source: TOOLS/PACK_IPSL/launch_ipsl_enlarge.sh @ 1839

Last change on this file since 1839 was 1839, checked in by acosce, 12 years ago

BugFix? when we try to find variables to exclude of ncrcat.
For example before "Point Omega" was find as a integer variable

  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#!/bin/bash
2######################
3## TITANE   CEA ##
4######################
5#MSUB -r ipsl_pack      # Nom du job               
6#MSUB -eo
7#MSUB -n 1              # Reservation du processus
8#MSUB -T 86400          # Limite de temps elapsed du job
9#MSUB -p gen2211
10#MSUB -q mono
11
12# ex : ./launch_ipsl_enlarge.sh
13
14# gpdebug : pour option -f
15restartExecFromZero=0
16while [ $# -gt 0 ]
17do
18   echo "boucle sur les arguments du script ..."
19   echo "@=$@"
20   case $1 in
21   -f)  restartExecFromZero=1
22        echo "force restart from the beginning ..."
23        ;;
24   esac
25   shift
26done
27export restartExecFromZero=${restartExecFromZero}
28# gpdebug : end
29
30export JOB_DIR=${LS_SUBCWD:-${PWD}}
31export EXE_DIR=${JOB_DIR}
32
33export INPUT_DMF_DATA=/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable
34export OUTPUT_STORE=/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/PSEUDO_STORE_ANNE
35export OUTPUT_WORK=/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/PSEUDO_WORK_ANNE
36 
37SCRIPT_NAME=$(basename ${0} )
38
39export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM
40export IGCM_TMP=${SCRATCHDIR}/IGCM_DEM/tmp
41export clean_tmp=${clean_tmp:-yes}
42export DEM_LOG=${JOB_DIR}/dem_${LSB_JOBID:-${$}}.log
43export LOG_LEV=2
44
45export config_card=${IGCM_DEM}/config_card.liste
46
47
48############## gpdebug : Pour gestion des erreurs #########################################
49# Execute la function errorReceive() si reception d'un signal TERM
50trap 'DEM_errorReceive' TERM
51# liste des processus à détruire en cas d'erreur bloquante
52export listPID=$$
53# fichier pour la transmission des messages d'erreur d'un fils au prog principal
54export errorMsgFile="${PWD}/errorMsg.txt"
55############## gpdebug : fin ##############################################################
56
57source ${EXE_DIR}/DEM_utilities.sh
58
59DEM_log -0 "Demarrage de ${SCRIPT_NAME}"
60
61check_nco_version # gpdebug : verification de la version de nco #######################
62
63# gpdebug : si l'option -f est activee, on detruit tous les fichiers status
64if [ "x$restartExecFromZero" == "x1" ]
65then
66    echo "Deleting  all status files ..."
67    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste )
68    do
69       PATH_SIMU=$( dirname $CONFIG )
70       ListStatFileInSimu=`find $PATH_SIMU -type f -name "*status" `
71       if [ "x$ListStatFileInSimu" != "x" ]
72       then
73           for file in $ListStatFileInSimu
74           do
75              if [ -e $file ]
76              then
77                 rm -f $file
78              fi
79       
80           done     
81       fi   
82    done
83    echo "Deletion done."
84fi
85# gpdebug : end
86
87for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do
88
89    DEM_state=$( DEM_read_state ${IGCM_DEM}/config_card.liste ${CONFIG} )
90
91    if [[ "${DEM_state}" != "WriteListTarDone" ]] ; then
92
93        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} PackRunning
94        export PATH_SIMU=$( dirname $CONFIG )
95        ${EXE_DIR}/enlarge_my_files.sh ${INPUT_DMF_DATA} ${OUTPUT_STORE} ${OUTPUT_WORK}
96   
97        DEM_write_state ${IGCM_DEM}/config_card.liste ${CONFIG} PackDone
98
99    fi
100
101done
102
103DEM_log -0 "Fin de ${SCRIPT_NAME}"
Note: See TracBrowser for help on using the repository browser.