Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "src/core_atmosphere/physics/physics_noaa/SMOKE"]
path = src/core_atmosphere/physics/physics_noaa/SMOKE
url = https://github.com/NOAA-GSL/SMOKE.git
[submodule "src/core_atmosphere/physics/physics_noaa/MYNN-SFC"]
path = src/core_atmosphere/physics/physics_noaa/MYNN-SFC
url = https://github.com/NCAR/MYNN-SFC.git
29 changes: 26 additions & 3 deletions src/core_atmosphere/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ set(ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES
module_sf_mynn.F
sf_mynn_pre.F
sf_sfclayrev_pre.F
module_mynnsfclay_driver.F90
module_mynnsfclay.F90
module_mynnsfclay_pre.F90
)

list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES PREPEND physics/physics_wrf/)
Expand Down Expand Up @@ -248,6 +245,31 @@ set(ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES
)
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES PREPEND physics/physics_noaa/MYNN-EDMF/)

set(ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/MYNN-SFC)

if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR})
set(PHYSICS_MYNN-SFC_REPO_URL "https://github.com/NCAR/MYNN-SFC.git")
execute_process(COMMAND git clone ${PHYSICS_MYNN-SFC_REPO_URL} ${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_DIR}
RESULT_VARIABLE GIT_CLONE_RESULT
OUTPUT_VARIABLE GIT_CLONE_OUTPUT
ERROR_VARIABLE GIT_CLONE_ERROR)
if(NOT GIT_CLONE_RESULT EQUAL 0)
message(FATAL_ERROR "Git clone failed with error: ${GIT_CLONE_ERROR}")
endif()

else()
message(STATUS "Directory ${DIR_TO_CHECK} already exists, skipping clone")
endif()

set(ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES
module_sf_mynnsfc_land.F90
module_sf_mynnsfc_water.F90
module_sf_mynnsfc_ice.F90
MPAS/module_sf_mynnsfc_common.F90
MPAS/module_sf_mynnsfc_driver.F90
)
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES PREPEND physics/physics_noaa/MYNN-SFC/)

set(ATMOSPHERE_CORE_PHYSICS_RUCLSM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/RUCLSM)

if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_RUCLSM_DIR})
Expand Down Expand Up @@ -489,6 +511,7 @@ add_library(core_atmosphere ${ATMOSPHERE_CORE_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_UGWP_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_MYNN-SFC_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_RUCLSM_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_GFL_SOURCES}
${ATMOSPHERE_CORE_PHYSICS_SMOKE_SOURCES}
Expand Down
10 changes: 10 additions & 0 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2820,6 +2820,16 @@
description="configuration for surface layer-scheme"
possible_values="`suite',`sf_monin_obukhov','sf_monin_obukhov_rev',`sf_mynn',`sf_mynnsfclay',`sf_myj', `off'"/>

<nml_option name="config_mynn_sfcflux_land" type="integer" default_value="0" in_defaults="false"
units="-"
description="=configuration option for the calculation of zt and zq over land"
possible_values="0:constant Czil, 1:variable Czil, 2:Yang"/>

<nml_option name="config_mynn_sfcflux_water" type="integer" default_value="0" in_defaults="false"
units="-"
description="=configuration option for the calculation of z0, zt and zq over water"
possible_values="0:COARE3.0, 1:COARE3.5, 2:Davis/COARE3.5 ,3:Davis/Garratt, 4:Taylor-Yelland"/>

<nml_option name="config_radt_cld_overlap" type="character" default_value="maximum_random" in_defaults="false"
description="cloud overlapping option in the RRTMG lw and sw radiation schemes"
possible_values="`none',`random',`maximum_random',`maximum',`exponential',`'exponential_random'"/>
Expand Down
16 changes: 10 additions & 6 deletions src/core_atmosphere/physics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif

all:
./../tools/manage_externals/checkout_externals --externals ./../Externals.cfg
$(MAKE) lookup_tables core_physics_init core_physics_mmm core_microphysics core_UGWP core_RUCLSM core_mynnedmf core_GFL core_SMOKE core_physics_wrf core_physics_noahmp core_physics
$(MAKE) lookup_tables core_physics_init core_physics_mmm core_microphysics core_UGWP core_RUCLSM core_mynnedmf core_mynnsfc core_GFL core_SMOKE core_physics_wrf core_physics_noahmp core_physics

dummy:
echo "****** compiling physics ******"
Expand Down Expand Up @@ -73,6 +73,9 @@ core_SMOKE: core_physics_init
core_mynnedmf: core_physics_init core_physics_mmm
(cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; cp ./MPAS/module_bl_mynnedmf_driver.F90 .; cp ./MPAS/module_bl_mynnedmf_common.F90 .; $(MAKE) all)

core_mynnsfc:
(cd physics_noaa/MYNN-SFC; cp ./MPAS/Makefile .; cp ./MPAS/module_sf_mynnsfc_driver.F90 .; cp ./MPAS/module_sf_mynnsfc_common.F90 .; $(MAKE) all)

core_RUCLSM: core_physics_init core_physics_mmm
(cd physics_noaa/RUCLSM; cp ./MPAS/Makefile .; cp ./MPAS/module_ruc_land.F90 .; cp ./MPAS/module_ruc_ice.F90 .; cp ./MPAS/module_sf_sfcdiags_ruclsm.F .; $(MAKE) all COREDEF="$(COREDEF)")

Expand All @@ -92,7 +95,7 @@ core_physics_noahmp:

core_physics_init: $(OBJS_init)

core_physics: core_microphysics core_mynnedmf core_RUCLSM core_GFL core_SMOKE core_physics_wrf core_physics_noahmp
core_physics: core_microphysics core_mynnedmf core_mynnsfc core_RUCLSM core_GFL core_SMOKE core_physics_wrf core_physics_noahmp
($(MAKE) phys_interface COREDEF="$(COREDEF)")
ar -ru libphys.a $(OBJS_init) $(OBJS)
($(MAKE) -C ./physics_mmm -f Makefile.mpas physics_mmm_lib)
Expand Down Expand Up @@ -290,6 +293,7 @@ clean:
( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi )
( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi )
( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi )
( if [ -d physics_noaa/MYNN-SFC ]; then cd physics_noaa/MYNN-SFC; cp ./MPAS/Makefile .; $(MAKE) clean; fi )
( if [ -d physics_noaa/GFL ]; then cd physics_noaa/GFL; cp ./MPAS/Makefile .; $(MAKE) clean; fi )
( if [ -d physics_noaa/SMOKE ]; then cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; $(MAKE) clean; fi )
@# Certain systems with intel compilers generate *.i files
Expand All @@ -300,16 +304,16 @@ clean:
$(RM) $@ $*.mod
ifeq "$(GEN_F90)" "true"
$(CPP) $(CPPFLAGS) $(COREDEF) $(HYDROSTATIC) $(CPPINCLUDES) $< > $*.f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
else
$(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
$(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
endif

.F90.o:
$(RM) $@ $*.mod
ifeq "$(GEN_F90)" "true"
$(CPP) $(CPPFLAGS) $(COREDEF) $(HYDROSTATIC) $(CPPINCLUDES) $< > $*.f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
else
$(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F90 $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
$(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F90 $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noaa/UGWP -I./physics_noaa/MYNN-EDMF -I./physics_noaa/MYNN-SFC -I./physics_noaa/RUCLSM -I./physics_noaa/GFL -I./physics_noaa/SMOKE -I.. -I../../framework -I../../external/esmf_time_f90
endif
6 changes: 5 additions & 1 deletion src/core_atmosphere/physics/mpas_atmphys_driver_seaice.F
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ subroutine seaice_to_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
hfx_p(i,j) = xice_p(i,j)*hfx_p(i,j) + (1._RKIND-xice_p(i,j))*hfx_sea(i,j)
lh_p(i,j) = xice_p(i,j)*lh_p(i,j) + (1._RKIND-xice_p(i,j))*lh_sea(i,j)
qfx_p(i,j) = xice_p(i,j)*qfx_p(i,j) + (1._RKIND-xice_p(i,j))*qfx_sea(i,j)
qgh_p(i,j) = xice_p(i,j)*qgh_p(i,j) + (1._RKIND-xice_p(i,j))*qgh_sea(i,j)
if(trim(sfclayer_scheme) .ne. "sf_mynnsfclay") then
qgh_p(i,j) = xice_p(i,j)*qgh_p(i,j) + (1._RKIND-xice_p(i,j))*qgh_sea(i,j)
else
qgh_p(i,j) = qgh_p(i,j)
endif
qsfc_p(i,j) = xice_p(i,j)*qsfc_p(i,j) + (1._RKIND-xice_p(i,j))*qsfc_sea(i,j)
tsk_p(i,j) = xice_p(i,j)*tsk_p(i,j) + (1._RKIND-xice_p(i,j))*tsk_sea(i,j)
sfc_albedo_p(i,j) = xice_p(i,j)*sfc_albedo_p(i,j) + (1._RKIND-xice_p(i,j))*0.08_RKIND
Expand Down
67 changes: 33 additions & 34 deletions src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ module mpas_atmphys_driver_sfclayer
use mpas_atmphys_vars

use module_sf_mynn,only: sfclay_mynn
use module_mynnsfclay_driver,only:mynnsfclay_driver
use module_sf_mynnsfc_driver,only: mynnsfc_driver
use module_sf_sfclay
use module_sf_sfclayrev,only: sfclayrev
use sf_mynn,only: sf_mynn_init
use module_mynnsfclay,only: mynnsfclay_init
use module_sf_mynnsfc_driver,only: mynnsfc_init
use sf_sfclayrev,only: sf_sfclayrev_init
use module_sf_myjsfc

Expand Down Expand Up @@ -678,7 +678,6 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)

case("sf_mynnsfclay")
!input variables:
call mpas_pool_get_array(diag_physics,'qcg' ,qcg )
call mpas_pool_get_array(sfc_input ,'snowh',snowh)
!inout variables:
call mpas_pool_get_array(diag_physics,'ch' ,ch )
Expand All @@ -688,7 +687,6 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
do i = its,ite
!input variables:
snowh_p(i,j) = snowh(i)
qcg_p(i,j) = qcg(i)
!inout variables:
ch_p(i,j) = ch(i)
cqs_p(i,j) = cqs(i)
Expand Down Expand Up @@ -1097,7 +1095,7 @@ subroutine init_sfclayer(configs,diag_physics,sfc_input)
call sf_mynn_init(errmsg,errflg)

case("sf_mynnsfclay")
call mynnsfclay_init(errmsg,errflg)
call mynnsfc_init(allowed_to_read,errmsg,errflg)

case("sf_myj")
call mpas_pool_get_config(configs,'config_do_restart' ,config_do_restart )
Expand Down Expand Up @@ -1164,6 +1162,8 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
logical,pointer:: config_do_restart,config_frac_seaice
logical,pointer:: config_do_DAcycling
character(len=StrKIND),pointer:: sfclayer_scheme
character(len=StrKIND),pointer:: lsm_scheme
integer,pointer:: sf_mynn_sfcflux_land,sf_mynn_sfcflux_water
real(kind=RKIND),dimension(:),pointer:: areaCell

!local variables:
Expand Down Expand Up @@ -1390,32 +1390,33 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite

case("sf_mynnsfclay")
call mpas_timer_start('sf_mynnsfclay')
call mpas_log_write('--- enter subroutine mynnsfclay_driver:')
call mynnsfclay_driver( &
p3d = pres_hyd_p , pi3d = pi_p , psfcpa = psfc_p , &
th3d = th_p , t3d = t_p , u3d = u_p , &
v3d = v_p , qv3d = qv_p , qc3d = qc_p , &
rho3d = rho_p , dz8w = dz_p , cp = cp , &
g = gravity , rovcp = rcp , R = R_d , &
xlv = xlv , chs = chs_p , chs2 = chs2_p , &
call mpas_log_write('--- enter subroutine mynnsfc_driver:')
call mpas_pool_get_config(configs,'config_mynn_sfcflux_land' ,sf_mynn_sfcflux_land )
call mpas_pool_get_config(configs,'config_mynn_sfcflux_water',sf_mynn_sfcflux_water)
call mpas_pool_get_config(configs,'config_lsm_scheme' ,lsm_scheme )
call mynnsfc_driver( &
p3d = pres_hyd_p , th3d = th_p , t3d = t_p , &
u3d = u_p , v3d = v_p , qv3d = qv_p , &
rho3d = rho_p , dz8w = dz_p , &
chs = chs_p , chs2 = chs2_p , psfcpa = psfc_p , &
cqs = cqs_p , cqs2 = cqs2_p , cpm = cpm_p , &
znt = znt_p , &
ust = ust_p , pblh = hpbl_p , mavail = mavail_p , &
zol = zol_p , mol = mol_p , regime = regime_p , &
zol = zol_p , mol = mol_p , &
psim = psim_p , psih = psih_p , xland = xland_p , &
hfx = hfx_p , qfx = qfx_p , lh = lh_p , &
tsk = tsk_p , flhc = flhc_p , flqc = flqc_p , &
qgh = qgh_p , qsfc = qsfc_p , rmol = rmol_p , &
qsfc = qsfc_p , rmol = rmol_p , &
u10 = u10_p , v10 = v10_p , th2 = th2m_p , &
t2 = t2m_p , q2 = q2_p , snowh = snowh_p , &
gz1oz0 = gz1oz0_p , wspd = wspd_p , br = br_p , &
isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , &
ep1 = ep_1 , ep2 = ep_2 , karman = karman , &
isfflx = isfflx , dx = dx_p , &
ustm = ustm_p , ck = ck_p , cka = cka_p , &
cd = cd_p , cda = cda_p , ch = ch_p , &
qcg = qcg_p , spp_pbl = spp_pbl , isftcflx = isftcflx , &
iz0tlnd = iz0tlnd , &
spp_pbl = spp_pbl , &
sf_mynn_sfcflux_land = sf_mynn_sfcflux_land , &
sf_mynn_sfcflux_water = sf_mynn_sfcflux_water , &
flagc_lsm = lsm_scheme , &
itimestep= itimestep , initflag = initflag , &
restart = config_do_restart , &
cycling = config_do_DAcycling , &
Expand All @@ -1426,31 +1427,29 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
)

if(config_frac_seaice) then
call mynnsfclay_driver( &
p3d = pres_hyd_p , pi3d = pi_p , psfcpa = psfc_p , &
th3d = th_p , t3d = t_p , u3d = u_p , &
v3d = v_p , qv3d = qv_p , qc3d = qc_p , &
rho3d = rho_p , dz8w = dz_p , cp = cp , &
g = gravity , rovcp = rcp , R = R_d , &
xlv = xlv , chs = chs_sea , chs2 = chs2_sea , &
call mynnsfc_driver( &
p3d = pres_hyd_p , th3d = th_p , t3d = t_p , &
u3d = u_p , v3d = v_p , qv3d = qv_p , &
rho3d = rho_p , dz8w = dz_p , &
chs = chs_sea , chs2 = chs2_sea , psfcpa = psfc_p , &
cqs = cqs_sea , cqs2 = cqs2_sea , cpm = cpm_sea , &
znt = znt_sea , &
ust = ust_sea , pblh = hpbl_p , mavail = mavail_sea , &
zol = zol_sea , mol = mol_sea , regime = regime_sea , &
zol = zol_sea , mol = mol_sea , &
psim = psim_sea , psih = psih_sea , xland = xland_sea , &
hfx = hfx_sea , qfx = qfx_sea , lh = lh_sea , &
tsk = tsk_sea , flhc = flhc_sea , flqc = flqc_sea , &
qgh = qgh_sea , qsfc = qsfc_sea , rmol = rmol_sea , &
qsfc = qsfc_sea , rmol = rmol_sea , &
u10 = u10_sea , v10 = v10_sea , th2 = th2m_sea , &
t2 = t2m_sea , q2 = q2_sea , snowh = snowh_p , &
gz1oz0 = gz1oz0_sea , wspd = wspd_sea , br = br_sea , &
isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , &
ep1 = ep_1 , ep2 = ep_2 , karman = karman , &
isfflx = isfflx , dx = dx_p , &
ustm = ustm_sea , ck = ck_sea , cka = cka_sea , &
cd = cd_sea , cda = cda_sea , ch = ch_sea , &
qcg = qcg_p , spp_pbl = spp_pbl , isftcflx = isftcflx , &
iz0tlnd = iz0tlnd , &
spp_pbl = spp_pbl , &
sf_mynn_sfcflux_land = sf_mynn_sfcflux_land , &
sf_mynn_sfcflux_water = sf_mynn_sfcflux_water , &
flagc_lsm = lsm_scheme , &
itimestep= itimestep , initflag = initflag , &
restart = config_do_restart , &
cycling = config_do_DAcycling , &
Expand Down
Loading