sfeng2@unl_edu
New Member
I usually run the CAM model at NCAR computers. Recently, I am trying to run the CAM at Jaguar, ORNL. The procedures to set up the CAM runs at the Jaguar are much different from the NCAR computers. Currently, I have trouble to compile the model and build the executable file.
I first load the netcdf library using 'module load netcdf'.
Then I used the following short script to build and compile the code:
#! /usr/bin/csh -f
set camroot = /ccs/home/sfeng/CAM/cam1
setenv CSMDATA /ccs/home/sfeng/CAM
## LOGNAME - used in default settings, must be set if not available
## setenv LOGNAME
if !($?LOGNAME) then
echo "LOGNAME not available for setting of defaults - setting must be added to this script"
exit 1
endif
## Default namelist settings:
## $case is the case identifier for this run. It will be placed in the namelist.
## $runtype is the run type: startup, continue, or branch.
## $stop_n is the number of days to integrate (units depend on stop_option)
set case = camrun
set runtype = startup
set stop_n = 1
## $wrkdir is a working directory where the model will be built and run.
## $blddir is the directory where model will be compiled.
## $rundir is the directory where the model will be run.
## $cfgdir is the directory containing the CAM configuration scripts.
set wrkdir = /tmp/work/$LOGNAME
set blddir = $wrkdir/$case/bld
set rundir = $wrkdir/$case
set cfgdir = $camroot/models/atm/cam/bld
## Ensure that run and build directories exist
mkdir -p $rundir || echo "cannot create $rundir" && exit 1
mkdir -p $blddir || echo "cannot create $blddir" && exit 1
####echo " OK so far !!!!"
## If an executable doesn't exist, build one.
if ( ! -x $blddir/cam ) then
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/configure || echo "configure failed" && exit 1
echo "building CAM in $blddir ..."
rm -f Depends
gmake -j8 >&! MAKE.out || echo "CAM build failed: see $blddir/MAKE.out" && exit 1
endif
## Create the namelist
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/build-namelist -s -case $case -runtype $runtype
-namelist "&camexp stop_option='ndays', stop_n=$stop_n /" || echo "build-namelist failed" && exit 1
exit 0
The following are the error I got:
** Cannot find netcdf.inc in specified directory: /usr/local/include
**
** The NetCDF include directory is determined from the following set of options listed
** from highest to lowest precedence:
** * interactively, enabled by command-line option -i
** * by the command-line option -nc_inc
** * by a default configuration file, specified by -defaults
** * by the environment variable INC_NETCDF
** * by the default value /usr/local/include
configure failed
There is not NetCDF library at /usr/local/include, but I loaded it using 'module load netcdf'. How does the 'netcdf' is used after it is loaded in Jaguar?
It seems that there are a lot groups are running CAM or CCSM at Jaguar, can anybody provide a sample 'build' and 'run' script you used to complier and run the model?
Best
Song Feng
email: sfeng2@unl.edu
I first load the netcdf library using 'module load netcdf'.
Then I used the following short script to build and compile the code:
#! /usr/bin/csh -f
set camroot = /ccs/home/sfeng/CAM/cam1
setenv CSMDATA /ccs/home/sfeng/CAM
## LOGNAME - used in default settings, must be set if not available
## setenv LOGNAME
if !($?LOGNAME) then
echo "LOGNAME not available for setting of defaults - setting must be added to this script"
exit 1
endif
## Default namelist settings:
## $case is the case identifier for this run. It will be placed in the namelist.
## $runtype is the run type: startup, continue, or branch.
## $stop_n is the number of days to integrate (units depend on stop_option)
set case = camrun
set runtype = startup
set stop_n = 1
## $wrkdir is a working directory where the model will be built and run.
## $blddir is the directory where model will be compiled.
## $rundir is the directory where the model will be run.
## $cfgdir is the directory containing the CAM configuration scripts.
set wrkdir = /tmp/work/$LOGNAME
set blddir = $wrkdir/$case/bld
set rundir = $wrkdir/$case
set cfgdir = $camroot/models/atm/cam/bld
## Ensure that run and build directories exist
mkdir -p $rundir || echo "cannot create $rundir" && exit 1
mkdir -p $blddir || echo "cannot create $blddir" && exit 1
####echo " OK so far !!!!"
## If an executable doesn't exist, build one.
if ( ! -x $blddir/cam ) then
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/configure || echo "configure failed" && exit 1
echo "building CAM in $blddir ..."
rm -f Depends
gmake -j8 >&! MAKE.out || echo "CAM build failed: see $blddir/MAKE.out" && exit 1
endif
## Create the namelist
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/build-namelist -s -case $case -runtype $runtype
-namelist "&camexp stop_option='ndays', stop_n=$stop_n /" || echo "build-namelist failed" && exit 1
exit 0
The following are the error I got:
** Cannot find netcdf.inc in specified directory: /usr/local/include
**
** The NetCDF include directory is determined from the following set of options listed
** from highest to lowest precedence:
** * interactively, enabled by command-line option -i
** * by the command-line option -nc_inc
** * by a default configuration file, specified by -defaults
** * by the environment variable INC_NETCDF
** * by the default value /usr/local/include
configure failed
There is not NetCDF library at /usr/local/include, but I loaded it using 'module load netcdf'. How does the 'netcdf' is used after it is loaded in Jaguar?
It seems that there are a lot groups are running CAM or CCSM at Jaguar, can anybody provide a sample 'build' and 'run' script you used to complier and run the model?
Best
Song Feng
email: sfeng2@unl.edu