Skip to content

Commit

Permalink
Merge branch 'progc_update' into ufs-dev-PR18
Browse files Browse the repository at this point in the history
  • Loading branch information
Grant Firl authored and Grant Firl committed Dec 20, 2022
2 parents 05b1682 + eefb777 commit 4fb7ef9
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 31 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci_fv3_ccpp_prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: CI test to run FV3 ccpp_prebuild step
on: [push, pull_request]

jobs:
build-linux:
ccpp-prebuild-FV3:

# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
max-parallel: 5
runs-on: ubuntu-20.04

steps:
- name: Checkout current ccpp-physics code
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_scm_ccpp_prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: CI test to run SCM ccpp_prebuild step
on: [push, pull_request]

jobs:
build-linux:
ccpp-prebuild-SCM:

# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
max-parallel: 5
runs-on: ubuntu-20.04

steps:

Expand Down
5 changes: 5 additions & 0 deletions physics/module_sf_noahmp_glacier.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,11 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso
! 2m air temperature
ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
cq2b = ehb2
! for opt_sfc 3
if (opt_sfc ==3) then
ehb2 = fv*vkc/fh2
cq2b = ehb2
endif

if (opt_sfc == 4) then
ehb2 = ch2 * wspd1i ! need conductance,z0h from sfcdif4
Expand Down
24 changes: 22 additions & 2 deletions physics/module_sf_noahmplsm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4289,13 +4289,19 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , &
! qfx = (qsfc-qair)*rhoair*caw !*cpair/gammag

! 2m temperature over vegetation ( corrected for low cq2v values )
if (opt_sfc == 1 .or. opt_sfc == 2 .or. opt_sfc ==3 ) then
if (opt_sfc == 1 .or. opt_sfc == 2 ) then
! cah2 = fv*1./vkc*log((2.+z0h)/z0h)
cah2 = fv*vkc/log((2.+z0h)/z0h)
cah2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
cq2v = cah2
endif

! opt_sfc 3: fh2 is the stability
if (opt_sfc ==3) then
cah2 = fv*vkc/fh2
cq2v = cah2
endif

if (opt_sfc == 4 ) then
rahc2 = max(1.,1./(ch2v*wspdv))
rawc2 = rahc2
Expand Down Expand Up @@ -4742,7 +4748,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
!jref:start; errors in original equation corrected.
! 2m air temperature

if(opt_sfc == 1 .or. opt_sfc ==2 .or. opt_sfc == 3) then
if(opt_sfc == 1 .or. opt_sfc ==2 ) then
ehb2 = fv*vkc/log((2.+z0h)/z0h)
ehb2 = fv*vkc/(log((2.+z0h)/z0h)-fh2)
cq2b = ehb2
Expand All @@ -4756,6 +4762,20 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
if (parameters%urban_flag) q2b = qsfc
end if

! opt_sfc 3: fh2 is the stability
if(opt_sfc == 3 ) then
ehb2 = fv*vkc/fh2
cq2b = ehb2
if (ehb2.lt.1.e-5 ) then
t2mb = tgb
q2b = qsfc
else
t2mb = tgb - shb/(rhoair*cpair) * 1./ehb2
q2b = qsfc - evb/(lathea*rhoair)*(1./cq2b + rsurf)
endif
if (parameters%urban_flag) q2b = qsfc
end if

if(opt_sfc == 4) then ! consistent with veg

rahb2 = max(1.,1./(ch2b*wspdb))
Expand Down
5 changes: 3 additions & 2 deletions physics/progsigma_calc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, &
epsilon=1.E-11
km1=km-1
betadcu = 2.0
betascu = 3.6
betascu = 8.0
invdelt = 1./delt

!Initialization 2D
Expand Down Expand Up @@ -210,17 +210,18 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, &
enddo

!Reduce area fraction before coupling back to mass-flux computation.
!This tuning could be addressed in updraft velocity equation instead.
if(flag_shallow)then
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betascu
sigmab(i)=MAX(0.03,sigmab(i))
endif
enddo
else
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betadcu
sigmab(i)=MAX(0.01,sigmab(i))
endif
enddo
endif
Expand Down
24 changes: 17 additions & 7 deletions physics/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
! parameter(cinacrmx=-120.,cinacrmn=-120.)
parameter(cinacrmx=-120.,cinacrmn=-80.)
parameter(bet1=1.875,cd1=.506,f1=2.0,gam1=.5)
parameter(betaw=.03,dxcrtuf=15.e3)
parameter(betaw=.03)

!
! local variables and arrays
Expand Down Expand Up @@ -2468,8 +2468,10 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
!
if(progsigma)then
dxcrtas=30.e3
dxcrtuf=10.e3
else
dxcrtas=8.e3
dxcrtuf=15.e3
endif


Expand Down Expand Up @@ -3519,9 +3521,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
if(k > kb(i) .and. k < ktop(i)) then
tem = 0.5 * (eta(i,k-1) + eta(i,k)) * xmb(i)
tem1 = pfld(i,k) * 100. / (rd * t1(i,k))
sigmagfm(i) = max(sigmagfm(i), betaw)
ptem = tem / (sigmagfm(i) * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*sigmagfm(i)*ptem*ptem
if(progsigma)then
tem2 = sigmab(i)
else
tem2 = max(sigmagfm(i), betaw)
endif
ptem = tem / (tem2 * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*tem2*ptem*ptem
endif
endif
enddo
Expand All @@ -3533,9 +3539,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
if(k > 1 .and. k <= jmin(i)) then
tem = 0.5*edto(i)*(etad(i,k-1)+etad(i,k))*xmb(i)
tem1 = pfld(i,k) * 100. / (rd * t1(i,k))
sigmagfm(i) = max(sigmagfm(i), betaw)
ptem = tem / (sigmagfm(i) * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*sigmagfm(i)*ptem*ptem
if(progsigma)then
tem2 = sigmab(i)
else
tem2 = max(sigmagfm(i), betaw)
endif
ptem = tem / (tem2 * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*tem2*ptem*ptem
endif
endif
enddo
Expand Down
18 changes: 14 additions & 4 deletions physics/samfshalcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
parameter(cinacrmx=-120.,shevf=2.0)
parameter(dtmax=10800.,dtmin=600.)
parameter(bet1=1.875,cd1=.506,f1=2.0,gam1=.5)
parameter(betaw=.03,dxcrt=15.e3,dxcrtc0=9.e3)
parameter(betaw=.03,dxcrtc0=9.e3)
parameter(h1=0.33333333)
! progsigma
parameter(dxcrtas=30.e3)
Expand Down Expand Up @@ -258,6 +258,12 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
cinacrmn=-80.
endif

if (progsigma) then
dxcrt=10.e3
else
dxcrt=15.e3
endif

c-----------------------------------------------------------------------
if (.not.hwrf_samfshal) then
!> ## Determine whether to perform aerosol transport
Expand Down Expand Up @@ -2449,9 +2455,13 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
if(k > kb(i) .and. k < ktop(i)) then
tem = 0.5 * (eta(i,k-1) + eta(i,k)) * xmb(i)
tem1 = pfld(i,k) * 100. / (rd * t1(i,k))
sigmagfm(i) = max(sigmagfm(i), betaw)
ptem = tem / (sigmagfm(i) * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*sigmagfm(i)*ptem*ptem
if(progsigma)then
tem2 = sigmab(i)
else
tem2 = max(sigmagfm(i), betaw)
endif
ptem = tem / (tem2 * tem1)
qtr(i,k,ntk)=qtr(i,k,ntk)+0.5*tem2*ptem*ptem
endif
endif
enddo
Expand Down
16 changes: 8 additions & 8 deletions physics/sfc_diag_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con
errmsg = ''
errflg = 0

! if (lsm == lsm_noahmp) then
! do i=1,im
! if(dry(i)) then
! t2m(i) = t2mmp(i)
! q2m(i) = q2mp(i)
! endif
! enddo
! endif
if (lsm == lsm_noahmp) then
do i=1,im
if(dry(i)) then
t2m(i) = t2mmp(i)
q2m(i) = q2mp(i)
endif
enddo
endif

if (lssav) then
do i=1,im
Expand Down

0 comments on commit 4fb7ef9

Please sign in to comment.