Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UFS-dev PR#220 #1096

Merged
merged 9 commits into from
Oct 22, 2024
Merged
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
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS}
APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_Fortran_FLAGS_PHYSICS} ${OpenMP_Fortran_FLAGS}")

# Lower optimization for certain schemes when compiling with Intel in Release mode
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM"))
# Define a list of schemes that need lower optimization with Intel in Release mode
set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90
mynnedmf_wrapper.F90
gcycle.F90)
gcycle.F90
module_mp_nssl_2mom.F90)
foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_LOWER_OPTIMIZATION)
set(SCHEMES_TMP ${SCHEMES})
# Need to determine the name of the scheme with its path
Expand All @@ -156,7 +157,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL
endif()

# No optimization for certain schemes when compiling with Intel in Release mode
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM"))
# Define a list of schemes that can't be optimized with Intel in Release mode
set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90)
foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_NO_OPTIMIZATION)
Expand Down
360 changes: 180 additions & 180 deletions CODEOWNERS

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ module GFS_surface_composites_post
!! \htmlinclude GFS_surface_composites_post_run.html
!!
subroutine GFS_surface_composites_post_run ( &
im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, wind, t1, q1, prsl1, &
im, kice, km, rd, rvrdm1, cplflx, cplwav2atm, cpl_fire, frac_grid, flag_cice, thsfc_loc, islmsk, dry, wet, icy, wind, t1, q1, prsl1, &
landfrac, lakefrac, oceanfrac, zorl, zorlo, zorll, zorli, garea, frac_ice, &
cd, cd_wat, cd_lnd, cd_ice, cdq, cdq_wat, cdq_lnd, cdq_ice, rb, rb_wat, rb_lnd, rb_ice, stress, stress_wat, stress_lnd, &
stress_ice, ffmm, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh, ffhh_wat, ffhh_lnd, ffhh_ice, uustar, uustar_wat, uustar_lnd, &
uustar_ice, fm10, fm10_wat, fm10_lnd, fm10_ice, fh2, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, &
cmm, cmm_wat, cmm_lnd, cmm_ice, chh, chh_wat, chh_lnd, chh_ice, gflx, gflx_wat, gflx_lnd, gflx_ice, ep1d, ep1d_wat, &
ep1d_lnd, ep1d_ice, weasd, weasd_lnd, weasd_ice, snowd, snowd_lnd, snowd_ice, tprcp, tprcp_wat, &
tprcp_lnd, tprcp_ice, evap, evap_wat, evap_lnd, evap_ice, hflx, hflx_wat, hflx_lnd, hflx_ice, qss, qss_wat, qss_lnd, &
qss_ice, tsfc, tsfco, tsfcl, tsfc_wat, tisfc, hice, cice, tiice, &
tprcp_lnd, tprcp_ice, evap, evap_wat, evap_lnd, evap_ice, hflx, hflx_wat, hflx_lnd, hflx_ice, hflx_fire, evap_fire, &
qss, qss_wat, qss_lnd, qss_ice, tsfc, tsfco, tsfcl, tsfc_wat, tisfc, hice, cice, tiice, &
sigmaf, zvfun, lheatstrg, h0facu, h0facs, hflxq, hffac, stc, lkm, iopt_lake, iopt_lake_clm, use_lake_model, &
grav, prsik1, prslk1, prslki, z1, ztmax_wat, ztmax_lnd, ztmax_ice, huge, errmsg, errflg)

implicit none

integer, intent(in) :: im, kice, km, lkm, iopt_lake, iopt_lake_clm
logical, intent(in) :: cplflx, frac_grid, cplwav2atm, frac_ice
logical, intent(in) :: cplflx, frac_grid, cplwav2atm, frac_ice, cpl_fire
logical, intent(in) :: lheatstrg
logical, dimension(:), intent(in) :: flag_cice, dry, icy
logical, dimension(:), intent(in) :: wet
Expand All @@ -51,6 +51,7 @@ subroutine GFS_surface_composites_post_run (
snowd_lnd, snowd_ice, tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, &
hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, zorlo, zorll, zorli, garea

real(kind=kind_phys), dimension(:), intent(in), optional :: hflx_fire, evap_fire
real(kind=kind_phys), dimension(:), intent(inout) :: zorl, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, &
fh2, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc

Expand Down Expand Up @@ -275,6 +276,10 @@ subroutine GFS_surface_composites_post_run (
else if (islmsk(i) == 1) then
!-- land
call composite_land
if (cpl_fire) then
hflx(i) = hflx(i) + hflx_fire(i)
evap(i) = evap(i) + evap_fire(i)
endif
elseif (islmsk(i) == 0) then
!-- water
call composite_wet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,31 @@
type = real
kind = kind_phys
intent = in
[hflx_fire]
standard_name = kinematic_surface_upward_sensible_heat_flux_of_fire
long_name = kinematic surface upward sensible heat flux of fire
units = K m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = True
[evap_fire]
standard_name = surface_upward_specific_humidity_flux_of_fire
long_name = kinematic surface upward latent heat flux of fire
units = kg kg-1 m s-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = True
[cpl_fire]
standard_name = do_fire_coupling
long_name = flag controlling fire_behavior collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[qss]
standard_name = surface_specific_humidity
long_name = surface air saturation specific humidity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ end subroutine GFS_surface_generic_post_init
!> \section arg_table_GFS_surface_generic_post_run Argument Table
!! \htmlinclude GFS_surface_generic_post_run.html
!!
subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpllnd, lssav, dry, icy, wet, &
subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpllnd, cpl_fire, lssav, dry, icy, wet, &
lsm, lsm_noahmp, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, &
adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, &
adjvisbmu, adjvisdfu, t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, pahi, &
Expand All @@ -59,7 +59,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
implicit none

integer, intent(in) :: im
logical, intent(in) :: cplflx, cplaqm, cplchm, cplwav, cpllnd, lssav
logical, intent(in) :: cplflx, cplaqm, cplchm, cplwav, cpllnd, cpl_fire, lssav
logical, dimension(:), intent(in) :: dry, icy, wet
integer, intent(in) :: lsm, lsm_noahmp
real(kind=kind_phys), intent(in) :: dtf
Expand Down Expand Up @@ -136,9 +136,20 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
dswsfci_cpl (i) = adjsfcdsw(i)
dlwsfc_cpl (i) = dlwsfc_cpl(i) + adjsfcdlw(i)*dtf
dswsfc_cpl (i) = dswsfc_cpl(i) + adjsfcdsw(i)*dtf
enddo
endif

if (cplflx .or. cpllnd .or. cpl_fire) then
do i=1,im
psurfi_cpl (i) = pgr(i)
enddo
endif
if (cplflx .or. cpl_fire) then
do i=1,im
t2mi_cpl (i) = t2m(i)
q2mi_cpl (i) = q2m(i)
enddo
endif

if (cplflx) then
do i=1,im
Expand All @@ -155,8 +166,6 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl
nlwsfci_cpl(i) = adjsfcdlw(i) - adjsfculw_wat(i)
endif
nlwsfc_cpl (i) = nlwsfc_cpl(i) + nlwsfci_cpl(i)*dtf
t2mi_cpl (i) = t2m(i)
q2mi_cpl (i) = q2m(i)
enddo
endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@
dimensions = ()
type = logical
intent = in
[cpl_fire]
standard_name = do_fire_coupling
long_name = flag controlling fire_behavior collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[lssav]
standard_name = flag_for_diagnostics
long_name = logical flag for storing diagnostics
Expand Down
2 changes: 1 addition & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml,
real (kind=kind_io8) :: min_ice(nx*ny)
integer :: i_indx(nx*ny), j_indx(nx*ny)
character(len=6) :: tile_num_ch
real(kind=kind_phys) :: sig1t
real(kind=kind_phys) :: sig1t(nx*ny)
integer :: npts, nb, ix, jx, ls, ios, ll
logical :: exists

Expand Down
15 changes: 7 additions & 8 deletions physics/MP/Morrison_Gettelman/aerinterp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2,
character(*), intent(inout) :: errmsg
integer, intent(in) :: iflip
integer i1,i2, iday,j,j1,j2,l,npts,nc,n1,n2,lev,k,i,ii, klev
real(kind=kind_phys) fhour,temj, tx1, tx2,temi, tem
real(kind=kind_phys) fhour,temj, tx1, tx2,temi, tem, tem1, tem2
real(kind=kind_phys), dimension(npts) :: temij,temiy,temjx,ddxy

!
Expand Down Expand Up @@ -363,10 +363,9 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2,
!$OMP parallel num_threads(nthrds) default(none) &
!$OMP shared(npts,ntrcaer,aerin,aer_pres,prsl) &
!$OMP shared(ddx,ddy,jindx1,jindx2,iindx1,iindx2) &
!$OMP shared(aerpm,aerpres,aerout,lev,nthrds) &
!$OMP shared(temij,temiy,temjx,ddxy) &
!$OMP private(l,j,k,ii,i1,i2,j1,j2,tem) &
!$OMP copyin(tx1,tx2) firstprivate(tx1,tx2)
!$OMP shared(aerpm,aerpres,aerout,lev,nthrds) &
!$OMP shared(temij,temiy,temjx,ddxy,tx1,tx2) &
!$OMP private(l,j,k,ii,i1,i2,j1,j2,tem,tem1,tem2)

!$OMP do
#endif
Expand Down Expand Up @@ -416,10 +415,10 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2,
ENDIF
ENDDO
tem = 1.0 / (aerpres(j,i1) - aerpres(j,i2))
tx1 = (prsl(j,L) - aerpres(j,i2)) * tem
tx2 = (aerpres(j,i1) - prsl(j,L)) * tem
tem1 = (prsl(j,L) - aerpres(j,i2)) * tem
tem2 = (aerpres(j,i1) - prsl(j,L)) * tem
DO ii = 1, ntrcaer
aerout(j,L,ii) = aerpm(j,i1,ii)*tx1 + aerpm(j,i2,ii)*tx2
aerout(j,L,ii) = aerpm(j,i1,ii)*tem1 + aerpm(j,i2,ii)*tem2
ENDDO
endif
ENDDO !L-loop
Expand Down
27 changes: 22 additions & 5 deletions physics/smoke_dust/rrfs_smoke_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,30 @@ end subroutine rrfs_smoke_wrapper_init
!!
!>\section rrfs_smoke_wrapper rrfs-sd Scheme General Algorithm
!> @{
subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, &
subroutine rrfs_smoke_wrapper_run(im, flag_init, kte, kme, ktau, dt, garea, land, jdate, &
u10m, v10m, ustar, rlat, rlon, tskin, pb2d, t2m, dpt2m, &
pr3d, ph3d,phl3d, prl3d, tk3d, us3d, vs3d, spechum, w, &
nsoil, smc, tslb, vegtype_dom, vegtype_frac, soiltyp, nlcat, &
dswsfc, zorl, snow, julian,recmol, &
dswsfc, zorl, snow, julian, recmol, &
idat, rain_cpl, rainc_cpl, hf2d, g, pi, con_cp, con_rd, con_fv, &
dust12m_in, emi_ant_in, smoke_RRFS, smoke2d_RRFS, &
ntrac, qgrs, gq0, chem3d, tile_num, &
ntsmoke, ntdust, ntcoarsepm, imp_physics, imp_physics_thompson, &
ntfsmoke, ntsmoke, ntdust, ntcoarsepm, &
imp_physics, imp_physics_thompson, &
nwfa, nifa, emanoc, emdust, emseas, drydep_flux_out, wetdpr, &
ebb_smoke_in, frp_output, coef_bb, fire_type_out, &
ebu_smoke,fhist,min_fplume, &
max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout, &
smoke_fire, cpl_fire, &
peak_hr_out,lu_nofire_out,lu_qfire_out, &
fire_heat_flux_out, frac_grid_burned_out, kpbl,oro, &
uspdavg, hpbl_thetav, mpicomm, mpirank, mpiroot, errmsg,errflg )

implicit none


integer, intent(in) :: im,kte,kme,ktau,nsoil,tile_num,jdate(8),idat(8)
integer, intent(in) :: ntrac, ntsmoke, ntdust, ntcoarsepm, ndvel, nlcat
integer, intent(in) :: ntrac, ntfsmoke, ntsmoke, ntdust, ntcoarsepm, ndvel, nlcat
logical, intent(in) :: flag_init
real(kind_phys),intent(in) :: dt, julian, g, pi, con_cp, con_rd, con_fv

integer, parameter :: ids=1,jds=1,jde=1, kds=1
Expand Down Expand Up @@ -165,6 +167,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
real(kind_phys), dimension(:), intent(in), optional :: wetness
real(kind_phys), dimension(:), intent(out), optional :: lu_nofire_out,lu_qfire_out
integer, dimension(:), intent(out), optional :: fire_type_out
real(kind_phys), dimension(:), intent(in), optional :: smoke_fire
logical, intent(in) :: cpl_fire
integer, intent(in) :: imp_physics, imp_physics_thompson
integer, dimension(:), intent(in) :: kpbl
real(kind_phys), dimension(:), intent(in) :: oro
Expand Down Expand Up @@ -234,6 +238,19 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
errmsg = ''
errflg = 0

if (cpl_fire) then
if (flag_init) then
do i=1,im
do k=kts,kte
qgrs(i,k,ntfsmoke) = 0.
end do
end do
endif
do i=1,im
qgrs(i,kts,ntfsmoke) = qgrs(i,kts,ntfsmoke) + smoke_fire(i)
end do
endif

if (.not. do_rrfs_sd) return

! -- set domain
Expand Down
30 changes: 30 additions & 0 deletions physics/smoke_dust/rrfs_smoke_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@
dimensions = ()
type = integer
intent = in
[flag_init]
standard_name = flag_for_first_timestep
long_name = flag signaling first time step for time integration loop
units = flag
dimensions = ()
type = logical
intent = in
[kte]
standard_name = vertical_layer_dimension
long_name = vertical layer dimension
Expand Down Expand Up @@ -642,6 +649,13 @@
dimensions = ()
type = integer
intent = in
[ntfsmoke]
standard_name = index_for_fire_smoke_in_tracer_concentration_array
long_name = tracer index for fire smoke
units = index
dimensions = ()
type = integer
intent = in
[ntdust]
standard_name = index_for_dust_in_tracer_concentration_array
long_name = tracer index for dust
Expand Down Expand Up @@ -946,6 +960,22 @@
type = real
kind = kind_phys
intent = in
[smoke_fire]
standard_name = smoke_emission_of_fire
long_name = smoke emission of fire
units = kg m-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
optional = True
[cpl_fire]
standard_name = do_fire_coupling
long_name = flag controlling fire_behavior collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
Loading