Post-parse time-unit fixup shared by the file + string config
paths. t_end, status_interval, ocean_diag%dt_out are given
in time_unit from &time_nml; multiply through to SI seconds.
dt_fixed/dt_max stay in seconds; default time_unit="s"
gives a 1× factor (bit-identical to before).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(config_t), | intent(inout) | :: | cfg |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | time_factor |
subroutine apply_time_unit_cascade(cfg) !! Post-parse time-unit fixup shared by the file + string config !! paths. `t_end`, `status_interval`, `ocean_diag%dt_out` are given !! in `time_unit` from `&time_nml`; multiply through to SI seconds. !! `dt_fixed`/`dt_max` stay in seconds; default `time_unit="s"` !! gives a 1× factor (bit-identical to before). type(config_t), intent(inout) :: cfg real(wp) :: time_factor select case (trim(cfg%time_unit)) case ("s", "sec", "second", "seconds") time_factor = 1.0_wp case ("min", "minute", "minutes") time_factor = 60.0_wp case ("hr", "hour", "hours", "h") time_factor = 3600.0_wp case ("day", "days", "d") time_factor = 86400.0_wp case ("year", "years", "yr") ! Julian year (365.25 d) — matches MOM6 / UDUNITS. time_factor = 365.25_wp*86400.0_wp case default call logger%error("Invalid time_unit = '"//trim(cfg%time_unit)// & "': must be one of s/min/hr/day/year") time_factor = 1.0_wp ! fallthrough so validation reports it end select cfg%t_end = cfg%t_end*time_factor cfg%status_interval = cfg%status_interval*time_factor cfg%ocean%diag%dt_out = cfg%ocean%diag%dt_out*time_factor end subroutine apply_time_unit_cascade