Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for QQJK diag bug #9

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 13 additions & 2 deletions GMI_GridComp/GmiChemistry/GmiUpdateChemistry_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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"
!
Expand Down Expand Up @@ -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.
Expand All @@ -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, &
Expand All @@ -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
Expand Down