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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
url = https://github.com/NOAA-GSL/SMOKE.git
[submodule "src/core_atmosphere/stochastic_physics"]
path = src/core_atmosphere/stochastic_physics
url = https://github.com/dtcenter/stochastic_physics.git
url = https://github.com/guoqing-noaa/stochastic_physics.git
5 changes: 5 additions & 0 deletions modulefiles/mpas/derecho.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ prepend_path("MODULEPATH", '/glade/work/epicufsrt/contrib/spack-stack/derecho/sp

load("stack-oneapi/2024.2.1")
load("stack-cray-mpich/8.1.29")
load("intel-oneapi-mkl/2024.2.2")
load("cmake/3.27.9")
load("parallel-netcdf/1.12.3")
load("parallelio/2.6.2")

if mode() == "load" then
setenv("PNETCDF", os.getenv("parallel_netcdf_ROOT"))
setenv("NetCDF_C_ROOT", os.getenv("netcdf_c_ROOT"))
setenv("NetCDF_FORTRAN_ROOT", os.getenv("netcdf_fortran_ROOT"))
end
if mode() == "unload" then
unsetenv("PNETCDF")
unsetenv("NetCDF_C_ROOT")
unsetenv("NetCDF_FORTRAN_ROOT")
end

setenv("CMAKE_C_COMPILER", "mpicc")
Expand Down
5 changes: 5 additions & 0 deletions modulefiles/mpas/gaeac6.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ prepend_path("MODULEPATH", "/ncrc/proj/epic/spack-stack/c6/spack-stack-1.9.3/env

load("stack-oneapi/2024.2.1")
load("stack-cray-mpich/8.1.32")
load("intel-oneapi-mkl/2023.2.0")
load("cmake/3.27.9")
load("parallel-netcdf/1.12.3")
load("parallelio/2.6.2")

if mode() == "load" then
setenv("PNETCDF", os.getenv("parallel_netcdf_ROOT"))
setenv("NetCDF_C_ROOT", os.getenv("netcdf_c_ROOT"))
setenv("NetCDF_FORTRAN_ROOT", os.getenv("netcdf_fortran_ROOT"))
end
if mode() == "unload" then
unsetenv("PNETCDF")
unsetenv("NetCDF_C_ROOT")
unsetenv("NetCDF_FORTRAN_ROOT")
end

setenv("CMAKE_C_COMPILER", "mpicc")
Expand Down
6 changes: 6 additions & 0 deletions modulefiles/mpas/hera.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ prepend_path("MODULEPATH","/contrib/spack-stack/spack-stack-1.9.3/envs/ue-oneapi

load("stack-oneapi/2024.2.1")
load("stack-intel-oneapi-mpi/2021.13")
load("mkl/2024.2.1")

load("cmake/3.27.9")
load("parallel-netcdf/1.12.3")
load("parallelio/2.6.2")

if mode() == "load" then
setenv("PNETCDF", os.getenv("parallel_netcdf_ROOT"))
setenv("NetCDF_C_ROOT", os.getenv("netcdf_c_ROOT"))
setenv("NetCDF_FORTRAN_ROOT", os.getenv("netcdf_fortran_ROOT"))
end
if mode() == "unload" then
unsetenv("PNETCDF")
unsetenv("NetCDF_C_ROOT")
unsetenv("NetCDF_FORTRAN_ROOT")
end

setenv("CMAKE_C_COMPILER", "mpiicc")
Expand Down
5 changes: 5 additions & 0 deletions modulefiles/mpas/orion.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ prepend_path("MODULEPATH", "/apps/contrib/spack-stack/spack-stack-1.9.3/envs/ue-

load("stack-oneapi/2024.2.1")
load("stack-intel-oneapi-mpi/2021.13")
load("intel-oneapi-mkl/2024.2.1")
load("cmake/3.27.9")
load("parallel-netcdf/1.12.3")
load("parallelio/2.6.2")

if mode() == "load" then
setenv("PNETCDF", os.getenv("parallel_netcdf_ROOT"))
setenv("NetCDF_C_ROOT", os.getenv("netcdf_c_ROOT"))
setenv("NetCDF_FORTRAN_ROOT", os.getenv("netcdf_fortran_ROOT"))
end
if mode() == "unload" then
unsetenv("PNETCDF")
unsetenv("NetCDF_C_ROOT")
unsetenv("NetCDF_FORTRAN_ROOT")
end

setenv("CMAKE_C_COMPILER", "mpiicc")
Expand Down
6 changes: 5 additions & 1 deletion modulefiles/mpas/ursa.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ prepend_path("MODULEPATH", "/contrib/spack-stack/spack-stack-1.9.3/envs/ue-oneap

load("stack-oneapi/2024.2.1")
load("stack-intel-oneapi-mpi/2021.13")
load("intel-oneapi-mkl/2024.2.1")

load("cmake/3.27.9")
load("parallel-netcdf/1.12.3")
Expand All @@ -17,9 +18,12 @@ setenv("CMAKE_CXX_COMPILER", "mpiicpc")
setenv("CMAKE_Fortran_COMPILER", "mpiifort")

if mode() == "load" then
--setenv("PNETCDF", os.getenv("PARALLEL_NETCDF_ROOT"))
setenv("PNETCDF", os.getenv("parallel_netcdf_ROOT"))
setenv("NetCDF_C_ROOT", os.getenv("netcdf_c_ROOT"))
setenv("NetCDF_FORTRAN_ROOT", os.getenv("netcdf_fortran_ROOT"))
end
if mode() == "unload" then
unsetenv("PNETCDF")
unsetenv("NetCDF_C_ROOT")
unsetenv("NetCDF_FORTRAN_ROOT")
end
34 changes: 34 additions & 0 deletions src/core_atmosphere/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,39 @@ set(ATMOSPHERE_CORE_PHYSICS_SMOKE_SOURCES
)
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_SMOKE_SOURCES PREPEND physics/physics_noaa/SMOKE/)

# build stochastic_physics as a library
set(ATMOSPHERE_CORE_STOCHASTIC_PHYSICS_SOURCES
kinddef.F90
mpi_wrapper.F90
plumes.F90
mersenne_twister.F90
random_numbers.F90
stochy_namelist_def.F90
compns_stochy.F90
stochy_internal_state_mod.F90
spectral_transforms.F90
stochastic_physics.F90
stochy_patterngenerator.F90
stochy_data_mod.F90
stochy_nml_rec.F90
get_stochy_pattern.F90
lndp_apply_perts.F90
stochastic_physics_mpas.F
)
list(TRANSFORM ATMOSPHERE_CORE_STOCHASTIC_PHYSICS_SOURCES PREPEND stochastic_physics/)
add_library(stochastic_physics ${ATMOSPHERE_CORE_STOCHASTIC_PHYSICS_SOURCES})
mpas_fortran_target(stochastic_physics)
target_compile_definitions(stochastic_physics PRIVATE INTERNAL_FILE_NML)
if(NOT MPAS_DOUBLE_PRECISION)
target_compile_definitions(stochastic_physics PRIVATE CCPP_32BIT)
endif()
find_package(BLAS REQUIRED)
find_package(NetCDF REQUIRED COMPONENTS Fortran C)
target_link_libraries(stochastic_physics PUBLIC MPI::MPI_Fortran framework ${BLAS_LIBRARIES} NetCDF::NetCDF_Fortran NetCDF::NetCDF_C)
install(TARGETS stochastic_physics EXPORT ${PROJECT_NAME}ExportsCore
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

set(ATMOSPHERE_CORE_PHYSICS_MMM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_mmm)

if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_MMM_DIR})
Expand Down Expand Up @@ -503,6 +536,7 @@ if (${DO_PHYSICS})
list(APPEND CORE_ATMOSPHERE_COMPILE_DEFINITIONS DO_PHYSICS)
endif ()
target_compile_definitions(core_atmosphere PRIVATE ${CORE_ATMOSPHERE_COMPILE_DEFINITIONS})
target_link_libraries(core_atmosphere PUBLIC stochastic_physics)
set_MPAS_DEBUG_flag(core_atmosphere)
mpas_core_target(CORE atmosphere TARGET core_atmosphere INCLUDES ${ATMOSPHERE_CORE_INCLUDES})

Expand Down