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

read and output total aod, dust, SS, SU, OC, and BC aod to grib2 pass regression test at Hera and DELL #263

Merged
merged 9 commits into from
Mar 2, 2021
4 changes: 2 additions & 2 deletions scripts/exgdas_atmos_nceppost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ then
# produce flux file, the default will be /nwprod/parm/gfs_cntrl.parm

if [ $GRIBVERSION = 'grib2' ]; then
export POSTGRB2TBL=${POSTGRB2TBL:-${G2TMPL_SRC}/params_grib2_tbl_new}
export POSTGRB2TBL=${POSTGRB2TBL:-${g2tmpl_ROOT}/share/params_grib2_tbl_new}
export PostFlatFile=${PostFlatFile:-$PARMpost/postxconfig-NT-GFS-ANL.txt}
export CTLFILE=$PARMpost/postcntrl_gfs_anl.xml
fi
Expand Down Expand Up @@ -252,7 +252,7 @@ do
export OUTTYP=${OUTTYP:-4}

if [ $GRIBVERSION = 'grib2' ] ; then
export POSTGRB2TBL=${POSTGRB2TBL:-${G2TMPL_SRC}/params_grib2_tbl_new}
export POSTGRB2TBL=${POSTGRB2TBL:-${g2tmpl_ROOT}/share/params_grib2_tbl_new}
export PostFlatFile=$PARMpost/postxconfig-NT-GFS.txt
if [ $RUN = gfs ] ; then
export IGEN=$IGEN_GFS
Expand Down
4 changes: 2 additions & 2 deletions scripts/exgfs_atmos_nceppost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ then
# produce flux file, the default will be /nwprod/parm/gfs_cntrl.parm
if [ $GRIBVERSION = 'grib2' ]; then
# use grib2 nomonic table in product g2tmpl directory as default
export POSTGRB2TBL=${POSTGRB2TBL:-${G2TMPL_SRC}/params_grib2_tbl_new}
export POSTGRB2TBL=${POSTGRB2TBL:-${g2tmpl_ROOT}/share/params_grib2_tbl_new}
export PostFlatFile=${PostFlatFile:-$PARMpost/postxconfig-NT-GFS-ANL.txt}
export CTLFILE=$PARMpost/postcntrl_gfs_anl.xml
fi
Expand Down Expand Up @@ -299,7 +299,7 @@ do
export GFSOUT=${PREFIX}gfsio${fhr}

if [ $GRIBVERSION = 'grib2' ]; then
export POSTGRB2TBL=${POSTGRB2TBL:-${G2TMPL_SRC}/params_grib2_tbl_new}
export POSTGRB2TBL=${POSTGRB2TBL:-${g2tmpl_ROOT}/share/params_grib2_tbl_new}
export PostFlatFile=${PostFlatFile:-$PARMpost/postxconfig-NT-GFS.txt}

if [ $RUN = gfs ] ; then
Expand Down
6 changes: 6 additions & 0 deletions sorc/ncep_post.fd/ALLOCATE_ALL.f
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@ SUBROUTINE ALLOCATE_ALL()
allocate(avgetrans(im,jsta_2l:jend_2u))
allocate(avgesnow(im,jsta_2l:jend_2u))
allocate(avgpotevp(im,jsta_2l:jend_2u))
allocate(aod550(im,jsta_2l:jend_2u))
allocate(du_aod550(im,jsta_2l:jend_2u))
allocate(ss_aod550(im,jsta_2l:jend_2u))
allocate(su_aod550(im,jsta_2l:jend_2u))
allocate(oc_aod550(im,jsta_2l:jend_2u))
allocate(bc_aod550(im,jsta_2l:jend_2u))
!
! FROM MASKS
!
Expand Down
93 changes: 91 additions & 2 deletions sorc/ncep_post.fd/CLDRAD.f
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
!! 20-03-25 Jesse Meng - remove grib1
!! 20-05-20 Jesse Meng - CALRH unification with NAM scheme
!! 20-11-10 Jesse Meng - USE UPP_PHYSICS MODULE
!! 21-02-08 Anning Cheng, read aod550, aod550_du/su/ss/oc/bc
!! directly from fv3gfs and output to grib2 by setting rdaod
!!
!! USAGE: CALL CLDRAD
!! INPUT ARGUMENT LIST:
Expand Down Expand Up @@ -114,7 +116,8 @@ SUBROUTINE CLDRAD
SWDDIFC, SWUPBC, LWDNBC, LWUPBC, SWUPT, &
TAOD5502D, AERSSA2D, AERASY2D, MEAN_FRP, LWP, IWP, &
AVGCPRATE, &
DUSTCB,SSCB,BCCB,OCCB,SULFCB,DUSTPM,SSPM
DUSTCB,SSCB,BCCB,OCCB,SULFCB,DUSTPM,SSPM,aod550, &
du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550
use masks, only: LMH, HTM
use params_mod, only: TFRZ, D00, H99999, QCLDMIN, SMALL, D608, H1, ROG, &
GI, RD, QCONV, ABSCOEFI, ABSCOEF, STBOL, PQ0, A2, &
Expand All @@ -123,7 +126,7 @@ SUBROUTINE CLDRAD
FLD_INFO, AVRAIN, THEAT, IFHR, IFMIN, AVCNVC, &
TCLOD, ARDSW, TRDSW, ARDLW, NBIN_DU, TRDLW, IM, &
NBIN_SS, NBIN_OC, NBIN_BC, NBIN_SU, DTQ2, &
JM, LM, gocart_on, me
JM, LM, gocart_on, me, rdaod
use rqstfld_mod, only: IGET, ID, LVLS, IAVBLFLD
use gridspec_mod, only: dyval, gridtype
use cmassi_mod, only: TRAD_ice
Expand Down Expand Up @@ -4330,6 +4333,88 @@ SUBROUTINE CLDRAD
endif
ENDIF

!2D AEROSOL OPTICAL DEPTH AT 550 NM
IF(rdaod) then
IF (IGET(609).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(609))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF

IF (IGET(610).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=du_aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(610))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF

IF (IGET(611).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=ss_aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(611))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF

IF (IGET(612).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=su_aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(612))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF

IF (IGET(613).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=oc_aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(613))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF


IF (IGET(614).GT.0) THEN
DO J=JSTA,JEND
DO I=1,IM
grid1(i,j)=bc_aod550(i,j)
ENDDO
ENDDO
if(grib=="grib2" )then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(614))
datapd(1:im,1:jend-jsta+1,cfld)=GRID1(1:im,jsta:jend)
endif
ENDIF
END IF !rdaod

!2D AEROSOL OPTICAL DEPTH AT 550 NM
IF (IGET(715)>0) THEN
DO J=JSTA,JEND
Expand Down Expand Up @@ -4402,6 +4487,10 @@ SUBROUTINE CLDRAD
DO I = 690, 698 ! TOTAL AND SPECIATED AEROSOL
IF ( IGET(I)>0 ) LAERSMASS = .TRUE.
ENDDO
IF ( rdaod ) THEN
LAEROPT = .FALSE.
LAERSMASS = .FALSE.
END IF

IF ( LAEROPT ) THEN
PRINT *, 'COMPUTE AEROSOL OPTICAL PROPERTIES'
Expand Down
2 changes: 1 addition & 1 deletion sorc/ncep_post.fd/CTLBLK.f
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module CTLBLK_mod
real*8 :: gdsdegr
real,allocatable :: datapd(:,:,:)
!
logical :: gocart_on, d3d_on, hyb_sigp
logical :: gocart_on, d3d_on, hyb_sigp, rdaod
logical :: SIGMA,RUN,FIRST,RESTRT
logical :: global
logical :: SMFLAG
Expand Down
5 changes: 5 additions & 0 deletions sorc/ncep_post.fd/DEALLOCATE.f
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ SUBROUTINE DE_ALLOCATE
deallocate(avgesnow)
deallocate(avgpotevp)
deallocate(ti)
deallocate(du_aod550)
deallocate(ss_aod550)
deallocate(su_aod550)
deallocate(bc_aod550)
deallocate(oc_aod550)
! GSD
deallocate(rainc_bucket)
deallocate(rainc_bucket1)
Expand Down
32 changes: 30 additions & 2 deletions sorc/ncep_post.fd/INITPOST_GFS_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SUBROUTINE INITPOST_GFS_NETCDF(ncid3d)
avgedir,avgecan,avgetrans,avgesnow,avgprec_cont,avgcprate_cont,rel_vort_max, &
avisbeamswin,avisdiffswin,airbeamswin,airdiffswin,refdm10c_max,wspd10max, &
alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
ti
ti,aod550,du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550
use soil, only: sldpth, sh2o, smc, stc
use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
use physcons_post, only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
Expand All @@ -76,7 +76,7 @@ SUBROUTINE INITPOST_GFS_NETCDF(ncid3d)
jend_m, imin, imp_physics, dt, spval, pdtop, pt, qmin, nbin_du, nphs, dtq2, ardlw,&
ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameFlux, fileNameAER
nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameFlux, fileNameAER,rdaod
use gridspec_mod, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, &
latstartv, latlastv, cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r
Expand Down Expand Up @@ -2006,6 +2006,34 @@ SUBROUTINE INITPOST_GFS_NETCDF(ncid3d)
enddo
enddo

if(me==0)print*,'rdaod= ',rdaod
! inst aod550 optical depth
if(rdaod) then
VarName='aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,aod550)

VarName='du_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,du_aod550)

VarName='ss_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,ss_aod550)

VarName='su_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,su_aod550)

VarName='oc_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,oc_aod550)

VarName='bc_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,bc_aod550)
end if

! time averaged ground heat flux using nemsio
VarName='gflux_ave'
call read_netcdf_2d_scatter(me,ncid2d,1,im,jm,jsta,jsta_2l &
Expand Down
33 changes: 31 additions & 2 deletions sorc/ncep_post.fd/INITPOST_GFS_NETCDF_PARA.f
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SUBROUTINE INITPOST_GFS_NETCDF_PARA(ncid3d)
avgedir,avgecan,avgetrans,avgesnow,avgprec_cont,avgcprate_cont,rel_vort_max, &
avisbeamswin,avisdiffswin,airbeamswin,airdiffswin,refdm10c_max,wspd10max, &
alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
ti
ti,aod550,du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550
use soil, only: sldpth, sh2o, smc, stc
use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
use physcons_post, only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
Expand All @@ -76,7 +76,7 @@ SUBROUTINE INITPOST_GFS_NETCDF_PARA(ncid3d)
jend_m, imin, imp_physics, dt, spval, pdtop, pt, qmin, nbin_du, nphs, dtq2, ardlw,&
ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameFlux, fileNameAER
nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameFlux, fileNameAER,rdaod
use gridspec_mod, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, &
latstartv, latlastv, cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r
Expand Down Expand Up @@ -1748,6 +1748,35 @@ SUBROUTINE INITPOST_GFS_NETCDF_PARA(ncid3d)
enddo
enddo

if(me==0)print*,'rdaod= ',rdaod
! inst aod550 optical depth
if(rdaod) then
VarName='aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,aod550)

VarName='du_aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,du_aod550)

VarName='ss_aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,ss_aod550)

VarName='su_aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,su_aod550)

VarName='oc_aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,oc_aod550)

VarName='bc_aod550'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,bc_aod550)
endif !end if rdaod


! time averaged ground heat flux using nemsio
VarName='gflux_ave'
call read_netcdf_2d_para(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
Expand Down
32 changes: 30 additions & 2 deletions sorc/ncep_post.fd/INITPOST_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ SUBROUTINE INITPOST_NETCDF(ncid3d)
avgedir,avgecan,avgetrans,avgesnow,avgprec_cont,avgcprate_cont,rel_vort_max, &
avisbeamswin,avisdiffswin,airbeamswin,airdiffswin,refdm10c_max,wspd10max, &
alwoutc,alwtoac,aswoutc,aswtoac,alwinc,aswinc,avgpotevp,snoavg, &
ti
ti,aod550,du_aod550,ss_aod550,su_aod550,oc_aod550,bc_aod550
use soil, only: sldpth, sh2o, smc, stc
use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice
use physcons_post, only: grav => con_g, fv => con_fvirt, rgas => con_rd, &
Expand All @@ -77,7 +77,7 @@ SUBROUTINE INITPOST_NETCDF(ncid3d)
ardsw, asrfc, avrain, avcnvc, theat, gdsdegr, spl, lsm, alsl, im, jm, im_jm, lm, &
jsta_2l, jend_2u, nsoil, lp1, icu_physics, ivegsrc, novegtype, nbin_ss, nbin_bc, &
nbin_oc, nbin_su, gocart_on, pt_tbl, hyb_sigp, filenameFlux, fileNameAER, &
iSF_SURFACE_PHYSICS
iSF_SURFACE_PHYSICS,rdaod
use gridspec_mod, only: maptype, gridtype, latstart, latlast, lonstart, lonlast, cenlon, &
dxval, dyval, truelat2, truelat1, psmapf, cenlat,lonstartv, lonlastv, cenlonv, &
latstartv, latlastv, cenlatv,latstart_r,latlast_r,lonstart_r,lonlast_r, STANDLON
Expand Down Expand Up @@ -1935,6 +1935,34 @@ SUBROUTINE INITPOST_NETCDF(ncid3d)
enddo
enddo

if(me==0)print*,'rdaod= ',rdaod
! inst aod550 optical depth
if(rdaod) then
VarName='aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,aod550)

VarName='du_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,du_aod550)

VarName='ss_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,ss_aod550)

VarName='su_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,su_aod550)

VarName='oc_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,oc_aod550)

VarName='bc_aod550'
call read_netcdf_2d_scatter(ncid2d,im,jsta,jsta_2l,jend,jend_2u, &
spval,VarName,bc_aod550)
end if

! time averaged ground heat flux using nemsio
VarName='gflux_ave'
call read_netcdf_2d_scatter(me,ncid2d,1,im,jm,jsta,jsta_2l &
Expand Down
3 changes: 2 additions & 1 deletion sorc/ncep_post.fd/VRBLS2D_mod.f
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ module vrbls2d
,airdiffswin(:,:),snowfall(:,:),acond(:,:),edir(:,:),ecan(:,:) &
,etrans(:,:),esnow(:,:),avgedir(:,:),avgecan(:,:),avgetrans(:,:)&
,avgesnow(:,:),avgpotevp(:,:),avgprec_cont(:,:),avgcprate_cont(:,:)&
,ti(:,:)
,ti(:,:),aod550(:,:),du_aod550(:,:),ss_aod550(:,:),su_aod550(:,:) &
,bc_aod550(:,:),oc_aod550(:,:)
integer, allocatable :: IVGTYP(:,:),ISLTYP(:,:),ISLOPE(:,:)
! Add 2d aerosol diagnosis fields for GOCART (NGAC)
real, allocatable :: &
Expand Down
5 changes: 3 additions & 2 deletions sorc/ncep_post.fd/WRFPOST.f
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ PROGRAM WRFPOST
lp1, lm1, im_jm, isf_surface_physics, nsoil, spl, lsmp1, global, &
jsta, jend, jsta_m, jend_m, jsta_2l, jend_2u, novegtype, icount_calmict, npset, datapd,&
lsm, fld_info, etafld2_tim, eta2p_tim, mdl2sigma_tim, cldrad_tim, miscln_tim, &
fixed_tim, time_output, imin, surfce2_tim, komax, ivegsrc, d3d_on, gocart_on, &
fixed_tim, time_output, imin, surfce2_tim, komax, ivegsrc, d3d_on, gocart_on,rdaod, &
readxml_tim, spval, fullmodelname, submodelname, hyb_sigp, filenameflat
use grib2_module, only: gribit2,num_pset,nrecout,first_grbtbl,grib_info_finalize
use sigio_module, only: sigio_head
Expand Down Expand Up @@ -174,7 +174,7 @@ PROGRAM WRFPOST
integer :: kpo,kth,kpv
real,dimension(komax) :: po,th,pv
namelist/nampgb/kpo,po,kth,th,kpv,pv,fileNameAER,d3d_on,gocart_on,popascal &
,hyb_sigp
,hyb_sigp,rdaod

character startdate*19,SysDepInfo*80,IOWRFNAME*3,post_fname*255
character cgar*1,cdum*4,line*10
Expand Down Expand Up @@ -307,6 +307,7 @@ PROGRAM WRFPOST
gocart_on = .false.
popascal = .false.
fileNameAER = ''
rdaod = .false.
! gocart_on = .true.
! d3d_on = .true.

Expand Down