1 | #!/bin/bash |
---|
2 | #SBATCH --partition=zen4 |
---|
3 | #SBATCH --ntasks=24 |
---|
4 | #SBATCH --time=02:00:00 |
---|
5 | |
---|
6 | # job information |
---|
7 | cat << EOF |
---|
8 | ------------------------------------------------------------------ |
---|
9 | Job submit on $SLURM_SUBMIT_HOST by $SLURM_JOB_USER |
---|
10 | JobID=$SLURM_JOBID Running_Node=$SLURM_NODELIST |
---|
11 | Node=$SLURM_JOB_NUM_NODES Task=$SLURM_NTASKS |
---|
12 | ------------------------------------------------------------------ |
---|
13 | EOF |
---|
14 | # Begin of section with executable commands |
---|
15 | |
---|
16 | |
---|
17 | ######################################################## |
---|
18 | ## standard run 121x121x61 nodes=1:ppn=4,mem=4gb,vmem=6gb |
---|
19 | ######################################################## |
---|
20 | ### large-domain run 321x321x61 (OK but slower) nodes=1:ppn=16,mem=16gb,vmem=24gb |
---|
21 | ######################################################## |
---|
22 | ### large-domain run 321x321x61 nodes=1:ppn=32,mem=32gb,vmem=48gb |
---|
23 | ######################################################## |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | step=1 |
---|
28 | fold=$PWD |
---|
29 | |
---|
30 | #### PREAMBLE |
---|
31 | ulimit -s unlimited |
---|
32 | |
---|
33 | #### STEP 1 |
---|
34 | if [[ ${step} -le 1 ]] ; then |
---|
35 | cd $fold/gcm |
---|
36 | # |
---|
37 | ./get_startday_from_namelist.sh | ./launch_gcm |
---|
38 | # |
---|
39 | if [[ $SLURM_NTASKS -gt 24 ]] ; then |
---|
40 | echo "--- Total CPU count is above 24" |
---|
41 | echo "--- For the standard GCM resolution, this is too much" |
---|
42 | echo "--- So we run the GCM only with 24 processors" |
---|
43 | $WHERE_MPI/mpirun -np 24 gcm.e > log_gcm |
---|
44 | else |
---|
45 | $WHERE_MPI/mpirun gcm.e > log_gcm |
---|
46 | fi |
---|
47 | # |
---|
48 | cd $fold/prep |
---|
49 | echo 1 | create_readmeteo.exe |
---|
50 | readmeteo.exe < readmeteo.def |
---|
51 | fi |
---|
52 | |
---|
53 | stop |
---|
54 | |
---|
55 | ##### STEP 2 |
---|
56 | if [[ ${step} -le 2 ]] ; then |
---|
57 | cd $fold/geogrid |
---|
58 | \rm geo_em.* |
---|
59 | geogrid.exe |
---|
60 | # |
---|
61 | cd $fold/metgrid |
---|
62 | \rm met_em.* |
---|
63 | metgrid.exe |
---|
64 | fi |
---|
65 | |
---|
66 | ##### STEP 3 |
---|
67 | if [[ ${step} -le 3 ]] ; then |
---|
68 | cd $fold/ |
---|
69 | \rm wrfi* wrfb* |
---|
70 | real.exe |
---|
71 | fi |
---|
72 | |
---|
73 | ##### STEP 4 |
---|
74 | if [[ ${step} -le 4 ]] ; then |
---|
75 | rm -rf $fold/run_$SLURM_JOBID |
---|
76 | mkdir $fold/run_$SLURM_JOBID |
---|
77 | mv rsl.error.0000 $fold/run_$SLURM_JOBID/real_rsl.error.0000 |
---|
78 | mv rsl.out.0000 $fold/run_$SLURM_JOBID/real_rsl.out.0000 |
---|
79 | cp -rfL $fold/*.def $fold/run_$SLURM_JOBID/ |
---|
80 | cp -rfL $fold/wrf.exe* $fold/run_$SLURM_JOBID/ |
---|
81 | cp -rfL $fold/namelist.input $fold/run_$SLURM_JOBID/ |
---|
82 | cp -rfL $fold/namelist.wps $fold/run_$SLURM_JOBID/ |
---|
83 | cp -rfL $fold/wrfi* $fold/run_$SLURM_JOBID/ |
---|
84 | cp -rfL $fold/wrfb* $fold/run_$SLURM_JOBID/ |
---|
85 | cd $fold/run_$SLURM_JOBID/ |
---|
86 | ln -sf $fold/data_physics ./ |
---|
87 | $WHERE_MPI/mpirun wrf.exe |
---|
88 | #gdb wrf.exe -ex=run |
---|
89 | fi |
---|