Skip to content

Not possible to output interval-averaged diagnostics with a non-even-hour frequency >= 30 minutes #193

@spencerkclark

Description

@spencerkclark

This code in atmos_model.F90 -- which impacts the calculation of time_int, a key value used as the denominator in computing interval-averaged diagnostics -- will round the value of fhzero to the nearest integer before converting to units of seconds, if fhzero is at least 0.5:
https://github.com/VulcanClimateModeling/fv3gfs-fortran/blob/566e73209fde8b1ee0d073db2a7afa68ecc1d41a/FV3/atmos_model.F90#L955-L959
The value of time_int will therefore be incorrect if one uses a non-even-hour frequency greater than 30 minutes, e.g. 2.5 hours. For example you can end up with diagnostics that have an unusual cycle, starting with typically sized values which steadily decrease with time as time_int increases, before jumping back up to their typical values when time_int is reset.

sw-example

A fix for this would be to always use the approach in the else condition, i.e. to never truncate the value fhzero before converting it to have units of seconds. This way, time_int would always be reset at the expected time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions