[314] | 1 | #-Q- cesium #!/bin/ksh |
---|
| 2 | #-Q- cesium ###################### |
---|
| 3 | #-Q- cesium ## CESIUM CEA ## |
---|
| 4 | #-Q- cesium ###################### |
---|
| 5 | #-Q- cesium #MSUB -r SE # Nom du job |
---|
| 6 | #-Q- cesium #MSUB -N 1 # Reservation du noeud |
---|
| 7 | #-Q- cesium #MSUB -n 1 # Reservation du processus |
---|
| 8 | #-Q- cesium #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 9 | #-Q- cesium #MSUB -E "-j o" |
---|
| 10 | #-Q- cesium #MSUB -E "-S /bin/ksh" |
---|
[2] | 11 | #-Q- platine #!/usr/bin/ksh |
---|
| 12 | #-Q- platine ################### |
---|
| 13 | #-Q- platine ## PLATINE CEA ## |
---|
| 14 | #-Q- platine ################### |
---|
| 15 | #-Q- platine #BSUB -J SE # Nom du job |
---|
| 16 | #-Q- platine #BSUB -N # message a la fin du job |
---|
| 17 | #-Q- platine #BSUB -n 1 # reservation des processeurs pour le job |
---|
| 18 | #-Q- platine #BSUB -W 1:00 # Limite temps |
---|
[18] | 19 | #-Q- platine #BSUB -q post # Passage en queue post |
---|
[59] | 20 | #-Q- sx8brodie #!/bin/ksh |
---|
[2] | 21 | #-Q- sx8brodie ####################### |
---|
| 22 | #-Q- sx8brodie ## SX8BRODIE IDRIS ## |
---|
| 23 | #-Q- sx8brodie ####################### |
---|
[58] | 24 | #-Q- sx8brodie # Temps Elapsed max. d'une requete hh:mm:ss |
---|
[220] | 25 | #-Q- sx8brodie # @ wall_clock_limit = 20:00:00 |
---|
[58] | 26 | #-Q- sx8brodie # Nom du travail LoadLeveler |
---|
[66] | 27 | #-Q- sx8brodie # @ job_name = SE |
---|
[58] | 28 | #-Q- sx8brodie # Fichier de sortie standard du travail |
---|
| 29 | #-Q- sx8brodie # @ output = $(job_name).$(jobid) |
---|
| 30 | #-Q- sx8brodie # Fichier de sortie d'erreur du travail |
---|
| 31 | #-Q- sx8brodie # @ error = $(job_name).$(jobid) |
---|
| 32 | #-Q- sx8brodie # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 33 | #-Q- sx8brodie # @ notification = error |
---|
[213] | 34 | #-Q- sx8brodie # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
[58] | 35 | #-Q- sx8brodie # @ queue |
---|
[68] | 36 | #-Q- aix6 #!/bin/ksh |
---|
| 37 | #-Q- aix6 ####################### |
---|
| 38 | #-Q- aix6 ## VARGAS IDRIS ## |
---|
| 39 | #-Q- aix6 ####################### |
---|
| 40 | #-Q- aix6 # Temps Elapsed max. d'une requete hh:mm:ss |
---|
[220] | 41 | #-Q- aix6 # @ wall_clock_limit = 20:00:00 |
---|
[68] | 42 | #-Q- aix6 # Nom du travail LoadLeveler |
---|
| 43 | #-Q- aix6 # @ job_name = SE |
---|
| 44 | #-Q- aix6 # Fichier de sortie standard du travail |
---|
| 45 | #-Q- aix6 # @ output = $(job_name).$(jobid) |
---|
| 46 | #-Q- aix6 # Fichier de sortie d'erreur du travail |
---|
| 47 | #-Q- aix6 # @ error = $(job_name).$(jobid) |
---|
| 48 | #-Q- aix6 # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.) |
---|
| 49 | #-Q- aix6 # @ notification = error |
---|
[213] | 50 | #-Q- aix6 # @ environment = $DEBUG_debug ; $MODIPSL ; $libIGCM ; $libIGCM_SX ; $SUBMIT_DIR ; $REBUILD_DIR ; $RebuildFromArchive ; $POST_DIR ; $MASTER ; $DateBegin ; $PeriodDateBegin ; $PeriodDateEnd ; $NbRebuildDir ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $MASTER |
---|
[68] | 51 | #-Q- aix6 # @ queue |
---|
[2] | 52 | #-Q- sx8mercure #!/bin/ksh |
---|
| 53 | #-Q- sx8mercure ###################### |
---|
| 54 | #-Q- sx8mercure ## SX8MERCURE CEA ## |
---|
| 55 | #-Q- sx8mercure ###################### |
---|
| 56 | #-Q- sx8mercure #PBS -N SE # Nom du job |
---|
| 57 | #-Q- sx8mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 58 | #-Q- sx8mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 59 | #-Q- sx8mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 60 | #-Q- sx8mercure #PBS -l cputim_job=1:00:00 # Limite temps a 1 heures |
---|
[299] | 61 | #-Q- sx8mercure #PBS -q scalaire |
---|
[172] | 62 | #-Q- sx9mercure ###################### |
---|
| 63 | #-Q- sx9mercure ## SX9MERCURE CEA ## |
---|
| 64 | #-Q- sx9mercure ###################### |
---|
[257] | 65 | #-Q- sx9mercure #PBS -N SE # Nom du job |
---|
[315] | 66 | #-Q- sx9mercure #PBS -m a # message si abort |
---|
[257] | 67 | #-Q- sx9mercure #PBS -j o # regroupement des stdout et stderr |
---|
| 68 | #-Q- sx9mercure #PBS -S /usr/bin/ksh # shell de soumission |
---|
| 69 | #-Q- sx9mercure #PBS -l memsz_job=1gb # Limite memoire a 1 Go |
---|
| 70 | #-Q- sx9mercure #PBS -l cputim_job=1:00:00 # Limite temps a 1 heures |
---|
[298] | 71 | #-Q- sx9mercure #PBS -q scalaire |
---|
[222] | 72 | #-Q- titane #!/bin/ksh |
---|
| 73 | #-Q- titane ###################### |
---|
| 74 | #-Q- titane ## TITANE CEA ## |
---|
| 75 | #-Q- titane ###################### |
---|
| 76 | #-Q- titane #MSUB -r SE # Nom du job |
---|
| 77 | #-Q- titane #MSUB -N 1 # Reservation du noeud |
---|
| 78 | #-Q- titane #MSUB -n 1 # Reservation du processus |
---|
| 79 | #-Q- titane #MSUB -T 86400 # Limite de temps elapsed du job |
---|
| 80 | #-Q- titane #MSUB -E "-j o" |
---|
| 81 | #-Q- titane #MSUB -E "-S /bin/ksh" |
---|
| 82 | #-Q- titane ##MSUB -e nco.out # Sortie standard |
---|
| 83 | #-Q- titane ##MSUB -o nco.out # Sortie standard |
---|
[281] | 84 | #-Q- lxiv8 ###################### |
---|
| 85 | #-Q- lxiv8 ## OBELIX LSCE ## |
---|
| 86 | #-Q- lxiv8 ###################### |
---|
| 87 | #-Q- lxiv8 #PBS -N SE |
---|
| 88 | #-Q- lxiv8 #PBS -m a |
---|
| 89 | #-Q- lxiv8 #PBS -j oe |
---|
| 90 | #-Q- lxiv8 #PBS -q medium |
---|
| 91 | #-Q- lxiv8 #PBS -o SE.$$ |
---|
| 92 | #-Q- lxiv8 #PBS -S /bin/ksh |
---|
[2] | 93 | #-Q- default #!/bin/ksh |
---|
| 94 | #-Q- default ################## |
---|
| 95 | #-Q- default ## DEFAULT HOST ## |
---|
| 96 | #-Q- default ################## |
---|
| 97 | |
---|
[108] | 98 | # $Date$ |
---|
| 99 | # $Author$ |
---|
| 100 | # $Revision$ |
---|
| 101 | # IPSL (2006) |
---|
| 102 | # This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC |
---|
| 103 | |
---|
| 104 | #set -eu |
---|
[2] | 105 | #set -vx |
---|
| 106 | |
---|
| 107 | date |
---|
| 108 | |
---|
| 109 | #-Q- sx8brodie export OMP_NUM_THREADS=1 |
---|
[108] | 110 | #-Q- aix6 export OMP_NUM_THREADS=1 |
---|
[2] | 111 | |
---|
| 112 | ######################################################################## |
---|
| 113 | |
---|
| 114 | #D- Flag to determine if this job in a standalone mode |
---|
| 115 | #D- Default : value from AA_job if any |
---|
| 116 | StandAlone=${StandAlone:=true} |
---|
| 117 | |
---|
[206] | 118 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 119 | #D- Default : value from AA_job if any |
---|
[229] | 120 | libIGCM=${libIGCM:=::modipsl::/libIGCM} |
---|
| 121 | # WARNING for StandAlone used : To run this script on some machine, |
---|
| 122 | # you must check MirrorlibIGCM variable in sys library. |
---|
| 123 | # If this variable is true, you must use libIGCM_POST path instead |
---|
| 124 | # of your running libIGCM directory. |
---|
[206] | 125 | |
---|
[213] | 126 | #D- Flag to determine if rebuild process has been performed asynchronously |
---|
| 127 | #D- Possible value true or false. |
---|
| 128 | #D- If true raw files has allready been patched by rebuild job |
---|
| 129 | #D- If false create_ts will patch the raw files |
---|
| 130 | #D- Default : Value from AA_job if any. Usefull in StandAlone case. |
---|
| 131 | RebuildFrequency=${RebuildFrequency:=true} |
---|
| 132 | |
---|
[2] | 133 | #D- Flag to determine atlas job's output directory |
---|
| 134 | #D- Default : value from libIGCM_post.ksh if any |
---|
| 135 | POST_DIR=${POST_DIR:=${PBS_O_WORKDIR}} |
---|
| 136 | |
---|
| 137 | #D- Increased verbosity (1, 2, 3) |
---|
| 138 | #D- Default : value from AA_job if any |
---|
| 139 | Verbosity=${Verbosity:=3} |
---|
| 140 | |
---|
| 141 | #D- Low level debug : to bypass lib test checks and stack construction |
---|
| 142 | #D- Default : value from AA_job if any |
---|
| 143 | DEBUG_debug=${DEBUG_debug:=false} |
---|
| 144 | |
---|
| 145 | #D- TEMPORARY Flag to determine atmospheric resolution |
---|
| 146 | #D- Default : value from atmospheric driver if any |
---|
[135] | 147 | RESOL_ATM=${RESOL_ATM:=ALL} |
---|
[2] | 148 | |
---|
[257] | 149 | #D- Flag to determine surface resolution |
---|
| 150 | #D- Default : value from surface driver if any |
---|
| 151 | RESOL_SRF=ALL |
---|
| 152 | |
---|
| 153 | #D- Flag to determine surface resolution |
---|
| 154 | #D- Default : value from surface driver if any |
---|
| 155 | RESOL_SBG=ALL |
---|
| 156 | |
---|
[2] | 157 | #D- TEMPORARY Flag to determine ocean resolution |
---|
| 158 | #D- Default : value from ocean driver if any |
---|
| 159 | RESOL_OCE=${RESOL_OCE:=ORCA2} |
---|
| 160 | |
---|
| 161 | #D- TEMPORARY Flag to determine ice resolution |
---|
| 162 | #D- Default : value from ice driver if any |
---|
| 163 | RESOL_ICE=${RESOL_ICE:=ORCA2} |
---|
| 164 | |
---|
[178] | 165 | #D- TEMPORARY Flag to determine marine biogeochemistry resolution |
---|
| 166 | #D- Default : value from ice driver if any |
---|
| 167 | RESOL_MBG=${RESOL_MBG:=ORCA2} |
---|
| 168 | |
---|
[2] | 169 | ######################################################################## |
---|
| 170 | |
---|
[108] | 171 | . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh |
---|
| 172 | ( ${DEBUG_debug} ) && IGCM_debug_Check |
---|
| 173 | . ${libIGCM}/libIGCM_card/libIGCM_card.ksh |
---|
| 174 | ( ${DEBUG_debug} ) && IGCM_card_Check |
---|
| 175 | . ${libIGCM}/libIGCM_date/libIGCM_date.ksh |
---|
| 176 | ( ${DEBUG_debug} ) && IGCM_date_Check |
---|
| 177 | #------- |
---|
| 178 | . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh |
---|
[2] | 179 | |
---|
| 180 | ######################################################################## |
---|
| 181 | |
---|
| 182 | #set -vx |
---|
| 183 | |
---|
[202] | 184 | IGCM_sys_MkdirWork ${RUN_DIR_PATH} |
---|
[2] | 185 | IGCM_sys_Cd ${RUN_DIR_PATH} |
---|
| 186 | |
---|
| 187 | if [ ${StandAlone} = true ] ; then |
---|
| 188 | CARD_DIR=${SUBMIT_DIR} |
---|
| 189 | else |
---|
| 190 | CARD_DIR=${RUN_DIR_PATH}/$( basename ${SUBMIT_DIR} ) |
---|
| 191 | IGCM_sys_Get_Master ${SUBMIT_DIR} ${RUN_DIR_PATH} |
---|
| 192 | fi |
---|
| 193 | |
---|
| 194 | # |
---|
| 195 | # First of all |
---|
| 196 | # |
---|
| 197 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card UserChoices |
---|
| 198 | typeset option |
---|
| 199 | for option in ${config_UserChoices[*]} ; do |
---|
| 200 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option} |
---|
| 201 | done |
---|
| 202 | # |
---|
| 203 | echo |
---|
| 204 | IGCM_debug_Print 1 "DefineArrayFromOption : config_UserChoices" |
---|
| 205 | IGCM_debug_PrintVariables 3 config_UserChoices_JobName |
---|
| 206 | IGCM_debug_PrintVariables 3 config_UserChoices_LongName |
---|
| 207 | IGCM_debug_PrintVariables 3 config_UserChoices_TagName |
---|
[263] | 208 | IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName |
---|
| 209 | IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName |
---|
[2] | 210 | IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType |
---|
| 211 | IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin |
---|
| 212 | IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd |
---|
| 213 | IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength |
---|
| 214 | echo |
---|
| 215 | |
---|
| 216 | #================================== |
---|
[263] | 217 | #R_SAVE : Job output directory |
---|
| 218 | if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then |
---|
| 219 | FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' ) |
---|
| 220 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 221 | R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName} |
---|
| 222 | else |
---|
| 223 | R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 224 | R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName} |
---|
| 225 | fi |
---|
[2] | 226 | # |
---|
| 227 | IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card ListOfComponents |
---|
| 228 | # |
---|
| 229 | IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post SeasonalFrequency |
---|
| 230 | # |
---|
| 231 | # Determine period for seasonnal average. Default : value from AA_job if any |
---|
| 232 | # |
---|
| 233 | DateBegin=${DateBegin:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )} |
---|
| 234 | # |
---|
| 235 | PeriodDateEnd=${PeriodDateEnd:=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )} |
---|
| 236 | # |
---|
| 237 | freq=$( echo ${config_Post_SeasonalFrequency} | sed -e "s/[yY]//" ) |
---|
| 238 | # |
---|
[149] | 239 | an_fin=$(( $( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) / 1000 )) |
---|
[2] | 240 | an_deb=$( IGCM_date_YearDigit $(( an_fin - freq + 1 )) ) |
---|
| 241 | an_fin=$( IGCM_date_YearDigit ${an_fin} ) |
---|
| 242 | # |
---|
| 243 | # For each component selected determine which files need post-processing |
---|
| 244 | # |
---|
| 245 | for comp in ${config_ListOfComponents[*]} ; do |
---|
| 246 | # |
---|
| 247 | IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp} |
---|
| 248 | eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 |
---|
| 249 | # |
---|
| 250 | card=${CARD_DIR}/COMP/${compname}.card |
---|
| 251 | IGCM_card_DefineArrayFromOption ${card} OutputFiles List |
---|
| 252 | # |
---|
| 253 | ListFilesName=${compname}_OutputFiles_List |
---|
| 254 | eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1 |
---|
| 255 | # |
---|
| 256 | if [ X${FileName0} != X${NULL_STR} ] ; then |
---|
| 257 | # |
---|
| 258 | # INITIALISATION |
---|
| 259 | # |
---|
| 260 | eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 |
---|
[236] | 261 | typeset i=2 |
---|
[2] | 262 | # |
---|
[240] | 263 | until [ $i -gt $NbFiles ]; do |
---|
[2] | 264 | # |
---|
[243] | 265 | eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1 |
---|
[2] | 266 | # |
---|
| 267 | if [ X${flag_post} != XNONE ] ; then |
---|
| 268 | # |
---|
[236] | 269 | # Check if seasonal is required for this file |
---|
[2] | 270 | # |
---|
[239] | 271 | IGCM_card_DefineArrayFromSection ${card} ${flag_post} |
---|
[236] | 272 | # |
---|
[239] | 273 | # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default |
---|
[237] | 274 | # |
---|
[239] | 275 | # variable option allready typeset above |
---|
| 276 | for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do |
---|
| 277 | if [ ${option} = Seasonal ] ; then |
---|
| 278 | FoundSeasonal=true |
---|
| 279 | IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal |
---|
| 280 | fi |
---|
| 281 | done |
---|
| 282 | # |
---|
| 283 | if [ ! X${FoundSeasonal} = Xtrue ] ; then |
---|
[237] | 284 | eval ${compname}_${flag_post}_Seasonal=ON |
---|
| 285 | fi |
---|
| 286 | # |
---|
[236] | 287 | if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then |
---|
[243] | 288 | (( i=i+3 )) |
---|
[236] | 289 | continue |
---|
| 290 | fi |
---|
| 291 | # |
---|
| 292 | # CREATE LIST |
---|
| 293 | # |
---|
| 294 | FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' ) |
---|
| 295 | # |
---|
| 296 | DIRECTORY=${R_SAVE}/${comp}/Analyse/SE |
---|
| 297 | # |
---|
| 298 | TestedFile=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${FILE}.nc |
---|
| 299 | # |
---|
| 300 | IGCM_sys_TestFileArchive ${DIRECTORY}/${TestedFile} |
---|
| 301 | if [ ! $? = 0 ] ; then |
---|
| 302 | eval set +A LISTE_FILE_${comp} \$\{LISTE_FILE_${comp}[*]} ${FILE} |
---|
| 303 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 304 | IGCM_card_DefineArrayFromOption ${card} Post_${FILE} Patches |
---|
| 305 | eval set +A LISTE_PATCHES_${FILE} \$\{${compname}_Post_${FILE}_Patches[*]} |
---|
| 306 | if [ X$( eval echo \${LISTE_PATCHES_${FILE}[0]} ) != X${NULL_STR} ]; then |
---|
| 307 | for Patch in $( eval echo \${LISTE_PATCHES_${FILE}[*]} ); do |
---|
| 308 | if [ Xload${Patch} != X ] ; then |
---|
| 309 | . ${libIGCM}/libIGCM_post/IGCM_${Patch}.ksh |
---|
| 310 | eval load${Patch}=loaded |
---|
| 311 | fi |
---|
| 312 | done |
---|
| 313 | fi |
---|
| 314 | fi |
---|
| 315 | fi |
---|
[2] | 316 | fi |
---|
[243] | 317 | (( i=i+3 )) |
---|
[236] | 318 | done # until [ $i -eq $NbFiles ] |
---|
[2] | 319 | fi |
---|
[150] | 320 | done # for comp |
---|
[2] | 321 | |
---|
| 322 | for comp in ${config_ListOfComponents[*]} ; do |
---|
| 323 | # |
---|
| 324 | eval R_OUT_${comp}=${R_SAVE}/${comp} |
---|
| 325 | # |
---|
| 326 | i=0 |
---|
| 327 | for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do |
---|
| 328 | # |
---|
| 329 | # Determine in which output can we find file |
---|
| 330 | # IE : Output/MO or Output/DA or ... |
---|
| 331 | # |
---|
| 332 | FlagDir=$( echo ${file} | awk -F "_" '{print $1}' ) |
---|
| 333 | case ${FlagDir} in |
---|
| 334 | 1Y) FreqDir=YE ;; |
---|
| 335 | 1M) FreqDir=MO ;; |
---|
| 336 | 5D|1D) FreqDir=DA ;; |
---|
| 337 | HF) FreqDir=HF ;; |
---|
[265] | 338 | 3H) FreqDir=HF ;; |
---|
[2] | 339 | INS) FreqDir=INS ;; |
---|
| 340 | esac |
---|
| 341 | # |
---|
| 342 | RESULT_SE=${config_UserChoices_JobName}_SE_${an_deb}_${an_fin}_${file}.nc |
---|
| 343 | # Do not redoo an existing SE |
---|
[66] | 344 | IGCM_sys_TestFileArchive ${R_SAVE}/${comp}/Analyse/SE/${RESULT_SE} |
---|
| 345 | if [ $? = 0 ] ; then |
---|
[2] | 346 | continue |
---|
| 347 | fi |
---|
| 348 | # |
---|
| 349 | eval file_path=\${R_OUT_${comp}}/Output/${FreqDir}/ |
---|
| 350 | # |
---|
| 351 | case ${config_UserChoices_PeriodLength} in |
---|
| 352 | # For Yearly simulation : |
---|
| 353 | 1Y|1y) |
---|
| 354 | (( an = an_deb )) |
---|
| 355 | # Initialize array |
---|
[66] | 356 | #set -A liste_file_se |
---|
| 357 | #set -A liste_file_se_tmp |
---|
| 358 | unset liste_file_se |
---|
| 359 | unset liste_file_se_tmp |
---|
[2] | 360 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 361 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 362 | # |
---|
| 363 | an4=$(printf "%04i\n" ${an} ) |
---|
| 364 | # |
---|
| 365 | diy=$( IGCM_date_DaysInYear $an4 ) |
---|
| 366 | afin=$( IGCM_date_AddDaysToGregorianDate ${an4}0101 $(( diy - 1 )) ) |
---|
| 367 | date=${an4}0101_${afin} |
---|
[66] | 368 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 369 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 370 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 371 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
[2] | 372 | (( an = an + 1 )) |
---|
| 373 | done |
---|
| 374 | # |
---|
| 375 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 376 | eval ExitFlag=false |
---|
| 377 | IGCM_debug_Verif_Exit_Post |
---|
| 378 | |
---|
| 379 | # Apply IGCM_Patch if needed |
---|
[150] | 380 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 381 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 382 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 383 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 384 | IGCM_${Patch} ${file_t} |
---|
| 385 | done |
---|
[2] | 386 | done |
---|
[150] | 387 | fi |
---|
[2] | 388 | fi |
---|
[231] | 389 | |
---|
| 390 | # Search of common list of variables to be treated |
---|
| 391 | nbfile=0 |
---|
| 392 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 393 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
[243] | 394 | (( nbfile = nbfile + 1 )) |
---|
[231] | 395 | done |
---|
| 396 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 397 | IGCM_sys_Rm tmpfile_ncra |
---|
[2] | 398 | |
---|
| 399 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 400 | # |
---|
| 401 | (( nb = ${mois} - 1 )) |
---|
| 402 | # |
---|
| 403 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
[231] | 404 | IGCM_sys_ncra -O -v ${list_var_final_ncra} -d time_counter,${nb},,12 ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
[2] | 405 | done |
---|
| 406 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 407 | eval ExitFlag=false |
---|
| 408 | IGCM_debug_Verif_Exit_Post |
---|
| 409 | ;; |
---|
| 410 | # For Monthly simulation : |
---|
| 411 | 1M|1m) |
---|
| 412 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 413 | # |
---|
| 414 | (( nb = ${mois} - 1 )) |
---|
| 415 | # |
---|
| 416 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
| 417 | # |
---|
| 418 | (( an = an_deb )) |
---|
| 419 | # Initialize array |
---|
[66] | 420 | #set -A liste_file_se |
---|
| 421 | #set -A liste_file_se_tmp |
---|
| 422 | unset liste_file_se |
---|
| 423 | unset liste_file_se_tmp |
---|
[2] | 424 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 425 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 426 | # |
---|
| 427 | an4=$(printf "%04i\n" ${an} ) |
---|
| 428 | # |
---|
| 429 | date=${an4}${mois}01_${an4}${mois}${moisL} |
---|
[66] | 430 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 431 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 432 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 433 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 434 | |
---|
[2] | 435 | (( an = an + 1 )) |
---|
| 436 | done |
---|
| 437 | # |
---|
| 438 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 439 | eval ExitFlag=false |
---|
| 440 | IGCM_debug_Verif_Exit_Post |
---|
| 441 | |
---|
| 442 | # Apply IGCM_Patch if needed |
---|
[150] | 443 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 444 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 445 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 446 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 447 | IGCM_${Patch} ${file_t} |
---|
| 448 | done |
---|
[2] | 449 | done |
---|
[150] | 450 | fi |
---|
[2] | 451 | fi |
---|
| 452 | |
---|
[231] | 453 | # Search of common list of variables to be treated |
---|
| 454 | nbfile=0 |
---|
| 455 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 456 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
[243] | 457 | (( nbfile = nbfile + 1 )) |
---|
[231] | 458 | done |
---|
| 459 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 460 | IGCM_sys_Rm tmpfile_ncra |
---|
| 461 | IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
| 462 | |
---|
[2] | 463 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 464 | eval ExitFlag=false |
---|
| 465 | IGCM_debug_Verif_Exit_Post |
---|
| 466 | done |
---|
| 467 | ;; |
---|
| 468 | *D|*d) |
---|
| 469 | for mois in 01 02 03 04 05 06 07 08 09 10 11 12 ; do |
---|
| 470 | # |
---|
| 471 | (( nb = ${mois} - 1 )) |
---|
| 472 | # |
---|
| 473 | OUT_SE[${nb}]=${config_UserChoices_JobName}_SE${mois}_${an_deb}_${an_fin}_${file}.nc |
---|
| 474 | # |
---|
| 475 | (( an = an_deb )) |
---|
| 476 | # Initialize array |
---|
[66] | 477 | #set -A liste_file_se |
---|
| 478 | #set -A liste_file_se_tmp |
---|
| 479 | unset liste_file_se |
---|
| 480 | unset liste_file_se_tmp |
---|
[2] | 481 | while [ ${an} -le ${an_fin} ] ; do |
---|
| 482 | moisL=$( IGCM_date_DaysInMonth ${an} ${mois} ) |
---|
| 483 | # |
---|
| 484 | an4=$(printf "%04i\n" ${an} ) |
---|
| 485 | # |
---|
| 486 | length_d=$(( ${config_UserChoices_PeriodLength} - 1 )) |
---|
| 487 | # for one day |
---|
| 488 | if [ ${length_d} -eq 1 ] ; then |
---|
| 489 | (( length_d = 0 )) |
---|
| 490 | fi |
---|
| 491 | (( day = 1 )) |
---|
| 492 | while [ ${day} -le ${moisL} ] ; do |
---|
| 493 | day2=$(printf "%02i\n" ${day} ) |
---|
| 494 | day_beg=${an4}${mois}${day2} |
---|
| 495 | day_end=$( IGCM_date_AddDaysToGregorianDate ${day_beg} ${length_d} ) |
---|
| 496 | date=${an4}${mois}${day_beg}_${an4}${mois}${day_end} |
---|
[66] | 497 | #set +A liste_file_se ${liste_file_se[*]} ${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 498 | #set +A liste_file_se_tmp ${liste_file_se_tmp[*]} ${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 499 | liste_file_se[${#liste_file_se[*]}]=${file_path}${config_UserChoices_JobName}_${date}_${file}.nc |
---|
| 500 | liste_file_se_tmp[${#liste_file_se_tmp[*]}]=${config_UserChoices_JobName}_${date}_${file}.nc |
---|
[2] | 501 | (( day = day + 1 )) |
---|
| 502 | done |
---|
| 503 | (( an = an + 1 )) |
---|
| 504 | done |
---|
| 505 | # |
---|
| 506 | IGCM_sys_Get /l liste_file_se[*] ${RUN_DIR_PATH} |
---|
| 507 | eval ExitFlag=false |
---|
| 508 | IGCM_debug_Verif_Exit_Post |
---|
| 509 | |
---|
| 510 | # Apply IGCM_Patch if needed |
---|
[150] | 511 | if [ ! ${RebuildFrequency} = true ] ; then |
---|
| 512 | if [ X$( eval echo \${LISTE_PATCHES_${file}[0]} ) != X${NULL_STR} ]; then |
---|
| 513 | for file_t in $( eval echo ${liste_file_se_tmp[*]} ); do |
---|
| 514 | for Patch in $( eval echo \${LISTE_PATCHES_${file}[*]} ); do |
---|
| 515 | IGCM_${Patch} ${file_t} |
---|
| 516 | done |
---|
[2] | 517 | done |
---|
[150] | 518 | fi |
---|
[2] | 519 | fi |
---|
| 520 | |
---|
[231] | 521 | # Search of common list of variables to be treated |
---|
| 522 | nbfile=0 |
---|
| 523 | for file_common_var in ${liste_file_se_tmp[*]} ; do |
---|
| 524 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncra |
---|
[243] | 525 | (( nbfile = nbfile + 1 )) |
---|
[231] | 526 | done |
---|
| 527 | list_var_final_ncra=`cat tmpfile_ncra | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 528 | IGCM_sys_Rm tmpfile_ncra |
---|
| 529 | |
---|
| 530 | IGCM_sys_ncra -O -v ${list_var_final_ncra} ${liste_file_se_tmp[*]} ${OUT_SE[${nb}]} |
---|
[2] | 531 | IGCM_sys_Rm ${liste_file_se_tmp[*]} |
---|
| 532 | eval ExitFlag=false |
---|
| 533 | IGCM_debug_Verif_Exit_Post |
---|
| 534 | done |
---|
| 535 | ;; |
---|
| 536 | esac |
---|
| 537 | # |
---|
[231] | 538 | |
---|
| 539 | # Search of common list of variables to be treated |
---|
| 540 | nbfile=0 |
---|
| 541 | for file_common_var in ${OUT_SE[*]} ; do |
---|
| 542 | ncks -m ${file_common_var} | grep '# dim. =' | cut -d ':' -f 1 >> tmpfile_ncrcat |
---|
[243] | 543 | (( nbfile = nbfile + 1 )) |
---|
[231] | 544 | done |
---|
| 545 | list_var_final_ncrcat=`cat tmpfile_ncrcat | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 == nbfile) {print $2}}' | paste -s -d ','` |
---|
| 546 | IGCM_sys_Rm tmpfile_ncrcat |
---|
| 547 | |
---|
| 548 | IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_SE} |
---|
[2] | 549 | # |
---|
| 550 | IGCM_sys_Rm ${OUT_SE[*]} |
---|
| 551 | # |
---|
[278] | 552 | if [ ${comp} = "CPL" ] ; then |
---|
| 553 | ${ncatted} -a modulo,time,c,c," " ${RESULT_SE} |
---|
| 554 | else |
---|
| 555 | ${ncatted} -a modulo,time_counter,c,c," " ${RESULT_SE} |
---|
| 556 | fi |
---|
[2] | 557 | # |
---|
| 558 | eval IGCM_sys_Put_Out ${RESULT_SE} \${R_OUT_${comp}}/Analyse/SE/${RESULT_SE} |
---|
| 559 | IGCM_sys_Rm ${RESULT_SE} |
---|
| 560 | # |
---|
| 561 | eval ExitFlag=false |
---|
| 562 | IGCM_debug_Verif_Exit_Post |
---|
| 563 | done |
---|
| 564 | done |
---|
| 565 | |
---|
| 566 | # DODS copy |
---|
| 567 | for comp in ${config_ListOfComponents[*]} ; do |
---|
[67] | 568 | IGCM_sys_TestDirArchive ${R_SAVE}/${comp}/Analyse/SE |
---|
| 569 | [ $? = 0 ] && IGCM_sys_Put_Dods ${comp}/Analyse/SE |
---|
[2] | 570 | done |
---|
| 571 | |
---|
| 572 | YEARS=${an_deb}_${an_fin} |
---|
| 573 | |
---|
| 574 | export POST_DIR; export SUBMIT_DIR; export libIGCM; export R_INIT; export R_BC; export StandAlone |
---|
[213] | 575 | export RESOL_ATM; export RESOL_OCE ; export RESOL_ICE ; export RESOL_MBG ; export RESOL_SRF ; export RESOL_SBG |
---|
[2] | 576 | export R_SAVE; export config_UserChoices_JobName; export config_UserChoices_TagName; export YEARS; |
---|
[213] | 577 | listVarEnv="POST_DIR,SUBMIT_DIR,libIGCM,R_INIT,R_BC,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG,R_SAVE,config_UserChoices_JobName,config_UserChoices_TagName,YEARS" |
---|
[2] | 578 | export listVarEnv; |
---|
| 579 | |
---|
| 580 | #D- |
---|
| 581 | # -------------------------------------------------------------------- |
---|
| 582 | #D- Test if all was right before ATLAS |
---|
| 583 | # -------------------------------------------------------------------- |
---|
| 584 | IGCM_debug_Verif_Exit_Post |
---|
| 585 | |
---|
| 586 | if [ ${config_UserChoices_TagName} = "IPSLCM4_v1_OASIS3" ] || \ |
---|
[15] | 587 | [ ${config_UserChoices_TagName} = "IPSLCM4_v2" ] || \ |
---|
[2] | 588 | [ ${config_UserChoices_TagName} = "IPSL_ESM_V1" ] ; then |
---|
| 589 | # |
---|
| 590 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 591 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 592 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
| 593 | IGCM_sys_QsubPost additionnal ; |
---|
| 594 | # |
---|
[263] | 595 | elif [ ${config_UserChoices_TagName} = "IPSLCM5" ] || \ |
---|
| 596 | [ ${config_UserChoices_TagName} = "IPSLCM5A" ] ; then |
---|
[74] | 597 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 598 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 599 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
[242] | 600 | IGCM_sys_QsubPost atlas_PISCES ; |
---|
[74] | 601 | # |
---|
[15] | 602 | elif [ ${config_UserChoices_TagName} = "LMDZ4OR" ] || \ |
---|
[43] | 603 | [ ${config_UserChoices_TagName} = "LMDZOR" ] || \ |
---|
[25] | 604 | [ ${config_UserChoices_TagName} = "LMDZ4OR_v2" ] ; then |
---|
[2] | 605 | # |
---|
| 606 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 607 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 608 | # |
---|
[45] | 609 | elif [ ${config_UserChoices_TagName} = "LMDZ" ] ; then |
---|
[34] | 610 | # |
---|
| 611 | IGCM_sys_QsubPost atlas_LMDZ ; |
---|
| 612 | # |
---|
[15] | 613 | elif [ ${config_UserChoices_TagName} = "OL" ] || \ |
---|
[2] | 614 | [ ${config_UserChoices_TagName} = "OL2" ] ; then |
---|
| 615 | # |
---|
| 616 | IGCM_sys_QsubPost atlas_ORCHIDEE ; |
---|
| 617 | # |
---|
[87] | 618 | elif [ ${config_UserChoices_TagName} = "ORCA2_LIM" ] || |
---|
[242] | 619 | [ ${config_UserChoices_TagName} = "ORCA2_LIM2" ] ; then |
---|
[2] | 620 | # |
---|
| 621 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
[87] | 622 | # IGCM_sys_QsubPost additionnal ; |
---|
[242] | 623 | elif [ ${config_UserChoices_TagName} = "ORCA2_LIM2_PISCES" ] ; then |
---|
[2] | 624 | # |
---|
[242] | 625 | IGCM_sys_QsubPost atlas_ORCA_LIM ; |
---|
| 626 | IGCM_sys_QsubPost atlas_PISCES ; |
---|
| 627 | # IGCM_sys_QsubPost additionnal ; |
---|
| 628 | elif [ ${config_UserChoices_TagName} = "ORCA2_OFF_PISCES" ] ; then |
---|
| 629 | # |
---|
| 630 | IGCM_sys_QsubPost atlas_PISCES ; |
---|
| 631 | # |
---|
[2] | 632 | fi |
---|
[203] | 633 | |
---|
| 634 | # Clean RUN_DIR_PATH (necessary for cesium) |
---|
| 635 | IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH} |
---|