Skip to content

Commit

Permalink
Backport bugfixes to 2.35
Browse files Browse the repository at this point in the history
This release backports fixes for ExtData2G handling of climatologies
in weird circumstances and a fix for HISTORY handling of 1-bin
output from GOCART.
  • Loading branch information
mathomp4 committed Jul 10, 2023
1 parent c271ace commit 982dc34
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.35.4] - 2023-07-11

### Fixed

- Added bug fix when using climatology option in ExtData2G under certain scenarios (see [#2192](https://github.com/GEOS-ESM/MAPL/issues/2192) for more information)
- Fixed logic in generating the names of the split fields. If the alias field in the History.rc has separators (;), each substring is used to name the resulting fields. If there are no separators, this will be the exact name of the first split field

## [2.35.3] - 2023-03-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_policy (SET CMP0054 NEW)

project (
MAPL
VERSION 2.35.3
VERSION 2.35.4
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the default build type to release
Expand Down
1 change: 0 additions & 1 deletion base/Base/Base_Base_implementation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3924,7 +3924,6 @@ subroutine genAlias(name, n, splitNameArray, aliasName, rc)
deallocate(tmp)
! if the user did no supply enough separated alias field names,
! append 00i to the original field name
if (n==1) nn=0
do i=nn+1,n
write(splitNameArray(i),'(A,I3.3)') trim(name), i
end do
Expand Down
17 changes: 9 additions & 8 deletions gridcomps/ExtData2G/ExtDataClimFileHandler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module MAPL_ExtdataClimFileHandler
use MAPL_StringTemplate
use MAPL_ExtDataBracket
use MAPL_ExtDataConstants
use MAPL_CommsMod
implicit none
private
public ExtDataClimFileHandler
Expand Down Expand Up @@ -59,10 +60,10 @@ subroutine get_file_bracket(this, input_time, source_time, bracket, fail_on_miss
allocate(source_years(2))
call ESMF_TimeGet(source_time(1),yy=source_years(1),_RC)
call ESMF_TimeGet(source_time(2),yy=source_years(2),_RC)
_ASSERT(source_years(1) >= valid_years(1),'source time outide valid range')
_ASSERT(source_years(1) <= valid_years(2),'source time outide valid range')
_ASSERT(source_years(2) >= valid_years(1),'source time outide valid range')
_ASSERT(source_years(2) <= valid_years(2),'source time outide valid range')
_ASSERT(source_time(1) >= this%valid_range(1),'source time outside valid range')
_ASSERT(source_time(1) <= this%valid_range(2),'source time outside valid range')
_ASSERT(source_time(2) >= this%valid_range(1),'source time outside valid range')
_ASSERT(source_time(2) <= this%valid_range(2),'source time outside valid range')
end if

! shift target year to request source time if specified
Expand All @@ -72,20 +73,20 @@ subroutine get_file_bracket(this, input_time, source_time, bracket, fail_on_miss

!if (size(source_years)>0) then
if (allocated(source_years)) then
if (target_year < source_years(1)) then
if (input_time < source_time(1)) then
target_year = source_years(1)
this%clim_year = target_year
else if (target_year >= source_years(2)) then
else if (input_time >= source_time(2)) then
target_year = source_years(2)
this%clim_year = target_year
end if
call swap_year(target_time,target_year,_RC)
else
if (target_year < valid_years(1)) then
if (input_time <= this%valid_range(1)) then
target_year = valid_years(1)
this%clim_year = target_year
call swap_year(target_time,target_year,_RC)
else if (target_year >= valid_years(2)) then
else if (input_time >= this%valid_range(2)) then
target_year = valid_years(2)
this%clim_year = target_year
call swap_year(target_time,target_year,_RC)
Expand Down

0 comments on commit 982dc34

Please sign in to comment.