Skip to content

Commit 747297f

Browse files
committed
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physics into feature/phys2dyn
2 parents 548c41e + 91d9790 commit 747297f

172 files changed

Lines changed: 6387 additions & 5063 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
branch = main
99
[submodule "physics/SFC_Layer/MYNN/MYNN"]
1010
path = physics/SFC_Layer/MYNN/MYNN
11-
url = https://github.com/NCAR/MYNN-SFC
12-
branch = main
11+
#url = https://github.com/NCAR/MYNN-SFC
12+
#branch = main
13+
url = https://github.com/grantfirl/MYNN-SFC
14+
branch = feature/tendency_cleanup

physics/CONV/C3/cu_c3_driver.F90

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
!

physics/CONV/C3/cu_c3_driver.meta

Lines changed: 68 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
optional = True
234234
[tmf]
235235
standard_name = tendency_of_vertically_diffused_tracer_concentration
236-
long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme
236+
long_name = tendency of the tracers due to vertical diffusion in PBL scheme
237237
units = kg kg-1 s-1
238238
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_vertical_diffusion_tracers)
239239
type = real
@@ -249,7 +249,7 @@
249249
intent = in
250250
optional = True
251251
[sigmain]
252-
standard_name = prognostic_updraft_area_fraction_in_convection
252+
standard_name = physics_timestep_initial_updraft_area_fraction
253253
long_name = convective updraft area fraction
254254
units = frac
255255
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -258,8 +258,8 @@
258258
intent = in
259259
optional = True
260260
[sigmaout]
261-
standard_name = updraft_area_fraction_updated_by_physics
262-
long_name = convective updraft area fraction updated by physics
261+
standard_name = updraft_area_fraction
262+
long_name = convective updraft area fraction
263263
units = frac
264264
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
265265
type = real
@@ -314,21 +314,21 @@
314314
kind = kind_phys
315315
intent = out
316316
[qv_spechum]
317-
standard_name = specific_humidity_of_new_state
318-
long_name = water vapor specific humidity updated by physics
317+
standard_name = specific_humidity
318+
long_name = water vapor specific humidity
319319
units = kg kg-1
320320
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
321321
type = real
322322
kind = kind_phys
323-
intent = inout
323+
intent = in
324324
[t]
325-
standard_name = air_temperature_of_new_state
326-
long_name = updated temperature
325+
standard_name = air_temperature
326+
long_name = air temperature
327327
units = K
328328
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
329329
type = real
330330
kind = kind_phys
331-
intent = inout
331+
intent = in
332332
[cld1d]
333333
standard_name = cloud_work_function
334334
long_name = cloud work function
@@ -338,23 +338,23 @@
338338
kind = kind_phys
339339
intent = out
340340
[us]
341-
standard_name = x_wind_of_new_state
342-
long_name = updated x-direction wind
341+
standard_name = x_wind
342+
long_name = x-direction wind
343343
units = m s-1
344344
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
345345
type = real
346346
kind = kind_phys
347-
intent = inout
347+
intent = in
348348
[vs]
349-
standard_name = y_wind_of_new_state
350-
long_name = updated y-direction wind
349+
standard_name = y_wind
350+
long_name = y-direction wind
351351
units = m s-1
352352
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
353353
type = real
354354
kind = kind_phys
355-
intent = inout
355+
intent = in
356356
[t2di]
357-
standard_name = air_temperature
357+
standard_name = physics_timestep_initial_air_temperature
358358
long_name = mid-layer temperature
359359
units = K
360360
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -370,7 +370,7 @@
370370
kind = kind_phys
371371
intent = in
372372
[qv2di_spechum]
373-
standard_name = specific_humidity
373+
standard_name = physics_timestep_initial_specific_humidity
374374
long_name = water vapor specific humidity
375375
units = kg kg-1
376376
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
@@ -453,15 +453,15 @@
453453
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
454454
type = real
455455
kind = kind_phys
456-
intent = inout
456+
intent = in
457457
[clcw]
458458
standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer
459459
long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
460460
units = kg kg-1
461461
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
462462
type = real
463463
kind = kind_phys
464-
intent = inout
464+
intent = in
465465
[pbl]
466466
standard_name = atmosphere_boundary_layer_thickness
467467
long_name = PBL thickness
@@ -736,6 +736,54 @@
736736
dimensions = ()
737737
type = integer
738738
intent = in
739+
[ten_t]
740+
standard_name = tendency_of_air_temperature
741+
long_name = tendency of air temperature calculated by one physics scheme
742+
units = K s-1
743+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
744+
type = real
745+
kind = kind_phys
746+
intent = out
747+
[ten_u]
748+
standard_name = tendency_of_x_wind
749+
long_name = tendency of x wind calculated by one physics scheme
750+
units = m s-2
751+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
752+
type = real
753+
kind = kind_phys
754+
intent = out
755+
[ten_v]
756+
standard_name = tendency_of_y_wind
757+
long_name = tendency of y wind calculated by one physics scheme
758+
units = m s-2
759+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
760+
type = real
761+
kind = kind_phys
762+
intent = out
763+
[ten_q]
764+
standard_name = tendency_of_tracer_concentration
765+
long_name = tendency of tracer concentration calculated by one physics scheme
766+
units = kg kg-1 s-1
767+
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
768+
type = real
769+
kind = kind_phys
770+
intent = out
771+
[dcliw]
772+
standard_name = tendency_of_ice_water_mixing_ratio_convective_transport_tracer
773+
long_name = tendency of ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
774+
units = kg kg-1 s-1
775+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
776+
type = real
777+
kind = kind_phys
778+
intent = out
779+
[dclcw]
780+
standard_name = tendency_of_cloud_condensed_water_mixing_ratio_convective_transport_tracer
781+
long_name = tendency of ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array
782+
units = kg kg-1 s-1
783+
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
784+
type = real
785+
kind = kind_phys
786+
intent = out
739787
[errmsg]
740788
standard_name = ccpp_error_message
741789
long_name = error message for error handling in CCPP

physics/CONV/C3/cu_c3_driver_post.meta

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
type = integer
2323
intent = in
2424
[t]
25-
standard_name = air_temperature_of_new_state
26-
long_name = temperature updated by physics
25+
standard_name = air_temperature
26+
long_name = air temperature
2727
units = K
2828
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
2929
type = real
3030
kind = kind_phys
3131
intent = in
3232
[q]
33-
standard_name = specific_humidity_of_new_state
34-
long_name = water vapor specific humidity updated by physics
33+
standard_name = specific_humidity
34+
long_name = water vapor specific humidity
3535
units = kg kg-1
3636
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
3737
type = real

physics/CONV/C3/cu_c3_driver_pre.meta

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545
kind = kind_phys
4646
intent = in
4747
[t]
48-
standard_name = air_temperature
48+
standard_name = physics_timestep_initial_air_temperature
4949
long_name = model layer mean temperature
5050
units = K
5151
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
5252
type = real
5353
kind = kind_phys
5454
intent = in
5555
[q]
56-
standard_name = specific_humidity
56+
standard_name = physics_timestep_initial_specific_humidity
5757
long_name = water vapor specific humidity
5858
units = kg kg-1
5959
dimensions = (horizontal_loop_extent,vertical_layer_dimension)

0 commit comments

Comments
 (0)