Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
59 changes: 46 additions & 13 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@
<var name="ktop_deep"/>
<var name="xmb_total"/>
<var name="xmb_shallow"/>
<var name="cldfrac_dp"/>
<var name="cldfrac_sh"/>
<var name="qc_cu"/>
<var name="qi_cu"/>
<var name="rthmpten"/>
Expand Down Expand Up @@ -934,10 +936,12 @@

<var name="i_rainnc"/>
<var name="rainnc"/>
<var name="rainncv"/>
<var name="precipw"/>
<var name="cuprec"/>
<var name="i_rainc"/>
<var name="rainc"/>
<var name="raincv"/>
<var name="kpbl"/>
<var name="hpbl"/>
<var name="hfx"/>
Expand Down Expand Up @@ -2179,6 +2183,16 @@
description="configuration for convection schemes"
possible_values="`suite',`cu_kain_fritsch',`cu_tiedtke',`cu_ntiedtke',`cu_grell_freitas',`off'"/>

<nml_option name="config_kfeta_trigger" type="integer" default_value="1" in_defaults="false"
units="-"
description="KF (1) original or (2) moisture-advection based convection trigger"
possible_values="1 or 2"/>

<nml_option name="config_cu_radt_feedback" type="logical" default_value="false" in_defaults="false"
units="-"
description="whether to enable KF subgrid-scale cloud feedbacks to the SW and LW radiation schemes"
possible_values=".true. or .false."/>

<nml_option name="config_lsm_scheme" type="character" default_value="suite" in_defaults="false"
units="-"
description="configuration for land-surface schemes"
Expand Down Expand Up @@ -2487,6 +2501,22 @@
description="time running-averaged vertical velocity"
packages="cu_kain_fritsch_in"/>

<var name="cldfrac_dp" type="real" dimensions="nVertLevels nCells Time" units="unitless"
description="sugbgrid-scale cloud fraction from KF deep convection"
packages="cu_kain_fritsch_in"/>

<var name="cldfrac_sh" type="real" dimensions="nVertLevels nCells Time" units="unitless"
description="subgrid-scale cloud fraction from KF shallow convection"
packages="cu_kain_fritsch_in"/>

<var name="cldfracwcu" type="real" dimensions="nVertLevels nCells Time" units="unitless"
description="horizontal cloud fraction including convective cloud fraction"
packages="cu_kain_fritsch_in"/>

<var name="cldfracwcut" type="real" dimensions="nCells Time" units="unitless"
description="total cloud fraction including convective cloud fraction"
packages="cu_kain_fritsch_in"/>


<!-- ... GRELL-FREITAS ONLY: -->
<var name="k22_shallow" type="integer" dimensions="nCells Time" units="unitless"
Expand All @@ -2513,14 +2543,6 @@
description="cloud base mass flux for shallow convection"
packages="cu_grell_freitas_in"/>

<var name="qc_cu" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1}"
description="in-cloud cloud water mixing ratio in Grell-Freitas cloud model"
packages="cu_grell_freitas_in"/>

<var name="qi_cu" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1}"
description="in-cloud cloud ice mixing ratio in Grell-Freitas cloud model"
packages="cu_grell_freitas_in"/>


<!-- ... KAIN_FRITSCH AND GRELL-FREITAS: -->
<var name="cubot" type="real" dimensions="nCells Time" units="unitless"
Expand All @@ -2531,6 +2553,14 @@
description="index of lowest level of convection"
packages="cu_grell_freitas_in;cu_kain_fritsch_in"/>

<var name="qc_cu" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1}"
description="in-cloud cloud water mixing ratio from convection parameterization"
packages="cu_grell_freitas_in;cu_kain_fritsch_in"/>

<var name="qi_cu" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1}"
description="in-cloud cloud ice mixing ratio from convection parameterization"
packages="cu_grell_freitas_in;cu_kain_fritsch_in"/>


<!-- ================================================================================================== -->
<!-- ... PARAMETERIZATION OF PLANETARY BOUNDARY LAYER PROCESSES: -->
Expand Down Expand Up @@ -3100,7 +3130,10 @@
<!-- ================================================================================================== -->

<var name="cldfrac" type="real" dimensions="nVertLevels nCells Time" units="unitless"
description="horizontal cloud fraction"/>
description="grid-scale horizontal cloud fraction"/>

<var name="cldfract" type="real" dimensions="nCells Time" units="unitless"
description="grid-scale total cloud fraction"/>


<!-- ================================================================================================== -->
Expand Down Expand Up @@ -3322,6 +3355,10 @@
description="tendency of cloud ice mixing ratio due to cumulus convection"
packages="cu_grell_freitas_in;cu_kain_fritsch_in;cu_ntiedtke_in"/>

<var name="rqvdynten" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1} s^{-1}"
description="tendency of water vapor due to horizontal and vertical advections"
packages="cu_grell_freitas_in;cu_kain_fritsch_in;cu_ntiedtke_in"/>


<!-- KAIN_FRITSCH: -->
<var name="rqrcuten" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1} s^{-1}"
Expand All @@ -3333,10 +3370,6 @@
packages="cu_kain_fritsch_in"/>

<!-- TIEDTKE AND GRELL -->
<var name="rqvdynten" type="real" dimensions="nVertLevels nCells Time" units="kg kg^{-1} s^{-1}"
description="tendency of water vapor due to horizontal and vertical advections"
packages="cu_grell_freitas_in;cu_ntiedtke_in"/>

<var name="rucuten" type="real" dimensions="nVertLevels nCells Time" units="m s^{-1} s^{-1}"
description="tendency of zonal wind due to cumulus convection"
packages="cu_grell_freitas_in;cu_ntiedtke_in"/>
Expand Down
186 changes: 161 additions & 25 deletions src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ module mpas_atmphys_driver_cloudiness
! cloud formation, but changes to the cloud water and cloud ice mixing ratios only affect the long wave and
! short wave radiation codes.
! Laura D. Fowler (laura@ucar.edu) / 2016-07-05.
! * implemented cloud fraction and condensates from Kain-Fritsch convection parameterization.
! Jerold A. Herwehe (herwehe.jerry@epa.gov) / 2016-12-08.
! * since we removed the local variable radt_cld_scheme from mpas_atmphys_vars.F, now defines radt_cld_scheme
! as a pointer to config_radt_cld_scheme.
! Laura D. Fowler (laura@ucar.edu) / 2017-02-16.
Expand All @@ -67,6 +69,11 @@ subroutine allocate_cloudiness
if(.not.allocated(dx_p) ) allocate(dx_p(ims:ime,jms:jme) )
if(.not.allocated(xland_p) ) allocate(xland_p(ims:ime,jms:jme) )
if(.not.allocated(cldfrac_p)) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme))
if(.not.allocated(cldfracrad_p))allocate(cldfracrad_p(ims:ime,kms:kme,jms:jme))
if(.not.allocated(cldfrac_dp_p))allocate(cldfrac_dp_p(ims:ime,kms:kme,jms:jme))
if(.not.allocated(cldfrac_sh_p))allocate(cldfrac_sh_p(ims:ime,kms:kme,jms:jme))
if(.not.allocated(qccu_p) ) allocate(qccu_p(ims:ime,kms:kme,jms:jme) )
if(.not.allocated(qicu_p) ) allocate(qicu_p(ims:ime,kms:kme,jms:jme) )
if(.not.allocated(qvrad_p) ) allocate(qvrad_p(ims:ime,kms:kme,jms:jme) )
if(.not.allocated(qcrad_p) ) allocate(qcrad_p(ims:ime,kms:kme,jms:jme) )
if(.not.allocated(qirad_p) ) allocate(qirad_p(ims:ime,kms:kme,jms:jme) )
Expand All @@ -81,6 +88,11 @@ subroutine deallocate_cloudiness
if(allocated(dx_p) ) deallocate(dx_p )
if(allocated(xland_p) ) deallocate(xland_p )
if(allocated(cldfrac_p)) deallocate(cldfrac_p)
if(allocated(cldfracrad_p))deallocate(cldfracrad_p)
if(allocated(cldfrac_dp_p))deallocate(cldfrac_dp_p )
if(allocated(cldfrac_sh_p))deallocate(cldfrac_sh_p )
if(allocated(qccu_p) ) deallocate(qccu_p )
if(allocated(qicu_p) ) deallocate(qicu_p )
if(allocated(qvrad_p) ) deallocate(qvrad_p )
if(allocated(qcrad_p) ) deallocate(qcrad_p )
if(allocated(qirad_p) ) deallocate(qirad_p )
Expand All @@ -105,14 +117,16 @@ subroutine cloudiness_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)

!local variables and pointers:
integer:: i,j,k

real(kind=RKIND),dimension(:,:),pointer:: cldfrac_dp,cldfrac_sh,qc_cu,qi_cu
real(kind=RKIND),pointer:: len_disp
real(kind=RKIND),dimension(:),pointer:: areaCell,meshDensity
real(kind=RKIND),dimension(:),pointer:: xland
character(len=StrKIND),pointer:: convection_scheme

!-----------------------------------------------------------------------------------------------------------------

call mpas_pool_get_config(configs,'config_len_disp',len_disp)
call mpas_pool_get_config(configs,'config_convection_scheme',convection_scheme)

call mpas_pool_get_array(mesh,'areaCell' ,areaCell )
call mpas_pool_get_array(mesh,'meshDensity',meshDensity)
Expand All @@ -126,48 +140,131 @@ subroutine cloudiness_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
dx_p(i,j) = dx_p(i,j)*0.001
xland_p(i,j) = xland(i)
enddo

!--- initialize the radiative cloud fraction and water vapor, cloud water, cloud ice,
! and snow mixing ratios:
do k = kts,kte
do i = its,ite
qvrad_p(i,k,j) = qv_p(i,k,j)
qcrad_p(i,k,j) = qc_p(i,k,j)
qirad_p(i,k,j) = qi_p(i,k,j)
qsrad_p(i,k,j) = qs_p(i,k,j)
cldfrac_p(i,k,j) = 0._RKIND
enddo
enddo
enddo

!--- initialize the radiative cloud fraction and water vapor, cloud water, cloud ice,
! and snow mixing ratios:

convection_select: select case(convection_scheme)

case("cu_kain_fritsch")
call mpas_pool_get_array(diag_physics,'cldfrac_dp',cldfrac_dp)
call mpas_pool_get_array(diag_physics,'cldfrac_sh',cldfrac_sh)
call mpas_pool_get_array(diag_physics,'qc_cu' ,qc_cu )
call mpas_pool_get_array(diag_physics,'qi_cu' ,qi_cu )

do j = jts,jte
do k = kts,kte
do i = its,ite
qvrad_p(i,k,j) = qv_p(i,k,j)
qcrad_p(i,k,j) = qc_p(i,k,j)
qirad_p(i,k,j) = qi_p(i,k,j)
qsrad_p(i,k,j) = qs_p(i,k,j)
cldfrac_p(i,k,j) = 0._RKIND
cldfracrad_p(i,k,j) = 0._RKIND
cldfrac_dp_p(i,k,j) = cldfrac_dp(k,i)
cldfrac_sh_p(i,k,j) = cldfrac_sh(k,i)
qccu_p(i,k,j) = qc_cu(k,i)
qicu_p(i,k,j) = qi_cu(k,i)
enddo
enddo
enddo

case default
do j = jts,jte
do k = kts,kte
do i = its,ite
qvrad_p(i,k,j) = qv_p(i,k,j)
qcrad_p(i,k,j) = qc_p(i,k,j)
qirad_p(i,k,j) = qi_p(i,k,j)
qsrad_p(i,k,j) = qs_p(i,k,j)
cldfrac_p(i,k,j) = 0._RKIND
cldfracrad_p(i,k,j) = 0._RKIND
enddo
enddo
enddo

end select convection_select

end subroutine cloudiness_from_MPAS

!=================================================================================================================
subroutine cloudiness_to_MPAS(diag_physics,its,ite)
subroutine cloudiness_to_MPAS(configs,diag_physics,its,ite)
!=================================================================================================================

!input arguments:
integer,intent(in):: its,ite
type(mpas_pool_type),intent(in) :: configs

!inout arguments:
type(mpas_pool_type),intent(inout):: diag_physics

!local variables and pointers:
integer:: i,j,k

real(kind=RKIND),dimension(:,:),pointer:: cldfrac
real(kind=RKIND),dimension(:,:),pointer:: cldfrac,cldfracwcu
real(kind=RKIND),dimension(:),pointer:: cldfract,cldfracwcut

real(kind=RKIND):: cldji,cldwcuji
character(len=StrKIND),pointer:: convection_scheme

!-----------------------------------------------------------------------------------------------------------------

call mpas_pool_get_array(diag_physics,'cldfrac',cldfrac)
call mpas_pool_get_config(configs,'config_convection_scheme',convection_scheme)

call mpas_pool_get_array(diag_physics,'cldfrac' ,cldfrac)
call mpas_pool_get_array(diag_physics,'cldfract',cldfract)

convection_select: select case(convection_scheme)

case("cu_kain_fritsch")
call mpas_pool_get_array(diag_physics,'cldfracwcu',cldfracwcu)
call mpas_pool_get_array(diag_physics,'cldfracwcut',cldfracwcut)

do j = jts,jte
do k = kts,kte
do i = its,ite
cldfrac(k,i) = cldfrac_p(i,k,j)
cldfracwcu(k,i) = cldfracrad_p(i,k,j)
enddo
enddo
enddo

!compute cloud diagnosis (random overlapping) by ZCX (from WRF)
do j = jts,jte
do i = its,ite
cldji = 1._RKIND
cldwcuji = 1._RKIND
do k = kte-1,kts,-1
cldji = cldji * (1.0 - cldfrac_p(i,k,j))
cldwcuji = cldwcuji * (1.0 - cldfracrad_p(i,k,j))
enddo
cldfract(i) = 1.0 - cldji
cldfracwcut(i) = 1.0 - cldwcuji
enddo
enddo

do j = jts,jte
do k = kts,kte
do i = its,ite
cldfrac(k,i) = cldfrac_p(i,k,j)
enddo
enddo
enddo
case default
do j = jts,jte
do k = kts,kte
do i = its,ite
cldfrac(k,i) = cldfrac_p(i,k,j)
enddo
enddo
enddo

!compute cloud diagnosis (random overlapping) by ZCX (from WRF)
do j = jts,jte
do i = its,ite
cldji = 1._RKIND
do k = kte-1,kts,-1
cldji = cldji * (1.0 - cldfrac_p(i,k,j))
enddo
cldfract(i) = 1.0 - cldji
enddo
enddo

end select convection_select

end subroutine cloudiness_to_MPAS

Expand All @@ -187,14 +284,20 @@ subroutine driver_cloudiness(configs,mesh,diag_physics,sfc_input,its,ite)

!local variables and pointers:
character(len=StrKIND),pointer:: radt_cld_scheme
logical, pointer:: cu_radt_feedback

integer:: i,j,k

real(kind=RKIND):: cldfrac_cu
character(len=StrKIND),pointer:: convection_scheme

!-----------------------------------------------------------------------------------------------------------------
!call mpas_log_write('')
!call mpas_log_write('--- enter subroutine driver_cloudiness:')

call mpas_pool_get_config(configs,'config_radt_cld_scheme',radt_cld_scheme)
call mpas_pool_get_config(configs,'config_radt_cld_scheme' ,radt_cld_scheme )
call mpas_pool_get_config(configs,'config_convection_scheme',convection_scheme)
call mpas_pool_get_config(configs,'config_cu_radt_feedback' ,cu_radt_feedback )

!copy MPAS arrays to local arrays:
call cloudiness_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
Expand Down Expand Up @@ -226,8 +329,41 @@ subroutine driver_cloudiness(configs,mesh,diag_physics,sfc_input,its,ite)

end select cld_fraction_select

convection_select: select case(convection_scheme)

case("cu_kain_fritsch")
!--- assign radiative cloud fraction:
do j = jts,jte
do k = kts,kte
do i = its,ite
cldfracrad_p(i,k,j) = cldfrac_p(i,k,j)
enddo
enddo
enddo

if(cu_radt_feedback) then
!adjust cloud fraction and condensates before radiation calls if Cu feedback is enabled by
!incorporating subgrid-scale convective clouds into resolved cloudiness (based on CESM):
do j = jts,jte
do k = kts,kte
do i = its,ite
cldfrac_cu=cldfrac_dp_p(i,k,j)+cldfrac_sh_p(i,k,j) !Cu cloud fraction
cldfracrad_p(i,k,j)=(1.-cldfrac_cu)*cldfracrad_p(i,k,j) !update resolved cloud fraction for Cu punch-through
cldfracrad_p(i,k,j)=cldfracrad_p(i,k,j)+cldfrac_cu !new total cloud fraction for radiation
cldfracrad_p(i,k,j)=amin1(1.0,cldfracrad_p(i,k,j))
qcrad_p(i,k,j) = qcrad_p(i,k,j)+(qccu_p(i,k,j)*cldfrac_cu) !new total cloud water for radiation
qirad_p(i,k,j) = qirad_p(i,k,j)+(qicu_p(i,k,j)*cldfrac_cu) !new total cloud ice for radiation
enddo
enddo
enddo
endif

case default

end select convection_select

!copy local arrays to MPAS grid:
call cloudiness_to_MPAS(diag_physics,its,ite)
call cloudiness_to_MPAS(configs,diag_physics,its,ite)

!call mpas_log_write('--- end subroutine driver_cloudiness.')

Expand Down
Loading