Skip to content

Commit 9020f31

Browse files
author
Haipeng Lin
committed
Recompute pgam, lamc, degrau, dei for radiation from updated state in pumas_post_main
Mirrors CAM micro_pumas_cam post-call recomputation, which discards the per-substep values PUMAS returns. Match dei standard name with RRTMGP and the CAM-SIMA registry (singular crystal). Run pumas_post_main before apply_heating_rate (air density uses the pre-heating temperature) and add the low stratiform cloud fraction optics limiter to the suite.
1 parent 787c32c commit 9020f31

5 files changed

Lines changed: 198 additions & 12 deletions

File tree

schemes/pumas/micro_pumas_ccpp_dimensions_post.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@
464464
kind = pumas_r8
465465
intent = in
466466
[deffi]
467-
standard_name = effective_diameter_of_stratiform_cloud_ice_crystals_for_radiation
467+
standard_name = effective_diameter_of_stratiform_cloud_ice_crystal_for_radiation
468468
long_name = effective diameter of stratiform cloud ice particles for radiation
469469
units = um
470470
dimensions = (horizontal_loop_extent, vertical_layer_dimension)

schemes/pumas/micro_pumas_ccpp_optics_limiter.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
kind = kind_phys
5454
intent = inout
5555
[deffi]
56-
standard_name = effective_diameter_of_stratiform_cloud_ice_particle_for_radiation
56+
standard_name = effective_diameter_of_stratiform_cloud_ice_crystal_for_radiation
5757
long_name = effective diameter of stratiform cloud ice particles for radiation
5858
units = um
5959
dimensions = (horizontal_loop_extent, vertical_layer_dimension)

schemes/pumas/pumas_post_main.F90

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,53 @@ module pumas_post_main
99

1010
!> \section arg_table_pumas_post_main_run Argument Table
1111
!! \htmlinclude pumas_post_main_run.html
12-
subroutine pumas_post_main_run(ncol, cldice, numice, strat_cldfrc, effi, errmsg, errcode)
12+
subroutine pumas_post_main_run(ncol, nlev, trop_cloud_top_lev, rair, pmid, temp, &
13+
cldliq, numliq, cldice, numice, graupel, numgraup, strat_cldfrc, &
14+
effi, dei, pgam, lamc, degrau, errmsg, errcode)
1315
use ccpp_kinds, only: kind_phys
1416
use pumas_kinds, only: pumas_r8=>kind_r8
15-
use micro_pumas_utils, only: size_dist_param_basic, mg_ice_props, mincld, qsmall
17+
use micro_pumas_utils, only: size_dist_param_basic, size_dist_param_liq, &
18+
mg_ice_props, mg_liq_props, avg_diameter, &
19+
mincld, qsmall, rhog, rhows, rhoi
1620

1721
integer, intent(in) :: ncol
22+
integer, intent(in) :: nlev
23+
integer, intent(in) :: trop_cloud_top_lev !Index of the top model level for which
24+
!tropospheric cloud physics is run (index)
25+
real(kind_phys), intent(in) :: rair ! gas constant of dry air (J kg-1 K-1)
26+
real(kind_phys), dimension(:,:), intent(in) :: pmid ! layer midpoint pressure (Pa)
27+
real(kind_phys), dimension(:,:), intent(in) :: temp ! air temperature, before microphysics heating is applied (K)
28+
real(kind_phys), dimension(:,:), intent(in) :: cldliq ! updated cloud liquid water mixing ratio (kg/kg)
29+
real(kind_phys), dimension(:,:), intent(in) :: numliq ! updated cloud droplet number concentration (kg-1)
1830
real(kind_phys), dimension(:,:), intent(in) :: cldice ! updated cloud ice mixing ratio (kg/kg)
1931
real(kind_phys), dimension(:,:), intent(in) :: numice ! updated cloud ice number concentration (kg-1)
32+
real(kind_phys), dimension(:,:), intent(in) :: graupel ! updated graupel mixing ratio (kg/kg)
33+
real(kind_phys), dimension(:,:), intent(in) :: numgraup ! updated graupel number concentration (kg-1)
2034
real(kind_phys), dimension(:,:), intent(in) :: strat_cldfrc! total stratiform cloud area fraction (= ast)
2135
real(kind_phys), dimension(:,:), intent(out) :: effi ! ice effective radius (micron)
36+
real(kind_phys), dimension(:,:), intent(out) :: dei ! ice effective diameter for radiation (micron)
37+
real(kind_phys), dimension(:,:), intent(out) :: pgam ! droplet size distribution shape parameter for radiation (1)
38+
real(kind_phys), dimension(:,:), intent(out) :: lamc ! droplet size distribution slope for radiation (1)
39+
real(kind_phys), dimension(:,:), intent(out) :: degrau ! graupel effective diameter for radiation (m)
2240
character(len=512), intent(out) :: errmsg
2341
integer, intent(out) :: errcode
2442

25-
integer :: k, nlev
26-
real(pumas_r8) :: icimrst(ncol, size(cldice,2)) ! in-cloud (grid-mean) ice mixing ratio
27-
real(pumas_r8) :: niic(ncol, size(cldice,2)) ! in-cloud (grid-mean) ice number conc
28-
real(pumas_r8) :: rei(ncol, size(cldice,2)) ! ice slope param, then effective radius
43+
integer :: k
44+
real(pumas_r8) :: icimrst(ncol, nlev) ! in-cloud (grid-mean) ice mixing ratio
45+
real(pumas_r8) :: niic(ncol, nlev) ! in-cloud (grid-mean) ice number conc
46+
real(pumas_r8) :: rei(ncol, nlev) ! ice slope param, then effective radius
47+
real(pumas_r8) :: icwmrst(ncol, nlev) ! in-cloud (grid-mean) liquid mixing ratio
48+
real(pumas_r8) :: ncic(ncol, nlev) ! in-cloud (grid-mean) droplet number conc
49+
real(pumas_r8) :: rho(ncol, nlev) ! air density
50+
real(pumas_r8) :: mu(ncol, nlev) ! droplet size distribution shape parameter
51+
real(pumas_r8) :: lambdac(ncol, nlev) ! droplet size distribution slope
52+
real(pumas_r8) :: qg(ncol, nlev) ! grid-mean graupel mixing ratio
53+
real(pumas_r8) :: ng(ncol, nlev) ! grid-mean graupel number conc
54+
real(pumas_r8) :: dgout2(ncol, nlev) ! mean graupel particle diameter
2955

3056
errmsg = ' '
3157
errcode = 0
3258

33-
nlev = size(cldice, 2)
34-
3559
! Ice effective radius is recomputed here from the post-microphysics
3660
! grid-mean in-cloud ice, NOT from the raw per-substep value PUMAS returns.
3761
! PUMAS uses the total stratiform fraction for ice cloud (icecldf = ast).
@@ -54,6 +78,59 @@ subroutine pumas_post_main_run(ncol, cldice, numice, strat_cldfrc, effi, errmsg,
5478

5579
effi(:ncol,:) = real(rei(:,:), kind_phys)
5680

81+
! Ice effective diameter for radiation follows from the recomputed
82+
! effective radius. Mirrors CAM micro_pumas_cam.F90:3080 (dei).
83+
dei(:ncol,:) = real(rei(:,:) * rhoi/rhows * 2._pumas_r8, kind_phys)
84+
85+
! Droplet size distribution parameters for radiation are likewise recomputed
86+
! from the post-microphysics grid-mean in-cloud liquid. Air density uses the
87+
! temperature BEFORE the microphysics heating is applied (in CAM the input
88+
! state, not the substepped local state, "to preserve answers").
89+
! PUMAS uses the total stratiform fraction for liquid cloud (liqcldf = ast).
90+
! Mirrors CAM micro_pumas_cam.F90:2919 (rho), :2621 (icwmrst), :2957 (ncic),
91+
! :2952-2978 (mu, lambdac).
92+
rho(:,:) = real(pmid(:ncol,:), pumas_r8) / &
93+
(real(rair, pumas_r8) * real(temp(:ncol,:), pumas_r8))
94+
icwmrst(:,:) = min(real(cldliq(:ncol,:), pumas_r8) / &
95+
max(mincld, real(strat_cldfrc(:ncol,:), pumas_r8)), 0.005_pumas_r8)
96+
ncic(:,:) = real(numliq(:ncol,:), pumas_r8) / &
97+
max(mincld, real(strat_cldfrc(:ncol,:), pumas_r8))
98+
99+
mu(:,:) = 0._pumas_r8
100+
lambdac(:,:) = 0._pumas_r8
101+
do k = trop_cloud_top_lev, nlev
102+
call size_dist_param_liq(mg_liq_props, icwmrst(:,k), ncic(:,k), rho(:,k), &
103+
mu(:,k), lambdac(:,k), ncol)
104+
end do
105+
106+
! size_dist_param_liq flags no-cloud points with mu = -100; CAM resets
107+
! those to zero (lambdac is already zero there).
108+
where (icwmrst(:,trop_cloud_top_lev:) < qsmall)
109+
mu(:,trop_cloud_top_lev:) = 0._pumas_r8
110+
end where
111+
112+
pgam(:ncol,:) = real(mu(:,:), kind_phys)
113+
lamc(:ncol,:) = real(lambdac(:,:), kind_phys)
114+
115+
! Graupel effective diameter for radiation, from the post-microphysics
116+
! grid-mean graupel. Mirrors CAM micro_pumas_cam.F90:3043-3056 (degrau).
117+
qg(:,:) = real(graupel(:ncol,:), pumas_r8)
118+
ng(:,:) = real(numgraup(:ncol,:), pumas_r8)
119+
120+
dgout2(:,:) = 0._pumas_r8
121+
where (qg(:,trop_cloud_top_lev:) >= 1.e-7_pumas_r8)
122+
dgout2(:,trop_cloud_top_lev:) = avg_diameter( &
123+
qg(:,trop_cloud_top_lev:), &
124+
ng(:,trop_cloud_top_lev:) * rho(:,trop_cloud_top_lev:), &
125+
rho(:,trop_cloud_top_lev:), rhog)
126+
end where
127+
128+
degrau(:ncol,:) = 0._kind_phys
129+
where (qg(:,trop_cloud_top_lev:) >= 1.e-7_pumas_r8)
130+
degrau(:ncol,trop_cloud_top_lev:) = real(dgout2(:,trop_cloud_top_lev:) * &
131+
3._pumas_r8 * rhog/rhows, kind_phys)
132+
end where
133+
57134
end subroutine pumas_post_main_run
58135

59136
end module pumas_post_main

schemes/pumas/pumas_post_main.meta

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,62 @@
1313
dimensions = ()
1414
type = integer
1515
intent = in
16+
[nlev]
17+
standard_name = vertical_layer_dimension
18+
long_name = vertical layer dimension
19+
units = count
20+
dimensions = ()
21+
type = integer
22+
intent = in
23+
[trop_cloud_top_lev]
24+
standard_name = vertical_layer_index_of_troposphere_cloud_physics_top
25+
long_name = vertical layer index of troposphere cloud physics top
26+
units = index
27+
dimensions = ()
28+
type = integer
29+
intent = in
30+
[rair]
31+
standard_name = gas_constant_of_dry_air
32+
long_name = ideal gas constant for dry air
33+
units = J kg-1 K-1
34+
dimensions = ()
35+
type = real
36+
kind = kind_phys
37+
intent = in
38+
[pmid]
39+
standard_name = air_pressure
40+
long_name = air pressure
41+
units = Pa
42+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
43+
type = real
44+
kind = kind_phys
45+
intent = in
46+
[temp]
47+
standard_name = air_temperature
48+
long_name = air temperature
49+
units = K
50+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
51+
type = real
52+
kind = kind_phys
53+
intent = in
54+
[cldliq]
55+
standard_name = cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water
56+
long_name = cloud liquid water mixing ratio wrt moist air and condensed water
57+
units = kg kg-1
58+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
59+
type = real
60+
kind = kind_phys
61+
intent = in
62+
advected = true
63+
[numliq]
64+
standard_name = mass_number_concentration_of_cloud_liquid_water_droplets_in_moist_air_and_condensed_water
65+
long_name = mass number concentration of cloud liquid wrt moist air and condensed water
66+
units = kg-1
67+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
68+
type = real
69+
kind = kind_phys
70+
intent = in
71+
advected = true
1672
[cldice]
1773
standard_name = cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water
1874
long_name = cloud ice mixing ratio wrt moist air and condensed water
@@ -31,6 +87,24 @@
3187
kind = kind_phys
3288
intent = in
3389
advected = true
90+
[graupel]
91+
standard_name = graupel_water_mixing_ratio_wrt_moist_air_and_condensed_water
92+
long_name = graupel mixing ratio wrt moist air and condensed water
93+
units = kg kg-1
94+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
95+
type = real
96+
kind = kind_phys
97+
intent = in
98+
advected = true
99+
[numgraup]
100+
standard_name = mass_number_concentration_of_graupel_particles_in_moist_air_and_condensed_water
101+
long_name = mass number concentration of graupel wrt moist air and condensed water
102+
units = kg-1
103+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
104+
type = real
105+
kind = kind_phys
106+
intent = in
107+
advected = true
34108
[strat_cldfrc]
35109
standard_name = stratiform_cloud_area_fraction
36110
long_name = stratiform cloud area fraction
@@ -47,6 +121,38 @@
47121
type = real
48122
kind = kind_phys
49123
intent = out
124+
[dei]
125+
standard_name = effective_diameter_of_stratiform_cloud_ice_crystal_for_radiation
126+
long_name = effective diameter of stratiform cloud ice particles for radiation
127+
units = um
128+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
129+
type = real
130+
kind = kind_phys
131+
intent = out
132+
[pgam]
133+
standard_name = size_distribution_shape_parameter_for_microphysics
134+
long_name = cloud particle size distribution shape (gamma) parameter
135+
units = 1
136+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
137+
type = real
138+
kind = kind_phys
139+
intent = out
140+
[lamc]
141+
standard_name = slope_of_droplet_distribution_for_optics
142+
long_name = cloud particle size distribution slope (lambda) parameter
143+
units = 1
144+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
145+
type = real
146+
kind = kind_phys
147+
intent = out
148+
[degrau]
149+
standard_name = effective_diameter_of_stratiform_cloud_graupel_particle_for_radiation
150+
long_name = effective diameter of stratiform graupel particles for radiation
151+
units = m
152+
dimensions = (horizontal_loop_extent, vertical_layer_dimension)
153+
type = real
154+
kind = kind_phys
155+
intent = out
50156
[errmsg]
51157
standard_name = ccpp_error_message
52158
long_name = error message for error handling in CCPP

test/test_suites/suite_pumas.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
<!-- Apply tendencies -->
2222
<scheme>apply_constituent_tendencies</scheme>
2323
<scheme>clamp_number_concentrations</scheme>
24+
<!-- Recompute size distribution quantities for radiation from the updated
25+
constituents; needs the pre-heating air temperature, so it must run
26+
before apply_heating_rate -->
27+
<scheme>pumas_post_main</scheme>
28+
<scheme>micro_pumas_ccpp_optics_limiter</scheme>
2429
<scheme>apply_heating_rate</scheme>
2530
<!--<scheme>qneg</scheme>-->
2631
<scheme>geopotential_temp</scheme>
27-
<!-- Post PUMAS for REI - needs updated numice, numliq -->
28-
<scheme>pumas_post_main</scheme>
2932
</group>
3033
</suite>

0 commit comments

Comments
 (0)