Skip to content

Commit

Permalink
1)Add changes for handling either postive or nagative delz from FV3 o…
Browse files Browse the repository at this point in the history
…utput; 2)Use bilinear interpolation for land-sea mask(LAND) in pgrb2 files. (NOAA-EMC#7)
  • Loading branch information
WenMeng-NOAA committed Oct 6, 2019
1 parent 9871359 commit ba7e59b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
7 changes: 4 additions & 3 deletions sorc/ncep_post.fd/INITPOST_GFS_NEMS_MPIIO.f
Original file line number Diff line number Diff line change
Expand Up @@ -929,13 +929,14 @@ SUBROUTINE INITPOST_GFS_NEMS_MPIIO(iostatusAER)
call getrecn(recname,reclevtyp,reclev,nrec,varname,VcoordName,l,recn)
if(recn /= 0) then
fldst = (recn-1)*fldsize
! make sure delz is positive.
!$omp parallel do private(i,j,js)
do j=jsta,jend
js = fldst + (j-jsta)*im
do i=1,im
zint(i,j,ll)=zint(i,j,ll+1)+tmp(i+js)
zint(i,j,ll)=zint(i,j,ll+1)+abs(tmp(i+js))
if(recn_dpres /= -9999)pmid(i,j,ll)=rgas*dpres(i,j,ll)* &
t(i,j,ll)*(q(i,j,ll)*fv+1.0)/grav/tmp(i+js)
t(i,j,ll)*(q(i,j,ll)*fv+1.0)/grav/abs(tmp(i+js))
enddo
enddo
if(debugprint)print*,'sample l ',VarName,' = ',ll, &
Expand All @@ -945,7 +946,7 @@ SUBROUTINE INITPOST_GFS_NEMS_MPIIO(iostatusAER)
do j=jsta,jend
js = fldst + (j-jsta)*im
do i=1,im
omga(i,j,ll)=(-1.)*wh(i,j,ll)*dpres(i,j,ll)/tmp(i+js)
omga(i,j,ll)=(-1.)*wh(i,j,ll)*dpres(i,j,ll)/abs(tmp(i+js))
end do
end do
if(debugprint)print*,'sample l omga for FV3',ll, &
Expand Down
8 changes: 5 additions & 3 deletions sorc/ncep_post.fd/INITPOST_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -702,16 +702,17 @@ SUBROUTINE INITPOST_NETCDF(ncid3d)
cwm(i,j,l)=spval
! zint(i,j,l)=zint(i,j,l+1)+buf(i,j)
! if(abs(dpres(i,j,l))>1.0e5)print*,'bad dpres ',i,j,dpres(i,j,l)
!make sure delz is positive
if(dpres(i,j,l)/=spval .and. t(i,j,l)/=spval .and. &
q(i,j,l)/=spval .and. buf3d(i,j,l)/=spval)then
pmid(i,j,l)=rgas*dpres(i,j,l)* &
t(i,j,l)*(q(i,j,l)*fv+1.0)/grav/buf3d(i,j,l)
t(i,j,l)*(q(i,j,l)*fv+1.0)/grav/abs(buf3d(i,j,l))
else
pmid(i,j,l)=spval
end if
! dong add missing value
if (wh(i,j,l) < spval) then
omga(i,j,l)=(-1.)*wh(i,j,l)*dpres(i,j,l)/buf3d(i,j,l)
omga(i,j,l)=(-1.)*wh(i,j,l)*dpres(i,j,l)/abs(buf3d(i,j,l))
else
omga(i,j,l) = spval
end if
Expand Down Expand Up @@ -858,7 +859,8 @@ SUBROUTINE INITPOST_NETCDF(ncid3d)
do j=jsta,jend
do i=1,im
if(zint(i,j,l+1)/=spval .and. buf3d(i,j,l)/=spval)then
zint(i,j,l)=zint(i,j,l+1)+buf3d(i,j,l)
!make sure delz is positive
zint(i,j,l)=zint(i,j,l+1)+abs(buf3d(i,j,l))
! if(zint(i,j,l)>1.0E6)print*,'bad H ',i,j,l,zint(i,j,l)
else
zint(i,j,l)=spval
Expand Down
4 changes: 3 additions & 1 deletion ush/fv3gfs_downstream_nems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ set -x
#-Wen Meng, January 2018, add flag PGB1F for turning on/ogg grib1 pgb data at 1.00 deg. generation.
#-Wen Meng, Feburary 2018
# 1. Add flag PGBS for turning on/off pgb data at 1.0 and 0.5 deg. generation frequency of FHOUT_PGB defined.
#-Wen Meng, October
# 1. Use bilinear interpolation for LAND. It can trancate land-sea mask as 1 or 0.
#-----------------------------------------------------------------------


Expand All @@ -47,7 +49,7 @@ export PGBS=${PGBS:-"NO"} #YES-- generate 1.00 and 0.50 deg pgb data
#--wgrib2 regrid parameters
export option1=' -set_grib_type same -new_grid_winds earth '
export option21=' -new_grid_interpolation bilinear -if '
export option22=":(LAND|CRAIN|CICEP|CFRZR|CSNOW|ICSEV):"
export option22=":(CRAIN|CICEP|CFRZR|CSNOW|ICSEV):"
export option23=' -new_grid_interpolation neighbor -fi '
export option24=' -set_bitmap 1 -set_grib_max_bits 16 -if '
export option25=":(APCP|ACPCP|PRATE|CPRAT):"
Expand Down
3 changes: 2 additions & 1 deletion ush/fv3gfs_dwn_nems.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -x
# Wen Meng 12/2017: add trim_rh.sh for triming RH values larger than 100.
# Wen Meng 01/2018: add flag PGB1F for turning on/off wgrib1 pgb data at 1.00 deg. generation.
# Wen Meng 02/2018: add flag PGBS for turning on/off pgb data at 1.0 and 0.5 deg. generation.
# Wen Meng 10/2019: Use bilinear interpolation for LAND, It can trancate land-sea mask as 0 or 1.

export tmpfile=$1
export fhr3=$2
Expand All @@ -22,7 +23,7 @@ export TRIMRH=${TRIMRH:-$USHgfs/trim_rh.sh}

export opt1=' -set_grib_type same -new_grid_winds earth '
export opt21=' -new_grid_interpolation bilinear -if '
export opt22=":(LAND|CSNOW|CRAIN|CFRZR|CICEP|ICSEV):"
export opt22=":(CSNOW|CRAIN|CFRZR|CICEP|ICSEV):"
export opt23=' -new_grid_interpolation neighbor -fi '
export opt24=' -set_bitmap 1 -set_grib_max_bits 16 -if '
export opt25=":(APCP|ACPCP|PRATE|CPRAT):"
Expand Down

0 comments on commit ba7e59b

Please sign in to comment.