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 3922 for trunk/NEMOGCM/CONFIG – NEMO

Changeset 3922 for trunk/NEMOGCM/CONFIG


Ignore:
Timestamp:
2013-06-14T12:37:08+02:00 (11 years ago)
Author:
smasson
Message:

trunk:compilation enhancements, see ticket #1117

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/makenemo

    r3764 r3922  
    106106export AGRIFUSE=10 
    107107declare -a TAB 
     108list_key=0; 
    108109#- 
    109110#- FCM and functions location --- 
     
    142143   echo "./makenemo clean"; 
    143144   echo ""; 
     145   echo "Example to list the available keys of a CONFIG "; 
     146   echo "./makenemo list_key"; 
     147   echo ""; 
    144148   echo "Example to add and remove keys"; 
    145149   echo "./makenemo add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" "; 
     
    158162   (j)  x_j=${OPTARG};; 
    159163   (t)  x_t=${OPTARG};; 
    160     (e)  x_e=${OPTARG};; 
    161     (s)  x_s=${OPTARG};; 
    162     (v)  x_v=${OPTARG};; 
     164   (e)  x_e=${OPTARG};; 
     165   (s)  x_s=${OPTARG};; 
     166   (v)  x_v=${OPTARG};; 
    163167   (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    164168   exit 2;; 
     
    188192       export ${list_del_key} 
    189193       shift 
     194       ;; 
     195   list_key) 
     196       list_key=1 
    190197       ;; 
    191198   *) 
     
    222229[ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 
    223230 
    224 #- When used for the first time, choose a compiler --- 
    225 . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm ${CMP_NAM} || exit 
    226  
    227231#- 
    228232#- Choose a default configuration if needed --- 
    229233#- ORCA2_LIM or last one used --- 
    230234. ${COMPIL_DIR}/Fcheck_config.sh cfg.txt ${NEW_CONF} || exit 
    231  
    232235 
    233236if [ ${#NEW_CONF} -eq 0 ] ; then 
     
    269272. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 
    270273 
     274# build the complete list of the cpp keys of this configuration 
     275for i in $( grep "^# .*key" GYRE/WORK/* )  
     276do 
     277    echo $i | grep key_ 
     278done | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt 
     279if [ $list_key -eq 1 ]; then 
     280    cat ${COMPIL_DIR}/full_key_list.txt 
     281    exit 0 
     282fi 
     283 
    271284#- At this stage new configuration has been added, 
    272285#- We add or remove keys 
     
    278291    . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key} 
    279292fi 
     293 
     294for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm ) 
     295do 
     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 
     304   fi 
     305    fi 
     306done 
     307 
     308#- At this stage cpp keys have been updated. we can check the arch file 
     309#- When used for the first time, choose a compiler --- 
     310. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 
    280311 
    281312#- At this stage the configuration has beeen chosen 
Note: See TracChangeset for help on using the changeset viewer.