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 GCHPctmEnv small numerical bugs #456

Open
wants to merge 4 commits into
base: dev/no-diff-to-benchmark
Choose a base branch
from
Open
Changes from 2 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
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 follwing GEOS-Chem convetion
yuanjianz marked this conversation as resolved.
Show resolved Hide resolved
! Add negative sign to make positive = "up"
UpwardsMassFlux(:,:,:) = -UpwardsMassFlux(:,:,LM:0:-1)/dt
end if

! nullify pointers
Expand Down