source: utils/CI/sette_r14244_crayftn_877/BATCH_TEMPLATE/batch-XC40_METO @ 14710

Last change on this file since 14710 was 14710, checked in by andmirek, 5 months ago

Ticket #2655 changes in batch script to add comma ater logical

File size: 2.8 KB
Line 
1#/bin/bash
2#!
3#PBS -N nemo_sette
4#PBS -l walltime=00:30:00
5#PBS -j oe
6#PBS -q normal
7#PBS -V
8#PBS -l SELECT
9
10  export PBS_O_WORKDIR=$(readlink -f $PBS_O_WORKDIR)
11  export OMP_NUM_THREADS=1
12  cd $PBS_O_WORKDIR
13  export XIO_HOME=$xios_path
14#
15  echo " ";
16  export OMP_NUM_THREADS=1
17  O_PER_NODE=32
18  X_PER_NODE=4
19  OCORES=NPROCS
20  XCORES=NXIOPROCS
21  if [ $OCORES -le 32 ] ; then O_PER_NODE=$OCORES; fi
22  export SETTE_DIR=DEF_SETTE_DIR
23
24###############################################################
25#
26#
27# load sette functions (only post_test_tidyup needed)
28#
29  . ${SETTE_DIR}/all_functions.sh
30###############################################################
31#
32# Don't remove neither change the following line
33# BODY
34#
35# Test specific settings. Do not hand edit these lines; the fcm_job.sh script will set these
36# (via sed operating on this template job file). Note that the number of compute nodes required
37# is also set by the fcm_job.sh on the PBS select header line above.
38#
39# These variables are needed by post_test_tidyup function in all_functions.sh
40#
41  export INPUT_DIR=DEF_INPUT_DIR
42  export CONFIG_DIR=DEF_CONFIG_DIR
43  export TOOLS_DIR=DEF_TOOLS_DIR
44  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION
45  export NEW_CONF=DEF_NEW_CONF
46  export CMP_NAM=DEF_CMP_NAM
47  export TEST_NAME=DEF_TEST_NAME
48  export EXE_DIR=DEF_EXE_DIR
49  ulimit -c unlimited
50  ulimit -s unlimited
51  export FORT_FMT_RECL=132
52#
53# end of set up
54###############################################################
55#
56# change to the working directory
57#
58  cd $EXE_DIR
59
60#add comma after logical
61for nml in `find ./ -name '*namelist_*'`
62do
63chk=$(grep -c -i -e"= *.false.," -e"= *.true.," $nml)
64if test $chk -eq 0 ; then
65echo "Changing : "$nml
66ed - $nml << EOF
67%s/=\( *\).false./=\1.false.,/
68w
69q
70EOF
71ed - $nml << EOF
72%s/=\( *\).FALSE./=\1.FALSE.,/
73w
74q
75EOF
76ed - $nml << EOF
77%s/=\( *\).true./=\1.true.,/
78w
79q
80EOF
81ed - $nml << EOF
82%s/=\( *\).TRUE./=\1.TRUE.,/
83w
84q
85EOF
86else
87echo $nml " may have already been processed: "$chk" lines already correct"
88fi
89done
90#end add comma after logical
91  echo Directory is `pwd`
92 
93  if [ $XCORES -gt 0 ]; then
94#
95#  Run MPMD case
96#
97     #XIOS will run on a separate node so will run in parallel queue
98     if [ ! -f ./xios_server.exe ] && [ -f ${XIO_HOME}/bin/xios_server.exe ]; then
99        cp ${XIO_HOME}/bin/xios_server.exe .
100     fi
101     if [ ! -f ./xios_server.exe ]; then
102        echo "./xios_server.exe not found"
103        echo "run aborted"
104        exit
105     fi
106       echo time aprun -b -n $XCORES -N $X_PER_NODE ./xios_server.exe : -n $OCORES -N $O_PER_NODE ./nemo
107            time aprun -b -n $XCORES -N $X_PER_NODE ./xios_server.exe : -n $OCORES -N $O_PER_NODE ./nemo
108#
109  else
110#
111# Run SPMD case
112#
113    echo time aprun -b  -n $OCORES -N $O_PER_NODE ./nemo
114         time aprun -b  -n $OCORES -N $O_PER_NODE ./nemo
115  fi
116#
117
118#
119  post_test_tidyup
120# END_BODY
121# Don't remove neither change the previous line
122  exit
123
Note: See TracBrowser for help on using the repository browser.