Skip to content

Commit

Permalink
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physics
Browse files Browse the repository at this point in the history
… into HEAD
  • Loading branch information
dustinswales committed Aug 2, 2023
2 parents 8188e26 + 9b69974 commit a583b26
Show file tree
Hide file tree
Showing 46 changed files with 4,023 additions and 2,043 deletions.
67 changes: 33 additions & 34 deletions CODEOWNERS

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%vtype_save', Sfcprop%vtype_save)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%stype' , Sfcprop%stype)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%stype_save', Sfcprop%stype_save)

call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%scolor' , Sfcprop%scolor)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%scolore_save', Sfcprop%scolor_save)

call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%uustar' , Sfcprop%uustar)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%oro' , Sfcprop%oro)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Sfcprop%oro_uf' , Sfcprop%oro_uf)
Expand Down Expand Up @@ -1531,7 +1535,7 @@ module GFS_checkland
!! \htmlinclude GFS_checkland_run.html
!!
subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_guess, &
flag_init, flag_restart, frac_grid, isot, ivegsrc, stype, vtype, slope, &
flag_init, flag_restart, frac_grid, isot, ivegsrc, stype,scolor, vtype, slope, &
dry, icy, wet, lake, ocean, oceanfrac, landfrac, lakefrac, slmsk, islmsk, &
zorl, zorlw, zorll, zorli, fice, errmsg, errflg )

Expand All @@ -1554,6 +1558,8 @@ subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_
integer, intent(in ) :: isot
integer, intent(in ) :: ivegsrc
integer, intent(in ) :: stype(:)
integer, intent(in ) :: scolor(:)

integer, intent(in ) :: vtype(:)
integer, intent(in ) :: slope(:)
logical, intent(in ) :: dry(:)
Expand Down Expand Up @@ -1598,6 +1604,8 @@ subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_iter(i) :', i, blkno, flag_iter(i)
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, flag_guess(i) :', i, blkno, flag_guess(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, stype(i) :', i, blkno, stype(i)

write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, scolor(i) :', i, blkno, scolor(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, vtype(i) :', i, blkno, vtype(i)
write(0,'(a,2i5,1x,e16.7)')'YYY: i, blk, slope(i) :', i, blkno, slope(i)
write(0,'(a,2i5,1x,1x,l)') 'YYY: i, blk, dry(i) :', i, blkno, dry(i)
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_debug.meta
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,13 @@
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
Expand Down
23 changes: 16 additions & 7 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module GFS_phys_time_vary
use set_soilveg_mod, only: set_soilveg

! --- needed for Noah MP init
use noahmp_tables, only: laim_table,saim_table,sla_table, &
use noahmp_tables, only: read_mp_table_parameters, &
laim_table,saim_table,sla_table, &
bexp_table,smcmax_table,smcwlt_table, &
dwsat_table,dksat_table,psisat_table, &
isurban_table,isbarren_table, &
Expand Down Expand Up @@ -169,6 +170,7 @@ subroutine GFS_phys_time_vary_init (
real(kind_phys), intent(in) :: canopy(:)
real(kind_phys), intent(in) :: tg3(:)
integer, intent(in) :: stype(:)

real(kind_phys), intent(in) :: con_t0c

integer, intent(in) :: nthrds
Expand Down Expand Up @@ -270,6 +272,10 @@ subroutine GFS_phys_time_vary_init (
!> - Initialize soil vegetation (needed for sncovr calculation further down)
call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg)

!$OMP section
!> - read in NoahMP table (needed for NoahMP init)
call read_mp_table_parameters(errmsg, errflg)

!$OMP end sections

! Need an OpenMP barrier here (implicit in "end sections")
Expand Down Expand Up @@ -439,8 +445,8 @@ subroutine GFS_phys_time_vary_init (
!$OMP shared(isbarren_table,isice_table,isurban_table) &
!$omp shared(iswater_table,laim_table,sla_table,bexp_table) &
!$omp shared(stc,smc,slc,tg3,snowxy,tsnoxy,snicexy,snliqxy) &
!$omp shared(zsnsoxy,STYPE,SMCMAX_TABLE,SMCWLT_TABLE,zs,dzs) &
!$omp shared(DWSAT_TABLE,DKSAT_TABLE,PSISAT_TABLE,smoiseq) &
!$omp shared(zsnsoxy,stype,smcmax_table,smcwlt_table,zs,dzs) &
!$omp shared(dwsat_table,dksat_table,psisat_table,smoiseq) &
!$OMP shared(smcwtdxy,deeprechxy,rechxy,errmsg,errflg) &
!$OMP private(vegtyp,masslai,masssai,snd,dzsno,dzsnso,isnow) &
!$OMP private(soiltyp,bexp,smcmax,smcwlt,dwsat,dksat,psisat,ddz)
Expand Down Expand Up @@ -712,7 +718,7 @@ subroutine GFS_phys_time_vary_timestep_init (
kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, &
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype, shdmin, shdmax, snowd, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, &
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, &
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg)

Expand Down Expand Up @@ -759,7 +765,7 @@ subroutine GFS_phys_time_vary_timestep_init (
zorli(:), zorll(:), zorlo(:), weasd(:), snoalb(:), &
canopy(:), vfrac(:), shdmin(:), shdmax(:), &
snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:)
integer, intent(inout) :: vtype(:), stype(:), slope(:)
integer, intent(inout) :: vtype(:), stype(:),scolor(:), slope(:)

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -875,7 +881,10 @@ subroutine GFS_phys_time_vary_timestep_init (
fhour, iflip, jindx1_aer, jindx2_aer, &
ddy_aer, iindx1_aer, &
iindx2_aer, ddx_aer, &
levs, prsl, aer_nm)
levs, prsl, aer_nm, errmsg, errflg)
if(errflg /= 0) then
return
endif
endif

!> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs
Expand All @@ -887,7 +896,7 @@ subroutine GFS_phys_time_vary_timestep_init (
frac_grid, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, tsfc, &
tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, &
zorli, zorll, zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, &
stype, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
stype, scolor, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, &
xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg)
endif
endif
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,13 @@
dimensions = (horizontal_dimension)
type = integer
intent = inout
[scolor]
standard_name = soil_color_classification
long_name = soil color for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = inout
[shdmin]
standard_name = min_vegetation_area_fraction
long_name = min fractional coverage of green vegetation
Expand Down
12 changes: 6 additions & 6 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module GFS_rrtmg_pre
!!
!>\section rrtmg_pre_gen General Algorithm
subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
ltp, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_unified, me, ncnd, ntrac, &
ltp, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, me, ncnd, ntrac, &
num_p3d, npdf3d, &
ncnvcld3d,ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, top_at_1,&
ntrw, ntsw, ntgl, nthl, ntwa, ntoz, ntsmoke, ntdust, ntcoarsepm, &
Expand All @@ -44,7 +44,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
gasvmr_o2, gasvmr_co, gasvmr_cfc11, gasvmr_cfc12, gasvmr_cfc22, &
gasvmr_ccl4, gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, &
clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, &
faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, &
faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, rrfs_sd &
aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozc, levozc, &
blatc, dphiozc, errmsg, errflg)

Expand Down Expand Up @@ -85,7 +85,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&

integer, intent(in) :: im, levs, lm, lmk, lmp, ltp, &
n_var_lndp, imfdeepcnv, &
imfdeepcnv_gf, imfdeepcnv_unified, &
imfdeepcnv_gf, imfdeepcnv_c3, &
me, ncnd, ntrac, &
num_p3d, npdf3d, ncnvcld3d, ntqv, &
ntcw, ntiw, ntlnc, ntinc, &
Expand Down Expand Up @@ -128,7 +128,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
uni_cld, effr_in, do_mynnedmf, &
lmfshal, lmfdeep2, pert_clds, lcrick,&
lcnorm, top_at_1, lextop, mraerosol
logical, intent(in) :: aero_dir_fdb
logical, intent(in) :: rrfs_sd, aero_dir_fdb

logical, intent(in) :: nssl_ccn_on, nssl_invertccn
integer, intent(in) :: spp_rad
Expand Down Expand Up @@ -641,7 +641,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
endif

!>--- add smoke and dust ---
if (aero_dir_fdb) then
if (rrfs_sd .and. aero_dir_fdb) then
do k=1,lmk
do i=1,im
aer_nm(i,k,1 )=aer_nm(i,k,1 )+ qgrs(i,k,ntdust)*fdb_coef(1)*1.e-9 ! dust bin1
Expand Down Expand Up @@ -820,7 +820,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
enddo
endif
elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP
if ((imfdeepcnv==imfdeepcnv_gf .or. imfdeepcnv==imfdeepcnv_unified) .and. kdt>1) then
if ((imfdeepcnv==imfdeepcnv_gf .or. imfdeepcnv==imfdeepcnv_c3) .and. kdt>1) then
do k=1,lm
k1 = k + kd
do i=1,im
Expand Down
13 changes: 10 additions & 3 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@
dimensions = ()
type = integer
intent = in
[imfdeepcnv_unified]
standard_name = identifier_for_unified_deep_convection
long_name = flag for Unified deep convection scheme
[imfdeepcnv_c3]
standard_name = identifier_for_c3_deep_convection
long_name = flag for C3 deep convection scheme
units = flag
dimensions = ()
type = integer
Expand Down Expand Up @@ -1466,6 +1466,13 @@
dimensions = ()
type = integer
intent = in
[rrfs_sd]
standard_name = do_smoke_coupling
long_name = flag controlling rrfs_sd collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[aero_dir_fdb]
standard_name = do_smoke_aerosol_direct_feedback
long_name = flag for smoke and dust radiation feedback
Expand Down
7 changes: 1 addition & 6 deletions physics/GFS_rrtmgp_cloud_mp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -875,17 +875,12 @@ subroutine cmp_reff_Thompson(nLev, nCol, i_cldliq, i_cldice, i_cldsnow, i_cldice
qi_mp(iCol,iLay) = tracer(iCol,iLay,i_cldice) / (1.-q_lay(iCol,iLay))
qs_mp(iCol,iLay) = tracer(iCol,iLay,i_cldsnow) / (1.-q_lay(iCol,iLay))
ni_mp(iCol,iLay) = tracer(iCol,iLay,i_cldice_nc) / (1.-q_lay(iCol,iLay))
if (ltaerosol) then
if (ltaerosol .or. mraerosol) then
nc_mp(iCol,iLay) = tracer(iCol,iLay,i_cldliq_nc) / (1.-q_lay(iCol,iLay))
nwfa(iCol,iLay) = tracer(iCol,iLay,i_twa)
if (qc_mp(iCol,iLay) > 1.e-12 .and. nc_mp(iCol,iLay) < 100.) then
nc_mp(iCol,iLay) = make_DropletNumber(qc_mp(iCol,iLay)*rho, nwfa(iCol,iLay)*rho) * orho
endif
elseif (mraerosol) then
nc_mp(iCol,iLay) = tracer(iCol,iLay,i_cldliq_nc) / (1.-q_lay(iCol,iLay))
if (qc_mp(iCol,iLay) > 1.e-12 .and. nc_mp(iCol,iLay) < 100.) then
nc_mp(iCol,iLay) = make_DropletNumber(qc_mp(iCol,iLay)*rho, nwfa(iCol,iLay)*rho) * orho
endif
else
if (nint(lsmask(iCol)) == 1) then !land
nc_mp(iCol,iLay) = nt_c_l*orho
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_suite_interstitial_3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module GFS_suite_interstitial_3
!!
subroutine GFS_suite_interstitial_3_run (otsptflag, &
im, levs, nn, cscnv,imfshalcnv, imfdeepcnv, &
imfshalcnv_samf, imfdeepcnv_samf, imfdeepcnv_unified, &
imfshalcnv_unified,progsigma, &
imfshalcnv_samf, imfdeepcnv_samf, imfdeepcnv_c3, &
imfshalcnv_c3,progsigma, &
first_time_step, restart, &
satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, &
ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, &
Expand Down Expand Up @@ -40,7 +40,7 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &
logical, intent(in ) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras, progsigma
logical, intent(in ) :: first_time_step, restart
integer, intent(in ) :: imfshalcnv, imfdeepcnv, imfshalcnv_samf,imfdeepcnv_samf
integer, intent(in ) :: imfshalcnv_unified,imfdeepcnv_unified
integer, intent(in ) :: imfshalcnv_c3,imfdeepcnv_c3
integer, intent(in) :: ntinc, ntlnc
logical, intent(in) :: ldiag3d, qdiag3d
integer, dimension(:,:), intent(in) :: dtidx
Expand Down Expand Up @@ -84,7 +84,7 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, &
! In case of using prognostic updraf area fraction, initialize area fraction here
! since progsigma_calc is called from both deep and shallow schemes.
if(((imfshalcnv == imfshalcnv_samf) .or. (imfdeepcnv == imfdeepcnv_samf) &
.or. (imfshalcnv == imfshalcnv_unified) .or. (imfdeepcnv == imfdeepcnv_unified)) &
.or. (imfshalcnv == imfshalcnv_c3) .or. (imfdeepcnv == imfdeepcnv_c3)) &
.and. progsigma)then
if(first_time_step .and. .not. restart)then
do k=1,levs
Expand Down
14 changes: 7 additions & 7 deletions physics/GFS_suite_interstitial_3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
dimensions = ()
type = integer
intent = in
[imfdeepcnv_unified]
standard_name = identifier_for_unified_deep_convection
long_name = flag for Unified deep convection scheme
[imfdeepcnv_c3]
standard_name = identifier_for_c3_deep_convection
long_name = flag for C3 deep convection scheme
units = flag
dimensions = ()
type = integer
Expand All @@ -78,9 +78,9 @@
dimensions = ()
type = integer
intent = in
[imfshalcnv_unified]
standard_name = identifier_for_unified_shallow_convection
long_name = flag for Unified shallow convection scheme
[imfshalcnv_c3]
standard_name = identifier_for_c3_shallow_convection
long_name = flag for C3 shallow convection scheme
units = flag
dimensions = ()
type = integer
Expand Down Expand Up @@ -542,4 +542,4 @@
units = 1
dimensions = ()
type = integer
intent = out
intent = out
14 changes: 8 additions & 6 deletions physics/GFS_surface_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ module GFS_surface_generic_post
!> \section arg_table_GFS_surface_generic_post_init Argument Table
!! \htmlinclude GFS_surface_generic_post_init.html
!!
subroutine GFS_surface_generic_post_init (vtype, stype, slope, vtype_save, stype_save, slope_save, errmsg, errflg)
subroutine GFS_surface_generic_post_init (vtype, stype,scolor, slope, vtype_save, stype_save,scolor_save, slope_save, errmsg, errflg)

integer, dimension(:), intent(in) :: vtype_save, stype_save, slope_save
integer, dimension(:), intent(out) :: vtype, stype, slope
integer, dimension(:), intent(in) :: vtype_save, stype_save,scolor_save, slope_save
integer, dimension(:), intent(out) :: vtype, stype, scolor,slope

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand All @@ -37,6 +37,7 @@ subroutine GFS_surface_generic_post_init (vtype, stype, slope, vtype_save, stype
! Restore vegetation, soil and slope type
vtype(:) = vtype_save(:)
stype(:) = stype_save(:)
scolor(:) = scolor_save(:)
slope(:) = slope_save(:)

end subroutine GFS_surface_generic_post_init
Expand All @@ -53,7 +54,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, &
nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, evcwa, transa, sbsnoa, snowca, snohfa, paha, ep, ecan, etran, edir, waxy, &
runoff, srunoff, runof, drain, tecan, tetran, tedir, twa, lheatstrg, h0facu, h0facs, zvfun, hflx, evap, hflxq, hffac, &
isot, ivegsrc, islmsk, vtype, stype, slope, vtype_save, stype_save, slope_save, errmsg, errflg)
isot, ivegsrc, islmsk, vtype, stype,scolor, slope, vtype_save, stype_save,scolor_save, slope_save, errmsg, errflg)

implicit none

Expand Down Expand Up @@ -85,8 +86,8 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
real(kind=kind_phys), dimension(:), intent(out) :: hflxq
real(kind=kind_phys), dimension(:), intent(out) :: hffac

integer, intent(in) :: isot, ivegsrc, islmsk(:), vtype_save(:), stype_save(:), slope_save(:)
integer, intent(out) :: vtype(:), stype(:), slope(:)
integer, intent(in) :: isot, ivegsrc, islmsk(:), vtype_save(:), stype_save(:),scolor_save(:), slope_save(:)
integer, intent(out) :: vtype(:), stype(:),scolor(:), slope(:)

! CCPP error handling variables
character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -274,6 +275,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
! Restore vegetation, soil and slope type
vtype(:) = vtype_save(:)
stype(:) = stype_save(:)
scolor(:) = scolor_save(:)
slope(:) = slope_save(:)

end subroutine GFS_surface_generic_post_run
Expand Down
Loading

0 comments on commit a583b26

Please sign in to comment.