source: trunk/LMDZ.COMMON/libf/evolution/deftank/pem_run.job @ 4134

Last change on this file since 4134 was 4110, checked in by jbclement, 3 weeks ago

PEM:

  • Introduction of a configurable display/logging system with options 'out2term', 'out2log', 'verbosity_lvl'. All messages now use verbosity levels ('LVL_NFO', 'LVL_WRN', 'LVL_ERR' and 'LVL_DBG').
  • Code encapsulation improvements with systematic privacy/protection of module variables.
  • Addition of workflow safety checks for required executables, dependencies (e.g. 'ncdump'), input files and callphys keys.
  • Renaming of PEM starting and diagnostic files ("startevol.nc" into "startevo.nc", "diagevol.nc" into "diagevo.nc").

JBC

  • Property svn:executable set to *
File size: 2.4 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=1
8#SBATCH --cpus-per-task=1
9#SBATCH --threads-per-core=1 # --hint=nomultithread
10### Job information
11#SBATCH --job-name=jobPEM1
12#SBATCH --output=jobPEM_%j.out
13#SBATCH --time=24:00:00
14#SBATCH --mem=64G
15
16########################################################################
17# Modify here the parameters depending on your setup
18####################################################
19# Path to the arch.env to source:
20source ../trunk/LMDZ.COMMON/arch.env
21
22# Name of executable for the PEM:
23pem_exe="pem_64x48x32_phymars_seq.e"
24
25# Argument for the PEM execution ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job):
26pem_arg="--auto-exit"
27########################################################################
28
29
30ulimit -s unlimited
31
32# Checking the executable
33if [ ! -f $pem_exe ]; then
34    echo "Error: required file \"$pem_exe\" not found!"
35    exit 1
36fi
37
38# Running the PEM
39read 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
40echo "Run \"PEM $i_pem_run\" is starting."
41cp run_pem.def run.def
42eval "./$pem_exe $pem_arg > run.log 2>&1"
43if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "so far, so good!"); then # Check if it ended abnormally
44    echo "Error: the run \"PEM $i_pem_run\" crashed!"
45    exit 1
46fi
47
48# Copy data files and prepare the next run
49mv run.log logs/run_pem${i_pem_run}.log
50if [ -f "diagevo.nc" ]; then
51    mv diagevo.nc diags/diagevo${i_pem_run}.nc
52fi
53if [ -f "diagevo_soil.nc" ]; then
54    mv diagevo_soil.nc diags/diagevo_soil${i_pem_run}.nc
55fi
56cp restartevo.nc starts/restartevo${i_pem_run}.nc
57mv restartevo.nc startevo.nc
58cp restartfi.nc starts/restartfi_postpem${i_pem_run}.nc
59mv restartfi.nc startfi.nc
60if [ -f "restart.nc" ]; then
61    cp restart.nc starts/restart_postpem${i_pem_run}.nc
62    mv restart.nc start.nc
63elif [ -f "restart1D.txt" ]; then
64    cp restart1D.txt starts/restart1D_postpem${i_pem_run}.txt
65    mv restart1D.txt start1D.txt
66fi
67
68# Submit the next cycle
69#if [ "$(awk 'END{print $NF}' pem_workflow.sts)" -eq 7 ]; then
70#    read 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
71#    ./pem_workflow.sh cont # Continue the PEM run if it stopped because of job time limit
72#else
73    ./pem_workflow.sh new
74#fi
Note: See TracBrowser for help on using the repository browser.