source: trunk/LMDZ.COMMON/libf/evolution/deftank/pcm_run.job @ 4174

Last change on this file since 4174 was 4152, checked in by jbclement, 3 weeks ago

PEM:

  • Fix outputs "diagevo.nc" for 3D data.
  • Fix sign in computing exchanges due to adsorption/ice table and in balancing H2O flux from/into atmosphere.
  • Few cleanings.

JBC

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/bash
2### Partition to use
3#SBATCH --account=cin0391
4#SBATCH --constraint=GENOA
5### Number of nodes/cores to use
6#SBATCH --nodes=1
7#SBATCH --ntasks-per-node=24
8#SBATCH --cpus-per-task=8
9#SBATCH --threads-per-core=1 # --hint=nomultithread
10### Job information
11#SBATCH --job-name=jobPCM0
12#SBATCH --output=jobPCM_%j.out
13#SBATCH --time=4:00:00
14
15########################################################################
16# Modify here the parameters depending on your setup
17####################################################
18# Path to the arch.env to source:
19source ../trunk/LMDZ.COMMON/arch.env
20
21# Number of threads to use (must be the same as "#SBATCH --cpus-per-task=" above)
22export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
23export OMP_STACKSIZE=400M
24
25# Name of executable for the PCM:
26pcm_exe="gcm_64x48x32_phymars_para.e"
27
28# Execution command:
29exec_cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$pcm_exe"
30########################################################################
31
32
33ulimit -s unlimited
34
35# Checking the executable
36if [ ! -f $pcm_exe ]; then
37    echo "Error: required file \"$pcm_exe\" not found!"
38    exit 1
39fi
40
41# Running the PCM
42read n_yr_sim ntot_yr_sim r_plnt2earth_yr i_pcm_run i_pem_run n_pcm_runs n_pcm_runs_ini < pem_workflow.sts
43echo "Run \"PCM $i_pcm_run\" is starting."
44cp run_pcm.def run.def
45eval "$exec_cmd > run.log 2>&1"
46if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally
47    echo "Error: the run \"PCM $i_pcm_run\" crashed!"
48    if [ $exec_mode -ne 0 ]; then
49        echo "Be careful: there may be dependent jobs remaining in the queue! You can cancel them by executing the script \"kill_pem_workflow.sh\"."
50    fi
51    exit 1
52fi
53
54# Copy data files and prepare the next run
55mv run.log logs/run_pcm${i_pcm_run}.log
56if [ -f "diagfi.nc" ]; then
57    mv diagfi.nc diags/diagfi${i_pcm_run}.nc
58fi
59if [ -f "diagsoil.nc" ]; then
60    mv diagsoil.nc diags/diagsoil${i_pcm_run}.nc
61fi
62if [ -f "stats.nc" ]; then
63    mv stats.nc diags/stats${i_pcm_run}.nc
64fi
65k=0
66if [ $(echo "$k > 0" | bc) -eq 1 ]; then # Only the last 2 years are taken for the PEM
67    cp xoutdaily4pem.nc xoutdaily4pem_y${k}.nc
68    cp xoutyearly4pem.nc xoutyearly4pem_y${k}.nc
69fi
70mv xoutdaily4pem.nc diags/xoutdaily4pem${i_pcm_run}.nc
71mv xoutyearly4pem.nc diags/xoutyearly4pem${i_pcm_run}.nc
72cp restartfi.nc starts/restartfi${i_pcm_run}.nc
73mv restartfi.nc startfi.nc
74if [ -f "restart.nc" ]; then
75    cp restart.nc starts/restart${i_pcm_run}.nc
76    mv restart.nc start.nc
77elif [ -f "restart1D.txt" ]; then
78    cp restart1D.txt starts/restart1D${i_pcm_run}.txt
79    mv restart1D.txt start1D.txt
80fi
81((i_pcm_run++))
82sed -i "1s/.*/$n_yr_sim $ntot_yr_sim $r_plnt2earth_yr $i_pcm_run $i_pem_run $n_pcm_runs $n_pcm_runs_ini/" pem_workflow.sts
Note: See TracBrowser for help on using the repository browser.