FMS 2025.01-dev
Flexible Modeling System
Loading...
Searching...
No Matches
fms_diag_time_utils_mod

fms_diag_time_utils contains functions and subroutines necessary for the diag_manager_mod related to time handling. More...

Functions/Subroutines

type(time_type) function diag_clock_time_inc (time, output_freq, output_units, err_msg)
 Determine the next time data/file is to be written based on the frequency and units using the clock. For example, if doing daily averages and the input time is day1_hour3, the output time will be day2_hour0.
 
type(time_type) function diag_forecast_time_inc (time, output_freq, output_units, err_msg)
 Determine the next time data/file is to be written based on the frequency and units using forecast time. For example, if doing daily averages and the input time is day1_hour3, the output time will be day2_hour3.
 
real function, public get_date_dif (t2, t1, units)
 Return the difference between two times in units.
 
character(len=128) function, public get_time_string (filename, current_time)
 This function determines a string based on current time. This string is used as suffix in output file name.
 
subroutine, public set_time_type (time_int, time)
 Sets up a time_type based on 6 member array of integers defining the [year month day hour min sec].
 

Detailed Description

fms_diag_time_utils contains functions and subroutines necessary for the diag_manager_mod related to time handling.

Author
Uriel Ramirez

Function/Subroutine Documentation

◆ diag_clock_time_inc()

type(time_type) function diag_clock_time_inc ( type(time_type), intent(in)  time,
integer, intent(in)  output_freq,
integer, intent(in)  output_units,
character(len=*), intent(out), optional  err_msg 
)
private

Determine the next time data/file is to be written based on the frequency and units using the clock. For example, if doing daily averages and the input time is day1_hour3, the output time will be day2_hour0.

Returns
the next time data/file is to be written
Parameters
[in]timeCurrent model time.
[in]output_freqOutput frequency number value.
[in]output_unitsOutput frequency unit.
[out]err_msgFunction error message. An empty string indicates the next output time was found successfully.

Definition at line 66 of file fms_diag_time_utils.F90.

◆ diag_forecast_time_inc()

type(time_type) function diag_forecast_time_inc ( type(time_type), intent(in)  time,
integer, intent(in)  output_freq,
integer, intent(in)  output_units,
character(len=*), intent(out), optional  err_msg 
)
private

Determine the next time data/file is to be written based on the frequency and units using forecast time. For example, if doing daily averages and the input time is day1_hour3, the output time will be day2_hour3.

Returns
the next time data/file is to be written
Parameters
[in]timeCurrent model time.
[in]output_freqOutput frequency number value.
[in]output_unitsOutput frequency unit.
[out]err_msgFunction error message. An empty string indicates the next output time was found successfully.

Definition at line 126 of file fms_diag_time_utils.F90.

◆ get_date_dif()

real function, public get_date_dif ( type(time_type), intent(in)  t2,
type(time_type), intent(in)  t1,
integer, intent(in)  units 
)

Return the difference between two times in units.

Returns
Real get_data_dif
Parameters
[in]t2Most recent time.
[in]t1Most distant time.
[in]unitsUnit of return value.

Definition at line 356 of file fms_diag_time_utils.F90.

◆ get_time_string()

character(len=128) function, public get_time_string ( character(len=*), intent(in)  filename,
type(time_type), intent(in)  current_time 
)

This function determines a string based on current time. This string is used as suffix in output file name.

Returns
Character(len=128) get_time_string
Parameters
[in]filenameFile name.
[in]current_timeCurrent model time.

Definition at line 215 of file fms_diag_time_utils.F90.

◆ set_time_type()

subroutine, public set_time_type ( integer, dimension(6), intent(in)  time_int,
type(time_type), intent(inout)  time 
)

Sets up a time_type based on 6 member array of integers defining the [year month day hour min sec].

Parameters
[in]time_intThe time in the format [year month day hour min second]
[in,out]timeThe time converted to the time_type

Definition at line 390 of file fms_diag_time_utils.F90.