Back to home page

MITgcm

 
 

    


Warning, /tools/run_cpl_test is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit a99d7059 on 2022-03-25 19:27:01 UTC
b2495a94f0 Jean*0001 #! /usr/bin/env bash
dda5bd4160 Jean*0002 
a99d705983 Jean*0003 #---
                0004 # Description:
                0005 #   script to compile and run MITgcm Atmosphere-Ocean coupled set-up
                0006 #     see, e.g., verification/cpl_aim+ocn/README.md
                0007 #         or     verification_other/cpl_gray+ocn/
                0008 #   Note: currently these coupled set-up are not covered by "testreport"
                0009 # 1) running "./run_cpl_test" show the different steps (+ some options) available
                0010 # 2) some options are not available as argument and require editing this script, e.g.,
                0011 #    a) to run Ocean or Atmos component on more that 1 MPI process (edit: NpOc and Npr)
                0012 #    b) to use compiler Optimisation (edit: GMKopt)
                0013 #---
                0014 
a3fd9a2edd Jean*0015 bdPfx='build'; # build-dir prefix
                0016 
a99d705983 Jean*0017 # Npr  :: total number of MPI procs (including 1 for coupler)
                0018 # NpOc :: number of MPI procs for Ocean component
                0019 # Npr - NpOc - 1 :: number of MPI procs for Atmos. component
c186d3754d Jean*0020 #- default:
ab3c9af868 Jean*0021  Npr=3 ; NpOc=1 ;
                0022 #Npr=25; NpOc=12;
a99d705983 Jean*0023 
                0024 # MTH :: genmake2 option for multi-threading compilation
4fee6741c4 Jean*0025 MTH=
a99d705983 Jean*0026 
                0027 # GMKopt :: other genmake2 option (empty --> use compiler optimisation)
3bf5ee70f4 Jean*0028 GMKopt='-devel'
                0029 #GMKopt='-ieee'
ab3c9af868 Jean*0030 #GMKopt=
c186d3754d Jean*0031 
a99d705983 Jean*0032 rnkO=1 ; rnkA=`expr $rnkO + $NpOc`
                0033 MTHo=
                0034 MTHa=
c186d3754d Jean*0035 #- parse options:
5d8546a51a Jean*0036 if [ $# -ge 1 ] ; then if test $1 = '-mth' ; then
7e24056d27 Jean*0037   MTH='-omp' ; shift
                0038   if test -f input_ocn/eedata.mth ; then MTHo=$MTH ; fi
                0039   if test -f input_atm/eedata.mth ; then MTHa=$MTH ; fi
5d8546a51a Jean*0040 fi ; fi
a99d705983 Jean*0041 sfx=''; chkArg=$# ;
                0042 if [ $chkArg -eq 2 ]; then
                0043   sfx=$2 ; nInpAlt=`ls -1 -d input_???.$sfx 2> /dev/null | wc -l`
                0044   if [ $nInpAlt -eq 0 ]; then chkArg=0
                0045     echo " no second set of input-dir matching suffix '.$sfx'"
                0046   else chkArg=1 ; fi
                0047 fi
                0048 if [ $chkArg -ge 1 ]; then
                0049   if [ $1 -lt 0 -o $1 -gt 5 ]; then chkArg=0 ; fi
                0050   #- allows more argument for building step (step=1)
                0051   if [ $1 -eq 1 ]; then chkArg=1 ; fi
                0052 fi
3bf5ee70f4 Jean*0053 if [ $chkArg -ne 1 ]; then
a99d705983 Jean*0054   echo 'Usage: '`basename $0`' [typ] step [opt-arg]'
ab7ee76107 Jean*0055   echo ' => test coupled set-up on linux box (1.cpu)'
a99d705983 Jean*0056   echo ' typ = -mth : compile and run (if eedata.mth) 2-threads for ocn & atm'
7e24056d27 Jean*0057   echo ' step = 0 : clean all directories'
a99d705983 Jean*0058   echo ' step = 1 : compile the 3 executables (cpl,ocn,atm);'
                0059   echo '       opt-arg: -of Optfile_Name : using option-file "Optfile_Name"'
                0060   echo ' step = 2 : copy input files and dir(s);'
ab3c9af868 Jean*0061   echo " step = 3 : run with $Npr mpi processes"
7e24056d27 Jean*0062   echo ' step = 4 : check the results'
                0063   echo ' step = 5 : remove output files in rank_0,1,2 dir.'
a99d705983 Jean*0064   echo ' opt-arg (for step 2 & 4): suffix of second set of input-dir to use'
dda5bd4160 Jean*0065   exit
                0066 fi
                0067 kpr=$1
a99d705983 Jean*0068 curDir=`pwd`
dda5bd4160 Jean*0069 
                0070 #============================================================================
                0071 
a99d705983 Jean*0072 if test $kpr = 0 ; then
                0073  rm -f pr_group std_outp comp_res.{ocn,atm,land,icTh,icDy,pTr}
a3fd9a2edd Jean*0074  rm -f ${bdPfx}_???/TTT.*make.* ${bdPfx}_???/TTT.mkdepend.*
ab3c9af868 Jean*0075  /bin/rm -r -f rank_? rank_1? rank_2?
a3fd9a2edd Jean*0076  if test -f ${bdPfx}_cpl/Makefile ; then cd ${bdPfx}_cpl ; make Clean ; cd .. ; fi
                0077  if test -f ${bdPfx}_ocn/Makefile ; then cd ${bdPfx}_ocn ; make Clean ; cd .. ; fi
                0078  if test -f ${bdPfx}_atm/Makefile ; then cd ${bdPfx}_atm ; make Clean ; cd .. ; fi
dda5bd4160 Jean*0079 fi
a99d705983 Jean*0080 if test $kpr = 5 ; then
37faa9ac7a Jean*0081  echo 'remove output files in rank_0,1,2 dir.'
a99d705983 Jean*0082  rm -f pr_group std_outp comp_res.{ocn,atm,land,icTh,icDy,pTr}
a3fd9a2edd Jean*0083  test -f rank_0/Coupler.0000.clog && rm -f rank_0/Coupler.0000.clog
                0084  if test -d rank_$rnkO ; then
a99d705983 Jean*0085    ( cd rank_$rnkO ; rm -f *.txt *.log STD???.00?? UV-*.00??.clog
                0086      mkdir tmp_trash ; mv *.data *.meta tmp_trash
                0087      listLNK=`find tmp_trash -type l`
                0088      if test "x$listLNK" != x ; then mv $listLNK .
                0089        echo -n " move back to rank_$rnkO : " ; echo $listLNK | sed "s|tmp_trash/||g"
                0090      fi
                0091      /bin/rm -rf tmp_trash )
a3fd9a2edd Jean*0092  fi
                0093  if test -d rank_$rnkA ; then
a99d705983 Jean*0094    ( cd rank_$rnkA ; rm -f *.txt *.log STD???.00?? UV-*.00??.clog
                0095      mkdir tmp_trash ; mv *.data *.meta tmp_trash
                0096      listLNK=`find tmp_trash -type l`
                0097      if test "x$listLNK" != x ; then mv $listLNK .
                0098        echo -n " move back to rank_$rnkA : " ; echo $listLNK | sed "s|tmp_trash/||g"
                0099      fi
                0100      /bin/rm -rf tmp_trash )
a3fd9a2edd Jean*0101  fi
37faa9ac7a Jean*0102 fi
dda5bd4160 Jean*0103 
a99d705983 Jean*0104 if test $kpr = 1 ; then
dda5bd4160 Jean*0105 
3bf5ee70f4 Jean*0106 #- choice of the optfile:
                0107 #  default: take a local one in dir verification with sufix '+mpi'
c186d3754d Jean*0108  nbOpF=`ls ../linux_* | grep '+mpi' 2> /dev/null | wc -l`
3bf5ee70f4 Jean*0109 #  or take the one given as argument:
                0110  if [ $# -ge 3 ]; then
                0111    if test $2 = '-of' -a -f $3 ; then nbOpF=-1 ; OPTFILE=$3 ; fi
                0112  fi
ab3c9af868 Jean*0113  if test $nbOpF = 1 ; then
c186d3754d Jean*0114    OPTFILE=`ls ../linux_* | grep '+mpi'`
ab3c9af868 Jean*0115  elif [ $nbOpF -ge 2 ] ; then
                0116    echo "pick the 1rst of these ( $nbOpF ) optfiles:"
                0117    ls ../linux_* | grep '+mpi'
                0118    OPTFILE=`ls ../linux_* | grep '+mpi' | head -1`
3bf5ee70f4 Jean*0119  elif [ $nbOpF -ne -1 ] ; then
c186d3754d Jean*0120    echo "Pb in finding optfile: found $nbOpF :"
ab3c9af868 Jean*0121    ls ../linux_* | grep '+mpi' ; exit
ab7ee76107 Jean*0122  fi
3bf5ee70f4 Jean*0123  zz=`grep '^ *FC=' $OPTFILE | tail -1`
                0124  echo " Using optfile: $OPTFILE  (compiler: $zz) $MTH"
f9b804c1e5 Jean*0125  zz=`echo $OPTFILE | grep -c '^\/'`
                0126  if test $zz = 0 ; then OPTFILE="../$OPTFILE" ; fi
ab7ee76107 Jean*0127 #---
dda5bd4160 Jean*0128  echo '==== compile coupler:'
a3fd9a2edd Jean*0129  cd ${bdPfx}_cpl
dda5bd4160 Jean*0130  echo ' --- genmake2 (cpl):'
b2495a94f0 Jean*0131  ../../../tools/genmake2 -of $OPTFILE -mpi $GMKopt >  TTT.genmake.$$ 2>&1
42ba74acb2 Jean*0132  RetVal=$? ; tail -5 TTT.genmake.$$
                0133  if test "x$RetVal" != x0 ; then
                0134    echo "Error in genmake2 (cpl)" ; exit 11
                0135  fi
dda5bd4160 Jean*0136  echo ' --- make depend (cpl):'
b2495a94f0 Jean*0137  make depend > TTT.mkdepend.$$ 2>&1
42ba74acb2 Jean*0138  RetVal=$? ; tail -5 TTT.mkdepend.$$
                0139  if test "x$RetVal" != x0 ; then
                0140    echo "Error in mkdepend (cpl)" ; exit 12
                0141  fi
b6f598c890 Jean*0142  echo ' --- make (cpl):' ; touch TTT.make.$$
                0143 #do_make_syntax.sh obj > TTT.make.$$ 2>&1
                0144  make >> TTT.make.$$ 2>&1
42ba74acb2 Jean*0145  RetVal=$? ; tail -10 TTT.make.$$
                0146  if test "x$RetVal" != x0 ; then
                0147    echo "Error in make     (cpl)" ; exit 13
                0148  fi
a99d705983 Jean*0149  echo ' ' ; cd $curDir
dda5bd4160 Jean*0150 
                0151  echo '==== compile OGCM:'
a3fd9a2edd Jean*0152  cd ${bdPfx}_ocn
dda5bd4160 Jean*0153  echo ' --- genmake2 (ocn):'
b2495a94f0 Jean*0154  ../../../tools/genmake2 -of $OPTFILE -mpi $MTHo $GMKopt >  TTT.genmake.$$ 2>&1
42ba74acb2 Jean*0155  RetVal=$? ; tail -5 TTT.genmake.$$
                0156  if test "x$RetVal" != x0 ; then
                0157    echo "Error in genmake2 (ocn)" ; exit 21
                0158  fi
dda5bd4160 Jean*0159  echo ' --- make depend (ocn):'
b2495a94f0 Jean*0160  make depend > TTT.mkdepend.$$ 2>&1
42ba74acb2 Jean*0161  RetVal=$? ; tail -10 TTT.mkdepend.$$
                0162  if test "x$RetVal" != x0 ; then
                0163    echo "Error in mkdepend (ocn)" ; exit 22
                0164  fi
b6f598c890 Jean*0165  echo ' --- make (ocn):' ; touch TTT.make.$$
                0166 #do_make_syntax.sh obj > TTT.make.$$ 2>&1
                0167  make >> TTT.make.$$ 2>&1
42ba74acb2 Jean*0168  RetVal=$? ; tail -10 TTT.make.$$
                0169  if test "x$RetVal" != x0 ; then
                0170    echo "Error in make     (ocn)" ; exit 23
                0171  fi
a99d705983 Jean*0172  echo ' ' ; cd $curDir
dda5bd4160 Jean*0173 
                0174  echo '==== compile AGCM:'
a3fd9a2edd Jean*0175  cd ${bdPfx}_atm
dda5bd4160 Jean*0176  echo ' --- genmake2 (atm):'
b2495a94f0 Jean*0177  ../../../tools/genmake2 -of $OPTFILE -mpi $MTHa $GMKopt >  TTT.genmake.$$ 2>&1
42ba74acb2 Jean*0178  RetVal=$? ; tail -5 TTT.genmake.$$
                0179  if test "x$RetVal" != x0 ; then
                0180    echo "Error in genmake2 (atm)" ; exit 31
                0181  fi
dda5bd4160 Jean*0182  echo ' --- make depend (atm):'
b2495a94f0 Jean*0183  make depend > TTT.mkdepend.$$ 2>&1
42ba74acb2 Jean*0184  RetVal=$? ; tail -10 TTT.mkdepend.$$
                0185  if test "x$RetVal" != x0 ; then
                0186    echo "Error in mkdepend (atm)" ; exit 32
                0187  fi
b6f598c890 Jean*0188  echo ' --- make (atm):' ; touch TTT.make.$$
                0189 #do_make_syntax.sh obj > TTT.make.$$ 2>&1
                0190  make >> TTT.make.$$ 2>&1
42ba74acb2 Jean*0191  RetVal=$? ; tail -10 TTT.make.$$
                0192  if test "x$RetVal" != x0 ; then
                0193    echo "Error in make     (atm)" ; exit 33
                0194  fi
a99d705983 Jean*0195  echo ' ' ; cd $curDir
dda5bd4160 Jean*0196 
a3fd9a2edd Jean*0197  ls -l ${bdPfx}_???/mitgcmuv
dda5bd4160 Jean*0198 
                0199 fi
                0200 
a99d705983 Jean*0201 if test $kpr = 2 ; then
ab3c9af868 Jean*0202   echo 'rm dir:' rank_? rank_1? rank_2?
                0203   /bin/rm -r -f rank_? rank_1? rank_2?
a99d705983 Jean*0204   n=0 ; inpDr='input_cpl';
                0205   mkdir rank_$n
                0206   ( cd rank_$n
                0207     if test -d ../$inpDr.$sfx ; then
                0208       echo 'Link files from dir:' $inpDr.$sfx '->' rank_$n
                0209       ln -s ../$inpDr.$sfx/* .
                0210     fi
                0211     echo 'Link files from dir:' $inpDr '->' rank_$n
                0212     ln -s ../$inpDr/* .
                0213     if test -x prepare_run ; then ./prepare_run ; fi
                0214   )
ab3c9af868 Jean*0215 
a99d705983 Jean*0216   n=$rnkO ; inpDr='input_ocn';
ab3c9af868 Jean*0217   mkdir rank_$n
a99d705983 Jean*0218   ( cd rank_$n
                0219     if test -d ../$inpDr.$sfx ; then
                0220       echo 'Link files from dir:' $inpDr.$sfx '->' rank_$n
                0221       ln -s ../$inpDr.$sfx/* .
                0222     fi
                0223     echo 'Link files from dir:' $inpDr '->' rank_$n
                0224     ln -s ../$inpDr/* .
                0225     if test -x prepare_run ; then ./prepare_run ; fi
                0226     if test "x$MTHo" != x ; then
                0227       echo " MTH run: mv -f eedata.mth eedata"
                0228       if test -h eedata ; then rm -f eedata ; fi
                0229       mv -f eedata.mth eedata
                0230     fi
                0231   )
ab3c9af868 Jean*0232   n=`expr $n + 1`
                0233   while [ $n -le $NpOc ] ; do
                0234     ln -s rank_$rnkO rank_$n
                0235     n=`expr $n + 1`
                0236   done
                0237 
a99d705983 Jean*0238   n=$rnkA ; inpDr='input_atm';
ab3c9af868 Jean*0239   mkdir rank_$n
a99d705983 Jean*0240   ( cd rank_$n
                0241     if test -d ../$inpDr.$sfx ; then
                0242       echo 'Link files from dir:' $inpDr.$sfx '->' rank_$n
                0243       ln -s ../$inpDr.$sfx/* .
                0244     fi
                0245     echo 'Link files from dir:' $inpDr '->' rank_$n
                0246     ln -s ../$inpDr/* .
                0247     if test -x prepare_run ; then ./prepare_run ; fi
                0248     if test "x$MTHa" != x ; then
                0249       echo " MTH run: mv -f eedata.mth eedata"
                0250       if test -h eedata ; then rm -f eedata ; fi
                0251       mv -f eedata.mth eedata
                0252     fi
                0253   )
ab3c9af868 Jean*0254   n=`expr $n + 1`
                0255   while [ $n -lt $Npr ] ; do
                0256     ln -s rank_$rnkA rank_$n
                0257     n=`expr $n + 1`
                0258   done
dda5bd4160 Jean*0259 
                0260 fi
                0261 
a99d705983 Jean*0262 if test $kpr = 3 ; then
                0263   runDir=$curDir
ab3c9af868 Jean*0264 # rm -f rank_?/pickup*.ckptA.00?.00?.??ta
a99d705983 Jean*0265   echo $runDir
ab3c9af868 Jean*0266   tmpfil=TTT.$$
                0267 
                0268 #--- running on the same node:
                0269   list='' ; nc=0; xx=`hostname`
                0270   while [ $nc -lt $Npr ] ; do list="$list $xx" ; nc=`expr $nc + 1` ; done
                0271 #-- On darwin cluster node (from qrsh session):
                0272 # JOB_ID=`qstat | sed -n '3,$ p' | grep " $USER " | awk '{print $1}'`
                0273 # NODEFILE="/tmp/$JOB_ID.1.darwin/machines"
                0274 # echo " JOB_ID = '$JOB_ID' ; NODEFILE = '$NODEFILE'"
                0275 #-- On ACES cluster (in PBS batch job):
                0276 # NODEFILE=$PBS_NODEFILE
                0277 #--- running on different nodes:
                0278 # ls -l $NODEFILE
                0279 # nprc=`cat $NODEFILE | uniq | wc -l`
                0280 # if [ $nprc -ge $Npr ] ; then
                0281 #   list=`cat $NODEFILE | uniq | head -$Npr`
                0282 # else
                0283 #   list=`cat $NODEFILE | head -$Npr`
                0284 # fi
                0285 
                0286   nc=0; nn=0; dd1=cpl ;
                0287   rm -f pr_group ; touch pr_group
                0288   for xx in $list
                0289   do
a99d705983 Jean*0290     echo $xx $nn $curDir/${bdPfx}_$dd1/mitgcmuv >> pr_group
ab3c9af868 Jean*0291     nc=`expr $nc + 1`
                0292     if [ $nc -le $NpOc ] ; then dd1=ocn ; else dd1=atm ; fi
                0293     nn=1
                0294   done
3b043b9ccf Jean*0295   NpAt=`expr $Npr - 1 - $NpOc`
a3fd9a2edd Jean*0296   RunOpt="-np 1 ./${bdPfx}_cpl/mitgcmuv"
                0297   RunOpt="$RunOpt : -np $NpOc ./${bdPfx}_ocn/mitgcmuv"
                0298   RunOpt="$RunOpt : -np $NpAt ./${bdPfx}_atm/mitgcmuv"
ab3c9af868 Jean*0299 
a99d705983 Jean*0300   cd $runDir
ab3c9af868 Jean*0301   if test "x$MTH" != x ; then
                0302     export OMP_NUM_THREADS=2 ; export KMP_STACKSIZE=400m
                0303     if test "x$MTHo" != x ; then
                0304       echo -n " run OCN ($MTHo) with $OMP_NUM_THREADS threads ;"
                0305     fi
                0306     if test "x$MTHa" != x ; then
                0307       echo -n " run ATM ($MTHa) with $OMP_NUM_THREADS threads ;"
                0308     fi
                0309     echo ""
                0310   fi
3b043b9ccf Jean*0311   mpich=`which mpirun`
                0312   echo $mpich | grep 'mpich-mx' > /dev/null 2>&1
                0313   mpichmx=$?
b6f598c890 Jean*0314   echo $mpich | grep 'mpich-1' > /dev/null 2>&1
                0315   mpich1=$?
3b043b9ccf Jean*0316   echo $mpich | grep 'mpich2' > /dev/null 2>&1
                0317   mpich2=$?
0919079818 Jean*0318   echo $mpich | grep 'openmpi' > /dev/null 2>&1
                0319   opnmpi=$?
b6f598c890 Jean*0320   if test $mpich1 == 0 ; then
a99d705983 Jean*0321   # /usr/local/pkg/mpi/mpi-1.2.4..8a-gm-1.5/pgi/bin/mpirun.ch_gm -pg pr_group -wd $runDir --gm-kill 5 -v  ./${bdPfx}_cpl/mitgcmuv > std_outp 2>&1
b6f598c890 Jean*0322   #- with mpich-1 (on danton, old aces: ao, geo, itrda):
a3fd9a2edd Jean*0323     echo "execute 'mpirun -p4pg pr_group -v ./${bdPfx}_cpl/mitgcmuv' :"
                0324     mpirun -p4pg pr_group -v ./${bdPfx}_cpl/mitgcmuv > std_outp 2>&1
3b043b9ccf Jean*0325   elif test $mpichmx == 0 ; then
                0326   #- with mpich-mx (on beagle):
a3fd9a2edd Jean*0327     echo "execute 'mpirun -pg pr_group -v ./${bdPfx}_cpl/mitgcmuv' :"
                0328     mpirun -pg pr_group -v ./${bdPfx}_cpl/mitgcmuv > std_outp 2>&1
b6f598c890 Jean*0329   elif test $mpich2 == 0 -o $opnmpi == 0 ; then
                0330   #- with Hydra mpich2 (on baudelaire) or with openmpi:
                0331     echo "execute 'mpirun $RunOpt' :"
                0332     mpirun $RunOpt  > std_outp 2>&1
3b043b9ccf Jean*0333   else
b6f598c890 Jean*0334   #- new mpich (mpich2) installation often just put in "mpich" dir
                0335     echo "execute 'mpirun $RunOpt' :"
                0336     mpirun $RunOpt  > std_outp 2>&1
3b043b9ccf Jean*0337   fi
ab3c9af868 Jean*0338   tail -20 std_outp
a99d705983 Jean*0339   ls -l rank_$rnkO/pickup.ckpt?.*data | tail -1
                0340   ls -l rank_$rnkA/pickup.ckpt?.*data | tail -1
dda5bd4160 Jean*0341 
                0342 fi
                0343 
a99d705983 Jean*0344 if test $kpr = 4 ; then
3b043b9ccf Jean*0345  CompRes="$HOME/bin/comp_res"
a99d705983 Jean*0346  if test -x $CompRes ; then
                0347   if test "x$sfx" = x ; then rfx='0000' ; else rfx=$sfx ; fi
dda5bd4160 Jean*0348 
a99d705983 Jean*0349   if test -f rank_$rnkO/STDOUT.0000 ; then
                0350     echo '==> check Ocean output:'
                0351     $CompRes rank_$rnkO/STDOUT.0000 results/ocnSTDOUT.$rfx
ab7ee76107 Jean*0352     mv -f comp_res.log comp_res.ocn
a99d705983 Jean*0353     usePkg=`grep -i '^ *useSEAICE *=' rank_$rnkO/data.pkg | tail -n 1 | grep -i -c '= *\.TRUE\.'`
                0354     if [ $usePkg -ge 1 ] ; then
                0355       echo '==> check Seaice output:'
                0356       $CompRes rank_$rnkO/STDOUT.0000 results/ocnSTDOUT.$rfx S
                0357       mv -f comp_res.log comp_res.icDy
                0358     fi
                0359     usePkg=`grep -i '^ *usePTRACERS *=' rank_$rnkO/data.pkg | tail -n 1 | grep -i -c '= *\.TRUE\.'`
                0360     if [ $usePkg -ge 1 ] ; then
                0361       echo '==> check pTracers output:'
                0362       nTr=`grep -i '^ *PTRACERS_numInUse *=' rank_$rnkO/data.ptracers \
                0363            | tail -n 1 | sed 's/^.*=//' | sed 's/,.*$//'`
                0364       $CompRes rank_$rnkO/STDOUT.0000 results/ocnSTDOUT.$rfx $nTr
                0365       mv -f comp_res.log comp_res.pTr
                0366     fi
ab7ee76107 Jean*0367     echo ' '
a99d705983 Jean*0368   else echo "No Ocean output file in rank_$rnkO" ; fi
dda5bd4160 Jean*0369 
a99d705983 Jean*0370   if test -f rank_$rnkA/STDOUT.0000 ; then
dda5bd4160 Jean*0371     echo '==> check Atmos output:'
a99d705983 Jean*0372     $CompRes rank_$rnkA/STDOUT.0000 results/atmSTDOUT.$rfx
ab7ee76107 Jean*0373     mv -f comp_res.log comp_res.atm
a99d705983 Jean*0374     usePkg=`grep -i '^ *useLand *=' rank_$rnkA/data.pkg | tail -n 1 | grep -i -c '= *\.TRUE\.'`
                0375     if [ $usePkg -ge 1 ] ; then
                0376       echo '==> check Land output:'
                0377       $CompRes rank_$rnkA/STDOUT.0000 results/atmSTDOUT.$rfx L
                0378       mv -f comp_res.log comp_res.land
                0379     fi
                0380     usePkg=`grep -i '^ *useThSIce *=' rank_$rnkA/data.pkg | tail -n 1 | grep -i -c '= *\.TRUE\.'`
                0381     if [ $usePkg -ge 1 ] ; then
                0382       echo '==> check thSIce output:'
                0383       $CompRes rank_$rnkA/STDOUT.0000 results/atmSTDOUT.$rfx I
                0384       mv -f comp_res.log comp_res.icTh
                0385     fi
ab7ee76107 Jean*0386     echo ' '
a99d705983 Jean*0387   else echo "No Atmos output file in rank_$rnkA" ; fi
dda5bd4160 Jean*0388 
a99d705983 Jean*0389   else
                0390     echo "No file '$CompRes' to run ==> skip step: $kpr "
                0391   fi
dda5bd4160 Jean*0392 fi
                0393 
                0394 exit 0