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

Bug fix for QPFFFG and QPFARI encoding in RRFS #961

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
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
30 changes: 15 additions & 15 deletions parm/postxconfig-NT-rrfs_subh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ surface
?
?
?
525
BUCKET1_ASNOW_ON_SURFACE
bucket Var density snowfall on surface
725
GSD_ACM_SNOD_ON_SURFACE
?
1
tmpl4_8
ASNOW
Expand Down Expand Up @@ -394,9 +394,9 @@ surface
?
?
?
526
BUCKET1_APCP_ON_SURFACE
bucket Total precipitation on surface
417
CACM_APCP_ON_SURFACE
?
1
tmpl4_8
APCP
Expand Down Expand Up @@ -436,9 +436,9 @@ surface
?
?
?
528
BUCKET1_TSNOWP_ON_SURFACE
bucket snow on surface
1004
ACM_SNOWFALL_ON_SURFACE
?
1
tmpl4_8
TSNOWP
Expand Down Expand Up @@ -478,9 +478,9 @@ surface
?
?
?
527
BUCKET1_FRZR_ON_SURFACE
bucket Freezing rain on surface
782
ACM_FRAIN_ON_SURFACE
?
1
tmpl4_8
FRZR
Expand Down Expand Up @@ -520,9 +520,9 @@ surface
?
?
?
530
BUCKET1_GRAUPEL_ON_SURFACE
bucket graupel precipitation on surface
746
ACM_GRAUPEL_ON_SURFACE
?
1
tmpl4_8
FROZR
Expand Down
10 changes: 5 additions & 5 deletions parm/rrfs_postcntrl_subh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@
</param>

<param>
<shortname>BUCKET1_ASNOW_ON_SURFACE</shortname>
<shortname>GSD_ACM_SNOD_ON_SURFACE</shortname>
<scale>9.0</scale>
</param>

<param>
<shortname>BUCKET1_APCP_ON_SURFACE</shortname>
<shortname>CACM_APCP_ON_SURFACE</shortname>
<scale>-4.0</scale>
</param>

<param>
<shortname>BUCKET1_TSNOWP_ON_SURFACE</shortname>
<shortname>ACM_SNOWFALL_ON_SURFACE</shortname>
<scale>6.0</scale>
</param>

<param>
<shortname>BUCKET1_FRZR_ON_SURFACE</shortname>
<shortname>ACM_FRAIN_ON_SURFACE</shortname>
<scale>6.0</scale>
</param>

<param>
<shortname>BUCKET1_GRAUPEL_ON_SURFACE</shortname>
<shortname>ACM_GRAUPEL_ON_SURFACE</shortname>
<scale>6.0</scale>
</param>

Expand Down
12 changes: 1 addition & 11 deletions sorc/ncep_post.fd/CALPW.f
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
!> 2021-09-02 | Bo Cui | Decompose UPP in X direction
!> 2022-11-16 | Eric James | Adding calculation of vertically integrated dust from RRFS
!> 2023-02-23 | Eric James | Adding vertically integrated coarse PM from RRFS
!> 2024-04-23 | Eric James | Adding vertically integrated smoke emissions (ebb)
!>
!> @author Russ Treadon W/NP2 @date 1992-12-24
!-----------------------------------------------------------------------
Expand All @@ -55,7 +54,7 @@ SUBROUTINE CALPW(PW,IDECID)
use vrbls3d, only: q, qqw, qqi, qqr, qqs, cwm, qqg, t, rswtt, &
train, tcucn, mcvg, pmid, o3, ext, pint, rlwtt, &
taod5503d,sca, asy
use vrbls4d, only: smoke, fv3dust, coarsepm, ebb
use vrbls4d, only: smoke, fv3dust, coarsepm
use masks, only: htm
use params_mod, only: tfrz, gi
use ctlblk_mod, only: lm, jsta, jend, im, spval, ista, iend
Expand Down Expand Up @@ -298,15 +297,6 @@ SUBROUTINE CALPW(PW,IDECID)
Qdum(I,J) = COARSEPM(I,J,L,1)/(1E9)
ENDDO
END DO

! EBB (from RRFS)
ELSE IF (IDECID == 24) THEN
!$omp parallel do private(i,j)
DO J=JSTA,JEND
DO I=ISTA,IEND
Qdum(I,J) = EBB(I,J,L,1)/(1E9)
ENDDO
END DO
ENDIF
!
!$omp parallel do private(i,j,dp)
Expand Down
19 changes: 16 additions & 3 deletions sorc/ncep_post.fd/CLDRAD.f
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
!> 2023-09-26 | Jaymes Kenyon | For RRFS, use cloud fraction to diagnose cloud base/top (height and pressure)
!> 2024-04-23 | Eric James | Adding smoke emissions (ebb) from RRFS
!> 2024-05-01 | Jaymes Kenyon | Updates to the GSL exp-1 ceiling diagnostic
!> 2024-05-24 | Eric James | Correcting the vertical summing of biomass burning emissions (EBB)
!>
!> @author Russ Treadon W/NP2 @date 1993-08-30
!---------------------------------------------------------------------------------
Expand All @@ -86,7 +87,7 @@
SUBROUTINE CLDRAD

!
use vrbls4d, only: DUST,SUSO, SALT, SOOT, WASO,NO3,NH4
use vrbls4d, only: DUST,SUSO, SALT, SOOT, WASO,NO3,NH4,EBB
use vrbls3d, only: QQW, QQR, T, ZINT, CFR, QQI, QQS, Q, EXT, ZMID,PMID,&
PINT, DUEM, DUSD, DUDP, DUWT, DUSV, SSEM, SSSD,SSDP,&
SSWT, SSSV, BCEM, BCSD, BCDP, BCWT, BCSV, OCEM,OCSD,&
Expand Down Expand Up @@ -533,8 +534,20 @@ SUBROUTINE CLDRAD
! TOTAL COLUMN EBB (BIOMASS BURNING EMISSIONS)
!
IF (IGET(745) > 0) THEN
CALL CALPW(GRID1(ista:iend,jsta:iend),24)
CALL BOUND(GRID1,D00,H99999)
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
do i=1,iend-ista+1
ii=ista+i-1
GRID1(ii,jj) = 0.0
do k=1,lm
LL=LM-k+1
if(EBB(ii,jj,k,1)/=spval)then
GRID1(ii,jj) = GRID1(ii,jj) + EBB(ii,jj,k,1)/(1E9)
endif
enddo
enddo
enddo
if(grib == "grib2" )then
cfld = cfld + 1
fld_info(cfld)%ifld = IAVBLFLD(IGET(745))
Expand Down
48 changes: 39 additions & 9 deletions sorc/ncep_post.fd/SURFCE.f
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
!> 2024-04-03 | E James | Enabling output of hourly average smoke PM2.5 and dust PM10
!> 2024-04-23 | E James | Adding smoke emissions (ebb) from RRFS
!> 2024-05-01 | E James | Adapt the BUCKET1 type fields (15-min acc) for use in RRFS
!> 2024-05-24 | E James | Modify the run total acc precip fields for 15-min output
!>
!> @note
!> USAGE: CALL SURFCE
Expand Down Expand Up @@ -482,7 +483,11 @@ SUBROUTINE SURFCE
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(725))
fld_info(cfld)%ntrange=1
fld_info(cfld)%tinvstat=IFHR
if(ifmin>1)then
fld_info(cfld)%tinvstat=IFHR*60+IFMIN
else
fld_info(cfld)%tinvstat=IFHR
endif
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
Expand Down Expand Up @@ -3128,7 +3133,7 @@ SUBROUTINE SURFCE
DO J=JSTA,JEND
DO I=ISTA,IEND
IF(AVGPREC_CONT(I,J) < SPVAL)THEN
GRID2(I,J) = AVGPREC_CONT(I,J)*FLOAT(IFHR)*3600.*1000./DTQ2
GRID2(I,J) = AVGPREC_CONT(I,J)*((3600.*FLOAT(IFHR))+(60.*FLOAT(IFMIN)))*1000./DTQ2
ELSE
GRID2(I,J) = SPVAL
END IF
Expand All @@ -3142,7 +3147,11 @@ SUBROUTINE SURFCE
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(417))
fld_info(cfld)%ntrange=1
fld_info(cfld)%tinvstat=IFHR
if(ifmin>1)then
fld_info(cfld)%tinvstat=IFHR*60+IFMIN
else
fld_info(cfld)%tinvstat=IFHR
endif
! print*,'tinvstat in cont bucket= ',fld_info(cfld)%tinvstat
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
Expand Down Expand Up @@ -3572,8 +3581,15 @@ SUBROUTINE SURFCE
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(746))
fld_info(cfld)%ntrange=1
fld_info(cfld)%tinvstat=IFHR-ID(18)
if(MODELNAME=='FV3R' .OR. MODELNAME=='GFS')fld_info(cfld)%tinvstat=IFHR
if(MODELNAME=='FV3R' .OR. MODELNAME=='GFS')then
if(ifmin>1)then
fld_info(cfld)%tinvstat=IFHR*60+IFMIN
else
fld_info(cfld)%tinvstat=IFHR
endif
else
fld_info(cfld)%tinvstat=IFHR-ID(18)
endif
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
Expand Down Expand Up @@ -3618,8 +3634,15 @@ SUBROUTINE SURFCE
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(782))
fld_info(cfld)%ntrange=1
fld_info(cfld)%tinvstat=IFHR-ID(18)
if(MODELNAME=='FV3R' .OR. MODELNAME=='GFS')fld_info(cfld)%tinvstat=IFHR
if(MODELNAME=='FV3R' .OR. MODELNAME=='GFS')then
if(ifmin>1)then
fld_info(cfld)%tinvstat=IFHR*60+IFMIN
else
fld_info(cfld)%tinvstat=IFHR
endif
else
fld_info(cfld)%tinvstat=IFHR-ID(18)
endif
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
Expand Down Expand Up @@ -3664,8 +3687,15 @@ SUBROUTINE SURFCE
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(1004))
fld_info(cfld)%ntrange=1
fld_info(cfld)%tinvstat=IFHR-ID(18)
if(MODELNAME=='FV3R' .or. MODELNAME=='GFS')fld_info(cfld)%tinvstat=IFHR
if(MODELNAME=='FV3R' .OR. MODELNAME=='GFS')then
if(ifmin>1)then
fld_info(cfld)%tinvstat=IFHR*60+IFMIN
else
fld_info(cfld)%tinvstat=IFHR
endif
else
fld_info(cfld)%tinvstat=IFHR-ID(18)
endif
! print*,'id(18),tinvstat in acgraup= ',ID(18),fld_info(cfld)%tinvstat
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
Expand Down
14 changes: 9 additions & 5 deletions sorc/ncep_post.fd/grib2_module.f
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module grib2_module
integer num_pset
integer isec,hrs_obs_cutoff,min_obs_cutoff
integer sec_intvl,stat_miss_val,time_inc_betwn_succ_fld
integer perturb_num,num_ens_fcst
integer perturb_num,num_ens_fcst,prob_num,tot_num_prob
character*80 type_of_time_inc,stat_unit_time_key_succ
logical*1,allocatable :: bmap(:)
integer ibm
Expand Down Expand Up @@ -165,7 +165,9 @@ subroutine grib_info_init()
type_of_time_inc='same_start_time_fcst_fcst_time_inc'
stat_unit_time_key_succ='missing'
time_inc_betwn_succ_fld=0
!
prob_num = 0
tot_num_prob = 1
!
!-- open fld name tble
!
if(first_grbtbl) then
Expand Down Expand Up @@ -505,8 +507,8 @@ subroutine gengrb2msg(idisc,icatg, iparm,nprm,nlvl,fldlvl1,fldlvl2,ntrange,tinvs
!use gdtsec3, only: getgdtnum
implicit none
!
integer,intent(in) :: idisc,icatg, iparm,nprm,fldlvl1,fldlvl2,ntrange,tinvstat
integer,intent(inout) :: nlvl
integer,intent(in) :: idisc,icatg, iparm,nprm,fldlvl1,fldlvl2,ntrange
integer,intent(inout) :: nlvl,tinvstat
real,dimension(:),intent(in) :: datafld1
character(1),intent(inout) :: cgrib(max_bytes)
integer, intent(inout) :: lengrib
Expand Down Expand Up @@ -548,7 +550,6 @@ subroutine gengrb2msg(idisc,icatg, iparm,nprm,nlvl,fldlvl1,fldlvl2,ntrange,tinvs
integer scaled_val_fixed_sfc1,scale_fct_fixed_sfc2
character(80) fixed_sfc2_type
integer idec_scl,ibin_scl,ibmap,inumbits
integer prob_num,tot_num_prob
character(80) prob_type
real fldscl
integer igdstmpl(igdsmaxlen)
Expand Down Expand Up @@ -763,6 +764,9 @@ subroutine gengrb2msg(idisc,icatg, iparm,nprm,nlvl,fldlvl1,fldlvl2,ntrange,tinvs
if((modelname=='RAPR'.and.vtimeunits=='FMIN').or.(modelname=='FV3R'.and.pset%time_range_unit=="minute")) then
ifhrorig = ifhr
ifhr = ifhr*60 + ifmin
if(ifmin<1)then
tinvstat = tinvstat*60 + ifmin
endif
ihr_start = max(0,ifhr-tinvstat)
else
if(ifmin > 0.)then ! change time range unit to minute
Expand Down
Loading