Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix and optimization of prognostic closure for the P8 physics suite #967

Merged
merged 3 commits into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions physics/GFS_MP_generic_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ module GFS_MP_generic_pre
!> \section arg_table_GFS_MP_generic_pre_run Argument Table
!! \htmlinclude GFS_MP_generic_pre_run.html
!!
subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, &
subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, progsigma, ntcw, nncl, &
ntrac, gt0, gq0, save_t, save_q, num_dfi_radar, errmsg, errflg)
!
use machine, only: kind_phys

implicit none
integer, intent(in) :: im, levs, ntcw, nncl, ntrac, num_dfi_radar
logical, intent(in) :: ldiag3d, qdiag3d, do_aw
logical, intent(in) :: ldiag3d, qdiag3d, do_aw, progsigma
real(kind=kind_phys), dimension(:,:), intent(in) :: gt0
real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0

Expand All @@ -39,7 +39,7 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl,
enddo
enddo
endif
if (ldiag3d .or. do_aw) then
if (ldiag3d .or. do_aw .or. progsigma) then
if(qdiag3d) then
do n=1,ntrac
do k=1,levs
Expand All @@ -48,7 +48,7 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl,
enddo
enddo
enddo
else if(do_aw) then
else if(do_aw .or. progsigma) then
! if qdiag3d, all q are saved already
save_q(1:im,:,1) = gq0(1:im,:,1)
do n=ntcw,ntcw+nncl-1
Expand All @@ -59,4 +59,4 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl,

end subroutine GFS_MP_generic_pre_run

end module GFS_MP_generic_pre
end module GFS_MP_generic_pre
7 changes: 7 additions & 0 deletions physics/GFS_MP_generic_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
dimensions = ()
type = logical
intent = in
[progsigma]
standard_name = do_prognostic_updraft_area_fraction
long_name = flag for prognostic area fraction in cumulus convection
units = flag
dimensions = ()
type = logical
intent = in
[ntcw]
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
long_name = tracer index for cloud condensate (or liquid water)
Expand Down
30 changes: 19 additions & 11 deletions physics/progsigma_calc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
!> @{

subroutine progsigma_calc (im,km,flag_init,flag_restart, &
del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, &
delt,prevsq,q,kbcon1,ktcon,cnvflg,sigmain,sigmaout, &
flag_shallow,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, &
delt,prevsq,q,kbcon1,ktcon,cnvflg,sigmain,sigmaout, &
sigmab,errmsg,errflg)
!
!
Expand All @@ -30,7 +30,7 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, &
real(kind=kind_phys), intent(in) :: prevsq(im,km), q(im,km),del(im,km), &
qmicro(im,km),tmf(im,km),dbyo1(im,km),zdqca(im,km), &
omega_u(im,km),zeta(im,km)
logical, intent(in) :: flag_init,flag_restart,cnvflg(im)
logical, intent(in) :: flag_init,flag_restart,cnvflg(im),flag_shallow
real(kind=kind_phys), intent(in) :: sigmain(im,km)

! intent out
Expand All @@ -48,14 +48,15 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, &

real(kind=kind_phys) :: gcvalmx,epsilon,ZZ,cvg,mcon,buy2, &
fdqb,dtdyn,dxlim,rmulacvg,tem, &
DEN,betascu,dp1,invdelt
DEN,betascu,betadcu,dp1,invdelt

!Parameters
gcvalmx = 0.1
rmulacvg=10.
epsilon=1.E-11
km1=km-1
betascu = 3.0
betadcu = 2.0
betascu = 3.6
invdelt = 1./delt

!Initialization 2D
Expand Down Expand Up @@ -212,12 +213,19 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, &

!Reduce area fraction before coupling back to mass-flux computation.
!This tuning could be addressed in updraft velocity equation instead.
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betascu
endif
enddo

if(flag_shallow)then
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betascu
endif
enddo
else
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betadcu
endif
enddo
endif


end subroutine progsigma_calc
Expand Down
4 changes: 3 additions & 1 deletion physics/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
real(kind=kind_phys) omega_u(im,km),zdqca(im,km),qlks(im,km),
& omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im)
real(kind=kind_phys) gravinv
logical flag_shallow
c physical parameters
! parameter(grav=grav,asolfac=0.958)
! parameter(elocp=hvap/cp,el2orc=hvap*hvap/(rv*cp))
Expand Down Expand Up @@ -2882,7 +2883,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &

!> - From Bengtsson et al. (2022) Prognostic closure scheme, equation 8, compute updraft area fraction based on a moisture budget
if(progsigma)then
call progsigma_calc(im,km,first_time_step,restart,
flag_shallow = .false.
call progsigma_calc(im,km,first_time_step,restart,flag_shallow,
& del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap,delt,
& prevsq,q,kbcon1,ktcon,cnvflg,
& sigmain,sigmaout,sigmab,errmsg,errflg)
Expand Down
5 changes: 3 additions & 2 deletions physics/samfshalcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
& omegac(im),zeta(im,km),dbyo1(im,km),
& sigmab(im)
real(kind=kind_phys) gravinv,dxcrtas

logical flag_shallow
c physical parameters
! parameter(g=grav,asolfac=0.89)
! parameter(g=grav)
Expand Down Expand Up @@ -1929,7 +1929,8 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, &
c
c Prognostic closure
if(progsigma)then
call progsigma_calc(im,km,first_time_step,restart,
flag_shallow = .true.
call progsigma_calc(im,km,first_time_step,restart,flag_shallow,
& del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap,delt,
& prevsq,q,kbcon1,ktcon,cnvflg,
& sigmain,sigmaout,sigmab,errmsg,errflg)
Expand Down