- 积分
 - 214
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2011-12-15
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
 本帖最后由 66kqkq 于 2016-6-26 16:23 编辑  
 
分享一个CAM5.3的 C shell脚本 
 
#! /usr/bin/csh -f 
##======================================================================= 
setenv OMP_NUM_THREADS 6 
 
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 
 
limit stacksize unlimited 
 
set camroot = /.../cesm1_2_2     #CESM 的代码路径 
 
set ntasks       = 72    #自己根据实际情况定义 
set case          = ... 
set runtype      = ...   #startup; continue 自己选择 
set stop_n       = ...   #自己根据实际情况定义 
set stop_option  = nmonths 
set restr        = monthly 
set nx           = 12 
set ny           = 6 
 
set rundir       = $camroot/sensitive/$case 
set blddir       = $rundir/bld 
set cfgdir       = $camroot/models/atm/cam/bld 
 
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 -hgrid 1.9x2.5 -fc mpif90 -fc_type pgi -ntasks $ntasks -cam_exedir $rundir -cam_bld $blddir || echo "configure failed" && exit 1 
    echo "building CAM in $blddir ..." 
    rm -f Depends 
    gmake -j2 >&! MAKE.out      || echo "CAM build failed: see $blddir/MAKE.out" && exit 1 
endif 
 
## Create the namelist 
cd $rundir                      || echo "cd $rundir failed" && exit 1 
$cfgdir/build-namelist -s -config $blddir/config_cache.xml -runtype $runtype -dir $rundir                      \ 
  -namelist "&camexp stop_option='nmonths', stop_n=$stop_n, npr_yz = $nx,$ny,$ny,$nx  restart_option='monthly' \ 
  bndtvs = '.......nc'                        \       #如果不是annual cycle的SST,自己加过异常的海温路径。如果是气候态的海温强迫,则可删掉该行。 
  /" || echo "build-namelist failed" && exit 1 
 
echo "running CAM in $rundir" 
 
rm cam.log  || echo  "remove the cam.log" 
 
cp .../submitjob.sh ./ 
qsub submitjob.sh 
exit 0 
 
 |   
 
 
 
 |