- Timestamp:
- 01/31/12 17:31:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modipsl/trunk/util/ins_job
r1619 r1644 108 108 j=$(cd ${i%/*};/bin/pwd;) 109 109 n_f=${F_RCI##*/}; 110 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}";111 110 112 111 if [ ! X$( echo ${j} | grep USER_SPEC ) = X ] ; then 113 112 # Do not treat config.card if it is in sub-directory of USER_SPEC 114 113 # Continue to next config.card 115 echo "USER_SPEC directory exist in path, do not use this config.card"116 114 continue 115 else 116 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 117 117 fi 118 118 … … 123 123 config_UserChoices_JobNumProcTot=1 124 124 config_UserChoices_UserSpec="" 125 RESOL_ATM_3D=this_is_a_test_string 126 RESOL=this_is_another_test_string 125 127 typeset option 126 128 for option in ${config_UserChoices[*]} ; do … … 128 130 done 129 131 132 # Find the JobName : JobName might contain the variable RESOL_ATM_3D that will be replaced by what is in .resol file 133 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 134 TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 135 JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" ) 136 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 137 elif [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then 138 TRUERESOL=$( find ../ -name ".resol" -exec head -1 {} \; ) 139 JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" ) 140 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 141 else 142 JobName=${config_UserChoices_JobName} 143 fi 144 echo "JobName=${JobName}" 145 130 146 # Add specific treatment for new type of directory structure 131 147 if [ -d ${j}/USER_SPEC ] && [ -d ${j}/GENERAL ] ; then 132 148 echo "This is new configuration structure" 133 echo "JobName=${config_UserChoices_JobName}"134 149 135 150 if [ "X${config_UserChoices_UserSpec}" = X ] ; then … … 143 158 fi 144 159 145 if [ -d ${j}/${ config_UserChoices_JobName} ] ; then146 echo "Directory ${j}/${ config_UserChoices_JobName} exist already, continue next config.card"160 if [ -d ${j}/${JobName} ] ; then 161 echo "Directory ${j}/${JobName} exist already, continue next config.card" 147 162 continue 148 163 fi 149 cp -r ${j}/USER_SPEC/${config_UserChoices_UserSpec} ${j}/${ config_UserChoices_JobName}150 cp -r ${j}/GENERAL/* ${j}/${ config_UserChoices_JobName}/.151 cp -f ${j}/${F_CFG} ${j}/${ config_UserChoices_JobName}/.152 j=${j}/${ config_UserChoices_JobName}164 cp -r ${j}/USER_SPEC/${config_UserChoices_UserSpec} ${j}/${JobName} 165 cp -r ${j}/GENERAL/* ${j}/${JobName}/. 166 cp -f ${j}/${F_CFG} ${j}/${JobName}/. 167 j=${j}/${JobName} 153 168 echo new j=$j 154 169 fi … … 160 175 \cp ${F_RCI} ${j}; 161 176 } 162 # We keep explicitly JobName because it is not optionnal. 163 RESOL_ATM_3D=this_is_a_test_string 164 RESOL=this_is_another_test_string 165 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 166 TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 167 config_UserChoices_JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" ) 168 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${config_UserChoices_JobName} 169 else 170 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then 171 TRUERESOL=$( find ../ -name ".resol" -exec head -1 {} \; ) 172 config_UserChoices_JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" ) 173 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${config_UserChoices_JobName} 174 fi 175 fi 176 177 177 178 # File name for Job 178 n_f='Job_'${ config_UserChoices_JobName};179 n_f='Job_'${JobName}; 179 180 [[ -f ${j}'/'${n_f} ]] && { ins_job_Warning; continue; } 180 181 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; … … 182 183 -e "/^${W_P}/d" \ 183 184 -e "s%::modipsl::%${F_MOD}%" \ 184 -e "s/::Jobname::/${ config_UserChoices_JobName}/" \185 -e "s/::Jobname::/${JobName}/" \ 185 186 -e "s/::JobClass::/${config_UserChoices_JobClass}/" \ 186 187 -e "s/::JobNumProcTot::/${config_UserChoices_JobNumProcTot}/" \
Note: See TracChangeset
for help on using the changeset viewer.