Changeset 412
- Timestamp:
- 01/28/11 17:22:24 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
r409 r412 306 306 { 307 307 IGCM_debug_PushStack "IGCM_SmoothModulo" 308 309 set -vx 308 310 typeset defVector ModValue 309 311 310 312 eval set +A defVector -- $( echo "${1}" | \ 311 313 gawk -F ':' '{print ($1 == "" ? 1 : $1) " " (NF==3 ? ($2 == "" ? 1 : $2) : 1) " " (NF==3 ? ($3 == "" ? -1 : $3) : ($2 == "" ? -1 : $2))}' ) 314 315 # Save Smooth Min and Max. Needed to call IGCM_sys_Get when appropriate 316 arr[1]=${defVector[0]} 317 arr[2]=${defVector[2]} 312 318 313 319 # Test limits : … … 317 323 ( [ ${2} -le ${defVector[2]} ] || \ 318 324 [ ${defVector[2]} -lt 0 ] ) ) ; then 319 320 # Save Smooth Min and Max. Needed to call IGCM_sys_Get when appropriate321 SmoothMin=${defVector[0]}322 SmoothMax=${defVector[2]}323 325 # Test modulo 324 326 ModValue=$( expr \( ${2} - ${defVector[0]} \) % ${defVector[1]} ) 325 327 if [ ${ModValue} -eq 0 ] ; then 326 echo true 328 arr[3]=true 329 echo ${arr[@]} 327 330 IGCM_debug_PopStack "IGCM_SmoothModulo" 328 331 return 1 329 332 else 330 echo false 333 arr[3]=false 334 echo ${arr[@]} 331 335 IGCM_debug_PopStack "IGCM_SmoothModulo" 332 336 return 0 333 337 fi 334 338 else 335 echo false 339 arr[3]=false 340 echo ${arr[@]} 336 341 IGCM_debug_PopStack "IGCM_SmoothModulo" 337 342 return 0 … … 344 349 IGCM_debug_PushStack "IGCM_comp_GetInputSmoothFiles" 345 350 351 set -vx 352 346 353 # Debug Print : 347 354 echo … … 349 356 echo 350 357 351 typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ i__352 typeset file_in_ file_in file_out_ file_out ret SmoothDef 358 typeset comp compname comptagname card ListFilesName FileName0 NbFiles j i i_ i__ 359 typeset file_in_ file_in file_out_ file_out ret SmoothDef aux val 353 360 354 361 for comp in ${config_ListOfComponents[*]} ; do 355 356 362 echo "-----" 357 363 # Define component … … 373 379 (( i=0 )) 374 380 until [ $i -ge $NbFiles ]; do 375 376 381 eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1 377 382 eval file_in=${file_in_} … … 384 389 eval SmoothDef=\${${ListFilesName}[$i__]} 385 390 IGCM_debug_Print 3 " ${file_in} ${SmoothDef}" 386 eval ret=$( IGCM_SmoothModulo ${SmoothDef} ${CumulPeriod} ) 387 if ( [ X${ret} = Xtrue ] || ( [ ${Period} -eq 1 ] && [ ${CumulPeriod} -ge ${SmoothMin} ] && [ ${CumulPeriod} -le ${SmoothMax} ) ) ; then 391 aux=$( IGCM_SmoothModulo ${SmoothDef} ${CumulPeriod} ) 392 j=1 393 for val in ${aux} ; do 394 [ ${j} -eq 1 ] && SmoothMin=${val} 395 [ ${j} -eq 2 ] && SmoothMax=${val} 396 [ ${j} -eq 3 ] && ret=${val} 397 (( j=j+1 )) 398 done 399 if ( [ X${ret} = Xtrue ] || ( [ ${Period} -eq 1 ] && [ ${CumulPeriod} -ge ${SmoothMin} ] && [ ${CumulPeriod} -le ${SmoothMax} ] ) ) ; then 388 400 IGCM_sys_Get ${file_in} ${file_out} 389 401 #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
Note: See TracChangeset
for help on using the changeset viewer.