FMS  2024.01.00
Flexible Modeling System
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. More...
 
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. More...
 
real function, public get_date_dif (t2, t1, units)
 Return the difference between two times in units. More...
 
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. More...
 

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 fms_diag_time_utils_mod::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 65 of file fms_diag_time_utils.F90.

◆ diag_forecast_time_inc()

type(time_type) function fms_diag_time_utils_mod::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 125 of file fms_diag_time_utils.F90.

◆ get_date_dif()

real function, public fms_diag_time_utils_mod::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 355 of file fms_diag_time_utils.F90.

◆ get_time_string()

character(len=128) function, public fms_diag_time_utils_mod::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 214 of file fms_diag_time_utils.F90.