source: TOOLS/PACK_IPSL/load_ipslPack_env.sh @ 1862

Last change on this file since 1862 was 1861, checked in by gpincka, 12 years ago

correction erreur

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#!/bin/bash
2
3# Variables d'environnement
4export IGCM_DEM="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/IGCM_DEM"
5export INPUT_DMF_DATA="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME_DATAS"
6export OUTPUT_STORE="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_STORE"
7export OUTPUT_WORK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_WORK"
8export OUTPUT_CHECK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_CHECK"
9export OUTPUT_PROGRESS="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS"
10
11# Sur curie en sequentiel
12# export OUTPUT_PROGRESS="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_PROGRESS_SEQ"
13# export OUTPUT_STORE="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_STORE_SEQ"
14# export OUTPUT_WORK="/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/GUILLAUME/PSEUDO_DMNFS_WORK_SEQ"
15
16
17# Pour titane
18#export IGCM_DEM="/scratch/cont003/pierreg/IGCM_DEM"
19#export INPUT_DMF_DATA="/scratch/cont003/pierreg/datasLabo/dataDMNFS_simple1"
20#export OUTPUT_STORE="/scratch/cont003/pierreg/PSEUDO_DMNFS_STORE"
21#export OUTPUT_WORK="/scratch/cont003/pierreg/PSEUDO_DMNFS_WORK"
22#export OUTPUT_CHECK="/scratch/cont003/pierreg/PSEUDO_DMNFS_CHECK"
23#export OUTPUT_PROGRESS="/scratch/cont003/pierreg/PSEUDO_DMNFS_PROGRESS"
24
25scriptCallingThisOne="$scriptCallingLoad"
26# echo "scriptCallingThisOne=$scriptCallingThisOne"
27
28if [ "x${scriptCallingThisOne}" != "xlaunch_ipsl_pack.sh" ]
29then
30
31    # Determination du chemin pour le rep ${PSEUDO_DMNFS_PROGRESS}/USER (seulement pour la partie de pack)
32    # ------------------------------------------------------------------
33    # Le rep ${OUTPUT_PROGRESS} contiendra des sous rep USER
34    # ${OUTPUT_PROGRESS}/USER contiendra, pour l'utilisateur USER :
35    #    * la liste des taches a executer en parallele par le prog c/mpi
36    #    * la nouvelle liste des taches qui n'ont pas ete reussies dans un premier temps
37    #    * les sorties des taches executees en parallele (traitement des liste de fichiers)
38    # L'idee est de regrouper ces elements dans un rep ${OUTPUT_PROGRESS}/USER
39    # Pour determiner le rep USER, on parcourt ${IGCM_DEM}/config_card.liste.
40    # La chaine de caract commune a toutes les lignes de ce fichier est le rep USER,
41    # que l'on cree ensuite dans ${OUTPUT_PROGRESS}
42
43    function find_intersection
44    {
45        # Trouve la sous chaine commune de 2 chaines de caract
46        local string1=$1
47        local string2=$2
48
49        local lengthString1=${#string1}
50        local lengthString2=${#string2}
51
52        local longestString=
53        local smallestString=
54        if [ $lengthString1 -ge $lengthString2 ]
55        then
56           longestString=$string1
57           smallestString=$string2
58        else
59           longestString=$string2
60           smallestString=$string1 
61        fi
62
63        while [ "x`echo $longestString | grep $smallestString `" == "x" ]
64        do
65            smallestString=$( dirname $smallestString )
66        done
67        echo "$smallestString"
68    }
69
70    COMMON_STRING=`head -n 1 ${IGCM_DEM}/config_card.liste | awk '{print $1}' | xargs dirname `
71    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do
72
73       PATH_SIMU=$( dirname $CONFIG )
74       INTERSECT=$( find_intersection  $PATH_SIMU $COMMON_STRING )
75       COMMON_STRING=$INTERSECT
76
77    done
78
79    # echo "COMMON_STRING=$COMMON_STRING"
80
81    PATH_TO_ADD=`echo $COMMON_STRING | sed "s;${IGCM_DEM};;" | sed 's;^/;;' `
82    # echo "PATH_TO_ADD=$PATH_TO_ADD"
83
84    USER_OUTPUT_PROGRESS="${OUTPUT_PROGRESS}/${PATH_TO_ADD}"
85    export USER_OUTPUT_PROGRESS=`echo $USER_OUTPUT_PROGRESS | sed 's;/$;;' `
86    export DETAILLED_OUTPUT="${USER_OUTPUT_PROGRESS}/detailed_pack_output"
87
88    # creation du rep ${IGCM_DEM}/PSEUDO_DMNFS_PROGRESS/USER
89    mkdir -p ${USER_OUTPUT_PROGRESS}
90
91    # creation d'un rep specifique pour les sorties detaillees des operations de pack
92    mkdir -p ${DETAILLED_OUTPUT}
93
94fi
Note: See TracBrowser for help on using the repository browser.