Skip to content

Commit

Permalink
Merge pull request #456 from yuanjianz/bugfix/gchp-advection-small-nu…
Browse files Browse the repository at this point in the history
…merical-bugs

Fix GCHPctmEnv small numerical bugs
  • Loading branch information
lizziel authored Dec 5, 2024
2 parents 6a6038a + 2641547 commit afd03c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- Added code to `src/CMakeLists.txt` to build & install the KPP standalone executable when `fullchem` or `custom` mechanisms are selected

### Fixed
- Fixed dry mass flux derivation in GCHPctmEnv when using mass flux imports
- Fixed UpwardsMassFlux sign to make positive represent upwards direction

## [14.5.0] - 2024-11-08
### Added
- Added documentation about GEOS convection change affecting meteorology starting June 1, 2020
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,15 @@ subroutine prepare_massflux_exports(IMPORT, EXPORT, PLE, dt, RC)
call MAPL_GetPointer(IMPORT, temp3d_r4, 'MFXC', RC=STATUS)
_VERIFY(STATUS)
if ( correct_mass_flux_for_humidity > 0 ) then
MFX_EXPORT = dble(temp3d_r4) / ( 1.d0 - SPHU0_EXPORT )
MFX_EXPORT = dble(temp3d_r4) * ( 1.d0 - SPHU0_EXPORT )
else
MFX_EXPORT = dble(temp3d_r4)
endif

call MAPL_GetPointer(IMPORT, temp3d_r4, 'MFYC', RC=STATUS)
_VERIFY(STATUS)
if ( correct_mass_flux_for_humidity > 0 ) then
MFY_EXPORT = dble(temp3d_r4) / ( 1.d0 - SPHU0_EXPORT )
MFY_EXPORT = dble(temp3d_r4) * ( 1.d0 - SPHU0_EXPORT )
else
MFY_EXPORT = dble(temp3d_r4)
endif
Expand Down Expand Up @@ -953,8 +953,9 @@ subroutine prepare_massflux_exports(IMPORT, EXPORT, PLE, dt, RC)
! Get vertical mass flux
call fv_getVerticalMassFlux(MFX_EXPORT, MFY_EXPORT, UpwardsMassFlux, dt)

! Flip vertical so that GCHP diagnostic is positive="up"
UpwardsMassFlux(:,:,:) = UpwardsMassFlux(:,:,LM:0:-1)/dt
! Flip vertical so that GCHP diagnostic level is following GEOS-Chem convention
! Add negative sign to make positive = "up"
UpwardsMassFlux(:,:,:) = -UpwardsMassFlux(:,:,LM:0:-1)/dt
end if

! nullify pointers
Expand Down

0 comments on commit afd03c1

Please sign in to comment.