Changes between Version 7 and Version 8 of DocDéveloppeur


Ignore:
Timestamp:
03/05/13 17:37:46 (11 years ago)
Author:
sdipsl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DocDéveloppeur

    v7 v8  
    9090#!sh 
    9191#================================================================== 
    92 libIGCM_card 
    93 This ksh library handles extraction of information from configuration file 
    94 called "card" file (en français fichier "carte"). 
    95 All function described bellow must be prefixed by IGCM_card. 
    96  
    97 #================================================================== 
    9892function IGCM_card_PrintOption 
    9993* Purpose: Print an option from a given file.card and section 
    10094* Usage: IGCM_card_PrintOption file.card section option 
     95* Only used by IGCM_card_Test.ksh 
    10196 
    10297#================================================================== 
     
    10499* Purpose: Print all options from a given file.card and section 
    105100* Usage: IGCM_card_PrintSection file.card section 
     101* Only used by IGCM_card_Test.ksh 
    106102 
    107103#================================================================== 
     
    125121#================================================================== 
    126122function IGCM_card_WriteOption 
    127 * Purpose: Write an option from a given file.card and section 
     123* Purpose: Write an option in a given file.card and section 
    128124* Usage: IGCM_card_WriteOption file.card section newvalue 
    129125* Examples: IGCM_card_WriteOption file.card Recipes Red 150 
     
    134130 
    135131#================================================================== 
     132function IGCM_card_WriteArrayOption 
     133* Purpose: Write an array option a given file.card and section 
     134* Usage: IGCM_card_WriteArrayOption file.card section option newarray 
     135* Examples: set -A MyArray -- 1 2 3 
     136            IGCM_card_WriteArrayOption file.card Recipes List MyArray 
     137 
     138#================================================================== 
    136139function IGCM_card_Check 
    137140* Purpose: Check the present file by comparison with a reference file 
     
    151154libIGCM_date 
    152155This ksh library handles date calculs and convertions in different calendars. 
    153  
     156  types of calendars are possible : 
     157 
     158  - leap|gregorian|standard (other name leap) : 
     159      The normal calendar. The time origin for the 
     160      julian day in this case is 24 Nov -4713. 
     161  - noleap|365_day : 
     162      A 365 day year without leap years. 
     163  - all_leap|366_day : 
     164      A 366 day year with only leap years. 
     165  - 360d|360_day : 
     166      Year of 360 days with month of equal length. 
    154167#================================================================== 
    155168function IGCM_date_DaysInYear 
    156  * Purpose: Return the number of days in a year 
    157  * Usage: IGCM_date_DaysInYear yyyy 
    158           if there is no argument on the command line, 
    159           then assume that a yyyy is being piped in 
     169* Purpose: Return the number of days in a year 
     170* Usage: IGCM_date_DaysInYear yyyy 
     171         if there is no argument on the command line, 
     172         then assume that a yyyy is being piped in 
    160173 
    161174#================================================================== 
    162175function IGCM_date_DaysInMonth 
    163  * Purpose: Calculate the number of days in a month 
    164  * Usage: IGCM_date_DaysInMonth yyyy mm 
    165           or IGCM_date_DaysInMonth yyyymmdd 
    166           if there are no command line arguments then 
    167           assume that a yyyymmdd is being piped in and read the value. 
    168           if there is only one argument assume it is a yyyymmdd on the command line 
    169           other wise it is a yyyy and mm on the command line 
    170  
     176* Purpose: Calculate the number of days in a month 
     177* Usage: IGCM_date_DaysInMonth yyyy mm 
     178         or IGCM_date_DaysInMonth yyyymmdd 
     179         if there are no command line arguments then 
     180         assume that a yyyymmdd is being piped in and read the value. 
     181         if there is only one argument assume it is a yyyymmdd on the command line 
     182         other wise it is a yyyy and mm on the command line 
    171183#================================================================== 
    172184function IGCM_date_ConvertGregorianDateToJulian 
    173  * Purpose: Convert yyyymmdd to yyyyddd 
    174  * Usage: IGCM_date_ConvertGregorianDateToJulian 19980429 
    175           if there is no command line argument, then assume that the date" 
    176           is coming in on a pipe and use read to collect it 
     185* Purpose: Convert yyyymmdd to yyyyddd 
     186* Usage: IGCM_date_ConvertGregorianDateToJulian 19980429 
     187         if there is no command line argument, then assume that the date 
     188         is coming in on a pipe and use read to collect it 
    177189 
    178190#================================================================== 
    179191function IGCM_date_ConvertJulianDateToGregorian() 
    180  * Purpose: Convert yyyyddd to yyyymmdd 
    181  * Usage: IGCM_date_ConvertJulianDateToGregorian 1998213 
    182           if there is no command line argument, assume one is being 
    183           piped in and read it 
     192* Purpose: Convert yyyyddd to yyyymmdd 
     193* Usage: IGCM_date_ConvertJulianDateToGregorian 1998213 
     194         if there is no command line argument, assume one is being 
     195         piped in and read it 
    184196 
    185197#================================================================== 
    186198function IGCM_date_AddDaysToJulianDate 
    187  * Purpose: Add days to a yyyyddd formatted date 
    188  * Usage: IGCM_date_AddDaysToJulianDate 1998312 { ,-}14 
    189           Read from the difference from the command lines 
    190           and the date from the command line, or standard input 
     199* Purpose: Add days to a yyyyddd formatted date 
     200* Usage: IGCM_date_AddDaysToJulianDate 1998312 { ,-}14 
     201         Read the difference from the command lines 
     202         and the date from the command line, or standard input 
    191203 
    192204#================================================================== 
    193205function IGCM_date_AddDaysToGregorianDate 
    194  * Purpose: Add days to a yyyymmdd formatted date 
    195  * Usage: IGCM_date_AddDaysToGregorianDate 19980312 { ,-}14 
    196           Read from the difference from the command lines 
    197           and the date from the command line, or standard input 
     206* Purpose: Add days to a yyyymmdd formatted date 
     207* Usage: IGCM_date_AddDaysToGregorianDate 19980312 { ,-}14 
     208         Read the difference from the command lines 
     209         and the date from the command line, or standard input 
    198210 
    199211#================================================================== 
    200212function IGCM_date_DaysBetweenJulianDate 
    201  * Purpose: Calculate the days difference between two dates and reports 
    202             the number days as jul1 - jul2 
    203  * Usage: IGCM_date_DaysBetweenJulianDate jul1 jul2 
    204           where julian date is in the form yyyyddd 
     213* Purpose: Calculate the days difference between two dates and reports 
     214           the number days as jul1 - jul2 
     215* Usage: IGCM_date_DaysBetweenJulianDate jul1 jul2 
     216         where julian date is in the form yyyyddd 
    205217 
    206218#================================================================== 
    207219function IGCM_date_DaysBetweenGregorianDate () 
    208  * Purpose: Calculate the days difference between two dates and reports 
    209             the number days as grg1 - grg2 
    210  * Usage: IGCM_date_DaysBetweenGregorianDate grg1 grg2 
    211           where gregorian date is in the form yyyymmdd 
     220* Purpose: Calculate the days difference between two dates and reports 
     221           the number days as grg1 - grg2 
     222* Usage: IGCM_date_DaysBetweenGregorianDate grg1 grg2 
     223         where gregorian date is in the form yyyymmdd 
    212224 
    213225#================================================================== 
    214226function IGCM_date_DaysSinceJC () 
    215  * Purpose: Calculate the days difference between a date and 00010101 
    216  * Usage: IGCM_date_DaysSinceJC grg1 
    217           where gregorian date is in the form yyyymmdd 
     227* Purpose: Calculate the days difference between a date and 00010101 
     228* Usage: IGCM_date_DaysSinceJC grg1 
     229         where gregorian date is in the form yyyymmdd 
     230 
     231#================================================================== 
     232function IGCM_date_DaysInPreviousPeriod () 
     233* Purpose: Give the numbers of days during the previous prd1 period from grg1 date # OLD create_ts_begin_date 
     234* Usage: IGCM_date_DaysInPreviousPeriod grg1 prd1 [end] 
     235         where grg1 gregorian date is in the form yyyymmdd 
     236         where prd1 period is in the form N[Yy], N[Mm], N[Dd]. N integer 
     237         where [end] is an optionnal keyword to specify grg1 is the end of prd1 
     238 
     239#================================================================== 
     240function IGCM_date_DaysInNextPeriod () 
     241* Purpose: Give the numbers of days during the next prd1 period from grg1 date # OLD create_ts_next_date 
     242* Usage: IGCM_date_DaysInNextPeriod grg1 prd1 
     243         where grg1 gregorian date is in the form yyyymmdd 
     244         where prd1 period is in the form N[Yy], N[Mm], N[Dd]. N integer 
     245 
     246#================================================================== 
     247function IGCM_date_DaysInCurrentPeriod () 
     248* Purpose: Give the numbers of days during the Current prd1 period from grg1 date 
     249* Usage: IGCM_date_DaysInCurrentPeriod grg1 prd1 
     250         where grg1 gregorian date is in the form yyyymmdd 
     251         where prd1 period is in the form N[Yy], N[Mm], N[Dd]. N integer 
    218252 
    219253#================================================================== 
     
    274308#!sh 
    275309#================================================== 
    276 LibIGCM_sys for Mercure 
    277 #================================================== 
    278  
    279  This ksh library if a layer under some usefull  
     310LibIGCM_sys Default host 
     311#================================================== 
     312 
     313 This ksh library if a layer under some usefull 
    280314environment variables and shell commands. 
    281315All those definitions depend on host particularities. 
     
    287321#================================================== 
    288322#================================================== 
     323function IGCM_sys_ChangeArchive 
     324* Purpose: Just a dummy call on this machine 
     325* Examples: 
     326 
     327#================================================== 
     328function IGCM_sys_RshMaster 
     329* Purpose: Connection to frontend machine. 
     330* Examples: 
     331 
     332#================================================== 
     333function IGCM_sys_RshArchive 
     334* Purpose: Archive rsh command 
     335* Examples: 
     336 
     337#================================================== 
    289338function IGCM_sys_RshPost 
    290 * Purpose: Master rsh command 
     339* Purpose: Post-process rsh command 
     340* Examples: 
     341 
     342#================================================== 
     343function IGCM_sys_SendMail 
     344* Purpose: Send mail when simulation is over 
    291345* Examples: 
    292346 
     
    332386 
    333387#================================================== 
     388function IGCM_sys_IsFileArchived 
     389* Purpose: Test file that must NOT EXISTS on Archive 
     390* Examples: 
     391 
     392#================================================== 
    334393function IGCM_sys_TestFileArchive 
    335394* Purpose: Test file that must NOT EXISTS on Archive 
     395* Examples: 
     396 
     397#================================================== 
     398function IGCM_sys_TestFileBuffer 
     399* Purpose: Test file that must NOT EXISTS on Buffer 
     400* Examples: 
     401 
     402#================================================== 
     403function IGCM_sys_CountFileArchive 
     404* Purpose: Count files on Archive filesystem 
     405* Examples: 
     406 
     407#================================================== 
     408function IGCM_sys_CountFileBuffer 
     409* Purpose: Count files on Scratch filesystem 
    336410* Examples: 
    337411 
     
    343417#================================================== 
    344418function IGCM_sys_Tar 
    345 * Purpose: master un-tar command 
     419* Purpose: master tar command 
    346420* Examples: 
    347421 
     
    362436 
    363437************************* 
    364  File transfer functions  
     438 File transfer functions 
    365439************************* 
    366440 
     
    371445  Error values and explanations can depend on your system version. 
    372446#================================================== 
     447function IGCM_sys_Miror_libIGCM 
     448* Purpose: Mirror libIGCM PATH and lib to frontend 
     449* Examples: 
     450 
     451#================================================== 
    373452function IGCM_sys_Cp 
    374453* Purpose: generic cp 
     
    376455 
    377456#================================================== 
     457function IGCM_sys_Rm 
     458* Purpose: generic rm 
     459* Examples: 
     460 
     461#================================================== 
     462function IGCM_sys_RmRunDir 
     463* Purpose: rm tmpdir (dummy function most of the time batch 
     464                      scheduler will do the job) 
     465* Examples: 
     466 
     467#================================================== 
    378468function IGCM_sys_Mv 
    379469* Purpose: generic move 
     
    381471 
    382472#================================================== 
     473function IGCM_sys_Put_Dir 
     474* Purpose: Copy a complete directory on $(ARCHIVE) 
     475* Examples: 
     476 
     477#================================================== 
     478function IGCM_sys_Get_Dir 
     479* Purpose: Copy a complete directory from ${ARCHIVE} 
     480* Examples: 
     481 
     482#================================================== 
     483function IGCM_sys_Get_Master 
     484* Purpose: Copy a complete directory from MASTER filesystem 
     485* Examples: 
     486 
     487#================================================== 
    383488function IGCM_sys_Put_Rest 
    384 * Purpose: Put computied restarts on $(ARCHIVE). 
     489* Purpose: Put computied restarts on ${ARCHIVE}. 
    385490           File and target directory must exist. 
    386491* Examples: 
    387492 
    388493#================================================== 
     494function IGCM_sys_PutBuffer_Rest 
     495* Purpose: Put computied restarts on ${SCRATCHDIR}. 
     496           File and target directory must exist. 
     497* Examples: 
     498 
     499#================================================== 
     500function IGCM_sys_PrepareTaredRestart 
     501* Purpose: Prepare tared restart to be access by computing job. Identity here. 
     502* Examples: 
     503 
     504#================================================== 
    389505function IGCM_sys_Put_Out 
    390 * Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly 
     506* Purpose: Copy a file on ${ARCHIVE} after having chmod it in readonly 
     507* Examples: 
     508 
     509#================================================== 
     510function IGCM_sys_PutBuffer_Out 
     511* Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly 
    391512* Examples: 
    392513 
     
    396517* Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX 
    397518            IGCM_sys_Get /l Array_contain_myfiles /destpath/ 
    398  
     519#================================================== 
     520function IGCM_sys_GetBuffer 
     521* Purpose: Get a file from ${SCRATCHDIR} 
     522* Examples: IGCM_sys_GetBuffer myfile /destpath/myfile_with_PREFIX 
     523            IGCM_sys_GetBuffer /l Array_contain_myfiles /destpath/ 
    399524#================================================== 
    400525function IGCM_sys_GetDate_FichWork 
    401 * Purpose: donne la date filesys d'un fichier sur le filesystem WORK 
     526* Purpose: donne la date filesys d un fichier sur le filesystem WORK 
    402527* Examples: 
    403528 
    404529#================================================== 
    405530function IGCM_sys_GetDate_FichArchive 
    406 * Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE  
    407 * Examples: 
    408 }}} 
     531* Purpose: donne la date filesys d un fichier sur le filesystem ARCHIVE 
     532* Examples: 
     533 
     534#================================================== 
     535function IGCM_sys_Dods_Rm 
     536* Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole. 
     537* Examples: 
     538 
     539#================================================== 
     540function IGCM_sys_Dods_Cp 
     541* Purpose: Copy $(ARCHIVE) files on DODS internet protocole. 
     542* Examples: 
     543 
     544#================================================== 
     545function IGCM_sys_Put_Dods 
     546* Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here 
     547* Examples: 
     548 
     549#================================================== 
     550function IGCM_sys_rebuild 
     551* Purpose: rebuild parallel files 
     552* Examples: 
     553 
     554#================================================== 
     555function IGCM_sys_rebuild_station 
     556* Purpose: rebuild parallel files describing station  
     557* Examples: 
     558 
     559#================================================== 
     560function IGCM_sys_desactiv_variables 
     561* Purpose: set environement variables prior to execution 
     562* Examples: 
     563 
     564 MPI specifications 
     565 Other specifications 
     566#================================================== 
     567function IGCM_sys_desactiv_variables 
     568* Purpose: unset environement variables after execution 
     569* Examples: 
     570 
     571 MPI specifications 
     572 Other specifications 
     573#================================================== 
     574function IGCM_sys_build_run_file 
     575* Purpose: build run file (deprecated) 
     576* Examples: 
     577 
     578#================================================== 
     579function IGCM_sys_build_execution_scripts 
     580* Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 
     581* Examples: 
     582 
     583#================================================== 
     584function IGCM_sys_check_quota. Dummy call here 
     585* Purpose: check user quota. Stop the simulation if quota above 90% 
     586* Examples: 
     587 
     588#================================================== 
     589function IGCM_sys_CountJobInQueue 
     590* Purpose: Check if job_name is currently 
     591  running or in queue 
     592* Examples: IGCM_sys_CountJobInQueue ${JobName} NbRun 
     593 
     594#================================================== 
     595function IGCM_sys_ncap2 
     596* Purpose: encapsulate ncap2 call so as to manage error code and retry 
     597* Examples: 
     598 
     599#================================================== 
     600function IGCM_sys_ncatted 
     601* Purpose: encapsulate ncatted call so as to manage error code and retry 
     602* Examples: 
     603 
     604#================================================== 
     605function IGCM_sys_ncbo 
     606* Purpose: encapsulate ncbo call so as to manage error code and retry 
     607* Examples: 
     608 
     609#================================================== 
     610function IGCM_sys_ncdif 
     611* Purpose: encapsulate ncdiff call so as to manage error code and retry 
     612* Examples: 
     613 
     614#================================================== 
     615function IGCM_sys_ncea 
     616* Purpose: encapsulate ncea call so as to manage error code and retry 
     617* Examples: 
     618 
     619#================================================== 
     620function IGCM_sys_ncecat 
     621* Purpose: encapsulate ncecat call so as to manage error code and retry 
     622* Examples: 
     623 
     624#================================================== 
     625function IGCM_sys_ncflint 
     626* Purpose: encapsulate ncflint call so as to manage error code and retry 
     627* Examples: 
     628 
     629#================================================== 
     630function IGCM_sys_ncks 
     631* Purpose: encapsulate ncks call so as to manage error code and retry 
     632* Examples: 
     633 
     634#================================================== 
     635function IGCM_sys_ncpdq 
     636* Purpose: encapsulate ncpdq call so as to manage error code and retry 
     637* Examples: 
     638 
     639#================================================== 
     640function IGCM_sys_ncra 
     641* Purpose: encapsulate ncra call so as to manage error code and retry 
     642* Examples: 
     643 
     644#================================================== 
     645function IGCM_sys_ncrcat 
     646* Purpose: encapsulate ncrcat call so as to manage error code and retry 
     647* Examples: 
     648 
     649#================================================== 
     650function IGCM_sys_ncrename 
     651* Purpose: encapsulate ncrename call so as to manage error code and retry 
     652* Examples: 
     653 
     654#================================================== 
     655function IGCM_sys_ncwa 
     656* Purpose: encapsulate ncwa call so as to manage error code and retry 
     657* Examples: 
     658 
     659#================================================== 
     660function IGCM_sys_cdo 
     661* Purpose: encapsulate cdo call so as to manage error code and retry 
     662* Examples: 
     663}}}