Skip to content

Commit 1b7f08b

Browse files
Merge branch 'release-v3.0'
This merge introduces v3.0 of all MPAS models. * release-v3.0: (346 commits) When writing restart_timestamp file, trim the time stamp variable. Use constant extrapolation below the surface for RH. Place upper-bound on saturation vapor pressure to avoid negative densities in MPAS-A initialization, particularly near the model top. Change vertical grid stretching exponent from 1.8 to 1.5 for Jablonowski and Williamson test case. Initialize intent(out) argument 'ierr' in mpas_core_setup_clock() for init_atmosphere core. Move mpas_atm_advection model from core_atmosphere to core_init_atmosphere. Adding a trim when writing restart_timestamp Add units to enstrophy Updating interval division to use linear Removing un-needed latex equations from units in global stats. Edit GM Registry descriptions. Change to cap: Restart_timestamp Halt if I/O errors (other than clobber errors) are encountered in MPAS-Atmosphere. Add code to write 'restart_timestamp' file for atmosphere core. Restore restart_timestamp file, add "forcing" LI Registry cleanup for 3.0 Change a few default namelist flags Fixing an issue with an improperly formatted read statement Remove some unneeded trim statments from timers Fixing formating of warning messages for missing namelist records ...
2 parents a8b6191 + 6fb3dae commit 1b7f08b

File tree

242 files changed

+53244
-25704
lines changed

Some content is hidden

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

242 files changed

+53244
-25704
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Ignore Files in the MPAS Direcory
22

33
# All pre-processed Fortran files in MPAS specific directories
4+
src/core_*/Registry_processed.xml
45
src/core_*/*.f90
56
src/framework/*.f90
67
src/driver/*.f90
@@ -44,3 +45,12 @@ src/registry/parse
4445

4546
# Ignore MPAS core build files.
4647
.mpas_core_*
48+
49+
# Ignore all runtime config files
50+
namelist.*
51+
streams.*
52+
stream_list.*
53+
54+
# Intermediate files that may be produced by Intel compilers
55+
*.i
56+
*.i90

Makefile

Lines changed: 104 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#MODEL_FORMULATION = -DNCAR_FORMULATION
2-
MODEL_FORMULATION = -DLANL_FORMULATION
1+
MODEL_FORMULATION =
32

43

54
dummy:
@@ -36,6 +35,20 @@ ftn:
3635
"USE_PAPI = $(USE_PAPI)" \
3736
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE" )
3837

38+
titan-cray:
39+
( $(MAKE) all \
40+
"FC_PARALLEL = ftn" \
41+
"CC_PARALLEL = cc" \
42+
"FC_SERIAL = ftn" \
43+
"CC_SERIAL = gcc" \
44+
"FFLAGS_OPT = -s integer32 -default64 -O3 -f free -N 255 -em -ef" \
45+
"CFLAGS_OPT = -O3" \
46+
"LDFLAGS_OPT = -O3" \
47+
"CORE = $(CORE)" \
48+
"DEBUG = $(DEBUG)" \
49+
"USE_PAPI = $(USE_PAPI)" \
50+
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE" )
51+
3952
pgi:
4053
( $(MAKE) all \
4154
"FC_PARALLEL = mpif90" \
@@ -108,7 +121,7 @@ ifort-gcc:
108121
"CFLAGS_OPT = -O3" \
109122
"LDFLAGS_OPT = -O3" \
110123
"FFLAGS_DEBUG = -real-size 64 -g -convert big_endian -FR -CU -CB -check all -fpe0 -traceback" \
111-
"CFLAGS_DEBUG = -g -traceback" \
124+
"CFLAGS_DEBUG = -g" \
112125
"LDFLAGS_DEBUG = -g -fpe0 -traceback" \
113126
"CORE = $(CORE)" \
114127
"DEBUG = $(DEBUG)" \
@@ -197,7 +210,7 @@ intel-nersc:
197210
"CC_PARALLEL = cc" \
198211
"FC_SERIAL = ftn" \
199212
"CC_SERIAL = cc" \
200-
"FFLAGS_OPT = -real-size 64 -O3 -FR" \
213+
"FFLAGS_OPT = -real-size 64 -O3 -convert big_endian -FR" \
201214
"CFLAGS_OPT = -O3" \
202215
"LDFLAGS_OPT = -O3" \
203216
"CORE = $(CORE)" \
@@ -226,29 +239,57 @@ CPPINCLUDES =
226239
FCINCLUDES =
227240
LIBS =
228241
ifneq ($(wildcard $(PIO)/lib), ) # Check for newer PIO version
229-
CPPINCLUDES = -I$(NETCDF)/include -I$(PIO)/include -I$(PNETCDF)/include
230-
FCINCLUDES = -I$(NETCDF)/include -I$(PIO)/include -I$(PNETCDF)/include
231-
LIBS = -L$(PIO)/lib -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
242+
CPPINCLUDES = -I$(PIO)/include
243+
FCINCLUDES = -I$(PIO)/include
244+
LIBS = -L$(PIO)/lib -lpio
232245
else
233-
CPPINCLUDES = -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
234-
FCINCLUDES = -I$(NETCDF)/include -I$(PIO) -I$(PNETCDF)/include
235-
LIBS = -L$(PIO) -L$(PNETCDF)/lib -L$(NETCDF)/lib -lpio -lpnetcdf
246+
CPPINCLUDES = -I$(PIO)
247+
FCINCLUDES = -I$(PIO)
248+
LIBS = -L$(PIO) -lpio
236249
endif
237250

238-
NCLIB = -lnetcdf
239-
NCLIBF = -lnetcdff
240-
ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
241-
LIBS += $(NCLIBF)
242-
endif # CHECK FOR NETCDF4
243-
LIBS += $(NCLIB)
251+
ifneq "$(PNETCDF)" ""
252+
CPPINCLUDES += -I$(PNETCDF)/include
253+
FCINCLUDES += -I$(PNETCDF)/include
254+
LIBS += -L$(PNETCDF)/lib -lpnetcdf
255+
endif
256+
257+
ifneq "$(NETCDF)" ""
258+
CPPINCLUDES += -I$(NETCDF)/include
259+
FCINCLUDES += -I$(NETCDF)/include
260+
LIBS += -L$(NETCDF)/lib
261+
NCLIB = -lnetcdf
262+
NCLIBF = -lnetcdff
263+
ifneq ($(wildcard $(NETCDF)/lib/libnetcdff.*), ) # CHECK FOR NETCDF4
264+
LIBS += $(NCLIBF)
265+
endif # CHECK FOR NETCDF4
266+
LIBS += $(NCLIB)
267+
endif
244268

245269
RM = rm -f
246270
CPP = cpp -P -traditional
247271
RANLIB = ranlib
248272

249-
250273
ifdef CORE
251274

275+
ifneq ($(wildcard src/core_$(CORE)), ) # CHECK FOR EXISTENCE OF CORE DIRECTORY
276+
277+
ifneq ($(wildcard src/core_$(CORE)/build_options.mk), ) # Check for build_options.mk
278+
include src/core_$(CORE)/build_options.mk
279+
else # ELSE Use Default Options
280+
EXE_NAME=$(CORE)_model
281+
NAMELIST_SUFFIX=$(CORE)
282+
endif
283+
284+
override CPPFLAGS += -DMPAS_NAMELIST_SUFFIX=$(NAMELIST_SUFFIX)
285+
override CPPFLAGS += -DMPAS_EXE_NAME=$(EXE_NAME)
286+
287+
else # ELSE CORE DIRECTORY CHECK
288+
289+
report_builds: all
290+
291+
endif # END CORE DIRECTORY CHECK
292+
252293
ifeq "$(DEBUG)" "true"
253294

254295
ifndef FFLAGS_DEBUG
@@ -302,7 +343,6 @@ else
302343
GEN_F90_MESSAGE="MPAS was built with .F files."
303344
endif
304345

305-
306346
ifneq ($(wildcard .mpas_core_*), ) # CHECK FOR BUILT CORE
307347

308348
ifneq ($(wildcard .mpas_core_$(CORE)), ) # CHECK FOR SAME CORE AS ATTEMPTED BUILD.
@@ -326,10 +366,32 @@ else
326366
CONTINUE=true
327367
endif # END IF BUILT CORE CHECK
328368

369+
ifneq ($(wildcard namelist.$(NAMELIST_SUFFIX)), ) # Check for generated namelist file.
370+
NAMELIST_MESSAGE="A default namelist file (namelist.$(NAMELIST_SUFFIX).defaults) has been generated, but namelist.$(NAMELIST_SUFFIX) has not been modified."
371+
else
372+
NAMELIST_MESSAGE="A default namelist file (namelist.$(NAMELIST_SUFFIX).defaults) has been generated and copied to namelist.$(NAMELIST_SUFFIX)."
373+
endif
374+
375+
ifneq ($(wildcard streams.$(NAMELIST_SUFFIX)), ) # Check for generated streams file.
376+
STREAM_MESSAGE="A default streams file (streams.$(NAMELIST_SUFFIX).defaults) has been generated, but streams.$(NAMELIST_SUFFIX) has not been modified."
377+
else
378+
STREAM_MESSAGE="A default streams file (streams.$(NAMELIST_SUFFIX).defaults) has been generated and copied to streams.$(NAMELIST_SUFFIX)."
379+
endif
380+
381+
329382
ifeq "$(findstring clean, $(MAKECMDGOALS))" "clean" # CHECK FOR CLEAN TARGET
330383
override AUTOCLEAN=false
331384
endif # END OF CLEAN TARGET CHECK
332385

386+
VER=$(shell git describe --dirty 2> /dev/null)
387+
#override CPPFLAGS += -DMPAS_GIT_VERSION=$(VER)
388+
389+
ifeq "$(findstring v, $(VER))" "v"
390+
override CPPFLAGS += -DMPAS_GIT_VERSION=$(VER)
391+
else
392+
override CPPFLAGS += -DMPAS_GIT_VERSION="unknown"
393+
endif # END OF GIT DESCRIBE VERSION
394+
333395
####################################################
334396
# Section for adding external libraries and includes
335397
####################################################
@@ -348,6 +410,11 @@ all: core_error
348410

349411
else
350412

413+
ifeq ($(wildcard src/core_$(CORE)/build_options.mk), ) # Check for build_options.mk
414+
report_builds:
415+
@echo "CORE=$(CORE)"
416+
endif
417+
351418
ifeq "$(CONTINUE)" "true"
352419
all: mpas_main
353420
else
@@ -356,7 +423,8 @@ endif
356423

357424
endif
358425

359-
mpas_main:
426+
427+
mpas_main:
360428
ifeq "$(AUTOCLEAN)" "true"
361429
$(RM) .mpas_core_*
362430
endif
@@ -376,10 +444,17 @@ endif
376444
FCINCLUDES="$(FCINCLUDES)" \
377445
CORE="$(CORE)"\
378446
AUTOCLEAN="$(AUTOCLEAN)" \
379-
GEN_F90="$(GEN_F90)"
380-
@echo "$(CORE)" > .mpas_core_$(CORE)
381-
if [ -e src/$(CORE)_model ]; then mv src/$(CORE)_model .; fi
382-
@echo ""
447+
GEN_F90="$(GEN_F90)" \
448+
NAMELIST_SUFFIX="$(NAMELIST_SUFFIX)" \
449+
EXE_NAME="$(EXE_NAME)"
450+
451+
@echo "$(EXE_NAME)" > .mpas_core_$(CORE)
452+
if [ -e src/$(EXE_NAME) ]; then mv src/$(EXE_NAME) .; fi
453+
if [ -e src/inc/namelist.$(NAMELIST_SUFFIX).defaults ]; then mv src/inc/namelist.$(NAMELIST_SUFFIX).defaults .; fi
454+
if [ ! -e namelist.$(NAMELIST_SUFFIX) ]; then cp namelist.$(NAMELIST_SUFFIX).defaults namelist.$(NAMELIST_SUFFIX); fi
455+
if [ -e src/inc/streams.$(NAMELIST_SUFFIX).defaults ]; then mv src/inc/streams.$(NAMELIST_SUFFIX).defaults .; fi
456+
if [ ! -e streams.$(NAMELIST_SUFFIX) ]; then cp streams.$(NAMELIST_SUFFIX).defaults streams.$(NAMELIST_SUFFIX); fi
457+
for f in `find src/inc -name "stream_list.*"`; do mv $$f .; done
383458
@echo "*******************************************************************************"
384459
@echo $(DEBUG_MESSAGE)
385460
@echo $(PARALLEL_MESSAGE)
@@ -389,11 +464,15 @@ ifeq "$(AUTOCLEAN)" "true"
389464
@echo $(AUTOCLEAN_MESSAGE)
390465
endif
391466
@echo $(GEN_F90_MESSAGE)
467+
@echo $(NAMELIST_MESSAGE)
468+
@echo $(STREAM_MESSAGE)
392469
@echo "*******************************************************************************"
393470
clean:
394-
$(RM) .mpas_core_*
395471
cd src; $(MAKE) clean RM="$(RM)" CORE="$(CORE)"
396-
$(RM) $(CORE)_model
472+
$(RM) .mpas_core_*
473+
$(RM) $(EXE_NAME)
474+
$(RM) namelist.$(NAMELIST_SUFFIX).defaults
475+
$(RM) streams.$(NAMELIST_SUFFIX).defaults
397476
core_error:
398477
@echo ""
399478
@echo "*******************************************************************************"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v2.1
1+
MPAS-v3.0
22
====
33

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

namelist.input

Lines changed: 0 additions & 1 deletion
This file was deleted.

namelist.input.atmosphere

Lines changed: 0 additions & 85 deletions
This file was deleted.

namelist.input.init_atmosphere

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)