Skip to content

Commit

Permalink
Merge branch 'chunxi_physics' of https://github.com/ChunxiZhang-NOAA/…
Browse files Browse the repository at this point in the history
…ccpp-physics into HAFS_fer_hires
  • Loading branch information
mzhangw committed Sep 4, 2019
2 parents bed9c0e + 727417c commit dff5b0f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 21 deletions.
25 changes: 18 additions & 7 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ end subroutine GFS_MP_generic_post_init
!! | dsnow_cpl | tendency_of_lwe_thickness_of_snow_amount_for_coupling | change in show_cpl (coupling_type) | m | 1 | real | kind_phys | inout | F |
!! | lsm | flag_for_land_surface_scheme | flag for land surface model | flag | 0 | integer | | in | F |
!! | lsm_ruc | flag_for_ruc_land_surface_scheme | flag for RUC land surface model | flag | 0 | integer | | in | F |
!! | raincprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | rainncprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | raincprv | lwe_thickness_of_explicit_rainfall_amount_from_previous_timestep | explicit rainfall from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | rainncprv | lwe_thickness_of_convective_precipitation_amount_from_previous_timestep | convective_precipitation_amount from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | iceprv | lwe_thickness_of_ice_amount_from_previous_timestep | ice amount from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | snowprv | lwe_thickness_of_snow_amount_from_previous_timestep | snow amount from previous timestep | m | 1 | real | kind_phys | inout | F |
!! | graupelprv | lwe_thickness_of_graupel_amount_from_previous_timestep | graupel amount from previous timestep | m | 1 | real | kind_phys | inout | F |
Expand Down Expand Up @@ -276,6 +276,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 @@ -374,7 +378,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
!! and determine explicit rain/snow by snow/ice/graupel coming out directly from MP
!! and convective rainfall from the cumulus scheme if the surface temperature is below
!! \f$0^oC\f$.
if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson) then
if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics_fer_hires) then
! determine convective rain/snow by surface temperature
! determine large-scale rain/snow by rain/snow coming out directly from MP
do i = 1, im
Expand All @@ -392,10 +396,17 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt
! 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
endif
if(imp_physics == imp_physics_fer_hires) then
total_precip = tprcp(i)
if (total_precip > rainmin) then
srflag(i) = (ice(i)+csnow)/total_precip
endif
else
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
endif
end if
enddo
elseif( .not. cal_pre) then
if (imp_physics == imp_physics_mg) then ! MG microphysics
Expand Down
52 changes: 39 additions & 13 deletions physics/GFS_PBL_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ end subroutine GFS_PBL_generic_pre_finalize
!! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F |
!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F |
!! | ntkev | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F |
!! | nqrimef | index_for_mass_weighted_rime_factor | tracer index for mass weighted rime factor | index | 0 | integer | | in | F |
!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_fer_hires | flag_for_fer_hires_microphysics_scheme | choice of Ferrier-Aligo microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_fer_hires | flag_for_fer_hires_microphysics_scheme | choice of Ferrier-Aligo microphysics scheme | flag | 0 | integer | | in | F |
!! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F |
!! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F |
!! | hybedmf | flag_for_hedmf | flag for hybrid edmf pbl scheme (moninedmf) | flag | 0 | logical | | in | F |
Expand All @@ -56,10 +57,9 @@ end subroutine GFS_PBL_generic_pre_finalize
#endif
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, &
ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, &
imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires, &
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 @@ -68,7 +68,7 @@ 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
integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf
Expand Down Expand Up @@ -178,7 +178,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,
enddo
enddo
endif
elseif (imp_physics == imp_physics_gfdl ) then
elseif (imp_physics == imp_physics_gfdl) then
! GFDL MP
do k=1,levs
do i=1,im
Expand All @@ -191,6 +191,20 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac,
vdftra(i,k,7) = qgrs(i,k,ntoz)
enddo
enddo

elseif (imp_physics == imp_physics_fer_hires) then
! F-A MP
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_zhao_carr) then
! Zhao/Carr/Sundqvist
if (cplchm) then
Expand Down Expand Up @@ -253,6 +267,7 @@ end subroutine GFS_PBL_generic_post_finalize
!! | ntoz | index_for_ozone | tracer index for ozone mixing ratio | index | 0 | integer | | in | F |
!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F |
!! | ntkev | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F |
!! | nqrimef | index_for_mass_weighted_rime_factor | tracer index for mass weighted rime factor | index | 0 | integer | | in | F |
!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F |
!! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F |
Expand Down Expand Up @@ -337,9 +352,8 @@ end subroutine GFS_PBL_generic_post_finalize
!!
#endif
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, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, &
imp_physics_fer_hires, &
ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev,nqrimef, &
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 @@ -353,9 +367,9 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
implicit none

integer, intent(in) :: im, levs, nvdiff, ntrac
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_fer_hires
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
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 @@ -495,7 +509,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
enddo
endif
elseif (imp_physics == imp_physics_gfdl) then
! GFDL MP or F-A MP
! GFDL MP
do k=1,levs
do i=1,im
dqdt(i,k,ntqv) = dvdftra(i,k,1)
Expand All @@ -507,6 +521,18 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
dqdt(i,k,ntoz) = dvdftra(i,k,7)
enddo
enddo
elseif (imp_physics == imp_physics_fer_hires) then
! F-A MP
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_zhao_carr) then
if (cplchm) then
do k=1,levs
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,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

0 comments on commit dff5b0f

Please sign in to comment.