Changeset 236 for trunk/libIGCM/libIGCM_post/libIGCM_post.ksh
- Timestamp:
- 03/01/10 16:59:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_post/libIGCM_post.ksh
r210 r236 165 165 typeset POST NbDays PeriodEndJul PostEndJul LengthDays 166 166 POST=false 167 167 # 168 # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS 169 # 170 if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then 171 list_post=TimeSeriesFrequency 172 fi 173 # 174 if [ X${Seasonal} = Xtrue ] ; then 175 list_post=${list_post} SeasonalFrequency 176 fi 177 # 168 178 # READ TIME SERIES OR SEASONAL FREQUENCY 169 # AND TURN ON THE FLAG WHEN MODULO IS ZERO 170 for post_freq in TimeSeriesFrequency SeasonalFrequency ; do 179 # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO 180 # 181 for post_freq in ${list_post} ; do 171 182 # 172 183 # Initialize … … 196 207 fi 197 208 # 198 # For each componant select determine which files need post-processing 199 # 200 for comp in ${config_ListOfComponents[*]} ; do 201 # 202 #echo "-----" 203 eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 204 ListFilesName=${compname}_OutputFiles_List 205 eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1 206 # 207 if [ X${FileName0} != X${NULL_STR} ] ; then 208 # 209 #IGCM_debug_Print 1 "Component : ${compname}" 210 # 211 # INITIALISATION 212 # 213 eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1 214 typeset i=0 215 # 216 until [ $i -eq $NbFiles ]; do 217 # 218 eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1 219 eval file_in=${file_in_} 220 let $(( i_ = i+2 )) 221 eval flag_post_=\${${ListFilesName}[$i_]} > /dev/null 2>&1 222 eval flag_post=${flag_post_} 223 # 224 if [ X${flag_post} != XNONE ] ; then 225 # 226 case ${config_Post_post_freq} in 227 *y|*Y) 228 PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" ) 229 # 230 case ${config_UserChoices_PeriodLength} in 231 *Y|*y) 232 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" ) 233 if [ ${PeriodPost} -le ${PeriodYear} ] ; then 234 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ; then 235 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 236 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 237 fi 238 else 239 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 240 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 241 fi ;; 242 *M|*m) 243 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 244 if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then 245 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then 246 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true 247 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true 248 fi 249 else 250 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 251 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 252 fi ;; 253 *D|*d) 254 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 255 NbDays=$( IGCM_date_DaysInYear ${year} ) 256 if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then 257 if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then 258 if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \ 259 $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then 260 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true 261 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true 262 fi 263 else 264 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 265 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 266 fi 267 else 209 case ${config_Post_post_freq} in 210 *y|*Y) 211 PeriodYear=$( echo ${config_Post_post_freq} | sed -e "s/[yY]//" ) 212 # 213 case ${config_UserChoices_PeriodLength} in 214 *Y|*y) 215 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[yY]//" ) 216 if [ ${PeriodPost} -le ${PeriodYear} ] ; then 217 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodYear} ) -eq 0 ] ; then 218 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 219 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 220 fi 221 else 222 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 223 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 224 fi ;; 225 *M|*m) 226 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 227 if [ ${PeriodPost} -le $(( ${PeriodYear} * 12 )) ] ; then 228 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) % $(( ${PeriodYear} * 12 )) ) -eq 0 ] ; then 229 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && eval ${post_freq}=true 230 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} * 12 )) -ne 0 ] && POST=true 231 fi 232 else 233 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 234 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 235 fi ;; 236 *D|*d) 237 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 238 NbDays=$( IGCM_date_DaysInYear ${year} ) 239 if [ ${config_UserChoices_CalendarType} = 360d ] | [ ${config_UserChoices_CalendarType} = noleap ] ; then 240 if [ ${PeriodPost} -le $(( ${PeriodYear} * ${NbDays} )) ] ; then 241 if [ $( expr $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) % \ 242 $(( ${NbDays} * ${PeriodYear} / ${PeriodPost} )) ) -eq 0 ] ; then 243 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] && eval ${post_freq}=true 244 [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodPost} ) )) -ne 0 ] POST=true 245 fi 246 else 247 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 248 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 249 fi 250 else 268 251 # if [ ${PeriodYear} -eq 1 ] ; then 269 252 # PeriodEndJul=$( IGCM_date_ConvertGregorianDateToJulian ${PeriodDateEnd} ) … … 276 259 # fi 277 260 # else 278 279 280 261 IGCM_debug_Print 3 "For ${post_freq} with leap calendar, for ${comp} and ${file_in} :" 262 IGCM_debug_Print 3 "We have a daily PeriodLength frequency and RebuildFrequency=${PeriodYear}Y." 263 IGCM_debug_Print 3 "No post-treatment. Case not properly handle at this moment." 281 264 # fi 282 fi;; 283 esac ;; 284 *M|*m) 285 PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" ) 286 case ${config_UserChoices_PeriodLength} in 287 *Y|*y) 288 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 289 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 290 *M|*m) 291 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 292 if [ ${PeriodPost} -le ${PeriodMonth} ] ; then 293 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodMonth} ) -eq 0 ] ; then 294 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 295 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 296 fi 297 else 298 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 299 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 300 fi;; 301 *D|*d) 302 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 303 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 304 esac ;; 305 *D|*d) 306 PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" ) 307 case ${config_UserChoices_PeriodLength} in 308 *Y|*y) 309 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 310 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 311 *M|*m) 312 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 313 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 314 *D|*d) 315 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 316 if [ ${PeriodPost} -le ${PeriodDay} ] ; then 317 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay} ) -eq 0 ] ; then 318 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 319 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 320 fi 321 else 322 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 323 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 324 fi;; 325 esac ;; 326 NONE|none) 327 ;; 328 *) 329 IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 330 ;; 331 esac 332 fi 333 let $(( i=i+3 )) 334 done 335 fi 336 done 265 fi;; 266 esac ;; 267 *M|*m) 268 PeriodMonth=$( echo ${config_Post_post_freq} | sed -e "s/[mM]//" ) 269 case ${config_UserChoices_PeriodLength} in 270 *Y|*y) 271 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 272 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 273 *M|*m) 274 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[mM]//" ) 275 if [ ${PeriodPost} -le ${PeriodMonth} ] ; then 276 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodMonth} ) -eq 0 ] ; then 277 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 278 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 279 fi 280 else 281 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 282 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 283 fi;; 284 *D|*d) 285 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 286 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 287 esac ;; 288 *D|*d) 289 PeriodDay=$( echo ${config_Post_post_freq} | sed -e "s/[dD]//" ) 290 case ${config_UserChoices_PeriodLength} in 291 *Y|*y) 292 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 293 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 294 *M|*m) 295 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 296 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " ;; 297 *D|*d) 298 PeriodPost=$( echo ${config_UserChoices_PeriodLength} | sed -e "s/[dD]//" ) 299 if [ ${PeriodPost} -le ${PeriodDay} ] ; then 300 if [ $( expr $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) % ${PeriodDay} ) -eq 0 ] ; then 301 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && eval ${post_freq}=true 302 [ $(( ${CumulPeriod} * ${PeriodPost} - ${PeriodOffset} )) -ne 0 ] && POST=true 303 fi 304 else 305 IGCM_debug_Print 3 "PeriodLength frequency ${config_UserChoices_PeriodLength} not compatbile with" 306 IGCM_debug_Print 3 "${flag_post} frequency : ${config_Post_post_freq} " 307 fi;; 308 esac ;; 309 NONE|none) 310 ;; 311 *) 312 IGCM_debug_Print 3 "KeyWord not allowed for ${post_freq} in config.card" 313 ;; 314 esac 337 315 done 338 316 # … … 662 640 # 663 641 typeset listVarEnv 664 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER, DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"642 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 665 643 IGCM_sys_RshPost <<-EOF 666 644 export DEBUG_debug=${DEBUG_debug} … … 672 650 export POST_DIR=${POST_DIR} 673 651 export MASTER=${MASTER} 652 export RebuildFromArchive=${config_Post_RebuildFromArchive} 674 653 export DateBegin=${DateBegin} 675 654 export PeriodDateBegin=${PeriodDateBegin} … … 698 677 # 699 678 typeset listVarEnv 700 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER, DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE"679 listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_BIOS,config_UserChoices_JobName,R_SAVE" 701 680 IGCM_sys_RshPost <<-EOF 702 681 export DEBUG_debug=${DEBUG_debug} … … 708 687 export POST_DIR=${POST_DIR} 709 688 export MASTER=${MASTER} 689 export RebuildFromArchive=${config_Post_RebuildFromArchive} 710 690 export DateBegin=${DateBegin} 711 691 export PeriodDateBegin=${PeriodDateBegin}
Note: See TracChangeset
for help on using the changeset viewer.