@@ -10,32 +10,35 @@ module pumas_post_main
1010 ! > \section arg_table_pumas_post_main_run Argument Table
1111 ! ! \htmlinclude pumas_post_main_run.html
1212 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 )
13+ cldliq , numliq , cldice , numice , snow , numsnow , graupel , numgraup , &
14+ strat_cldfrc , effi , dei , pgam , lamc , des , degrau , errmsg , errcode )
1515 use ccpp_kinds, only: kind_phys
1616 use pumas_kinds, only: pumas_r8 = >kind_r8
1717 use micro_pumas_utils, only: size_dist_param_basic, size_dist_param_liq, &
1818 mg_ice_props, mg_liq_props, avg_diameter, &
19- mincld, qsmall, rhog, rhows, rhoi
19+ mincld, qsmall, rhog, rhosn, rhows, rhoi
2020
2121 integer , intent (in ) :: ncol
2222 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)
23+ integer , intent (in ) :: trop_cloud_top_lev ! Index of the top model level for which
24+ ! tropospheric cloud physics is run (index)
2525 real (kind_phys), intent (in ) :: rair ! gas constant of dry air (J kg-1 K-1)
2626 real (kind_phys), dimension (:,:), intent (in ) :: pmid ! layer midpoint pressure (Pa)
2727 real (kind_phys), dimension (:,:), intent (in ) :: temp ! air temperature, before microphysics heating is applied (K)
2828 real (kind_phys), dimension (:,:), intent (in ) :: cldliq ! updated cloud liquid water mixing ratio (kg/kg)
2929 real (kind_phys), dimension (:,:), intent (in ) :: numliq ! updated cloud droplet number concentration (kg-1)
3030 real (kind_phys), dimension (:,:), intent (in ) :: cldice ! updated cloud ice mixing ratio (kg/kg)
3131 real (kind_phys), dimension (:,:), intent (in ) :: numice ! updated cloud ice number concentration (kg-1)
32+ real (kind_phys), dimension (:,:), intent (in ) :: snow ! updated snow mixing ratio (kg/kg)
33+ real (kind_phys), dimension (:,:), intent (in ) :: numsnow ! updated snow number concentration (kg-1)
3234 real (kind_phys), dimension (:,:), intent (in ) :: graupel ! updated graupel mixing ratio (kg/kg)
3335 real (kind_phys), dimension (:,:), intent (in ) :: numgraup ! updated graupel number concentration (kg-1)
3436 real (kind_phys), dimension (:,:), intent (in ) :: strat_cldfrc! total stratiform cloud area fraction (= ast)
3537 real (kind_phys), dimension (:,:), intent (out ) :: effi ! ice effective radius (micron)
3638 real (kind_phys), dimension (:,:), intent (out ) :: dei ! ice effective diameter for radiation (micron)
3739 real (kind_phys), dimension (:,:), intent (out ) :: pgam ! droplet size distribution shape parameter for radiation (1)
3840 real (kind_phys), dimension (:,:), intent (out ) :: lamc ! droplet size distribution slope for radiation (1)
41+ real (kind_phys), dimension (:,:), intent (out ) :: des ! snow effective diameter for radiation (micron)
3942 real (kind_phys), dimension (:,:), intent (out ) :: degrau ! graupel effective diameter for radiation (m)
4043 character (len= 512 ), intent (out ) :: errmsg
4144 integer , intent (out ) :: errcode
@@ -49,6 +52,10 @@ subroutine pumas_post_main_run(ncol, nlev, trop_cloud_top_lev, rair, pmid, temp,
4952 real (pumas_r8 ) :: rho(ncol, nlev) ! air density
5053 real (pumas_r8 ) :: mu(ncol, nlev) ! droplet size distribution shape parameter
5154 real (pumas_r8 ) :: lambdac(ncol, nlev) ! droplet size distribution slope
55+ real (pumas_r8 ) :: qs(ncol, nlev) ! grid-mean snow mixing ratio
56+ real (pumas_r8 ) :: ns(ncol, nlev) ! grid-mean snow number conc
57+ real (pumas_r8 ) :: dsout2(ncol, nlev) ! mean snow particle diameter
58+ real (pumas_r8 ) :: desm(ncol, nlev) ! snow effective diameter (m)
5259 real (pumas_r8 ) :: qg(ncol, nlev) ! grid-mean graupel mixing ratio
5360 real (pumas_r8 ) :: ng(ncol, nlev) ! grid-mean graupel number conc
5461 real (pumas_r8 ) :: dgout2(ncol, nlev) ! mean graupel particle diameter
@@ -59,7 +66,6 @@ subroutine pumas_post_main_run(ncol, nlev, trop_cloud_top_lev, rair, pmid, temp,
5966 ! Ice effective radius is recomputed here from the post-microphysics
6067 ! grid-mean in-cloud ice, NOT from the raw per-substep value PUMAS returns.
6168 ! PUMAS uses the total stratiform fraction for ice cloud (icecldf = ast).
62- ! Mirrors CAM micro_pumas_cam.F90:2677 (icimrst), :3174 (niic), :3171-3193 (rei).
6369 icimrst(:,:) = min (real (cldice(:ncol,:), pumas_r8 ) / &
6470 max (mincld, real (strat_cldfrc(:ncol,:), pumas_r8 )), 0.005_pumas_r8 )
6571 niic(:,:) = real (numice(:ncol,:), pumas_r8 ) / &
@@ -79,16 +85,16 @@ subroutine pumas_post_main_run(ncol, nlev, trop_cloud_top_lev, rair, pmid, temp,
7985 effi(:ncol,:) = real (rei(:,:), kind_phys)
8086
8187 ! Ice effective diameter for radiation follows from the recomputed
82- ! effective radius. Mirrors CAM micro_pumas_cam.F90:3080 (dei).
88+ ! effective radius.
8389 dei(:ncol,:) = real (rei(:,:) * rhoi/ rhows * 2._pumas_r8 , kind_phys)
8490
8591 ! 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+ ! from the post-microphysics grid-mean in-cloud liquid.
93+ ! Air density uses the temperature BEFORE the microphysics heating is applied
94+ ! The original comment in CAM noted:
95+ ! "State instead of state_loc to preserve answers for MG1 (and in any
96+ ! case, it is unlikely to make much difference)."
97+ ! PUMAS uses the total stratiform fraction for liquid cloud (liqcldf = ast)
9298 rho(:,:) = real (pmid(:ncol,:), pumas_r8 ) / &
9399 (real (rair, pumas_r8 ) * real (temp(:ncol,:), pumas_r8 ))
94100 icwmrst(:,:) = min (real (cldliq(:ncol,:), pumas_r8 ) / &
@@ -103,17 +109,32 @@ subroutine pumas_post_main_run(ncol, nlev, trop_cloud_top_lev, rair, pmid, temp,
103109 mu(:,k), lambdac(:,k), ncol)
104110 end do
105111
106- ! size_dist_param_liq flags no-cloud points with mu = -100; CAM resets
107- ! those to zero (lambdac is already zero there).
112+ ! size_dist_param_liq flags no-cloud points with mu = -100 and reset to zero.
108113 where (icwmrst(:,trop_cloud_top_lev:) < qsmall)
109114 mu(:,trop_cloud_top_lev:) = 0._pumas_r8
110115 end where
111116
112117 pgam(:ncol,:) = real (mu(:,:), kind_phys)
113118 lamc(:ncol,:) = real (lambdac(:,:), kind_phys)
114119
115- ! Graupel effective diameter for radiation, from the post-microphysics
116- ! grid-mean graupel. Mirrors CAM micro_pumas_cam.F90:3043-3056 (degrau).
120+ ! Snow effective diameter for radiation, from the post-microphysics grid-mean snow
121+ qs(:,:) = real (snow(:ncol,:), pumas_r8 )
122+ ns(:,:) = real (numsnow(:ncol,:), pumas_r8 )
123+
124+ dsout2(:,:) = 0._pumas_r8
125+ desm(:,:) = 0._pumas_r8
126+ where (qs(:,trop_cloud_top_lev:) >= 1.e-7_pumas_r8 )
127+ dsout2(:,trop_cloud_top_lev:) = avg_diameter( &
128+ qs(:,trop_cloud_top_lev:), &
129+ ns(:,trop_cloud_top_lev:) * rho(:,trop_cloud_top_lev:), &
130+ rho(:,trop_cloud_top_lev:), rhosn)
131+ desm(:,trop_cloud_top_lev:) = dsout2(:,trop_cloud_top_lev:) * &
132+ 3._pumas_r8 * rhosn/ rhows
133+ end where
134+
135+ des(:ncol,:) = real (desm(:,:) * 1.e6_pumas_r8 , kind_phys)
136+
137+ ! Graupel effective diameter for radiation, from the post-microphysics grid-mean graupel
117138 qg(:,:) = real (graupel(:ncol,:), pumas_r8 )
118139 ng(:,:) = real (numgraup(:ncol,:), pumas_r8 )
119140
0 commit comments