From 71e75ca3140e0498679bfece2edf5db7e58e2353 Mon Sep 17 00:00:00 2001 From: Weiyuan Jiang Date: Mon, 5 May 2025 11:42:17 -0400 Subject: [PATCH 1/2] set hsurf according to the index range --- CHANGELOG.md | 1 + Process_Library/GOCART2G_Process.F90 | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c45b15f..f284be23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- set hsurf to be the last indexed layer when index domains are different - fixed a bug that avoids dividing nSubsteps = 0 ### Added diff --git a/Process_Library/GOCART2G_Process.F90 b/Process_Library/GOCART2G_Process.F90 index 35ef7223..15c927e2 100644 --- a/Process_Library/GOCART2G_Process.F90 +++ b/Process_Library/GOCART2G_Process.F90 @@ -1517,7 +1517,8 @@ subroutine Chem_SettlingSimple ( km, klid, mie, bin, cdt, grav, & ONE_OVER_G = 1.0/grav - hsurf => hghte(i1:i2,j1:j2,km) + dk = ubound(hghte,3) + hsurf => hghte(i1:i2,j1:j2,dk) allocate(dz(i2,j2,km), radius(i2,j2,km), rhop(i2,j2,km), vsettle(i2,j2,km), qa(i2,j2,km), source=0.0) allocate(cmass_before(i2,j2), cmass_after(i2,j2), source=0.0_DP) @@ -1691,7 +1692,8 @@ subroutine Chem_Settling ( km, klid, bin, flag, cdt, grav, & ONE_OVER_G = 1.0/grav - hsurf => hghte(i1:i2,j1:j2,km) + dk = ubound(hghte,3) + hsurf => hghte(i1:i2,j1:j2, dk) allocate(dz(i2,j2,km), radius(i2,j2,km), rhop(i2,j2,km), vsettle(i2,j2,km), qa(i2,j2,km), source=0.0) allocate(cmass_before(i2,j2), cmass_after(i2,j2), source=0.0_DP) @@ -2316,7 +2318,8 @@ subroutine Chem_Settling2Gorig (km, klid, flag, bin, int_qa, grav, delp, & gravDP = grav - hsurf => hghte(i1:i2,j1:j2,km) + dk = ubound(hghte,3) + hsurf => hghte(i1:i2,j1:j2, dk) ! Allocate arrays ! --------------- @@ -2659,7 +2662,8 @@ subroutine Chem_SettlingSimpleOrig ( km, klid, flag, grav, cdt, radiusInp, rhopI i2 = ubound(hghte,1) j2 = ubound(hghte,2) - hsurf => hghte(i1:i2,j1:j2,km) + dk = ubound(hghte,3) + hsurf => hghte(i1:i2,j1:j2, dk) ! Allocate arrays ! --------------- @@ -6401,7 +6405,8 @@ subroutine SulfateDistributeEmissions ( km, nbins, cdt, grav, nymd, nhms, & i2 = size(rhoa,1) j2 = size(rhoa,2) allocate(hsurf(i1:i2,j1:j2)) - hsurf = hghte(i1:i2,j1:j2,km) + k = ubound(hghte,3) + hsurf = hghte(i1:i2,j1:j2,k) allocate(srcSO2(i2,j2), srcSO4(i2,j2), srcDMS(i2,j2), srcSO4anthro(i2,j2), & srcSO2anthro(i2,j2), srcSO2bioburn(i2,j2), source=0.0) From b553a100f2dc50b02bd63e1172ee5f61dca7e4b5 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 28 May 2025 14:59:41 -0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49e0ed20..04e4105d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- set hsurf to be the last indexed layer when index domains are different + ### Added ## [v2.4.1] - 2025-05-28 @@ -36,7 +38,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- set hsurf to be the last indexed layer when index domains are different - fixed a bug that avoids dividing nSubsteps = 0 ### Added