1 | #!/bin/bash |
---|
2 | # |
---|
3 | #SBATCH -J SEICHE |
---|
4 | #SBATCH -o SEICHE.%j.out |
---|
5 | #SBATCH -e SEICHE.%j.err |
---|
6 | #SBATCH -N 1 |
---|
7 | #SBATCH -p mono |
---|
8 | #SBATCH --ntasks-per-node:32 |
---|
9 | #SBATCH --time=00:20:00 |
---|
10 | #SBATCH --exclusive |
---|
11 | #SBATCH -x node-07 |
---|
12 | # |
---|
13 | # |
---|
14 | OCEANCORES=30 |
---|
15 | XIOCORES=2 |
---|
16 | # |
---|
17 | ############################################################### |
---|
18 | export MPIRUN="mpirun -np $OCEANCORES" |
---|
19 | export RUN_DIR=/data/rd_exchange/jchanut/dev_r14318_RK3_stage1_tsplit/tests/SEICHE |
---|
20 | export TOOL_DIR=/data/rd_exchange/jchanut/dev_r14318_RK3_stage1_tsplit/tools |
---|
21 | #export RUN_DIR="$(dirname "$(pwd)")" |
---|
22 | export EXE_DIR=/kara/data1/jchanut/SEICHE |
---|
23 | ############################################################### |
---|
24 | # |
---|
25 | # change to the working directory |
---|
26 | # |
---|
27 | cd ${EXE_DIR} |
---|
28 | cp ${RUN_DIR}/EXPREF/*.xml . |
---|
29 | cp ${RUN_DIR}/EXPREF/namelist_ref . |
---|
30 | cp ${RUN_DIR}/EXPREF/namelist_cfg_skel_marsaleix ./namelist_cfg_skel |
---|
31 | cp ${RUN_DIR}/BLD/bin/nemo.exe . |
---|
32 | cp ${XIOS_BIN}/xios_server.exe . |
---|
33 | cp ${TOOL_DIR}/REBUILD_NEMO/rebuild_nemo . |
---|
34 | cp ${TOOL_DIR}/REBUILD_NEMO/rebuild_nemo.exe . |
---|
35 | # |
---|
36 | #ntest=0: test time convergence ; =1: spatial convergence ; =2: both at constant courant number |
---|
37 | #ntest=-1: is a sanity check with constant barotropic time step and varying baroclinic time step |
---|
38 | ntest=-1 |
---|
39 | exp_base='SEICHE_mar_rk3_dt' |
---|
40 | rdt_base=960 |
---|
41 | nbaro_base=112 |
---|
42 | nstep_base=1080 |
---|
43 | npts_base=1600 |
---|
44 | nlev_base=30 |
---|
45 | atfp_base=0.1 |
---|
46 | btav='.false.' |
---|
47 | btfw='.true.' |
---|
48 | ralpha_base=0.07 # = 0.5*theta |
---|
49 | nexp=5 |
---|
50 | for (( i=1; i<=$nexp; i++)) |
---|
51 | do |
---|
52 | rdt=$rdt_base |
---|
53 | nstep=$nstep_base |
---|
54 | npts=$npts_base |
---|
55 | nlev=$nlev_base |
---|
56 | nbaro=$nbaro_base |
---|
57 | atfp=$atfp_base |
---|
58 | ralpha=$ralpha_base |
---|
59 | exp=$exp_base'_'$i |
---|
60 | if [[ $ntest -eq 0 || $ntest -eq 2 || $ntest -eq -1 ]] ; then |
---|
61 | # Temporal convergence |
---|
62 | for (( j=1; j<$i; j++)) do rdt=` expr $rdt / 2 `; done |
---|
63 | for (( j=1; j<$i; j++)) do nstep=` expr $nstep \\* 2 `; done |
---|
64 | elif [[ $ntest -eq 1 ]] ; then |
---|
65 | # Spatial convergence only: |
---|
66 | # smallest time step: |
---|
67 | for (( j=1; j<$nexp; j++)) do rdt=` expr $rdt / 2 `; done |
---|
68 | for (( j=1; j<$nexp; j++)) do nstep=` expr $nstep \\* 2 `; done |
---|
69 | fi |
---|
70 | if [[ $ntest -eq 1 || $ntest -eq 2 ]] ; then |
---|
71 | # With spatial and temporal convergence: |
---|
72 | for (( j=1; j<$i; j++)) do npts=` expr $npts \\* 2 `; done |
---|
73 | fi |
---|
74 | if [[ $ntest -eq -1 ]] ; then |
---|
75 | # This is a verification test: whatever the baroclinic time step is |
---|
76 | # number of barotropic iterations is modified accordingly |
---|
77 | # such that barotropic time step is constant. If no time averaging in the |
---|
78 | # barotropic mode, the solution should basically be unchanged |
---|
79 | for (( j=1; j<$i; j++)) do nbaro=` expr $nbaro / 2 `; done |
---|
80 | fi |
---|
81 | if [[ $ntest -eq 3 ]] ; then |
---|
82 | # With spatial and temporal convergence: |
---|
83 | for (( j=1; j<$i; j++)) do nlev=` expr $nlev \\* 2 `; done |
---|
84 | fi |
---|
85 | sed -e "s/EXPNAME/'$exp'/" \ |
---|
86 | -e "s/RDT/${rdt}/" \ |
---|
87 | -e "s/NPTS/${npts}/" \ |
---|
88 | -e "s/NLEV/${nlev}/" \ |
---|
89 | -e "s/NSTEP/${nstep}/" \ |
---|
90 | -e "s/NBARO/$nbaro/" \ |
---|
91 | -e "s/RALPHA/$ralpha/" \ |
---|
92 | -e "s/BTAV/$btav/" \ |
---|
93 | -e "s/BTFW/$btfw/" \ |
---|
94 | -e "s/ASS/$atfp/" namelist_cfg_skel > namelist_cfg |
---|
95 | time mpirun -bynode -np $OCEANCORES ./nemo.exe : -np $XIOCORES ./xios_server.exe |
---|
96 | mv run.stat.nc ${i}_run.stat.nc |
---|
97 | mv run.stat ${i}_run.stat |
---|
98 | mv ocean.output ${i}_ocean.output |
---|
99 | stepout=`printf "%08d\n" $nstep` |
---|
100 | ./rebuild_nemo ${exp}_${stepout}_restart $OCEANCORES |
---|
101 | rm -rf ${exp}_${stepout}_restart_* |
---|
102 | rm nam_rebuild* |
---|
103 | mv ${exp}_${stepout}_restart.nc ${exp}_restart.nc |
---|
104 | done |
---|
105 | # |
---|
106 | exit |
---|