New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3937 for trunk/NEMOGCM/CONFIG/makenemo – NEMO

Ignore:
Timestamp:
2013-06-24T18:04:26+02:00 (10 years ago)
Author:
smasson
Message:

trunk:compilation enhancements, bugfix of changeset r3922, see ticket #1117

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/makenemo

    r3924 r3937  
    106106export AGRIFUSE=10 
    107107declare -a TAB 
    108 list_key=0; 
     108list_key=0 
     109chk_key=1 
    109110#- 
    110111#- FCM and functions location --- 
     
    113114#- 
    114115#- Choice of the options --- 
    115 while getopts :hd:n:r:m:j:e:s:v:t: V 
     116while getopts :hd:n:r:m:j:e:s:v:t:k: V 
    116117do 
    117118    case $V in 
    118119   (h) x_h=${OPTARG}; 
    119120        echo "Usage   : "${b_n} \ 
    120        " [-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]"; 
    121122   echo " -h           : help"; 
    122123   echo " -h institute : specific help for consortium members"; 
     
    129130        echo " -j No        : number of processes used to compile (0=nocompilation)"; 
    130131        echo " -v No        : set verbosity level for compilation [0-3]"; 
     132        echo " -k 0/1       : used cpp keys check (default = 1 -> check activated)"; 
    131133   echo " -t dir       : temporary directory for compilation" 
    132134   echo ""; 
     
    165167   (s)  x_s=${OPTARG};; 
    166168   (v)  x_v=${OPTARG};; 
     169   (k)  chk_key=${OPTARG};; 
    167170   (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    168171   exit 2;; 
     
    273276 
    274277# build the complete list of the cpp keys of this configuration 
    275 for i in $( grep "^ *#.* key_" ${NEW_CONF}/WORK/* )  
    276 do 
    277     echo $i | grep key_ 
    278 done | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt 
    279 if [ $list_key -eq 1 ]; then 
    280     cat ${COMPIL_DIR}/full_key_list.txt 
    281     exit 0 
     278if [ $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 
    282287fi 
    283288 
     
    292297fi 
    293298 
    294 for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm ) 
    295 do 
    296     if [ "$( echo $kk | cut -c 1-4 )" == "key_" ]; then 
    297    nb=$( grep -c $kk ${COMPIL_DIR}/full_key_list.txt ) 
    298    if [ $nb -eq 0 ]; then 
    299        echo 
    300        echo "E R R O R : key "$kk" is not found in ${NEW_CONF}/WORK routines..." 
    301        echo "we stop..." 
    302        echo 
    303        exit 1 
     299#- check that all keys are really existing... 
     300if [ $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 
    304313   fi 
    305     fi 
    306 done 
     314    done 
     315fi 
    307316 
    308317#- At this stage cpp keys have been updated. we can check the arch file 
     
    348357        rm -rf ${NEMO_TDIR}/${NEW_CONF}/BLD 
    349358        rm -rf ${NEMO_TDIR}/${NEW_CONF}/EXP00/opa 
     359        rm -f ${COMPIL_DIR}/*history ${COMPIL_DIR}/*fcm ${COMPIL_DIR}/*txt 
    350360        echo "cleaning ${NEW_CONF} WORK, BLD" 
    351361    fi 
Note: See TracChangeset for help on using the changeset viewer.