From 44528598929d920bcebd83f835869c183044308d Mon Sep 17 00:00:00 2001 From: WenMeng-NOAA <48260754+WenMeng-NOAA@users.noreply.github.com> Date: Tue, 10 Nov 2020 07:38:37 -0500 Subject: [PATCH] Bug fix for FV3 LAM/LAMX (#219) * Fix of total cloud fraction in CLDRAD.f for FV3/LAMX. * Setting iSF_SURFACE_PHYSICS as 2 in regional FV3 read interface. --- sorc/ncep_post.fd/CLDRAD.f | 6 ++++-- sorc/ncep_post.fd/INITPOST_NETCDF.f | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/sorc/ncep_post.fd/CLDRAD.f b/sorc/ncep_post.fd/CLDRAD.f index 281bfcd0a1..d8de015c32 100644 --- a/sorc/ncep_post.fd/CLDRAD.f +++ b/sorc/ncep_post.fd/CLDRAD.f @@ -928,8 +928,10 @@ SUBROUTINE CLDRAD FRAC=0. DO JC=max(1,J-numr),min(JM,J+numr) DO IC=max(1,I-numr),min(IM,I+numr) - NUMPTS=NUMPTS+1 - FRAC=FRAC+FULL_CLD(IC,JC) + IF(FULL_CLD(IC,JC) /= SPVAL) THEN + NUMPTS=NUMPTS+1 + FRAC=FRAC+FULL_CLD(IC,JC) + ENDIF ENDDO ENDDO IF (NUMPTS>0) FRAC=FRAC/REAL(NUMPTS) diff --git a/sorc/ncep_post.fd/INITPOST_NETCDF.f b/sorc/ncep_post.fd/INITPOST_NETCDF.f index 221d97284c..46346ae591 100644 --- a/sorc/ncep_post.fd/INITPOST_NETCDF.f +++ b/sorc/ncep_post.fd/INITPOST_NETCDF.f @@ -75,7 +75,8 @@ SUBROUTINE INITPOST_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, & + iSF_SURFACE_PHYSICS 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 @@ -205,6 +206,14 @@ SUBROUTINE INITPOST_NETCDF(ncid3d) else if(me==0)print*,'ak5= ',ak5 end if + Status=nf90_get_att(ncid3d,nf90_global,'sf_surface_physi', & + iSF_SURFACE_PHYSICS) + if(Status/=0)then + print*,'sf_surface_physi not found; assigning to 2' + iSF_SURFACE_PHYSICS=2 !set LSM physics to 2 for NOAH + else + if(me==0)print*,'SF_SURFACE_PHYSICS= ',iSF_SURFACE_PHYSICS + endif Status=nf90_get_att(ncid3d,nf90_global,'idrt',idrt) if(Status/=0)then print*,'idrt not in netcdf file,reading grid'