write_time Function

private function write_time(time_in_seconds) result(string)

Particular format to write time in output log file

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: time_in_seconds

Time to output

Return Value character(len=64)

Time as string in particlar format


Called by

proc~~write_time~~CalledByGraph proc~write_time write_time proc~destroy_time destroy_time proc~destroy_time->proc~write_time proc~destroy_solver destroy_solver proc~destroy_solver->proc~destroy_time proc~finish_run finish_run proc~finish_run->proc~destroy_solver program~main main program~main->proc~finish_run proc~abort_run abort_run proc~abort_run->proc~finish_run

Contents

Source Code


Source Code

        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