Changeset 4148 for branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/makenemo
- Timestamp:
- 2013-11-04T13:54:28+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2013/dev_LOCEAN_2013/NEMOGCM/CONFIG/makenemo
r3764 r4148 106 106 export AGRIFUSE=10 107 107 declare -a TAB 108 list_key=0 109 chk_key=1 108 110 #- 109 111 #- FCM and functions location --- … … 112 114 #- 113 115 #- Choice of the options --- 114 while getopts :hd:n:r:m:j:e:s:v:t: V116 while getopts :hd:n:r:m:j:e:s:v:t:k: V 115 117 do 116 118 case $V in 117 119 (h) x_h=${OPTARG}; 118 120 echo "Usage : "${b_n} \ 119 " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No] ";121 " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No] [-k 0/1]"; 120 122 echo " -h : help"; 121 123 echo " -h institute : specific help for consortium members"; … … 128 130 echo " -j No : number of processes used to compile (0=nocompilation)"; 129 131 echo " -v No : set verbosity level for compilation [0-3]"; 132 echo " -k 0/1 : used cpp keys check (default = 1 -> check activated)"; 130 133 echo " -t dir : temporary directory for compilation" 131 134 echo ""; … … 141 144 echo "Example to clean "; 142 145 echo "./makenemo clean"; 146 echo ""; 147 echo "Example to list the available keys of a CONFIG "; 148 echo "./makenemo list_key"; 143 149 echo ""; 144 150 echo "Example to add and remove keys"; … … 158 164 (j) x_j=${OPTARG};; 159 165 (t) x_t=${OPTARG};; 160 (e) x_e=${OPTARG};; 161 (s) x_s=${OPTARG};; 162 (v) x_v=${OPTARG};; 166 (e) x_e=${OPTARG};; 167 (s) x_s=${OPTARG};; 168 (v) x_v=${OPTARG};; 169 (k) chk_key=${OPTARG};; 163 170 (:) echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 164 171 exit 2;; … … 188 195 export ${list_del_key} 189 196 shift 197 ;; 198 list_key) 199 list_key=1 190 200 ;; 191 201 *) … … 222 232 [ "${CMP_NAM}" == help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 223 233 224 #- When used for the first time, choose a compiler ---225 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm ${CMP_NAM} || exit226 227 234 #- 228 235 #- Choose a default configuration if needed --- 229 236 #- ORCA2_LIM or last one used --- 230 237 . ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 231 232 238 233 239 if [ ${#NEW_CONF} -eq 0 ] ; then … … 269 275 . ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF} ${NEMO_TDIR} || exit 270 276 277 # build the complete list of the cpp keys of this configuration 278 if [ $chk_key -eq 1 ] ; then 279 for i in $( grep "^ *#.* key_" ${NEW_CONF}/WORK/* ) 280 do 281 echo $i | grep key_ | sed -e "s/=.*//" 282 done | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt 283 if [ $list_key -eq 1 ]; then 284 cat ${COMPIL_DIR}/full_key_list.txt 285 exit 0 286 fi 287 fi 288 271 289 #- At this stage new configuration has been added, 272 290 #- We add or remove keys … … 278 296 . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key} 279 297 fi 298 299 #- check that all keys are really existing... 300 if [ $chk_key -eq 1 ] ; then 301 for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm ) 302 do 303 if [ "$( echo $kk | cut -c 1-4 )" == "key_" ]; then 304 kk=${kk/=*/} 305 nb=$( grep -c $kk ${COMPIL_DIR}/full_key_list.txt ) 306 if [ $nb -eq 0 ]; then 307 echo 308 echo "E R R O R : key "$kk" is not found in ${NEW_CONF}/WORK routines..." 309 echo "we stop..." 310 echo 311 exit 1 312 fi 313 fi 314 done 315 fi 316 317 #- At this stage cpp keys have been updated. we can check the arch file 318 #- When used for the first time, choose a compiler --- 319 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 280 320 281 321 #- At this stage the configuration has beeen chosen … … 317 357 rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD 318 358 rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/opa 359 rm -f ${COMPIL_DIR}/*history ${COMPIL_DIR}/*fcm ${COMPIL_DIR}/*txt 319 360 echo "cleaning ${NEW_CONF} WORK, BLD" 320 361 fi
Note: See TracChangeset
for help on using the changeset viewer.