Skip to content

Commit 791c6d6

Browse files
Merge pull request #2 from dustinswales/move_stmt_to_init
move setting of flag from run to init phase
2 parents 12b400a + 81563de commit 791c6d6

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

physics/cu_c3_driver.F90

+14-12
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,31 @@ module cu_c3_driver
3030
!! \htmlinclude cu_c3_driver_init.html
3131
!!
3232
subroutine cu_c3_driver_init(imfshalcnv, imfshalcnv_c3, imfdeepcnv, &
33-
imfdeepcnv_c3,mpirank, mpiroot, errmsg, errflg)
33+
imfdeepcnv_c3,progsigma, cnx, mpirank, mpiroot, &
34+
errmsg, errflg)
3435

3536
implicit none
3637

3738
integer, intent(in) :: imfshalcnv, imfshalcnv_c3
3839
integer, intent(in) :: imfdeepcnv, imfdeepcnv_c3
3940
integer, intent(in) :: mpirank
4041
integer, intent(in) :: mpiroot
42+
integer, intent(in) :: cnx
43+
logical, intent(inout) :: progsigma
4144
character(len=*), intent( out) :: errmsg
4245
integer, intent( out) :: errflg
4346

4447
! initialize ccpp error handling variables
4548
errmsg = ''
4649
errflg = 0
4750

51+
if(progsigma)then
52+
if(cnx < 384)then
53+
progsigma=.false.
54+
write(*,*)'Forcing prognostic closure to .false. due to coarse resolution'
55+
endif
56+
endif
57+
4858
end subroutine cu_c3_driver_init
4959

5060
!
@@ -58,7 +68,7 @@ end subroutine cu_c3_driver_init
5868
!!
5969
!>\section gen_c3_driver Grell-Freitas Cumulus Scheme Driver General Algorithm
6070
subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
61-
do_ca,progsigma,cnx,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, &
71+
do_ca,progsigma,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, &
6272
forceqv_spechum,phil,delp,raincv,tmf,qmicro,sigmain, &
6373
betascu,betamcu,betadcu,qv_spechum,t,cld1d,us,vs,t2di,w, &
6474
qv2di_spechum,p2di,psuri, &
@@ -93,14 +103,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
93103
integer :: ishallow_g3 ! depend on imfshalcnv
94104
!-------------------------------------------------------------
95105
integer :: its,ite, jts,jte, kts,kte
96-
integer, intent(in ) :: im,km,ntracer,cnx
106+
integer, intent(in ) :: im,km,ntracer
97107
integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in
98108
logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf
99109
logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, &
100110
do_ca
101111
real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu
102112
logical, intent(in ) :: ldiag3d
103-
logical, intent(inout) :: progsigma
113+
logical, intent(in ) :: progsigma
104114
real(kind=kind_phys), intent(inout) :: dtend(:,:,:)
105115
!$acc declare copy(dtend)
106116
integer, intent(in) :: dtidx(:,:), &
@@ -280,14 +290,6 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
280290
!$acc end kernels
281291
endif
282292

283-
284-
if(progsigma)then
285-
if(cnx < 384)then
286-
progsigma=.false.
287-
write(*,*)'Forcing prognostic closure to .false. due to coarse resolution'
288-
endif
289-
endif
290-
291293
if(ldiag3d) then
292294
if(flag_for_dcnv_generic_tend) then
293295
cliw_deep_idx=0

physics/cu_c3_driver.meta

+14-7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@
4949
dimensions = ()
5050
type = integer
5151
intent = in
52+
[progsigma]
53+
standard_name = do_prognostic_updraft_area_fraction
54+
long_name = flag for prognostic sigma in cumuls scheme
55+
units = flag
56+
dimensions = ()
57+
type = logical
58+
intent = inout
59+
[cnx]
60+
standard_name = number_of_x_points_for_current_cubed_sphere_tile
61+
long_name = number of points in x direction for this cubed sphere face
62+
units = count
63+
dimensions = ()
64+
type = integer
65+
intent = in
5266
[errmsg]
5367
standard_name = ccpp_error_message
5468
long_name = error message for error handling in CCPP
@@ -133,13 +147,6 @@
133147
units = flag
134148
dimensions = ()
135149
type = logical
136-
intent = inout
137-
[cnx]
138-
standard_name = number_of_x_points_for_current_cubed_sphere_tile
139-
long_name = number of points in x direction for this cubed sphere face
140-
units = count
141-
dimensions = ()
142-
type = integer
143150
intent = in
144151
[cactiv]
145152
standard_name = counter_for_grell_freitas_convection

0 commit comments

Comments
 (0)