Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Registry/Registry.EM_COMMON
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,7 @@ rconfig integer ISFFLX namelist,physics 1 1
rconfig integer IFSNOW namelist,physics 1 1 irh "IFSNOW" "" ""
rconfig integer ICLOUD namelist,physics 1 1 irh "ICLOUD" "" ""
rconfig integer cldovrlp namelist,physics 1 2 irh "cldovrlp" "1=random, 2=maximum-random, 3=maximum, 4=exponential, 5=exponential-random" ""
rconfig integer idcor namelist,physics 1 0 irh "idcor" "0=constant decorrelation length, 2500 m, 1=latitude-varying decorrelation length" ""
rconfig integer ideal_xland namelist,physics 1 1 rh "IDEAL_XLAND" "land=1(def), water=2, for ideal cases with no land-use" ""
rconfig real swrad_scat namelist,physics 1 1 irh "SWRAD_SCAT" "SCATTERING FACTOR IN SWRAD" ""
rconfig integer surface_input_source namelist,physics 1 3 irh "surface_input_source" "1=static (fractional), 2=time dependent (dominant), 3=dominant cateogry from metgrid" ""
Expand Down
3 changes: 2 additions & 1 deletion dyn_em/module_first_rk_step_part1.F
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ SUBROUTINE first_rk_step_part1 ( grid , config_flags &
& , CLDFRA_DP=grid%cldfra_dp & ! ckay for subgrid cloud
& , CLDFRA_SH=grid%cldfra_sh &
& , icloud_bl=config_flags%icloud_bl &
& , cldovrlp=config_flags%cldovrlp & ! J. Henderson AER: cldovrlp namelist value
& , cldovrlp=config_flags%cldovrlp &
& , idcor=config_flags%idcor &
& , qc_bl=grid%qc_bl,qi_bl=grid%qi_bl,cldfra_bl=grid%cldfra_bl&
& , re_cloud=grid%re_cloud, re_ice=grid%re_ice, re_snow=grid%re_snow & ! G. Thompson
& , has_reqc=grid%has_reqc, has_reqi=grid%has_reqi, has_reqs=grid%has_reqs & ! G. Thompson
Expand Down
128 changes: 112 additions & 16 deletions phys/module_ra_rrtmg_lw.F
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,7 @@ module mcica_subcol_gen_lw

use parkind, only : im => kind_im, rb => kind_rb
use parrrtm, only : nbndlw, ngptlw
use rrlw_con, only: grav
use rrlw_con, only: grav, pi
use rrlw_wvn, only: ngb
use rrlw_vsn

Expand All @@ -2085,10 +2085,13 @@ module mcica_subcol_gen_lw
!------------------------------------------------------------------
! Public subroutines
!------------------------------------------------------------------

subroutine mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, hgt, &
cldfrac, ciwp, clwp, cswp, rei, rel, res, tauc, cldfmcl, &
ciwpmcl, clwpmcl, cswpmcl, reicmcl, relqmcl, resnmcl, taucmcl)
! mji - Add height needed for exponential and exponential-random cloud overlap methods
! (icld=4 and 5, respectively) along with idcor, juldat and lat used to specify
! the decorrelation length for these methods
Comment thread
davegill marked this conversation as resolved.
subroutine mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, &
cldfrac, ciwp, clwp, cswp, rei, rel, res, tauc, &
hgt, idcor, juldat, lat, &
cldfmcl, ciwpmcl, clwpmcl, cswpmcl, reicmcl, relqmcl, resnmcl, taucmcl)

! ----- Input -----
! Control
Expand Down Expand Up @@ -2132,6 +2135,9 @@ subroutine mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, hgt
! Dimensions: (ncol,nlay)
real(kind=rb), intent(in) :: res(:,:) ! snow particle size
! Dimensions: (ncol,nlay)
integer(kind=im), intent(in) :: idcor ! Decorrelation length type
integer(kind=im), intent(in) :: juldat ! Julian date (day of year, 1-365)
real(kind=rb), intent(in) :: lat ! latitude (degrees, -90 to 90)

! ----- Output -----
! Atmosphere/clouds - cldprmc [mcica]
Expand Down Expand Up @@ -2167,6 +2173,14 @@ subroutine mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, hgt
! real(kind=rb) :: qi(ncol, nlay) ! ice water (specific humidity)
! real(kind=rb) :: ql(ncol, nlay) ! liq water (specific humidity)

! MJI - For latitude dependent decorrelation length
real(kind=rb), parameter :: am1 = 1.4315_rb
real(kind=rb), parameter :: am2 = 2.1219_rb
real(kind=rb), parameter :: am4 = -25.584_rb
real(kind=rb), parameter :: amr = 7._rb
real(kind=rb) :: am3
real(kind=rb) :: decorr_len(ncol) ! decorrelation length (meters)
real(kind=rb), parameter :: Zo_default = 2500._rb ! default constant decorrelation length (m)

! Return if clear sky; or stop if icld out of range
if (icld.eq.0) return
Expand Down Expand Up @@ -2200,15 +2214,35 @@ subroutine mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, hgt
! ql(ilev) = (clwp(ilev) * grav) / (pdel(ilev) * 1000._rb)
! enddo

! MJI - Latitude and day of year dependent decorrelation length
if (idcor .eq. 1) then
! Derive decorrelation length based on day of year and latitude (from NASA GMAO method)
! Result is in meters
if (juldat .gt. 181) then
am3 = -4._rb * amr / 365._rb * (juldat-272)
else
am3 = 4._rb * amr / 365._rb * (juldat-91)
endif
! Latitude in radians, decorrelation length in meters
! decorr_len(:) = ( am1 + am2 * exp(-(lat*180._rb/pi - am3)**2 / (am4*am4)) ) * 1.e3_rb
! Latitude in degrees, decorrelation length in meters
decorr_len(:) = ( am1 + am2 * exp(-(lat - am3)**2 / (am4*am4)) ) * 1.e3_rb
Comment thread
davegill marked this conversation as resolved.
else
! Spatially and temporally constant decorrelation length
decorr_len(:) = Zo_default
endif

! Generate the stochastic subcolumns of cloud optical properties for the longwave;
call generate_stochastic_clouds (ncol, nlay, nsubclw, icld, irng, pmid, hgt, cldfrac, clwp, ciwp, cswp, tauc, &
call generate_stochastic_clouds (ncol, nlay, nsubclw, icld, irng, pmid, cldfrac, clwp, ciwp, cswp, tauc, &
hgt, decorr_len, &
cldfmcl, clwpmcl, ciwpmcl, cswpmcl, taucmcl, permuteseed)

end subroutine mcica_subcol_lw


!-------------------------------------------------------------------------------------------------
subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt, cld, clwp, ciwp, cswp, tauc, &
subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, cld, clwp, ciwp, cswp, tauc, &
hgt, decorr_len, &
cld_stoch, clwp_stoch, ciwp_stoch, cswp_stoch, tauc_stoch, changeSeed)
!-------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -2307,6 +2341,8 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt
! real(kind=rb), intent(in) :: asmc(:,:,:) ! in-cloud asymmetry parameter
! Dimensions: (nbndlw,ncol,nlay)
! inactive - for future expansion
real(kind=rb), intent(in) :: decorr_len(:) ! decorrelation length (meters)
! Dimensions: (ncol)

real(kind=rb), intent(out) :: cld_stoch(:,:,:) ! subcolumn cloud fraction
! Dimensions: (ngptlw,ncol,nlay)
Expand Down Expand Up @@ -2340,7 +2376,7 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt
integer(kind=im) :: overlap ! 1 = random overlap, 2 = maximum-random,
! 3 = maximum overlap, 4 = exponential,
! 5 = exponential-random
real(kind=rb), parameter :: Zo = 2500._rb ! length scale (m)
real(kind=rb) :: Zo_inv(ncol) ! inverse of decorrelation length scale (m)
real(kind=rb), dimension(ncol,nlay) :: alpha ! overlap parameter

! Constants (min value for cloud fraction and cloud water and ice)
Expand All @@ -2367,6 +2403,7 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt

! Pass input cloud overlap setting to local variable
overlap = icld
Zo_inv(:) = 1._rb / decorr_len(:)

! Ensure that cloud fractions are in bounds
do ilev = 1, nlay
Expand Down Expand Up @@ -2489,7 +2526,9 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt
endif

case(4)
! Exponential overlap: weighting between maximum and random overlap increases with the distance.
! Exponential overlap: transition from maximum to random cloud overlap increases
! exponentially with layer thickness and distance through layers
!
! The random numbers for exponential overlap verify:
! j=1 RAN(j)=RND1
! j>1 if RND1 < alpha(j,j-1) => RAN(j) = RAN(j-1)
Expand All @@ -2501,7 +2540,7 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt
do i = 1, ncol
alpha(i, 1) = 0._rb
do ilev = 2,nlay
alpha(i, ilev) = exp( -( hgt (i, ilev) - hgt (i, ilev-1)) / Zo)
alpha(i, ilev) = exp( -(hgt(i,ilev) - hgt(i,ilev-1)) * Zo_inv(i))
enddo
enddo

Expand Down Expand Up @@ -2536,8 +2575,55 @@ subroutine generate_stochastic_clouds(ncol, nlay, nsubcol, icld, irng, pmid, hgt
end do

case(5)
! Exponential-random overlap:
call wrf_error_fatal("Cloud Overlap case 5: ER has not yet been implemented. Stopping...")
! Exponential_Random overlap: transition from maximum to random cloud overlap increases
! exponentially with layer thickness and with distance through adjacent cloudy layers.
! Non-adjacent blocks of clouds are treated randomly, and each block begins a new
! exponential transition from maximum to random.
!
! compute alpha: bottom to top
! - set alpha to 0 in bottom layer (no layer below for correlation)
do i = 1, ncol
alpha(i, 1) = 0._rb
do ilev = 2,nlay
alpha(i, ilev) = exp( -(hgt(i,ilev) - hgt(i,ilev-1) ) * Zo_inv(i))
! Decorrelate layers when clear layer follows a cloudy layer to enforce
! random correlation between non-adjacent cloudy layers
if (cldf(i,ilev) .eq. 0.0_rb .and. cldf(i,ilev-1) .gt. 0.0_rb) then
alpha(i,ilev) = 0.0_rb
endif
end do
end do

! generate 2 streams of random numbers
! CDF2 is used to select which sub-columns are vertically correlated relative to alpha
! CDF is used to select which sub-columns are treated as cloudy relative to cloud fraction
if (irng.eq.0) then
do isubcol = 1,nsubcol
do ilev = 1,nlay
call kissvec(seed1, seed2, seed3, seed4, rand_num)
CDF(isubcol, :, ilev) = rand_num
call kissvec(seed1, seed2, seed3, seed4, rand_num)
CDF2(isubcol, :, ilev) = rand_num
end do
end do
elseif (irng.eq.1) then
do isubcol = 1, nsubcol
do i = 1, ncol
do ilev = 1,nlay
rand_num_mt = getRandomReal(randomNumbers)
CDF(isubcol,i,ilev) = rand_num_mt
rand_num_mt = getRandomReal(randomNumbers)
CDF2(isubcol,i,ilev) = rand_num_mt
enddo
enddo
enddo
endif
! generate vertical correlations in random number arrays - bottom to top
do ilev = 2,nlay
where (CDF2(:, :, ilev) < spread(alpha (:,ilev), dim=1, nCopies=nsubcol) )
CDF(:,:,ilev) = CDF(:,:,ilev-1)
end where
end do

end select

Expand Down Expand Up @@ -11489,7 +11575,7 @@ SUBROUTINE RRTMG_LWRAD( &
p8w, p3d, pi3d, &
dz8w, tsk, t3d, t8w, rho3d, r, g, &
icloud, warm_rain, cldfra3d, &
cldovrlp, &
cldovrlp,idcor,xlat, &
lradius,iradius, &
is_cammgmp_used, &
f_ice_phy, f_rain_phy, &
Expand Down Expand Up @@ -11665,9 +11751,15 @@ SUBROUTINE RRTMG_LWRAD( &
nlay, &
icld, &
cldovrlp, &
idcor, &
juldat, &
inflglw, &
iceflglw, &
liqflglw
! Latitude
real, dimension( ims:ime,jms:jme ), intent(in) :: xlat ! (latitude for cldovrlp=4 or 5)
real :: lat

! Dimension with extra layer from model top to TOA
real, dimension( 1, kts:nlayers+1 ) :: plev, &
tlev
Expand Down Expand Up @@ -12087,6 +12179,8 @@ SUBROUTINE RRTMG_LWRAD( &
! Select cloud overlap assumption (1 = random, 2 = maximum-random, 3 = maximum, 4 = exponential, 5 = exponential-random
icld=cldovrlp ! J. Henderson AER assign namelist variable cldovrlp to existing icld

! Set julian date
juldat = julian
! Select cloud liquid and ice optics parameterization options
! For passing in cloud optical properties directly:
! icld = 2
Expand Down Expand Up @@ -12605,9 +12699,11 @@ SUBROUTINE RRTMG_LWRAD( &
permuteseed = 150

! Sub-column generator for McICA
call mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, hgt, &
cldfrac, ciwpth, clwpth, cswpth, rei, rel, res, taucld, cldfmcl, &
ciwpmcl, clwpmcl, cswpmcl, reicmcl, relqmcl, resnmcl, taucmcl)
lat=xlat(i,j) !retrieve scalar latitude for column calculation
call mcica_subcol_lw(iplon, ncol, nlay, icld, permuteseed, irng, play, &
cldfrac, ciwpth, clwpth, cswpth, rei, rel, res, taucld, &
hgt, idcor, juldat, lat, &
cldfmcl, ciwpmcl, clwpmcl, cswpmcl, reicmcl, relqmcl, resnmcl, taucmcl)

!--------------------------------------------------------------------------
! Aerosol optical depth, single scattering albedo and asymmetry parameter -czhao 03/2010
Expand Down
Loading