Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar attribute in outputs should be proleptic_gregorian #387

Open
aidanheerdegen opened this issue Jun 25, 2024 · 0 comments
Open

Calendar attribute in outputs should be proleptic_gregorian #387

aidanheerdegen opened this issue Jun 25, 2024 · 0 comments

Comments

@aidanheerdegen
Copy link
Contributor

The gregorian calendar option for MOM5 implements a proleptic_gregorian calendar

function leap_year_gregorian_int(year)
logical :: leap_year_gregorian_int
integer, intent(in) :: year
leap_year_gregorian_int = mod(year,4) == 0
leap_year_gregorian_int = leap_year_gregorian_int .and. .not.mod(year,100) == 0
leap_year_gregorian_int = leap_year_gregorian_int .or. mod(year,400) == 0
end function leap_year_gregorian_int

whereas the CF conventions state that a gregorian calendar attribute is mixed Julian/Gregorian, and a proleptic Gregorian must have the attribute proleptic_gregorian.

https://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/build/ch04s04.html

Original issue is here: COSIMA/access-om2#117

A simple fix would be to change this line

https://github.com/mom-ocean/FMS/blob/3bd24800ed3cd8b0eb26643afdecf88e10641beb/time_manager/time_manager.F90#L1564

to

valid_calendar_types = 'PROLEPTIC_GREGORIAN'

as this is the function that is called when the time attributes are written:

https://github.com/ACCESS-NRI/MOM5/blob/baaf7ed1baf4543bc821d97402a94792b4044ac4/src/shared/diag_manager/diag_output.F90#L353-L355

Which results in a netCDF variable definition like so:

        double time(time) ;
                time:long_name = "time" ;
                time:units = "days since 0001-01-01 00:00:00" ;
                time:cartesian_axis = "T" ;
                time:calendar_type = "GREGORIAN" ;
                time:calendar = "GREGORIAN" ;
                time:bounds = "time_bounds" ;

Note that this line appears in the MOM5 source here due to FMS being included as a subtree:

valid_calendar_types = 'GREGORIAN '

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant