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

Last change on this file since 37 was 37, checked in by sdipsl, 16 years ago

ACa/SD : Function IGCM_sys_RshArchive will be use to manage NEMO restart in the parallel case

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