Changeset 1828 for modipsl/trunk/util/ins_job
- Timestamp:
- 07/20/12 11:01:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modipsl/trunk/util/ins_job
r1644 r1828 14 14 15 15 Usage : 16 ${b_n} [-h] [-v] 16 ${b_n} [-h] [-v] [-e] 17 17 18 18 Options : 19 19 -h : help 20 20 -v : verbose mode 21 -e : turn on hindcast/forecast ensemble mode 21 22 " 22 23 } … … 35 36 #- 36 37 x_v='silencious'; 37 while getopts :hv V 38 do 39 case $V in 40 (h) ins_job_Usage; exit 0;; 41 (v) x_v='verbose';; 42 (:) echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 43 exit 2;; 44 (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; 45 exit 2;; 46 esac 47 done 38 x_e=false; 39 while getopts :hve V ; do 40 case $V in 41 (h) ins_job_Usage; exit 0;; 42 (v) x_v='verbose';; 43 (e) x_e=true;; 44 (:) echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 45 exit 2;; 46 (\?) echo ${b_n}" : -"${OPTARG}" option : not supported" 1>&2; 47 exit 2;; 48 esac 49 done 48 50 shift $(($OPTIND-1)); 49 51 #- … … 93 95 #- 94 96 DEBUG_debug=false 97 MirrorlibIGCM=false 95 98 . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh 96 99 . ${libIGCM}/libIGCM_card/libIGCM_card.ksh 100 . ${libIGCM}/libIGCM_date/libIGCM_date.ksh 101 . ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh 102 if [ $x_e = 'true' ] ; then 103 . ${libIGCM}/libIGCM_ensemble/libIGCM_ensemble.ksh 104 fi 97 105 #- 98 106 # Define the pattern string to substitute … … 109 117 n_f=${F_RCI##*/}; 110 118 111 if [ ! X$( echo ${j} | grep USER_SPEC) = X ] ; then112 # Do not treat config.card if it is in sub-directory of USER_SPEC119 if [ ! X$( echo ${j} | grep EXPERIMENTS ) = X ] ; then 120 # Do not treat config.card if it is in sub-directory of EXPERIMENTS 113 121 # Continue to next config.card 114 122 continue 115 123 else 116 124 print - "\nWorking with file ${F_CFG}\nin directory ${j}\nfor ${n_f}"; 125 fi 126 127 # Find out if new structure and set .resol filename 128 if [ -d ${j}/EXPERIMENTS ] && [ -d ${j}/GENERAL ] ; then 129 # New Structure 130 echo "This is new configuration structure" 131 new_struct=yes 132 resolfile=$j/.resol 133 else 134 # Old Structure 135 new_struct=no 136 resolfile=$j/../.resol 117 137 fi 118 138 … … 122 142 config_UserChoices_JobClass=mono 123 143 config_UserChoices_JobNumProcTot=1 124 config_UserChoices_ UserSpec=""144 config_UserChoices_ExpType="" 125 145 RESOL_ATM_3D=this_is_a_test_string 126 146 RESOL=this_is_another_test_string … … 132 152 # Find the JobName : JobName might contain the variable RESOL_ATM_3D that will be replaced by what is in .resol file 133 153 if [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL_ATM_3D} ) = X ] ; then 134 TRUERESOL=$( find ../ -name ".resol" -exec tail -1 {} \; | awk "-F=" '{print $2}' ) 154 TRUERESOL=$( tail -1 $resolfile | awk "-F=" '{print $2}' ) 155 echo TRUERESOL = $TRUERESOL 135 156 JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL_ATM_3D}/${TRUERESOL}/" ) 136 157 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} 137 158 elif [ ! X$( echo ${config_UserChoices_JobName} | grep ${RESOL} ) = X ] ; then 138 TRUERESOL=$( find ../ -name ".resol" -exec head -1 {} \;)159 TRUERESOL=$( head -1 $resolfile ) 139 160 JobName=$( echo ${config_UserChoices_JobName} | sed -e "s/${RESOL}/${TRUERESOL}/" ) 140 161 IGCM_card_WriteOption ${j}'/'${F_CFG} UserChoices JobName ${JobName} … … 145 166 146 167 # Add specific treatment for new type of directory structure 147 if [ -d ${j}/USER_SPEC ] && [ -d ${j}/GENERAL ] ; then 148 echo "This is new configuration structure" 149 150 if [ "X${config_UserChoices_UserSpec}" = X ] ; then 168 if [ ${new_struct} == yes ] ; then 169 170 if [ "X${config_UserChoices_ExpType}" = X ] ; then 151 171 echo "\nERROR in ${j}/config.card" 152 172 echo "ins_job stops here" 153 echo "=> The variable UserSpecmust be added in config.card in section UserChoices"154 echo "=> UserSpec gives the directory for the .card configurtaion files for the wanted experiement. For exemple UserSpec=IPSLCM5/historical"173 echo "=> The variable ExpType must be added in config.card in section UserChoices" 174 echo "=> ExpType gives the directory for the .card configurtaion files for the wanted experiement. For exemple ExpType=IPSLCM5/historical" 155 175 exit 4 156 176 else 157 echo " UserSpec= ${config_UserChoices_UserSpec}"177 echo "ExpType= ${config_UserChoices_ExpType}" 158 178 fi 159 179 … … 162 182 continue 163 183 fi 164 cp -r ${j}/ USER_SPEC/${config_UserChoices_UserSpec} ${j}/${JobName}184 cp -r ${j}/EXPERIMENTS/${config_UserChoices_ExpType} ${j}/${JobName} 165 185 cp -r ${j}/GENERAL/* ${j}/${JobName}/. 166 186 cp -f ${j}/${F_CFG} ${j}/${JobName}/. … … 207 227 done 208 228 #- 229 # Limited to hindcast/forecast Ensemble for the time being 230 if [ ${x_e} = 'true' ] ; then 231 #.. Read input data from ensemble.card .. 232 # TO BE CHANGED 233 FileName="ensemble.card" 234 SUBMIT_DIR=$( pwd ) 235 RUN_DIR="${WORKDIR}/ENSEMBLE" 236 # 237 # Copy initial things around and define variables (hindcast/forecast case) 238 IGCM_ensemble_CastInit 239 # As it says 240 IGCM_sys_Cd ${SUBMIT_DIR} 241 IGCM_ensemble_CastPeriodicStarts 242 # As it says 243 IGCM_sys_Cd ${SUBMIT_DIR} 244 IGCM_ensemble_CastNonPeriodicStarts 245 # Done 246 IGCM_sys_Cp ${RUN_DIR}/CreatedDir.txt ${RUN_DIR}/Qsub.txt ${SUBMIT_DIR} 247 IGCM_sys_Cd ${SUBMIT_DIR} 248 fi 249 #- 209 250 print - ""; 210 251 #-
Note: See TracChangeset
for help on using the changeset viewer.