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

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