From 982dc34fa568a5637d2ef83e749798b29cfe746f Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 10 Jul 2023 14:28:35 -0400 Subject: [PATCH] Backport bugfixes to 2.35 This release backports fixes for ExtData2G handling of climatologies in weird circumstances and a fix for HISTORY handling of 1-bin output from GOCART. --- CHANGELOG.md | 7 +++++++ CMakeLists.txt | 2 +- base/Base/Base_Base_implementation.F90 | 1 - gridcomps/ExtData2G/ExtDataClimFileHandler.F90 | 17 +++++++++-------- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a5158286872..3ed000a48219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 436b84ff8161..e9bf42ba68de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/base/Base/Base_Base_implementation.F90 b/base/Base/Base_Base_implementation.F90 index ba3da7a2f233..c4225c9e3e8b 100644 --- a/base/Base/Base_Base_implementation.F90 +++ b/base/Base/Base_Base_implementation.F90 @@ -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 diff --git a/gridcomps/ExtData2G/ExtDataClimFileHandler.F90 b/gridcomps/ExtData2G/ExtDataClimFileHandler.F90 index d6121adade33..8b012d3e5e4f 100644 --- a/gridcomps/ExtData2G/ExtDataClimFileHandler.F90 +++ b/gridcomps/ExtData2G/ExtDataClimFileHandler.F90 @@ -13,6 +13,7 @@ module MAPL_ExtdataClimFileHandler use MAPL_StringTemplate use MAPL_ExtDataBracket use MAPL_ExtDataConstants + use MAPL_CommsMod implicit none private public ExtDataClimFileHandler @@ -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 @@ -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)