From 25d8b7ba407f28f591960e261aa00df23fce7e36 Mon Sep 17 00:00:00 2001 From: Wen Meng Date: Mon, 12 Jun 2023 22:42:50 +0000 Subject: [PATCH 1/9] Update upp revision and clean up inline post read interface. --- io/post_fv3.F90 | 1134 +++++++++++++++++++++-------------------------- upp | 2 +- 2 files changed, 509 insertions(+), 627 deletions(-) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index 7cc6ab45e..c8c6fa5c3 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -187,7 +187,7 @@ subroutine post_run_fv3(wrt_int_state,grid_id,mype,mpicomp,lead_write, & call set_outflds(kth,th,kpv,pv) if(allocated(datapd))deallocate(datapd) allocate(datapd(ite-its+1,jte-jts+1,nrecout+100)) -!$omp parallel do default(none),private(i,j,k),shared(nrecout,jend,jsta,im,datapd,ista,iend) +!$omp parallel do default(none),private(i,j,k),shared(nrecout,jend,jsta,datapd,ista,iend) do k=1,nrecout+100 do j=1,jend+1-jsta do i=1,iend+1-ista @@ -494,6 +494,8 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) ! Apr 2022 W. Meng Unify set_postvars_gfs and ! set_postvars_regional to set_postvars_fv3 ! Apr 2023 W. Meng Sync RRFS and GFS changes from off-line post +! Jun 2023 W. Meng Remove duplicate initialization; +! relocate computation of aerosol fields ! !----------------------------------------------------------------------- !*** set up post fields from nmint_state @@ -670,7 +672,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) bk5(i) = wrt_int_state%bk(i) enddo -!$omp parallel do default(none) private(i,j) shared(jsta,jend,im,f,gdlat,ista,iend) +!$omp parallel do default(none) private(i,j) shared(jsta,jend,f,gdlat,ista,iend) do j=jsta,jend do i=ista,iend f(I,J) = 1.454441e-4*sin(gdlat(i,j)*dtr) ! 2*omeg*sin(phi) @@ -679,18 +681,6 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) ! pt = ak5(1) -! GFS does not have surface specific humidity -! inst sensible heat flux -! inst latent heat flux -!$omp parallel do default(none),private(i,j),shared(jsta,jend,im,spval,qs,twbs,qwbs,ths,ista,iend) - do j=jsta,jend - do i=ista,iend - qs(i,j) = SPVAL - twbs(i,j) = SPVAL - qwbs(i,j) = SPVAL - enddo - enddo - ! GFS set up DT to compute accumulated fields, set it to one dtq2 = wrt_int_state%dtp nphs = 2. @@ -706,49 +696,15 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) allocate(snacc_land(ista:iend,jsta:jend)) endif -! -! GFS does not have convective cloud efficiency -! similated precip -! 10 m theta -! 10 m humidity -! snow free albedo -!$omp parallel do default(none), private(i,j), shared(jsta,jend,im,spval,ista,iend), & -!$omp& shared(cldefi,lspa,th10,q10,albase) - do j=jsta,jend - do i=ista,iend - cldefi(i,j) = SPVAL - lspa(i,j) = SPVAL - th10(i,j) = SPVAL - q10(i,j) = SPVAL - albase(i,j) = SPVAL - enddo - enddo - -! GFS does not have convective precip -!$omp parallel do default(none) private(i,j) shared(jsta,jend,im,cprate,ista,iend) - do j=jsta,jend - do i=ista,iend - cprate(i,j) = 0. - enddo - enddo + !wm +!! GFS does not have convective precip +!!$omp parallel do default(none) private(i,j) shared(jsta,jend,cprate,ista,iend) +! do j=jsta,jend +! do i=ista,iend +! cprate(i,j) = 0. +! enddo +! enddo -! GFS probably does not use zenith angle, czen, czmean -! inst surface outgoing longwave, radot -! inst cloud fraction for high, middle, and low cloud, -! cfrach -! inst ground heat flux, grnflx -!$omp parallel do default(none) private(i,j) shared(jsta,jend,im,spval,ista,iend), & -!$omp& shared(czen,czmean,radot,cfrach,cfracl,cfracm,grnflx) - do j=jsta,jend - do i=ista,iend - czen(i,j) = SPVAL - czmean(i,j) = SPVAL - cfrach(i,j) = SPVAL - cfracl(i,j) = SPVAL - cfracm(i,j) = SPVAL - grnflx(i,j) = SPVAL - enddo - enddo ! ! GFS doesn not yet output soil layer thickness, assign SLDPTH to be the same as nam sldpth(1) = 0.10 @@ -766,17 +722,12 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) ! inst outgoing sfc shortwave, rswout ! snow phase change heat flux, snopcx ! GFS does not use total momentum flux,sfcuvx -!$omp parallel do default(none),private(i,j),shared(jsta,jend,im,spval,ista,iend), & -!$omp& shared(acfrcv,ncfrcv,acfrst,ncfrst,bgroff,rswin,rswinc,rswout,snopcx,sfcuvx,& -!$omp& ltg1_max,ltg2_max,ltg3_max) +!$omp parallel do default(none),private(i,j),shared(jsta,jend,spval,ista,iend), & +!$omp& shared(acfrcv,ncfrcv,acfrst,ncfrst,bgroff,rswinc) do j=jsta,jend do i=ista,iend - acfrcv(i,j) = spval ncfrcv(i,j) = 1.0 - acfrst(i,j) = spval ncfrst(i,j) = 1.0 - bgroff(i,j) = spval - rswinc(i,j) = spval enddo enddo @@ -787,77 +738,11 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) ! GFS surface flux has been averaged, set ASRFC to 1 asrfc = 1.0 -! GFS does not have temperature tendency due to long wave radiation -! temperature tendency due to short wave radiation -! temperature tendency due to latent heating from convection -! temperature tendency due to latent heating from grid scale - do l=1,lm -!$omp parallel do default(none),private(i,j),shared(jsta_2l,jend_2u,im,spval,l,ista_2l,iend_2u), & -!$omp& shared(rlwtt,rswtt,tcucn,tcucns,train) - do j=jsta_2l,jend_2u - do i=ista_2l,iend_2u - rlwtt(i,j,l) = spval - rswtt(i,j,l) = spval - tcucn(i,j,l) = spval - tcucns(i,j,l) = spval - train(i,j,l) = spval - enddo - enddo - enddo - ! set avrain to 1 avrain = 1.0 avcnvc = 1.0 theat = 6.0 ! just in case GFS decides to output T tendency -! GFS does not have temperature tendency due to latent heating from grid scale - train = spval - -! GFS does not have soil moisture availability, smstav -! accumulated surface evaporatio, sfcevp -! averaged accumulated snow, acsnow -! snow melt,acsnom -! humidity at roughness length, qz0 -! u at roughness length, uz0 -! v at roughness length, vz0 -! shelter rh max, maxrhshltr -! shelter rh min, minrhshltr -!$omp parallel do default(none),private(i,j),shared(jsta_2l,jend_2u,im,spval,ista_2l,iend_2u), & -!$omp& shared(sfcevp,acsnom,qz0,uz0,vz0,maxrhshltr,minrhshltr) - do j=jsta_2l,jend_2u - do i=ista_2l,iend_2u - sfcevp(i,j) = spval - acsnom(i,j) = spval - qz0(i,j) = spval - uz0(i,j) = spval - vz0(i,j) = spval - enddo - enddo - -! GFS does not have mixing length,el_pbl -! exchange coefficient, exch_h - do l=1,lm -!$omp parallel do default(none),private(i,j),shared(jsta_2l,jend_2u,im,l,spval,el_pbl,exch_h,ista_2l,iend_2u) - do j=jsta_2l,jend_2u - do i=ista_2l,iend_2u - el_pbl(i,j,l) = spval - exch_h(i,j,l) = spval - enddo - enddo - enddo - -! GFS does not have deep convective cloud top and bottom fields -!$omp parallel do default(none),private(i,j),shared(jsta_2l,jend_2u,im,spval,ista_2l,iend_2u), & -!$omp& shared(htopd,hbotd,htops,hbots,cuppt) - do j=jsta_2l,jend_2u - do i=ista_2l,iend_2u - htopd(i,j) = SPVAL - hbotd(i,j) = SPVAL - htops(i,j) = SPVAL - hbots(i,j) = SPVAL - cuppt(i,j) = SPVAL - enddo - enddo ! ! get inital date sdat(1) = wrt_int_state%idate(2) !month @@ -2457,9 +2342,9 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) endif !end rdaod if ((gocart_on .or. gccpp_on) .and. d2d_chem) then + do K = 1, nbin_du write(VarName, '(A,I3.3)') 'duem', k - if(trim(fieldname)==VarName) then !$omp parallel do default(none) private(i,j,K) shared(jsta,jend,ista,iend,spval,duem,arrayr42d,fillvalue) do j=jsta,jend @@ -2595,7 +2480,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo enddo endif - enddo + enddo do K = 1, nbin_ss if ( K == 1) VarName='seas1wt' @@ -2613,7 +2498,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo enddo endif - enddo + enddo do K = 1, nbin_ss if ( K == 1) VarName='seas1wtc' @@ -2631,7 +2516,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo enddo endif - enddo + enddo do K = 1, nbin_bc if ( K == 1) VarName='bceman' @@ -2646,7 +2531,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo enddo endif - enddo + enddo do K = 1, nbin_bc if ( K == 1) VarName='bc1sd' @@ -2784,15 +2669,15 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo - if(trim(fieldname)=='maod') then - !$omp parallel do default(none) private(i,j,K) shared(jsta,jend,ista,iend,spval,maod,arrayr42d,fillvalue) - do j=jsta,jend - do i=ista, iend - maod(i,j) = arrayr42d(i,j) - if( abs(arrayr42d(i,j)-fillValue) < small) maod(i,j) = spval - enddo + if(trim(fieldname)=='maod') then + !$omp parallel do default(none) private(i,j,K) shared(jsta,jend,ista,iend,spval,maod,arrayr42d,fillvalue) + do j=jsta,jend + do i=ista, iend + maod(i,j) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) maod(i,j) = spval enddo - endif + enddo + endif endif !end gocart_on @@ -3775,7 +3660,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo enddo endif - if(mype==0) print *,'in gfs_post, get ref_10cm=',maxval(ref_10cm), minval(ref_10cm) +! if(mype==0) print *,'in gfs_post, get ref_10cm=',maxval(ref_10cm), minval(ref_10cm) else if(trim(fieldname)=='refl_10cm') then !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,ref_10cm,arrayr43d,fillvalue,spval) @@ -3952,467 +3837,302 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo endif -! read chemical fields - if(gocart_on .or. gccpp_on .or. nasa_on) then - - if(trim(fieldname)=='dust1') then - !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) - do l=1,lm - do j=jsta,jend - do i=ista, iend - dust(i,j,l,1) = max(arrayr43d(i,j,l),0.0) - if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,1) = spval - enddo - enddo - enddo - endif + ! read chemical fields + if(gocart_on .or. gccpp_on .or. nasa_on) then - if(trim(fieldname)=='dust2') then - !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) - do l=1,lm - do j=jsta,jend - do i=ista, iend - dust(i,j,l,2) = max(arrayr43d(i,j,l),0.0) - if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,2) = spval - enddo - enddo - enddo - endif + if(trim(fieldname)=='dust1') then + !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) + do l=1,lm + do j=jsta,jend + do i=ista, iend + dust(i,j,l,1) = max(arrayr43d(i,j,l),0.0) + if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,1) = spval + enddo + enddo + enddo + endif - if(trim(fieldname)=='dust3') then - !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) - do l=1,lm - do j=jsta,jend - do i=ista, iend - dust(i,j,l,3) = max(arrayr43d(i,j,l), 0.0) - if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,3) = spval - enddo - enddo - enddo - endif + if(trim(fieldname)=='dust2') then + !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) + do l=1,lm + do j=jsta,jend + do i=ista, iend + dust(i,j,l,2) = max(arrayr43d(i,j,l),0.0) + if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,2) = spval + enddo + enddo + enddo + endif - if(trim(fieldname)=='dust4') then - !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) - do l=1,lm - do j=jsta,jend - do i=ista, iend - dust(i,j,l,4) = max(arrayr43d(i,j,l), 0.0) - if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,4) = spval - enddo - enddo - enddo - endif + if(trim(fieldname)=='dust3') then + !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) + do l=1,lm + do j=jsta,jend + do i=ista, iend + dust(i,j,l,3) = max(arrayr43d(i,j,l), 0.0) + if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,3) = spval + enddo + enddo + enddo + endif - if(trim(fieldname)=='dust5') then - !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) - do l=1,lm - do j=jsta,jend - do i=ista, iend - dust(i,j,l,5) = max(arrayr43d(i,j,l), 0.0) - if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,5) = spval - enddo - enddo - enddo - endif + if(trim(fieldname)=='dust4') then + !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,dust,arrayr43d,fillvalue,spval) + do l=1,lm + do j=jsta,jend + do i=ista, iend + dust(i,j,l,4) = max(arrayr43d(i,j,l), 0.0) + if(abs(arrayr43d(i,j,l)-fillvalue) < small) dust(i,j,l,4) = spval + enddo + enddo + enddo + endif - dustcb=0.0 - dustallcb=0.0 - do l=1,lm - do j=jsta,jend - do i=ista, iend - if(dust(i,j,l,1) Date: Tue, 13 Jun 2023 01:34:13 +0000 Subject: [PATCH 2/9] sync changes from offline post interface --- io/post_fv3.F90 | 136 ++++++++++++++++++------------------------------ 1 file changed, 50 insertions(+), 86 deletions(-) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index c8c6fa5c3..eff4f3cd5 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -544,12 +544,13 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) sfcvxi, t10m, t10avg, psfcavg, akhsavg, akmsavg, & albedo, tg, prate_max, pwat, snow_acm, snow_bkt, & acgraup, graup_bucket, acfrain, frzrn_bucket, & - ltg1_max, ltg2_max, ltg3_max, aodtot, ebb, hwp, & + ltg1_max, ltg2_max, ltg3_max, ebb, hwp, & aod550,du_aod550,ss_aod550,su_aod550,oc_aod550, & bc_aod550,maod, & dustpm10, dustcb, bccb, occb, sulfcb, sscb, & dustallcb, ssallcb, dustpm, sspm, pp25cb, pp10cb, & - no3cb, nh4cb, dusmass, ducmass, dusmass25,ducmass25 + no3cb, nh4cb, dusmass, ducmass, dusmass25,ducmass25, & + snownc, graupelnc, qrmax use soil, only: sldpth, sh2o, smc, stc, sllevel use masks, only: lmv, lmh, htm, vtm, gdlat, gdlon, dx, dy, hbm2, sm, sice use ctlblk_mod, only: im, jm, lm, lp1, jsta, jend, jsta_2l, jend_2u, jsta_m,jend_m, & @@ -605,9 +606,8 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) real,dimension(:), allocatable :: slat,qstl real,external::FPVSNEW real,dimension(:,:),allocatable :: dummy, p2d, t2d, q2d, qs2d, & - cw2d, cfr2d, accswe_ice, accswe_land, & - snacc_land, snacc_ice - real,dimension(:,:,:),allocatable :: extsmoke, extdust + cw2d, cfr2d, snacc_land, snacc_ice + real,dimension(:,:,:),allocatable :: ext550 character(len=80) :: fieldname, wrtFBName, flatlon, & VarName type(ESMF_Grid) :: wrtGrid @@ -688,10 +688,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) !Allocate for regional models only if(modelname=='FV3R') then - allocate(extsmoke(ista:iend,jsta:jend,lm)) - allocate(extdust(ista:iend,jsta:jend,lm)) - allocate(accswe_ice(ista:iend,jsta:jend)) - allocate(accswe_land(ista:iend,jsta:jend)) + allocate(ext550(ista:iend,jsta:jend,lm)) allocate(snacc_ice(ista:iend,jsta:jend)) allocate(snacc_land(ista:iend,jsta:jend)) endif @@ -999,17 +996,6 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo endif - ! total aod - if(trim(fieldname)=='aodtot') then - !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,aodtot,arrayr42d,fillValue,spval) - do j=jsta,jend - do i=ista, iend - aodtot(i,j)=arrayr42d(i,j) - if(abs(arrayr42d(i,j)-fillValue) < small) aodtot(i,j)=spval - enddo - enddo - endif - ! biomass burning emissions if(trim(fieldname)=='ebb_smoke_hr') then !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,ebb,arrayr42d,fillValue,spval) @@ -1252,6 +1238,28 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo endif + !time step snow (in m) + if(trim(fieldname)=='snow') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,snownc,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + snownc(i,j) = arrayr42d(i,j) + if (abs(arrayr42d(i,j)-fillValue) < small) snownc(i,j) = spval + enddo + enddo + endif + + !time step graupel (in m) + if(trim(fieldname)=='graupel') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,graupelnc,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + graupelnc(i,j) = arrayr42d(i,j) + if (abs(arrayr42d(i,j)-fillValue) < small) graupelnc(i,j) = spval + enddo + enddo + endif + ! max hourly surface precipitation rate if(trim(fieldname)=='pratemax') then !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,prate_max,arrayr42d,sm,fillValue) @@ -2235,25 +2243,6 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) endif if(modelname=='FV3R')then - !acsnow - if(trim(fieldname)=='accswe_land') then - !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,accswe_land,arrayr42d,fillvalue,spval) - do j=jsta,jend - do i=ista, iend - accswe_land(i,j) = arrayr42d(i,j) - if(abs(arrayr42d(i,j)-fillvalue) Date: Wed, 14 Jun 2023 16:14:32 +0000 Subject: [PATCH 3/9] More clean up --- io/post_fv3.F90 | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index eff4f3cd5..82c62f05a 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -693,15 +693,6 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) allocate(snacc_land(ista:iend,jsta:jend)) endif - !wm -!! GFS does not have convective precip -!!$omp parallel do default(none) private(i,j) shared(jsta,jend,cprate,ista,iend) -! do j=jsta,jend -! do i=ista,iend -! cprate(i,j) = 0. -! enddo -! enddo - ! ! GFS doesn not yet output soil layer thickness, assign SLDPTH to be the same as nam sldpth(1) = 0.10 @@ -709,18 +700,9 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) sldpth(3) = 0.6 sldpth(4) = 1.0 -! GFS does not output time averaged convective and strat cloud fraction, set acfrcv to spval, n -! cfrcv to 1 -! time averaged cloud fraction, set acfrst to spval, ncfrst to 1 -! UNDERGROUND RUNOFF, bgroff -! inst incoming sfc longwave -! inst incoming sfc shortwave, rswin -! inst incoming clear sky sfc shortwave, rswinc -! inst outgoing sfc shortwave, rswout -! snow phase change heat flux, snopcx -! GFS does not use total momentum flux,sfcuvx +! set ncfrcv to 1, ncfrst to 1 !$omp parallel do default(none),private(i,j),shared(jsta,jend,spval,ista,iend), & -!$omp& shared(acfrcv,ncfrcv,acfrst,ncfrst,bgroff,rswinc) +!$omp& shared(ncfrcv,ncfrst) do j=jsta,jend do i=ista,iend ncfrcv(i,j) = 1.0 From a49d3d98544cfb245a91c896635512a5bd5f0b18 Mon Sep 17 00:00:00 2001 From: Wen Meng Date: Mon, 26 Jun 2023 19:29:51 +0000 Subject: [PATCH 4/9] Update upp revision to 0544d07 --- upp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upp b/upp index 7529528c9..0544d0741 160000 --- a/upp +++ b/upp @@ -1 +1 @@ -Subproject commit 7529528c9a5bc99188349e7d2d418ec68eaedbce +Subproject commit 0544d074185a3fb67503ae918ef3ade2eab29a2f From 98c3f4d921b5c973fb6e202ded71ba5aeab0fe9f Mon Sep 17 00:00:00 2001 From: Wen Meng Date: Fri, 30 Jun 2023 19:08:41 +0000 Subject: [PATCH 5/9] Add initialization for some local variables. --- io/post_fv3.F90 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index 82c62f05a..c86c27630 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -691,6 +691,21 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) allocate(ext550(ista:iend,jsta:jend,lm)) allocate(snacc_ice(ista:iend,jsta:jend)) allocate(snacc_land(ista:iend,jsta:jend)) + + do j=jsta,jend + do i=ista,iend + snacc_ice(i,j)=spval + snacc_land(i,j)=spval + end do + end do + + do l=1,lm + do j=jsta,jend + do i=ista,iend + ext550(i,j,l)=spval + end do + end do + end do endif ! @@ -4309,6 +4324,9 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) if(ext550(i,j,l) Date: Sat, 1 Jul 2023 01:35:30 +0000 Subject: [PATCH 6/9] Change undefined value of aextc55 as 0 --- io/post_fv3.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index c86c27630..ff52a330d 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -4326,7 +4326,7 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) aextc55(i,j,l)=taod5503d(i,j,l)/(zint(i,j,l)-zint(i,j,l+1)) else taod5503d(i,j,l)=spval - aextc55(i,j,l)=spval + aextc55(i,j,l)=0. endif enddo enddo From 827bfcade4a926b4110ff7c67ab671005c002ad0 Mon Sep 17 00:00:00 2001 From: Wen Meng Date: Thu, 6 Jul 2023 20:43:05 +0000 Subject: [PATCH 7/9] Read soill to level 9 for RUC LSM --- io/post_fv3.F90 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index ff52a330d..2b2b70564 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -1626,6 +1626,69 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) enddo endif + if(nsoil==9) then + ! liquid volumetric soil mpisture in fraction + if(trim(fieldname)=='soill5') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,sh2o,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + sh2o(i,j,5) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) sh2o(i,j,5) = spval + if (sm(i,j) /= 0.0) sh2o(i,j,5) = spval + enddo + enddo + endif + + ! liquid volumetric soil mpisture in fraction + if(trim(fieldname)=='soill6') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,sh2o,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + sh2o(i,j,6) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) sh2o(i,j,6) = spval + if (sm(i,j) /= 0.0) sh2o(i,j,6) = spval + enddo + enddo + endif + + ! liquid volumetric soil mpisture in fraction + if(trim(fieldname)=='soill7') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,sh2o,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + sh2o(i,j,7) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) sh2o(i,j,7) = spval + if (sm(i,j) /= 0.0) sh2o(i,j,7) = spval + enddo + enddo + endif + + ! liquid volumetric soil mpisture in fraction + if(trim(fieldname)=='soill8') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,sh2o,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + sh2o(i,j,8) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) sh2o(i,j,8) = spval + if (sm(i,j) /= 0.0) sh2o(i,j,8) = spval + enddo + enddo + endif + + ! liquid volumetric soil mpisture in fraction + if(trim(fieldname)=='soill9') then + !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,sh2o,arrayr42d,sm,fillValue) + do j=jsta,jend + do i=ista, iend + sh2o(i,j,9) = arrayr42d(i,j) + if( abs(arrayr42d(i,j)-fillValue) < small) sh2o(i,j,9) = spval + if (sm(i,j) /= 0.0) sh2o(i,j,9) = spval + enddo + enddo + endif + + endif !nsoil + ! volumetric soil moisture if(trim(fieldname)=='soilw1') then !$omp parallel do default(none) private(i,j) shared(jsta,jend,ista,iend,spval,smc,arrayr42d,sm,fillValue) From 60b546fd13a9c005b5f3e19157b49af88cc2576f Mon Sep 17 00:00:00 2001 From: Wen Meng Date: Mon, 17 Jul 2023 01:26:01 +0000 Subject: [PATCH 8/9] Correct tke reading and update upp revision. --- io/post_fv3.F90 | 8 ++++++-- upp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/io/post_fv3.F90 b/io/post_fv3.F90 index 2b2b70564..f8dcc80de 100644 --- a/io/post_fv3.F90 +++ b/io/post_fv3.F90 @@ -3726,13 +3726,17 @@ subroutine set_postvars_fv3(wrt_int_state,grid_id,mype,mpicomp) endif ! model level tke - if(trim(fieldname)=='tke') then + if(trim(fieldname)=='qke') then !$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,q2,arrayr43d, fillvalue,spval) do l=1,lm do j=jsta,jend do i=ista, iend q2(i,j,l)=arrayr43d(i,j,l) - if(abs(arrayr43d(i,j,l)-fillvalue)