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 to external IC ingest when the NetCDF global attribute is set to source_fv3gfs (GFS ICs) #93

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 16 additions & 6 deletions tools/external_ic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -659,18 +659,25 @@ subroutine get_nggps_ic (Atm, fv_domain)
graupel = get_tracer_index(MODEL_ATMOS, 'graupel')
ntclamt = get_tracer_index(MODEL_ATMOS, 'cld_amt')
if (trim(source) == source_fv3gfs) then
!--- The code here assumes:
! (a) that hydrostatic pressure (proportional to mass) is based on moist mass
! ie. dry air + water vapor
! (b) that tracers are tracer mass divided by total mass
! ie. moist mass + all condensates
! To the best of our understanding this is the convention in the GFS v15 and
! later analyses.
do k=1,npz
do j=js,je
do i=is,ie
wt = Atm%delp(i,j,k)
if ( Atm%flagstruct%nwat == 6 ) then
qt = wt/(1. - (Atm%q(i,j,k,liq_wat) + &
Atm%q(i,j,k,ice_wat) + &
Atm%q(i,j,k,rainwat) + &
Atm%q(i,j,k,snowwat) + &
Atm%q(i,j,k,graupel)))
qt = wt/(1. + (Atm%q(i,j,k,liq_wat) + &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code was correct, see attachment. I may have gotten confused as to which version this was.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lharris4 thanks for the review. I guess we need to reopen this with EMC. The dev/emc sync has the logic in external_ic::get_nggps_ic as it appears in this PR since that seemed to be the conclusion I thought we arrived at.

Atm%q(i,j,k,ice_wat) + &
Atm%q(i,j,k,rainwat) + &
Atm%q(i,j,k,snowwat) + &
Atm%q(i,j,k,graupel)))
else ! all other values of nwat
qt = wt/(1. - sum(Atm%q(i,j,k,2:Atm%flagstruct%nwat)))
qt = wt/(1. + sum(Atm%q(i,j,k,2:Atm%flagstruct%nwat)))
endif
Atm%delp(i,j,k) = qt
if (ntclamt > 0) Atm%q(i,j,k,ntclamt) = 0.0 ! Moorthi
Expand All @@ -681,6 +688,9 @@ subroutine get_nggps_ic (Atm, fv_domain)
else
!--- Add cloud condensate from GFS to total MASS
! 20160928: Adjust the mixing ratios consistently...
!--- The code here assumes that hydrostatic pressure (proportional to mass) and all
! tracers are based on moist mass, as was the case in the "Legacy" GFSv14 and
! earlier.
do k=1,npz
do j=js,je
do i=is,ie
Expand Down