Skip to content

Commit bd39cdf

Browse files
committed
Merge branch 'release-v8.3.0'
MPAS Version 8.3.0 This release of MPAS introduces new capabilities and improvements in the MPAS-Atmosphere model and its supporting software infrastructure. Notable changes are listed below. Initialization: * Addition of support for 30" BNU soil category dataset. The 30" BNU soil category dataset can be selected by setting the new namelist option config_soilcat_data to 'BNU' in the &data_sources namelist group. Use of this dataset requires a separate static dataset download. (PR #1322) * Addition of support for 15" MODIS land use dataset. The 15" MODIS land use dataset may be selected by setting the existing namelist option config_landuse_data to 'MODIFIED_IGBP_MODIS_NOAH_15s' in the &data_sources namelist group. Use of this dataset requires a separate static dataset download. (PR #1322) * Introduction of a new namelist option, config_lu_supersample_factor, to control the super-sampling of land use data, which may now be on either a 30" or a 15" grid, depending on the choice of dataset. The existing namelist option config_30s_supersample_factor now controls the super-sampling for 30" terrain, soil category, and MODIS FPAR monthly vegetation fraction data only. (PR #1322) * A change in the horizontal interpolation from a four-point bilinear interpolation to a sixteen-point overlapping parabolic interpolation for both initial conditions and lateral boundary conditions. (PR #1303) * Ability to use ICON soil moisture and soil temperature fields. (PR #1298) * Addition of an option to skip processing of Noah-MP-only static fields in the init_atmosphere core. Setting the new config_noahmp_static namelist option to false in the &data_sources namelist group prevents the Noah-MP static fields from being processed when config_static_interp = true in the namelist.init_atmosphere file; this also permits existing static files that lack the Noah-MP fields 'soilcomp', 'soilcl1', 'soilcl2', 'soilcl3', and 'soilcl4' to be used by the init_atmosphere_model program. (PR #1239) * Memory scaling improvements to the gravity wave drag (GWD) static field processing in the init_atmosphere core (when 'config_native_gwd_static = true') to reduce memory usage when multiple MPI ranks are used. In many cases, these changes eliminate the need to undersubscribe computing resources, which was previously required in order to work around lack of memory scaling in the GWD static field processing. (PR #1235) Physics: * Update of the RRTMG LW and SW schemes, most notably with the addition of the exponential and exponential_random cloud overlap assumptions. The cloud overlap assumption and decorrelation length are now available as namelist options (config_radt_cld_overlap and config_radt_cld_dcorrlen, respectively). (PR #1296 and PR #1297) * The incorporation of NOAA's Unified Forecast System (UFS) Unified Gravity Wave Physics (UGWP) suite of physics parameterizations. This physics package is the "NOAA/GSL" orographic gravity wave drag (GWD) suite introduced in WRF Version 4.3 (activated by WRF namelist option 'gwd_opt=3'), but with the addition of a non-stationary GWD parameterization that represents gravity wave sources such as deep convection and frontal instability. The use of the UGWP suite requires additional static field downloads. (PR #1276) Dynamics: * Complete port of all routines in the dynamical core to GPUs using OpenACC directives, including routines used by limited-area simulations. Not included in this release, though, is the optimization of data movement between the CPU and GPU memory, and the profiling and optimization of the computational kernels. * A change in the zero-gradient LBC for w to a constant value of w=0 in the specified zone. For limited-area configurations, the change from a zero-gradient boundary condition for the vertical velocity, w, to a setting of the vertical velocity to zero in the specified region alleviates spurious streamers and instabilities that appeared near the boundaries in regions of strong inflow. (PR #1304) Infrastructure: * Implementation of a new capability to automatically generate package logic code, which determines when a package is active. This package logic is generated by the registry at build time through the use of a new XML attribute, active_when, for <package> elements. (PR #1321) Other: * Addition of a new Python script for setting up MPAS-Atmosphere run directories. (PR #1326) * Addition of 3-d 10 cm radar reflectivity (refl10cm) to the 'da_state' stream, useful for radar DA and radar obs comparison purposes. (PR #1323)
2 parents ac3866c + f29cd82 commit bd39cdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+8828
-4206
lines changed

CMakeLists.txt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ option(MPAS_DOUBLE_PRECISION "Use double precision 64-bit Floating point." TRUE)
2121
option(MPAS_PROFILE "Enable GPTL profiling" OFF)
2222
option(MPAS_OPENMP "Enable OpenMP" OFF)
2323
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
24+
option(MPAS_USE_PIO "Build with PIO I/O library" OFF)
2425

2526
message(STATUS "[OPTION] MPAS_CORES: ${MPAS_CORES}")
2627
message(STATUS "[OPTION] MPAS_DOUBLE_PRECISION: ${MPAS_DOUBLE_PRECISION}")
2728
message(STATUS "[OPTION] MPAS_PROFILE: ${MPAS_PROFILE}")
2829
message(STATUS "[OPTION] MPAS_OPENMP: ${MPAS_OPENMP}")
2930
message(STATUS "[OPTION] BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
31+
message(STATUS "[OPTION] MPAS_USE_PIO: ${MPAS_USE_PIO}")
3032

3133
# Build product output locations
3234
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -56,10 +58,20 @@ endif()
5658

5759
### Dependencies
5860
find_package(OpenMP COMPONENTS Fortran)
61+
62+
# use mpifort options with nvfortran
63+
if(CMAKE_Fortran_COMPILER_ID MATCHES NVHPC)
64+
find_program(CMAKE_Fortran_COMPILER_MPI NAMES mpifort REQUIRED)
65+
message(VERBOSE "CMAKE_Fortran_COMPILER_MPI: ${CMAKE_Fortran_COMPILER_MPI}")
66+
set(MPI_Fortran_COMPILER mpifort)
67+
endif()
5968
find_package(MPI REQUIRED COMPONENTS Fortran)
60-
find_package(NetCDF REQUIRED COMPONENTS Fortran C)
69+
6170
find_package(PnetCDF REQUIRED COMPONENTS Fortran)
62-
find_package(PIO REQUIRED COMPONENTS Fortran C)
71+
if(MPAS_USE_PIO)
72+
find_package(PIO REQUIRED COMPONENTS Fortran C)
73+
find_package(NetCDF REQUIRED COMPONENTS Fortran C)
74+
endif()
6375
if(MPAS_PROFILE)
6476
find_package(GPTL REQUIRED)
6577
endif()
@@ -70,6 +82,8 @@ if(CMAKE_C_COMPILER_ID MATCHES GNU)
7082
set(CPP_EXTRA_FLAGS -traditional)
7183
elseif(CMAKE_C_COMPILER_ID MATCHES "(Apple)?Clang" )
7284
find_program(CPP_EXECUTABLE NAMES cpp REQUIRED)
85+
elseif(CMAKE_C_COMPILER_ID MATCHES "NVHPC" )
86+
find_program(CPP_EXECUTABLE NAMES cpp REQUIRED)
7387
else()
7488
message(STATUS "Unknown compiler: ${CMAKE_C_COMPILER_ID}")
7589
set(CPP_EXECUTABLE ${CMAKE_C_COMPILER})
@@ -88,6 +102,9 @@ set(MPAS_SUBDRIVER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/driver/mpas_subdriver.F)
88102

89103
## Create targets
90104
add_subdirectory(src/external/ezxml) # Target: MPAS::external::ezxml
105+
if(NOT MPAS_USE_PIO)
106+
add_subdirectory(src/external/SMIOL) # Target: MPAS::external::smiol
107+
endif()
91108
if(ESMF_FOUND)
92109
message(STATUS "Configure MPAS for external ESMF")
93110
add_definitions(-DMPAS_EXTERNAL_ESMF_LIB -DMPAS_NO_ESMF_INIT)

Makefile

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,10 @@ intel: # BUILDTARGET Intel oneAPI Fortran, C, and C++ compiler suite
667667
"CFLAGS_OPT = -O3" \
668668
"CXXFLAGS_OPT = -O3" \
669669
"LDFLAGS_OPT = -O3" \
670-
"FFLAGS_DEBUG = -g -convert big_endian -free -check all -fpe0 -traceback" \
670+
"FFLAGS_DEBUG = -g -convert big_endian -free -check bounds,pointers,arg_temp_created,format,shape,contiguous -fpe0 -traceback" \
671671
"CFLAGS_DEBUG = -g -traceback" \
672672
"CXXFLAGS_DEBUG = -g -traceback" \
673-
"LDFLAGS_DEBUG = -g -check all -fpe0 -traceback" \
673+
"LDFLAGS_DEBUG = -g -traceback" \
674674
"FFLAGS_OMP = -qopenmp" \
675675
"CFLAGS_OMP = -qopenmp" \
676676
"PICFLAG = -fpic" \
@@ -1266,7 +1266,7 @@ ifeq "$(OPENACC)" "true"
12661266
endif # OPENACC eq true
12671267

12681268

1269-
pio_test: openmp_test openacc_test
1269+
pio_test: openmp_test openacc_test pnetcdf_test
12701270
@#
12711271
@# PIO_VERS will be set to:
12721272
@# 0 if no working PIO library was detected (and .piotest.log will contain error messages)
@@ -1374,11 +1374,52 @@ mpi_f08_test:
13741374
$(if $(findstring 1,$(MPAS_MPI_F08)), $(eval MPI_F08_MESSAGE = "Using the mpi_f08 module."), )
13751375
$(if $(findstring 1,$(MPAS_MPI_F08)), $(info mpi_f08 module detected.))
13761376

1377+
1378+
pnetcdf_test:
1379+
@#
1380+
@# Create test C programs that look for PNetCDF header file and some symbols in it
1381+
@#
1382+
ifneq "$(PNETCDF)" ""
1383+
@echo "Checking for a working PnetCDF library..."
1384+
@printf "#include \"pnetcdf.h\"\n\
1385+
&#include \"mpi.h\"\n\
1386+
&int main(){\n\
1387+
& int err, ncid;\n\
1388+
& err = ncmpi_create(MPI_COMM_WORLD, \"foo.nc\", NC_NOCLOBBER, MPI_INFO_NULL, &ncid);\n\
1389+
& return 0;\n\
1390+
&}\n" | sed 's/&/ /' > pnetcdf.c
1391+
@( $(CC) pnetcdf.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -L$(PNETCDF)/$(PNETCDFLIBLOC) -lpnetcdf -o pnetcdf.out > pnetcdf.log 2>&1; \
1392+
if [ $$? -eq 0 ] ; then \
1393+
echo "$(CC) can compile test PnetCDF C program."; \
1394+
else \
1395+
echo "*********************************************************"; \
1396+
echo "ERROR: Test PnetCDF C program could not be compiled by $(CC)."; \
1397+
echo "Please ensure you have a working PnetCDF library installed."; \
1398+
echo ""; \
1399+
echo "The following compilation command failed with errors:" ; \
1400+
echo "$(CC) pnetcdf.c $(CPPINCLUDES) $(CFLAGS) $(LDFLAGS) -L$(PNETCDF)/$(PNETCDFLIBLOC) -lpnetcdf -o pnetcdf.out"; \
1401+
echo ""; \
1402+
echo "Test program pnetcdf.c and output pnetcdf.log have been left"; \
1403+
echo "in the top-level MPAS directory for further debugging"; \
1404+
echo "*********************************************************"; \
1405+
rm -f pnetcdf.out; exit 1; \
1406+
fi )
1407+
1408+
@rm -f pnetcdf.c pnetcdf.out pnetcdf.log
1409+
else
1410+
@echo "*********************************************************"; \
1411+
echo "ERROR: The PNETCDF environment variable isn't set."; \
1412+
echo "Please set this variable to where PnetCDF is installed."; \
1413+
echo "*********************************************************"; \
1414+
exit 1
1415+
endif
1416+
1417+
13771418
ifneq "$(PIO)" ""
1378-
MAIN_DEPS = rebuild_check openmp_test openacc_test pio_test mpi_f08_test
1419+
MAIN_DEPS = rebuild_check openmp_test openacc_test pnetcdf_test pio_test mpi_f08_test
13791420
override CPPFLAGS += "-DMPAS_PIO_SUPPORT"
13801421
else
1381-
MAIN_DEPS = rebuild_check openmp_test openacc_test mpi_f08_test
1422+
MAIN_DEPS = rebuild_check openmp_test openacc_test pnetcdf_test mpi_f08_test
13821423
IO_MESSAGE = "Using the SMIOL library."
13831424
override CPPFLAGS += "-DMPAS_SMIOL_SUPPORT"
13841425
endif

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v8.2.3
1+
MPAS-v8.3.0
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

cmake/Functions/MPAS_Functions.cmake

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ function(mpas_fortran_target target)
8080

8181
# Global Fortran configuration
8282
set_target_properties(${target} PROPERTIES Fortran_FORMAT FREE)
83-
set(MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
84-
_MPI=1
85-
USE_PIO2=1
86-
)
83+
if(MPAS_USE_PIO)
84+
set(MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
85+
USE_PIO2=1
86+
)
87+
else()
88+
set(MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
89+
MPAS_SMIOL_SUPPORT=1
90+
)
91+
endif()
92+
list(APPEND MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS _MPI=1)
8793
# Enable OpenMP support
8894
if(MPAS_OPENMP)
8995
target_link_libraries(${target} PUBLIC OpenMP::OpenMP_Fortran)
@@ -123,6 +129,17 @@ function(mpas_fortran_target target)
123129
else()
124130
list(APPEND MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS SINGLE_PRECISION)
125131
endif()
132+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES NVHPC)
133+
134+
list(APPEND MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS
135+
$<$<COMPILE_LANGUAGE:Fortran>:-DCPRPGI -DMPAS_NAMELIST_SUFFIX=atmosphere -DMPAS_EXE_NAME=atmosphere_model>
136+
$<$<COMPILE_LANGUAGE:Fortran>:-DMPAS_OPENACC -DSINGLE_PRECISION -DMPAS_BUILD_TARGET=nvhpc>
137+
)
138+
list(APPEND MPAS_FORTRAN_TARGET_COMPILE_OPTIONS_PRIVATE
139+
$<$<COMPILE_LANGUAGE:Fortran>: -Mnofma -acc -gpu=math_uniform,cc70,cc80 -Minfo=accel -byteswapio>
140+
)
141+
message(VERBOSE "${target} options: ${MPAS_FORTRAN_TARGET_COMPILE_OPTIONS_PRIVATE}")
142+
message(VERBOSE "${target} defines: ${MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS}")
126143
endif()
127144
target_compile_definitions(${target} PRIVATE ${MPAS_FORTRAN_TARGET_COMPILE_DEFINITIONS})
128145
target_compile_options(${target} PRIVATE ${MPAS_FORTRAN_TARGET_COMPILE_OPTIONS_PRIVATE})
@@ -244,4 +261,4 @@ function(set_MPAS_DEBUG_flag target)
244261
if(CMAKE_BUILD_TYPE MATCHES Debug)
245262
target_compile_definitions(${target} PRIVATE MPAS_DEBUG)
246263
endif()
247-
endfunction()
264+
endfunction()

src/core_atmosphere/CMakeLists.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ set(ATMOSPHERE_CORE_PHYSICS_SOURCES
2020
mpas_atmphys_o3climatology.F
2121
mpas_atmphys_rrtmg_lwinit.F
2222
mpas_atmphys_rrtmg_swinit.F
23+
mpas_atmphys_sfc_diagnostics.F
2324
mpas_atmphys_update.F
2425
mpas_atmphys_update_surface.F
2526
mpas_atmphys_utilities.F
@@ -51,6 +52,7 @@ set(ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES
5152
cu_ntiedtke_pre.F
5253
module_bep_bem_helper.F
5354
module_bl_gwdo.F
55+
module_bl_ugwp_gwdo.F
5456
module_bl_ysu.F
5557
module_cam_error_function.F
5658
module_cam_shr_kind_mod.F
@@ -128,9 +130,36 @@ set(ATMOSPHERE_CORE_PHYSICS_MMM_SOURCES
128130

129131
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_MMM_SOURCES PREPEND physics/physics_mmm/)
130132

133+
set(ATMOSPHERE_CORE_PHYSICS_NOAA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/UGWP)
134+
135+
if(NOT EXISTS ${ATMOSPHERE_CORE_PHYSICS_NOAA_DIR})
136+
set(PHYSICS_NOAA_REPO_URL "https://github.com/NOAA-GSL/UGWP.git")
137+
execute_process(COMMAND git clone ${PHYSICS_NOAA_REPO_URL} ${ATMOSPHERE_CORE_PHYSICS_NOAA_DIR}
138+
RESULT_VARIABLE GIT_CLONE_RESULT
139+
OUTPUT_VARIABLE GIT_CLONE_OUTPUT
140+
ERROR_VARIABLE GIT_CLONE_ERROR)
141+
if(NOT GIT_CLONE_RESULT EQUAL 0)
142+
message(FATAL_ERROR "Git clone failed with error: ${GIT_CLONE_ERROR}")
143+
endif()
144+
145+
else()
146+
message(STATUS "Directory ${DIR_TO_CHECK} already exists, skipping clone")
147+
endif()
148+
149+
set(ATMOSPHERE_CORE_PHYSICS_NOAA_SOURCES
150+
bl_ugwp.F
151+
bl_ugwpv1_ngw.F
152+
cires_tauamf_data.F
153+
cires_ugwpv1_initialize.F
154+
cires_ugwpv1_module.F
155+
cires_ugwpv1_solv2.F
156+
cires_ugwpv1_triggers.F
157+
)
158+
159+
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_NOAA_SOURCES PREPEND physics/physics_noaa/UGWP/)
160+
131161
set(ATMOSPHERE_CORE_PHYSICS_NOAMP_UTILITY_SOURCES
132162
CheckNanMod.F90
133-
ErrorHandleMod.F90
134163
Machine.F90
135164
)
136165
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_NOAMP_UTILITY_SOURCES PREPEND physics/physics_noahmp/utility/)
@@ -344,6 +373,7 @@ add_library(core_atmosphere ${ATMOSPHERE_CORE_SOURCES}
344373
${ATMOSPHERE_CORE_PHYSICS_SOURCES}
345374
${ATMOSPHERE_CORE_PHYSICS_MMM_SOURCES}
346375
${ATMOSPHERE_CORE_PHYSICS_WRF_SOURCES}
376+
${ATMOSPHERE_CORE_PHYSICS_NOAA_SOURCES}
347377
${ATMOSPHERE_CORE_DIAGNOSTIC_SOURCES}
348378
${ATMOSPHERE_CORE_DYNAMICS_SOURCES})
349379

src/core_atmosphere/Externals.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ local_path = ./physics_mmm
33
protocol = git
44
repo_url = https://github.com/NCAR/MMM-physics.git
55
tag = 20240626-MPASv8.2
6+
required = True
67

8+
[GSL_UGWP]
9+
local_path = ./physics_noaa/UGWP
10+
protocol = git
11+
repo_url = https://github.com/NOAA-GSL/UGWP.git
12+
tag = MPAS_20241223
713
required = True
814

915
[externals_description]

src/core_atmosphere/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
# To build a dycore-only MPAS-Atmosphere model, comment-out or delete
55
# the definition of PHYSICS, below
66
#
7-
PHYSICS=-DDO_PHYSICS
8-
7+
# If MPAS_CAM_DYCORE is found in CPPFLAGS, PHYSICS will become undefined automatically
8+
#
9+
ifeq ($(findstring MPAS_CAM_DYCORE,$(CPPFLAGS)),)
10+
PHYSICS = -DDO_PHYSICS
11+
endif
912

1013
ifdef PHYSICS
1114
PHYSCORE = physcore
@@ -81,7 +84,7 @@ clean:
8184
$(RM) $@ $*.mod
8285
ifeq "$(GEN_F90)" "true"
8386
$(CPP) $(CPPFLAGS) $(PHYSICS) $(CPPINCLUDES) -I./inc $< > $*.f90
84-
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I../external/esmf_time_f90
87+
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90
8588
else
86-
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I../external/esmf_time_f90
89+
$(FC) $(CPPFLAGS) $(PHYSICS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./inc -I../framework -I../operators -I./physics -I./dynamics -I./diagnostics -I./physics/physics_wrf -I./physics/physics_mmm -I./physics/physics_noaa/UGWP -I../external/esmf_time_f90
8790
endif

0 commit comments

Comments
 (0)