Changes between Version 7 and Version 8 of DocDéveloppeur
- Timestamp:
- 03/05/13 17:37:46 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DocDéveloppeur
v7 v8 90 90 #!sh 91 91 #================================================================== 92 libIGCM_card93 This ksh library handles extraction of information from configuration file94 called "card" file (en français fichier "carte").95 All function described bellow must be prefixed by IGCM_card.96 97 #==================================================================98 92 function IGCM_card_PrintOption 99 93 * Purpose: Print an option from a given file.card and section 100 94 * Usage: IGCM_card_PrintOption file.card section option 95 * Only used by IGCM_card_Test.ksh 101 96 102 97 #================================================================== … … 104 99 * Purpose: Print all options from a given file.card and section 105 100 * Usage: IGCM_card_PrintSection file.card section 101 * Only used by IGCM_card_Test.ksh 106 102 107 103 #================================================================== … … 125 121 #================================================================== 126 122 function IGCM_card_WriteOption 127 * Purpose: Write an option froma given file.card and section123 * Purpose: Write an option in a given file.card and section 128 124 * Usage: IGCM_card_WriteOption file.card section newvalue 129 125 * Examples: IGCM_card_WriteOption file.card Recipes Red 150 … … 134 130 135 131 #================================================================== 132 function 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 #================================================================== 136 139 function IGCM_card_Check 137 140 * Purpose: Check the present file by comparison with a reference file … … 151 154 libIGCM_date 152 155 This 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. 154 167 #================================================================== 155 168 function IGCM_date_DaysInYear 156 157 158 159 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 160 173 161 174 #================================================================== 162 175 function 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 171 183 #================================================================== 172 184 function IGCM_date_ConvertGregorianDateToJulian 173 174 175 if there is no command line argument, then assume that the date"176 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 177 189 178 190 #================================================================== 179 191 function IGCM_date_ConvertJulianDateToGregorian() 180 181 182 183 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 184 196 185 197 #================================================================== 186 198 function IGCM_date_AddDaysToJulianDate 187 188 189 Read fromthe difference from the command lines190 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 191 203 192 204 #================================================================== 193 205 function IGCM_date_AddDaysToGregorianDate 194 195 196 Read fromthe difference from the command lines197 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 198 210 199 211 #================================================================== 200 212 function IGCM_date_DaysBetweenJulianDate 201 202 203 204 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 205 217 206 218 #================================================================== 207 219 function IGCM_date_DaysBetweenGregorianDate () 208 209 210 211 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 212 224 213 225 #================================================================== 214 226 function 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 #================================================================== 232 function 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 #================================================================== 240 function 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 #================================================================== 247 function 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 218 252 219 253 #================================================================== … … 274 308 #!sh 275 309 #================================================== 276 LibIGCM_sys for Mercure277 #================================================== 278 279 This ksh library if a layer under some usefull 310 LibIGCM_sys Default host 311 #================================================== 312 313 This ksh library if a layer under some usefull 280 314 environment variables and shell commands. 281 315 All those definitions depend on host particularities. … … 287 321 #================================================== 288 322 #================================================== 323 function IGCM_sys_ChangeArchive 324 * Purpose: Just a dummy call on this machine 325 * Examples: 326 327 #================================================== 328 function IGCM_sys_RshMaster 329 * Purpose: Connection to frontend machine. 330 * Examples: 331 332 #================================================== 333 function IGCM_sys_RshArchive 334 * Purpose: Archive rsh command 335 * Examples: 336 337 #================================================== 289 338 function IGCM_sys_RshPost 290 * Purpose: Master rsh command 339 * Purpose: Post-process rsh command 340 * Examples: 341 342 #================================================== 343 function IGCM_sys_SendMail 344 * Purpose: Send mail when simulation is over 291 345 * Examples: 292 346 … … 332 386 333 387 #================================================== 388 function IGCM_sys_IsFileArchived 389 * Purpose: Test file that must NOT EXISTS on Archive 390 * Examples: 391 392 #================================================== 334 393 function IGCM_sys_TestFileArchive 335 394 * Purpose: Test file that must NOT EXISTS on Archive 395 * Examples: 396 397 #================================================== 398 function IGCM_sys_TestFileBuffer 399 * Purpose: Test file that must NOT EXISTS on Buffer 400 * Examples: 401 402 #================================================== 403 function IGCM_sys_CountFileArchive 404 * Purpose: Count files on Archive filesystem 405 * Examples: 406 407 #================================================== 408 function IGCM_sys_CountFileBuffer 409 * Purpose: Count files on Scratch filesystem 336 410 * Examples: 337 411 … … 343 417 #================================================== 344 418 function IGCM_sys_Tar 345 * Purpose: master un-tar command419 * Purpose: master tar command 346 420 * Examples: 347 421 … … 362 436 363 437 ************************* 364 File transfer functions 438 File transfer functions 365 439 ************************* 366 440 … … 371 445 Error values and explanations can depend on your system version. 372 446 #================================================== 447 function IGCM_sys_Miror_libIGCM 448 * Purpose: Mirror libIGCM PATH and lib to frontend 449 * Examples: 450 451 #================================================== 373 452 function IGCM_sys_Cp 374 453 * Purpose: generic cp … … 376 455 377 456 #================================================== 457 function IGCM_sys_Rm 458 * Purpose: generic rm 459 * Examples: 460 461 #================================================== 462 function IGCM_sys_RmRunDir 463 * Purpose: rm tmpdir (dummy function most of the time batch 464 scheduler will do the job) 465 * Examples: 466 467 #================================================== 378 468 function IGCM_sys_Mv 379 469 * Purpose: generic move … … 381 471 382 472 #================================================== 473 function IGCM_sys_Put_Dir 474 * Purpose: Copy a complete directory on $(ARCHIVE) 475 * Examples: 476 477 #================================================== 478 function IGCM_sys_Get_Dir 479 * Purpose: Copy a complete directory from ${ARCHIVE} 480 * Examples: 481 482 #================================================== 483 function IGCM_sys_Get_Master 484 * Purpose: Copy a complete directory from MASTER filesystem 485 * Examples: 486 487 #================================================== 383 488 function IGCM_sys_Put_Rest 384 * Purpose: Put computied restarts on $ (ARCHIVE).489 * Purpose: Put computied restarts on ${ARCHIVE}. 385 490 File and target directory must exist. 386 491 * Examples: 387 492 388 493 #================================================== 494 function IGCM_sys_PutBuffer_Rest 495 * Purpose: Put computied restarts on ${SCRATCHDIR}. 496 File and target directory must exist. 497 * Examples: 498 499 #================================================== 500 function IGCM_sys_PrepareTaredRestart 501 * Purpose: Prepare tared restart to be access by computing job. Identity here. 502 * Examples: 503 504 #================================================== 389 505 function 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 #================================================== 510 function IGCM_sys_PutBuffer_Out 511 * Purpose: Copy a file on ${SCRATCHDIR} after having chmod it in readonly 391 512 * Examples: 392 513 … … 396 517 * Examples: IGCM_sys_Get myfile /destpath/myfile_with_PREFIX 397 518 IGCM_sys_Get /l Array_contain_myfiles /destpath/ 398 519 #================================================== 520 function 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/ 399 524 #================================================== 400 525 function IGCM_sys_GetDate_FichWork 401 * Purpose: donne la date filesys d 'un fichier sur le filesystem WORK526 * Purpose: donne la date filesys d un fichier sur le filesystem WORK 402 527 * Examples: 403 528 404 529 #================================================== 405 530 function 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 #================================================== 535 function IGCM_sys_Dods_Rm 536 * Purpose: DO NOTHING ! Put ${ARCHIVE} files on DODS internet protocole. 537 * Examples: 538 539 #================================================== 540 function IGCM_sys_Dods_Cp 541 * Purpose: Copy $(ARCHIVE) files on DODS internet protocole. 542 * Examples: 543 544 #================================================== 545 function IGCM_sys_Put_Dods 546 * Purpose: Put ${ARCHIVE} files on DODS internet protocole. Dummy function here 547 * Examples: 548 549 #================================================== 550 function IGCM_sys_rebuild 551 * Purpose: rebuild parallel files 552 * Examples: 553 554 #================================================== 555 function IGCM_sys_rebuild_station 556 * Purpose: rebuild parallel files describing station 557 * Examples: 558 559 #================================================== 560 function IGCM_sys_desactiv_variables 561 * Purpose: set environement variables prior to execution 562 * Examples: 563 564 MPI specifications 565 Other specifications 566 #================================================== 567 function IGCM_sys_desactiv_variables 568 * Purpose: unset environement variables after execution 569 * Examples: 570 571 MPI specifications 572 Other specifications 573 #================================================== 574 function IGCM_sys_build_run_file 575 * Purpose: build run file (deprecated) 576 * Examples: 577 578 #================================================== 579 function IGCM_sys_build_execution_scripts 580 * Purpose: build execution scripts to be launch by ${HOST_MPIRUN_COMMAND} 581 * Examples: 582 583 #================================================== 584 function IGCM_sys_check_quota. Dummy call here 585 * Purpose: check user quota. Stop the simulation if quota above 90% 586 * Examples: 587 588 #================================================== 589 function 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 #================================================== 595 function IGCM_sys_ncap2 596 * Purpose: encapsulate ncap2 call so as to manage error code and retry 597 * Examples: 598 599 #================================================== 600 function IGCM_sys_ncatted 601 * Purpose: encapsulate ncatted call so as to manage error code and retry 602 * Examples: 603 604 #================================================== 605 function IGCM_sys_ncbo 606 * Purpose: encapsulate ncbo call so as to manage error code and retry 607 * Examples: 608 609 #================================================== 610 function IGCM_sys_ncdif 611 * Purpose: encapsulate ncdiff call so as to manage error code and retry 612 * Examples: 613 614 #================================================== 615 function IGCM_sys_ncea 616 * Purpose: encapsulate ncea call so as to manage error code and retry 617 * Examples: 618 619 #================================================== 620 function IGCM_sys_ncecat 621 * Purpose: encapsulate ncecat call so as to manage error code and retry 622 * Examples: 623 624 #================================================== 625 function IGCM_sys_ncflint 626 * Purpose: encapsulate ncflint call so as to manage error code and retry 627 * Examples: 628 629 #================================================== 630 function IGCM_sys_ncks 631 * Purpose: encapsulate ncks call so as to manage error code and retry 632 * Examples: 633 634 #================================================== 635 function IGCM_sys_ncpdq 636 * Purpose: encapsulate ncpdq call so as to manage error code and retry 637 * Examples: 638 639 #================================================== 640 function IGCM_sys_ncra 641 * Purpose: encapsulate ncra call so as to manage error code and retry 642 * Examples: 643 644 #================================================== 645 function IGCM_sys_ncrcat 646 * Purpose: encapsulate ncrcat call so as to manage error code and retry 647 * Examples: 648 649 #================================================== 650 function IGCM_sys_ncrename 651 * Purpose: encapsulate ncrename call so as to manage error code and retry 652 * Examples: 653 654 #================================================== 655 function IGCM_sys_ncwa 656 * Purpose: encapsulate ncwa call so as to manage error code and retry 657 * Examples: 658 659 #================================================== 660 function IGCM_sys_cdo 661 * Purpose: encapsulate cdo call so as to manage error code and retry 662 * Examples: 663 }}}