public pure function tem_time_default_zero(time, dependency) result(zeroed)
Function to find a default for time, if it is not defined already.
Depending on dependency set the value in time to a zero time,
if it is set to never.
This is useful to find a suitable minimum, where an interval is
defined in the timeControl, but no minimum.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
pure function tem_time_default_zero(time,dependency)result(zeroed)! -------------------------------------------------------------------- !!> The time to find a default 0 for, if not define, but dependency is.type(tem_time_type),intent(in)::time!> A time definition where we set a 0 default in time for, if the!! corresponding component is defined, but the time component is!! not.type(tem_time_type),intent(in)::dependency!> Resulting time, with zeroed components where dependency is defined,!! but time not.type(tem_time_type)::zeroed! -------------------------------------------------------------------- !zeroed=timeif(.not.time%sim<huge(time%sim))then! Time set to never.if(dependency%sim<huge(dependency%sim))then! But dependency not!zeroed%sim=0.0_rkend if end if if(.not.time%iter<huge(time%iter))then! Time set to never.if(dependency%iter<huge(dependency%iter))then! But dependency not!zeroed%iter=0end if end if if(.not.time%clock<huge(time%clock))then! Time set to never.if(dependency%clock<huge(dependency%clock))then! But dependency not!zeroed%clock=0.0_rkend if end if end function tem_time_default_zero