[1159] | 1 | #-Q- curie ###################### |
---|
| 2 | #-Q- curie ## CURIE TGCC/CEA ## |
---|
| 3 | #-Q- curie ###################### |
---|
| 4 | #-Q- curie #MSUB -r METRICS_LMDZ # Nom du job |
---|
| 5 | #-Q- curie #MSUB -eo |
---|
| 6 | #-Q- curie #MSUB -n 1 # Reservation du processus |
---|
| 7 | #-Q- curie #MSUB -T 14400 # Limite de temps elapsed du job |
---|
| 8 | #-Q- curie #MSUB -q ::default_node:: |
---|
[1274] | 9 | #-Q- curie #MSUB -c ::default_core:: |
---|
[1159] | 10 | #-Q- curie #MSUB -Q normal |
---|
| 11 | #-Q- curie #MSUB -A ::default_project:: |
---|
| 12 | #-Q- curie set +x |
---|
| 13 | #-Q- ada #!/bin/ksh |
---|
| 14 | #-Q- ada ####################### |
---|
| 15 | #-Q- ada ## ADA IDRIS ## |
---|
| 16 | #-Q- ada ####################### |
---|
| 17 | #-Q- ada # @ job_type = serial |
---|
| 18 | #-Q- ada # @ requirements = (Feature == "prepost") |
---|
| 19 | #-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss |
---|
| 20 | #-Q- ada # @ wall_clock_limit = 4:00:00 |
---|
| 21 | #-Q- ada # Nom du travail LoadLeveler |
---|
| 22 | #-Q- ada # @ job_name = METRICS_LMDZ |
---|
| 23 | #-Q- ada # Fichier de sortie standard du travail |
---|
| 24 | #-Q- ada # @ output = $(job_name).$(jobid) |
---|
| 25 | #-Q- ada # Fichier de sortie d'erreur du travail |
---|
| 26 | #-Q- ada # @ error = $(job_name).$(jobid) |
---|
| 27 | #-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 28 | #-Q- ada # @ notification = error |
---|
[1290] | 29 | #-Q- ada # @ environment = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit) |
---|
[1159] | 30 | #-Q- ada # @ queue |
---|
| 31 | #-Q- lxiv8 ###################### |
---|
| 32 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
| 33 | #-Q- lxiv8 ###################### |
---|
| 34 | #-Q- lxiv8 #PBS -N METRICS_LMDZ |
---|
| 35 | #-Q- lxiv8 #PBS -m a |
---|
| 36 | #-Q- lxiv8 #PBS -j oe |
---|
| 37 | #-Q- lxiv8 #PBS -q test |
---|
| 38 | #-Q- lxiv8 #PBS -o METRICS_LMDZ.$$ |
---|
| 39 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
[1184] | 40 | #-Q- ifort_CICLAD ###################### |
---|
| 41 | #-Q- ifort_CICLAD ## CICLAD IPSL ## |
---|
| 42 | #-Q- ifort_CICLAD ###################### |
---|
| 43 | #-Q- ifort_CICLAD #PBS -N METRICS_LMDZ |
---|
| 44 | #-Q- ifort_CICLAD #PBS -m a |
---|
| 45 | #-Q- ifort_CICLAD #PBS -j oe |
---|
| 46 | #-Q- ifort_CICLAD #PBS -q std |
---|
| 47 | #-Q- ifort_CICLAD #PBS -S /bin/ksh |
---|
[1159] | 48 | #-Q- default #!/bin/ksh |
---|
| 49 | #-Q- default ################## |
---|
| 50 | #-Q- default ## DEFAULT HOST ## |
---|
| 51 | #-Q- default ################## |
---|
| 52 | |
---|
| 53 | #************************************************************** |
---|
| 54 | # Author: Sebastien Denvil |
---|
| 55 | # Contact: Sebastien.Denvil__at__ipsl.jussieu.fr |
---|
| 56 | # $Revision:: $ Revision of last commit |
---|
| 57 | # $Author:: $ Author of last commit |
---|
| 58 | # $Date:: $ Date of last commit |
---|
| 59 | # IPSL (2006) |
---|
| 60 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 61 | # |
---|
| 62 | #************************************************************** |
---|
| 63 | |
---|
| 64 | #set -eu |
---|
| 65 | #set -vx |
---|
| 66 | |
---|
| 67 | date |
---|
| 68 | |
---|
| 69 | #-Q- ada export OMP_NUM_THREADS=1 |
---|
| 70 | |
---|
[1356] | 71 | #D- Task type DO NOT CHANGE (computing, post-processing or checking) |
---|
[1159] | 72 | TaskType=post-processing |
---|
| 73 | |
---|
| 74 | ###################################################################### |
---|
| 75 | |
---|
| 76 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 77 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 78 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 79 | #------- |
---|
| 80 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
| 81 | . ${libIGCM}/libIGCM_config/libIGCM_config.ksh |
---|
[1166] | 82 | . ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh |
---|
[1159] | 83 | #------- |
---|
[1192] | 84 | IGCM_sys_MkdirWork ${RUN_DIR_PATH} |
---|
| 85 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
| 86 | #------- |
---|
[1159] | 87 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 88 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 89 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 90 | |
---|
| 91 | ###################################################################### |
---|
| 92 | |
---|
| 93 | #set -vx |
---|
| 94 | |
---|
| 95 | # ------------------------------------------------------------------ |
---|
| 96 | # Test if all was right before proceeding further |
---|
| 97 | # ------------------------------------------------------------------ |
---|
[1206] | 98 | IGCM_debug_Verif_Exit |
---|
[1159] | 99 | |
---|
| 100 | if [ ${StandAlone} = true ] ; then |
---|
| 101 | CARD_DIR=${SUBMIT_DIR} |
---|
| 102 | else |
---|
| 103 | CARD_DIR=${RUN_DIR_PATH} |
---|
| 104 | IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH} |
---|
| 105 | IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card ${RUN_DIR_PATH} |
---|
| 106 | IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP ${RUN_DIR_PATH} |
---|
| 107 | IGCM_sys_Get_Master ${SUBMIT_DIR}/POST ${RUN_DIR_PATH} |
---|
| 108 | fi |
---|
| 109 | |
---|
| 110 | #================================== |
---|
| 111 | # First of all |
---|
| 112 | # |
---|
| 113 | # Read libIGCM compatibility version in config.card |
---|
| 114 | # Read UserChoices section |
---|
| 115 | # Read Ensemble section |
---|
| 116 | # Read Post section |
---|
| 117 | # Define all netcdf output directories |
---|
| 118 | #================================== |
---|
| 119 | IGCM_config_CommonConfiguration ${CARD_DIR}/config.card |
---|
| 120 | |
---|
[1189] | 121 | # ------------------------------------------------------------------ |
---|
| 122 | # Activate BigBrother so as to supervise this job |
---|
| 123 | # ------------------------------------------------------------------ |
---|
| 124 | IGCM_debug_BigBro_Initialize |
---|
| 125 | |
---|
[1159] | 126 | #================================== |
---|
| 127 | # Then set up several directories |
---|
| 128 | #================================== |
---|
| 129 | R_OUT_ATM=${R_SAVE}/ATM |
---|
| 130 | DIR_OUT=${DIR_OUT:=SE} |
---|
[1209] | 131 | RUN_DIR=${RUN_DIR_PATH} |
---|
[1159] | 132 | IGCM_sys_MkdirArchive ${R_FIGR} |
---|
| 133 | IGCM_sys_MkdirWork ${RUN_DIR} |
---|
| 134 | IGCM_sys_Cd ${RUN_DIR} |
---|
[1202] | 135 | IGCM_sys_MkdirWork METRICS/SE_${YEARS} |
---|
[1159] | 136 | |
---|
| 137 | #================================== |
---|
| 138 | # Get the file |
---|
| 139 | #================================== |
---|
| 140 | IGCM_sys_Get ${R_OUT_ATM}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc ${RUN_DIR} |
---|
[1221] | 141 | IGCM_sys_Get ${R_OUT_ATM}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc ${RUN_DIR} |
---|
[1159] | 142 | |
---|
| 143 | #================================== |
---|
[1202] | 144 | # Group of metrics we will compute |
---|
[1159] | 145 | #================================== |
---|
[1221] | 146 | GroupsOfMetrics='LMDZ_PCMDI LMDZ_JetLat LMDZ_OverOceanRegions' |
---|
[1308] | 147 | MP_Version=v3 |
---|
[1159] | 148 | |
---|
[1335] | 149 | #================================== |
---|
[1364] | 150 | # SET UP THE PATH (wont be done in libIGCM_sys because setup_runtime.sh is way too intrusive) |
---|
[1335] | 151 | #================================== |
---|
[1364] | 152 | . ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/setup_runtime.sh |
---|
[1335] | 153 | |
---|
[1202] | 154 | for metricsGroupName in ${GroupsOfMetrics} ; do |
---|
[1159] | 155 | |
---|
[1202] | 156 | #================================== |
---|
[1221] | 157 | # Appropriate configuration template |
---|
[1202] | 158 | #================================== |
---|
[1222] | 159 | IGCM_sys_Cp ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/doc/parameter_files/input_parameters_${metricsGroupName}_template.py template.py |
---|
[1159] | 160 | |
---|
[1202] | 161 | #================================== |
---|
[1221] | 162 | # Configure template for histmth.nc |
---|
[1202] | 163 | #================================== |
---|
| 164 | IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\' |
---|
| 165 | IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\' |
---|
| 166 | IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\' |
---|
| 167 | IGCM_comp_modifyFile template.py Login \'${LOGIN}\' |
---|
| 168 | IGCM_comp_modifyFile template.py model_versions \[\'${config_UserChoices_TagName}\'\] |
---|
| 169 | IGCM_comp_modifyFile template.py experiment \'${config_UserChoices_ExperimentName}\' |
---|
| 170 | IGCM_comp_modifyFile template.py realization \'${config_UserChoices_JobName}\' |
---|
| 171 | IGCM_comp_modifyFile template.py project_id \'IPSL\-${config_UserChoices_SpaceName}\' |
---|
[1203] | 172 | IGCM_comp_modifyFile template.py ModelFreeSpace "\"${config_UserChoices_LongName}\"" |
---|
[1202] | 173 | IGCM_comp_modifyFile template.py case_id \'${metricsGroupName}\' |
---|
[1365] | 174 | IGCM_comp_modifyFile template.py obs_data_path \'${R_IN}/ReferenceDatasets/climatos\' |
---|
[1209] | 175 | IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS/SE_${YEARS}\' |
---|
[1202] | 176 | IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\' |
---|
[1162] | 177 | |
---|
[1202] | 178 | #================================== |
---|
| 179 | # Compute metrics |
---|
| 180 | #================================== |
---|
[1222] | 181 | python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py |
---|
[1202] | 182 | |
---|
[1221] | 183 | if [ ${metricsGroupName} != "LMDZ_OverOceanRegions" ] ; then |
---|
| 184 | #================================== |
---|
| 185 | # (Re)Configure template for histmthNMC.nc |
---|
| 186 | #================================== |
---|
| 187 | IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc\' |
---|
| 188 | IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc\' |
---|
| 189 | |
---|
| 190 | #================================== |
---|
| 191 | # Compute metrics for histmthNMC.nc |
---|
| 192 | #================================== |
---|
[1222] | 193 | python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py |
---|
[1221] | 194 | fi |
---|
| 195 | |
---|
[1202] | 196 | #================================== |
---|
| 197 | # Export metrics to mongoDB system |
---|
| 198 | #================================== |
---|
| 199 | IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}/${metricsGroupName} ${metricsGroupName} |
---|
| 200 | |
---|
| 201 | done |
---|
| 202 | |
---|
[1162] | 203 | #================================== |
---|
[1159] | 204 | # Save files |
---|
| 205 | #================================== |
---|
| 206 | IGCM_sys_Put_Dir METRICS ${R_FIGR} |
---|
| 207 | IGCM_sys_Rm -Rf METRICS |
---|
| 208 | IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc |
---|
| 209 | |
---|
| 210 | # Clean RUN_DIR_PATH (necessary for cesium and titane only) |
---|
| 211 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|
[1189] | 212 | |
---|
| 213 | # ------------------------------------------------------------------ |
---|
| 214 | # Finalize BigBrother to inform that the jobs end |
---|
| 215 | # ------------------------------------------------------------------ |
---|
| 216 | IGCM_debug_BigBro_Finalize |
---|