#!/bin/ksh #************************************************************** # Author: Sebastien Denvil # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr # $Revision:: $ Revision of last commit # $Author:: $ Author of last commit # $Date:: $ Date of last commit # IPSL (2006) # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC # #************************************************************** # ID of your genci project. Curie only : post-processing jobs need it to run properly #-Q- curie export BRIDGE_MSUB_PROJECT=::default_project:: #set -eu #set -vx libIGCM=::modipsl::/libIGCM #D- Task type DO NOT CHANGE (computing, post-processing or checking) TaskType=checking #D--------------------------------------------------------------------== #D- -1. User modification place #D--------------------------------------------------------------------== #D- Increased verbosity (1, 2, 3) Verbosity=3 #D- Low level debug : to perform lib test checks, stack construction and IO functions instrumentation #D- Default=true DEBUG_debug=true #D- Messaging : all activities and call stacks will be sent to ipsl servers #D- If true will imply DEBUG_debug=true #D- Default=false #D- BigBrother=true #D--------------------------------------------------------------------== echo "purge an entire simulation :" echo "Script used to purge a simulation from the IGCM_OUT directory !" echo "This script will completely wipe out your simulation and will erase all files !!!" echo "Be careful and read all informations !" echo "----" echo "It must be called in Experience directory (so-called SUBMIT_DIR)." echo "----" #D--------------------------------------------------------------------== . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh . ${libIGCM}/libIGCM_card/libIGCM_card.ksh . ${libIGCM}/libIGCM_date/libIGCM_date.ksh #------- SUBMIT_DIR=$( pwd ) . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh . ${libIGCM}/libIGCM_config/libIGCM_config.ksh #------- ( ${DEBUG_debug} ) && IGCM_debug_Check ( ${DEBUG_debug} ) && IGCM_card_Check ( ${DEBUG_debug} ) && IGCM_date_Check #================================== # First of all # # Read libIGCM compatibility version in config.card # Read UserChoices section # Read Ensemble section # Read Post section # Define all netcdf output directories #================================== IGCM_config_CommonConfiguration ${SUBMIT_DIR}/config.card # ------------------------------------------------------------------ # Activate BigBrother so as to supervise this simulation # ------------------------------------------------------------------ IGCM_debug_BigBro_Initialize # List whats need to be done echo "Search directories in ${R_SAVE}" set +A ListDirectories -- $( IGCM_sys_RshArchive "find ${R_SAVE} ${R_BUFR} ${R_FIGR} -type d | sort | uniq" ) CountListDirectories=${#ListDirectories[@]} # And proceed if [ ${CountListDirectories} -gt 0 ] ; then for dir in ${ListDirectories[@]} ; do IGCM_debug_Print 2 -e "\033[1;31m ${dir}\033[m" done IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/run.card\033[m" IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Debug\033[m" IGCM_debug_Print 2 -e "\033[1;31m ${SUBMIT_DIR}/Script_Output_*.??????\033[m" echo -e "\033[1;32mDo you REALLY want to erase all those directories and files?" echo -n -e " Your answer (y/n) : \033[m" read reponse case ${reponse} in oui|OUI|o|y|yes|YES) echo "OK. It will be erased." for dir in ${ListDirectories[@]} ; do IGCM_sys_RshArchive rm -rf ${dir} done # Remove dods hardlink IGCM_sys_Dods_Rm # Remove run.card rm -f ${SUBMIT_DIR}/run.card # Remove Script_Output rm -f ${SUBMIT_DIR}/Script_Output_*.?????? # Remove the Debug directory rm -rf ${SUBMIT_DIR}/Debug # Send a message telling we want to purge IGCM_debug_sendAMQP_Purge echo "done." ;; non|NON|n|no|NO) echo "Nothing to do !" ;; esac fi exit 0