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

Last change on this file since 4091 was 4091, checked in by jbclement, 6 days ago

PEM:
Small corrections in the scripts.
JBC

  • Property svn:executable set to *
File size: 2.3 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# Running the PEM
33read 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
34echo "Run \"PEM $i_pem_run\" is starting."
35cp run_pem.def run.def
36eval "./$pem_exe $pem_arg > run.log 2>&1"
37if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "so far, so good!"); then # Check if it ended abnormally
38    echo "Error: the run \"PEM $i_pem_run\" crashed!"
39    exit 1
40fi
41
42# Copy data files and prepare the next run
43mv run.log logs/run_pem${i_pem_run}.log
44if [ -f "diagevol.nc" ]; then
45    mv diagevol.nc diags/diagevol${i_pem_run}.nc
46fi
47if [ -f "diagevol_soil.nc" ]; then
48    mv diagevol_soil.nc diags/diagevol_soil${i_pem_run}.nc
49fi
50cp restartevol.nc starts/restartevol${i_pem_run}.nc
51mv restartevol.nc startevol.nc
52cp restartfi.nc starts/restartfi_postpem${i_pem_run}.nc
53mv restartfi.nc startfi.nc
54if [ -f "restart.nc" ]; then
55    cp restart.nc starts/restart_postpem${i_pem_run}.nc
56    mv restart.nc start.nc
57elif [ -f "restart1D.txt" ]; then
58    cp restart1D.txt starts/restart1D_postpem${i_pem_run}.txt
59    mv restart1D.txt start1D.txt
60fi
61
62# Submit the next cycle
63#if [ "$(awk 'END{print $NF}' pem_workflow.sts)" -eq 7 ]; then
64#    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
65#    ./pem_workflow.sh cont # Continue the PEM run if it stopped because of job time limit
66#else
67    ./pem_workflow.sh new
68#fi
Note: See TracBrowser for help on using the repository browser.