Skip to content

Commit

Permalink
Merge branch 'dtc/develop' of https://github.com/NCAR/ccpp-physics in…
Browse files Browse the repository at this point in the history
…to rrtmgp-dev
  • Loading branch information
dustinswales committed Dec 3, 2019
2 parents c62f631 + 7041bd2 commit 10191cd
Show file tree
Hide file tree
Showing 27 changed files with 4,735 additions and 342 deletions.
9 changes: 6 additions & 3 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ end subroutine GFS_MP_generic_post_init
!> \section gfs_mp_gen GFS MP Generic Post General Algorithm
!> @{
subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, &
imp_physics_thompson, imp_physics_mg, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, &
imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, &
rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, &
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, &
Expand All @@ -93,7 +93,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
implicit none

integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: cal_pre, lssav, ldiag3d, cplflx, cplchm

real(kind=kind_phys), intent(in) :: dtf, frain, con_g
Expand Down Expand Up @@ -179,6 +179,10 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
graupel = frain*graupel0 ! time-step graupel
ice = frain*ice0 ! time-step ice
snow = frain*snow0 ! time-step snow

else if (imp_physics == imp_physics_fer_hires) then
tprcp = max (0.,rain) ! time-step convective and explicit precip
ice = frain*rain1*sr ! time-step ice
end if

if (lsm==lsm_ruc) then
Expand Down Expand Up @@ -296,7 +300,6 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
! if (snow0(i)+ice0(i)+graupel0(i)+csnow > 0.0) then
! Sfcprop%srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1)
! endif
! compute fractional srflag
total_precip = snow0(i)+ice0(i)+graupel0(i)+rain0(i)+rainc(i)
if (total_precip > rainmin) then
srflag(i) = (snow0(i)+ice0(i)+graupel0(i)+csnow)/total_precip
Expand Down
8 changes: 8 additions & 0 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@
type = integer
intent = in
optional = F
[imp_physics_fer_hires]
standard_name = flag_for_fer_hires_microphysics_scheme
long_name = choice of Ferrier-Aligo microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[cal_pre]
standard_name = flag_for_precipitation_type_algorithm
long_name = flag controls precip type algorithm
Expand Down
43 changes: 36 additions & 7 deletions physics/GFS_PBL_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ end subroutine GFS_PBL_generic_pre_finalize
!!
subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, &
ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, &
ntwa, ntia, ntgl, ntoz, ntke, ntkev, trans_aero, ntchs, ntchm, &
ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef, trans_aero, ntchs, ntchm, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, &
imp_physics_zhao_carr, imp_physics_mg, cplchm, ltaerosol, hybedmf, do_shoc, &
imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires, cplchm, ltaerosol, hybedmf, do_shoc, &
satmedmf, qgrs, vdftra, errmsg, errflg)

use machine, only : kind_phys
Expand All @@ -93,10 +93,10 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,

integer, intent(in) :: im, levs, nvdiff, ntrac
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc
integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, ntchs, ntchm
integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef,ntchs, ntchm
logical, intent(in) :: trans_aero
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf

real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs
Expand Down Expand Up @@ -126,6 +126,20 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,
vdftra(i,k,4) = qgrs(i,k,ntoz)
enddo
enddo

! Ferrier-Aligo
elseif (imp_physics == imp_physics_fer_hires) then
do k=1,levs
do i=1,im
vdftra(i,k,1) = qgrs(i,k,ntqv)
vdftra(i,k,2) = qgrs(i,k,ntcw)
vdftra(i,k,3) = qgrs(i,k,ntiw)
vdftra(i,k,4) = qgrs(i,k,ntrw)
vdftra(i,k,5) = qgrs(i,k,nqrimef)
vdftra(i,k,6) = qgrs(i,k,ntoz)
enddo
enddo

elseif (imp_physics == imp_physics_thompson) then
! Thompson
if(ltaerosol) then
Expand Down Expand Up @@ -263,9 +277,10 @@ end subroutine GFS_PBL_generic_post_finalize
!! \htmlinclude GFS_PBL_generic_post_run.html
!!
subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, &
ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, &
ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev,nqrimef, &
trans_aero, ntchs, ntchm, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, &
imp_physics_fer_hires, &
ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, shinhong, do_ysu, &
dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, &
dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, &
Expand All @@ -280,10 +295,10 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
implicit none

integer, intent(in) :: im, levs, nvdiff, ntrac, ntchs, ntchm
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef
logical, intent(in) :: trans_aero
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea
logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu

Expand Down Expand Up @@ -365,6 +380,20 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
dqdt(i,k,ntoz) = dvdftra(i,k,4)
enddo
enddo

elseif (imp_physics == imp_physics_fer_hires) then
! Ferrier-Aligo
do k=1,levs
do i=1,im
dqdt(i,k,ntqv) = dvdftra(i,k,1)
dqdt(i,k,ntcw) = dvdftra(i,k,2)
dqdt(i,k,ntiw) = dvdftra(i,k,3)
dqdt(i,k,ntrw) = dvdftra(i,k,4)
dqdt(i,k,nqrimef) = dvdftra(i,k,5)
dqdt(i,k,ntoz) = dvdftra(i,k,6)
enddo
enddo

elseif (imp_physics == imp_physics_thompson) then
! Thompson
if(ltaerosol) then
Expand Down
32 changes: 32 additions & 0 deletions physics/GFS_PBL_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@
type = integer
intent = in
optional = F
[nqrimef]
standard_name = index_for_mass_weighted_rime_factor
long_name = tracer index for mass weighted rime factor
units = index
dimensions = ()
type = integer
intent = in
optional = F
[trans_aero]
standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion
long_name = flag for aerosol convective transport and PBL diffusion
Expand Down Expand Up @@ -233,6 +241,14 @@
type = integer
intent = in
optional = F
[imp_physics_fer_hires]
standard_name = flag_for_fer_hires_microphysics_scheme
long_name = choice of Ferrier-Aligo microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[cplchm]
standard_name = flag_for_chemistry_coupling
long_name = flag controlling cplchm collection (default off)
Expand Down Expand Up @@ -473,6 +489,14 @@
type = integer
intent = in
optional = F
[nqrimef]
standard_name = index_for_mass_weighted_rime_factor
long_name = tracer index for mass weighted rime factor
units = index
dimensions = ()
type = integer
intent = in
optional = F
[trans_aero]
standard_name = flag_for_aerosol_convective_transport_and_PBL_diffusion
long_name = flag for aerosol convective transport and PBL diffusion
Expand Down Expand Up @@ -545,6 +569,14 @@
type = integer
intent = in
optional = F
[imp_physics_fer_hires]
standard_name = flag_for_fer_hires_microphysics_scheme
long_name = choice of Ferrier-Aligo microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
optional = F
[ltaerosol]
standard_name = flag_for_aerosol_physics
long_name = flag for aerosol physics
Expand Down
18 changes: 14 additions & 4 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ end subroutine GFS_rrtmg_pre_init
subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Tbd, Cldprop, Coupling, &
Radtend, & ! input/output
f_ice, f_rain, f_rimef, flgmin, cwm, & ! F-A mp scheme only
lm, im, lmk, lmp, & ! input
kd, kt, kb, raddt, delp, dz, plvl, plyr, & ! output
tlvl, tlyr, tsfg, tsfa, qlyr, olyr, &
Expand Down Expand Up @@ -59,6 +60,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
& NSPC1
use module_radiation_clouds, only: NF_CLDS, & ! cld_init
& progcld1, progcld3, &
& progcld2, &
& progcld4, progcld5, &
& progclduni
use module_radsw_parameters, only: topfsw_type, sfcfsw_type, &
Expand All @@ -80,8 +82,16 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input

integer, intent(in) :: im, lm, lmk, lmp
integer, intent(out) :: kd, kt, kb

! F-A mp scheme only
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_ice
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_rain
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(in) :: f_rimef
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(out) :: cwm
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: flgmin
real(kind=kind_phys), intent(out) :: raddt


real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(out) :: delp
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(out) :: dz
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+1+LTP), intent(out) :: plvl
Expand Down Expand Up @@ -520,7 +530,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
ccnd(i,k,1) = tracer1(i,k,ntcw) ! liquid water/ice
enddo
enddo
elseif (Model%ncnd == 2) then ! MG
elseif (Model%ncnd == 2) then ! MG or F-A
do k=1,LMK
do i=1,IM
ccnd(i,k,1) = tracer1(i,k,ntcw) ! liquid water
Expand Down Expand Up @@ -749,6 +759,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Model%sup, Model%kdt, me, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs


elseif (Model%imp_physics == 11) then ! GFDL cloud scheme

if (.not.Model%lgfdlmprad) then
Expand All @@ -773,8 +784,8 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
! clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
endif

elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then ! Thompson / WSM6 cloud micrphysics scheme

elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6 .or. &
Model%imp_physics == 15) then
if (Model%kdt == 1) then
Tbd%phy_f3d(:,:,Model%nleffr) = 10.
Tbd%phy_f3d(:,:,Model%nieffr) = 50.
Expand All @@ -795,7 +806,6 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input

! endif ! end_if_ntcw

! CCPP
do k = 1, LMK
do i = 1, IM
clouds1(i,k) = clouds(i,k,1)
Expand Down
45 changes: 45 additions & 0 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,51 @@
type = GFS_radtend_type
intent = inout
optional = F
[f_ice]
standard_name = fraction_of_ice_water_cloud
long_name = fraction of ice water cloud
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[f_rain]
standard_name = fraction_of_rain_water_cloud
long_name = fraction of rain water cloud
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[f_rimef]
standard_name = rime_factor
long_name = rime factor
units = frac
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[flgmin]
standard_name = minimum_large_ice_fraction
long_name = minimum large ice fraction in F-A mp scheme
units = frac
dimensions = (2)
type = real
kind = kind_phys
intent = in
optional = F
[cwm]
standard_name = total_cloud_condensate_mixing_ratio_updated_by_physics
long_name = total cloud condensate mixing ratio (except water vapor) updated by physics
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[lm]
standard_name = number_of_vertical_layers_for_radiation_calculations
long_name = number of vertical layers for radiation calculation
Expand Down
Loading

0 comments on commit 10191cd

Please sign in to comment.