|
| 1 | +module micro_pumas_ccpp_optics_limiter |
| 2 | + |
| 3 | + use ccpp_kinds, only: kind_phys |
| 4 | + |
| 5 | + implicit none |
| 6 | + private |
| 7 | + |
| 8 | + public :: micro_pumas_ccpp_optics_limiter_run |
| 9 | + |
| 10 | + !Convective size distribution parameters, used in place of the stratiform |
| 11 | + !parameters where the stratiform cloud fraction is negligible. |
| 12 | + !Mirrors CAM micro_pumas_cam.F90. |
| 13 | + real(kind_phys), parameter :: dcon = 25.e-6_kind_phys !Convective size distribution effective radius (m) |
| 14 | + real(kind_phys), parameter :: mucon = 5.3_kind_phys !Convective size distribution shape parameter (1) |
| 15 | + real(kind_phys), parameter :: deicon = 50._kind_phys !Convective ice effective diameter (um) |
| 16 | + |
| 17 | + !Stratiform cloud fraction below which the stratiform size distribution is |
| 18 | + !discarded. PUMAS divides cloud water by the cloud fraction to obtain the |
| 19 | + !in-cloud values these parameters are derived from, so as the cloud fraction |
| 20 | + !vanishes the slope and diameters it produces grow without bound. |
| 21 | + real(kind_phys), parameter :: cldfrc_min = 1.e-4_kind_phys |
| 22 | + |
| 23 | +contains |
| 24 | + !> \section arg_table_micro_pumas_ccpp_optics_limiter_run Argument Table |
| 25 | + !! \htmlinclude micro_pumas_ccpp_optics_limiter_run.html |
| 26 | + subroutine micro_pumas_ccpp_optics_limiter_run(ncol, nlev, trop_cloud_top_lev, & |
| 27 | + strat_cldfrc, pgamrad, lamcrad, deffi, errmsg, errcode) |
| 28 | + |
| 29 | + integer, intent(in) :: ncol !Number of horizontal columns (count) |
| 30 | + integer, intent(in) :: nlev !Number of vertical layers (count) |
| 31 | + integer, intent(in) :: trop_cloud_top_lev !Index of the top model level for which |
| 32 | + !tropospheric cloud physics is run (index) |
| 33 | + real(kind_phys), intent(in) :: strat_cldfrc(:, :) !Stratiform cloud area fraction (fraction) |
| 34 | + real(kind_phys), intent(inout) :: pgamrad(:, :) !Size distribution shape parameter (1) |
| 35 | + real(kind_phys), intent(inout) :: lamcrad(:, :) !Slope of droplet distribution (m-1) |
| 36 | + real(kind_phys), intent(inout) :: deffi(:, :) !Effective diameter of cloud ice particle (um) |
| 37 | + character(len=512), intent(out) :: errmsg !CCPP error message (none) |
| 38 | + integer, intent(out) :: errcode !CCPP error code (1) |
| 39 | + |
| 40 | + integer :: i, k |
| 41 | + |
| 42 | + errmsg = '' |
| 43 | + errcode = 0 |
| 44 | + |
| 45 | + !lamcrad is an inverse length; it is declared dimensionless in the metadata |
| 46 | + !to match the RRTMGP and host declarations, so dcon must stay in meters for |
| 47 | + !the value handed to radiation to be consistent with CAM. |
| 48 | + do k = trop_cloud_top_lev, nlev |
| 49 | + do i = 1, ncol |
| 50 | + if (strat_cldfrc(i, k) < cldfrc_min) then |
| 51 | + pgamrad(i, k) = mucon |
| 52 | + lamcrad(i, k) = (mucon + 1._kind_phys) / dcon |
| 53 | + deffi(i, k) = deicon |
| 54 | + end if |
| 55 | + end do |
| 56 | + end do |
| 57 | + |
| 58 | + end subroutine micro_pumas_ccpp_optics_limiter_run |
| 59 | + |
| 60 | +end module micro_pumas_ccpp_optics_limiter |
0 commit comments