@@ -80,7 +80,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
8080 fhour ,fh_dfi_radar ,ix_dfi_radar ,num_dfi_radar ,cap_suppress , &
8181 dfi_radar_max_intervals ,ldiag3d ,qci_conv ,do_cap_suppress , &
8282 sigmaout ,maxupmf ,maxMF ,do_mynnedmf ,ichoice_in ,ichoicem_in , &
83- ichoice_s_in ,errmsg ,errflg )
83+ ichoice_s_in ,ten_t , ten_u , ten_v , ten_q , dcliw , dclcw , errmsg ,errflg )
8484!- ------------------------------------------------------------
8585 implicit none
8686 integer , parameter :: maxiens= 1
@@ -120,11 +120,11 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
120120 real (kind= kind_phys), dimension ( : , : ), intent (in ), optional :: forcet,forceqv_spechum
121121 real (kind= kind_phys), dimension ( : , : ), intent (in ) :: w,phil,delp
122122 real (kind= kind_phys), dimension ( : , : ), intent (in ), optional :: sigmain,qmicro
123- real (kind= kind_phys), dimension ( : , : ), intent (inout ) :: t,us,vs
123+ real (kind= kind_phys), dimension ( : , : ), intent (in ) :: t,us,vs
124124 real (kind= kind_phys), dimension ( : , : ), intent (inout ), optional :: qci_conv
125125 real (kind= kind_phys), dimension ( : , : ), intent (out ) :: cnvw_moist,cnvc
126126 real (kind= kind_phys), dimension ( : , : ), intent (out ), optional :: sigmaout
127- real (kind= kind_phys), dimension ( : , : ), intent (inout ) :: cliw, clcw
127+ real (kind= kind_phys), dimension ( : , : ), intent (in ) :: cliw, clcw
128128 real (kind= kind_phys), dimension ( : , : , :), intent (in ) :: tmf
129129! $acc declare copyin(forcet,forceqv_spechum,w,phil)
130130! $acc declare copy(t,us,vs,qci_conv,cliw, clcw)
@@ -158,7 +158,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
158158! $acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d)
159159 ! Specific humidity from FV3
160160 real (kind= kind_phys), dimension (:,:), intent (in ) :: qv2di_spechum
161- real (kind= kind_phys), dimension (:,:), intent (inout ) :: qv_spechum
161+ real (kind= kind_phys), dimension (:,:), intent (in ) :: qv_spechum
162162 real (kind= kind_phys), dimension (:), intent (inout ), optional :: aod_gf
163163! $acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf)
164164 ! Local water vapor mixing ratios and cloud water mixing ratios
@@ -172,7 +172,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
172172 integer , intent (in ) :: imfshalcnv
173173 integer , dimension (:), intent (inout ), optional :: cactiv,cactiv_m
174174! $acc declare copy(cactiv,cactiv_m)
175-
175+ real (kind_phys), dimension (:,:), intent (out ) :: ten_t, ten_u, ten_v, dcliw, dclcw
176+ real (kind_phys), dimension (:,:,:), intent (out ) :: ten_q
177+
176178 character (len=* ), intent (out ) :: errmsg
177179 integer , intent (out ) :: errflg
178180
@@ -225,7 +227,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
225227! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off
226228! convection for this call only and at that particular gridpoint
227229!
228- real (kind= kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten
230+ real (kind= kind_phys), dimension (im,km) :: qcheck,zo,t2d,q2d,po,p2d,rhoi,clw_ten,new_qv_spechum,new_cliw,new_clcw
229231 real (kind= kind_phys), dimension (im,km) :: tn,qo,tshall,qshall,dz8w,omeg
230232 real (kind= kind_phys), dimension (im) :: z1,psur,cuten,cutens,cutenm
231233 real (kind= kind_phys), dimension (im) :: umean,vmean,pmean,mc_thresh
@@ -268,7 +270,16 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
268270 ! initialize ccpp error handling variables
269271 errmsg = ' '
270272 errflg = 0
271-
273+
274+ ten_t = 0.0
275+ ten_u = 0.0
276+ ten_v = 0.0
277+ ten_q = 0.0
278+ dcliw = 0.0
279+ dclcw = 0.0
280+ new_clcw = clcw
281+ new_cliw = cliw
282+
272283 ichoice = ichoice_in
273284 ichoicem = ichoicem_in
274285 ichoice_s = ichoice_s_in
@@ -956,11 +967,12 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
956967 cnvw(i,k)= cnvwt(i,k)* xmb(i)* dt+ cnvwts(i,k)* xmbs(i)* dt+ cnvwtm(i,k)* xmbm(i)* dt
957968 ud_mf(i,k)= cuten(i)* zu(i,k)* xmb(i)* dt
958969 dd_mf(i,k)= cuten(i)* zd(i,k)* edt(i)* xmb(i)* dt
959- t(i,k)= t(i,k)+ dt* (cutens(i)* outts(i,k)+ cutenm(i)* outtm(i,k)+ outt(i,k)* cuten(i))
970+
971+ ten_t(i,k) = cutens(i)* outts(i,k)+ cutenm(i)* outtm(i,k)+ outt(i,k)* cuten(i)
960972 qv(i,k)= max (1.e-16 ,qv(i,k)+ dt* (cutens(i)* outqs(i,k)+ cutenm(i)* outqm(i,k)+ outq(i,k)* cuten(i)))
961973 gdc(i,k,7 )= sqrt (us(i,k)** 2 + vs(i,k)** 2 )
962- us (i,k)= us(i,k) + outu(i,k)* cuten(i)* dt + outum(i,k)* cutenm(i)* dt + outus(i,k)* cutens(i)* dt
963- vs (i,k)= vs(i,k) + outv(i,k)* cuten(i)* dt + outvm(i,k)* cutenm(i)* dt + outvs(i,k)* cutens(i)* dt
974+ ten_u (i,k) = outu(i,k)* cuten(i) + outum(i,k)* cutenm(i) + outus(i,k)* cutens(i)
975+ ten_v (i,k) = outv(i,k)* cuten(i) + outvm(i,k)* cutenm(i) + outvs(i,k)* cutens(i)
964976
965977 gdc(i,k,1 )= max (0 .,tun_rad_shall(i)* cupclws(i,k)* cutens(i)) ! my mod
966978 ! gdc2(i,k,1)=max(0.,tun_rad_deep(i)*(cupclwm(i,k)*cutenm(i)+cupclw(i,k)*cuten(i)))
@@ -1005,10 +1017,13 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
10051017 )
10061018 tem1 = max (0.0 , min (1.0 , (tcr- t(i,k))* tcrf))
10071019 if (clcw(i,k) .gt. - 999.0 ) then
1008- cliw(i,k) = max (0 .,cliw(i,k) + tem * tem1) ! ice
1009- clcw(i,k) = max (0 .,clcw(i,k) + tem * (1.0 - tem1)) ! water
1020+ new_cliw(i,k) = max (0 .,cliw(i,k) + tem * tem1) ! ice
1021+ new_clcw(i,k) = max (0 .,clcw(i,k) + tem * (1.0 - tem1)) ! water
1022+ dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/ dt
1023+ dclcw(i,k) = (new_clcw(i,k) - clcw(i,k))/ dt
10101024 else
1011- cliw(i,k) = max (0 .,cliw(i,k) + tem)
1025+ new_cliw(i,k) = max (0 .,cliw(i,k) + tem)
1026+ dcliw(i,k) = (new_cliw(i,k) - cliw(i,k))/ dt
10121027 endif
10131028
10141029 enddo
@@ -1076,9 +1091,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
10761091! Scale dry mixing ratios for water wapor and cloud water to specific humidy / moist mixing ratios
10771092!
10781093! $acc kernels
1079- qv_spechum = qv/ (1.0_kind_phys + qv)
1094+ new_qv_spechum = qv/ (1.0_kind_phys + qv)
10801095 cnvw_moist = cnvw/ (1.0_kind_phys + qv)
10811096! $acc end kernels
1097+ do i= its,ite
1098+ do k= kts,kte
1099+ ten_q(i,k,ntqv) = (new_qv_spechum(i,k) - qv_spechum(i,k))/ dt
1100+ end do
1101+ end do
10821102!
10831103! Diagnostic tendency updates
10841104!
0 commit comments