[1355] | 1 | #!/bin/ksh |
---|
| 2 | #************************************************************** |
---|
| 3 | # Author: Sebastien Denvil |
---|
| 4 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
| 5 | # $Revision:: $ Revision of last commit |
---|
| 6 | # $Author:: $ Author of last commit |
---|
| 7 | # $Date:: $ Date of last commit |
---|
| 8 | # IPSL (2006) |
---|
| 9 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 10 | # |
---|
| 11 | #************************************************************** |
---|
| 12 | # ID of your genci project. Curie only : post-processing jobs need it to run properly |
---|
| 13 | #-Q- curie export BRIDGE_MSUB_PROJECT=::default_project:: |
---|
| 14 | |
---|
| 15 | #set -eu |
---|
| 16 | #set -vx |
---|
| 17 | |
---|
| 18 | libIGCM=::modipsl::/libIGCM |
---|
| 19 | |
---|
[1356] | 20 | #D- Task type DO NOT CHANGE (computing, post-processing or checking) |
---|
[1355] | 21 | TaskType=checking |
---|
| 22 | |
---|
| 23 | #D--------------------------------------------------------------------== |
---|
| 24 | #D- -1. User modification place |
---|
| 25 | #D--------------------------------------------------------------------== |
---|
| 26 | |
---|
| 27 | #D- Increased verbosity (1, 2, 3) |
---|
| 28 | Verbosity=3 |
---|
| 29 | |
---|
[1399] | 30 | #D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation |
---|
[1355] | 31 | #D- Default=true |
---|
[1399] | 32 | DEBUG_debug=true |
---|
[1355] | 33 | |
---|
[1399] | 34 | #D- Messaging : all activities and call stacks will be sent to ipsl servers |
---|
| 35 | #D- If true will imply DEBUG_debug=true |
---|
| 36 | #D- Default=false |
---|
| 37 | #D- |
---|
| 38 | BigBrother=true |
---|
| 39 | |
---|
| 40 | |
---|
[1355] | 41 | #D--------------------------------------------------------------------== |
---|
| 42 | |
---|
| 43 | echo "purge an entire simulation :" |
---|
| 44 | echo "Script used to purge a simulation from the IGCM_OUT directory !" |
---|
| 45 | echo "This script will completely wipe out your simulation and will erase all files !!!" |
---|
| 46 | echo "Be careful and read all informations !" |
---|
| 47 | echo "----" |
---|
| 48 | echo "It must be called in Experience directory (so-called SUBMIT_DIR)." |
---|
| 49 | echo "----" |
---|
| 50 | |
---|
| 51 | #D--------------------------------------------------------------------== |
---|
| 52 | |
---|
| 53 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 54 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 55 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 56 | #------- |
---|
| 57 | SUBMIT_DIR=$( pwd ) |
---|
| 58 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
| 59 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
| 60 | #------- |
---|
| 61 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 62 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 63 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 64 | |
---|
[1399] | 65 | if [ ! -f ${SUBMIT_DIR}/config.card ] ; then |
---|
| 66 | echo "A config.card is needed to proceed" |
---|
| 67 | exit |
---|
| 68 | fi |
---|
| 69 | |
---|
[1355] | 70 | #================================== |
---|
| 71 | # First of all |
---|
| 72 | # |
---|
| 73 | # Read libIGCM compatibility version in config.card |
---|
| 74 | # Read UserChoices section |
---|
| 75 | # Read Ensemble section |
---|
| 76 | # Read Post section |
---|
| 77 | # Define all netcdf output directories |
---|
| 78 | #================================== |
---|
| 79 | IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card |
---|
| 80 | |
---|
| 81 | # ------------------------------------------------------------------ |
---|
| 82 | # Activate BigBrother so as to supervise this simulation |
---|
| 83 | # ------------------------------------------------------------------ |
---|
| 84 | IGCM_debug_BigBro_Initialize |
---|
| 85 | |
---|
| 86 | # List whats need to be done |
---|
| 87 | echo "Search directories in ${R_SAVE}" |
---|
| 88 | set +A ListDirectories -- $( IGCM_sys_RshArchive "find ${R_SAVE} ${R_BUFR} ${R_FIGR} -type d | sort | uniq" ) |
---|
| 89 | CountListDirectories=${#ListDirectories[@]} |
---|
| 90 | |
---|
| 91 | # And proceed |
---|
| 92 | if [ ${CountListDirectories} -gt 0 ] ; then |
---|
| 93 | for dir in ${ListDirectories[@]} ; do |
---|
| 94 | IGCM_debug_Print 2 -e "\033[1;31m ${dir}\033[m" |
---|
| 95 | done |
---|
[1399] | 96 | IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/run.card\033[m" |
---|
| 97 | IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Debug\033[m" |
---|
| 98 | IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Script_Output_*.??????\033[m" |
---|
[1355] | 99 | |
---|
[1399] | 100 | echo -e "\033[1;32mDo you REALLY want to erase all those directories and files?" |
---|
[1355] | 101 | echo -n -e " Your answer (y/n) : \033[m" |
---|
| 102 | read reponse |
---|
| 103 | case ${reponse} in |
---|
| 104 | |
---|
| 105 | oui|OUI|o|y|yes|YES) |
---|
| 106 | echo "OK. It will be erased." |
---|
| 107 | for dir in ${ListDirectories[@]} ; do |
---|
| 108 | IGCM_sys_RshArchive rm -rf ${dir} |
---|
| 109 | done |
---|
| 110 | # Remove dods hardlink |
---|
| 111 | IGCM_sys_Dods_Rm |
---|
[1373] | 112 | # Remove run.card |
---|
| 113 | rm -f ${SUBMIT_DIR}/run.card |
---|
| 114 | # Remove Script_Output |
---|
| 115 | rm -f ${SUBMIT_DIR}/Script_Output_*.?????? |
---|
| 116 | # Remove the Debug directory |
---|
| 117 | rm -rf ${SUBMIT_DIR}/Debug |
---|
[1355] | 118 | # Send a message telling we want to purge |
---|
| 119 | IGCM_debug_sendAMQP_Purge |
---|
| 120 | echo "done." |
---|
| 121 | ;; |
---|
| 122 | non|NON|n|no|NO) |
---|
| 123 | echo "Nothing to do !" |
---|
| 124 | ;; |
---|
| 125 | esac |
---|
| 126 | fi |
---|
| 127 | |
---|
| 128 | exit 0 |
---|