Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Fwd: some problems in configure the cam5

Dear all
I want to run the CAM5 in IBM aix
but when configure using run-ibm.csh* there are some thing wrong.
I attached the run-ibm.csh* in CAM3 which can run CAM3 in our computers
Who can help me change it to fit CAM5, thank you very much

#! /usr/bin/csh -f


#-----------------------------------------------------------------------
## IBM
##------------
##
## This is an example script to build and run the default CAM configuration
## on an IBM SP. The default configuration is T42L26, Eulerian dynamics,
## CLM2 land model, and CSIM4 ice model.
##
## Setting LoadLeveler options for batch queue submission.
## @ class is the queue in which to run the job.
## To see a list of available queues, type "llclass" interactively.
## @ node is the number of nodes. @tasks_per_node should be set to 1 because
## of the hybrid OpenMP/MPI configuration of CAM. The number of nodes should
## be a power of 2, up to a max of 16 for T42.
## @ output and @error are the names of file written to the directory from
## which the script is submitted containing STDOUT and STDERR respectively
## @ job_type = parallel declares that multiple nodes will be used.
## @ network.MPI: Has to do with network connection between nodes. Best to leave alone.
## @ node_usage = not_shared acquires dedicated access to nodes for the job.
## @ queue tells load leveler to submit the job

###@ class = normald
###@ node = 4
###@ tasks_per_node = 4
###@ output = out.$(jobid)
###@ error = err.$(jobid)
###@ job_type = parallel
###@ network.MPI = sn_all,shared,us
###@ node_usage = shared
###@ job_name = cam3_wm
###@ queue

## POE Environment. Set these for interactive jobs. They're ignored by LoadLeveler
## MP_NODES is the number of nodes. The number chosen should be a power of 2, up to a max of 16 for T42.
#setenv MP_NODES 2
#setenv MP_TASKS_PER_NODE 1
#setenv MP_EUILIB us
#setenv MP_RMPOOL 1
# TH: bug fix suggested by Brian Eaton 1/24/03
#unsetenv MP_PROCS

# must be set equal to (CPUs-per-node / tasks_per_node)
#setenv OMP_NUM_THREADS 4

## suggestion from Jim Edwards to reintroduce XLSMPOPTS on 11/13/03
#setenv XLSMPOPTS "stack=256000000"
#setenv AIXTHREAD_SCOPE S
#setenv MALLOCMULTIHEAP true
#setenv OMP_DYNAMIC false
## Do our best to get sufficient stack memory
#limit stacksize unlimited


## netCDF stuff for Q32
#setenv INC_NETCDF /opt/netcdf-3.5.1/include
#setenv LIB_NETCDF /opt/netcdf-3.5.1/lib
## netCDF stuff for Q64
setenv INC_NETCDF /u/student/soft/netcdf-3.5.1_64/include
setenv LIB_NETCDF /u/student/soft/netcdf-3.5.1_64/lib

## ROOT OF CAM DISTRIBUTION - probably needs to be customized.
## Contains the source code for the CAM distribution.
## (the root directory contains the subdirectory "models")
set camroot = /ngpfs/fs3/student/cam3

## ROOT OF CAM DATA DISTRIBUTION - needs to be customized unless running at NCAR.
## Contains the initial and boundary data for the CAM distribution.
## (the root directory contains the subdirectories "atm" and "lnd")
setenv CSMDATA /ngpfs/fs3/student/cam3/inputdata

## Default namelist settings:
## $case is the case identifier for this run. It will be placed in the namelist.
## $runtype is the run type: initial, restart, or branch.
## $nelapse is the number of timesteps to integrate, or number of days if negative.
set case = test32
set runtype = initial
set nelapse = 150

## $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 = /ngpfs/fs3/student
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

## 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 -j4 >&! 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 -o $rundir/namelist
# -namelist "&camexp nelapse=$nelapse /" || echo "build-namelist failed" && exit 1

$cfgdir/build-namelist -s -case $case -runtype $runtype
-namelist "&camexp nelapse=$nelapse /"
-namelist "&camexp archive_dir='$rundir' /"
-namelist "&camexp rest_pfile ='$rundir/cam2.rpointer' /"
-o $rundir/namelist
-infile $cfgdir/namelist_sst5120
|| echo "build-namelist failed" && exit 1


## Run BCCAM

cd $rundir || echo "cd $rundir failed" && exit 1
cp $camroot/models/atm/cam/bld/cam3.cmd .
# cp $CSMDATA/atm/cam2/inic/smmr_T42_asc.dat .
###
echo "running CAM3 in $rundir"

# poe $blddir/cam < namelist || echo "CAM run failed" && exit 1
# llsubmit cam3.cmd



exit 0
 
this is my change using CAM5 run-ibm.csh
but something is wrong
#! /usr/bin/csh -f

## extract number of tasks from batch environment
set ntasks = `4`

## should be set equal to (CPUs-per-node / tasks_per_node)
setenv OMP_NUM_THREADS 4

## suggestions from Jim Edwards 07/08
setenv XLSMPOPTS "stack=256000000"
setenv OMP_DYNAMIC false
setenv AIXTHREAD_SCOPE S
setenv MALLOCMULTIHEAP true
setenv MP_USE_BULK_XFER yes
setenv MP_LABELIO yes

## Do our best to get sufficient stack memory
limit stacksize unlimited

## netCDF stuff
setenv INC_NETCDF /u/student/soft/netcdf-3.5.1_64/include
setenv LIB_NETCDF /u/student/soft/netcdf-3.5.1_64/lib

## ROOT OF CAM DISTRIBUTION - probably needs to be customized.
## Contains the source code for the CAM distribution.
## (the root directory contains the subdirectory "models")
set camroot = /ngpfs/fs3/student/cesm

## ROOT OF CAM DATA DISTRIBUTION - needs to be customized unless running at NCAR.
## Contains the initial and boundary data for the CAM distribution.
## (the root directory contains the subdirectories "atm" and "lnd")
setenv CSMDATA /ngpfs/fs3/student/cesm/inputdata

## 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 = /ngpfs/fs3/student
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

## If an executable doesn't exist, build one.
if ( ! -x $blddir/cam ) then
cd $blddir || echo "cd $blddir failed" && exit 1
$cfgdir/configure -dyn fv -hgrid 1.9x2.5 -spmd -smp -ntasks $ntasks -nthreads $OMP_NUM_THREADS || 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

$cfgdir/build-namelist -s -case $case -runtype $runtype
-namelist "&camexp nelapse=$nelapse /"
-namelist "&camexp archive_dir='$rundir' /"
-namelist "&camexp rest_pfile ='$rundir/cam2.rpointer' /"
-o $rundir/namelist
-infile $cfgdir/namelist_sst5120
|| echo "build-namelist failed" && exit 1


## Run CAM - use 'mpirun.lsf' on bluefire
cd $rundir || echo "cd $rundir failed" && exit 1
cp $camroot/models/atm/cam/bld/cam3.cmd .
# cp $CSMDATA/atm/cam2/inic/smmr_T42_asc.dat
echo "running CAM in $rundir"

#bluefire
#mpirun.lsf /usr/local/bin/hybrid_launch $blddir/cam || echo "CAM run failed" && exit 1

exit 0
 

eaton

CSEG and Liaisons
Here are a few things I see that are wrong:

. set ntasks = `4` -- This will not set ntasks to 4. Remove the backticks which are telling the shell to execute the command 4. The system will respond with something like "4: Command not found."

. the build-namelist command should not have multiple -namelist arguments. Just use one and put all the namelist variables in it; like in the example.

. the build-namelist command is using an old argument, -o, which is no longer valid. See the user guide.

. the variables being set via the -namelist argument are no longer valid. See the namelist documentation.
 
Top