source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh @ 61

Last change on this file since 61 was 61, checked in by sdipsl, 15 years ago
  • Add UnixMaxLimit? variables inside libIGCM_sys
  • Don't use module with ulam for the moment
  • Adapt llsubmit procedure to have post-process job output when we want to
  • Property licence set to
    The following licence information concerns ONLY the libIGCM tools
    ==================================================================

    Copyright © Centre National de la Recherche Scientifique CNRS
    Commissariat à l'Énergie Atomique CEA

    libIGCM : Library for Portable Models Computation of IGCM Group.

    IGCM Group is the french IPSL Global Climate Model Group.

    This library is a set of shell scripts and functions whose purpose is
    the management of the initialization, the launch, the transfer of
    output files, the post-processing and the monitoring of datas produce
    by any numerical program on any plateforme.

    This software is governed by the CeCILL license under French law and
    abiding by the rules of distribution of free software. You can use,
    modify and/ or redistribute the software under the terms of the CeCILL
    license as circulated by CEA, CNRS and INRIA at the following URL
    "http://www.cecill.info".

    As a counterpart to the access to the source code and rights to copy,
    modify and redistribute granted by the license, users are provided only
    with a limited warranty and the software's author, the holder of the
    economic rights, and the successive licensors have only limited
    liability.

    In this respect, the user's attention is drawn to the risks associated
    with loading, using, modifying and/or developing or reproducing the
    software by the user in light of its specific status of free software,
    that may mean that it is complicated to manipulate, and that also
    therefore means that it is reserved for developers and experienced
    professionals having in-depth computer knowledge. Users are therefore
    encouraged to load and test the software's suitability as regards their
    requirements in conditions enabling the security of their systems and/or
    data to be ensured and, more generally, to use and operate it in the
    same conditions as regards security.

    The fact that you are presently reading this means that you have had
    knowledge of the CeCILL license and that you accept its terms.
  • Property svn:keywords set to Date Author Revision
File size: 34.1 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
5# Contact: Martial.Mancip_ipsl.jussieu.fr
6# $Date$
7# $Author$
8# $Revision$
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11# History:
12# Modification:
13#
14#**************************************************************
15
16#=========================================================
17# The documentation of this file can be automatically generated
18# if you use the prefix #D- for comments to be extracted.
19# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
20#=========================================================
21
22#D-#==================================================
23#D-LibIGCM_sys for Mercure TX
24#D-#==================================================
25#D-
26#D- This ksh library if a layer under some usefull
27#D-environment variables and shell commands.
28#D-All those definitions depend on host particularities.
29#D-It manages a stack mechanism and test validity of operations.
30#D-All function described bellow must be prefixed by IGCM_sys.
31
32#====================================================
33# libIGCM_sys PARAMETERS
34#====================================================
35
36#====================================================
37# set DEBUG_sys to true to output calls of function
38typeset -r DEBUG_sys=${DEBUG_sys:=true}
39
40#====================================================
41# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
42typeset -r DRYRUN=${DRYRUN:=0}
43
44# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
45# -------------------------------------------------------------------------------------
46# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
47# |          |  Cp/Exe param files |            |  Chmod  |                           |
48# |          |      Qsub           |            |         |                           |
49# -------------------------------------------------------------------------------------
50# |    0     |       yes           |    yes     |  yes    |      yes                  |
51# -------------------------------------------------------------------------------------
52# |    1     |       yes           |    yes     |  yes    |      no                   |
53# -------------------------------------------------------------------------------------
54# |    2     |       yes           |    yes     |  no     |      no                   |
55# -------------------------------------------------------------------------------------
56# |    3     |       yes           |    no      |  no     |      no                   |
57# -------------------------------------------------------------------------------------
58
59#=====================================================
60# Global Variables :
61#=====================================================
62# Language : "fr" or "en"
63typeset -r MYLANG="fr"
64
65#=====================================================
66# Host and user names
67# $hostname ou hostname
68typeset -r HOST=$( hostname )
69# $username ou whoami
70typeset -r LOGIN=$( whoami )
71
72#D-
73#D-#==================================================
74#D-Program used in libIGCM
75#D-#==================================================
76
77# rsync with path
78typeset -r RSYNC=/usr/bin/rsync
79# RSYNC_opt args to rsync
80typeset -r RSYNC_opt="-Lt -v"
81# RSYNC_opt args to "remote rsync"
82# ie storage filesystem
83typeset -r RHOST=fer.ccc.cea.fr
84typeset -r REMOTE_RSYNC=/dmnfs/cont003/p86denv/RSYNC/bin/rsync
85
86#====================================================
87# Source Ferret
88. /home/cont003/p86ipsl/.atlas_env_mercure_ksh
89
90#====================================================
91# Specific for ocean additionnal diagnostic
92export FER_GO="$FER_GO /home/cont003/p86denv/IGCM_POST_UTIL/JNL /home/cont003/p86denv/GRAF /home/cont003/p86denv/GRAF/GO"
93export FER_PALETTE="$FER_PALETTE /home/cont003/p86denv/GRAF/PALET"
94
95#=========================================================
96# Host specific DIRECTORIES
97#====================================================
98#====================================================
99#- libIGCM_POST
100typeset -r libIGCM_POST=${libIGCM}
101
102#====================================================
103#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
104typeset -r R_EXE="${MODIPSL}/bin"
105
106#====================================================
107# For interactive jobs on mercure
108PBS_O_WORKDIR=${PBS_O_WORKDIR:=$(pwd)}
109
110#====================================================
111#- SUBMIT_DIR : submission dir
112typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
113
114#====================================================
115#- ARCHIVE
116typeset -r ARCHIVE=${DMFDIR}
117
118#====================================================
119#- IN
120typeset -r R_IN=${R_IN:=/dmnfs/cont003/p86ipsl/IGCM}
121
122#====================================================
123#- OUT
124typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
125
126#====================================================
127#- OUT_SCR (ONLY FOR double copy an scratch)
128typeset -r R_OUT_SCR=${SCRATCHDIR}/IGCM_OUT
129
130#====================================================
131#- OUT_POST
132typeset -r R_OUT_POST=${SCRATCHDIR}/IGCM_OUT
133
134#====================================================
135#- RUN_DIR_PATH : Temporary working directory (=> TMP)
136typeset -r RUN_DIR_PATH=${RUN_DIR_PATH:=${TMPDIR}}
137
138#====================================================
139#- Max number of arguments passed to nco operator or demigration command
140UNIX_MAX_LIMIT=360
141
142#D-#==================================================
143#D-function IGCM_sys_RshMaster
144#D-* Purpose: Just a fake command to wrapp
145#D-           IGCM_card call in post-treatment
146#D-           Rhodes do not see brodie filesystem
147#D-           That's why we need this hack.
148#D-* Examples:
149#D-
150function IGCM_sys_RshMaster {
151    #set -vx
152    IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
153    /bin/ksh <<-EOF
154    export libIGCM=${libIGCM}
155    . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
156    . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
157    ${@}
158EOF
159    if [ $? -gt 0 ] ; then
160        echo "IGCM_sys_RshMaster : erreur."
161        IGCM_debug_Exit "IGCM_sys_RshMaster"
162    fi
163    IGCM_debug_PopStack "IGCM_sys_RshMaster"
164}
165
166#D-#==================================================
167#D-function IGCM_sys_RshArchive
168#D-* Purpose: Archive rsh command
169#D-* Examples:
170#D-
171function IGCM_sys_RshArchive {
172    IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
173    /bin/ksh <<-EOF
174    ${@}
175EOF
176    if [ $? -gt 0 ] ; then
177        echo "IGCM_sys_RshArchive : erreur."
178        IGCM_debug_Exit "IGCM_sys_RshArchive"
179    fi
180    IGCM_debug_PopStack "IGCM_sys_RshArchive"
181}
182
183#D-#==================================================
184#D-function IGCM_sys_Nb_files_archive
185#D-* Purpose: Count files on Archive filesystem
186#D-* Examples:
187#D-
188function IGCM_sys_Nb_files_archive {
189   ls ${@} 2>/dev/null | wc -l
190   if [ $? -gt 0 ] ; then
191       echo "IGCM_sys_RshArchive : erreur."
192   fi
193}
194
195#D-#==================================================
196#D-function IGCM_sys_RshPost
197#D-* Purpose: Master rsh command
198#D-* Examples:
199#D-
200function IGCM_sys_RshPost {
201    IGCM_debug_PushStack "IGCM_sys_RshPost" $@
202    if ( $DEBUG_sys ) ; then
203        echo "IGCM_sys_RshPost :" $@
204    fi
205    /bin/ksh ${@}
206    if [ $? -gt 0 ] ; then
207        echo "IGCM_sys_RshPost : erreur."
208        IGCM_debug_Exit "IGCM_sys_RshPost"
209    fi
210    IGCM_debug_PopStack "IGCM_sys_RshPost"
211}
212
213#D-#==================================================
214#D-function IGCM_sys_Mkdir
215#D-* Purpose: Master locale mkdir command
216#D-* Examples:
217#D-
218function IGCM_sys_Mkdir {
219    IGCM_debug_PushStack "IGCM_sys_Mkdir" $@
220    if ( $DEBUG_sys ) ; then
221        echo "IGCM_sys_Mkdir :" $@
222    fi
223    if [ ! -d ${1} ]; then
224        \mkdir -p $1
225        if [ $? -gt 0 ] ; then
226            echo "IGCM_sys_Mkdir : erreur."
227            IGCM_debug_Exit "IGCM_sys_Mkdir"
228        fi
229    fi
230    # vérification :
231    if [ ! -d ${1} ] ; then
232        echo "IGCM_sys_Mkdir : erreur."
233        IGCM_debug_Exit "IGCM_sys_Mkdir"
234    fi
235    IGCM_debug_PopStack "IGCM_sys_Mkdir"
236}
237
238#D-#==================================================
239#D-function IGCM_sys_MkdirArchive
240#D-* Purpose: Mkdir on Archive
241#D-* Examples:
242#D-
243function IGCM_sys_MkdirArchive {
244    IGCM_debug_PushStack "IGCM_sys_MkdirArchive" $@
245    if ( $DEBUG_sys ) ; then
246        echo "IGCM_sys_MkdirArchive :" $@
247    fi
248    #- creation de repertoire sur le serveur fichier
249    if [ ! -d ${1} ]; then 
250        \mkdir -p $1
251        if [ $? -gt 0 ] ; then
252            echo "IGCM_sys_MkdirArchive : erreur."
253            IGCM_debug_Exit "IGCM_sys_MkdirArchive"
254        fi
255    fi
256#    vérification ?? :
257#    if [ ! -d ${1} ] ; then
258#       echo "IGCM_sys_MkdirArchive : erreur."
259#       IGCM_debug_Exit "IGCM_sys_MkdirArchive"
260#    fi
261    IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
262}
263
264#D-#==================================================
265#D-function IGCM_sys_MkdirWork
266#D-* Purpose: Mkdir on Work
267#D-* Examples:
268#D-
269function IGCM_sys_MkdirWork {
270    IGCM_debug_PushStack "IGCM_sys_MkdirWork" $@
271    if ( $DEBUG_sys ) ; then
272        echo "IGCM_sys_MkdirWork :" $@
273    fi
274    #- creation de repertoire sur le serveur fichier
275    if [ ! -d ${1} ]; then 
276        \mkdir -p $1
277        if [ $? -gt 0 ] ; then
278            echo "IGCM_sys_MkdirWork : erreur."
279            IGCM_debug_Exit "IGCM_sys_MkdirWork"
280        fi
281    fi
282    # vérification ?? :
283    if [ ! -d ${1} ] ; then
284        echo "IGCM_sys_MkdirWork : erreur."
285        IGCM_debug_Exit "IGCM_sys_MkdirWork"
286    fi
287    IGCM_debug_PopStack "IGCM_sys_MkdirWork"
288}
289#IGCM_sys_MkdirWork ${RUN_DIR_PATH}
290#echo "RUN_DIR_PATH ${RUN_DIR_PATH} ok."
291
292#D-#==================================================
293#D-function IGCM_sys_Cd
294#D-* Purpose: master cd command
295#D-* Examples:
296#D-
297function IGCM_sys_Cd {
298    IGCM_debug_PushStack "IGCM_sys_Cd" $@
299    if ( $DEBUG_sys ) ; then
300        echo "IGCM_sys_Cd :" $@
301    fi
302    \cd $1
303    if [ $? -gt 0 ] ; then
304        echo "IGCM_sys_Cd : erreur."
305        IGCM_debug_Exit "IGCM_sys_Cd"
306    fi
307    IGCM_debug_PopStack "IGCM_sys_Cd"
308}
309
310#D-#==================================================
311#D-function IGCM_sys_Chmod
312#D-* Purpose: Chmod
313#D-* Examples:
314#D-
315function IGCM_sys_Chmod {
316    IGCM_debug_PushStack "IGCM_sys_Chmod" -- $@
317    if ( $DEBUG_sys ) ; then
318        echo "IGCM_sys_Chmod :" $@
319    fi
320    if [ $DRYRUN -le 1 ]; then
321        \chmod $@
322        if [ $? -gt 0 ] ; then
323            echo "IGCM_sys_Chmod : erreur."
324            IGCM_debug_Exit "IGCM_sys_Chmod"
325        fi
326    else
327        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
328    fi
329    IGCM_debug_PopStack "IGCM_sys_Chmod"
330}
331
332#D-#==================================================
333#D-function IGCM_sys_FileSize
334#D-* Purpose: Filesize
335#D-* Examples:
336#D-
337function IGCM_sys_FileSize {
338    IGCM_debug_PushStack "IGCM_sys_FileSize" $@
339
340    typeset sizeF
341    set +A sizeF -- $( ls -la ${1} )
342    if [ $? -gt 0 ] ; then
343        IGCM_debug_Exit "IGCM_sys_FileSize"
344    fi
345    eval ${2}=${sizeF[4]}
346
347    IGCM_debug_PopStack "IGCM_sys_FileSize"
348}
349
350#D-#==================================================
351#D-function IGCM_sys_TestDir
352#D-* Purpose: Test Directory that must exists
353#D-* Examples:
354#D-
355function IGCM_sys_TestDir {
356    IGCM_debug_PushStack "IGCM_sys_TestDir" $@
357    if ( $DEBUG_sys ) ; then
358        echo "IGCM_sys_TestDir :" $@
359    fi
360    if [ ! -d ${1} ]; then
361        echo "IGCM_sys_TestDir : Directory $1 does not exist."
362        IGCM_debug_Exit "IGCM_sys_TestDir"
363    fi
364    IGCM_debug_PopStack "IGCM_sys_TestDir"
365}
366
367#D-#==================================================
368#D-function IGCM_sys_TestDirArchive
369#D-* Purpose: Test Directory that must exists on Archive
370#D-* Examples:
371#D-
372function IGCM_sys_TestDirArchive {
373    IGCM_debug_PushStack "IGCM_sys_TestDirArchive" $@
374    if ( $DEBUG_sys ) ; then
375        echo "IGCM_sys_TestDirArchive :" $@
376    fi
377    if [ ! -d ${1} ]; then
378        echo "IGCM_sys_TestDirArchive : Directory $1 does not exist on ${ARCHIVE}."
379        IGCM_debug_Exit "IGCM_sys_TestDirArchive"
380    fi
381    IGCM_debug_PopStack "IGCM_sys_TestDirArchive"
382}
383
384#D-#==================================================
385#D-function IGCM_sys_TestFileArchive
386#D-* Purpose: Test file that must NOT EXISTS on Archive
387#D-* Examples:
388#D-
389function IGCM_sys_TestFileArchive {
390    IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
391    if ( $DEBUG_sys ) ; then
392        echo "IGCM_sys_TestFileArchive :" $@
393    fi
394    if [ ! -f ${1} ]; then
395        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
396        return 1
397    else
398        IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
399        return 0
400    fi
401}
402
403#D-#==================================================
404#D-function IGCM_sys_Tree
405#D-* Purpose: Tree directories with files on ${ARCHIVE}
406#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
407#D-
408function IGCM_sys_Tree {
409    IGCM_debug_PushStack "IGCM_sys_Tree" $@
410    if ( $DEBUG_sys ) ; then
411        echo "IGCM_sys_Tree :" $@
412    fi
413
414    \tree -f $@
415
416    IGCM_debug_PopStack "IGCM_sys_Tree"
417}
418
419#D-#==================================================
420#D-function IGCM_sys_Tar
421#D-* Purpose: master un-tar command
422#D-* Examples:
423#D-
424function IGCM_sys_Tar {
425    IGCM_debug_PushStack "IGCM_sys_Tar" $@
426    if ( $DEBUG_sys ) ; then
427        echo "IGCM_sys_Tar :" $@
428    fi
429    \tar cvf $@
430    if [ $? -gt 0 ] ; then
431        echo "IGCM_sys_Tar : erreur."
432        IGCM_debug_Exit "IGCM_sys_Tar"
433    fi
434    \tar tvf $1
435
436    IGCM_debug_PopStack "IGCM_sys_Tar"
437}
438
439#D-#==================================================
440#D-function IGCM_sys_UnTar
441#D-* Purpose: master un-tar command
442#D-* Examples:
443#D-
444function IGCM_sys_UnTar {
445    IGCM_debug_PushStack "IGCM_sys_UnTar" $@
446    if ( $DEBUG_sys ) ; then
447        echo "IGCM_sys_UnTar :" $@
448    fi
449    \tar xvf $1
450    if [ $? -gt 0 ] ; then
451        echo "IGCM_sys_UnTar : erreur."
452        IGCM_debug_Exit "IGCM_sys_UnTar"
453    fi
454    IGCM_debug_PopStack "IGCM_sys_UnTar"
455}
456
457#D-#==================================================
458#D-function IGCM_sys_QsubPost
459#D-* Purpose: Qsub new job on scalaire
460#D-* Examples:
461#D-
462function IGCM_sys_QsubPost {
463    IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
464    if ( $DEBUG_sys ) ; then
465        echo "IGCM_sys_QsubPost :" $@
466    fi
467    /usr/bin/nqsII/qsub -q scalaire -o ${POST_DIR}/$1.${PeriodDateEnd}.out ${libIGCM_POST}/$1.job -v ${listVarEnv}
468    if [ $? -gt 0 ] ; then
469        echo "IGCM_sys_QsubPost : erreur " $@
470        IGCM_debug_Exit "IGCM_sys_QsubPost"
471    fi
472    IGCM_debug_PopStack "IGCM_sys_QsubPost"
473}
474
475#D-*************************
476#D- File transfer functions
477#D-*************************
478#D-
479
480#D-#==================================================
481#D-function IGCM_sys_Rsync_out
482#D-* Purpose: treat return val of rsync
483#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
484#D-  Error values and explanations can depend on your system version.
485function IGCM_sys_Rsync_out {
486    RET=$1
487    if [ ! $RET ] ; then
488        echo "rsync error !"
489    fi
490
491    if [ $MYLANG = "fr" ]; then
492        case $RET in
493            0)  return ;;
494            1)  echo "Erreur de rsync ; RERR_SYNTAX : "
495                echo "Erreur de syntaxe ou d'utilisation."
496                return;;
497            2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
498                echo "Incompatibilité de protocole."
499                return;;
500            3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
501                echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
502                echo "répertoires"
503                return;;
504            4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
505                echo "Action demandée non supportée : une tentative de manipulation de"
506                echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
507                echo "été faite ; ou une option qui est supportée par le  client  mais"
508                echo "pas par le serveur a été spécifiée."
509                return;;
510            10) echo "Erreur de rsync ; RERR_SOCKETIO"
511                echo "Erreur dans le socket d'entrée sortie"
512                return;;
513            11) echo "Erreur de rsync ; RERR_FILEIO"
514                echo "Erreur d'entrée sortie fichier"
515                return;;
516            12) echo "Erreur de rsync ; RERR_STREAMIO"
517                echo "Erreur dans flux de donnée du protocole rsync"
518                return;;
519            13) echo "Erreur de rsync ; RERR_MESSAGEIO"
520                echo "Erreur avec les diagnostics du programme"
521                return;;
522            14) echo "Erreur de rsync ; RERR_IPC"
523                echo "Erreur dans le code IPC"
524                return;;
525            20) echo "Erreur de rsync ; RERR_SIGNAL"
526                echo "SIGUSR1 ou SIGINT reçu"
527                return;;
528            21) echo "Erreur de rsync ; RERR_WAITCHILD"
529                echo "Une erreur retournée par waitpid()"
530                return;;
531            22) echo "Erreur de rsync ; RERR_MALLOC"
532                echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
533                return;;
534            23) echo ""
535                echo "Erreur fichier inexistant"
536                return;;
537            30) echo "Erreur de rsync ; RERR_TIMEOUT"
538                echo "Temps d'attente écoulé dans l'envoi/réception de données"
539                return;;
540            *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
541                return;;
542        esac
543    elif [ $MYLANG = "en" ] ; then
544        case $RET in
545            0)  return;;               
546            1)  echo "rsync error : Syntax or usage error "
547                return;;
548            2)  echo "rsync error : Protocol incompatibility "
549                return;;
550            3)  echo "rsync error : Errors selecting input/output files, dirs"
551                return;;
552            4)  echo "rsync error : Requested action not supported: an attempt"
553                echo "was made to manipulate 64-bit files on a platform that cannot support"
554                echo "them; or an option was specified that is supported by the client and"
555                echo "not by the server."
556                return;;
557            5)  echo "rsync error : Error starting client-server protocol"
558                return;;
559            10) echo "rsync error : Error in socket I/O "
560                return;;
561            11) echo "rsync error : Error in file I/O "
562                return;;
563            12) echo "rsync error : Error in rsync protocol data stream "
564                return;;
565            13) echo "rsync error : Errors with program diagnostics "
566                return;;
567            14) echo "rsync error : Error in IPC code "
568                return;;
569            20) echo "rsync error : Received SIGUSR1 or SIGINT "
570                return;;
571            21) echo "rsync error : Some error returned by waitpid() "
572                return;;
573            22) echo "rsync error : Error allocating core memory buffers "
574                return;;
575            23) echo "rsync error : Partial transfer due to error"
576                return;;
577            24) echo "rsync error : Partial transfer due to vanished source files"
578                return;;
579            30) echo "rsync error : Timeout in data send/receive "
580                return;;
581            *)  echo "rsync error : return code of rsync unknown :" $RET
582                return;;
583        esac
584    else
585        echo "unknown language $MYLANG."
586        return
587    fi
588}
589   
590#D-#==================================================
591#D-function IGCM_sys_Cp
592#D-* Purpose: generic cp
593#D-* Examples:
594#D-
595function IGCM_sys_Cp {
596    IGCM_debug_PushStack "IGCM_sys_Cp" $@
597    if ( $DEBUG_sys ) ; then
598        echo "IGCM_sys_Cp :" $@
599    fi
600
601    typeset RET
602
603    echo cp $@ > out_rsync 2>&1
604    \cp $@ >> out_rsync 2>&1
605    RET=$?
606
607    if [ ${RET} -gt 0 ] ; then
608        echo "IGCM_sys_Cp : error."
609        cat out_rsync
610        IGCM_debug_Exit "IGCM_sys_Cp"
611    fi
612    IGCM_debug_PopStack "IGCM_sys_Cp"
613}
614
615#D-#==================================================
616#D-function IGCM_sys_Rm
617#D-* Purpose: generic rm
618#D-* Examples:
619#D-
620function IGCM_sys_Rm {
621    IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
622    if ( $DEBUG_sys ) ; then
623        echo "IGCM_sys_Rm :" $@
624    fi
625
626    typeset RET
627
628    echo rm $@ > out_rsync 2>&1
629    \rm $@ >> out_rsync 2>&1
630    RET=$?
631   
632    if [ ${RET} -gt 0 ] ; then
633        echo "IGCM_sys_Rm : error."
634        cat out_rsync
635        IGCM_debug_Exit "IGCM_sys_Rm"
636    fi
637    IGCM_debug_PopStack "IGCM_sys_Rm"
638}
639
640#D-#==================================================
641#D-function IGCM_sys_Mv
642#D-* Purpose: generic move
643#D-* Examples:
644#D-
645function IGCM_sys_Mv {
646    IGCM_debug_PushStack "IGCM_sys_Mv" $@
647    if ( $DEBUG_sys ) ; then
648        echo "IGCM_sys_Mv :" $@
649    fi
650
651    typeset RET
652
653    echo mv $@ > out_rsync 2>&1
654    \mv $@ >> out_rsync 2>&1
655    RET=$?
656
657    if [ ${RET} -gt 0 ] ; then
658        echo "IGCM_sys_Mv : error in mv."
659        cat out_rsync
660        IGCM_debug_Exit "IGCM_sys_Mv"
661    fi
662
663    IGCM_debug_PopStack "IGCM_sys_Mv"
664}
665
666#D-#==================================================
667#D-function IGCM_sys_Put_Dir
668#D-* Purpose: Copy a complete directory on $(ARCHIVE)
669#D-* Examples:
670#D-
671function IGCM_sys_Put_Dir {
672    IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
673    if ( $DEBUG_sys ) ; then
674        echo "IGCM_sys_Put_Dir :" $@
675    fi
676    if [ $DRYRUN = 0 ]; then
677        if [ ! -d ${1} ] ; then
678            echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
679            IGCM_debug_PopStack "IGCM_sys_Put_Dir"
680            return
681        fi
682
683        typeset RET
684
685        # Only if we use rsync
686        #IGCM_sys_TestDirArchive $( dirname $2 )
687        #
688        #USUAL WAY
689        \cp -r $1 $2 > out_rsync 2>&1
690        RET=$?
691
692        if [ ${RET} -gt 0 ] ; then
693            echo "IGCM_sys_Put_Dir : error."
694            cat out_rsync
695            IGCM_debug_Exit "IGCM_sys_Put_Dir"
696        fi
697    else
698        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
699    fi
700    IGCM_debug_PopStack "IGCM_sys_Put_Dir"
701}
702
703#D-#==================================================
704#D-function IGCM_sys_Get_Dir
705#D-* Purpose: Copy a complete directory from $(ARCHIVE)
706#D-* Examples:
707#D-
708function IGCM_sys_Get_Dir {
709    IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
710    if ( $DEBUG_sys ) ; then
711        echo "IGCM_sys_Get_Dir :" $@
712    fi
713    if [ $DRYRUN = 0 ]; then
714        if [ ! -d ${1} ] ; then
715            echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
716            IGCM_debug_PopStack "IGCM_sys_Get_Dir"
717            return
718        fi
719
720        typeset RET
721
722        # Only if we use rsync
723        #IGCM_sys_TestDirArchive $( dirname $2 )
724        #
725        #USUAL WAY
726        \cp -r $1 $2 > out_rsync 2>&1
727        RET=$?
728
729        if [ ${RET} -gt 0 ] ; then
730            echo "IGCM_sys_Get_Dir : error."
731            cat out_rsync
732            IGCM_debug_Exit "IGCM_sys_Get_Dir"
733        fi
734    else
735        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
736    fi
737    IGCM_debug_PopStack "IGCM_sys_Get_Dir"
738}
739
740#D-#==================================================
741#D-function IGCM_sys_Get_Master
742#D-* Purpose: Copy a complete directory from MASTER filesystem
743#D-* Examples:
744#D-
745function IGCM_sys_Get_Master {
746    IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
747    if ( $DEBUG_sys ) ; then
748        echo "IGCM_sys_Get_Master :" $@
749    fi
750    if [ $DRYRUN = 0 ]; then
751        if [ ! -d ${1} ] ; then
752            echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
753            IGCM_debug_PopStack "IGCM_sys_Get_Master"
754            return
755        fi
756
757        typeset RET
758        sleep 60
759
760        #USUAL WAY
761        \cp -r $1 $2 > out_rsync 2>&1
762        RET=$?
763
764        if [ ${RET} -gt 0 ] ; then
765            echo "IGCM_sys_Get_Master : error."
766            cat out_rsync
767            IGCM_debug_Exit "IGCM_sys_Get_Master"
768        fi
769    else
770        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
771    fi
772    IGCM_debug_PopStack "IGCM_sys_Get_Master"
773}
774
775#D-#==================================================
776#D-function IGCM_sys_Put_Out
777#D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
778#D-* Examples:
779#D-
780function IGCM_sys_Put_Out {
781    IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
782    if ( $DEBUG_sys ) ; then
783        echo "IGCM_sys_Put_Out :" $@
784    fi
785    if [ $DRYRUN = 0 ]; then
786        if [ ! -f ${1} ] ; then
787            echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
788            IGCM_debug_PopStack "IGCM_sys_Put_Out"
789            return 1
790        fi
791        #
792        IGCM_sys_MkdirArchive $( dirname $2 )
793        #
794        typeset RET
795        #
796        IGCM_sys_Chmod 444 ${1}
797        #
798        # USUAL WAY
799        putfer $1 $2 > out_rsync 2>&1
800        RET=$?
801
802#       #RSYNC WITH NETWORK RSH CALL
803#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
804#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
805
806#       #RSYNC WITH NFS USE
807#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
808#       ${RSYNC_FRONT} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
809
810#       RET=$?
811#       IGCM_sys_Rsync_out $RET
812
813#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
814#       (( RET=RET+$? ))
815
816        if [ ${RET} -gt 0 ] ; then
817            echo "IGCM_sys_Put_Out : error."
818            cat out_rsync
819            IGCM_debug_Exit "IGCM_sys_Put_Out"
820        fi
821    else
822        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
823    fi
824    IGCM_debug_PopStack "IGCM_sys_Put_Out"
825    return 0
826}
827
828#D-#==================================================
829#D-function IGCM_sys_Get
830#D-* Purpose: Get a file from ${ARCHIVE}
831#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
832#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
833function IGCM_sys_Get {
834    IGCM_debug_PushStack "IGCM_sys_Get" $@
835
836    typeset DEST RET dm_liste ifile target file_work
837
838    if ( $DEBUG_sys ) ; then
839        echo "IGCM_sys_Get :" $@
840    fi
841    if [ $DRYRUN -le 2 ]; then
842        if [ X${1} = X'/l' ] ; then
843            # test if the first file is present in the old computation :
844            eval set +A dm_liste \${${2}}
845        else
846            eval set +A dm_liste ${1}
847        fi
848        eval DEST=\${${#}}
849
850        #=====================================================
851        #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
852        #=====================================================
853
854        # Is it an R_OUT file (not R_IN) ?
855        #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
856        #if [ $? -eq 0 ] ; then
857        #    # Yes  ? then we try to get it in SCRATCHDIR
858        #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_OUT_SCR}|g" )
859        #    if [ -f ${file_work[0]} ] ; then
860        #       IGCM_sys_Cp ${file_work[*]} ${DEST}
861        #       IGCM_debug_PopStack "IGCM_sys_Get"
862        #       return
863        #    fi
864        #fi
865
866        # test if the (first) file is present in the old computation :
867        IGCM_sys_TestFileArchive ${dm_liste[0]}
868        RET=$?
869        if [ ${RET} -gt 0 ] ; then
870            echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
871            IGCM_debug_Exit "IGCM_sys_Get"
872            IGCM_debug_PopStack "IGCM_sys_Get"
873            return
874        fi
875
876        dmget ${dm_liste[*]} > out_rsync 2>&1
877        RET=$?
878        if [ ${RET} -gt 0 ] ; then
879            echo "IGCM_sys_Get : demigration error."
880            cat out_rsync
881            IGCM_debug_Exit "IGCM_sys_Get"
882            IGCM_debug_PopStack "IGCM_sys_Get"
883            return
884        fi
885
886        #USUAL WAY
887        (( RET=0 ))
888        if [ X${1} = X'/l' ] ; then
889            (( RET=0 ))
890            for target in ${dm_liste[*]} ; do
891                local_file=$( basename ${target} )
892                \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
893                (( RET = RET + $? ))
894            done
895        else
896            \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
897            RET=$?
898        fi
899
900#       #RSYNC WITH NETWORK RSH CALL
901#       echo ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
902#       ${RSYNC_FRONT} ${RSYNC_opt} --rsync-path=${REMOTE_RSYNC} -e rsh ${RHOST}:"${dm_liste}" ${RHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
903
904#       #RSYNC WITH NFS USE
905#       echo ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
906#       ${RSYNC_FRONT} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
907
908#       RET=$?
909#       IGCM_sys_Rsync_out $RET
910
911#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
912#       (( RET=RET+$? ))
913
914        if [ ${RET} -gt 0 ] ; then
915            echo "IGCM_sys_Get : copy error."
916            cat out_rsync
917            IGCM_debug_Exit "IGCM_sys_Get"
918        fi
919    else
920        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
921    fi
922    IGCM_debug_PopStack "IGCM_sys_Get"
923}
924
925#D-#==================================================
926#D-function IGCM_sys_Put_Dods
927#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
928#D-* Examples:
929#D-
930function IGCM_sys_Put_Dods {
931    IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
932    if ( $DEBUG_sys ) ; then
933        echo "IGCM_sys_Put_Dods :" $@
934    fi
935    if [ $DRYRUN = 0 ]; then
936        if [ ! -d ${R_SAVE}/${1} ] ; then
937            echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
938            IGCM_debug_PopStack "IGCM_sys_Put_Dods"
939            return
940        fi
941
942        typeset RET
943        #
944        cd ${R_SAVE}
945        dods_rm public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/${1} > /dev/null 2>&1
946        #/bin/chmod -R u+w  ${R_SAVE}/${1}
947        dods_cp ${1} public/${LOGIN}/${config_UserChoices_TagName}/${config_UserChoices_JobName} > /dev/null 2>&1
948        #/bin/chmod -R +rX ${R_SAVE}/${1}
949        #/bin/chmod -R a+rX /dmnfs/cont003/dods/public/${LOGIN}/${config_UserChoices_TagName}
950        #RET=$?
951        RET=0
952       
953        if [ ${RET} -gt 0 ] ; then
954            echo "IGCM_sys_Put_Dods : error."
955            IGCM_debug_Exit "IGCM_sys_Put_Dods"
956        fi
957    else
958        ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
959    fi
960    IGCM_debug_PopStack "IGCM_sys_Put_Dods"
961}
962
963############################################################## A REVOIR !!
964
965#D-#==================================================
966#D-function IGCM_sys_Rapatrie
967#D-* Purpose: Rapatrie
968#D-* Examples:
969#D-
970function IGCM_sys_Rapatrie {
971    IGCM_debug_PushStack "IGCM_sys_Rapatrie" $@
972    if ( $DEBUG_sys ) ; then
973        echo "IGCM_sys_Rapatrie :" $@
974    fi
975
976    typeset RET=0
977
978    IGCM_sys_Get ${R_STOCKAGE}/$2 $1 ;
979    let $(( RET=RET+$? ))
980    IGCM_sys_Cd $1 ;
981    let $(( RET=RET+$? ))
982    IGCM_sys_UnTar $2 ;
983    let $(( RET=RET+$? ))
984
985    if [ ${RET} -gt 0 ] ; then
986        echo "IGCM_sys_Rapatrie : erreur."
987        IGCM_debug_Exit "IGCM_sys_Rapatrie"
988    fi
989    IGCM_debug_PopStack "IGCM_sys_Rapatrie"
990}
991
992############################################################## A FINIR !!
993
994#D-#==================================================
995#D-function IGCM_sys_GetDate_FichWork
996#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
997#D-* Examples:
998#D-
999function IGCM_sys_GetDate_FichWork {
1000    IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1001    if ( $DEBUG_sys ) ; then
1002        echo "IGCM_sys_GetDate_FichWork :" $@
1003    fi
1004    # donne la date filesys d'un fichier sur la machine work
1005    IGCM_debug_PopStack "IGCM_sys_FichWork"
1006}
1007
1008#D-#==================================================
1009#D-function IGCM_sys_GetDate_FichArchive
1010#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1011#D-* Examples:
1012#D-
1013function IGCM_sys_GetDate_FichArchive {
1014    IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1015    if ( $DEBUG_sys ) ; then
1016        echo "IGCM_sys_GetDate_FichArchive :" $@
1017    fi
1018    IGCM_debug_PopStack "IGCM_sys_FichArchive"
1019}
1020
1021##############################################################
1022# REBUILD OPERATOR
1023
1024function IGCM_sys_rebuild {
1025    IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1026    if ( $DEBUG_sys ) ; then
1027        echo "IGCM_sys_rebuild :" $@
1028    fi
1029    /home/cont003/p86ipsl/TX7/bin/rebuild -f -o $@
1030    if [ $? -gt 0 ] ; then
1031       echo "IGCM_sys_rebuild : erreur ${@}."
1032       IGCM_debug_Exit "rebuild"
1033    fi
1034
1035    IGCM_debug_PopStack "IGCM_sys_rebuild"
1036}
1037
1038##############################################################
1039# NCO OPERATOR
1040
1041function IGCM_sys_ncap {
1042    IGCM_debug_PushStack "IGCM_sys_ncap" -- $@
1043    if ( $DEBUG_sys ) ; then
1044        echo "IGCM_sys_ncap :" $@
1045    fi
1046    /usr/local/bin/ncap $@
1047    if [ $? -gt 0 ] ; then
1048       echo "IGCM_sys_ncap : erreur ${@}."
1049#       IGCM_debug_Exit "ncap"
1050    fi
1051
1052    IGCM_debug_PopStack "IGCM_sys_ncap"
1053}
1054
1055ncatted=/usr/local/bin/ncatted
1056# Problem with ksh and string passed in this function to ncatted !
1057# function IGCM_sys_ncatted {
1058#     IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1059#     if ( $DEBUG_sys ) ; then
1060#       echo "IGCM_sys_ncatted :" $@
1061#     fi
1062#     /usr/local/bin/ncatted $@
1063#     if [ $? -gt 0 ] ; then
1064#        echo "IGCM_sys_ncatted : erreur ${@}."
1065#        IGCM_debug_Exit "ncatted"
1066#     fi
1067
1068#     IGCM_debug_PopStack "IGCM_sys_ncatted"
1069# }
1070
1071function IGCM_sys_ncbo {
1072    IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1073    if ( $DEBUG_sys ) ; then
1074        echo "IGCM_sys_ncbo :" $@
1075    fi
1076    /usr/local/bin/ncbo $@
1077    if [ $? -gt 0 ] ; then
1078       echo "IGCM_sys_ncbo : erreur ${@}."
1079#       IGCM_debug_Exit "ncbo"
1080    fi
1081
1082    IGCM_debug_PopStack "IGCM_sys_ncbo"
1083}
1084
1085function IGCM_sys_ncdiff {
1086    IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1087    if ( $DEBUG_sys ) ; then
1088        echo "IGCM_sys_ncdiff :" $@
1089    fi
1090    /usr/local/bin/ncdiff $@
1091    if [ $? -gt 0 ] ; then
1092       echo "IGCM_sys_ncdiff : erreur ${@}."
1093#       IGCM_debug_Exit "ncdiff"
1094    fi
1095
1096    IGCM_debug_PopStack "IGCM_sys_ncdiff"
1097}
1098
1099function IGCM_sys_ncea {
1100    IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1101    if ( $DEBUG_sys ) ; then
1102        echo "IGCM_sys_ncea :" $@
1103    fi
1104    /usr/local/bin/ncea $@
1105    if [ $? -gt 0 ] ; then
1106       echo "IGCM_sys_ncea : erreur ${@}."
1107#       IGCM_debug_Exit "ncea"
1108    fi
1109
1110    IGCM_debug_PopStack "IGCM_sys_ncea"
1111}
1112
1113function IGCM_sys_ncecat {
1114    IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1115    if ( $DEBUG_sys ) ; then
1116        echo "IGCM_sys_ncecat :" $@
1117    fi
1118    /usr/local/bin/ncecat $@
1119    if [ $? -gt 0 ] ; then
1120       echo "IGCM_sys_ncecat : erreur ${@}."
1121#       IGCM_debug_Exit "ncecat"
1122    fi
1123
1124    IGCM_debug_PopStack "IGCM_sys_ncecat"
1125}
1126
1127function IGCM_sys_ncflint {
1128    IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1129    if ( $DEBUG_sys ) ; then
1130        echo "IGCM_sys_ncflint :" $@
1131    fi
1132    /usr/local/bin/ncflint $@
1133    if [ $? -gt 0 ] ; then
1134       echo "IGCM_sys_ncflint : erreur ${@}."
1135#       IGCM_debug_Exit "ncflint"
1136    fi
1137
1138    IGCM_debug_PopStack "IGCM_sys_ncflint"
1139}
1140
1141function IGCM_sys_ncks {
1142    IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1143    if ( $DEBUG_sys ) ; then
1144        echo "IGCM_sys_ncks :" $@
1145    fi
1146    /usr/local/bin/ncks $@
1147    if [ $? -gt 0 ] ; then
1148       echo "IGCM_sys_ncks : erreur ${@}."
1149#       IGCM_debug_Exit "ncks"
1150    fi
1151
1152    IGCM_debug_PopStack "IGCM_sys_ncks"
1153}
1154
1155function IGCM_sys_ncpdq {
1156    IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1157    if ( $DEBUG_sys ) ; then
1158        echo "IGCM_sys_ncpdq :" $@
1159    fi
1160    /usr/local/bin/ncpdq $@
1161    if [ $? -gt 0 ] ; then
1162       echo "IGCM_sys_ncpdq : erreur ${@}."
1163#       IGCM_debug_Exit "ncpdq"
1164    fi
1165
1166    IGCM_debug_PopStack "IGCM_sys_ncpdq"
1167}
1168
1169function IGCM_sys_ncra {
1170    IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1171    if ( $DEBUG_sys ) ; then
1172        echo "IGCM_sys_ncra :" $@
1173    fi
1174    /usr/local/bin/ncra $@
1175    if [ $? -gt 0 ] ; then
1176       echo "IGCM_sys_ncra : erreur ${@}."
1177#       IGCM_debug_Exit "ncra"
1178    fi
1179
1180    IGCM_debug_PopStack "IGCM_sys_ncra"
1181}
1182
1183function IGCM_sys_ncrcat {
1184    IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1185    if ( $DEBUG_sys ) ; then
1186        echo "IGCM_sys_ncrcat :" $@
1187    fi
1188    /usr/local/bin/ncrcat $@
1189    if [ $? -gt 0 ] ; then
1190       echo "IGCM_sys_ncrcat : erreur ${@}."
1191#       IGCM_debug_Exit "ncrcat"
1192    fi
1193
1194    IGCM_debug_PopStack "IGCM_sys_ncrcat"
1195}
1196
1197function IGCM_sys_ncrename {
1198    IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1199    if ( $DEBUG_sys ) ; then
1200        echo "IGCM_sys_ncrename :" $@
1201    fi
1202    /usr/local/bin/ncrename $@
1203    if [ $? -gt 0 ] ; then
1204       echo "IGCM_sys_ncrename : erreur ${@}."
1205#       IGCM_debug_Exit "ncrename"
1206    fi
1207
1208    IGCM_debug_PopStack "IGCM_sys_ncrename"
1209}
1210
1211function IGCM_sys_ncwa {
1212    IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1213    if ( $DEBUG_sys ) ; then
1214        echo "IGCM_sys_ncwa :" $@
1215    fi
1216    /usr/local/bin/ncwa $@
1217    if [ $? -gt 0 ] ; then
1218       echo "IGCM_sys_ncwa : erreur ${@}."
1219#       IGCM_debug_Exit "ncwa"
1220    fi
1221
1222    IGCM_debug_PopStack "IGCM_sys_ncwa"
1223}
1224
1225############################################################
1226# Activate Running Environnment Variables
1227
1228function IGCM_sys_activ_variables {
1229    IGCM_debug_PushStack "IGCM_sys_activ_variables"
1230    if ( $DEBUG_sys ) ; then
1231        echo "IGCM_sys_activ_variables"
1232    fi
1233    IGCM_debug_PopStack "IGCM_sys_activ_variables"
1234}
1235
1236############################################################
1237# Desactivate Running Environnment Variables
1238
1239function IGCM_sys_desactiv_variables {
1240    IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1241    if ( $DEBUG_sys ) ; then
1242        echo "IGCM_sys_desactiv_variables"
1243    fi
1244    IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1245}
1246
1247############################################################
1248# Build run file
1249
1250function IGCM_sys_build_run_file {
1251    IGCM_debug_PushStack "IGCM_sys_build_run_file"
1252    if ( $DEBUG_sys ) ; then
1253        echo "IGCM_sys_build_run_file"
1254    fi
1255    IGCM_debug_PopStack "IGCM_sys_build_run_file"
1256}
Note: See TracBrowser for help on using the repository browser.