source: trunk/LMDZ.COMMON/libf/evolution/deftank/PCMrun.job @ 3563

Last change on this file since 3563 was 3556, checked in by jbclement, 5 weeks ago

PEM:
As intended, years computed by the PEM runs are now the only ones to be counted for the duration of the PEM simulation. The possibility to count in addition years computed by the PCM runs is left as an option of "launchPEM.sh" with the variable 'counting' (0 = "only PEM runs count"; any other values = "PCM runs are taken into account") + several small corrections/improvements in the launching scripts.
JBC

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2#SBATCH --job-name=jobPCM0
3#SBATCH --account=cin0391
4### GENOA nodes accommodate 96 cores
5#SBATCH --constraint=GENOA
6### Number of Nodes to use
7#SBATCH --nodes=1
8#SBATCH --ntasks-per-node=24
9#SBATCH --cpus-per-task=4
10#SBATCH --threads-per-core=1 # --hint=nomultithread
11###SBATCH --exclusive
12#SBATCH --output=jobPCM_%j.out
13#SBATCH --time=10:00:00
14
15# A few parameters that might need to be changed depending on your setup
16# Path to the arch.env to source:
17source ../trunk/LMDZ.COMMON/arch.env
18
19# Number of threads to use (must be the same as "#SBATCH --cpus-per-task=" above)
20export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
21export OMP_STACKSIZE=400M
22
23# Name of executable for the PCM:
24exePCM="gcm_64x48x32_phymars_para.e"
25
26# Execution command:
27exe_cmd="srun --cpu-bind=threads --label -c${OMP_NUM_THREADS:=1} $exePCM"
28########################################################################
29
30
31ulimit -s unlimited
32
33# Running the PCM
34read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
35echo "Run PCM $iPCM is starting."
36cp run_PCM.def run.def
37eval "$exe_cmd > out_runPCM${iPCM} 2>&1"
38if [ ! -f "restartfi.nc" ] || ! (tail -n 100 out_runPCM${iPCM} | grep -iq "everything is cool!"); then # Check if it ended abnormally
39    echo "Error: the run PCM $iPCM crashed!"
40    if [ $mode -ne 0 ]; then
41        echo "Be careful: there may be dependent jobs remaining in the SLURM queue with status 'DependencyNeverSatisfied'! You can cancel them by executing the script \"kill_launchPEM.sh\"."
42    fi
43    exit 1
44fi
45
46# Copy data files and prepare the next run
47mv out_runPCM${iPCM} out_PCM/run${iPCM}
48if [ -f "diagfi.nc" ]; then
49    mv diagfi.nc diags/diagfi${iPCM}.nc
50fi
51if [ -f "diagsoil.nc" ]; then
52    mv diagsoil.nc diags/diagsoil${iPCM}.nc
53fi
54if [ -f "stats.nc" ]; then
55    mv stats.nc diags/stats${iPCM}.nc
56fi
57k=0
58if [ $(echo "$k < 1" | bc -l) -eq 1 ]; then # Only the last 2 years are taken for the PEM
59    mv Xdiurnalave.nc diags/data2reshape${iPCM}.nc
60else
61    cp Xdiurnalave.nc diags/data2reshape${iPCM}.nc
62    mv Xdiurnalave.nc data2reshape_Y${k}.nc
63fi
64cp restartfi.nc starts/restartfi${iPCM}.nc
65mv restartfi.nc startfi.nc
66if [ -f "restart.nc" ]; then
67    cp restart.nc starts/restart${iPCM}.nc
68    mv restart.nc start.nc
69elif [ -f "restart1D.txt" ]; then
70    cp restart1D.txt starts/restart1D${iPCM}.txt
71    mv restart1D.txt start1D.txt
72fi
73((iPCM++))
74if [ $counting -ne 0 ]; then
75    i_myear=$(echo "$i_myear + 1." | bc -l)
76fi
77sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
Note: See TracBrowser for help on using the repository browser.