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