Skip to content

Commit

Permalink
Merge pull request #225 from JiliDong-NOAA/sigmab_fix
Browse files Browse the repository at this point in the history
[production/RRFS.v1]saSAS sigmab initialization modification during the first timestep
  • Loading branch information
grantfirl authored Jan 27, 2025
2 parents cfe8a0c + b2d5032 commit c197599
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
7 changes: 4 additions & 3 deletions physics/CONV/SAMF/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
& clam,c0s,c1,betal,betas,evef,pgcon,asolfac, &
& do_ca, ca_closure, ca_entr, ca_trigger, nthresh,ca_deep, &
& rainevap,sigmain,sigmaout,betadcu,betamcu,betascu, &
& maxMF, do_mynnedmf,errmsg,errflg)
& maxMF, do_mynnedmf,sigmab_coldstart,errmsg,errflg)
!
use machine , only : kind_phys
use funcphys , only : fpvs
Expand All @@ -100,7 +100,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
& prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:)
real(kind=kind_phys), dimension(:), intent(in) :: fscav
logical, intent(in) :: first_time_step,restart,hwrf_samfdeep, &
& progsigma,do_mynnedmf
& progsigma,do_mynnedmf,sigmab_coldstart
real(kind=kind_phys), intent(in) :: nthresh,betadcu,betamcu, &
& betascu
real(kind=kind_phys), intent(in) :: ca_deep(:)
Expand Down Expand Up @@ -2915,7 +2915,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, &
if(progsigma)then

!Initial computations, dynamic q-tendency
if(first_time_step .and. .not.restart)then
if(first_time_step .and. (.not.restart
& .or. sigmab_coldstart))then
do k = 1,km
do i = 1,im
qadv(i,k)=0.
Expand Down
7 changes: 7 additions & 0 deletions physics/CONV/SAMF/samfdeepcnv.meta
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,13 @@
dimensions = ()
type = logical
intent = in
[sigmab_coldstart]
standard_name = flag_to_cold_start_for_sigmab_init
long_name = flag to cold start for sigmab initialization
units = flag
dimensions = ()
type = logical
intent = in
[qlcn]
standard_name = mass_fraction_of_convective_cloud_liquid_water
long_name = mass fraction of convective cloud liquid water
Expand Down
20 changes: 9 additions & 11 deletions physics/CONV/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,flag_shallow,&

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

!Parameters
gcvalmx = 0.1
Expand All @@ -63,6 +63,12 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
km1=km-1
invdelt = 1./delt

if (flag_init) then
sigmind_new=0.0
else
sigmind_new=sigmind
end if

!Initialization 2D
do k = 1,km
do i = 1,im
Expand Down Expand Up @@ -168,13 +174,6 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
enddo

!sigmab
if(flag_init .and. .not. flag_restart)then
do i = 1,im
if(cnvflg(i))then
sigmab(i)=0.03
endif
enddo
else
do i = 1,im
if(cnvflg(i))then
DEN=MIN(termC(i)+termB(i),1.E8)
Expand All @@ -186,11 +185,10 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
sigmab(i)=(ZZ*(termA(i)+cvg))/(DEN+(1.0-ZZ))
if(sigmab(i)>0.)then
sigmab(i)=MIN(sigmab(i),0.95)
sigmab(i)=MAX(sigmab(i),0.01)
sigmab(i)=MAX(sigmab(i),sigmind_new)
endif
endif!cnvflg
enddo
endif

do k=1,km
do i=1,im
Expand Down Expand Up @@ -219,7 +217,7 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,&
do i= 1, im
if(cnvflg(i)) then
sigmab(i)=sigmab(i)/betadcu
sigmab(i)=MAX(sigmind,sigmab(i))
sigmab(i)=MAX(sigmind_new,sigmab(i))
endif
enddo
endif
Expand Down

0 comments on commit c197599

Please sign in to comment.