source: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh @ 710

Last change on this file since 710 was 710, checked in by sdipsl, 12 years ago
  • check existence of already copied files by IGCM_sys_PutBuffer_Out. #67
  • Property svn:keywords set to Revision Author Date
File size: 51.1 KB
Line 
1#!/bin/ksh
2
3#**************************************************************
4# Author: Sebastien Denvil, Martial Mancip
5# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
6# $Revision::                                          $ Revision of last commit
7# $Author::                                            $ Author of last commit
8# $Date::                                              $ Date of last commit
9# IPSL (2006)
10#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
11#
12#**************************************************************
13
14#=========================================================
15# The documentation of this file can be automatically generated
16# if you use the prefix #D- for comments to be extracted.
17# Extract with command: cat lib* | grep "^#D-" | cut -c "4-"
18#=========================================================
19
20#D-#==================================================
21#D-LibIGCM_sys for Mercure X64
22#D-#==================================================
23#D-
24#D- This ksh library if a layer under some usefull
25#D-environment variables and shell commands.
26#D-All those definitions depend on host particularities.
27#D-It manages a stack mechanism and test validity of operations.
28#D-All function described bellow must be prefixed by IGCM_sys.
29
30#====================================================
31# libIGCM_sys PARAMETERS
32#====================================================
33
34#====================================================
35# set DEBUG_sys to true to output calls of function
36typeset -r DEBUG_sys=${DEBUG_sys:=true}
37
38#====================================================
39# Turn in dry run mode ? (sys_Put_Rest, sys_Put_Out, sys_Get)
40typeset -r DRYRUN=${DRYRUN:=0}
41
42# YOU MUST COMPILE YOUR EXE FILES FOR DRYRUN MODE !
43# -------------------------------------------------------------------------------------
44# | DRYRUN=  |  Date computations, | sys_Get    |  Exe    | sys_Put_Out; sys_Put_Rest |
45# |          |  Cp/Exe param files |            |  Chmod  |                           |
46# |          |      Qsub           |            |         |                           |
47# -------------------------------------------------------------------------------------
48# |    0     |       yes           |    yes     |  yes    |      yes                  |
49# -------------------------------------------------------------------------------------
50# |    1     |       yes           |    yes     |  yes    |      no                   |
51# -------------------------------------------------------------------------------------
52# |    2     |       yes           |    yes     |  no     |      no                   |
53# -------------------------------------------------------------------------------------
54# |    3     |       yes           |    no      |  no     |      no                   |
55# -------------------------------------------------------------------------------------
56
57#=====================================================
58# Global Variables :
59#=====================================================
60# Language : "fr" or "en"
61typeset -r MYLANG="fr"
62
63#=====================================================
64# Host and user names
65# $hostname ou hostname
66typeset  HOST=${HOST:=$( hostname )}
67# $username ou whoami
68typeset  LOGIN=${LOGIN:=$( whoami )}
69
70#D-
71#D-#==================================================
72#D-Program used in libIGCM
73#D-#==================================================
74
75# rsync with path
76typeset -r RSYNC=/usr/bin/rsync
77# RSYNC_opt args to rsync
78typeset -r RSYNC_opt="-va"
79# ie storage filesystem
80typeset -r RHOST=mercure
81
82#====================================================
83# Set environment tools (ferret, nco, cdo)
84#====================================================
85. /home/cont003/p86ipsl/.atlas_env_mercure01_ksh
86
87#====================================================
88# Host specific DIRECTORIES
89#====================================================
90
91#====================================================
92#- R_EXE   (==> BIN_DIR = ${MODIPSL}/bin )
93typeset -r R_EXE="${MODIPSL}/bin"
94
95#====================================================
96# For interactive jobs on mercure
97PBS_O_WORKDIR=${PBS_O_WORKDIR:=$(pwd)}
98
99#====================================================
100#- SUBMIT_DIR : submission dir
101typeset SUBMIT_DIR=${SUBMIT_DIR:=${PBS_O_WORKDIR}}
102
103#====================================================
104#- ARCHIVE (dedicated to large files)
105typeset -r ARCHIVE=${CCCSTOREDIR}
106
107#- ARCHIVE (dedicated to small/medium files)
108typeset -r STORAGE=${CCCWORKDIR}
109
110#====================================================
111#- IN
112typeset -r R_IN=${R_IN:=/ccc/work/cont003/dsm/p86ipsl/IGCM}
113typeset -r R_IN_ECMWF=${R_IN_ECMWF:=/dmnfs/cont003/p24data}
114
115#====================================================
116#- R_OUT
117typeset -r R_OUT=${ARCHIVE}/IGCM_OUT
118
119#====================================================
120#- R_FIG (hosting figures : monitoring and atlas, and/or small files)
121typeset -r R_FIG=${STORAGE}/IGCM_OUT
122
123#====================================================
124#- R_BUF (ONLY FOR double copy an scratch)
125typeset -r R_BUF=${SCRATCHDIR}/IGCM_OUT
126
127#====================================================
128#- BIG_DIR : BIG_DIR to store files waiting for rebuild
129typeset -r BIG_DIR=${BIG_DIR:=${SCRATCHDIR}/REBUILD}
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#- set PackDefault true on NEC front-end
144PackDefault=true
145
146#D-#==================================================
147#D-function IGCM_sys_RshMaster
148#D-* Purpose: Just a fake command to wrapp
149#D-           IGCM_card call in post-treatment
150#D-           Ulam do not see brodie filesystem
151#D-           Cesium do not see all mercure filesystem
152#D-           That's why we need this hack.
153#D-* Examples:
154#D-
155function IGCM_sys_RshMaster {
156  IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
157  /bin/ksh <<-EOF
158    export libIGCM=${libIGCM}
159    export DEBUG_debug=${DEBUG_debug}
160    . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
161    . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
162    ${@}
163EOF
164  if [ $? -gt 0 ] ; then
165    echo "IGCM_sys_RshMaster : erreur."
166    IGCM_debug_Exit "IGCM_sys_RshMaster"
167  fi
168  IGCM_debug_PopStack "IGCM_sys_RshMaster"
169}
170
171#D-#==================================================
172#D-function IGCM_sys_RshArchive
173#D-* Purpose: Archive rsh command
174#D-* Examples:
175#D-
176function IGCM_sys_RshArchive {
177  IGCM_debug_PushStack "IGCM_sys_RshArchive" $@
178  /bin/ksh <<-EOF
179    ${@}
180EOF
181  if [ $? -gt 0 ] ; then
182    echo "IGCM_sys_RshArchive : erreur."
183    IGCM_debug_Exit "IGCM_sys_RshArchive"
184  fi
185  IGCM_debug_PopStack "IGCM_sys_RshArchive"
186}
187
188#D-#==================================================
189#D-function IGCM_sys_RshPost
190#D-* Purpose: Post-process rsh command
191#D-* Examples:
192#D-
193function IGCM_sys_RshPost {
194  IGCM_debug_PushStack "IGCM_sys_RshPost" $@
195  if ( $DEBUG_sys ) ; then
196    echo "IGCM_sys_RshPost :" $@
197  fi
198  /bin/ksh ${@}
199  if [ $? -gt 0 ] ; then
200    echo "IGCM_sys_RshPost : erreur."
201    IGCM_debug_Exit "IGCM_sys_RshPost"
202  fi
203  IGCM_debug_PopStack "IGCM_sys_RshPost"
204}
205
206#D-#==================================================
207#D-function IGCM_sys_SendMail
208#D-* Purpose: Send mail when simulation is over
209#D-* Examples:
210#D-
211function IGCM_sys_SendMail {
212  IGCM_debug_PushStack "IGCM_sys_SendMail" $@
213  if ( $DEBUG_sys ) ; then
214    echo "IGCM_sys_SendMail :" $@
215  fi
216
217  if ( ${ExitFlag} ) ; then
218    status=failed
219  else
220    status=completed
221  fi
222
223  cat  << END_MAIL > job_end.mail
224Dear ${LOGIN},
225
226  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
227  Job started : ${DateBegin}
228  Job ended   : ${DateEnd}
229  Output files are available in ${R_SAVE}
230  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
231END_MAIL
232
233  if  [ X"${config_UserChoices_MailName}" != X ] ; then
234    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
235  elif [ -f ~/.forward ] ; then
236    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
237  else
238    mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < 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_IsFileArchived
409#D-* Purpose: Test file that must NOT EXISTS on Archive
410#D-* Examples:
411#D-
412function IGCM_sys_IsFileArchived {
413  IGCM_debug_PushStack "IGCM_sys_IsFileArchived" $@
414  if ( $DEBUG_sys ) ; then
415    echo "IGCM_sys_IsFileArchived :" $@
416  fi
417  typeset IsArchivedFlag
418  IsArchivedFlag=$( [ X$( echo $1 | grep ^\/ccc\/store ) != X ] && echo 0 || echo 1 )
419  IGCM_debug_PopStack "IGCM_sys_IsFileArchived"
420
421  return ${IsArchivedFlag}
422}
423
424#D-#==================================================
425#D-function IGCM_sys_TestFileArchive
426#D-* Purpose: Test file that must NOT EXISTS on Archive
427#D-* Examples:
428#D-
429function IGCM_sys_TestFileArchive {
430  IGCM_debug_PushStack "IGCM_sys_TestFileArchive" $@
431  typeset ExistFlag
432  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
433  IGCM_debug_PopStack "IGCM_sys_TestFileArchive"
434
435  return ${ExistFlag}
436}
437
438#D-#==================================================
439#D-function IGCM_sys_TestFileBuffer
440#D-* Purpose: Test file that must NOT EXISTS on Buffer
441#D-* Examples:
442#D-
443function IGCM_sys_TestFileBuffer {
444  IGCM_debug_PushStack "IGCM_sys_TestFileBuffer" $@
445  typeset ExistFlag
446  ExistFlag=$( [ -f $1 ] && echo 0 || echo 1 )
447  IGCM_debug_PopStack "IGCM_sys_TestFileBuffer"
448
449  return ${ExistFlag}
450}
451
452#D-#==================================================
453#D-function IGCM_sys_CountFileArchive
454#D-* Purpose: Count files on Archive filesystem
455#D-* Examples:
456#D-
457function IGCM_sys_CountFileArchive {
458  IGCM_debug_PushStack "IGCM_sys_CountFileArchive" $@
459  ls ${@} 2>/dev/null | wc -l
460  if [ $? -gt 0 ] ; then
461    echo "IGCM_sys_CountFileArchive : erreur."
462  fi
463  IGCM_debug_PopStack "IGCM_sys_CountFileArchive"
464}
465
466#D-#==================================================
467#D-function IGCM_sys_CountFileBuffer
468#D-* Purpose: Count files on Scratch filesystem
469#D-* Examples:
470#D-
471function IGCM_sys_CountFileBuffer {
472  IGCM_debug_PushStack "IGCM_sys_CountFileBuffer" $@
473  ls ${@} 2>/dev/null | wc -l
474  if [ $? -gt 0 ] ; then
475    echo "IGCM_sys_CountFileBuffer : erreur."
476  fi
477  IGCM_debug_PopStack "IGCM_sys_CountFileBuffer"
478}
479
480#D-#==================================================
481#D-function IGCM_sys_Tree
482#D-* Purpose: Tree directories with files on ${ARCHIVE}
483#D-* Examples: IGCM_sys_Tree ${R_IN} ${R_OUT}
484#D-
485function IGCM_sys_Tree {
486  IGCM_debug_PushStack "IGCM_sys_Tree" $@
487  if ( $DEBUG_sys ) ; then
488    echo "IGCM_sys_Tree :" $@
489  fi
490
491  \tree -f $@
492
493  IGCM_debug_PopStack "IGCM_sys_Tree"
494}
495
496#D-#==================================================
497#D-function IGCM_sys_Tar
498#D-* Purpose: master tar command
499#D-* Examples:
500#D-
501function IGCM_sys_Tar {
502  IGCM_debug_PushStack "IGCM_sys_Tar" $@
503  if ( $DEBUG_sys ) ; then
504    echo "IGCM_sys_Tar :" $@
505  fi
506  \tar cf $@
507  if [ $? -gt 0 ] ; then
508    echo "IGCM_sys_Tar : erreur."
509    IGCM_debug_Exit "IGCM_sys_Tar"
510  fi
511  IGCM_debug_PopStack "IGCM_sys_Tar"
512}
513
514#D-#==================================================
515#D-function IGCM_sys_UnTar
516#D-* Purpose: master un-tar command
517#D-* Examples:
518#D-
519function IGCM_sys_UnTar {
520  IGCM_debug_PushStack "IGCM_sys_UnTar" $@
521  if ( $DEBUG_sys ) ; then
522    echo "IGCM_sys_UnTar :" $@
523  fi
524  \tar xvf $1
525  if [ $? -gt 0 ] ; then
526    echo "IGCM_sys_UnTar : erreur."
527    IGCM_debug_Exit "IGCM_sys_UnTar"
528  fi
529  IGCM_debug_PopStack "IGCM_sys_UnTar"
530}
531
532#D-#==================================================
533#D-function IGCM_sys_QsubPost
534#D-* Purpose: Qsub new job on scalaire
535#D-* Examples:
536#D-
537function IGCM_sys_QsubPost {
538  IGCM_debug_PushStack "IGCM_sys_QsubPost" $@
539  if ( $DEBUG_sys ) ; then
540    echo "IGCM_sys_QsubPost :" $@
541  fi
542  /usr/bin/nqsII/qsub -q scalaire -o ${POST_DIR}/${Script_Post_Output}.out ${libIGCM}/$1.job -v ${listVarEnv}
543  if [ $? -gt 0 ] ; then
544    echo "IGCM_sys_QsubPost : erreur " $@
545    IGCM_debug_Exit "IGCM_sys_QsubPost"
546  fi
547  IGCM_debug_PopStack "IGCM_sys_QsubPost"
548}
549
550#D-*************************
551#D- File transfer functions
552#D-*************************
553#D-
554
555#D-#==================================================
556#D-function IGCM_sys_Rsync_out
557#D-* Purpose: treat return val of rsync
558#D-* Examples: IGCM_sys_Rsync_out out_RET_rsync
559#D-  Error values and explanations can depend on your system version.
560function IGCM_sys_Rsync_out {
561  RET=$1
562  if [ ! $RET ] ; then
563    echo "rsync error !"
564  fi
565
566  if [ $MYLANG = "fr" ]; then
567    case $RET in
568    0)  return ;;
569    1)  echo "Erreur de rsync ; RERR_SYNTAX : "
570      echo "Erreur de syntaxe ou d'utilisation."
571      return;;
572    2)  echo "Erreur de rsync ; RERR_PROTOCOL : "
573      echo "Incompatibilité de protocole."
574      return;;
575    3)  echo "Erreur de rsync ; RERR_FILESELECT 3"
576      echo "Erreurs  lors  de  la  sélection des fichiers d'entrée sortie et"
577      echo "répertoires"
578      return;;
579    4)  echo "Erreur de rsync ; RERR_UNSUPPORTED"
580      echo "Action demandée non supportée : une tentative de manipulation de"
581      echo "fichiers  64-bits  sur une plate-forme qui ne les supporte pas a"
582      echo "été faite ; ou une option qui est supportée par le  client  mais"
583      echo "pas par le serveur a été spécifiée."
584      return;;
585    10) echo "Erreur de rsync ; RERR_SOCKETIO"
586      echo "Erreur dans le socket d'entrée sortie"
587      return;;
588    11) echo "Erreur de rsync ; RERR_FILEIO"
589      echo "Erreur d'entrée sortie fichier"
590      return;;
591    12) echo "Erreur de rsync ; RERR_STREAMIO"
592      echo "Erreur dans flux de donnée du protocole rsync"
593      return;;
594    13) echo "Erreur de rsync ; RERR_MESSAGEIO"
595      echo "Erreur avec les diagnostics du programme"
596      return;;
597    14) echo "Erreur de rsync ; RERR_IPC"
598      echo "Erreur dans le code IPC"
599      return;;
600    20) echo "Erreur de rsync ; RERR_SIGNAL"
601      echo "SIGUSR1 ou SIGINT reçu"
602      return;;
603    21) echo "Erreur de rsync ; RERR_WAITCHILD"
604      echo "Une erreur retournée par waitpid()"
605      return;;
606    22) echo "Erreur de rsync ; RERR_MALLOC"
607      echo "Erreur lors de l'allocation des tampons de mémoire de coeur"
608      return;;
609    23) echo ""
610      echo "Erreur fichier inexistant"
611      return;;
612    30) echo "Erreur de rsync ; RERR_TIMEOUT"
613      echo "Temps d'attente écoulé dans l'envoi/réception de données"
614      return;;
615    *)  echo "Erreur de rsync : code de retour de rsync inconnu :" $RET
616      return;;
617    esac
618  elif [ $MYLANG = "en" ] ; then
619    case $RET in
620    0)  return;;
621    1)  echo "rsync error : Syntax or usage error "
622      return;;
623    2)  echo "rsync error : Protocol incompatibility "
624      return;;
625    3)  echo "rsync error : Errors selecting input/output files, dirs"
626      return;;
627    4)  echo "rsync error : Requested action not supported: an attempt"
628      echo "was made to manipulate 64-bit files on a platform that cannot support"
629      echo "them; or an option was specified that is supported by the client and"
630      echo "not by the server."
631      return;;
632    5)  echo "rsync error : Error starting client-server protocol"
633      return;;
634    10) echo "rsync error : Error in socket I/O "
635      return;;
636    11) echo "rsync error : Error in file I/O "
637      return;;
638    12) echo "rsync error : Error in rsync protocol data stream "
639      return;;
640    13) echo "rsync error : Errors with program diagnostics "
641      return;;
642    14) echo "rsync error : Error in IPC code "
643      return;;
644    20) echo "rsync error : Received SIGUSR1 or SIGINT "
645      return;;
646    21) echo "rsync error : Some error returned by waitpid() "
647      return;;
648    22) echo "rsync error : Error allocating core memory buffers "
649      return;;
650    23) echo "rsync error : Partial transfer due to error"
651      return;;
652    24) echo "rsync error : Partial transfer due to vanished source files"
653      return;;
654    30) echo "rsync error : Timeout in data send/receive "
655      return;;
656    *)  echo "rsync error : return code of rsync unknown :" $RET
657      return;;
658    esac
659  else
660    echo "unknown language $MYLANG."
661    return
662  fi
663}
664
665#D-#==================================================
666#D-function IGCM_sys_Cp
667#D-* Purpose: generic cp
668#D-* Examples:
669#D-
670function IGCM_sys_Cp {
671  IGCM_debug_PushStack "IGCM_sys_Cp" $@
672  if ( $DEBUG_sys ) ; then
673    echo "IGCM_sys_Cp :" $@
674  fi
675
676  typeset RET
677
678  echo cp $@ > out_rsync 2>&1
679  \cp $@ >> out_rsync 2>&1
680  RET=$?
681
682  if [ ${RET} -gt 0 ] ; then
683    echo "IGCM_sys_Cp : error."
684    cat out_rsync
685    IGCM_debug_Exit "IGCM_sys_Cp"
686  else
687    \rm out_rsync
688  fi
689  IGCM_debug_PopStack "IGCM_sys_Cp"
690}
691
692#D-#==================================================
693#D-function IGCM_sys_Rm
694#D-* Purpose: generic rm
695#D-* Examples:
696#D-
697function IGCM_sys_Rm {
698  IGCM_debug_PushStack "IGCM_sys_Rm" -- $@
699  if ( $DEBUG_sys ) ; then
700    echo "IGCM_sys_Rm :" $@
701  fi
702
703  typeset RET
704
705  echo rm $@ > out_rsync 2>&1
706  \rm $@ >> out_rsync 2>&1
707  RET=$?
708
709  if [ ${RET} -gt 0 ] ; then
710    echo "IGCM_sys_Rm : error."
711    cat out_rsync
712    IGCM_debug_Exit "IGCM_sys_Rm"
713  else
714    \rm out_rsync
715  fi
716  IGCM_debug_PopStack "IGCM_sys_Rm"
717}
718
719#D-#==================================================
720#D-function IGCM_sys_RmRunDir
721#D-* Purpose: rm tmpdir (dummy function most of the time batch
722#D-                      scheduler will do the job)
723#D-           Dummy function on mercure front-end
724#D-* Examples:
725#D-
726function IGCM_sys_RmRunDir {
727    IGCM_debug_PushStack "IGCM_sys_RmRunDir" -- $@
728    if ( $DEBUG_sys ) ; then
729        echo "IGCM_sys_RmRunDir :" $@
730        echo "Dummy call, let the scheduler do that."
731    fi
732    IGCM_debug_PopStack "IGCM_sys_RmRunDir"
733}
734
735#D-#==================================================
736#D-function IGCM_sys_Mv
737#D-* Purpose: generic move
738#D-* Examples:
739#D-
740function IGCM_sys_Mv {
741  IGCM_debug_PushStack "IGCM_sys_Mv" $@
742  if ( $DEBUG_sys ) ; then
743    echo "IGCM_sys_Mv :" $@
744  fi
745
746  if [ $DRYRUN = 0 ]; then
747
748    typeset RET
749
750    echo mv $@ > out_rsync 2>&1
751    \mv $@ >> out_rsync 2>&1
752    RET=$?
753
754    if [ ${RET} -gt 0 ] ; then
755      echo "IGCM_sys_Mv : error in mv."
756      cat out_rsync
757      IGCM_debug_Exit "IGCM_sys_Mv"
758    else
759      \rm out_rsync
760    fi
761  else
762    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
763  fi
764
765  IGCM_debug_PopStack "IGCM_sys_Mv"
766}
767
768#D-#==================================================
769#D-function IGCM_sys_Put_Dir
770#D-* Purpose: Copy a complete directory on $(ARCHIVE)
771#D-* Examples:
772#D-
773function IGCM_sys_Put_Dir {
774  IGCM_debug_PushStack "IGCM_sys_Put_Dir" $@
775  if ( $DEBUG_sys ) ; then
776    echo "IGCM_sys_Put_Dir :" $@
777  fi
778  if [ $DRYRUN = 0 ]; then
779    if [ ! -d ${1} ] ; then
780      echo "WARNING : IGCM_sys_Put_Dir ${1} DOES NOT EXIST ."
781      IGCM_debug_PopStack "IGCM_sys_Put_Dir"
782      return
783    fi
784
785    typeset RET
786
787    # Only if we use rsync
788    #IGCM_sys_TestDirArchive $( dirname $2 )
789    #
790    #USUAL WAY
791    \cp -r $1 $2 > out_rsync 2>&1
792    RET=$?
793
794    if [ ${RET} -gt 0 ] ; then
795      echo "IGCM_sys_Put_Dir : error."
796      cat out_rsync
797      IGCM_debug_Exit "IGCM_sys_Put_Dir"
798    else
799      \rm out_rsync
800    fi
801  else
802    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
803  fi
804  IGCM_debug_PopStack "IGCM_sys_Put_Dir"
805}
806
807#D-#==================================================
808#D-function IGCM_sys_Get_Dir
809#D-* Purpose: Copy a complete directory from ${ARCHIVE}
810#D-* Examples:
811#D-
812function IGCM_sys_Get_Dir {
813  IGCM_debug_PushStack "IGCM_sys_Get_Dir" $@
814  if ( $DEBUG_sys ) ; then
815    echo "IGCM_sys_Get_Dir :" $@
816  fi
817  if [ $DRYRUN = 0 ]; then
818#    if [ ! -d ${1} ] ; then
819#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
820#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
821#      return
822#    fi
823
824    typeset RET
825
826    # Only if we use rsync
827    #IGCM_sys_TestDirArchive $( dirname $2 )
828    #
829    #USUAL WAY
830    # add dmget (to demigrate all offline files) to reduce time of this command :
831    #dmget $1/*
832    ccc_hsm get $1/*
833    \cp -r $1 $2 > out_rsync 2>&1
834    RET=$?
835
836    if [ ${RET} -gt 0 ] ; then
837      echo "IGCM_sys_Get_Dir : error."
838      cat out_rsync
839      IGCM_debug_Exit "IGCM_sys_Get_Dir"
840    else
841      \rm out_rsync
842    fi
843  else
844    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
845  fi
846  IGCM_debug_PopStack "IGCM_sys_Get_Dir"
847}
848
849#D-#==================================================
850#D-function IGCM_sys_Get_Master
851#D-* Purpose: Copy a complete directory from MASTER filesystem
852#D-* Examples:
853#D-
854function IGCM_sys_Get_Master {
855  IGCM_debug_PushStack "IGCM_sys_Get_Master" $@
856  if ( $DEBUG_sys ) ; then
857    echo "IGCM_sys_Get_Master :" $@
858  fi
859  if [ $DRYRUN = 0 ]; then
860    if ( [ ! -d ${1} ] && [ ! -f ${1} ] ) ; then
861      echo "WARNING : IGCM_sys_Get_Master ${1} DOES NOT EXIST ."
862      IGCM_debug_PopStack "IGCM_sys_Get_Master"
863      return
864    fi
865
866    typeset RET
867
868    #USUAL WAY
869    \cp -rL $1 $2 > out_rsync 2>&1
870    RET=$?
871
872    if [ ${RET} -gt 0 ] ; then
873      echo "IGCM_sys_Get_Master : error."
874      cat out_rsync
875      IGCM_debug_Exit "IGCM_sys_Get_Master"
876    else
877      \rm out_rsync
878    fi
879  else
880    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
881  fi
882  IGCM_debug_PopStack "IGCM_sys_Get_Master"
883}
884
885#D-#==================================================
886#D-function IGCM_sys_Put_Rest
887#D-* Purpose: Put computied restarts on ${ARCHIVE}.
888#D-           File and target directory must exist.
889#D-* Examples:
890#D-
891function IGCM_sys_Put_Rest {
892  IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
893  if ( $DEBUG_sys ) ; then
894    echo "IGCM_sys_Put_Rest :" $@
895  fi
896  if [ $DRYRUN = 0 ]; then
897    if [ ! -f ${1} ] ; then
898      echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
899      IGCM_debug_Exit "IGCM_sys_Put_Rest"
900    fi
901
902    typeset RET
903    #
904    if [ X${JobType} = XRUN ] ; then
905      IGCM_sys_Chmod 444 ${1}
906    fi
907
908    #
909    # USUAL WAY
910    \cp $1 $2 > out_rsync 2>&1
911    RET=$?
912
913#       #RSYNC WITH NETWORK SSH CALL
914#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
915#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
916
917#       #RSYNC WITH NFS USE
918#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
919#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
920
921#       RET=$?
922#       IGCM_sys_Rsync_out $RET
923
924#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
925#       (( RET=RET+$? ))
926
927    if [ ${RET} -gt 0 ] ; then
928      echo "IGCM_sys_Put_Rest : error."
929      cat out_rsync
930      IGCM_debug_Exit "IGCM_sys_Put_Rest"
931    else
932      \rm out_rsync
933    fi
934  else
935    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
936  fi
937  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
938}
939
940#D-#==================================================
941#D-function IGCM_sys_PutBuffer_Rest
942#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
943#D-           File and target directory must exist.
944#D-* Examples:
945#D-
946function IGCM_sys_PutBuffer_Rest {
947  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
948  if ( $DEBUG_sys ) ; then
949    echo "IGCM_sys_PutBuffer_Rest :" $@
950  fi
951  if [ $DRYRUN = 0 ]; then
952    if [ ! -f ${1} ] ; then
953      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
954      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
955    fi
956
957    typeset RET
958    #
959    if [ X${JobType} = XRUN ] ; then
960      IGCM_sys_Chmod 444 ${1}
961    fi
962
963    #
964    # USUAL WAY
965    \cp $1 $2 > out_rsync 2>&1
966    RET=$?
967
968    if [ ${RET} -gt 0 ] ; then
969      echo "IGCM_sys_PutBuffer_Rest : error."
970      cat out_rsync
971      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
972    else
973      \rm out_rsync
974    fi
975  else
976    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
977  fi
978  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Rest"
979}
980
981#D-#==================================================
982#D-function IGCM_sys_Put_Out
983#D-* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly
984#D-* Examples:
985#D-
986function IGCM_sys_Put_Out {
987  IGCM_debug_PushStack "IGCM_sys_Put_Out" $@
988  if ( $DEBUG_sys ) ; then
989    echo "IGCM_sys_Put_Out :" $@
990  fi
991
992  typeset NB_ESSAI DELAI status i exist skip
993
994  # number of tentative
995  NB_ESSAI=3
996  # time delay between tentative
997  DELAI=2
998
999  if [ $DRYRUN = 0 ]; then
1000    if [ ! -f ${1} ] ; then
1001      echo "WARNING : IGCM_sys_Put_Out ${1} DOES NOT EXIST ."
1002      IGCM_debug_PopStack "IGCM_sys_Put_Out"
1003      return 1
1004    fi
1005    #
1006    IGCM_sys_MkdirArchive $( dirname $2 )
1007    #
1008
1009    #=====================================================
1010    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
1011    #=====================================================
1012
1013    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
1014    #if [ $? -eq 0 ] ; then
1015    #    typeset WORKPATH FILEPATH
1016    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
1017    #    IGCM_sys_MkdirWork ${WORKPATH}
1018    #    FILEPATH=${WORKPATH}/$( basename $2 )
1019    #    #
1020    #    IGCM_sys_Cp ${1} ${FILEPATH}
1021    #fi
1022
1023    if [ X${JobType} = XRUN ] ; then
1024      if [ X${3} = X ] ; then
1025        IGCM_sys_Chmod 444 ${1}
1026      fi
1027    fi
1028    #
1029
1030    exist=false
1031    skip=false
1032    if [ -f $2 ] ; then
1033      IGCM_debug_Print 1 "$2 already exist"
1034      #dmget $2
1035      ccc_hsm get $2
1036      exist=true
1037      if [ "X$( diff $1 $2 )" = X ] ; then
1038        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
1039        skip=true
1040      else
1041        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
1042        skip=false
1043      fi
1044    fi
1045    #
1046    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
1047      IGCM_sys_Chmod u+w $2
1048    fi
1049
1050    if [ X${skip} = Xfalse ] ; then
1051      (( i = 0 ))
1052      while [ $i -lt $NB_ESSAI ] ; do
1053        # USUAL WAY
1054        \cp $1 $2 > out_rsync 2>&1
1055        status=$?
1056        if [ ${status} -gt 0 ]; then
1057          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}"
1058          IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
1059          sleep $DELAI
1060        else
1061          break
1062        fi
1063        (( i = i + 1 ))
1064      done
1065    fi
1066
1067#       #RSYNC WITH NETWORK SSH CALL
1068#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
1069#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
1070
1071#       #RSYNC WITH NFS USE
1072#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
1073#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
1074
1075#       status=$?
1076#       IGCM_sys_Rsync_out $status
1077
1078#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
1079#       (( status=status+$? ))
1080
1081    if [ ${status} -gt 0 ] ; then
1082      echo "IGCM_sys_Put_Out : error."
1083      cat out_rsync
1084      IGCM_debug_Exit "IGCM_sys_Put_Out"
1085    else
1086      \rm out_rsync
1087    fi
1088  else
1089    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1090  fi
1091  IGCM_debug_PopStack "IGCM_sys_Put_Out"
1092  return 0
1093}
1094
1095#D-#==================================================
1096#D-function IGCM_sys_PutBuffer_Out
1097#D-* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly
1098#D-* Examples:
1099#D-
1100function IGCM_sys_PutBuffer_Out {
1101  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Out" $@
1102  if ( $DEBUG_sys ) ; then
1103    echo "IGCM_sys_PutBuffer_Out :" $@
1104  fi
1105
1106  typeset NB_ESSAI DELAI status i exist skip
1107
1108  # number of tentative
1109  NB_ESSAI=3
1110  # time delay between tentative
1111  DELAI=2
1112
1113  if [ $DRYRUN = 0 ]; then
1114    if [ ! -f ${1} ] ; then
1115      echo "WARNING : IGCM_sys_PutBuffer_Out ${1} DOES NOT EXIST ."
1116      IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
1117      return 1
1118    fi
1119    #
1120    IGCM_sys_Mkdir $( dirname $2 )
1121    #
1122
1123    if [ X${JobType} = XRUN ] ; then
1124      if [ X${3} = X ] ; then
1125        IGCM_sys_Chmod 444 ${1}
1126      fi
1127    fi
1128
1129    exist=false
1130    skip=false
1131    if [ -f $2 ] ; then
1132      IGCM_debug_Print 1 "$2 already exist"
1133      exist=true
1134      if [ "X$( diff $1 $2 )" = X ] ; then
1135        IGCM_debug_Print 2 "$1 and $2 are the same file, we skip the copy"
1136        skip=true
1137      else
1138        IGCM_debug_Print 2 "$1 and $2 are not the same file, we force the copy"
1139        skip=false
1140      fi
1141    fi
1142    #
1143    if ( [ X${exist} = Xtrue ] && [ X${skip} = Xfalse ] ) ; then
1144      IGCM_sys_Chmod u+w $2
1145    fi
1146
1147    if [ X${skip} = Xfalse ] ; then
1148      i=0
1149      while [ $i -lt $NB_ESSAI ] ; do
1150        # USUAL WAY
1151        #\cp $1 $2 > out_rsync 2>&1
1152        \mv $1 $2 > out_rsync 2>&1
1153        status=$?
1154        if [ ${status} -gt 0 ]; then
1155          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed ${i}/${NB_ESSAI}"
1156          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again."
1157          sleep $DELAI
1158        else
1159          break
1160        fi
1161        (( i = i + 1 ))
1162      done
1163    fi
1164
1165    if [ ${status} -gt 0 ] ; then
1166      echo "IGCM_sys_PutBuffer_Out : error."
1167      cat out_rsync
1168      IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
1169    else
1170      \rm out_rsync
1171    fi
1172  else
1173    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1174  fi
1175  IGCM_debug_PopStack "IGCM_sys_PutBuffer_Out"
1176  return 0
1177}
1178
1179#D-#==================================================
1180#D-function IGCM_sys_Get
1181#D-* Purpose: Get a file from ${ARCHIVE}
1182#D-* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX
1183#D-            IGCM_sys_Get /l Array_contain_myfiles /destpath/
1184function IGCM_sys_Get {
1185  IGCM_debug_PushStack "IGCM_sys_Get" $@
1186
1187  typeset DEST RET dm_liste ifile target file_work
1188  typeset NB_ESSAI DELAI status i
1189
1190  if ( $DEBUG_sys ) ; then
1191    echo "IGCM_sys_Get :" $@
1192  fi
1193
1194  # number of tentative
1195  NB_ESSAI=3
1196  # time delay between tentative
1197  DELAI=2
1198
1199  if [ $DRYRUN -le 2 ]; then
1200    if [ X${1} = X'/l' ] ; then
1201      # test if the first file is present in the old computation :
1202      eval set +A dm_liste \${${2}}
1203    else
1204      eval set +A dm_liste ${1}
1205    fi
1206    eval DEST=\${${#}}
1207
1208    #=====================================================
1209    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
1210    #=====================================================
1211
1212    # Is it an R_OUT file (not R_IN) ?
1213    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
1214    #if [ $? -eq 0 ] ; then
1215    #    # Yes  ? then we try to get it in SCRATCHDIR
1216    #    set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
1217    #    if [ -f ${file_work[0]} ] ; then
1218    #   IGCM_sys_Cp ${file_work[*]} ${DEST}
1219    #   IGCM_debug_PopStack "IGCM_sys_Get"
1220    #   return
1221    #    fi
1222    #fi
1223
1224    ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
1225    RET=$?
1226    if [ ${RET} -gt 0 ] ; then
1227      echo "WARNING IGCM_sys_Get : demigration error."
1228      cat out_rsync
1229      echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
1230    fi
1231
1232    #if [ ${RET} -gt 0 ] ; then
1233    #    if [ ! "X$( grep "Lost dmusrcmd connection" out_rsync )" = "X" ] ; then
1234    #   cat out_rsync
1235    #   echo "WARNING IGCM_sys_Get : Lost dmusrcmd connection : "
1236    #   sleep 30
1237    #   echo "We try another time"
1238    ##  dmget ${dm_liste[*]} > out_rsync 2>&1
1239    #   ccc_hsm get ${dm_liste[*]} > out_rsync 2>&1
1240    #   RET=$?
1241    #   if [ ${RET} -gt 0 ] ; then
1242    #       echo "ERROR IGCM_sys_Get : again demigration error :"
1243    #       cat out_rsync
1244    #       IGCM_debug_Exit "IGCM_sys_Get"
1245    #   fi
1246    #    else
1247    #   echo "ERROR IGCM_sys_Get : demigration error :"
1248    #   cat out_rsync
1249    #   IGCM_debug_Exit "IGCM_sys_Get"
1250    #    fi
1251    #fi
1252
1253    #USUAL WAY
1254    if [ X${1} = X'/l' ] ; then
1255      (( RET=0 ))
1256      for target in ${dm_liste[*]} ; do
1257        local_file=$( basename ${target} )
1258        (( i = 0 ))
1259        # test if the target file is present before the loop
1260        IGCM_sys_TestFileArchive ${target}
1261        RET=$?
1262        if [ ${RET} -gt 0 ] ; then
1263          echo "IGCM_sys_Get, ERROR : regular file ${target} DOES NOT EXIST ."
1264          IGCM_debug_Exit "IGCM_sys_Get"
1265        else
1266          while [ $i -lt $NB_ESSAI ] ; do
1267            \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
1268            status=$?
1269            if [ ${status} -gt 0 ]; then
1270              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed ${i}/${NB_ESSAI}"
1271              IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
1272              sleep $DELAI
1273            else
1274              break
1275            fi
1276            (( i = i + 1 ))
1277          done
1278          (( RET = RET + status ))
1279        fi
1280      done
1281    else
1282      \cp ${dm_liste} ${DEST} >> out_rsync 2>&1
1283      RET=$?
1284    fi
1285
1286#       #RSYNC WITH NETWORK SSH CALL
1287#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} > out_rsync 2>&1
1288#       ${RSYNC} ${RSYNC_opt} -e ssh ${STOREHOST}:"${dm_liste}" ${STOREHOST}:${RUN_DIR}/${DEST} >> out_rsync 2>&1
1289
1290#       #RSYNC WITH NFS USE
1291#       echo ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} > out_rsync 2>&1
1292#       ${RSYNC} ${RSYNC_opt} ${dm_liste} ${RUN_DIR}/${DEST} >> out_rsync 2>&1
1293
1294#       RET=$?
1295#       IGCM_sys_Rsync_out $RET
1296
1297#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
1298#       (( RET=RET+$? ))
1299
1300    if [ ${RET} -gt 0 ] ; then
1301      echo "IGCM_sys_Get : copy error."
1302      cat out_rsync
1303#      IGCM_debug_Exit "IGCM_sys_Get"
1304    else
1305      \rm out_rsync
1306    fi
1307  else
1308    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1309  fi
1310  IGCM_debug_PopStack "IGCM_sys_Get"
1311}
1312
1313#D-#==================================================
1314#D-function IGCM_sys_GetBuffer
1315#D-* Purpose: Get a file from ${SCRATCHDIR}
1316#D-* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX
1317#D-            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/
1318function IGCM_sys_GetBuffer {
1319  IGCM_debug_PushStack "IGCM_sys_GetBuffer" $@
1320
1321  typeset DEST RET buf_liste ifile target file_work
1322
1323  if ( $DEBUG_sys ) ; then
1324    echo "IGCM_sys_GetBuffer :" $@
1325  fi
1326  if [ $DRYRUN -le 2 ]; then
1327    if [ X${1} = X'/l' ] ; then
1328      # test if the first file is present in the old computation :
1329      eval set +A buf_liste \${${2}}
1330    else
1331      eval set +A buf_liste ${1}
1332    fi
1333    eval DEST=\${${#}}
1334
1335    #USUAL WAY
1336    if [ X${1} = X'/l' ] ; then
1337      (( RET=0 ))
1338      for target in ${buf_liste[*]} ; do
1339        local_file=$( basename ${target} )
1340        \cp ${target} ${DEST}/${local_file} >> out_rsync 2>&1
1341        (( RET = RET + $? ))
1342      done
1343    else
1344      \cp ${buf_liste} ${DEST} >> out_rsync 2>&1
1345      RET=$?
1346    fi
1347
1348    if [ ${RET} -gt 0 ] ; then
1349      echo "IGCM_sys_GetBuffer : copy error."
1350      cat out_rsync
1351      IGCM_debug_Exit "IGCM_sys_GetBuffer"
1352    else
1353      \rm out_rsync
1354    fi
1355  else
1356    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1357  fi
1358  IGCM_debug_PopStack "IGCM_sys_GetBuffer"
1359}
1360
1361#D-#==================================================
1362#D-function IGCM_sys_GetDate_FichWork
1363#D-* Purpose: donne la date filesys d'un fichier sur le filesystem WORK
1364#D-* Examples:
1365#D-
1366function IGCM_sys_GetDate_FichWork {
1367  IGCM_debug_PushStack "IGCM_sys_FichWork" $@
1368  if ( $DEBUG_sys ) ; then
1369    echo "IGCM_sys_GetDate_FichWork :" $@
1370  fi
1371  # donne la date filesys d'un fichier sur la machine work
1372  IGCM_debug_PopStack "IGCM_sys_FichWork"
1373}
1374
1375#D-#==================================================
1376#D-function IGCM_sys_GetDate_FichArchive
1377#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
1378#D-* Examples:
1379#D-
1380function IGCM_sys_GetDate_FichArchive {
1381  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
1382  if ( $DEBUG_sys ) ; then
1383    echo "IGCM_sys_GetDate_FichArchive :" $@
1384  fi
1385  IGCM_debug_PopStack "IGCM_sys_FichArchive"
1386}
1387
1388#D-#==================================================
1389#D-function IGCM_sys_Dods_Rm
1390#D-* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole.
1391#D-* Examples:
1392#D-
1393function IGCM_sys_Dods_Rm {
1394  if ( $DEBUG_sys ) ; then
1395    echo "IGCM_sys_Dods_Rm :" $@
1396  fi
1397  typeset RET
1398  RET=0
1399  if [ $DRYRUN = 0 ]; then
1400
1401#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
1402#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
1403#      echo "Nothing has been done."
1404#      return
1405#    fi
1406
1407    /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
1408    RET=$?
1409
1410#       if [ ${RET} -gt 0 ] ; then
1411#           echo "IGCM_sys_Dods_Rm : error."
1412#           cat out_dods_rm
1413#           IGCM_debug_Exit "IGCM_sys_Dods_Rm"
1414#       else
1415#           rm out_dods_rm
1416#       fi
1417
1418  else
1419    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1420  fi
1421  return $RET
1422}
1423
1424#D-#==================================================
1425#D-function IGCM_sys_Dods_Cp
1426#D-* Purpose: Copy $(ARCHIVE) files on DODS internet protocole.
1427#D-* Examples:
1428#D-
1429function IGCM_sys_Dods_Cp {
1430  if ( $DEBUG_sys ) ; then
1431    echo "IGCM_sys_Dods_Cp :" $@
1432  fi
1433  typeset RET
1434  RET=0
1435  if [ $DRYRUN = 0 ]; then
1436
1437#    if [ ! -d ${R_SAVE}/${1} ] ; then
1438#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
1439#      echo "Nothing has been done."
1440#      return
1441#    fi
1442
1443    /ccc/cont003/home/dsm/p86ipsl/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
1444    RET=$?
1445
1446#       if [ ${RET} -gt 0 ] ; then
1447#           echo "IGCM_sys_Dods_Cp : error."
1448#           cat out_dods_cp
1449#           IGCM_debug_Exit "IGCM_sys_Dods_Cp"
1450#       else
1451#           rm out_dods_cp
1452#       fi
1453
1454  else
1455    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1456  fi
1457  return $RET
1458}
1459
1460#D-#==================================================
1461#D-function IGCM_sys_Put_Dods
1462#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
1463#D-* Examples:
1464#D-
1465function IGCM_sys_Put_Dods {
1466  IGCM_debug_PushStack "IGCM_sys_Put_Dods" $@
1467  if ( $DEBUG_sys ) ; then
1468    echo "IGCM_sys_Put_Dods :" $@
1469  fi
1470  typeset RET
1471  if [ $DRYRUN = 0 ]; then
1472    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
1473      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
1474      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
1475      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
1476      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1477      return
1478    fi
1479
1480    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
1481      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
1482      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
1483      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
1484      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1485      return
1486    fi
1487    #
1488    if [ -d ${R_SAVE}/${1} ] ; then
1489      cd ${R_SAVE}
1490    elif [ -d ${R_FIGR}/${1} ] ; then
1491      cd ${R_FIGR}
1492    fi
1493
1494    IGCM_sys_Dods_Rm ${1}
1495    IGCM_sys_Dods_Cp ${1}
1496    RET=0
1497
1498    if [ ${RET} -gt 0 ] ; then
1499      echo "IGCM_sys_Put_Dods : error."
1500      IGCM_debug_Exit "IGCM_sys_Put_Dods"
1501    fi
1502  else
1503    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
1504  fi
1505  IGCM_debug_PopStack "IGCM_sys_Put_Dods"
1506}
1507
1508##############################################################
1509# REBUILD OPERATOR
1510
1511function IGCM_sys_rebuild {
1512  IGCM_debug_PushStack "IGCM_sys_rebuild" -- $@
1513  if ( $DEBUG_sys ) ; then
1514    echo "IGCM_sys_rebuild :" $@
1515  fi
1516  /home/cont003/p86ipsl/X86_64/bin/rebuild -f -o $@
1517  if [ $? -gt 0 ] ; then
1518    echo "IGCM_sys_rebuild : erreur ${@}."
1519    IGCM_debug_Exit "rebuild"
1520  fi
1521
1522  IGCM_debug_PopStack "IGCM_sys_rebuild"
1523}
1524
1525function IGCM_sys_rebuild_station {
1526  IGCM_debug_PushStack "IGCM_sys_rebuild_station" -- $@
1527  typeset i list_opt file_in file_out prefix_invert list_invert
1528  if ( $DEBUG_sys ) ; then
1529    echo "IGCM_sys_rebuild_station :" $@
1530  fi
1531  list_opt=$@
1532
1533  # Invert Axis : t,x -> x,t
1534  #               t,pres,x -> x,t,pres
1535  # So that we can concatenate along x
1536  i=0
1537  for file_in in ${list_opt} ; do
1538    (( i = i + 1))
1539    [ ${i} = 1 ] && file_out=${file_in} && continue
1540    prefix_invert=$( basename ${file_in} .nc )
1541    IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs ${file_in} ${prefix_invert}_xt.nc
1542    list_invert[${#list_invert[*]}]=${prefix_invert}_xt.nc
1543  done
1544
1545  # Concatenate
1546  IGCM_sys_ncrcat ${list_invert[*]} histstn_xt.nc
1547
1548  # Re-ivert file
1549  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
1550
1551  # Station re-ordering is too expansive to be run within libICGM
1552  # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
1553  # This re-ordering must be done "in memory" by the cmorization process
1554  # Anyway this is the best sequence using (ncpdq - nrcat - ncpdq)
1555  # BEGIN reordering
1556
1557  # Only LMDZ text output contains the exact ordering of the station.
1558  # We isolate this in the code below:
1559  #  0  38  -157.5000000000000  70.98591549295774
1560  #  0  54  27.49999999999999   67.18309859154928
1561  #  0  56  -62.50000000000001  82.39436619718309
1562  #  0  79  12.49999999999999   78.59154929577466
1563  #  0  116 -165.0000000000000  76.05633802816901
1564  #  0  117 130.0000000000000   70.98591549295774
1565  #  0  118 110.0000000000000   87.46478873239437
1566  #  1  40  4.999999999999995   51.97183098591550
1567#  typeset iStation iProc list_opt file_in file_out prefix_invert
1568#  typeset -Z4 j4
1569#  typeset -Z3 j3
1570
1571#  unset list_opt
1572#  set +A list_opt $@
1573
1574  # Filename after rebuild
1575#  file_out=${list_opt[0]}
1576  # Prefix of output files
1577#  prefix_invert=$( basename ${file_out} .nc )
1578  # Number of procs
1579#  num_proc=$( grep -i mpi_size ${PREFIX}_${Exe_Output} | wc -l )
1580
1581#  iProc=0
1582#  while [ ${iProc} -lt ${num_proc} ] ; do
1583    # Array containing Station as a number
1584#    unset proc_stn
1585#    set +A proc_stn $( grep "iophy_mpi rank ip lon lat  $iProc" ${PREFIX}_${Exe_Output} | sed -e "s/iophy_mpi rank ip lon lat //g" | awk ' {print $2}' )
1586    # Number of stations produced by processor proc
1587#    stationLast=${#proc_stn[*]}
1588    # Proc number on 4 digits
1589#    j4=${iProc}
1590    # Init
1591#    iStation=0
1592#    while [ ${iStation} -lt ${stationLast} ] ; do
1593      # Station number on 3 digits
1594#      j3=${proc_stn[${iStation}]}
1595      # Extract station
1596      # Invert Axis : t,x -> x,t
1597      #               t,pres,x -> x,t,pres
1598      # So that we can concatenate along x
1599#      IGCM_sys_ncpdq -a x,time_counter -a x,time_counter,presnivs -d x,$iStation,$iStation ${prefix_invert}_${j4}.nc ${prefix_invert}_stn_${j3}.nc
1600#      (( iStation = iStation + 1 ))
1601#    done
1602#    (( iProc = iProc + 1 ))
1603#  done
1604
1605  # Concatenate all station along x
1606#  IGCM_sys_ncrcat ${prefix_invert}_stn_???.nc ${prefix_invert}_xt.nc
1607
1608  # Re-invert file
1609#  IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x ${prefix_invert}_xt.nc ${file_out}
1610
1611  # END reordering
1612
1613  IGCM_debug_PopStack "IGCM_sys_rebuild_station"
1614}
1615
1616############################################################
1617# Check of space available on temporary filesytems
1618function IGCM_sys_check_quota {
1619    IGCM_debug_PushStack "IGCM_sys_check_quota"
1620    if ( $DEBUG_sys ) ; then
1621        echo "IGCM_sys_check_quota"
1622    fi
1623    IGCM_debug_PopStack "IGCM_sys_check_quota"
1624}
1625
1626##############################################################
1627# NCO OPERATOR
1628
1629function IGCM_sys_ncap2 {
1630  IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@
1631  if ( $DEBUG_sys ) ; then
1632    echo "IGCM_sys_ncap2 :" $@
1633  fi
1634  ncap2 "$@"
1635  if [ $? -gt 0 ] ; then
1636    echo "IGCM_sys_ncap2 : erreur ${@}."
1637    IGCM_debug_Exit "ncap2"
1638  fi
1639
1640  IGCM_debug_PopStack "IGCM_sys_ncap2"
1641}
1642
1643function IGCM_sys_ncatted {
1644  IGCM_debug_PushStack "IGCM_sys_ncatted" -- $@
1645  if ( $DEBUG_sys ) ; then
1646    echo "IGCM_sys_ncatted :" $@
1647  fi
1648  ncatted "$@"
1649  if [ $? -gt 0 ] ; then
1650    echo "IGCM_sys_ncatted : erreur ${@}."
1651    IGCM_debug_Exit "ncatted"
1652  fi
1653
1654  IGCM_debug_PopStack "IGCM_sys_ncatted"
1655}
1656
1657function IGCM_sys_ncbo {
1658  IGCM_debug_PushStack "IGCM_sys_ncbo" -- $@
1659  if ( $DEBUG_sys ) ; then
1660    echo "IGCM_sys_ncbo :" $@
1661  fi
1662  ncbo $@
1663  if [ $? -gt 0 ] ; then
1664    echo "IGCM_sys_ncbo : erreur ${@}."
1665    IGCM_debug_Exit "ncbo"
1666  fi
1667
1668  IGCM_debug_PopStack "IGCM_sys_ncbo"
1669}
1670
1671function IGCM_sys_ncdiff {
1672  IGCM_debug_PushStack "IGCM_sys_ncdiff" -- $@
1673  if ( $DEBUG_sys ) ; then
1674    echo "IGCM_sys_ncdiff :" $@
1675  fi
1676  ncdiff $@
1677  if [ $? -gt 0 ] ; then
1678    echo "IGCM_sys_ncdiff : erreur ${@}."
1679    IGCM_debug_Exit "ncdiff"
1680  fi
1681
1682  IGCM_debug_PopStack "IGCM_sys_ncdiff"
1683}
1684
1685function IGCM_sys_ncea {
1686  IGCM_debug_PushStack "IGCM_sys_ncea" -- $@
1687  if ( $DEBUG_sys ) ; then
1688    echo "IGCM_sys_ncea :" $@
1689  fi
1690  ncea $@
1691  if [ $? -gt 0 ] ; then
1692    echo "IGCM_sys_ncea : erreur ${@}."
1693    IGCM_debug_Exit "ncea"
1694  fi
1695
1696  IGCM_debug_PopStack "IGCM_sys_ncea"
1697}
1698
1699function IGCM_sys_ncecat {
1700  IGCM_debug_PushStack "IGCM_sys_ncecat" -- $@
1701  if ( $DEBUG_sys ) ; then
1702    echo "IGCM_sys_ncecat :" $@
1703  fi
1704  ncecat $@
1705  if [ $? -gt 0 ] ; then
1706    echo "IGCM_sys_ncecat : erreur ${@}."
1707    IGCM_debug_Exit "ncecat"
1708  fi
1709
1710  IGCM_debug_PopStack "IGCM_sys_ncecat"
1711}
1712
1713function IGCM_sys_ncflint {
1714  IGCM_debug_PushStack "IGCM_sys_ncflint" -- $@
1715  if ( $DEBUG_sys ) ; then
1716    echo "IGCM_sys_ncflint :" $@
1717  fi
1718  ncflint $@
1719  if [ $? -gt 0 ] ; then
1720    echo "IGCM_sys_ncflint : erreur ${@}."
1721    IGCM_debug_Exit "ncflint"
1722  fi
1723
1724  IGCM_debug_PopStack "IGCM_sys_ncflint"
1725}
1726
1727function IGCM_sys_ncks {
1728  IGCM_debug_PushStack "IGCM_sys_ncks" -- $@
1729  if ( $DEBUG_sys ) ; then
1730    echo "IGCM_sys_ncks :" $@
1731  fi
1732  ncks $@
1733  if [ $? -gt 0 ] ; then
1734    echo "IGCM_sys_ncks : erreur ${@}."
1735    IGCM_debug_Exit "ncks"
1736  fi
1737
1738  IGCM_debug_PopStack "IGCM_sys_ncks"
1739}
1740
1741function IGCM_sys_ncpdq {
1742  IGCM_debug_PushStack "IGCM_sys_ncpdq" -- $@
1743  if ( $DEBUG_sys ) ; then
1744    echo "IGCM_sys_ncpdq :" $@
1745  fi
1746  ncpdq $@
1747  if [ $? -gt 0 ] ; then
1748    echo "IGCM_sys_ncpdq : erreur ${@}."
1749    IGCM_debug_Exit "ncpdq"
1750  fi
1751
1752  IGCM_debug_PopStack "IGCM_sys_ncpdq"
1753}
1754
1755function IGCM_sys_ncra {
1756  IGCM_debug_PushStack "IGCM_sys_ncra" -- $@
1757  if ( $DEBUG_sys ) ; then
1758    echo "IGCM_sys_ncra :" $@
1759  fi
1760  ncra $@
1761  if [ $? -gt 0 ] ; then
1762    echo "IGCM_sys_ncra : erreur ${@}."
1763    IGCM_debug_Exit "ncra"
1764  fi
1765
1766  IGCM_debug_PopStack "IGCM_sys_ncra"
1767}
1768
1769function IGCM_sys_ncrcat {
1770  IGCM_debug_PushStack "IGCM_sys_ncrcat" -- $@
1771  if ( $DEBUG_sys ) ; then
1772    echo "IGCM_sys_ncrcat :" $@
1773  fi
1774  ncrcat $@
1775  if [ $? -gt 0 ] ; then
1776    echo "IGCM_sys_ncrcat : erreur ${@}."
1777#       IGCM_debug_Exit "ncrcat"
1778  fi
1779
1780  IGCM_debug_PopStack "IGCM_sys_ncrcat"
1781}
1782
1783function IGCM_sys_ncrename {
1784  IGCM_debug_PushStack "IGCM_sys_ncrename" -- $@
1785  if ( $DEBUG_sys ) ; then
1786    echo "IGCM_sys_ncrename :" $@
1787  fi
1788  ncrename $@
1789  if [ $? -gt 0 ] ; then
1790    echo "IGCM_sys_ncrename : erreur ${@}."
1791    IGCM_debug_Exit "ncrename"
1792  fi
1793
1794  IGCM_debug_PopStack "IGCM_sys_ncrename"
1795}
1796
1797function IGCM_sys_ncwa {
1798  IGCM_debug_PushStack "IGCM_sys_ncwa" -- $@
1799  if ( $DEBUG_sys ) ; then
1800    echo "IGCM_sys_ncwa :" $@
1801  fi
1802  ncwa $@
1803  if [ $? -gt 0 ] ; then
1804    echo "IGCM_sys_ncwa : erreur ${@}."
1805    IGCM_debug_Exit "ncwa"
1806  fi
1807
1808  IGCM_debug_PopStack "IGCM_sys_ncwa"
1809}
1810
1811##############################################################
1812# CDO OPERATOR
1813
1814function IGCM_sys_cdo {
1815  IGCM_debug_PushStack "IGCM_sys_cdo" -- $@
1816  if ( $DEBUG_sys ) ; then
1817    echo "IGCM_sys_cdo :" $@
1818  fi
1819  \cdo $@
1820  if [ $? -gt 0 ] ; then
1821    echo "IGCM_sys_cdo : erreur ${@}."
1822    IGCM_debug_PopStack "IGCM_sys_cdo"
1823    return 1
1824  else
1825    IGCM_debug_PopStack "IGCM_sys_cdo"
1826    return 0
1827  fi
1828
1829  IGCM_debug_PopStack "IGCM_sys_cdo"
1830}
1831
1832############################################################
1833# Activate Running Environnment Variables
1834
1835function IGCM_sys_activ_variables {
1836  IGCM_debug_PushStack "IGCM_sys_activ_variables"
1837  if ( $DEBUG_sys ) ; then
1838    echo "IGCM_sys_activ_variables"
1839  fi
1840  IGCM_debug_PopStack "IGCM_sys_activ_variables"
1841}
1842
1843############################################################
1844# Desactivate Running Environnment Variables
1845
1846function IGCM_sys_desactiv_variables {
1847  IGCM_debug_PushStack "IGCM_sys_desactiv_variables"
1848  if ( $DEBUG_sys ) ; then
1849    echo "IGCM_sys_desactiv_variables"
1850  fi
1851  IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
1852}
1853
1854############################################################
1855# Build run file
1856
1857function IGCM_sys_build_run_file {
1858  IGCM_debug_PushStack "IGCM_sys_build_run_file"
1859  if ( $DEBUG_sys ) ; then
1860    echo "IGCM_sys_build_run_file"
1861  fi
1862  IGCM_debug_PopStack "IGCM_sys_build_run_file"
1863}
Note: See TracBrowser for help on using the repository browser.