From 4ac7547ce8983ac298bf371ebba59ae1918f8425 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Tue, 28 Jan 2025 15:47:08 +0000 Subject: [PATCH 1/3] "update GF/C3 for SRW3.0 release" --- physics/CONV/C3/cu_c3_deep.F90 | 132 ++++++++++++++++---- physics/CONV/C3/cu_c3_driver.F90 | 9 +- physics/CONV/Grell_Freitas/cu_gf_deep.F90 | 64 ++-------- physics/CONV/Grell_Freitas/cu_gf_driver.F90 | 9 +- 4 files changed, 134 insertions(+), 80 deletions(-) diff --git a/physics/CONV/C3/cu_c3_deep.F90 b/physics/CONV/C3/cu_c3_deep.F90 index 9bcbe5910..a97350059 100644 --- a/physics/CONV/C3/cu_c3_deep.F90 +++ b/physics/CONV/C3/cu_c3_deep.F90 @@ -153,7 +153,7 @@ subroutine cu_c3_deep_run( & !! betwee -1 and +1 ,do_capsuppress,cap_suppress_j & ! ,k22 & ! - ,jmin,tropics) ! + ,jmin,mc_thresh) ! implicit none @@ -198,16 +198,16 @@ subroutine cu_c3_deep_run( & !$acc declare copy(cnvwt,outu,outv,outt,outq,outqc,cupclw,frh_out,pre,xmb_out) real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & - hfx,qfx,xmbm_in,xmbs_in -!$acc declare copyin(hfx,qfx,xmbm_in,xmbs_in) + mc_thresh,hfx,qfx,xmbm_in,xmbs_in +!$acc declare copyin(mc_thresh,hfx,qfx,xmbm_in,xmbs_in) integer, dimension (its:) & ,intent (inout ) :: & kbcon,ktop !$acc declare copy(kbcon,ktop) integer, dimension (its:) & ,intent (in ) :: & - kpbl,tropics -!$acc declare copyin(kpbl,tropics) + kpbl +!$acc declare copyin(kpbl) ! ! basic environmental input includes moisture convergence (mconv) ! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off @@ -448,10 +448,19 @@ subroutine cu_c3_deep_run( & !---meltglac------------------------------------------------- real(kind=kind_phys), dimension (its:ite,kts:kte) :: p_liq_ice,melting_layer,melting -!$acc declare create(p_liq_ice,melting_layer,melting) +! icoldpool + integer, parameter :: icoldpool=0 + real(kind=kind_phys), parameter :: Kfr = 0.9, epsx = 1.e2, alpha_dd=45., pi=3.1416 + real(kind=kind_phys), dimension (its:ite) :: beta_x, vcpool, wlpool,umcl,vmcl,slope_pool + real(kind=kind_phys), dimension (its:ite,kts:kte) :: buoysrc,dellat_d + real(kind=kind_phys) :: aux,mcl_speed,total_dz,mx_buoy2,h_env,dpsum integer :: itemp +!$acc declare create(p_liq_ice,melting_layer,melting,buoysrc,beta_x,vcpool,wlpool,umcl,vmcl) + + + mx_buoy2 = cp*10. !---meltglac------------------------------------------------- !$acc kernels melting_layer(:,:)=0. @@ -586,9 +595,8 @@ subroutine cu_c3_deep_run( & !$acc loop private(radius,frh) do i=its,ite c1d(i,:)= 0. !c1 ! 0. ! c1 ! max(.003,c1+float(csum(i))*.0001) - entr_rate(i)=7.e-5 - min(20.,float(csum(i))) * 3.e-6 - if(xland1(i) == 0)entr_rate(i)=7.e-5 - if(dx(i) 0 dellaq(i,1) = dellaq(i,1)+ e_dn-g_rain + dellat_d(i,1)=zdo(i,2)*edto(i)*(hcdo(i,2)-heo_cup(i,2))*g/dp !--- conservation check !- water mass balance @@ -1780,6 +1790,12 @@ subroutine cu_c3_deep_run( & ! trash= trash+ (dellaq(i,k)+dellaqc(i,k)+ g_rain-e_dn)*dp/g enddo ! k + do k=2,jmin(i)-1 + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + dellat_d(i,k)= & + edto(i)*dd_massdetro(i,k)*(.5*(hcdo(i,k+1)+hcdo(i,k))-heo(i,k))*g/dp + enddo ! k + endif enddo @@ -1991,6 +2007,7 @@ subroutine cu_c3_deep_run( & !$acc atomic update mconv(i)=mconv(i)+omeg(i,k)*dq/g enddo + if ((mconv(i) < mc_thresh(i)) .and. (xland1(i) == 0)) ierr(i)=2242 enddo !> - From Bengtsson et al. (2022) \cite Bengtsson_2022 prognostic closure scheme, @@ -2088,6 +2105,34 @@ subroutine cu_c3_deep_run( & ichoice,imid,ipr,itf,ktf, & its,ite, kts,kte,dx,sigmab, & dicycle,xf_dicycle,xf_progsigma) + ! + ! + if (icoldpool > 0 .and. imid ==0) then + buoysrc(:,:)=0. + do i=its,itf + vcpool(i)=0. + wlpool(i)=0. + total_dz=0. + beta_x(i)=0. + if(ierr(i).gt.0)cycle ! exit loopI + do k = kts,jmin(i)-1 + buoysrc(i,k)=beta_x(i)-dellat_d(i,k)*xmb(i)*dtime !/sig(i)*cp + if(buoysrc(i,k) < epsx .or. total_dz .gt. z_detr ) cycle + H_env = heo(i,k) + dz = zo(i,k+1)-zo(i,k) + total_dz = total_dz + dz + vcpool(i) = vcpool(i) + (g*dz*min(mx_buoy2,buoysrc(i,k))/H_env) + wlpool(i) = wlpool(i) + (g*dz*min(mx_buoy2,buoysrc(i,k))/H_env ) + end do + do k = kts,jmin(i)-1 + buoysrc(i,k)=-dellat_d(i,k)*xmb(i)*dtime + end do + vcpool(i) = min(20., Kfr *sqrt(vcpool(i))) + slope_pool(i) = alpha_dd + wlpool(i) = min(10., Kfr *sin( slope_pool(i)*pi/180. )* sqrt(wlpool(i))) + enddo ! i-loop + endif ! icoldpool + !> - Call rain_evap_below_cloudbase() to calculate evaporation below cloud base @@ -2116,6 +2161,48 @@ subroutine cu_c3_deep_run( & endif enddo !$acc end kernels + if (icoldpool > 0 .and. icoldpool /= 2 .and. imid ==0) then + ! --- adding the gust front horizontal speed to the 2-d MCL wind + ! --- only magnitude is augmented, direction is kept the same + do i=its,itf + umcl(i)=0. + vmcl(i)=0. + dpsum=0. + if(ierr(i) > 0 ) cycle + do k=kts+1,ktop(i)-1 + trash =-(po_cup(i,k)-po_cup(i,kts)) + if(trash.gt.300..and. trash.lt.600.)then + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + umcl(i)=umcl(i)+us(i,k)*dp + vmcl(i)=vmcl(i)+us(i,k)*dp + dpsum=dpsum+dp + endif + enddo + if(dpsum > 0.) then + umcl(i)=umcl(i)/dpsum + vmcl(i)=vmcl(i)/dpsum + MCL_speed= sqrt( umcl(i)**2 + vmcl(i)**2 ) + aux = (MCL_speed + vcpool(i))/(MCL_speed+1.e-6) + umcl(i) = aux * umcl(i) + vmcl(i) = aux * vmcl(i) + endif + enddo + ! --- gust front momentum impact + do i=its,itf + if(ierr(i) > 0 .or. vcpool(i) .le.0.) cycle + k=kts + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + outu(i,k) = outu(i,k) + edto(i)*zdo(i,k+1)*umcl(i)*g/dp*xmb(i) + outv(i,k) = outv(i,k) + edto(i)*zdo(i,k+1)*vmcl(i)*g/dp*xmb(i) + do k=kts+1,kdet(i) + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + outu(i,k) = outu(i,k) + edto(i)*dd_massdetro(i,k)*umcl(i)*g/dp*xmb(i) + outv(i,k) = outv(i,k) + edto(i)*dd_massdetro(i,k)*vmcl(i)*g/dp*xmb(i) + enddo + enddo + endif ! icoldpool + if(icoldpool == 1)vcpool(:)=0. + ! rain evaporation as in sas ! if(irainevap.eq.1)then @@ -2142,6 +2229,8 @@ subroutine cu_c3_deep_run( & if(ierr(i).eq.0)then evef = edt(i) * evfact * sig(i)**2 if(xland(i).gt.0.5 .and. xland(i).lt.1.5) evef = edt(i) * evfactl * sig(i)**2 + !evef=.09 + !evef=.9 !$acc loop seq do k = ktop(i), 1, -1 rain = pwo(i,k) + edto(i) * pwdo(i,k) @@ -4228,7 +4317,7 @@ end subroutine cup_output_ens_3d !> Calculates moisture properties of the updraft. subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & p_cup,kbcon,ktop,dby,clw_all,xland1, & - q,gamma_cup,zu,qes_cup,k22,qe_cup,c0, & + q,gamma_cup,zu,qes_cup,k22,qe_cup,c0,jmin, & zqexec,ccn,ccnclean,rho,c1d,t,autoconv, & up_massentr,up_massdetr,psum,psumh, & itest,itf,ktf, & @@ -4267,7 +4356,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ! entr= entrainment rate integer, dimension (its:) & ,intent (in ) :: & - kbcon,ktop,k22,xland1 + kbcon,ktop,k22,xland1,jmin !$acc declare copyin(p_cup,rho,q,zu,gamma_cup,qe_cup,up_massentr,up_massdetr,dby,qes_cup,z_cup,zqexec,c0,kbcon,ktop,k22,xland1) real(kind=kind_phys), intent (in ) :: & ! HCB ccnclean @@ -4490,16 +4579,17 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & clw_allh(i,k)=max(0.,qch(i,k)-qrch) qrcb(i,k)=max(0.,(qch(i,k)-qrch)) ! /(1.+c0(i)*dz*zu(i,k)) if(is_deep)then - clwdet=0.1 !0.02 ! 05/11/2021 - !if(k.lt.kklev(i)) clwdet=0. ! 05/05/2021 + clwdet=1.2 !0.1 !0.02 else - clwdet=0.1 !0.02 ! 05/05/2021 - !if(k.lt.kklev(i)) clwdet=0. ! 05/25/2021 + clwdet=1.2 !0.1 !0.02 + endif + if (k.gt.jmin(i))then + clwdet=2. endif if(k.gt.kbcon(i)+1)c1d(i,k)=clwdet*up_massdetr(i,k-1) if(k.gt.kbcon(i)+1)c1d_b(i,k)=clwdet*up_massdetr(i,k-1) - c1d(i,k)=0.005 - c1d_b(i,k)=0.005 + !c1d(i,k)=0.005 + !c1d_b(i,k)=0.005 if(autoconv.eq.2) then ! diff --git a/physics/CONV/C3/cu_c3_driver.F90 b/physics/CONV/C3/cu_c3_driver.F90 index a08d47463..0ea8be075 100644 --- a/physics/CONV/C3/cu_c3_driver.F90 +++ b/physics/CONV/C3/cu_c3_driver.F90 @@ -228,10 +228,10 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real(kind=kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten real(kind=kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg real(kind=kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm - real(kind=kind_phys), dimension (im) :: umean,vmean,pmean + real(kind=kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh real(kind=kind_phys), dimension (im) :: xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv !$acc declare create(qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,tn,qo,tshall,qshall,dz8w,omeg, & -!$acc z1,psur,cuten,cutens,cutenm,umean,vmean,pmean, & +!$acc z1,psur,cuten,cutens,cutenm,umean,vmean,pmean,mc_thresh, & !$acc xmbs,xmbs2,xmb,xmbm,xmb_dumm,mconv) integer :: i,j,k,icldck,ipr,jpr,jpr_deep,ipr_deep,uidx,vidx,tidx,qidx @@ -603,6 +603,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& hfx(i)=hfx2(i)*cp*rhoi(i,1) qfx(i)=qfx2(i)*xlv*rhoi(i,1) dx(i) = sqrt(garea(i)) + mc_thresh(i)=3.25/dx(i) enddo do i=its,itf @@ -788,7 +789,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! betwee -1 and +1 ,do_cap_suppress_here,cap_suppress_j & ,k22m & - ,jminm,tropics) + ,jminm,mc_thresh) !$acc kernels do i=its,itf do k=kts,ktf @@ -882,7 +883,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! betwee -1 and +1 ,do_cap_suppress_here,cap_suppress_j & ,k22 & - ,jmin,tropics) + ,jmin,mc_thresh) jpr=0 ipr=0 !$acc kernels diff --git a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 index b945b9328..3317136fd 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 @@ -142,7 +142,7 @@ subroutine cu_gf_deep_run( & !! betwee -1 and +1 ,do_capsuppress,cap_suppress_j & ! ,k22 & ! - ,jmin,kdt,tropics) ! + ,jmin,kdt,mc_thresh) ! implicit none @@ -181,16 +181,16 @@ subroutine cu_gf_deep_run( & !$acc declare copy(cnvwt,outu,outv,outt,outq,outqc,cupclw,frh_out,pre,xmb_out) real(kind=kind_phys), dimension (its:ite) & ,intent (in ) :: & - hfx,qfx,xmbm_in,xmbs_in -!$acc declare copyin(hfx,qfx,xmbm_in,xmbs_in) + mc_thresh,hfx,qfx,xmbm_in,xmbs_in +!$acc declare copyin(mc_thresh,hfx,qfx,xmbm_in,xmbs_in) integer, dimension (its:ite) & ,intent (inout ) :: & kbcon,ktop !$acc declare copy(kbcon,ktop) integer, dimension (its:ite) & ,intent (in ) :: & - kpbl,tropics -!$acc declare copyin(kpbl,tropics) + kpbl +!$acc declare copyin(kpbl) ! ! basic environmental input includes moisture convergence (mconv) ! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off @@ -496,7 +496,7 @@ subroutine cu_gf_deep_run( & if(imid.eq.1)then c0(i)=0.002 endif - if(kdt.le.(4500./dtime))rrfs_factor(i)=1.-(float(kdt)/(4500./dtime)-1.)**2 +! if(kdt.le.(4500./dtime))rrfs_factor(i)=1.-(float(kdt)/(4500./dtime)-1.)**2 enddo !$acc end kernels @@ -573,15 +573,15 @@ subroutine cu_gf_deep_run( & ! !$acc kernels start_level(:)=kte + frh_out(:) = 0. !$acc end kernels !$acc kernels !$acc loop private(radius,frh) do i=its,ite c1d(i,:)= 0. !c1 ! 0. ! c1 ! max(.003,c1+float(csum(i))*.0001) - entr_rate(i)=7.e-5 - min(20.,float(csum(i))) * 3.e-6 - if(xland1(i) == 0)entr_rate(i)=7.e-5 - if(dx(i) Date: Tue, 11 Feb 2025 10:11:43 -0500 Subject: [PATCH 2/3] remove changes to ci and CMakeLists.txt that aren't needed --- .github/workflows/ci_fv3_ccpp_prebuild.yml | 2 +- CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_fv3_ccpp_prebuild.yml b/.github/workflows/ci_fv3_ccpp_prebuild.yml index b23c9977e..a5c2f8092 100644 --- a/.github/workflows/ci_fv3_ccpp_prebuild.yml +++ b/.github/workflows/ci_fv3_ccpp_prebuild.yml @@ -24,7 +24,7 @@ jobs: run: echo "GIT_REMOTE_HASH=`git rev-parse HEAD`" >> $GITHUB_ENV - name: Checkout latest fv3atm - run: git clone https://github.com/NCAR/fv3atm.git + run: git clone https://github.com/NOAA-EMC/fv3atm.git - name: Initialize submodules run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 62b2d06df..061ba840d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,9 +143,9 @@ SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS} if(CMAKE_BUILD_TYPE STREQUAL "Release" AND (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM")) # Define a list of schemes that need lower optimization with Intel in Release mode set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90 + module_mp_nssl_2mom.F90 mynnedmf_wrapper.F90 - gcycle.F90 - module_mp_nssl_2mom.F90) + gcycle.F90) foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_LOWER_OPTIMIZATION) set(SCHEMES_TMP ${SCHEMES}) # Need to determine the name of the scheme with its path From 21469fd87c997a9fe803560cae5a93f01b94ff72 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 11 Feb 2025 10:18:55 -0500 Subject: [PATCH 3/3] update SCM doc link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0573a6342..60ba98449 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Please see more information about the CCPP at the locations below. - [CCPP Physics GitHub wiki](https://github.com/NCAR/ccpp-physics/wiki) - [CCPP Framework GitHub wiki](https://github.com/NCAR/ccpp-framework/wiki) -For the use of CCPP with its Single Column Model, see the [Single Column Model User's Guide](https://dtcenter.org/sites/default/files/paragraph/scm-ccpp-guide-v6-0-0.pdf). +For the use of CCPP with its Single Column Model, see the [Single Column Model User's Guide](https://ccpp-scm.readthedocs.io/en/latest/). For the use of CCPP with NOAA's Unified Forecast System (UFS), see the [UFS Medium-Range Application User's Guide](https://ufs-mrweather-app.readthedocs.io/en/latest), the [UFS Short-Range Application User's Guide](https://ufs-srweather-app.readthedocs.io/en/latest) and the [UFS Weather Model User's Guide](https://ufs-weather-model.readthedocs.io/en/latest).