Skip to content

Commit

Permalink
Code update to connect MMM WSM6 to CCPP SCM
Browse files Browse the repository at this point in the history
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_common.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90
	modified:   Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta
	modified:   PBL/MYNN_EDMF/mynnedmf_wrapper.F90
	modified:   PBL/MYNN_EDMF/mynnedmf_wrapper.meta
	modified:   Radiation/radiation_clouds.f
	modified:   mmm_physics
	MP/wsm6/gfs_mmm_mp_wsm6_post.F90
	MP/wsm6/gfs_mmm_mp_wsm6_post.meta
	MP/wsm6/gfs_mmm_mp_wsm6_pre.F90
	MP/wsm6/gfs_mmm_mp_wsm6_pre.meta
  • Loading branch information
bluefinweiwei committed Aug 19, 2024
1 parent d7e08a8 commit 1ecd7f4
Show file tree
Hide file tree
Showing 21 changed files with 151 additions and 180 deletions.
2 changes: 2 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ subroutine GFS_MP_generic_post_run(
do k=1,levs
do i=1,im
dtend(i,k,idtend) = dtend(i,k,idtend) + (gq0(i,k,itrac)-save_q(i,k,itrac)) * frain
!if(itrac==3) &
!print*,'YYYY, itrac,gq0(i,k,itrac),save_q(i,k,itrac),frain,dtend(i,k,idtend)', itrac,gq0(i,k,itrac),save_q(i,k,itrac),frain,dtend(i,k,idtend)
enddo
enddo
endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers)
type = real
kind = kind_phys
intent = inout
intent = in
[rain0]
standard_name = lwe_thickness_of_explicit_rain_amount
long_name = explicit rain on physics timestep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, progsigma,
enddo
endif
endif

end subroutine GFS_MP_generic_pre_run

end module GFS_MP_generic_pre
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ module GFS_PBL_generic_common

contains

subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6,imp_physics_wsm6_mmm, &
imp_physics_thompson, ltaerosol,mraerosol, &
imp_physics_mg, ntgl, imp_physics_gfdl, &
imp_physics_zhao_carr, imp_physics_nssl,&
nssl_hail_on, nssl_ccn_on, kk, &
errmsg, errflg)
implicit none
!
integer, intent(in ) :: imp_physics, imp_physics_wsm6, &
integer, intent(in ) :: imp_physics, imp_physics_wsm6, imp_physics_wsm6_mmm, &
imp_physics_thompson, &
imp_physics_mg, ntgl, imp_physics_gfdl, &
imp_physics_zhao_carr,imp_physics_nssl
Expand All @@ -31,9 +31,9 @@ subroutine set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
errflg = 0

! Set Interstitial%kk = last index in diffused tracer array before chemistry-aerosol tracers
if (imp_physics == imp_physics_wsm6) then
if (imp_physics == imp_physics_wsm6 .or. imp_physics == imp_physics_wsm6_mmm) then
! WSM6
kk = 4
kk = 7
elseif (imp_physics == imp_physics_thompson) then
! Thompson
if(ltaerosol) then
Expand Down
19 changes: 11 additions & 8 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module GFS_PBL_generic_post
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,nqrimef, &
trans_aero, ntchs, ntchm, ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_wsm6_mmm, imp_physics_zhao_carr, imp_physics_mg, &
imp_physics_fer_hires, imp_physics_nssl, nssl_ccn_on, ltaerosol, mraerosol, nssl_hail_on, nssl_3moment, &
cplflx, cplaqm, cplchm, lssav, flag_for_pbl_generic_tend, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, &
shinhong, do_ysu, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, &
Expand All @@ -32,7 +32,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef
integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz
logical, intent(in) :: trans_aero
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_wsm6_mmm
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_3moment
Expand Down Expand Up @@ -103,7 +103,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
!
if (trans_aero) then
! Set kk if chemistry-aerosol tracers are diffused
call set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
call set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, imp_physics_wsm6_mmm, &
imp_physics_thompson, ltaerosol,mraerosol, &
imp_physics_mg, ntgl, imp_physics_gfdl, &
imp_physics_zhao_carr, imp_physics_nssl,&
Expand All @@ -122,14 +122,17 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac,
enddo
endif
!
if (imp_physics == imp_physics_wsm6) then
if (imp_physics == imp_physics_wsm6 .or. imp_physics == imp_physics_wsm6_mmm) then
! WSM6
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,ntoz) = dvdftra(i,k,4)
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,ntsw) = dvdftra(i,k,5)
dqdt(i,k,ntgl) = dvdftra(i,k,6)
dqdt(i,k,ntoz) = dvdftra(i,k,7)
enddo
enddo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@
dimensions = ()
type = integer
intent = in
[imp_physics_wsm6_mmm]
standard_name = identifier_for_wsm6_mmm_microphysics_scheme
long_name = choice of WSM6 MMM microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
[imp_physics_zhao_carr]
standard_name = identifier_for_zhao_carr_microphysics_scheme
long_name = choice of Zhao-Carr microphysics scheme
Expand Down
21 changes: 12 additions & 9 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, &
ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef, trans_aero, ntchs, ntchm, &
ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, &
imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_wsm6_mmm, &
imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires, imp_physics_nssl, &
ltaerosol, mraerosol, nssl_ccn_on, nssl_hail_on, nssl_3moment, &
hybedmf, do_shoc, satmedmf, qgrs, vdftra, save_u, save_v, save_t, save_q, &
Expand All @@ -31,7 +31,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef,ntchs, ntchm
integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz
logical, intent(in) :: trans_aero, ldiag3d, qdiag3d, lssav
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_wsm6_mmm
integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires
logical, intent(in) :: ltaerosol, hybedmf, do_shoc, satmedmf, flag_for_pbl_generic_tend, mraerosol
integer, intent(in) :: imp_physics_nssl
Expand Down Expand Up @@ -62,17 +62,20 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
vdftra = qgrs
rtg_ozone_index = ntoz
else
if (imp_physics == imp_physics_wsm6) then
if (imp_physics == imp_physics_wsm6 .or. imp_physics == imp_physics_wsm6_mmm) then
! WSM6
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,ntoz)
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,ntsw)
vdftra(i,k,6) = qgrs(i,k,ntgl)
vdftra(i,k,7) = qgrs(i,k,ntoz)
enddo
enddo
rtg_ozone_index = 4
rtg_ozone_index = 7

! Ferrier-Aligo
elseif (imp_physics == imp_physics_fer_hires) then
Expand Down Expand Up @@ -272,7 +275,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index,
endif
!
if (trans_aero) then
call set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, &
call set_aerosol_tracer_index(imp_physics, imp_physics_wsm6, imp_physics_wsm6_mmm, &
imp_physics_thompson, ltaerosol,mraerosol, &
imp_physics_mg, ntgl, imp_physics_gfdl, &
imp_physics_zhao_carr, imp_physics_nssl,&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@
dimensions = ()
type = integer
intent = in
[imp_physics_wsm6_mmm]
standard_name = identifier_for_wsm6_mmm_microphysics_scheme
long_name = choice of WSM6 MMM microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
[imp_physics_zhao_carr]
standard_name = identifier_for_zhao_carr_microphysics_scheme
long_name = choice of Zhao-Carr microphysics scheme
Expand Down
2 changes: 1 addition & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%clxss ', Interstitial%clxss )
end if
! GFDL and Thompson MP
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_nssl) then
if (Model%imp_physics == Model%imp_physics_gfdl .or. Model%imp_physics == Model%imp_physics_thompson .or. Model%imp_physics == Model%imp_physics_nssl .or. Model%imp_physics == Model%imp_physics_wsm6_mmm) then
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%graupelmp ', Interstitial%graupelmp )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%icemp ', Interstitial%icemp )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%rainmp ', Interstitial%rainmp )
Expand Down
18 changes: 17 additions & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
ccnd(i,k,4) = tracer1(i,k,ntsw) ! snow water
enddo
enddo
elseif (ncnd == 5 .or. ncnd == 6) then ! GFDL MP, Thompson, MG3, NSSL
elseif (ncnd == 5 .or. ncnd == 6) then ! GFDL MP, Thompson, MG3, NSSL, MMM WSM6
do k=1,LMK
do i=1,IM
ccnd(i,k,1) = tracer1(i,k,ntcw) ! liquid water
Expand Down Expand Up @@ -880,6 +880,22 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
! not used yet -- effr_in should always be true for now
endif

elseif (imp_physics == imp_physics_wsm6_mmm ) then ! MMM WSM6 MP
cldcov = 0.0
if(effr_in) then
do k=1,lm
k1 = k + kd
do i=1,im
effrl(i,k1) = effrl_inout(i,k)! re_cloud (i,k)
effri(i,k1) = effri_inout(i,k)! re_ice (i,k)
effrr(i,k1) = effrr_in(i,k)
effrs(i,k1) = effrs_inout(i,k) ! re_snow(i,k)
enddo
enddo
else
! not used yet -- effr_in should always be true for now
endif

elseif (imp_physics == imp_physics_thompson) then ! Thompson MP
!
! Compute effective radii for QC, QI, QS with (GF, MYNN) or without (all others) sub-grid clouds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
enddo
endif

if ((imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_wsm6_mmm) &
if ((imp_physics == imp_physics_thompson) &
.and. (ntlnc>0 .or. ntinc>0)) then
if_convert_dry_rho: if (convert_dry_rho) then
do k=1,levs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module maximum_hourly_diagnostics
subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, &
imp_physics_gfdl, imp_physics_thompson, &
imp_physics_fer_hires, imp_physics_nssl, &
con_g, phil, &
imp_physics_wsm6_mmm, con_g, phil, &
gt0, refl_10cm, refdmax, refdmax263k, u10m, v10m, &
u10max, v10max, spd10max, pgr, t2m, q2m, t02max, &
t02min, rh02max, rh02min, dtp, rain, pratemax, &
Expand All @@ -37,7 +37,7 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics,
integer, intent(in) :: im, levs, kdt
logical, intent(in) :: reset, lradar, lightning_threat
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_fer_hires, &
imp_physics_nssl
imp_physics_nssl, imp_physics_wsm6_mmm
real(kind_phys), intent(in ) :: con_g
real(kind_phys), intent(in ) :: con_rd
real(kind_phys), intent(in ) :: phil(:,:)
Expand Down Expand Up @@ -86,7 +86,8 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics,
if (lradar .and. (imp_physics == imp_physics_gfdl .or. &
imp_physics == imp_physics_thompson .or. &
imp_physics == imp_physics_fer_hires .or. &
imp_physics == imp_physics_nssl )) then
imp_physics == imp_physics_nssl .or. &
imp_physics == imp_physics_wsm6_mmm)) then
allocate(refd(im))
allocate(refd263k(im))
call max_fields(phil,refl_10cm,con_g,im,levs,refd,gt0,refd263k)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
dimensions = ()
type = integer
intent = in
[imp_physics_wsm6_mmm]
standard_name = identifier_for_wsm6_mmm_microphysics_scheme
long_name = choice of WSM6 MMM microphysics scheme
units = flag
dimensions = ()
type = integer
intent = in
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down
6 changes: 3 additions & 3 deletions physics/MP/wsm6/scm_mp_wsm6_post.F90
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module scm_mp_wsm6_post

implicit none

public :: scm_mp_wsm6_post_finalize
public :: scm_mp_wsm6_post_run

private

Expand All @@ -29,7 +29,7 @@ module scm_mp_wsm6_post
!> \section arg_table_scm_mp_wsm6_finalize Argument Table
!! \htmlinclude scm_mp_wsm6_finalize.html
!!
subroutine scm_mp_wsm6_post_finalize(errmsg, errflg)
subroutine scm_mp_wsm6_post_run(errmsg, errflg)

implicit none

Expand All @@ -48,6 +48,6 @@ subroutine scm_mp_wsm6_post_finalize(errmsg, errflg)

is_initialized = .false.

end subroutine scm_mp_wsm6_post_finalize
end subroutine scm_mp_wsm6_post_run

end module scm_mp_wsm6_post
4 changes: 2 additions & 2 deletions physics/MP/wsm6/scm_mp_wsm6_post.meta
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
########################################################################

[ccpp-arg-table]
name = scm_mp_wsm6_finalize
name = scm_mp_wsm6_post_run
type = scheme
[errmsg]
standard_name = ccpp_error_message
Expand All @@ -24,4 +24,4 @@
type = integer
intent = out

########################################################################
########################################################################
57 changes: 0 additions & 57 deletions physics/MP/wsm6/scm_mp_wsm6_pre.F90

This file was deleted.

Loading

0 comments on commit 1ecd7f4

Please sign in to comment.