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

Change get_average_days_per_year to use ESMF_CalendarGet #1624

Open
billsacks opened this issue Feb 1, 2022 · 0 comments
Open

Change get_average_days_per_year to use ESMF_CalendarGet #1624

billsacks opened this issue Feb 1, 2022 · 0 comments
Labels
blocked: dependency Wait to work on this until dependency is resolved enhancement new capability or improved behavior of existing capability

Comments

@billsacks
Copy link
Member

In an upcoming tag, I'm going to introduce a new function in clm_time_manager, get_average_days_per_year (see also #1612 ). Ideally, this would use the ESMF_CalendarGet subroutine, returning daysPerYear + real(daysPerYrDn, r8)/real(daysPerYrDd, r8). However, I currently cannot use that subroutine for two reasons:

(1) We don't use the real ESMF library in all builds, and the ESMF WRF time manager that we use in other situations doesn't support ESMF_CalendarGet.

(2) It appears that there is a bug in ESMF_CalendarGet for Gregorian calendars: it returns information appropriate for a noleap calendar, not for a Gregorian calendar.

Thus, we need to wait until both (1) we can rely on using the real ESMF library in all builds, and (2) the above ESMF bug is resolved and we can rely on users having a version of the ESMF library with this bug fix included. I am therefore marking this issue as "blocked", even though we don't have specific issues that block it.

Once we can rely on the above, we should change the implementation of get_average_days_per_year as noted above.

We should also introduce unit tests of this function for both a NOLEAP and a GREGORIAN calendar.

However, before we add these unit tests, we will need to change the unit test build to use the real esmf library instead of the esmf wrf time manager. This will involve getting rid of stuff in the top-level CMakeLists.txt that refers to the esmf wrf time manager, and adding the appropriate includes and links for the esmf library.

@billsacks billsacks added enhancement new capability or improved behavior of existing capability blocked: dependency Wait to work on this until dependency is resolved labels Feb 1, 2022
billsacks added a commit to billsacks/ctsm that referenced this issue Feb 1, 2022
For now, use hard-coded parameters (see ESCOMP#1624).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: dependency Wait to work on this until dependency is resolved enhancement new capability or improved behavior of existing capability
Projects
None yet
Development

No branches or pull requests

1 participant