Skip to content

Commit 054823f

Browse files
committed
convert MG micro and Arakawa-Wu adjustment schemes
1 parent 989c365 commit 054823f

8 files changed

Lines changed: 336 additions & 577 deletions

File tree

physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ module cs_conv_aw_adj
2020
!! \htmlinclude cs_conv_aw_adj_run.html
2121
!!
2222
!\section gen_cs_conv_aw_adj_run CPT cs_conv_aw_adj_run General Algorithm
23-
subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, &
24-
ntrac, ntcw, ntclamt, nncl, con_g, sigmafrac, &
25-
gt0, gq0, save_t, save_q, prsi, cldfrac, subcldfrac, &
23+
subroutine cs_conv_aw_adj_run(im, levs, dt, do_cscnv, do_aw, do_shoc, &
24+
ntcw, nncl, con_g, sigmafrac, ten_t, ten_q, prsi, subcldfrac, &
2625
prcp, imp_physics, imp_physics_mg, errmsg, errflg)
2726

2827
use machine, only: kind_phys
@@ -32,17 +31,14 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, &
3231
! --- interface variables
3332
integer, intent(in) :: im, levs
3433
logical, intent(in) :: do_cscnv, do_aw, do_shoc
35-
integer, intent(in) :: ntrac, ntcw, ntclamt, nncl
36-
real(kind_phys), intent(in) :: con_g
37-
real(kind_phys), dimension(:,:), intent(inout) :: sigmafrac
38-
real(kind_phys), dimension(:,:), intent(inout) :: gt0
39-
real(kind_phys), dimension(:,:,:), intent(inout) :: gq0
40-
real(kind_phys), dimension(:,:), intent(in) :: save_t
41-
real(kind_phys), dimension(:,:,:), intent(in) :: save_q
42-
real(kind_phys), dimension(:,:), intent(in) :: prsi
43-
real(kind_phys), dimension(:,:), intent(inout), optional :: cldfrac
44-
real(kind_phys), dimension(:,:), intent(inout), optional :: subcldfrac
45-
real(kind_phys), dimension(:), intent(inout) :: prcp
34+
integer, intent(in) :: ntcw, nncl
35+
real(kind_phys), intent(in) :: dt, con_g
36+
real(kind_phys), dimension(:,:), intent(in) :: sigmafrac
37+
real(kind_phys), dimension(:,:), intent(inout) :: ten_t
38+
real(kind_phys), dimension(:,:,:), intent(inout) :: ten_q
39+
real(kind_phys), dimension(:,:), intent(in) :: prsi
40+
real(kind_phys), dimension(:,:), intent(inout), optional :: subcldfrac
41+
real(kind_phys), dimension(:), intent(inout) :: prcp
4642
integer, intent(in ) :: imp_physics, imp_physics_mg
4743
character(len=*), intent( out) :: errmsg
4844
integer, intent( out) :: errflg
@@ -75,9 +71,9 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, &
7571
do k = 1,levs
7672
do i = 1,im
7773
tem1 = sigmafrac(i,k)
78-
gt0(i,k) = gt0(i,k) - tem1 * (gt0(i,k)-save_t(i,k))
79-
tem2 = tem1 * (gq0(i,k,1)-save_q(i,k,1))
80-
gq0(i,k,1) = gq0(i,k,1) - tem2
74+
ten_t(i,k) = (1.0 - tem1)*ten_t(i,k)
75+
tem2 = tem1 * ten_q(i,k,1)*dt
76+
ten_q(i,k,1) = (1.0 - tem1)*ten_q(i,k,1)
8177
temrain1(i) = temrain1(i) - (prsi(i,k)-prsi(i,k+1)) * tem2 * onebg
8278
enddo
8379
enddo
@@ -93,8 +89,8 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, &
9389
do n=ntcw,ntcw+nncl-1
9490
do k = 1,levs
9591
do i = 1,im
96-
tem1 = sigmafrac(i,k) * (gq0(i,k,n)-save_q(i,k,n))
97-
gq0(i,k,n) = gq0(i,k,n) - tem1
92+
tem1 = sigmafrac(i,k) * ten_q(i,k,n)*dt
93+
ten_q(i,k,n) = (1.0 - sigmafrac(i,k))*ten_q(i,k,n)
9894
temrain1(i) = temrain1(i) - (prsi(i,k)-prsi(i,k+1)) * tem1 * onebg
9995
enddo
10096
enddo

physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta

Lines changed: 17 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
dimensions = ()
2222
type = integer
2323
intent = in
24+
[dt]
25+
standard_name = timestep_for_physics
26+
long_name = physics time step
27+
units = s
28+
dimensions = ()
29+
type = real
30+
kind = kind_phys
31+
intent = in
2432
[do_cscnv]
2533
standard_name = flag_for_Chikira_Sugiyama_deep_convection
2634
long_name = flag for Chikira-Sugiyama convection
@@ -42,27 +50,13 @@
4250
dimensions = ()
4351
type = logical
4452
intent = in
45-
[ntrac]
46-
standard_name = number_of_tracers
47-
long_name = number of tracers
48-
units = count
49-
dimensions = ()
50-
type = integer
51-
intent = in
5253
[ntcw]
5354
standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array
5455
long_name = tracer index for cloud condensate (or liquid water)
5556
units = index
5657
dimensions = ()
5758
type = integer
5859
intent = in
59-
[ntclamt]
60-
standard_name = index_of_cloud_area_fraction_in_atmosphere_layer_in_tracer_concentration_array
61-
long_name = tracer index for cloud amount integer
62-
units = index
63-
dimensions = ()
64-
type = integer
65-
intent = in
6660
[nncl]
6761
standard_name = number_of_condensate_species
6862
long_name = number of cloud condensate types
@@ -85,39 +79,23 @@
8579
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
8680
type = real
8781
kind = kind_phys
88-
intent = inout
89-
[gt0]
90-
standard_name = air_temperature
91-
long_name = temperature updated by physics
92-
units = K
82+
intent = in
83+
[ten_t]
84+
standard_name = tendency_of_air_temperature
85+
long_name = tendency of air temperature calculated by one physics scheme
86+
units = K s-1
9387
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
9488
type = real
9589
kind = kind_phys
9690
intent = inout
97-
[gq0]
98-
standard_name = tracer_concentration
99-
long_name = tracer concentration updated by physics
100-
units = kg kg-1
91+
[ten_q]
92+
standard_name = tendency_of_tracer_concentration
93+
long_name = tendency of tracer concentration calculated by one physics scheme
94+
units = kg kg-1 s-1
10195
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
10296
type = real
10397
kind = kind_phys
10498
intent = inout
105-
[save_t]
106-
standard_name = air_temperature_save
107-
long_name = air temperature before entering a physics scheme
108-
units = K
109-
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
110-
type = real
111-
kind = kind_phys
112-
intent = in
113-
[save_q]
114-
standard_name = tracer_concentration_save
115-
long_name = tracer concentration before entering a physics scheme
116-
units = kg kg-1
117-
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
118-
type = real
119-
kind = kind_phys
120-
intent = in
12199
[prsi]
122100
standard_name = air_pressure_at_interface
123101
long_name = air pressure at model layer interfaces
@@ -126,15 +104,6 @@
126104
type = real
127105
kind = kind_phys
128106
intent = in
129-
[cldfrac]
130-
standard_name = cloud_fraction_for_MG
131-
long_name = cloud fraction used by Morrison-Gettelman MP
132-
units = frac
133-
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
134-
type = real
135-
kind = kind_phys
136-
intent = inout
137-
optional = True
138107
[subcldfrac]
139108
standard_name = subgrid_scale_cloud_fraction_from_shoc
140109
long_name = subgrid-scale cloud fraction from the SHOC scheme

physics/MP/Morrison_Gettelman/m_micro.F90

Lines changed: 69 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,18 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
150150
&, CNV_DQLDT_i, CLCN_i, u_i, v_i &
151151
&, TAUGWX, TAUGWY &
152152
&, TAUOROX, TAUOROY, CNV_FICE_i &
153-
&, CNV_NDROP_i,CNV_NICE_i, q_io, lwm_o &
154-
&, qi_o, t_io, rn_o, sr_o &
155-
&, ncpl_io, ncpi_io, fprcp, rnw_io, snw_io&
156-
&, qgl_io, ncpr_io, ncps_io, ncgl_io &
153+
&, CNV_NDROP_i,CNV_NICE_i, q_i, &
154+
&, t_i , rn_o, sr_o &
155+
&, ncpl_i, ncpi_i, fprcp, rnw_i, snw_i &
156+
&, qgl_i, ncpr_i, ncps_i, ncgl_i &
157157
&, CLLS_io, KCBL, rainmin &
158158
&, CLDREFFL, CLDREFFI, CLDREFFR, CLDREFFS &
159159
&, CLDREFFG, ntrcaer, aerfld_i &
160160
&, naai_i, npccn_i, iccn &
161161
&, skip_macro &
162162
&, alf_fac, qc_min, pdfflag &
163163
&, kdt, xlat, xlon, rhc_i, &
164-
& errmsg, errflg)
164+
& ten_t, ten_q, ten_qv, ten_ncpi, ten_ncpl, ten_rnw, ten_snw, ten_qgl, ten_ncpr, ten_ncps, ten_ncgl, ten_ql, ten_qi, errmsg, errflg)
165165

166166
! use funcphys, only: fpvs !< saturation vapor pressure for water-ice mixed
167167
! use funcphys, only: fpvsl, fpvsi, fpvs !< saturation vapor pressure for water,ice & mixed
@@ -203,7 +203,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
203203
& CNV_DQLDT_i, CLCN_i, QLCN_i, QICN_i, &
204204
& CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, &
205205
& CNV_NICE_i, w_upi
206-
! *GJF
206+
207207
real (kind=kind_phys), dimension(:,:),intent(in) :: &
208208
& rhc_i, naai_i, npccn_i
209209
real (kind=kind_phys), dimension(:,:,:),intent(in) :: &
@@ -214,7 +214,6 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
214214
! & CNVPRCP
215215

216216
! output
217-
real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o
218217
real (kind=kind_phys),dimension(:,:), intent(out) :: &
219218
cldreffl, cldreffi, cldreffr, cldreffs, cldreffg
220219
real (kind=kind_phys),dimension(:), intent(out) :: rn_o, sr_o
@@ -224,12 +223,13 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
224223
! input and output
225224
! Anning Cheng 10/24/2016 twat for total water, diagnostic purpose
226225
integer, dimension(:), intent(inout):: KCBL
227-
real (kind=kind_phys),dimension(:,:),intent(inout):: q_io, t_io, &
228-
& ncpi_io
226+
real (kind=kind_phys),dimension(:,:),intent(in):: q_i, t_i, &
227+
& ncpi_i
229228
real (kind=kind_phys),dimension(:,:),intent(inout) :: &
230-
rnw_io, snw_io, ncpr_io, ncps_io, qgl_io, ncgl_io, ncpl_io, &
231229
CLLS_io
232-
! *GJF
230+
real (kind=kind_phys),dimension(:,:),intent(in) :: ncpl_i, rnw_i, snw_i, qgl_i, ncpr_i, ncps_i, ncgl_i
231+
real (kind=kind_phys),dimension(:,:), intent(out) :: ten_t, ten_qv, ten_ncpi, ten_ncpl, ten_rnw, ten_snw, ten_qgl, ten_ncpr, ten_ncps, ten_ncgl, ten_ql, ten_qi
232+
real (kind=kind_phys),dimension(:,:,:), intent(out) :: ten_q
233233
!Moo real (kind=kind_phys),dimension(im,lm),intent(inout):: CLLS_io
234234

235235

@@ -411,6 +411,19 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
411411
! Initialize CCPP error handling variables
412412
errmsg = ''
413413
errflg = 0
414+
415+
ten_t = 0.0
416+
ten_q = 0.0
417+
ten_qv = 0.0
418+
ten_ncpi = 0.0
419+
ten_rnw = 0.0
420+
ten_snw = 0.0
421+
ten_qgl = 0.0
422+
ten_ncpr = 0.0
423+
ten_ncps = 0.0
424+
ten_ncgl = 0.0
425+
ten_ql = 0.0
426+
ten_qi = 0.0
414427

415428
lprnt = .false.
416429
ipr = 1
@@ -421,18 +434,18 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
421434
DO K=1, LM
422435
ll = lm-k+1
423436
DO I = 1,IM
424-
Q1(i,k) = q_io(i,ll)
437+
Q1(i,k) = q_i(i,ll)
425438
U1(i,k) = u_i(i,ll)
426439
V1(i,k) = v_i(i,ll)
427440
omega(i,k) = omega_i(i,ll)
428-
ncpl(i,k) = ncpl_io(i,ll)
429-
ncpi(i,k) = ncpi_io(i,ll)
430-
rnw(i,k) = rnw_io(i,ll)
431-
snw(i,k) = snw_io(i,ll)
432-
qgl(i,k) = qgl_io(i,ll)
433-
ncpr(i,k) = ncpr_io(i,ll)
434-
ncps(i,k) = ncps_io(i,ll)
435-
ncgl(i,k) = ncgl_io(i,ll)
441+
ncpl(i,k) = ncpl_i(i,ll)
442+
ncpi(i,k) = ncpi_i(i,ll)
443+
rnw(i,k) = rnw_i(i,ll)
444+
snw(i,k) = snw_i(i,ll)
445+
qgl(i,k) = qgl_i(i,ll)
446+
ncpr(i,k) = ncpr_i(i,ll)
447+
ncps(i,k) = ncps_i(i,ll)
448+
ncgl(i,k) = ncgl_i(i,ll)
436449
! QLLS is the total cloud water
437450
QLLS(i,k) = QLLS_i(i,ll)-QLCN_i(i,ll)
438451
QLCN(i,k) = QLCN_i(i,ll)
@@ -445,7 +458,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
445458
CLLS(I,k) = max(CLLS_io(I,ll)-CLCN_i(I,ll),zero)
446459
PLO(i,k) = prsl_i(i,ll)*0.01_kp
447460
zlo(i,k) = phil(i,ll) * onebg
448-
temp(i,k) = t_io(i,ll)
461+
temp(i,k) = t_i(i,ll)
449462
radheat(i,k) = lwheat_i(i,ll) + swheat_i(i,ll)
450463
rhc(i,k) = rhc_i(i,ll)
451464
if (iccn == 1) then
@@ -481,18 +494,18 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
481494
else
482495
DO K=1, LM
483496
DO I = 1,IM
484-
Q1(i,k) = q_io(i,k)
497+
Q1(i,k) = q_i(i,k)
485498
U1(i,k) = u_i(i,k)
486499
V1(i,k) = v_i(i,k)
487500
omega(i,k) = omega_i(i,k)
488-
ncpl(i,k) = ncpl_io(i,k)
489-
ncpi(i,k) = ncpi_io(i,k)
490-
rnw(i,k) = rnw_io(i,k)
491-
snw(i,k) = snw_io(i,k)
492-
qgl(i,k) = qgl_io(i,k)
493-
ncpr(i,k) = ncpr_io(i,k)
494-
ncps(i,k) = ncps_io(i,k)
495-
ncgl(i,k) = ncgl_io(i,k)
501+
ncpl(i,k) = ncpl_i(i,k)
502+
ncpi(i,k) = ncpi_i(i,k)
503+
rnw(i,k) = rnw_i(i,k)
504+
snw(i,k) = snw_i(i,k)
505+
qgl(i,k) = qgl_i(i,k)
506+
ncpr(i,k) = ncpr_i(i,k)
507+
ncps(i,k) = ncps_i(i,k)
508+
ncgl(i,k) = ncgl_i(i,k)
496509
! QLLS is the total cloud water
497510
QLLS(i,k) = QLLS_i(i,k)-QLCN_i(i,k)
498511
QLCN(i,k) = QLCN_i(i,k)
@@ -505,7 +518,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
505518
CLLS(I,k) = max(CLLS_io(I,k)-CLCN_i(I,k),zero)
506519
PLO(i,k) = prsl_i(i,k)*0.01_kp
507520
zlo(i,k) = phil(i,k) * onebg
508-
temp(i,k) = t_io(i,k)
521+
temp(i,k) = t_i(i,k)
509522
radheat(i,k) = lwheat_i(i,k) + swheat_i(i,k)
510523
rhc(i,k) = rhc_i(i,k)
511524
if (iccn == 1) then
@@ -1798,18 +1811,18 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
17981811
DO K=1, LM
17991812
ll = lm-k+1
18001813
DO I = 1,IM
1801-
t_io(i,k) = TEMP(i,ll)
1802-
q_io(i,k) = Q1(i,ll)
1803-
ncpi_io(i,k) = NCPI(i,ll)
1804-
ncpl_io(i,k) = NCPL(i,ll)
1805-
rnw_io(i,k) = rnw(i,ll)
1806-
snw_io(i,k) = snw(i,ll)
1807-
qgl_io(i,k) = qgl(i,ll)
1808-
ncpr_io(i,k) = NCPR(i,ll)
1809-
ncps_io(i,k) = NCPS(i,ll)
1810-
ncgl_io(i,k) = NCGL(i,ll)
1811-
lwm_o(i,k) = QL_TOT(i,ll)
1812-
qi_o(i,k) = QI_TOT(i,ll)
1814+
ten_t(i,k) = (temp(i,ll) - t_i(i,k))/dt_i
1815+
ten_qv(i,k) = (Q1(i,ll) - q_i(i,k))/dt_i
1816+
ten_ncpi(i,k) = (ncpi(i,ll) - ncpi_i(i,k))/dt_i
1817+
ten_ncpl(i,k) = (ncpl(i,ll) - ncpl_i(i,k))/dt_i
1818+
ten_rnw(i,k) = (rnw(i,ll) - rnw_i(i,k))/dt_i
1819+
ten_snw(i,k) = (snw(i,ll) - snw_i(i,k))/dt_i
1820+
ten_qgl(i,k) = (qgl(i,ll) - qgl_i(i,k))/dt_i
1821+
ten_ncpr(i,k) = (ncpr(i,ll) - ncpr_i(i,k))/dt_i
1822+
ten_ncps(i,k) = (ncps(i,ll) - ncps_i(i,k))/dt_i
1823+
ten_ncgl(i,k) = (ncgl(i,ll) - ncgl_i(i,k))/dt_i
1824+
ten_ql(i,k) = (ql_tot(i,ll) - qlls_i(i,k))/dt_i
1825+
ten_qi(i,k) = (qi_tot(i,ll) - qils_i(i,k))/dt_i
18131826
END DO
18141827
END DO
18151828
if (skip_macro) then
@@ -1830,18 +1843,18 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
18301843
else
18311844
DO K=1, LM
18321845
DO I = 1,IM
1833-
t_io(i,k) = TEMP(i,k)
1834-
q_io(i,k) = Q1(i,k)
1835-
ncpi_io(i,k) = NCPI(i,k)
1836-
ncpl_io(i,k) = NCPL(i,k)
1837-
rnw_io(i,k) = rnw(i,k)
1838-
snw_io(i,k) = snw(i,k)
1839-
qgl_io(i,k) = qgl(i,k)
1840-
ncpr_io(i,k) = NCPR(i,k)
1841-
ncps_io(i,k) = NCPS(i,k)
1842-
ncgl_io(i,k) = NCGL(i,k)
1843-
lwm_o(i,k) = QL_TOT(i,k)
1844-
qi_o(i,k) = QI_TOT(i,k)
1846+
ten_t(i,k) = (temp(i,k) - t_i(i,k))/dt_i
1847+
ten_qv(i,k) = (Q1(i,k) - q_i(i,k))/dt_i
1848+
ten_ncpi(i,k) = (ncpi(i,k) - ncpi_i(i,k))/dt_i
1849+
ten_ncpl(i,k) = (ncpl(i,k) - ncpl_i(i,k))/dt_i
1850+
ten_rnw(i,k) = (rnw(i,k) - rnw_i(i,k))/dt_i
1851+
ten_snw(i,k) = (snw(i,k) - snw_i(i,k))/dt_i
1852+
ten_qgl(i,k) = (qgl(i,k) - qgl_i(i,k))/dt_i
1853+
ten_ncpr(i,k) = (ncpr(i,k) - ncpr_i(i,k))/dt_i
1854+
ten_ncps(i,k) = (ncps(i,k) - ncps_i(i,k))/dt_i
1855+
ten_ncgl(i,k) = (ncgl(i,k) - ncgl_i(i,k))/dt_i
1856+
ten_ql(i,k) = (ql_tot(i,k) - qlls_i(i,k))/dt_i
1857+
ten_qi(i,k) = (qi_tot(i,k) - qils_i(i,k))/dt_i
18451858
END DO
18461859
END DO
18471860
if (skip_macro) then
@@ -1874,7 +1887,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i &
18741887

18751888
! if (lprnt) then
18761889
! write(0,*)' rn_o=',rn_o(ipr),' ls_prc2=',ls_prc2(ipr),' ls_snr=',ls_snr(ipr),' kdt=',kdt
1877-
! write(0,*)' end micro_mg_tend t_io= ', t_io(ipr,:)
1890+
! write(0,*)' end micro_mg_tend t_i= ', t_i(ipr,:)
18781891
! write(0,*)' end micro_mg_tend clls_io= ', clls_io(ipr,:)
18791892
! endif
18801893
! do k=1,lm

0 commit comments

Comments
 (0)