source: trunk/LMDZ.COMMON/libf/evolution/deftank/PEMrun.job @ 3584

Last change on this file since 3584 was 3584, checked in by jbclement, 33 hours ago

PEM:

  • Albedo is now updated only at the end of the PEM (and not at every iteration) + Correct way to set it taking into account CO2/H2O ice and frost.
  • Cosmetic cleanings.

JBC

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash
2#SBATCH --job-name=jobPEM1
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=1
9#SBATCH --cpus-per-task=1
10###SBATCH --exclusive
11#SBATCH --output=jobPEM_%j.out
12#SBATCH --time=24:00:00
13#SBATCH --mem=29000M
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# Name of executable for the PEM:
22exePEM="pem_64x48x32_phymars_seq.e"
23
24# Name of executable for reshaping PCM data with XIOS:
25exeReshape="reshape_XIOS_output_64x48x32_phymars_seq.e"
26
27# Argument for the PEM execution (for SLURM: "$SLURM_JOB_ID" | for PBD/TORQUE: "$PBS_JOBID" | "" when the script is not run as a job):
28arg_pem="$SLURM_JOB_ID"
29########################################################################
30
31
32ulimit -s unlimited
33
34# Reshaping PCM data with XIOS
35echo "Reshaping PCM data with XIOS is starting."
36./$exeReshape
37if [ ! -f "data_PCM_Y1.nc" ] || [ ! -f "data_PCM_Y2.nc" ]; then # Check if it ended abnormally
38    echo "Error: the reshaping executable crashed!"
39    exit 1
40fi
41
42# Running the PEM
43read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
44echo "Run PEM $iPEM is starting."
45cp run_PEM.def run.def
46eval "./$exePEM $arg_pem > out_runPEM${iPEM} 2>&1"
47if [ ! -f "restartfi.nc" ] || ! (tail -n 100 out_runPEM${iPEM} | grep -iq "so far, so good!"); then # Check if it ended abnormally
48    echo "Error: the run PEM $iPEM crashed!"
49    exit 1
50fi
51
52# Copy data files and prepare the next run
53mv out_runPEM${iPEM} out_PEM/run${iPEM}
54if [ -f "diagpem.nc" ]; then
55    mv diagpem.nc diags/diagpem${iPEM}.nc
56fi
57if [ -f "diagsoilpem.nc" ]; then
58    mv diagsoilpem.nc diags/diagsoilpem${iPEM}.nc
59fi
60cp restartpem.nc starts/restartpem${iPEM}.nc
61mv restartpem.nc startpem.nc
62cp restartfi.nc starts/restartfi_postPEM${iPEM}.nc
63mv restartfi.nc startfi.nc
64if [ -f "restart.nc" ]; then
65    cp restart.nc starts/restart_postPEM${iPEM}.nc
66    mv restart.nc start.nc
67elif [ -f "restart1D.txt" ]; then
68    cp restart1D.txt starts/restart1D_postPEM${iPEM}.txt
69    mv restart1D.txt start1D.txt
70fi
71
72# Launch the next cycle
73#if [ "$(awk 'END{print $NF}' info_PEM.txt)" -eq 7 ]; then
74#    read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
75#    ./launchPEM.sh cont # Continue the PEM run if it stopped because of job time limit
76#else
77    ./launchPEM.sh new
78#fi
Note: See TracBrowser for help on using the repository browser.