Changeset 509 for branches/libIGCM_MPI_OpenMP
- Timestamp:
- 10/19/11 14:33:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libIGCM_MPI_OpenMP/AA_move-and-rename
r436 r509 61 61 { 62 62 IGCM_debug_PushStack "REPLACE_sed" 63 typeset RET 63 64 64 65 FILEIN=${1} … … 85 86 IGCM_debug_PushStack "MOVE_and_RENAME_files" 86 87 87 typeset VAR_files FILE_OUT 88 typeset VAR_files FILE_OUT file i RET 88 89 89 90 VAR_files=${1} 90 91 eval VAR1=\${${VAR_files[0]}} 91 92 92 set +A FILE_OUT -- $( eval echo \${${VAR_files}[*]} | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" ) 93 if [ X$( echo ${NEW_R_SAVE} | grep ${config_UserChoices_JobName} ) != X ]; then 94 set +A FILE_OUT -- $( eval echo \${${VAR_files}[*]} | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" ) 95 ((i=0)) 96 for file in ${FILE_OUT[@]} ; do 97 FILE_OUT[$i]=$( dirname $file )/$( echo $( basename $file ) | sed -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" ) 98 (( i = i + 1 )) 99 done 100 else 101 set +A FILE_OUT -- $( eval echo \${${VAR_files}[*]} | sed -e "s&${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" ) 102 fi 93 103 IGCM_debug_Print 3 "MOVE_and_RENAME_files all : ${VAR1}" 94 104 IGCM_debug_Print 3 " to ${FILE_OUT}." … … 97 107 for file_o in ${FILE_OUT[@]} ; do 98 108 eval IGCM_sys_Mv \${${VAR_files}[${ifile}]} ${file_o} 109 RET=$? 99 110 (( ifile = ifile + 1 )) 100 111 done 101 RET=$?102 112 103 113 IGCM_debug_PopStack "MOVE_and_RENAME_files" … … 242 252 # Change JobName and copy run.card 243 253 if [ -f ${OutinDir}/run.card ] ; then 244 REPLACE_sed ${OutinDir}/run.card ${OutNEWDir} 254 sed -e "s/OldPrefix=\ *${config_UserChoices_JobName}/OldPrefix= ${NEW_JobName}/g" \ 255 ${OutinDir}/run.card > ${RUN_DIR_PATH}/run.card 256 RET=$? 257 if [ ${RET} = 0 ] ; then 258 IGCM_sys_Mv -f ${RUN_DIR_PATH}/run.card ${OutNEWDir} 259 IGCM_sys_Rm -f ${OutinDir}/run.card 260 fi 245 261 fi 246 262 … … 250 266 if [ ${#listfiles[*]} -gt 0 ] ; then 251 267 IGCM_sys_Cp ${listfiles[*]} ${OutNEWDir} 252 IGCM_sys_Rm -f ${listfiles[*]} 268 RET=$? 269 if [ ${RET} = 0 ] ; then 270 IGCM_sys_Rm -f ${listfiles[*]} 271 fi 253 272 fi 254 273 … … 261 280 unset listfiles 262 281 set +A listfiles -- $( find ${OutinDir} -type f -name "*_out_${config_Executable_Name}" ) 282 MOVE_and_RENAME_files "listfiles" 283 unset listfiles 284 set +A listfiles -- $( find ${OutinDir} -type f -name "*_out_execution" ) 263 285 MOVE_and_RENAME_files "listfiles" 264 286 … … 415 437 IGCM_sys_MkdirArchive ${NEW_R_SAVE}/${R_MONITORING} 416 438 REPLACE_sed ${R_SAVE}/${R_MONITORING}/index.html ${NEW_R_SAVE}/${R_MONITORING} 417 REPLACE_sed ${R_SAVE}/${R_MONITORING}/run.card ${NEW_R_SAVE}/${R_MONITORING} 439 sed -e "s/OldPrefix=\ *${config_UserChoices_JobName}/OldPrefix= ${NEW_JobName}/g" \ 440 ${R_SAVE}/${R_MONITORING}/run.card > ${RUN_DIR_PATH}/run.card 441 IGCM_sys_Mv -f ${RUN_DIR_PATH}/run.card ${NEW_R_SAVE}/${R_MONITORING} 442 RET=$? 443 if [ ${RET} = 0 ] ; then 444 IGCM_sys_Rm -f ${R_SAVE}/${R_MONITORING}/run.card 445 fi 418 446 REPLACE_sed ${R_SAVE}/${R_MONITORING}/config.card ${NEW_R_SAVE}/${R_MONITORING} 419 447 IGCM_sys_Cp -rp ${R_SAVE}/${R_MONITORING} ${NEW_R_SAVE} … … 487 515 if [ -f ${SUBMIT_DIR}/run.card ] ; then 488 516 IGCM_debug_Print 1 "edit run.card" 489 sed -e "s &${R_SAVE}&${NEW_R_SAVE}&g" -e "s/${config_UserChoices_JobName}/${NEW_JobName}/g" \517 sed -e "s/OldPrefix=\ *${config_UserChoices_JobName}/OldPrefix= ${NEW_JobName}/g" \ 490 518 ${SUBMIT_DIR}/run.card > ${RUN_DIR_PATH}/run.card 491 519 IGCM_sys_Mv -f ${RUN_DIR_PATH}/run.card ${SUBMIT_DIR}/run.card
Note: See TracChangeset
for help on using the changeset viewer.