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