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

Add support for annual data in interpolator_mod #1389

Merged
merged 7 commits into from
Dec 14, 2023

Conversation

mlee03
Copy link
Contributor

@mlee03 mlee03 commented Oct 11, 2023

Description
In this PR,

  • All computation involving time has been changed to be in r8_kind precision
  • Support for annual data has been added. The original code works with the number of days passed since base_time. Thus, the number of years passed since the base_time is converted to number of days passed since the base_time.

Fixes #1343

How Has This Been Tested?
The unit tests pass on the AMDBox with Intel and GCC

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

@mlee03 mlee03 changed the title Draft: Add support for annual data in interpolator_mod Add support for annual data in interpolator_mod Oct 19, 2023
@mlee03 mlee03 marked this pull request as ready for review October 19, 2023 12:43
clim_type%time_slice(n) = set_date_julian (yr, mo, dy, &
hr, mn, sc)
else if ( (model_calendar == JULIAN .and. trim(adjustl(lowercase(file_calendar))) == 'noleap')) then
Noleap_time = set_time( INT((time_in(n)-real(INT(time_in(n)),r8_kind))*SECONDS_PER_DAY), &
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to also take into account fractional number of days (converted to seconds) when setting time for greater accuracy. The same is done for the case where the model calendar and the file calendar are the same (see above).

@@ -708,18 +711,14 @@ subroutine interpolator_end(clim_type)
deallocate(clim_type%r8_type%nmon_pyear)
end if
endif
if (allocated(clim_type%indexm)) deallocate(clim_type%indexm)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set of deallocation was specified twice in interpolator_end. Removed it to make FMS more perfect.


clim_type%r4_type%is_allocated=.false.
clim_type%r8_type%is_allocated=.false.

!! RSH mod
if( .not. (clim_type%TIME_FLAG .eq. LINEAR .and. &
if( .not.(clim_type%TIME_FLAG .eq. LINEAR .and. read_all_on_init) .and. &
(clim_type%TIME_FLAG.ne.NOTIME) ) then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extended the if statement to include clim_type%TIME_FLAG.ne.NOTIME. For the case where clim_type%TIME_FLAG=NOTIME, close_file is called in interpolator_init. There is no file to close here

@rem1776
Copy link
Contributor

rem1776 commented Dec 13, 2023

@mlee03 Could you push a commit to get the CI running? Either merging with main or pushing an empty commit should work.

It ran too long ago for me to restart it manually but I think the issue was probably unrelated.

@rem1776 rem1776 merged commit e2e79fc into NOAA-GFDL:main Dec 14, 2023
19 checks passed
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

Successfully merging this pull request may close these issues.

FMS Interpolator unable to handle annual emissions
2 participants