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 3198 for branches/2011/dev_NEMO_MERGE_2011 – NEMO

Ignore:
Timestamp:
2011-12-07T15:53:38+01:00 (12 years ago)
Author:
rblod
Message:

Add new functionalities to makenemo, see ticket #894

Location:
branches/2011/dev_NEMO_MERGE_2011/NEMOGCM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/ARCH/arch-gfortran_osx.fcm

    r2490 r3198  
    1515 
    1616 
    17 %NCDF_INC            -I/usr/local/netcdf/include 
    18 %NCDF_LIB            -L/usr/local/netcdf/lib -lnetcdf 
    19 %FC                gfortran 
     17%NCDF_INC            -I/usr/local/pub/netcdf/4.0.1-gfortran/include 
     18%NCDF_LIB            -L/usr/local/pub/netcdf/4.0.1-gfortran/lib -lnetcdf 
     19%FC                mpif90 
    2020%FCFLAGS             -fdefault-real-8 -O3 -funroll-all-loops -fcray-pointer  
    2121%FFLAGS              %FCFLAGS 
    22 %LD                  gfortran 
     22%LD                  mpif90 
    2323%LDFLAGS 
    2424%FPPFLAGS            -P -C -traditional 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/ARCH/arch-ifort_osx.fcm

    r2370 r3198  
    1515 
    1616 
    17 %NCDF_INC            -I/usr/local/include  
    18 %NCDF_LIB            -L /usr/local/lib -lnetcdf    
     17%NCDF_INC            -I/usr/local/pub/netcdf/4.0.1-ifort/include  
     18%NCDF_LIB            -L /usr/local/pub/netcdf/4.0.1-ifort/lib -lnetcdf    
    1919%FC                  mpif90 
    2020%FCFLAGS         -r8 -O3  -traceback  
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/CONFIG/makenemo

    r2731 r3198  
    8989export TOOLS_DIR=${MAIN_DIR}/TOOLS 
    9090export COMPIL_DIR=${MAIN_DIR}/TOOLS/COMPILE 
    91 export NEMO_DIR=${MAIN_DIR}/NEMO 
     91export NEMO_DIR=${MAIN_DIR}/${x_s} 
    9292export AGRIFUSE=10 
    9393 
     
    100100#- Choice of the options --- 
    101101x_d=""; 
     102x_h=""; 
    102103x_n=""; 
    103104x_r=""; 
     
    106107x_c=""; 
    107108x_j=1; 
    108 while getopts :hd:n:r:m:j:t: V 
     109x_e="none"; 
     110x_s=NEMO; 
     111x_v=1; 
     112while getopts :hd:n:r:m:j:e:s:v:t: V 
    109113do 
    110114    case $V in 
    111    (h)  echo "Usage   : "${b_n} \ 
    112        " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-j No]"; 
    113    echo " -h    : help"; 
    114    echo " -n name : config name, [-n help] to list existing configurations"; 
    115    echo " -m arch : choose compiler, [-m help] to list existing compilers"; 
    116    echo " -d dir  : choose NEMO sub-directories"; 
    117    echo " -r conf : choose reference configuration"; 
    118    echo " -j No    : number of processes used to compile (0=nocompilation)"; 
    119    echo " -t dir  : temporary directory for compilation" 
     115   (h) x_h=${OPTARG}; 
     116        echo "Usage   : "${b_n} \ 
     117       " [-h] [-n name] [-m arch] [-d "dir1 dir2"] [-r conf] [-s Path] [-e Path] [-j No] [-v No]"; 
     118   echo " -h           : help"; 
     119   echo " -h institute : specific help for consortium members"; 
     120   echo " -n name      : config name, [-n help] to list existing configurations"; 
     121   echo " -m arch      : choose compiler, [-m help] to list existing compilers"; 
     122   echo " -d dir       : choose NEMO sub-directories"; 
     123   echo " -r conf      : choose reference configuration"; 
     124    echo " -s Path      : choose alternative location for NEMO main directory"; 
     125    echo " -e Path      : choose alternative location for MY_SRC directory"; 
     126    echo " -j No        : number of processes used to compile (0=nocompilation)"; 
     127    echo " -v No        : set verbosity level for compilation [0-3]"; 
     128   echo " -t dir       : temporary directory for compilation" 
    120129   echo ""; 
    121130   echo "Example to install a new configuration MY_CONFIG"; 
     
    137146   echo "./makenemo -n MY_CONFIG -j0 add_key \"key_iomput key_mpp_mpi\" del_key \"key_agrif\" "; 
    138147   echo ""; 
    139    . ${COMPIL_DIR}/Flist_archfile.sh ; 
     148   . ${COMPIL_DIR}/Flist_archfile.sh ${x_h} ; 
    140149   echo ""; 
    141150   echo "Default : previous configuration and compiler"; 
     
    147156   (j)  x_j=${OPTARG};; 
    148157   (t)  x_t=${OPTARG};; 
     158    (e)  x_e=${OPTARG};; 
     159    (s)  x_s=${OPTARG};; 
     160    (v)  x_v=${OPTARG};; 
    149161   (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    150162   exit 2;; 
     
    205217    exit 
    206218fi 
    207 [ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh && exit 
     219[ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit 
    208220 
    209221#- When used for the first time, choose a compiler --- 
     
    250262#- Clean links and librairies --- 
    251263#- Creating the good links, at first on OPA_SRC --- 
    252 . ${COMPIL_DIR}/Fmake_WORK.sh ${NEW_CONF} ${TAB[*]} || exit 
     264. ${COMPIL_DIR}/Fmake_WORK.sh ${x_e} ${NEW_CONF} ${TAB[*]} || exit 
    253265 
    254266. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF}  ${NEMO_TDIR} || exit 
     
    290302        [ "$AGRIFUSE" == 1 ] && rm -rf  ${NEMO_TDIR}/${NEW_CONF}/BLD/* 
    291303    fi 
    292     fcm build ${x_c} --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
     304    fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || cd - 
    293305    [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/opa 
    294306    [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe ] && ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/server.exe  ${CONFIG_DIR}/${NEW_CONF}/EXP00/server.exe 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Fcheck_archfile.sh

    r2520 r3198  
    6969   fi 
    7070else 
    71    ln -sf ${MAIN_DIR}/ARCH/arch-${2}.fcm ${COMPIL_DIR}/$1 
     71   if [ -f  ${MAIN_DIR}/ARCH/arch-${2}.fcm ]; then 
     72      ln -sf ${MAIN_DIR}/ARCH/arch-${2}.fcm ${COMPIL_DIR}/$1 
     73   else 
     74      ln -sf ${MAIN_DIR}/ARCH/LOCAL/arch-${2}.fcm ${COMPIL_DIR}/$1 
     75   fi    
    7276fi 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Fcheck_config.sh

    r2520 r3198  
    3939# - Nothing set, use the previous in use  
    4040# 
    41 # We use TOOLS/COMPILE/cfg.txt to check if the onfiguration exists. 
     41# We use TOOLS/CONFIG_DIR/cfg.txt to check if the onfiguration exists. 
    4242# 
    4343# EXAMPLES 
     
    6868declare -a ZTAB 
    6969if [ ${#2} -eq 0 ]; then 
    70    tail -1  ${COMPIL_DIR}/$1  > ${COMPIL_DIR}/cfg.tmp 
    71    read -a ZTAB < ${COMPIL_DIR}/cfg.tmp 
     70   tail -1  ${CONFIG_DIR}/$1  > ${CONFIG_DIR}/cfg.tmp 
     71   read -a ZTAB < ${CONFIG_DIR}/cfg.tmp 
    7272   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} ) 
    73    \rm ${COMPIL_DIR}/cfg.tmp 
     73   \rm ${CONFIG_DIR}/cfg.tmp 
    7474   echo "Warning !!!" 
    7575   echo "No configuration specified" 
     
    7979fi 
    8080if [ "$1" == cfg.txt ]; then 
    81    cat ${COMPIL_DIR}/$1 | grep "${NEW_CONF} " > ${COMPIL_DIR}/cfg.tmp 
    82    read -a ZTAB < ${COMPIL_DIR}/cfg.tmp 
     81   cat ${CONFIG_DIR}/$1 | grep "${NEW_CONF} " > ${CONFIG_DIR}/cfg.tmp 
     82   read -a ZTAB < ${CONFIG_DIR}/cfg.tmp 
    8383   NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} ) 
    84    \rm ${COMPIL_DIR}/cfg.tmp 
     84   \rm ${CONFIG_DIR}/cfg.tmp 
    8585fi 
    8686 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Fclean_config.sh

    r2520 r3198  
    6969 if [  -z "$answer" -o "x$answer" = "xy" ]; then 
    7070   # testing if configuration exists 
    71    if [ "$(cat ${COMPIL_DIR}/cfg.txt | grep "${NEW_CONF} ")"  == "" ] ; then 
     71   if [ "$(cat ${CONFIG_DIR}/cfg.txt | grep "${NEW_CONF} ")"  == "" ] ; then 
    7272      echo "The configuration ${NEW_CONF} does not exist in file cfg.txt"      
    7373      echo "No removing configuration" 
     
    7575        else 
    7676      rm -rf ${CONFIG_DIR}/${NEW_CONF} 
    77       sed -e "/${NEW_CONF} /d"  ${COMPIL_DIR}/cfg.txt >  ${COMPIL_DIR}/cfg.tmp 
    78       mv  ${COMPIL_DIR}/cfg.tmp  ${COMPIL_DIR}/cfg.txt 
     77      sed -e "/${NEW_CONF} /d"  ${CONFIG_DIR}/cfg.txt >  ${CONFIG_DIR}/cfg.tmp 
     78      mv  ${CONFIG_DIR}/cfg.tmp  ${CONFIG_DIR}/cfg.txt 
    7979      echo "${NEW_CONF} configuration REMOVED"  
    8080        fi 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Fcopy_dir.sh

    r2520 r3198  
    5555 
    5656declare -a ZTAB 
    57 grep "$1 " ${COMPIL_DIR}/cfg.txt > ${COMPIL_DIR}/cfg.tmp 
    58 read -a ZTAB < ${COMPIL_DIR}/cfg.tmp 
     57grep "$1 " ${CONFIG_DIR}/cfg.txt > ${CONFIG_DIR}/cfg.tmp 
     58read -a ZTAB < ${CONFIG_DIR}/cfg.tmp 
    5959TAB=( ${ZTAB[@]:1} ) 
    60 \rm ${COMPIL_DIR}/cfg.tmp 
     60\rm ${CONFIG_DIR}/cfg.tmp 
    6161 
    6262unset -v ZTAB 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Flist_archfile.sh

    r2520 r3198  
    1919# :: 
    2020# 
    21 #  $ Flist_archfile.sh 
     21#  $ Flist_archfile.sh Institute 
    2222# 
    2323# 
     
    3737#  $ ./Flist_archfile.sh  
    3838# 
     39#  $ ./Flist_archfile.sh CNRS 
    3940# 
    4041# TODO 
     
    5455# 
    5556#- 
     57 
     58if [ -n "$2" ]; then 
     59shift 
     60fi 
     61 
    5662echo "Available compilers for -m option :" 
    57 for file in `ls ${MAIN_DIR}/ARCH` 
     63for file in  $(ls ${MAIN_DIR}/ARCH | grep fcm ) 
    5864do 
    5965zvar1=${file#arch-} 
     
    6268printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
    6369done 
     70 
     71 
     72if [ "$1" == "all" ]; then 
     73   for dir  in  $(ls ${MAIN_DIR}/ARCH | grep -v fcm ) 
     74   do  
     75      echo "Available compilers at ${dir} :" 
     76      for file in  $(ls ${MAIN_DIR}/ARCH/${dir} | grep  fcm ) 
     77      do 
     78      zvar1=${file#arch-} 
     79      zvar2=$(head -1 ${MAIN_DIR}/ARCH/${dir}/$file) 
     80      #echo "${zvar1%.fcm} : ${zvar2#\#}" 
     81      printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
     82      done 
     83   done 
     84else 
     85   if [ -d ${MAIN_DIR}/ARCH/${1} ]; then 
     86      echo "Available compilers at $1 :" 
     87      for file in  $(ls ${MAIN_DIR}/ARCH/$1 | grep fcm ) 
     88      do 
     89      zvar1=${file#arch-} 
     90      zvar2=$(head -1 ${MAIN_DIR}/ARCH/${1}/$file) 
     91      #echo "${zvar1%.fcm} : ${zvar2#\#}" 
     92      printf "%-20s %s %-s\n" "${zvar1%.fcm}" : "${zvar2#\#}" 
     93      done 
     94   fi 
     95fi 
  • branches/2011/dev_NEMO_MERGE_2011/NEMOGCM/TOOLS/COMPILE/Fmake_WORK.sh

    r2520 r3198  
    6464# 
    6565#- 
    66 declare ZCONF=$1 ; shift  
     66declare ZSRC=$1 ; shift  
     67declare ZCONF=$1 ; shift 
    6768ZTAB=( $@ ) 
    6869declare i=0 ; declare NDIR=${#ZTAB[@]} 
    6970 
    7071echo "Creating ${ZCONF}/WORK = ${ZTAB[*]} for ${ZCONF}" 
    71 echo "" 
    7272 
    7373[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC 
    7474[   -d ${ZCONF}/WORK   ] || \mkdir ${ZCONF}/WORK 
     75 
     76if [ "${ZSRC}" != "none" ] ; then  
     77  if [ -d ${ZSRC} ] ; then  
     78     ln -sf ${ZSRC}/*.[Ffh]90 ${ZCONF}/MY_SRC/.  
     79     echo "MY_SRC content is linked to ${ZSRC}"  
     80  else 
     81     echo "External directory for MY_SRC does not exist. Using default." 
     82  fi 
     83else  
     84echo "MY_SRC directory is : ${ZCONF}/MY_SRC" 
     85fi 
    7586 
    7687\rm -f ../${1}/WORK/* 
Note: See TracChangeset for help on using the changeset viewer.