@@ -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
59136end module pumas_post_main
0 commit comments