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

Last change on this file since 3603 was 3584, checked in by jbclement, 4 weeks 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
RevLine 
[3349]1#!/bin/bash
[3351]2#SBATCH --job-name=jobPEM1
[3349]3#SBATCH --account=cin0391
4### GENOA nodes accommodate 96 cores
5#SBATCH --constraint=GENOA
6### Number of Nodes to use
[3417]7#SBATCH --nodes=1
[3416]8#SBATCH --ntasks=1
[3417]9#SBATCH --cpus-per-task=1
[3349]10###SBATCH --exclusive
[3403]11#SBATCH --output=jobPEM_%j.out
[3351]12#SBATCH --time=24:00:00
[3416]13#SBATCH --mem=29000M
[3349]14
[3579]15########################################################################
16# Modify here the parameters depending on your setup
17####################################################
[3351]18# Path to the arch.env to source:
[3349]19source ../trunk/LMDZ.COMMON/arch.env
20
[3351]21# Name of executable for the PEM:
22exePEM="pem_64x48x32_phymars_seq.e"
[3349]23
[3351]24# Name of executable for reshaping PCM data with XIOS:
25exeReshape="reshape_XIOS_output_64x48x32_phymars_seq.e"
[3495]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"
[3349]29########################################################################
30
[3351]31
[3403]32ulimit -s unlimited
33
[3354]34# Reshaping PCM data with XIOS
[3351]35echo "Reshaping PCM data with XIOS is starting."
36./$exeReshape
[3349]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
[3351]41
[3354]42# Running the PEM
[3416]43read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
[3349]44echo "Run PEM $iPEM is starting."
[3351]45cp run_PEM.def run.def
[3495]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
[3349]48    echo "Error: the run PEM $iPEM crashed!"
49    exit 1
50fi
[3354]51
[3349]52# Copy data files and prepare the next run
53mv out_runPEM${iPEM} out_PEM/run${iPEM}
[3386]54if [ -f "diagpem.nc" ]; then
55    mv diagpem.nc diags/diagpem${iPEM}.nc
56fi
[3349]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
[3363]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.