From 04074884c04139ecc86d02f0123a0aa2f5a8ccb1 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Thu, 20 Jun 2024 19:52:56 +0000 Subject: [PATCH 1/4] Output updraft value of convective cloud condensate --- physics/CONV/SAMF/samfdeepcnv.f | 5 ++++- physics/CONV/SAMF/samfshalcnv.f | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 7c2d9acf8..90ff4dfd4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3430,7 +3430,10 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & do i = 1, im if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index f720c4701..41f0124c6 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,7 +2405,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - endif + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + endif endif enddo enddo From b73269fcd3660b5c69cc110f796ef4a4b4e227be Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 18:08:51 +0000 Subject: [PATCH 2/4] update xkinv1 to 0.15 --- physics/PBL/SATMEDMF/satmedmfvdifq.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.F b/physics/PBL/SATMEDMF/satmedmfvdifq.F index 95a1e35e5..c0e43e809 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.F +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.F @@ -275,7 +275,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=1000.) parameter(qlcr=3.5e-5,zstblmax=2500.) - parameter(xkinv1=0.4,xkinv2=0.3) + parameter(xkinv1=0.15,xkinv2=0.3) parameter(h1=0.33333333,hcrinv=250.) parameter(vegflo=0.1,vegfup=1.0,z0lo=0.1,z0up=1.0) parameter(vc0=1.0,zc0=1.0) From 891959c2680b91ba745e4edbd7a7c98e17101d12 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 21:03:28 +0000 Subject: [PATCH 3/4] add check if progsigma is true --- physics/CONV/SAMF/samfdeepcnv.f | 10 +++++++--- physics/CONV/SAMF/samfshalcnv.f | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 90ff4dfd4..be43795b4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3431,9 +3431,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index 41f0124c6..fa9d77a53 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,9 +2405,13 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo From 1e9b0dd6c9c9da577349e02c1bb6fc912d29ceba Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 16 Jul 2024 16:20:14 +0000 Subject: [PATCH 4/4] address seg fault if progsigma=F --- physics/CONV/SAMF/samfdeepcnv.f | 33 +++++++++++++++----------- physics/CONV/SAMF/samfshalcnv.f | 42 +++++++++++++++++---------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index be43795b4..3ad067657 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -215,7 +215,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), - & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km) + & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km), + & sigmaoutx(im) real(kind=kind_phys) gravinv,invdelt,sigmind,sigminm,sigmins parameter(sigmind=0.01,sigmins=0.03,sigminm=0.01) logical flag_shallow, flag_mid @@ -3423,24 +3424,28 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & endif enddo c -c convective cloud water +! + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif c !> - Calculate convective cloud water. do k = 1, km - do i = 1, im - if (cnvflg(i) .and. rn(i) > 0.) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + do i = 1, im + if (cnvflg(i) .and. rn(i) > 0.) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if(progsigma)then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif endif endif - endif - enddo + enddo enddo c c convective cloud cover diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index fa9d77a53..ce783ea15 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -162,7 +162,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), & omegac(im),zeta(im,km),dbyo1(im,km), - & sigmab(im),qadv(im,km) + & sigmab(im),qadv(im,km),sigmaoutx(im) real(kind=kind_phys) gravinv,dxcrtas,invdelt,sigmind,sigmins, & sigminm logical flag_shallow,flag_mid @@ -2397,27 +2397,29 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & endif enddo c -c convective cloud water -c -!> - Calculate shallow convective cloud water. + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif + +c convective cloud water do k = 1, km - do i = 1, im - if (cnvflg(i)) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) - endif - endif - endif - enddo + do i = 1, im + if (cnvflg(i)) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if (progsigma) then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif + endif + endif + enddo enddo - -c +c c convective cloud cover c !> - Calculate convective cloud cover, which is used when pdf-based cloud fraction is used (i.e., pdfcld=.true.).