[2877] | 1 | #!/bin/bash |
---|
| 2 | #SBATCH --partition=zen4 |
---|
| 3 | #SBATCH --ntasks=24 |
---|
| 4 | #SBATCH --time=02:00:00 |
---|
[1436] | 5 | |
---|
[2877] | 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 | |
---|
[2499] | 17 | ######################################################## |
---|
[2877] | 18 | ## standard run 121x121x61 nodes=1:ppn=4,mem=4gb,vmem=6gb |
---|
[2499] | 19 | ######################################################## |
---|
[2877] | 20 | ### large-domain run 321x321x61 (OK but slower) nodes=1:ppn=16,mem=16gb,vmem=24gb |
---|
[2499] | 21 | ######################################################## |
---|
[2877] | 22 | ### large-domain run 321x321x61 nodes=1:ppn=32,mem=32gb,vmem=48gb |
---|
[2499] | 23 | ######################################################## |
---|
[1434] | 24 | |
---|
[2877] | 25 | |
---|
| 26 | |
---|
| 27 | step=1 |
---|
| 28 | fold=$PWD |
---|
| 29 | |
---|
[1434] | 30 | #### PREAMBLE |
---|
| 31 | ulimit -s unlimited |
---|
| 32 | |
---|
| 33 | #### STEP 1 |
---|
[1436] | 34 | if [[ ${step} -le 1 ]] ; then |
---|
[2877] | 35 | cd $fold/gcm |
---|
[1436] | 36 | # |
---|
[2499] | 37 | ./get_startday_from_namelist.sh | ./launch_gcm |
---|
[1436] | 38 | # |
---|
[2877] | 39 | if [[ $SLURM_NTASKS -gt 24 ]] ; then |
---|
[2499] | 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 |
---|
[1436] | 47 | # |
---|
[2877] | 48 | cd $fold/prep |
---|
[1436] | 49 | echo 1 | create_readmeteo.exe |
---|
| 50 | readmeteo.exe < readmeteo.def |
---|
| 51 | fi |
---|
[1434] | 52 | |
---|
[2877] | 53 | stop |
---|
| 54 | |
---|
[1436] | 55 | ##### STEP 2 |
---|
| 56 | if [[ ${step} -le 2 ]] ; then |
---|
[2877] | 57 | cd $fold/geogrid |
---|
[1439] | 58 | \rm geo_em.* |
---|
[1436] | 59 | geogrid.exe |
---|
| 60 | # |
---|
[2877] | 61 | cd $fold/metgrid |
---|
[1439] | 62 | \rm met_em.* |
---|
[1436] | 63 | metgrid.exe |
---|
| 64 | fi |
---|
[1434] | 65 | |
---|
[1436] | 66 | ##### STEP 3 |
---|
| 67 | if [[ ${step} -le 3 ]] ; then |
---|
[2877] | 68 | cd $fold/ |
---|
[1439] | 69 | \rm wrfi* wrfb* |
---|
[1436] | 70 | real.exe |
---|
| 71 | fi |
---|
[1434] | 72 | |
---|
[1436] | 73 | ##### STEP 4 |
---|
| 74 | if [[ ${step} -le 4 ]] ; then |
---|
[2877] | 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 ./ |
---|
[1552] | 87 | $WHERE_MPI/mpirun wrf.exe |
---|
[2493] | 88 | #gdb wrf.exe -ex=run |
---|
[1436] | 89 | fi |
---|