- Timestamp:
- 07/19/07 13:44:11 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modipsl/trunk/util/ins_job
r92 r93 6 6 function ins_job_Usage 7 7 { 8 echo"8 print - " 9 9 ins_job installs the jobs in the directories 10 10 which contain a file config.card … … 20 20 -v : verbose mode 21 21 " 22 } 23 function ins_job_Warning 24 { 25 print - "\n############### WARNING ###############"; 26 print - "File ${n_f} already exists\nin directory ${j}"; 27 print - "You must delete this file to update !"; 22 28 } 23 29 #- … … 90 96 . ${libIGCM}/libIGCM_card/libIGCM_card.ksh 91 97 #- 98 # Define the pattern string to substitute 99 #- 100 W_P='#-Q- '; W_W=${W_P}${x_t}; 101 #- 92 102 # Extract list of 'config.card' files 93 103 # and create jobs with AA_job … … 97 107 for i in ${l_cfg} 98 108 do 99 j=$(cd ${i%/*};pwd) 100 \cp ${F_RCI} ${j} 101 IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices JobName 102 print - "\nWorking with file ${F_CFG}"; 103 print - "in directory ${j}"; 104 print - "for Job_${config_UserChoices_JobName}" 105 W_P='#-Q- '; W_W=${W_P}${x_t}; 106 sed -e "/^${W_W} */ s///" \ 107 -e "/^${W_P}/d" \ 108 -e "s%::modipsl::%${F_MOD}%" \ 109 -e "s/::Jobname::/${config_UserChoices_JobName}/" \ 110 ${F_JOB} > ${j}'/Job_'${config_UserChoices_JobName} 109 j=$(cd ${i%/*};pwd) 110 n_f=${F_RCI##*/}; 111 [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; } 112 [[ ! -f ${j}'/'${n_f} ]] && \ 113 { 114 print - "\nCopying file ${F_RCI}\nin directory ${j}"; 115 \cp ${F_RCI} ${j}; 116 } 117 IGCM_card_DefineVariableFromOption ${j}'/'${F_CFG} UserChoices JobName 118 n_f='Job_'${config_UserChoices_JobName}; 119 [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; } 120 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 121 sed -e "/^${W_W} */ s///" \ 122 -e "/^${W_P}/d" \ 123 -e "s%::modipsl::%${F_MOD}%" \ 124 -e "s/::Jobname::/${config_UserChoices_JobName}/" \ 125 ${F_JOB} > ${j}'/'${n_f} 111 126 done 112 127 #- … … 117 132 for i in ${l_cfg} 118 133 do 119 i_f=${i##*/}; 120 [[ ${i_f} = 'AA_job' ]] && continue 121 i_d=${i%/*}; n_f=${i_f#AA_}'.job'; 122 print - "\nIn directory ${i_d}\n${i_f} -> ${n_f}" 123 sed -e "/^${W_W} */ s///" \ 124 -e "/^${W_P}/d" \ 125 ${i} > ${i_d}'/'${n_f} 134 i_f=${i##*/}; 135 [[ ${i_f} = 'AA_job' ]] && { continue; } 136 j=${i%/*}; n_f=${i_f#AA_}'.job'; 137 [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; } 138 print - "\nIn directory ${j}\n${i_f} -> ${n_f}" 139 sed -e "/^${W_W} */ s///" \ 140 -e "/^${W_P}/d" \ 141 ${i} > ${j}'/'${n_f} 126 142 done 143 #- 144 print - ""; 127 145 #- 128 146 # That's all folks
Note: See TracChangeset
for help on using the changeset viewer.