Skip to content

Commit

Permalink
Read bucket either as an integer or float (#984)
Browse files Browse the repository at this point in the history
* Read bucket as either an integer or float

* Restrict undefined grids in calculation

* Add changes to prevent undefined PBLHGUST in calculation

* add hera RT log

* add orion RT log

* add hercules RT log

---------

Co-authored-by: FernandoAndrade-NOAA <fernando.andrade-maldonado@noaa.gov>
  • Loading branch information
WenMeng-NOAA and FernandoAndrade-NOAA authored Jul 4, 2024
1 parent 5ecb8d9 commit 6075237
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 195 deletions.
4 changes: 3 additions & 1 deletion sorc/ncep_post.fd/CALGUST.f
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
!> 2015-03-11 | S Moorthi | Set sfcwind to spval if u10 and v10 are spvals for A grid and set gust to just wind (in GSM with nemsio, it appears u10 & v10 have spval)
!> 2021-09-02 | Bo Cui | Decompose UPP in X direction
!> 2023-02-24 | Weizhong Zheng| Revised calculation of wind gust for UFS applications
!> 2024-07-02 | Wen Meng | Restrict undefined grids in calculations
!>
!> @author Geoff Manikin W/NP2 @date 1997-03-04

Expand Down Expand Up @@ -151,6 +152,7 @@ SUBROUTINE CALGUST(LPBL,ZPBL,GUST)
GUST(I,J) = MAX(GUST(I,J),SFCWIND+DELWIND)
else
GUST(I,J) = spval
WIND = spval
endif
enddo
else
Expand All @@ -169,7 +171,7 @@ SUBROUTINE CALGUST(LPBL,ZPBL,GUST)
END IF

if(MODELNAME /= 'RAPR' .AND. MODELNAME /= 'GFS' .AND. MODELNAME /= 'FV3R')then
if (sfcwind < spval) then
if (sfcwind < spval .AND. ZPBL(I,J) < spval ) then
DELWIND = WIND - SFCWIND
ZSFC = FIS(I,J)*GI
DELWIND = DELWIND*(1.0-MIN(0.5,ZPBL(I,J)/2000.))
Expand Down
5 changes: 4 additions & 1 deletion sorc/ncep_post.fd/CALUPDHEL.f
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
!> 2020-11-06 | J Meng | Use UPP_MATH Module
!> 2021-10-31 | J Meng | 2D DECOMPOSITION
!> 2022-05-12 | E James | Adding a check for extremely large positive or negative UH values
!> 2024-06-27 | W Meng | Restrict undefined grids in calculation
!>
!> @author M Pyle W/NP2 @date 2007-10-22
!--------------------------------------------------------------------------------------
Expand Down Expand Up @@ -119,7 +120,9 @@ SUBROUTINE CALUPDHEL(UPDHEL)
DVDX = DDVDX(I,J)
DUDY = DDUDY(I,J)

UPDHEL(I,J)=UPDHEL(I,J)+(DVDX-DUDY)*WH(I,J,L)*DZ
IF (DVDX<spval.AND.DUDY<spval.AND. &
WH(I,J,L)<spval.AND.DZ<spval) &
UPDHEL(I,J)=UPDHEL(I,J)+(DVDX-DUDY)*WH(I,J,L)*DZ

IF (UPDHEL(I,J) < -9E10 .OR. UPDHEL(I,J) > 9E10) THEN
UPDHEL(I,J) = spval
Expand Down
19 changes: 14 additions & 5 deletions sorc/ncep_post.fd/INITPOST_NETCDF.f
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
!> 2024-05-01 | Eric James | set "prec_acc_dt1" as 15 min for RRFS
!> 2024-05-09 | Eric James | Enable reading of clear-sky downwelling shortwave irradiance
!> 2024-05-10 | Karina Asmar | Read omega from model output and calculate HGT for hydrostatic runs
!> 2024-06-25 | Wen Meng | Add capability to read fhzero as either an integer or float
!>
!> @author Hui-Ya Chuang @date 2016-03-04
!----------------------------------------------------------------------
Expand Down Expand Up @@ -182,7 +183,8 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d)
!
! REAL fhour
integer nfhour ! forecast hour from nems io file
integer fhzero !bucket
integer fhzero !bucket in integer
real fhzeror !bucket in real
real dtp !physics time step
real dz
REAL RINC(5)
Expand Down Expand Up @@ -1647,12 +1649,19 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d)
end if
if (me == 0) print*,'novegtype= ',novegtype

!Read fhzero as integer
Status=nf90_get_att(ncid2d,nf90_global,'fhzero',fhzero)
if (Status /= 0) then
print*,'fhzero not found-Assigned 3 hours as default'
fhzero=3
!Read fhzero as real
Status=nf90_get_att(ncid2d,nf90_global,'fhzero',fhzeror)
if (Status /= 0) then
print*,'fhzero not found-Assigned 3 hours as default'
fhzeror=3.
endif
else
fhzeror=float(fhzero)
end if
if (me == 0) print*,'fhzero= ',fhzero
! if(me==0)print*,'fhzeror= ',fhzeror
!
Status=nf90_get_att(ncid2d,nf90_global,'dtp',dtp)
if (Status /= 0) then
Expand All @@ -1665,7 +1674,7 @@ SUBROUTINE INITPOST_NETCDF(ncid2d,ncid3d)
CALL MICROINIT(imp_physics)
end if

tprec = float(fhzero)
tprec = fhzeror
! if(ifhr>240)tprec=12.
tclod = tprec
trdlw = tprec
Expand Down
4 changes: 4 additions & 0 deletions sorc/ncep_post.fd/MDLFLD.f
Original file line number Diff line number Diff line change
Expand Up @@ -4119,6 +4119,10 @@ SUBROUTINE MDLFLD
IF (MODELNAME=='RAPR' .OR. MODELNAME=='FV3R') THEN
HGT=ZMID(I,J,L)
PBLHOLD=PBLHGUST(I,J)
IF(PBLHOLD == spval) THEN
LPBL(I,J) = LM
EXIT loopL
ENDIF
ELSE
HGT=ZINT(I,J,L)
PBLHOLD=PBLRI(I,J)
Expand Down
132 changes: 56 additions & 76 deletions tests/logs/rt.log.HERA
Original file line number Diff line number Diff line change
@@ -1,89 +1,69 @@
===== Start of UPP Regression Testing Log =====
UPP Hash Tested:
2743fa41163593720364a644e55945d494e50efb
c07f26d786ce4408d12d370e579366dc0f06cc02

Submodule hashes:
-1ba8270870947b583cd51bc72ff8960f4c1fb36e sorc/libIFI.fd
-567edcc94bc418d0dcd6cdaafed448eeb5aab570 sorc/ncep_post.fd/post_gtg.fd

Run directory: /scratch2/NAGAPE/epic/Fernando.Andrade-maldonado/regression-tests/upp/987/UPP/ci/rundir/upp-HERA
Run directory: /scratch2/NAGAPE/epic/Fernando.Andrade-maldonado/regression-tests/upp/984/UPP/ci/rundir/upp-HERA
Baseline directory: /scratch2/NAGAPE/epic/UPP/test_suite

Total runtime: 03h:58m:06s
Test Date: 20240703 07:00:35
Total runtime: 00h:15m:18s
Test Date: 20240703 19:34:38
Summary Results:

07/03 03:17:12Z gfs_post_00.3841764-fv3gfs test: your new post executable generates bit-identical gfs.t00z.master.grb2f006 as the trunk
07/03 03:17:13Z gfs_post_00.3841764-fv3gfs test: your new post executable generates bit-identical gfs.t00z.sfluxgrbf006.grib2 as the trunk
07/03 03:17:13Z gfs_post_00.3841764-fv3gfs test: your new post executable generates bit-identical gfs.t00z.special.grb2f006 as the trunk
07/03 03:17:36Z gfs_post_00.2489321-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.master.grb2f006 as the trunk
07/03 03:17:37Z gfs_post_00.2489321-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.sfluxgrbf006.grib2 as the trunk
07/03 03:17:37Z gfs_post_00.2489321-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.special.grb2f006 as the trunk
07/03 03:39:11Z -hrrr test: your new post executable generates bit-identical WRFTWO.GrbF04 as the trunk
07/03 03:39:13Z -hrrr test: your new post executable generates bit-identical WRFPRS.GrbF04 as the trunk
07/03 03:39:15Z -hrrr test: your new post executable generates bit-identical WRFNAT.GrbF04 as the trunk
07/03 04:25:30Z -rtma pe test: your new post executable generates bit-identical NATLEV00.tm00 as the trunk
07/03 04:25:33Z -rtma pe test: your new post executable generates bit-identical PRSLEV00.tm00 as the trunk
07/03 04:25:34Z -rtma pe test: your new post executable generates bit-identical IFIFIP00.tm00 as the trunk
07/03 05:15:33Z -hrrr pe test: your new post executable generates bit-identical WRFTWO.GrbF04 as the trunk
07/03 05:15:35Z -hrrr pe test: your new post executable generates bit-identical WRFPRS.GrbF04 as the trunk
07/03 05:15:38Z -hrrr pe test: your new post executable generates bit-identical WRFNAT.GrbF04 as the trunk
07/03 06:58:54Z -fv3hafs test: your new post executable generates bit-identical HURPRS09.tm00 as the trunk
07/03 06:59:05Z -fv3r test: your new post executable generates bit-identical PRSLEV10.tm00 as the trunk
07/03 06:59:07Z -fv3gefs pe test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 06:59:08Z -fv3r pe test: your new post executable generates bit-identical PRSLEV10.tm00 as the trunk
07/03 06:59:09Z -fv3r test: your new post executable generates bit-identical NATLEV10.tm00 as the trunk
07/03 06:59:14Z -fv3r pe test: your new post executable generates bit-identical NATLEV10.tm00 as the trunk
07/03 06:59:51Z -fv3hafs pe test: your new post executable generates bit-identical HURPRS09.tm00 as the trunk
07/03 07:00:00Z -rap test: your new post executable generates bit-identical WRFPRS.GrbF16 as the trunk
07/03 07:00:00Z -fv3gefs test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 07:00:02Z -rap test: your new post executable generates bit-identical WRFNAT.GrbF16 as the trunk
07/03 07:00:10Z -rtma test: your new post executable generates bit-identical NATLEV00.tm00 as the trunk
07/03 07:00:14Z -rtma test: your new post executable generates bit-identical PRSLEV00.tm00 as the trunk
07/03 07:00:15Z -rtma test: your new post executable generates bit-identical IFIFIP00.tm00 as the trunk
07/03 07:00:21Z -rap pe test: your new post executable did generate changed results in WRFPRS.GrbF16
07/03 07:00:23Z -rap pe test: your new post executable generates bit-identical WRFNAT.GrbF16 as the trunk
07/03 06:59:16Z -Runtime: fv3gefs_pe_test 00:00:21 -- baseline 00:40:00
07/03 07:00:17Z -Runtime: rap_test 00:01:05 -- baseline 00:02:00
07/03 07:00:32Z -Runtime: rap_pe_test 00:01:13 -- baseline 00:02:00
07/03 07:00:32Z -Runtime: hrrr_test 00:02:37 -- baseline 00:02:00
07/03 07:00:33Z -Runtime: hrrr_pe_test 00:02:22 -- baseline 00:02:00
07/03 07:00:33Z -Runtime: fv3gfs_test 00:12:04 -- baseline 00:15:00
07/03 07:00:33Z -Runtime: fv3gfs_pe_test 00:12:21 -- baseline 00:15:00
07/03 07:00:34Z -Runtime: fv3r_test 00:01:44 -- baseline 00:03:00
07/03 07:00:34Z -Runtime: fv3r_pe_test 00:01:38 -- baseline 00:03:00
07/03 07:00:34Z -Runtime: fv3hafs_test 00:00:41 -- baseline 00:03:00
07/03 07:00:34Z -Runtime: fv3hafs_pe_test 00:00:37 -- baseline 00:03:00
07/03 07:00:35Z -Runtime: rtma_test 00:01:54 -- baseline 00:03:00
07/03 07:00:35Z -Runtime: rtma_test_pe_test 00:01:50 -- baseline
No changes in test results detected.
===== End of UPP Regression Testing Log =====
===== Start of UPP Regression Testing Log =====
UPP Hash Tested:
2743fa41163593720364a644e55945d494e50efb

Submodule hashes:
-1ba8270870947b583cd51bc72ff8960f4c1fb36e sorc/libIFI.fd
-567edcc94bc418d0dcd6cdaafed448eeb5aab570 sorc/ncep_post.fd/post_gtg.fd

Run directory: /scratch2/NAGAPE/epic/Fernando.Andrade-maldonado/regression-tests/upp/987/UPP/ci/rundir/upp-HERA
Baseline directory: /scratch2/NAGAPE/epic/UPP/test_suite

Total runtime: 00h:10m:55s
Test Date: 20240703 14:54:11
Summary Results:

07/03 14:46:45Z -fv3gefs pe test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 14:47:24Z -fv3gefs test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 14:49:17Z -nmmb test: your new post executable generates bit-identical BGDAWP03.tm00.Grib2 as the trunk
07/03 14:49:20Z -nmmb test: your new post executable generates bit-identical BGRD3D03.tm00.Grib2 as the trunk
07/03 14:49:21Z -nmmb test: your new post executable generates bit-identical BGRDSF03.tm00.Grib2 as the trunk
07/03 14:53:53Z -nmmb pe test: your new post executable generates bit-identical BGDAWP03.tm00.Grib2 as the trunk
07/03 14:53:57Z -nmmb pe test: your new post executable generates bit-identical BGRD3D03.tm00.Grib2 as the trunk
07/03 14:53:58Z -nmmb pe test: your new post executable generates bit-identical BGRDSF03.tm00.Grib2 as the trunk
07/03 14:49:23Z -Runtime: nmmb_test 00:01:57 -- baseline 00:01:00
07/03 14:54:10Z -Runtime: nmmb_pe_test 00:01:40 -- baseline 00:01:00
07/03 14:54:10Z -Runtime: fv3gefs_test 00:01:12 -- baseline 00:40:00
07/03 14:54:11Z -Runtime: fv3gefs_pe_test 00:00:37 -- baseline 00:40:00
07/03 19:23:12Z -fv3gefs pe test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 19:23:55Z -fv3hafs test: your new post executable generates bit-identical HURPRS09.tm00 as the trunk
07/03 19:24:01Z -rap test: your new post executable generates bit-identical WRFPRS.GrbF16 as the trunk
07/03 19:24:03Z -rap test: your new post executable generates bit-identical WRFNAT.GrbF16 as the trunk
07/03 19:24:20Z -hrrr pe test: your new post executable generates bit-identical WRFTWO.GrbF04 as the trunk
07/03 19:24:21Z -fv3gefs test: your new post executable generates bit-identical geaer.t00z.master.grb2f060 as the trunk
07/03 19:24:22Z -hrrr pe test: your new post executable generates bit-identical WRFPRS.GrbF04 as the trunk
07/03 19:24:24Z -hrrr pe test: your new post executable generates bit-identical WRFNAT.GrbF04 as the trunk
07/03 19:24:34Z -rtma pe test: your new post executable generates bit-identical NATLEV00.tm00 as the trunk
07/03 19:24:37Z -rtma pe test: your new post executable generates bit-identical PRSLEV00.tm00 as the trunk
07/03 19:24:38Z -rtma pe test: your new post executable generates bit-identical IFIFIP00.tm00 as the trunk
07/03 19:24:39Z -fv3hafs pe test: your new post executable generates bit-identical HURPRS09.tm00 as the trunk
07/03 19:25:48Z -nmmb test: your new post executable generates bit-identical BGDAWP03.tm00.Grib2 as the trunk
07/03 19:25:50Z -nmmb test: your new post executable generates bit-identical BGRD3D03.tm00.Grib2 as the trunk
07/03 19:25:51Z -nmmb test: your new post executable generates bit-identical BGRDSF03.tm00.Grib2 as the trunk
07/03 19:26:02Z -fv3r test: your new post executable generates bit-identical PRSLEV10.tm00 as the trunk
07/03 19:26:05Z -nmmb pe test: your new post executable generates bit-identical BGDAWP03.tm00.Grib2 as the trunk
07/03 19:26:06Z -fv3r test: your new post executable generates bit-identical NATLEV10.tm00 as the trunk
07/03 19:26:07Z -nmmb pe test: your new post executable generates bit-identical BGRD3D03.tm00.Grib2 as the trunk
07/03 19:26:07Z -nmmb pe test: your new post executable generates bit-identical BGRDSF03.tm00.Grib2 as the trunk
07/03 19:26:08Z -fv3r pe test: your new post executable generates bit-identical PRSLEV10.tm00 as the trunk
07/03 19:26:14Z -fv3r pe test: your new post executable generates bit-identical NATLEV10.tm00 as the trunk
07/03 19:26:18Z -hrrr test: your new post executable generates bit-identical WRFTWO.GrbF04 as the trunk
07/03 19:26:20Z -hrrr test: your new post executable generates bit-identical WRFPRS.GrbF04 as the trunk
07/03 19:26:21Z -hrrr test: your new post executable generates bit-identical WRFNAT.GrbF04 as the trunk
07/03 19:26:25Z -rtma test: your new post executable generates bit-identical NATLEV00.tm00 as the trunk
07/03 19:26:29Z -rtma test: your new post executable generates bit-identical PRSLEV00.tm00 as the trunk
07/03 19:26:29Z -rtma test: your new post executable generates bit-identical IFIFIP00.tm00 as the trunk
07/03 19:26:43Z -rap pe test: your new post executable did generate changed results in WRFPRS.GrbF16
07/03 19:26:45Z -rap pe test: your new post executable generates bit-identical WRFNAT.GrbF16 as the trunk
07/03 19:34:07Z gfs_post_00.3101429-fv3gfs test: your new post executable generates bit-identical gfs.t00z.master.grb2f006 as the trunk
07/03 19:34:08Z gfs_post_00.3101429-fv3gfs test: your new post executable generates bit-identical gfs.t00z.sfluxgrbf006.grib2 as the trunk
07/03 19:34:08Z gfs_post_00.3101429-fv3gfs test: your new post executable generates bit-identical gfs.t00z.special.grb2f006 as the trunk
07/03 19:34:31Z gfs_post_00.907284-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.master.grb2f006 as the trunk
07/03 19:34:33Z gfs_post_00.907284-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.sfluxgrbf006.grib2 as the trunk
07/03 19:34:33Z gfs_post_00.907284-fv3gfs pe test: your new post executable generates bit-identical gfs.t00z.special.grb2f006 as the trunk
07/03 19:25:57Z -Runtime: nmmb_test 00:01:26 -- baseline 00:01:00
07/03 19:26:12Z -Runtime: nmmb_pe_test 00:00:42 -- baseline 00:01:00
07/03 19:26:12Z -Runtime: fv3gefs_test 00:00:17 -- baseline 00:40:00
07/03 19:26:13Z -Runtime: fv3gefs_pe_test 00:00:31 -- baseline 00:40:00
07/03 19:26:14Z -Runtime: rap_test 00:01:10 -- baseline 00:02:00
07/03 19:26:59Z -Runtime: rap_pe_test 00:01:20 -- baseline 00:02:00
07/03 19:27:00Z -Runtime: hrrr_test 00:02:23 -- baseline 00:02:00
07/03 19:27:00Z -Runtime: hrrr_pe_test 00:02:07 -- baseline 00:02:00
07/03 19:34:19Z -Runtime: fv3gfs_test 00:11:57 -- baseline 00:15:00
07/03 19:34:35Z -Runtime: fv3gfs_pe_test 00:11:53 -- baseline 00:15:00
07/03 19:34:35Z -Runtime: fv3r_test 00:01:37 -- baseline 00:03:00
07/03 19:34:36Z -Runtime: fv3r_pe_test 00:01:45 -- baseline 00:03:00
07/03 19:34:37Z -Runtime: fv3hafs_test 00:00:38 -- baseline 00:03:00
07/03 19:34:37Z -Runtime: fv3hafs_pe_test 00:00:41 -- baseline 00:03:00
07/03 19:34:38Z -Runtime: rtma_test 00:01:48 -- baseline 00:03:00
07/03 19:34:38Z -Runtime: rtma_test_pe_test 00:01:57 -- baseline
No changes in test results detected.
===== End of UPP Regression Testing Log =====
Loading

0 comments on commit 6075237

Please sign in to comment.