From 9676e9955e28395ed1f751e6aecc40a3194a3269 Mon Sep 17 00:00:00 2001 From: Steve Steenrod Date: Wed, 19 Jul 2023 10:01:30 -0400 Subject: [PATCH 1/2] fix for QQJK diag bug --- .../GmiChemistry/GmiUpdateChemistry_mod.F90 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/GMI_GridComp/GmiChemistry/GmiUpdateChemistry_mod.F90 b/GMI_GridComp/GmiChemistry/GmiUpdateChemistry_mod.F90 index daca641..0ff2bf4 100755 --- a/GMI_GridComp/GmiChemistry/GmiUpdateChemistry_mod.F90 +++ b/GMI_GridComp/GmiChemistry/GmiUpdateChemistry_mod.F90 @@ -55,7 +55,6 @@ subroutine updateChemistry ( savedVars, rootProc, do_ftiming, & ! implicit none -# include "gmi_sad_constants.h" # include "setkin_par.h" # include "gmi_AerDust_const.h" ! @@ -119,6 +118,7 @@ subroutine updateChemistry ( savedVars, rootProc, do_ftiming, & integer :: ix integer :: num_loops real*8 :: chemintv + type (t_GmiArrayBundle) :: tm1Conc(num_species) ! ! !REVISION HISTORY: ! Initial code. @@ -135,6 +135,14 @@ subroutine updateChemistry ( savedVars, rootProc, do_ftiming, & else num_loops = 1 end if +! +!... save initial concentration for calc of qqj/qqk diags + if (pr_qqjk .and. .not. do_qqjk_inchem) then + do ix = 1, num_species + allocate ( tm1Conc(ix)%pArray3D (i1:i2, ju1:j2, k1:k2) ) + tm1Conc(ix)%pArray3D(:,:,:) = concentration(ix)%pArray3D(:,:,:) + enddo + end if do ix = 1, num_loops call Update_Smv2chem (savedVars, chemintv, surfEmissForChem, & @@ -149,10 +157,13 @@ subroutine updateChemistry ( savedVars, rootProc, do_ftiming, & end do if (pr_qqjk .and. .not. do_qqjk_inchem) then - call Accum_Qqjk (do_qqjk_reset, imgas_num, concentration, & + call Accum_Qqjk (do_qqjk_reset, imgas_num, tm1Conc, & qjgmi, qkgmi, qqjgmi, qqkgmi, num_molefrac, & num_species, num_qks, num_qjs, num_qjo, & pr_diag, loc_proc, ilong, i1, i2, ju1, j2, k1, k2) + do ix = 1, num_species + deallocate ( tm1Conc(ix)%pArray3D ) + enddo end if return From 95e7c994a4f60ac7acf72b98c783bb5b7ee89bd3 Mon Sep 17 00:00:00 2001 From: Steve Steenrod Date: Wed, 19 Jul 2023 12:14:10 -0400 Subject: [PATCH 2/2] fix for QQJK diag bug --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1105139..ca620e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- QQJK diag calc had bug, used time(t+dt) constituents ibstead of time(t) fields, fixed on 2023Jul19 + ### Added - Capability for AERO_PROVIDER=GOCART2G data-driven (GOCART.data)