source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh @ 203

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