source: BOL/LMDZ_Setup/reb.sh @ 5422

Last change on this file since 5422 was 5422, checked in by fhourdin, 15 hours ago

Changing $SUBMITCMD to a function submitcmd

Need for local use of LMDZ

File size: 1.8 KB
RevLine 
[4615]1#!/bin/bash
2
3#    ./reb $type $ym $SIM $SIMUDIR
4
5ym=$1
6SIMUDIR=$2
[5415]7SIM=$(basename "$SIMUDIR"); shift 2
[4615]8types="$*"
[5415]9PUT="mv"
[4615]10rebuild=/gpfswork/rech/groupe/rgroupe027/LMDZ20191008.trunkOR3013/modipsl/bin/rebuild
[5415]11local=$(pwd)
[4615]12
[5415]13. lmdz_env.sh
[4615]14
[5415]15echo "type $type"
16echo "ym $ym"
17echo "SIM $SIM"
18echo "SIMUDIR $SIMUDIR"
[4615]19
[5415]20for type in $types; do
21  job=$SIM$type
[4615]22
[5415]23  cat <<eod >| "$job"
24#!/bin/bash
25## Headers managed by sed
26#@JZ#JeanZay
27#@JZ#SBATCH --job-name=Seq              # nom du job
28#@JZ#SBATCH --nodes=1                   # nombre de noeuds
29#@JZ#SBATCH --ntasks-per-node=1         # nombre de taches MPI par noeud
30#@JZ#SBATCH --time=00:59:00             # temps d execution maximum demande (HH:MM:SS)
31#@JZ#SBATCH --output=post${type}%j.out  # nom du fichier de sortie
32#@JZ#SBATCH --error=post${type}%j.out   # nom du fichier d'erreur (ici en commun avec la sortie)
33#@SP#Spirit
34#@SP#SBATCH --job-name=Seq
35#@SP#SBATCH --nodes=1
36#@SP#SBATCH --ntasks-per-node=1
37#@SP#SBATCH --time=00:59:00
38#@SP#SBATCH --output=post${type}%j.out
39#@SP#SBATCH --error=post${type}%j.out
40#@ADS#Adastra
41#@ADS#SBATCH --job-name=Seq
42#@ADS#SBATCH --nodes=1
43#@ADS#SBATCH --ntasks-per-node=1
44#@ADS#SBATCH --time=00:59:00
45#@ADS#SBATCH --output=post${type}%j.out
46#@ADS#SBATCH --error=post${type}%j.out
[4615]47
48# on se place dans le repertoire de soumission
49cd $local
50pwd
51
52. lmdz_env.sh
53
54ulimit -s unlimited
[5415]55if [[ -f ${type}_0000.nc ]]; then
[5422]56  $RUNBASHCMD $rebuild -o ${type}.$ym.nc ${type}_[0-9][0-9][0-9][0-9].nc
[5415]57else
58  echo "${type}_0000.nc absent"
59fi
60if [[ -f $type.$ym.nc ]]; then
61   ${PUT} $type.$ym.nc ${SIMUDIR}/$type.$ym.nc
62   rm -f ${type}_[0-9][0-9][0-9][0-9].nc
63else
64   echo "La reconstruction de $type.$ym.nc a echoué"
65fi
[4615]66eod
67
[5422]68  #echo "Submitting the rebuild job $job using <$SUBMITCMD \"$job\">"
69  #$SUBMITCMD "$job"
70  echo "Submitting the rebuild job $job using <submitcmd \"$job\">"
71  submitcmd "$job"
[4615]72done
Note: See TracBrowser for help on using the repository browser.