Skip to content

Commit

Permalink
Merge pull request #568 from GEOS-ESM/hotfix/mathomp4/#563-leap-year-…
Browse files Browse the repository at this point in the history
…extrap-fix

Fixes #563. Fixes for Leap Year Extrapolation
  • Loading branch information
mathomp4 authored Oct 9, 2020
2 parents d42592b + 65cb858 commit c32de28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [2.3.2] - 2020-10-09

### Fixed

- Fixed a bug in ExtData when extrapolating on a Leap Day (#563)

### Added

- Added a deflate and bit shaving option to Regrid_Util.x
Expand Down
6 changes: 3 additions & 3 deletions base/MAPL_ExtDataGridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ subroutine UpdateBracketTime(item,cTime,bSide,interpTime,fileTime,file_processed
! Convert year offset to the future value
yrOffset = iYr - cYearOff
! Determine the template time
call ESMF_TimeSet(newTime,yy=iYr,mm=imm,dd=idd,h=ihr,m=imn,s=isc,__RC__)
call OffsetTimeYear(cTime,yrOffset,newTime,__RC__)
ftime = item%reff_time
n = 0
do while (.not.found)
Expand Down Expand Up @@ -2452,8 +2452,8 @@ subroutine UpdateBracketTime(item,cTime,bSide,interpTime,fileTime,file_processed
! yrOffset: Number of years added from current time to get file time
Do While ((.not.found).and.(abs(yrOffset).lt.maxOffset))
yrOffset = yrOffset - 1
iYr = refYear + yrOffset
call ESMF_TimeSet(newTime,yy=iyr,mm=imm,dd=idd,h=ihr,m=imn,s=isc,__RC__)
call OffsetTimeYear(cTime,yrOffset,newTime,__RC__)

! Error check - if the new time is before the first file time,
! all is lost
If (newTime.lt.xTSeries(1)) exit
Expand Down

0 comments on commit c32de28

Please sign in to comment.