Skip to content

Commit

Permalink
Merge pull request #5 from mnlevy1981/source_file_from_path
Browse files Browse the repository at this point in the history
I cleaned up a lot of the documentation in tools/mapping; I think tools that rely on $CIME/tools/configure now have consistent INSTALL instructions, ESMF version numbers have been updated to what's currently available on yellowstone and cheyenne (7.0.0), and tools that rely on ESMF executables run as expected on cheyenne.
  • Loading branch information
billsacks authored May 1, 2017
2 parents 1f72a2e + 7fa83de commit dc32aaa
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 62 deletions.
2 changes: 2 additions & 0 deletions tools/mapping/check_maps/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
ESMF_RegridWeightGenCheck
src/*.o
*.nc
*.Log
32 changes: 16 additions & 16 deletions tools/mapping/check_maps/README
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
==========================================================================
$Id: README 46983 2013-05-09 22:08:12Z tcraig $
$URL: https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_141106/check_maps/README $
==========================================================================


===============
ABOUT THIS TOOL
===============
Expand Down Expand Up @@ -42,23 +36,29 @@ BUILD
=====

To compile this tool, you need to have the ESMFMKFILE environment variable set.
The easiest way to do that is to load the ESMF modules. To do this, you must
already have the intel module loaded. Then load the version of ESMF you want
to use (as of April 2013, the most recent version available is 6.1.1):
The easiest way to do that is to load the ESMF modules. On yellowstone and
cheyenne, you must already have the intel module loaded. Then load the version
of ESMF you want to use (as of April 2017, the most recent version available is
7.0.0):

Yellowstone:
$ module load esmf
$ module load esmf-6.3.0r-ncdfio-uni-O
$ module load esmf-7.0.0-ncdfio-uni-O

Cheyenne:
$ module load esmf_libs/7.0.0
$ module load esmf-7.0.0-ncdfio-uni-O

This will set ESMFMKFILE. With this variable set, enter the mapping/check_maps/src/
directory and run gmake
This will set ESMFMKFILE. With this variable set, enter the src/ directory and
run gmake

$ cd mapping/check_maps/src
$ cd src
$ gmake [VERBOSE=TRUE]

VERBOSE=TRUE turns on some extra diagnostic output and is optional.

Back in the mapping/check_maps/ directory, you should now have an executable
file named ESMF_RegridWeightGenCheck.
Back in this directory, you should now have an executable file named
ESMF_RegridWeightGenCheck.

Note that at this time, the tool only works in serial mode (building with the
mpi-enabled version of the ESMF makefile leads to a segmentation fault when
Expand All @@ -78,6 +78,6 @@ listed in FILELIST
--help, -h Output this usage information

Notes:
1) For use on yellowstone, geyser, or caldera only!
1) For use on cheyenne, yellowstone, geyser, or caldera only!
2) Need to set ESMFMKFILE (see comments in Makefile) or compilation will fail
3) If -rc option is not enabled, -v flag is ignored and verbose / concise will depend on previous compilation
2 changes: 2 additions & 0 deletions tools/mapping/check_maps/src/ESMF_RegridWeightGenCheck.F90
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,8 @@ program OfflineTester
failCnt = failCnt + 1
if (Verbose) then
print *, "FAILED: conservation error = ", totArea
print *, " area1 = ", sum(grid1area)
print *, " area2 = ", sum(grid2area)
else
print *, "FAILED: conservation error = ", totArea, &
" in test ", j
Expand Down
13 changes: 10 additions & 3 deletions tools/mapping/check_maps/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@
### The executable should run on the yellowstone login node ######
################################################################################

ifneq ($(origin ESMFMKFILE), environment)
$(error Environment variable ESMFMKFILE was not set.)
# Don't require ESMF to be loaded to run "make clean":
USE_ESMF=TRUE
ifeq ($(MAKECMDGOALS),clean)
USE_ESMF=FALSE
endif

include $(ESMFMKFILE)
ifeq ($(USE_ESMF),TRUE)
ifneq ($(origin ESMFMKFILE), environment)
$(error Environment variable ESMFMKFILE was not set.)
endif
include $(ESMFMKFILE)
endif
TARGET = ESMF_RegridWeightGenCheck

# To compile with verbose output, run
Expand Down
21 changes: 10 additions & 11 deletions tools/mapping/gen_domain_files/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
HOW TO BUILD
============

Prior to building, you must make sure environment variables CIMEROOT and CIME_MODEL are set.

(1) $ cd src
(2) $ $CIMEROOT/tools/configure --machine [machine name] --macros-format Makefile
(3) Bash users:
$ . ./.env_mach_specific.sh
csh users:
$ source ./.env_mach_specific.csh
(4) $ gmake
(2) $ ../../../configure --macros-format Makefile --mpilib mpi-serial
Bash users:
(3) $ (. ./.env_mach_specific.sh ; gmake)
csh users:
(3) $ (source ./.env_mach_specific.csh ; gmake)

Note: in the second step, replace [machine name] with the machine you are
building on. Also, some machines have dedicated build nodes, so you might need
to SSH to another node before the 'gmake' step.
Note: in the second step, you may need to include "--machine [machine name]",
where [machine name] is the name of the machine you are building on. In most
cases configure can figure that out on its own, but if you get an error that is
the first fix to try. Also, some machines have dedicated build nodes, so you
might need to SSH to another node before the 'gmake' step.

18 changes: 15 additions & 3 deletions tools/mapping/gen_domain_files/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ default: $(EXENAME)
$(MACROS):
@echo "use the configure script located in the Machines directory to create the Makefile $(MACROS) file"

-include $(MACROS)
# Do not include Macros for clean or distclean targets
USE_MACROS=TRUE
ifeq ($(MAKECMDGOALS),clean)
USE_MACROS=FALSE
endif
ifeq ($(MAKECMDGOALS),distcleanclean)
USE_MACROS=FALSE
endif

ifeq ($(USE_MACROS),TRUE)
-include $(MACROS)
endif

# Check for the netcdf library and include directories
ifdef NETCDF_PATH
LIB_NETCDF:=$(NETCDF_PATH)/lib
Expand Down Expand Up @@ -133,7 +145,7 @@ $(EXENAME): $(OBJS)
clean:
$(RM) -f $(OBJS) $(EXENAME) *.mod

veryclean:
$(RM) -f $(OBJS) $(EXENAME) *.mod $(MACROS) env_mach* Depends* .env_mach*
distclean: clean
../../../configure --clean

gen_domain.o : gen_domain.F90
4 changes: 2 additions & 2 deletions tools/mapping/gen_mapping_files/README
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ Note: if rtm is specified and lnd is not, then this tool will

You can also set the following env variables:
ESMFBIN_PATH - Path to ESMF binaries
(Leave unset on yellowstone and caldera and the tool
will be loaded from modules)
(Leave unset on cheyenne, yellowstone, and caldera and the
tool will be loaded from modules)
MPIEXEC ------ Name of mpirun executable
(default is mpirun.lsf on yellowstone and caldera; if
you run interactively on yellowstone, mpi is not used)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.Log
*.nc
4 changes: 2 additions & 2 deletions tools/mapping/gen_mapping_files/gen_ESMF_mapping_file/README
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ where

You can also set the following env variables:
ESMFBIN_PATH - Path to ESMF binaries
(Leave unset on yellowstone and caldera and the tool
will be loaded from modules)
(Leave unset on cheyenne, yellowstone, and caldera and the
tool will be loaded from modules)
MPIEXEC ------ Name of mpirun executable
(default is mpirun.lsf on yellowstone and caldera; if
you run interactively on yellowstone, mpi is not used)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ usage() {
echo ''
echo 'You can also set the following env variables:'
echo ' ESMFBIN_PATH - Path to ESMF binaries '
echo ' (Leave unset on yellowstone/caldera/pronghorn and the tool'
echo ' will be loaded from modules)'
echo ' (Leave unset on cheyenne/yellowstone/caldera/pronghorn'
echo ' and the tool will be loaded from modules)'
echo ' MPIEXEC ------ Name of mpirun executable'
echo ' (default is mpirun.lsf on yellowstone/caldera/pronghorn; if'
echo ' you run interactively on yellowstone, mpi is not used)'
Expand Down Expand Up @@ -225,6 +225,9 @@ if [ $MACH == "UNSET" ]; then
ys* )
MACH="yellowstone"
;;
cheyenne* )
MACH="cheyenne"
;;
geyser* )
MACH="geyser"
;;
Expand All @@ -244,10 +247,13 @@ if [ $MACH == "UNSET" ]; then
fi

# Machine specific settings:
# 1) can not run in parallel interactively on yellowstone
# 1) can not run in parallel interactively on yellowstone or cheyenne
if [ $MACH == "yellowstone" ] && [ $interactive == "YES" ]; then
serial="TRUE"
fi
if [ $MACH == "cheyenne" ] && [ $interactive == "YES" ]; then
serial="TRUE"
fi
# 2) jaguar requires additional environment var
if [ $MACH == "jaguar" ] && [ -z "$REGRID_PROC" ]; then
REGRID_PROC=8
Expand Down Expand Up @@ -310,22 +316,26 @@ fi

case $MACH in
## yellowstone, geyser, caldera, or pronghorn
"yellowstone" | "geyser" | "caldera" | "pronghorn" )
"cheyenne" | "yellowstone" | "geyser" | "caldera" | "pronghorn" )
# From tcsh, script will not find module command
# So check to see if module works, otherwise source an init file
module list > /dev/null 2>&1 || source /etc/profile.d/modules.sh
module purge
module load intel
module load nco
module load esmf
if [ $MACH == "cheyenne" ]; then
module load esmf_libs/7.0.0
else
module load esmf
fi

if [ $serial == "TRUE" ]; then
module load esmf-6.3.0rp1-ncdfio-uni-O
module load esmf-7.0.0-ncdfio-uni-O
if [ -z "$MPIEXEC" ]; then
MPIEXEC=""
fi
else
module load esmf-6.3.0rp1-ncdfio-mpi-O
module load esmf-7.0.0-ncdfio-mpi-O
if [ -z "$MPIEXEC" ]; then
MPIEXEC="mpirun.lsf"
fi
Expand Down
21 changes: 10 additions & 11 deletions tools/mapping/map_field/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
HOW TO BUILD
============

Prior to building, you must make sure $CIMEROOT is set.

(1) $ cd src
(2) $ $CIMEROOT/tools/configure macros-format Makefile
(3) Bash users:
$ . ./.env_mach_specific.sh
csh users:
$ source ./.env_mach_specific.csh
(4) $ gmake
(2) $ ../../../configure --macros-format Makefile --mpilib mpi-serial
Bash users:
(3) $ (. ./.env_mach_specific.sh ; gmake)
csh users:
(3) $ (source ./.env_mach_specific.csh ; gmake)

Note: in the second step, replace [machine name] with the machine you are
building on. Also, some machines have dedicated build nodes, so you might need
to SSH to another node before the 'gmake' step.
Note: in the second step, you may need to include "--machine [machine name]",
where [machine name] is the name of the machine you are building on. In most
cases configure can figure that out on its own, but if you get an error that is
the first fix to try. Also, some machines have dedicated build nodes, so you
might need to SSH to another node before the 'gmake' step.

26 changes: 19 additions & 7 deletions tools/mapping/map_field/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,26 @@ null :=
CURDIR = .
EXENAME = ../map_field
RM = rm
MACFILE = Macros.make
MACROS = Macros.make

default: $(EXENAME)

$(MACFILE):
@echo "use the configure script located in the Machines directory to create the Makefile $(MACFILE) file"
$(MACROS):
@echo "use the configure script located in the Machines directory to create the Makefile $(MACROS) file"

# Do not include Macros for clean or distclean targets
USE_MACROS=TRUE
ifeq ($(MAKECMDGOALS),clean)
USE_MACROS=FALSE
endif
ifeq ($(MAKECMDGOALS),distcleanclean)
USE_MACROS=FALSE
endif

ifeq ($(USE_MACROS),TRUE)
-include $(MACROS)
endif

-include $(MACFILE)
# Check for the netcdf library and include directories
ifdef NETCDF_PATH
LIB_NETCDF:=$(NETCDF_PATH)/lib
Expand Down Expand Up @@ -97,7 +109,7 @@ else
FPPDEFS := $(CPPDEFS)
endif
#Primary Target: build the tool
all: $(EXENAME) $(MACFILE)
all: $(EXENAME) $(MACROS)

OBJS := map_field.o

Expand Down Expand Up @@ -133,7 +145,7 @@ $(EXENAME): $(OBJS)
clean:
$(RM) -f $(OBJS) $(EXENAME) *.mod

veryclean:
$(RM) -f $(OBJS) $(EXENAME) *.mod $(MACFILE) .env_mach* env_mach*
distclean: clean
../../../configure --clean

map_field.o : map_field.F90

0 comments on commit dc32aaa

Please sign in to comment.