[622] | 1 | #-Q- curie ###################### |
---|
| 2 | #-Q- curie ## CURIE TGCC/CEA ## |
---|
| 3 | #-Q- curie ###################### |
---|
[626] | 4 | #-Q- curie #MSUB -r MONITORING # Nom du job |
---|
[622] | 5 | #-Q- curie #MSUB -eo |
---|
| 6 | #-Q- curie #MSUB -n 1 # Reservation du processus |
---|
| 7 | #-Q- curie #MSUB -T 86400 # Limite de temps elapsed du job |
---|
[741] | 8 | #-Q- curie #MSUB -q xlarge |
---|
[704] | 9 | #-Q- curie #MSUB -Q normal |
---|
[681] | 10 | #-Q- curie set +x |
---|
[770] | 11 | #-Q- ada #!/bin/ksh |
---|
| 12 | #-Q- ada ####################### |
---|
| 13 | #-Q- ada ## ADA IDRIS ## |
---|
| 14 | #-Q- ada ####################### |
---|
| 15 | #-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 16 | #-Q- ada # @ wall_clock_limit = 1:00:00 |
---|
| 17 | #-Q- ada # Nom du travail LoadLeveler |
---|
| 18 | #-Q- ada # @ job_name = MONITORING |
---|
| 19 | #-Q- ada # Fichier de sortie standard du travail |
---|
| 20 | #-Q- ada # @ output = $(job_name).$(jobid) |
---|
| 21 | #-Q- ada # Fichier de sortie d'erreur du travail |
---|
| 22 | #-Q- ada # @ error = $(job_name).$(jobid) |
---|
| 23 | #-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 24 | #-Q- ada # @ notification = error |
---|
| 25 | #-Q- ada # @ environment = $POST_DIR ; $SUBMIT_DIR ; $libIGCM ; $libIGCM_SX ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $R_SAVE ; $config_UserChoices_JobName ; $config_UserChoices_TagName ; $YEARS ; $MASTER |
---|
| 26 | #-Q- ada # @ queue |
---|
[172] | 27 | #-Q- sx9mercure #!/bin/ksh |
---|
[616] | 28 | #-Q- sx9mercure ###################### |
---|
| 29 | #-Q- sx9mercure ## SX9MERCURE CCRT ## |
---|
| 30 | #-Q- sx9mercure ###################### |
---|
| 31 | #-Q- sx9mercure #PBS -N MONITORING # Nom du job |
---|
| 32 | #-Q- sx9mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 33 | #-Q- sx9mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 34 | #-Q- sx9mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 35 | #-Q- sx9mercure #PBS -l elapstim_req=1:00:00 # Limite temps a 2 heures |
---|
| 36 | #-Q- sx9mercure #PBS -q scalaire |
---|
[640] | 37 | #-Q- sx9mercure #PBS -r n |
---|
[222] | 38 | #-Q- titane #!/bin/ksh |
---|
| 39 | #-Q- titane ###################### |
---|
| 40 | #-Q- titane ## TITANE CEA ## |
---|
| 41 | #-Q- titane ###################### |
---|
| 42 | #-Q- titane #MSUB -r MONITORING # Nom du job |
---|
[544] | 43 | #-Q- titane #MSUB -eo |
---|
[222] | 44 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
| 45 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
[544] | 46 | #-Q- titane #MSUB -q mono |
---|
[643] | 47 | #-Q- titane #MSUB -E '-rn' |
---|
[281] | 48 | #-Q- lxiv8 ###################### |
---|
| 49 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
| 50 | #-Q- lxiv8 ###################### |
---|
| 51 | #-Q- lxiv8 #PBS -N MONITORING |
---|
| 52 | #-Q- lxiv8 #PBS -m a |
---|
| 53 | #-Q- lxiv8 #PBS -j oe |
---|
| 54 | #-Q- lxiv8 #PBS -q medium |
---|
| 55 | #-Q- lxiv8 #PBS -o MONITORING.$$ |
---|
| 56 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
[2] | 57 | #-Q- default #!/bin/ksh |
---|
| 58 | #-Q- default ################## |
---|
| 59 | #-Q- default ## DEFAULT HOST ## |
---|
| 60 | #-Q- default ################## |
---|
| 61 | |
---|
[373] | 62 | #************************************************************** |
---|
| 63 | # Author: Sebastien Denvil |
---|
| 64 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
| 65 | # $Revision:: $ Revision of last commit |
---|
| 66 | # $Author:: $ Author of last commit |
---|
| 67 | # $Date:: $ Date of last commit |
---|
[2] | 68 | # IPSL (2006) |
---|
| 69 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
[373] | 70 | # |
---|
| 71 | #************************************************************** |
---|
[2] | 72 | |
---|
[108] | 73 | #set -eu |
---|
| 74 | #set -vx |
---|
| 75 | |
---|
[2] | 76 | date |
---|
| 77 | |
---|
[770] | 78 | #-Q- ada export OMP_NUM_THREADS=1 |
---|
[2] | 79 | |
---|
[712] | 80 | #D- Task type (computing or post-processing) |
---|
| 81 | TaskType=post-processing |
---|
| 82 | |
---|
[280] | 83 | ######################################################################## |
---|
| 84 | |
---|
| 85 | #D- Flag to determine if this job in a standalone mode |
---|
| 86 | #D- Default : value from AA_job if any |
---|
| 87 | StandAlone=${StandAlone:=true} |
---|
| 88 | |
---|
[554] | 89 | #D- Path to libIGCM |
---|
[280] | 90 | #D- Default : value from AA_job if any |
---|
[770] | 91 | # WARNING For StandAlone use : To run this script on some machine (ada and cesium) |
---|
[554] | 92 | # WARNING you must check MirrorlibIGCM variable in sys library. |
---|
| 93 | # WARNING If this variable is true, you must use libIGCM_POST path instead |
---|
| 94 | # WARNING of your running libIGCM directory. |
---|
[280] | 95 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
| 96 | |
---|
[334] | 97 | #D- Increased verbosity (1, 2, 3) |
---|
| 98 | #D- Default : value from AA_job if any |
---|
| 99 | Verbosity=${Verbosity:=3} |
---|
| 100 | |
---|
| 101 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 102 | #D- Default : value from AA_job if any |
---|
| 103 | DEBUG_debug=${DEBUG_debug:=false} |
---|
| 104 | |
---|
| 105 | #D- TEMPORARY Flag to determine atmospheric resolution |
---|
| 106 | #D- Default : value from atmospheric driver if any |
---|
| 107 | RESOL_ATM=${RESOL_ATM:=ALL} |
---|
| 108 | |
---|
| 109 | #D- Flag to determine surface resolution |
---|
| 110 | #D- Default : value from surface driver if any |
---|
| 111 | RESOL_SRF=${RESOL_SRF:=ALL} |
---|
| 112 | |
---|
| 113 | #D- Flag to determine surface resolution |
---|
| 114 | #D- Default : value from surface driver if any |
---|
| 115 | RESOL_SBG=${RESOL_SBG:=ALL} |
---|
| 116 | |
---|
| 117 | #D- TEMPORARY Flag to determine ocean resolution |
---|
| 118 | #D- Default : value from ocean driver if any |
---|
| 119 | RESOL_OCE=${RESOL_OCE:=ORCA2} |
---|
| 120 | |
---|
| 121 | #D- TEMPORARY Flag to determine ice resolution |
---|
| 122 | #D- Default : value from ice driver if any |
---|
| 123 | RESOL_ICE=${RESOL_ICE:=ORCA2} |
---|
| 124 | |
---|
| 125 | #D- TEMPORARY Flag to determine marine biogeochemistry resolution |
---|
| 126 | #D- Default : value from ice driver if any |
---|
| 127 | RESOL_MBG=${RESOL_MBG:=ORCA2} |
---|
| 128 | |
---|
[2] | 129 | ###################################################################### |
---|
| 130 | |
---|
[108] | 131 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 132 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 133 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 134 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 135 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 136 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 137 | #------- |
---|
| 138 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
[731] | 139 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
[2] | 140 | |
---|
| 141 | ###################################################################### |
---|
| 142 | |
---|
| 143 | #set -vx |
---|
| 144 | |
---|
| 145 | #=========================================== |
---|
[36] | 146 | RUN_DIR=${RUN_DIR_PATH} |
---|
[34] | 147 | IGCM_sys_MkdirWork ${RUN_DIR} |
---|
| 148 | IGCM_sys_Cd ${RUN_DIR} |
---|
| 149 | |
---|
[436] | 150 | # ------------------------------------------------------------------ |
---|
| 151 | # Test if all was right before proceeding further |
---|
| 152 | # ------------------------------------------------------------------ |
---|
| 153 | IGCM_debug_Verif_Exit_Post |
---|
| 154 | |
---|
[2] | 155 | if [ ${StandAlone} = true ] ; then |
---|
[785] | 156 | CARD_DIR=${SUBMIT_DIR} |
---|
[2] | 157 | else |
---|
[785] | 158 | CARD_DIR=${RUN_DIR} |
---|
| 159 | IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH} |
---|
| 160 | IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card ${RUN_DIR_PATH} |
---|
| 161 | IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP ${RUN_DIR_PATH} |
---|
| 162 | IGCM_sys_Get_Master ${SUBMIT_DIR}/POST ${RUN_DIR_PATH} |
---|
[2] | 163 | fi |
---|
| 164 | |
---|
[727] | 165 | #================================== |
---|
[2] | 166 | # First of all |
---|
| 167 | # |
---|
[727] | 168 | # Read libIGCM compatibility version in config.card |
---|
| 169 | # Read UserChoices section |
---|
| 170 | # Read Ensemble section |
---|
| 171 | # Read Post section |
---|
| 172 | # Define all netcdf output directories |
---|
| 173 | #================================== |
---|
| 174 | IGCM_config_CommonConfiguration ${CARD_DIR}/config.card |
---|
[658] | 175 | |
---|
[263] | 176 | #================================== |
---|
[727] | 177 | # Read ListOfComponents section: |
---|
| 178 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
[591] | 179 | |
---|
[727] | 180 | # Create R_FIGR that has been defined by IGCM_config_CommonConfiguration |
---|
[591] | 181 | IGCM_sys_MkdirArchive ${R_FIGR} |
---|
[102] | 182 | # |
---|
[591] | 183 | IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING |
---|
[102] | 184 | if [ $? = 0 ] ; then |
---|
[785] | 185 | IGCM_debug_Print 1 "Get MONITORING directory from archive" |
---|
| 186 | IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR} |
---|
[102] | 187 | else |
---|
[785] | 188 | IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before" |
---|
[102] | 189 | fi |
---|
[2] | 190 | # -------------------------------------------- |
---|
| 191 | # Insert your commands between III...III lines |
---|
| 192 | # and precise produced directories to save |
---|
| 193 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
| 194 | |
---|
| 195 | for comp in ${config_ListOfComponents[*]} ; do |
---|
[785] | 196 | IGCM_debug_Print 1 "################## Component: ${comp} ######################" |
---|
| 197 | liste_file_monitoring="" |
---|
| 198 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
| 199 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
[181] | 200 | |
---|
[785] | 201 | PATH_monitoring_file="" |
---|
| 202 | eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1 |
---|
| 203 | if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then |
---|
| 204 | PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg |
---|
| 205 | elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then |
---|
| 206 | PATH_monitoring_file=${FER_ATLAS}/${monitoring_file} |
---|
| 207 | else |
---|
| 208 | IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}" |
---|
| 209 | IGCM_debug_Print 1 "Step to next component" |
---|
| 210 | continue |
---|
| 211 | fi |
---|
| 212 | # |
---|
| 213 | if [ X${PATH_monitoring_file} != X"" ] ; then |
---|
| 214 | IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}" |
---|
| 215 | IGCM_debug_Print 1 "Determine which files we need." |
---|
| 216 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO |
---|
| 217 | liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO ) |
---|
| 218 | fi |
---|
| 219 | # |
---|
| 220 | if [ ! "X${liste_file_monitoring}" = X ] ; then |
---|
| 221 | IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR} |
---|
| 222 | IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ." |
---|
| 223 | IGCM_debug_Print 1 "monitoring01 starts ................................................." |
---|
| 224 | monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} . |
---|
| 225 | else |
---|
| 226 | IGCM_debug_Print 1 "No time series detected by this command :" |
---|
| 227 | IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO" |
---|
| 228 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_MO |
---|
| 229 | fi |
---|
| 230 | # |
---|
[2] | 231 | done |
---|
| 232 | |
---|
| 233 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
| 234 | |
---|
| 235 | # Save files |
---|
[587] | 236 | IGCM_sys_Put_Dir MONITORING ${R_FIGR} |
---|
[2] | 237 | |
---|
| 238 | # Dods copy |
---|
| 239 | IGCM_sys_Put_Dods MONITORING |
---|
[203] | 240 | |
---|
[590] | 241 | # Clean RUN_DIR_PATH (necessary for cesium and titane only) |
---|
[203] | 242 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|