[622] | 1 | #-Q- curie ###################### |
---|
| 2 | #-Q- curie ## CURIE TGCC/CEA ## |
---|
| 3 | #-Q- curie ###################### |
---|
[837] | 4 | #-Q- curie #MSUB -r MONITORING # Nom du job |
---|
[1468] | 5 | #-Q- curie #MSUB -o MONITORING.out_%I |
---|
| 6 | #-Q- curie #MSUB -e MONITORING.out_%I |
---|
[622] | 7 | #-Q- curie #MSUB -n 1 # Reservation du processus |
---|
[1468] | 8 | #-Q- curie #MSUB -T 80000 # Limite de temps elapsed du job |
---|
[1154] | 9 | #-Q- curie #MSUB -q ::default_node:: |
---|
[1274] | 10 | #-Q- curie #MSUB -c ::default_core:: |
---|
[704] | 11 | #-Q- curie #MSUB -Q normal |
---|
[837] | 12 | #-Q- curie #MSUB -A ::default_project:: |
---|
[681] | 13 | #-Q- curie set +x |
---|
[1437] | 14 | #-Q- irene ###################### |
---|
| 15 | #-Q- irene ## IRENE TGCC/CEA ## |
---|
| 16 | #-Q- irene ###################### |
---|
| 17 | #-Q- irene #MSUB -r MONITORING # Job name |
---|
[1468] | 18 | #-Q- irene #MSUB -o MONITORING.out_%I |
---|
| 19 | #-Q- irene #MSUB -e MONITORING.out_%I |
---|
[1437] | 20 | #-Q- irene #MSUB -n 1 # Number of cores |
---|
| 21 | #-Q- irene #MSUB -T 80000 # Maximum elapsed time |
---|
[1468] | 22 | #-Q- irene #MSUB -q ::default_node:: |
---|
| 23 | #-Q- irene #MSUB -c ::default_core:: |
---|
[1437] | 24 | #-Q- irene #MSUB -Q normal |
---|
[1468] | 25 | #-Q- irene #MSUB -A ::default_post_project:: |
---|
[1460] | 26 | #-Q- irene #MSUB -m store,work,scratch |
---|
[1437] | 27 | #-Q- irene set +x |
---|
[770] | 28 | #-Q- ada #!/bin/ksh |
---|
| 29 | #-Q- ada ####################### |
---|
[929] | 30 | #-Q- ada ## ADA IDRIS ## |
---|
[770] | 31 | #-Q- ada ####################### |
---|
[1409] | 32 | #-Q- ada # @ job_type = mpich |
---|
[848] | 33 | #-Q- ada # @ requirements = (Feature == "prepost") |
---|
[770] | 34 | #-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss |
---|
[982] | 35 | #-Q- ada # @ wall_clock_limit = 4:00:00 |
---|
[1414] | 36 | #-Q- ada # Memory required for ferret (_SEP _MAR variables) |
---|
| 37 | #-Q- ada # @ as_limit = 30Gb |
---|
[770] | 38 | #-Q- ada # Nom du travail LoadLeveler |
---|
| 39 | #-Q- ada # @ job_name = MONITORING |
---|
[837] | 40 | #-Q- ada # Fichier de sortie standard du travail |
---|
[770] | 41 | #-Q- ada # @ output = $(job_name).$(jobid) |
---|
| 42 | #-Q- ada # Fichier de sortie d'erreur du travail |
---|
| 43 | #-Q- ada # @ error = $(job_name).$(jobid) |
---|
| 44 | #-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 45 | #-Q- ada # @ notification = error |
---|
[1290] | 46 | #-Q- ada # @ environment = $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; wall_clock_limit=$(wall_clock_limit) |
---|
[770] | 47 | #-Q- ada # @ queue |
---|
[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 |
---|
[1184] | 57 | #-Q- ifort_CICLAD ###################### |
---|
| 58 | #-Q- ifort_CICLAD ## CICLAD IPSL ## |
---|
| 59 | #-Q- ifort_CICLAD ###################### |
---|
| 60 | #-Q- ifort_CICLAD #PBS -N MONITORING |
---|
| 61 | #-Q- ifort_CICLAD #PBS -m a |
---|
| 62 | #-Q- ifort_CICLAD #PBS -j oe |
---|
| 63 | #-Q- ifort_CICLAD #PBS -q std |
---|
| 64 | #-Q- ifort_CICLAD #PBS -S /bin/ksh |
---|
[2] | 65 | #-Q- default #!/bin/ksh |
---|
| 66 | #-Q- default ################## |
---|
| 67 | #-Q- default ## DEFAULT HOST ## |
---|
| 68 | #-Q- default ################## |
---|
| 69 | |
---|
[373] | 70 | #************************************************************** |
---|
| 71 | # Author: Sebastien Denvil |
---|
| 72 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
| 73 | # $Revision:: $ Revision of last commit |
---|
| 74 | # $Author:: $ Author of last commit |
---|
| 75 | # $Date:: $ Date of last commit |
---|
[2] | 76 | # IPSL (2006) |
---|
| 77 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
[373] | 78 | # |
---|
| 79 | #************************************************************** |
---|
[2] | 80 | |
---|
[108] | 81 | #set -eu |
---|
| 82 | #set -vx |
---|
| 83 | |
---|
[2] | 84 | date |
---|
| 85 | |
---|
[770] | 86 | #-Q- ada export OMP_NUM_THREADS=1 |
---|
[2] | 87 | |
---|
[1356] | 88 | #D- Task type DO NOT CHANGE (computing, post-processing or checking) |
---|
[712] | 89 | TaskType=post-processing |
---|
| 90 | |
---|
[280] | 91 | ######################################################################## |
---|
| 92 | |
---|
| 93 | #D- Flag to determine if this job in a standalone mode |
---|
| 94 | #D- Default : value from AA_job if any |
---|
| 95 | StandAlone=${StandAlone:=true} |
---|
| 96 | |
---|
[554] | 97 | #D- Path to libIGCM |
---|
[280] | 98 | #D- Default : value from AA_job if any |
---|
[770] | 99 | # WARNING For StandAlone use : To run this script on some machine (ada and cesium) |
---|
[554] | 100 | # WARNING you must check MirrorlibIGCM variable in sys library. |
---|
| 101 | # WARNING If this variable is true, you must use libIGCM_POST path instead |
---|
| 102 | # WARNING of your running libIGCM directory. |
---|
[280] | 103 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
| 104 | |
---|
[334] | 105 | #D- Increased verbosity (1, 2, 3) |
---|
| 106 | #D- Default : value from AA_job if any |
---|
| 107 | Verbosity=${Verbosity:=3} |
---|
| 108 | |
---|
| 109 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 110 | #D- Default : value from AA_job if any |
---|
| 111 | DEBUG_debug=${DEBUG_debug:=false} |
---|
| 112 | |
---|
| 113 | #D- TEMPORARY Flag to determine atmospheric resolution |
---|
| 114 | #D- Default : value from atmospheric driver if any |
---|
| 115 | RESOL_ATM=${RESOL_ATM:=ALL} |
---|
| 116 | |
---|
| 117 | #D- Flag to determine surface resolution |
---|
| 118 | #D- Default : value from surface driver if any |
---|
| 119 | RESOL_SRF=${RESOL_SRF:=ALL} |
---|
| 120 | |
---|
| 121 | #D- Flag to determine surface resolution |
---|
| 122 | #D- Default : value from surface driver if any |
---|
| 123 | RESOL_SBG=${RESOL_SBG:=ALL} |
---|
| 124 | |
---|
| 125 | #D- TEMPORARY Flag to determine ocean resolution |
---|
| 126 | #D- Default : value from ocean driver if any |
---|
| 127 | RESOL_OCE=${RESOL_OCE:=ORCA2} |
---|
| 128 | |
---|
| 129 | #D- TEMPORARY Flag to determine ice resolution |
---|
| 130 | #D- Default : value from ice driver if any |
---|
[1326] | 131 | RESOL_ICE=${RESOL_OCE:=ORCA2} |
---|
[334] | 132 | |
---|
| 133 | #D- TEMPORARY Flag to determine marine biogeochemistry resolution |
---|
| 134 | #D- Default : value from ice driver if any |
---|
[1326] | 135 | RESOL_MBG=${RESOL_OCE:=ORCA2} |
---|
[334] | 136 | |
---|
[2] | 137 | ###################################################################### |
---|
| 138 | |
---|
[108] | 139 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 140 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 141 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 142 | #------- |
---|
| 143 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
[731] | 144 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
[832] | 145 | #------- |
---|
[1192] | 146 | RUN_DIR=${RUN_DIR_PATH} |
---|
| 147 | IGCM_sys_MkdirWork ${RUN_DIR} |
---|
| 148 | IGCM_sys_Cd ${RUN_DIR} |
---|
| 149 | #------- |
---|
[832] | 150 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 151 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 152 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
[2] | 153 | |
---|
| 154 | ###################################################################### |
---|
| 155 | |
---|
[901] | 156 | #set -vx |
---|
[2] | 157 | |
---|
[436] | 158 | # ------------------------------------------------------------------ |
---|
| 159 | # Test if all was right before proceeding further |
---|
| 160 | # ------------------------------------------------------------------ |
---|
[1206] | 161 | IGCM_debug_Verif_Exit |
---|
[436] | 162 | |
---|
[2] | 163 | if [ ${StandAlone} = true ] ; then |
---|
[785] | 164 | CARD_DIR=${SUBMIT_DIR} |
---|
[2] | 165 | else |
---|
[785] | 166 | CARD_DIR=${RUN_DIR} |
---|
| 167 | IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH} |
---|
| 168 | IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card ${RUN_DIR_PATH} |
---|
| 169 | IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP ${RUN_DIR_PATH} |
---|
| 170 | IGCM_sys_Get_Master ${SUBMIT_DIR}/POST ${RUN_DIR_PATH} |
---|
[2] | 171 | fi |
---|
| 172 | |
---|
[727] | 173 | #================================== |
---|
[2] | 174 | # First of all |
---|
| 175 | # |
---|
[727] | 176 | # Read libIGCM compatibility version in config.card |
---|
| 177 | # Read UserChoices section |
---|
| 178 | # Read Ensemble section |
---|
| 179 | # Read Post section |
---|
| 180 | # Define all netcdf output directories |
---|
| 181 | #================================== |
---|
| 182 | IGCM_config_CommonConfiguration ${CARD_DIR}/config.card |
---|
[658] | 183 | |
---|
[1198] | 184 | # ------------------------------------------------------------------ |
---|
| 185 | # Activate BigBrother so as to supervise this job |
---|
| 186 | # ------------------------------------------------------------------ |
---|
| 187 | IGCM_debug_BigBro_Initialize |
---|
| 188 | |
---|
[263] | 189 | #================================== |
---|
[727] | 190 | # Read ListOfComponents section: |
---|
| 191 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
[591] | 192 | |
---|
[727] | 193 | # Create R_FIGR that has been defined by IGCM_config_CommonConfiguration |
---|
[591] | 194 | IGCM_sys_MkdirArchive ${R_FIGR} |
---|
[102] | 195 | # |
---|
[591] | 196 | IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING |
---|
[102] | 197 | if [ $? = 0 ] ; then |
---|
[785] | 198 | IGCM_debug_Print 1 "Get MONITORING directory from archive" |
---|
| 199 | IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR} |
---|
[102] | 200 | else |
---|
[785] | 201 | IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before" |
---|
[102] | 202 | fi |
---|
[2] | 203 | # -------------------------------------------- |
---|
[901] | 204 | # Insert your commands between III...III lines |
---|
[2] | 205 | # and precise produced directories to save |
---|
| 206 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
| 207 | |
---|
| 208 | for comp in ${config_ListOfComponents[*]} ; do |
---|
[785] | 209 | IGCM_debug_Print 1 "################## Component: ${comp} ######################" |
---|
| 210 | liste_file_monitoring="" |
---|
| 211 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
| 212 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
[181] | 213 | |
---|
[785] | 214 | PATH_monitoring_file="" |
---|
| 215 | eval monitoring_file=monitoring01_${compname}_\${RESOL_${comp}}.cfg > /dev/null 2>&1 |
---|
[1326] | 216 | if [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/${monitoring_file} ]] ; then |
---|
| 217 | PATH_monitoring_file=${CARD_DIR}/POST/${monitoring_file} |
---|
[1329] | 218 | elif [[ -d ${CARD_DIR}/POST && -f ${CARD_DIR}/POST/monitoring01_${compname}.cfg ]] ; then |
---|
[785] | 219 | PATH_monitoring_file=${CARD_DIR}/POST/monitoring01_${compname}.cfg |
---|
| 220 | elif [ -f ${FER_ATLAS}/${monitoring_file} ] ; then |
---|
| 221 | PATH_monitoring_file=${FER_ATLAS}/${monitoring_file} |
---|
| 222 | else |
---|
| 223 | IGCM_debug_Print 1 "No monitoring file found for this component. Was expecting ${monitoring_file}" |
---|
| 224 | IGCM_debug_Print 1 "Step to next component" |
---|
| 225 | continue |
---|
| 226 | fi |
---|
| 227 | # |
---|
| 228 | if [ X${PATH_monitoring_file} != X"" ] ; then |
---|
| 229 | IGCM_debug_Print 1 "Monitoring file used : ${PATH_monitoring_file}" |
---|
[901] | 230 | IGCM_debug_Print 1 "Determine which frequency of time series to be used." |
---|
| 231 | |
---|
| 232 | FreqTS=$( grep FreqTS ${PATH_monitoring_file} | grep -v \# | awk -F "=" '{print $2}' ) |
---|
| 233 | if [ X${FreqTS} = X ] ; then |
---|
| 234 | # Default frequency is MO |
---|
| 235 | FreqTS=MO |
---|
| 236 | fi |
---|
| 237 | |
---|
| 238 | IGCM_debug_Print 1 "Times series frequency to be used is ${FreqTS}" |
---|
[785] | 239 | IGCM_debug_Print 1 "Determine which files we need." |
---|
[901] | 240 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} |
---|
| 241 | liste_file_monitoring=$( . monitoring01 -q -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} ) |
---|
[785] | 242 | fi |
---|
| 243 | # |
---|
| 244 | if [ ! "X${liste_file_monitoring}" = X ] ; then |
---|
| 245 | IGCM_sys_Get /l liste_file_monitoring ${RUN_DIR} |
---|
| 246 | IGCM_debug_Print 1 "monitoring01 -c ${CARD_DIR} -p ${comp} --time -t \"${config_UserChoices_JobName} monitoring\" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} ." |
---|
| 247 | IGCM_debug_Print 1 "monitoring01 starts ................................................." |
---|
| 248 | monitoring01 -c ${CARD_DIR} -p ${comp} --time -t "${config_UserChoices_JobName} monitoring" -o ${RUN_DIR}/MONITORING ${PATH_monitoring_file} . |
---|
| 249 | else |
---|
| 250 | IGCM_debug_Print 1 "No time series detected by this command :" |
---|
[901] | 251 | IGCM_debug_Print 1 "monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS}" |
---|
| 252 | . monitoring01 -l2 --listcommand 'IGCM_sys_RshArchive_NoError ls' ${PATH_monitoring_file} ${R_SAVE}/${comp}/Analyse/TS_${FreqTS} |
---|
[785] | 253 | fi |
---|
[1333] | 254 | |
---|
| 255 | # Now do cleaning before starting with next component |
---|
| 256 | rm -f ${RUN_DIR}/*nc |
---|
| 257 | |
---|
[2] | 258 | done |
---|
| 259 | |
---|
| 260 | # IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII |
---|
| 261 | |
---|
| 262 | # Save files |
---|
[587] | 263 | IGCM_sys_Put_Dir MONITORING ${R_FIGR} |
---|
[2] | 264 | |
---|
| 265 | # Dods copy |
---|
[903] | 266 | if [ X${config_Post_DodsCopy} = XTRUE ] ; then |
---|
| 267 | IGCM_sys_Put_Dods MONITORING |
---|
| 268 | fi |
---|
[203] | 269 | |
---|
[590] | 270 | # Clean RUN_DIR_PATH (necessary for cesium and titane only) |
---|
[203] | 271 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|
[1198] | 272 | |
---|
| 273 | # ------------------------------------------------------------------ |
---|
| 274 | # Finalize BigBrother to inform that the jobs end |
---|
| 275 | # ------------------------------------------------------------------ |
---|
| 276 | IGCM_debug_BigBro_Finalize |
---|