Particular format to write time in output log file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | time_in_seconds | Time to output |
Time as string in particlar format
function write_time(time_in_seconds) result(string)
!< Particular format to write time in output log file
implicit none
real(wp), intent(in) :: time_in_seconds
!< Time to output
character(len=64):: string
!< Time as string in particlar format
if(time_in_seconds>86400) then
write(string,'(f0.16,2x,A)') time_in_seconds/86400.,"days"
elseif(time_in_seconds>3600) then
write(string,'(f0.16,2x,A)') time_in_seconds/3600.,"Hr."
elseif(time_in_seconds>60) then
write(string,'(f0.16,2x,A)') time_in_seconds/60.,"Min."
elseif(time_in_seconds>0) then
write(string,'(f0.16,2x,A)') time_in_seconds,"Sec."
else
write(string,'(A)') "Not Valid"
end if
end function write_time