From 81209e99749622f8f321f1e9e168ff1a844b64e7 Mon Sep 17 00:00:00 2001 From: Simon Mueller <11-smueller@users.noreply.forge.nemo-ocean.eu> Date: Mon, 19 Dec 2022 10:45:45 +0000 Subject: [PATCH] Resolve "Repeatability of test-case SETTE tests" --- .gitignore | 12 +- makenemo | 201 +++++++++++------------- mk/Fadd_keys.sh | 6 +- mk/Fcheck_archfile.sh | 99 ++++++------ mk/Fdef_keys.sh | 2 +- mk/Fdel_keys.sh | 14 +- mk/Fmake_WORK.sh | 8 +- mk/Fmake_bld.sh | 9 +- mk/Fmake_config.sh | 11 +- mk/Fmake_tools_bld.sh | 2 +- mk/bld.cfg | 4 +- mk/bld_preproagr.cfg | 6 +- mk/bldxag.cfg | 6 +- mk/bldxag_tools.cfg | 4 +- mk/bldxagxcdf.cfg | 4 +- mk/bldxcdf.cfg | 4 +- mk/conv.cfg | 2 +- mk/tools.txt | 1 - sette/all_functions.sh | 20 +-- sette/prepare_exe_dir.sh | 14 +- sette/prepare_job.sh | 4 +- sette/sette_reference-configurations.sh | 54 +++---- sette/sette_test-cases.sh | 57 +++---- tools/maketools | 8 +- 24 files changed, 267 insertions(+), 285 deletions(-) delete mode 100644 mk/tools.txt diff --git a/.gitignore b/.gitignore index 403ab425..ab4a609c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,20 @@ -# configurations & testcases +# configurations, testcases & tools -*/work_cfgs.txt +cfgs/work_cfgs.txt cfgs/*/BLD cfgs/*/EXP00 cfgs/*/WORK cfgs/*_ST + +tests/work_cfgs.txt tests/*/BLD tests/*/EXP00 tests/*/WORK tests/*_ST +tools/*/BLD +tools/*/*.exe +tools/tools.txt + # mk -mk/arch* -mk/cpp.* mk/full_key_list.txt diff --git a/makenemo b/makenemo index 8de8150e..0d648679 100755 --- a/makenemo +++ b/makenemo @@ -88,18 +88,17 @@ x_u=''; x_a=''; x_m=''; x_t=''; x_b=''; x_j='1'; x_e='none'; x_s='src'; x_v='1' x_c_cfg=0 x_nocdf=0 -x_name='' ##- Local variables --- b_n=$(basename ${0}) OPTIND='1' MAIN_DIR=$(cd $(dirname "$0"); pwd) -MAIN_DIR=${MAIN_DIR%/sette*} -MAIN_DIR=${MAIN_DIR%/tools*} -MAIN_DIR=${MAIN_DIR%/cfgs*} -MAIN_DIR=${MAIN_DIR%/tests*} -MAIN_DIR=${MAIN_DIR%/ext*} -MAIN_DIR=${MAIN_DIR%/arch*} +MAIN_DIR=${MAIN_DIR%/sette} +MAIN_DIR=${MAIN_DIR%/tools} +MAIN_DIR=${MAIN_DIR%/cfgs} +MAIN_DIR=${MAIN_DIR%/tests} +MAIN_DIR=${MAIN_DIR%/ext} +MAIN_DIR=${MAIN_DIR%/arch} export MAIN_DIR # export CFGS_DIR=${MAIN_DIR}/cfgs @@ -195,7 +194,7 @@ EOF -d|--dirs|--comp) x_d=${2} ; shift ;; -n|--name) - x_name=${2} ; shift ;; + x_n=${2} ; shift ;; -r|--ref) x_r=${2} ; shift ;; -a|--academic|--test) @@ -229,34 +228,6 @@ EOF shift done -if [ -n "$x_name" ] # is the configuration existing in cfgs or tests? or is it a new conf? -then - incfg=$( find $CFGS_DIR -type d -name $x_name | wc -l ) # this configuration exists in CFGS_DIR - intst=$( find $TESTS_DIR -type d -name $x_name | wc -l ) # this configuration exists in TESTS_DIR - if [ $(( $incfg + $intst )) -eq 2 ] ; then - echo -e "\033[0;31m\nERROR: the $x_name directory is found twice: in $CFGS_DIR and in $TESTS_DIR\033[0m\n" - exit 4 - fi - if [ $(( $incfg + $intst )) -gt 0 ] ; then - if [ $x_c_cfg -eq 1 ] ; then # if we just want to clean the config (do it here as it must exist) - x_n=$x_name # must define x_n as it is used in Fclean_config.sh - . ${COMPIL_DIR}/Fclean_config.sh - exit 0 - fi - [ -n "$x_r" ] && echo -e "\nWARNING: $x_name configuration is already existing, we ignore \"-r $x_r\"\n" - [ -n "$x_a" ] && echo -e "\nWARNING: $x_name configuration is already existing, we ignore \"-a $x_a\"\n" - fi - if [ $incfg -eq 1 ] ; then - x_r=$x_name ; x_a='' # reference configuration existing -> define/overwrite x_r - elif [ $intst -eq 1 ] ; then - x_a=$x_name ; x_r='' # test configuration existing -> define/overwrite x_a - else - [ ${#x_c} -ne 0 ] && echo -e "\nWARNING: Compilation cleaning of a non-existing configuration, we ignore\n" && exit 0 - [ $x_c_cfg -eq 1 ] && echo -e "\nWARNING: Configuration cleaning of a non-existing configuration, we ignore\n" && exit 0 - x_n=$x_name # this is a new configuration -> define - fi -fi - export NEW_CONF=${x_n} NBR_PRC=${x_j} CMP_NAM=${x_m} @@ -268,21 +239,10 @@ NEMO_DBG=${x_b} [ "${CMP_NAM}" == 'all' ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit - -## No ref. cfg or demo selected -if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" ]]; then - echo -e "\033[0;31m\nAt least a reference configuration ('-r'), a test case ('-a'), " - echo -e "a remote configuration ('-u') has to be choosen to build a new configuration!!!\033[0m" - ${COMPIL_DIR}/Flist_cfgs.sh - exit 2 -fi -## At least one config has been requested - ## 'all' arg: list all available configurations if [[ "${REF_CONF}" == 'all' || "${DEMO_CONF}" == 'all' ]]; then ${COMPIL_DIR}/Flist_cfgs.sh exit 2 - ## Probably useless but who knows? elif [[ -n "${REF_CONF}" && -n "${DEMO_CONF}" ]]; then echo -e "\033[0;31m\nYou have to choose whether you work with:" echo -e " - LTS configurations in ./cfgs ('-r') or" @@ -292,29 +252,73 @@ elif [ -n "${REF_CONF}" ]; then conf_file=ref_cfgs.txt ; export CONFIG_DIR=${CFGS_DIR} ; TML_CONF=${REF_CONF} elif [ -n "${DEMO_CONF}" ]; then conf_file=demo_cfgs.txt; export CONFIG_DIR=${TESTS_DIR}; TML_CONF=${DEMO_CONF} -fi - -## Reuse a working cfg -grep -q "${TML_CONF} " ${CONFIG_DIR}/work_cfgs.txt 2>/dev/null && conf_file=work_cfgs.txt - -## Test if ref. cfg or demo case does exist -if (! grep -q "${TML_CONF} " ${CONFIG_DIR}/$conf_file ); then +elif [ $( grep -l "^${NEW_CONF} " */work_cfgs.txt 2> /dev/null | wc -l ) -eq 1 ]; then + conf_file=$( grep -l "^${NEW_CONF} " ${CFGS_DIR}/work_cfgs.txt ${TESTS_DIR}/work_cfgs.txt ) + export CONFIG_DIR=$( dirname $conf_file ); conf_file=$( basename $conf_file ) + TML_CONF=${NEW_CONF} +elif [ $( grep -l "^${NEW_CONF} " */work_cfgs.txt 2> /dev/null | wc -l ) -eq 2 ]; then + echo -e "\033[0;31m\nUser configuration is present in both" + echo -e "cfgs/work_cfgs.txt and tests/work_cfgs.txt files" + echo -e "Please choose only one \033[0m" + exit 2 +elif ! grep -q "^${NEW_CONF} " ${CFGS_DIR}/work_cfgs.txt ${TESTS_DIR}/work_cfgs.txt 2> /dev/null; then echo -e "\033[0;31m\nThe reference configuration ('-r') or " echo -e "demonstration case ('-a') selected is not available!!!" echo -e "Check the option used and the available items in .txt files\033[0m" ${COMPIL_DIR}/Flist_cfgs.sh exit 2 +else + exit 2 fi -## If new cfg exists, work in it -if [ -n "${NEW_CONF}" ] -then - echo - printf "\nYou are installing a new configuration %s from %s " ${NEW_CONF} ${TML_CONF} - printf "with sub-components: %s\n" "${NEM_SUBDIR}" - echo -else - NEW_CONF=${TML_CONF} +if [ -z "${NEW_CONF}" ]; then NEW_CONF=$TML_CONF; fi +export NEMO_TDIR=${x_t:-$CONFIG_DIR} + + +# check configuration existence & clean it if asked +incfg=$( find $NEMO_TDIR -type d -maxdepth 1 -name ${NEW_CONF} 2>/dev/null | wc -l ) # this configuration exists in CFGS_DIR +if [ $incfg -eq 1 ] ; then + # CLEANING + if [ $x_c_cfg -eq 1 ] ; then + . ${COMPIL_DIR}/Fclean_config.sh + exit 0 + elif [ ${#x_c} -ne 0 ]; then + read -p "Are you sure that you want to clean $NEW_CONF configuration ? " -n 1 -r; echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + # We coose the default light file + [ $x_nocdf -eq 1 ] && export USEBLD=bldxagxcdf.cfg || export USEBLD=bldxag.cfg + # We look after agrif + grep key_agrif ${NEMO_TDIR}/BLD/cpp.fcm 2>/dev/null && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} + # fcm clean + fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || exit 1 + # add remove for clean option + echo -e '\nCleaning '${NEW_CONF}' building directories and variables\n' + for dir in AGRIFLIB BLD LONG NEMOFILES REPRO_* SHORT WORK; do + rm -rf ${NEMO_TDIR}/${NEW_CONF}/$dir + done + for file in cpp.history cpp.fcm full_key_list.txt; do + rm -f ${NEMO_TDIR}/${NEW_CONF}/BLD/$file + done + exit 0 + else + echo "cleaning cancelled" + exit 2 + fi + fi + if [[ -n "$x_n" && -n "$REF_CONF" ]]; then echo -e "\nWARNING: $x_n configuration is already existing, we ignore \"-r $REF_CONF\"\n"; REF_CONF=""; fi + if [[ -n "$x_n" && -n "$DEMO_CONF" ]]; then echo -e "\nWARNING: $x_n configuration is already existing, we ignore \"-a $DEMO_CONF\"\n"; DEMO_CONF=""; fi +elif [ $incfg -eq 0 ]; then + [ $x_c_cfg -eq 1 ] && echo -e "\nWARNING: Configuration cleaning of a non-existing configuration, we ignore\n" && exit 0 + [ ${#x_c} -ne 0 ] && echo -e "\nWARNING: Compilation cleaning of a non-existing configuration, we ignore\n" && exit 0 +fi + + +## No ref. cfg or demo selected +if [[ -z "${REF_CONF}" && -z "${DEMO_CONF}" && $incfg -eq 0 ]]; then + echo -e "\033[0;31m\nAt least a reference configuration ('-r'), a test case ('-a'), " + echo -e "a remote configuration ('-u') has to be choosen to build a new configuration!!!\033[0m" + ${COMPIL_DIR}/Flist_cfgs.sh + exit 2 fi ## Update sub-comps if needed @@ -322,20 +326,22 @@ if [ -z "${NEM_SUBDIR}" ]; then NEM_SUBDIR=$( grep "${TML_CONF} " ${CONFIG_DIR}/${conf_file} | awk '{$1 = ""; print $0}' ) fi -export NEMO_TDIR=${x_t:-$CONFIG_DIR} export NEM_SUBDIR="${NEM_SUBDIR}" NEW_CONF="${NEW_CONF}" +## If new cfg exists, work in it +if [ ${TML_CONF} != ${NEW_CONF} ]; then + echo + printf "\nYou are installing a new configuration %s from %s " ${NEW_CONF} ${TML_CONF} + if [ -n "${NEM_SUBDIR}" ]; then printf "with sub-components: %s\n" "${NEM_SUBDIR}"; fi + echo +fi + ## Save new configuration with sub-components set in work_cfgs.txt -[ -f ${CONFIG_DIR}/work_cfgs.txt ] && sed -i "/${NEW_CONF} /d" ${CONFIG_DIR}/work_cfgs.txt +[ -f ${CONFIG_DIR}/work_cfgs.txt ] && sed -i "/^${NEW_CONF} /d" ${CONFIG_DIR}/work_cfgs.txt echo ${NEW_CONF} "${NEM_SUBDIR}" >> ${CONFIG_DIR}/work_cfgs.txt -cd ${CONFIG_DIR} - ## Create new config even in existing one (mkdir with -p option, cp with -n) -${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${TML_CONF} - -## create EXP00 if needed -[ ! -d ${CONFIG_DIR}/${NEW_CONF}/EXP00 ] && \cp -R -n ${CONFIG_DIR}/${NEW_CONF}/EXPREF ${CONFIG_DIR}/${NEW_CONF}/EXP00 +${COMPIL_DIR}/Fmake_config.sh ${NEMO_TDIR}/${NEW_CONF} ${CONFIG_DIR}/${TML_CONF} #- Create the WORK --- #- Clean links and librairies --- @@ -346,12 +352,12 @@ ${COMPIL_DIR}/Fmake_config.sh ${NEW_CONF} ${TML_CONF} # build the complete list of the cpp keys of this configuration if [[ ${chk_key} -eq 1 || ${list_key} -eq 1 ]] ; then - for i in $( grep "^ *#.* key_" ${NEW_CONF}/WORK/* ); do + for i in $( grep "^ *#.* key_" ${NEMO_TDIR}/${NEW_CONF}/WORK/* ); do echo $i | grep key_ | sed -e "s/=.*//" done \ - | sort -d | uniq > ${COMPIL_DIR}/full_key_list.txt + | sort -d | uniq > ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt - [ ${list_key} -eq 1 ] && echo && cat ${COMPIL_DIR}/full_key_list.txt && exit 0 + [ ${list_key} -eq 1 ] && echo && cat ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt && exit 0 fi #- At this stage new configuration has been added, we add or remove keys @@ -361,12 +367,12 @@ fi #- check that all keys are really existing... if [ $chk_key -eq 1 ] ; then - for kk in $( cat ${NEW_CONF}/cpp_${NEW_CONF}.fcm ); do + for kk in $( cat ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ); do if [ "$( echo $kk | cut -c 1-4 )" == "key_" ]; then kk=${kk/=*/} - if [ ! $( grep -w $kk ${COMPIL_DIR}/full_key_list.txt ) ]; then + if [ ! $( grep -w $kk ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt ) ]; then echo - echo "E R R O R : key "$kk" is not found in ${NEW_CONF}/WORK routines..." + echo "E R R O R : key "$kk" is not found in ${NEMO_TDIR}/${NEW_CONF}/WORK routines..." echo "we stop..." echo exit 1 @@ -377,16 +383,7 @@ fi #- At this stage cpp keys have been updated. we can check the arch file #- When used for the first time, choose a compiler --- -. ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm cpp.fcm ${CMP_NAM} || exit 3 - -#- At this stage the configuration has beeen chosen -#- We coose the default light file -[ $x_nocdf -eq 1 ] && export USEBLD=bldxagxcdf.cfg || export USEBLD=bldxag.cfg - -#- We look after agrif -grep key_agrif ${COMPIL_DIR}/cpp.fcm && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} -. ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} arch_nemo.fcm || exit 3 - +. ${COMPIL_DIR}/Fcheck_archfile.sh ${NEMO_TDIR}/${NEW_CONF}/BLD/arch_nemo.fcm ${NEMO_TDIR}/${NEW_CONF}/BLD/cpp.fcm ${CMP_NAM} || exit 3 #- #_ END OF CONFIGURATION PHASE #_ @@ -395,40 +392,32 @@ grep key_agrif ${COMPIL_DIR}/cpp.fcm && export AGRIFUSE=1 && export USEBLD=${USE #- Compile --- if [ "${NBR_PRC}" -gt 0 ]; then - cd ${NEMO_TDIR}/${NEW_CONF} || cd - + # We coose the default light file + [ $x_nocdf -eq 1 ] && export USEBLD=bldxagxcdf.cfg || export USEBLD=bldxag.cfg + + # We look after agrif + grep key_agrif ${NEMO_TDIR}/${NEW_CONF}/BLD/cpp.fcm 2>/dev/null && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} + . ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${NEMO_TDIR} arch_nemo.fcm || exit 3 + ## if AGRIF we do a first preprocessing if [[ ${#x_c} -eq 0 && "$AGRIFUSE" -eq 1 ]]; then - fcm build --ignore-lock -j 1 ${COMPIL_DIR}/bld_preproagr.cfg ||{ cd - ; exit 1 ;} + fcm build --ignore-lock -j 1 ${COMPIL_DIR}/bld_preproagr.cfg || exit 1 echo '' echo "---------------------------------" echo "CONV preprocessing successfull !!" echo "---------------------------------" echo '' fi - - fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD ||{ cd - ; exit 1 ;} + + fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || exit 1 if [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ]; then - ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ${CONFIG_DIR}/${NEW_CONF}/EXP00/nemo + ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ${NEMO_TDIR}/${NEW_CONF}/EXP00/nemo fi - ## add remove for clean option - if [ ${#x_c} -ne 0 ]; then - echo -e '\nCleaning '${NEW_CONF}' building directories and variables\n' - for dir in AGRIFLIB BLD LONG NEMOFILES REPRO_* SHORT WORK; do - rm -rf ${NEMO_TDIR}/${NEW_CONF}/$dir - done - for file in cpp.history cpp.fcm full_key_list.txt; do - rm -f ${COMPIL_DIR}/$file - done - fi fi -#- Come back to original directory --- -cd - - -#- #- Unset variables ${COMPIL_DIR}/Fclean_var.sh diff --git a/mk/Fadd_keys.sh b/mk/Fadd_keys.sh index 0aa554c1..e4fc8c78 100755 --- a/mk/Fadd_keys.sh +++ b/mk/Fadd_keys.sh @@ -64,11 +64,11 @@ set -o posix #- echo "Adding keys in : ${NEW_CONF}" for i in ${list_add_key} ; do - if [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "\<$i\>" )" -ne 0 ] ; then + if [ "$(cat ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "\<$i\>" )" -ne 0 ] ; then echo "key $i already present in cpp_${NEW_CONF}.fcm" else - sed -e "s/$/ ${i}/" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp - mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm + sed -e "s/$/ ${i}/" ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm > ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp + mv ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm echo "added key $i in ${NEW_CONF}" fi done diff --git a/mk/Fcheck_archfile.sh b/mk/Fcheck_archfile.sh index b6145132..f7aad910 100755 --- a/mk/Fcheck_archfile.sh +++ b/mk/Fcheck_archfile.sh @@ -73,19 +73,20 @@ EOF eval "echo \"$line\" >> $2" done < $1 } + # cleaning related to the old version -rm -f $( find ${COMPIL_DIR} -type f -name $1 -print ) +rm -f $( find $(dirname $1) -type f -name $(basename $1) -print ) # if [ ${#3} -eq 0 ]; then # arch not specified - if [ ! -f ${COMPIL_DIR}/arch.history ]; then + if [ ! -f $(dirname $1)/arch.history ]; then echo "Warning !!!" echo "NO compiler chosen" echo "Try makenemo -h for help" echo "EXITING..." exit 1 else # use the arch file defined in arch.history - myarch=$( cat ${COMPIL_DIR}/arch.history ) + myarch=$( cat $(dirname $1)/arch.history ) if [ ! -f $myarch ]; then echo "Warning !!!" echo "previously used arch file no more found:" @@ -93,26 +94,26 @@ if [ ${#3} -eq 0 ]; then # arch not specified echo "EXITING..." exit 1 else - if [ -f ${COMPIL_DIR}/$1 ]; then - if [ "$2" != "nocpp" ] + if [ -f $1 ]; then + if [[ ! "$2" =~ "nocpp" ]] then # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? - mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) - if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then - echo $mycpp > ${COMPIL_DIR}/cpp.history - cpeval ${myarch} ${COMPIL_DIR}/$1 + mycpp=$( ls -l $2 | sed -e "s/.* -> //" ) + if [ "$mycpp" != "$( cat $(dirname $2)/cpp.history )" ]; then + echo $mycpp > $(dirname $2)/cpp.history + cpeval ${myarch} $1 fi # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? - mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) - [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 + mycpp=$( find -L $(dirname $2) -cnewer $(basename $1) -name $(basename $2) -print ) + [ ${#mycpp} -ne 0 ] && cpeval ${myarch} $1 fi # has myarch file been updated since we copied it in ${COMPIL_DIR}? myarchdir=$( dirname ${myarch} ) myarchname=$( basename ${myarch} ) - myarch=$( find -L $myarchdir -cnewer ${COMPIL_DIR}/$1 -name $myarchname -print ) - [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 + myarch=$( find -L $myarchdir -cnewer $(basename $1) -name $myarchname -print ) + [ ${#myarch} -ne 0 ] && cpeval ${myarch} $1 else - cpeval ${myarch} ${COMPIL_DIR}/$1 + cpeval ${myarch} $1 fi fi fi @@ -135,68 +136,68 @@ else fi myarch=$( find ${MAIN_DIR}/arch -name arch-${3}.fcm -print ) # we were already using this arch file ? - if [ "$myarch" == "$( cat ${COMPIL_DIR}/arch.history )" ]; then - if [ -f ${COMPIL_DIR}/$1 ]; then - if [ "$2" != "nocpp" ] + if [ "$myarch" == "$( cat $(dirname $1)/arch.history 2>/dev/null)" ]; then + if [ -f $1 ]; then + if [[ ! "$2" =~ "nocpp" ]] then # has the cpp keys file been changed since we copied the arch file in ${COMPIL_DIR}? - mycpp=$( ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" ) - if [ "$mycpp" != "$( cat ${COMPIL_DIR}/cpp.history )" ]; then - echo $mycpp > ${COMPIL_DIR}/cpp.history - cpeval ${myarch} ${COMPIL_DIR}/$1 + mycpp=$( ls -l $2 | sed -e "s/.* -> //" ) + if [ "$mycpp" != "$( cat $(dirname $2)/cpp.history )" ]; then + echo $mycpp > $(dirname $2)/cpp.history + cpeval ${myarch} $1 fi # has the cpp keys file been updated since we copied the arch file in ${COMPIL_DIR}? - mycpp=$( find -L ${COMPIL_DIR} -cnewer ${COMPIL_DIR}/$1 -name $2 -print ) - [ ${#mycpp} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 + mycpp=$( find -L $(dirname $2) -cnewer $(basename $1) -name $(basename $2) -print ) + [ ${#mycpp} -ne 0 ] && cpeval ${myarch} $1 fi # has myarch file been updated since we copied it in ${COMPIL_DIR}? - myarch=$( find -L ${MAIN_DIR}/arch -cnewer ${COMPIL_DIR}/$1 -name arch-${3}.fcm -print ) - [ ${#myarch} -ne 0 ] && cpeval ${myarch} ${COMPIL_DIR}/$1 + myarch=$( find -L ${MAIN_DIR}/arch -cnewer $(basename $1) -name arch-${3}.fcm -print ) + [ ${#myarch} -ne 0 ] && cpeval ${myarch} $1 else - cpeval ${myarch} ${COMPIL_DIR}/$1 + cpeval ${myarch} $1 fi else - if [ "$2" != "nocpp" ] + if [[ ! "$2" =~ "nocpp" ]] then - ls -l ${COMPIL_DIR}/$2 | sed -e "s/.* -> //" > ${COMPIL_DIR}/cpp.history + ls -l $2 | sed -e "s/.* -> //" > $(dirname $2)/cpp.history fi - echo ${myarch} > ${COMPIL_DIR}/arch.history - cpeval ${myarch} ${COMPIL_DIR}/$1 + echo ${myarch} > $(dirname $1)/arch.history + cpeval ${myarch} $1 fi fi #- do we need xios library? #- 2 cases: #- in CONFIG directory looking for key_xios or key_iomput -if [ "$1" == "arch_nemo.fcm" ] +if [ "$(basename $1)" == "arch_nemo.fcm" ] then - if [ "$2" != "nocpp" ] + if [[ ! "$2" =~ "nocpp" ]] then - use_iom=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c "key_xios\|key_iomput" ) + use_iom=$( sed -e "s/#.*$//" $2 | grep -c "key_xios\|key_iomput" ) else use_iom=0 fi - have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) + have_lxios=$( sed -e "s/#.*$//" $1 | grep -c "\-lxios" ) if [[ ( $use_iom -eq 0 ) && ( $have_lxios -ge 1 ) ]] then - sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ - mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 + sed -e "s/-lxios//g" $1 > $(dirname $1)/tmp$$ + mv -f $(dirname $1)/tmp$$ $1 fi #- in TOOLS directory looking for USE xios else - use_iom=$( egrep --exclude-dir=.svn -r USE ${NEW_CONF}/src/* | grep -c xios ) - have_lxios=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-lxios" ) + use_iom=$( egrep --exclude-dir=.svn -r USE ${MAIN_DIR}/src/* | grep -c xios ) + have_lxios=$( sed -e "s/#.*$//" $1 | grep -c "\-lxios" ) if [[ ( $use_iom -eq 0 ) || ( $have_lxios != 1 ) ]] then - sed -e "s/-lxios//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ - mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 + sed -e "s/-lxios//g" $1 > $(dirname $1)/tmp$$ + mv -f $(dirname $1)/tmp$$ $1 fi fi #- do we need oasis libraries? -if [ "$2" != "nocpp" ] +if [[ ! "$2" =~ "nocpp" ]] then - use_oasis=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$2 | grep -c key_oasis3 ) + use_oasis=$( sed -e "s/#.*$//" $2 | grep -c key_oasis3 ) else use_oasis=0 fi @@ -206,26 +207,26 @@ if [[ ! -z "$XIOS_OASIS" ]]; then fi for liboa in psmile.MPI1 mct mpeu scrip mpp_io do - have_liboa=$( sed -e "s/#.*$//" ${COMPIL_DIR}/$1 | grep -c "\-l${liboa}" ) + have_liboa=$( sed -e "s/#.*$//" $1 | grep -c "\-l${liboa}" ) if [[ ( $use_oasis -eq 0 ) && ( $have_liboa -ge 1 ) ]] then - sed -e "s/-l${liboa}//g" ${COMPIL_DIR}/$1 > ${COMPIL_DIR}/tmp$$ - mv -f ${COMPIL_DIR}/tmp$$ ${COMPIL_DIR}/$1 + sed -e "s/-l${liboa}//g" $1 > $(dirname $1)/tmp$$ + mv -f $(dirname $1)/tmp$$ $1 fi done # Nemo debug ? if [ -n "${NEMO_DBG}" ]; then - if (! grep -q "^%DEBUG_FCFLAGS" ${COMPIL_DIR}/$1 ); then + if (! grep -q "^%DEBUG_FCFLAGS" $1 ); then echo "ERROR: You must defined '%DEBUG_FCFLAGS' in your arch file if you want to compile Nemo in debug mode using '-d' option" exit 1 fi # duplicate the lines starting with %DEBUG_XXX and replace, in the duplicated line, %DEBUG_XXX by %XXX - sed -i "/^%DEBUG_/{p;s/^%DEBUG_\([^ ]*\)/%\1/;}" ${COMPIL_DIR}/$1 + sed -i "/^%DEBUG_/{p;s/^%DEBUG_\([^ ]*\)/%\1/;}" $1 else - if (! grep -q "^%PROD_FCFLAGS" ${COMPIL_DIR}/$1 ); then + if (! grep -q "^%PROD_FCFLAGS" $1 ); then echo "WARNING: '%PROD_FCFLAGS' not defined in your arch file, makenemo will use '%FCFLAGS' instead" fi # duplicate the lines starting with %PROD_XXX and replace, in the duplicated line, %PROD_XXX by %XXX - sed -i "/^%PROD_/{p;s/^%PROD_\([^ ]*\)/%\1/;}" ${COMPIL_DIR}/$1 + sed -i "/^%PROD_/{p;s/^%PROD_\([^ ]*\)/%\1/;}" $1 fi diff --git a/mk/Fdef_keys.sh b/mk/Fdef_keys.sh index f0edd7d8..bf94a481 100755 --- a/mk/Fdef_keys.sh +++ b/mk/Fdef_keys.sh @@ -58,6 +58,6 @@ set -o posix echo "Defining keys in : ${NEW_CONF}" -echo " bld::tool::fppkeys ${list_def_key}" > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm +echo " bld::tool::fppkeys ${list_def_key}" > ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm unset -v list_def_key diff --git a/mk/Fdel_keys.sh b/mk/Fdel_keys.sh index 88aafc23..ff95aa2b 100755 --- a/mk/Fdel_keys.sh +++ b/mk/Fdel_keys.sh @@ -65,14 +65,14 @@ echo "Removing keys in : ${NEW_CONF}" for i in ${list_del_key} ; do if [ "$(echo ${i} | grep -c key_nproc )" -ne 0 ]; then - sed -e "s/key_nproc[ij]=.* //" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ - > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp - mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm + sed -e "s/key_nproc[ij]=.* //" ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ + > ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp + mv ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm echo " " - elif [ "$(cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ]; then - sed -e "s/\b${i}\b//" ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ - > ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp - mv ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm + elif [ "$(cat ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | grep -c "$i" )" -ne 0 ]; then + sed -e "s/\b${i}\b//" ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm \ + > ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp + mv ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm.tmp ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm echo "deleted key $i in ${NEW_CONF}" fi diff --git a/mk/Fmake_WORK.sh b/mk/Fmake_WORK.sh index 372bca57..780fb996 100755 --- a/mk/Fmake_WORK.sh +++ b/mk/Fmake_WORK.sh @@ -64,14 +64,14 @@ set -o posix # #- declare ZSRC=${@} -ZCONF=${NEW_CONF} +ZCONF=${NEMO_TDIR}/${NEW_CONF} ZTAB=${NEM_SUBDIR[@]} declare NDIR=${#ZTAB[@]} -echo 'Creating '${ZCONF}'/WORK = '${ZTAB[*]}' for '${ZCONF} +echo 'Creating '${ZCONF}'/WORK = '${ZTAB[*]}' for '${ZCONF##*/} -[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC -[ -d ${ZCONF}/WORK ] || \mkdir ${ZCONF}/WORK +[ ! -d ${ZCONF}/MY_SRC ] && \mkdir -p ${ZCONF}/MY_SRC +[ -d ${ZCONF}/WORK ] || \mkdir -p ${ZCONF}/WORK for comp in ${ZTAB[*]}; do find ${NEMO_DIR}/$comp -name *.[Ffh]90 -exec ln -sf {} ${ZCONF}/WORK \; diff --git a/mk/Fmake_bld.sh b/mk/Fmake_bld.sh index 53d9f7e3..bd4b331c 100755 --- a/mk/Fmake_bld.sh +++ b/mk/Fmake_bld.sh @@ -57,8 +57,7 @@ set -o posix # * creation # #- -[ ! -d ${3}/${2} ] && \mkdir ${3}/${2} -[ ! -d ${3}/${2}/BLD ] && \mkdir ${3}/${2}/BLD -[ ! -d ${1}/${2}/BLD ] && ln -sf ${3}/${2}/BLD ${1}/${2}/BLD -[ -f ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ] && ln -sf ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ${COMPIL_DIR}/cpp.fcm -rm -f ${1}/${NEW_CONF}/BLD/fcm.bld.lock +[ ! -d ${3}/${2} ] && \mkdir -p ${3}/${2} +[ ! -d ${3}/${2}/BLD ] && \mkdir -p ${3}/${2}/BLD +[ -f ${3}/${2}/cpp_${2}.fcm ] && ln -sf ${3}/${2}/cpp_${2}.fcm ${3}/${2}/BLD/cpp.fcm +rm -f ${1}/${2}/BLD/fcm.bld.lock diff --git a/mk/Fmake_config.sh b/mk/Fmake_config.sh index 12babc42..6a3e942b 100755 --- a/mk/Fmake_config.sh +++ b/mk/Fmake_config.sh @@ -59,8 +59,9 @@ set -o posix \mkdir -p ${1} \mkdir -p ${1}/EXP00 \mkdir -p ${1}/MY_SRC -\cp -R -n ${2}/cpp_${2}.fcm ${1}/cpp_${1}.fcm -\cp -R -n ${2}/EXPREF/*namelist* ${1}/EXP00/. -\cp -R -n ${2}/EXPREF/*.xml ${1}/EXP00/. -[ -f ${2}/EXPREF/AGRIF_FixedGrids.in ] && \cp -R -n ${2}/EXPREF/AGRIF_FixedGrids.in ${1}/EXP00/. -[ -d ${2}/MY_SRC ] && \cp -n ${2}/MY_SRC/* ${1}/MY_SRC/. 2> /dev/null +[ "${2}/cpp_${2##*/}.fcm" != "${1}/cpp_${1##*/}.fcm" ] && \cp -R -n ${2}/cpp_${2##*/}.fcm ${1}/cpp_${1##*/}.fcm +for f in ${2}/EXPREF/*.xml ${2}/EXPREF/*namelist*; do + if [ -L ${f} ]; then ln -sf $(readlink -f ${f}) ${1}/EXP00/$(basename ${f}); else cp -R -n ${f} ${1}/EXP00/.; fi +done +[ -f ${2}/EXPREF/AGRIF_FixedGrids.in ] && \cp -a -n ${2}/EXPREF/AGRIF_FixedGrids.in ${1}/EXP00/. +[ -d ${2}/MY_SRC ] && \cp -an ${2}/MY_SRC/* ${1}/MY_SRC/. 2> /dev/null diff --git a/mk/Fmake_tools_bld.sh b/mk/Fmake_tools_bld.sh index b5e67c8c..3a9a5041 100755 --- a/mk/Fmake_tools_bld.sh +++ b/mk/Fmake_tools_bld.sh @@ -62,5 +62,5 @@ set -o posix [ ! -d ${1}/${2}/BLD ] && ln -sf ${3}/${2}/BLD ${1}/${2}/BLD # enforce presence of cpp_tools.fcm (write a blank one if not present in the tools directory) # cp instead of ln to avoid overwiting previous tool cpp_XXX.fcm file when compiling a file without cpp_YYY.fcm file. -[ -f ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ] && cp -f ${1}/${NEW_CONF}/cpp_${NEW_CONF}.fcm ${COMPIL_DIR}/cpp_tools.fcm || echo 'bld::tool::fppkeys ' > ${COMPIL_DIR}/cpp_tools.fcm +[ -f ${3}/${2}/cpp_${2}.fcm ] && ln -sf -f ${3}/${2}/cpp_${2}.fcm ${3}/${2}/BLD/cpp_tools.fcm || echo 'bld::tool::fppkeys ' > ${3}/${2}/BLD/cpp_tools.fcm rm -f ${1}/${NEW_CONF}/BLD/fcm.bld.lock diff --git a/mk/bld.cfg b/mk/bld.cfg index 67352be6..ebc688aa 100644 --- a/mk/bld.cfg +++ b/mk/bld.cfg @@ -7,8 +7,8 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_nemo.fcm -inc $COMPIL_DIR/cpp.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/arch_nemo.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/cpp.fcm search_src 1 diff --git a/mk/bld_preproagr.cfg b/mk/bld_preproagr.cfg index e901d829..3f015aa1 100644 --- a/mk/bld_preproagr.cfg +++ b/mk/bld_preproagr.cfg @@ -7,11 +7,11 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_nemo.fcm -inc $COMPIL_DIR/cpp.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/arch_nemo.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/cpp.fcm search_src 1 -src::nemo $CONFIG_DIR/$NEW_CONF/WORK +src::nemo $NEMO_TDIR/$NEW_CONF/WORK bld::target lib_cray.f90 nemo.f90 agrif_user.f90 agrif2model.f90 diff --git a/mk/bldxag.cfg b/mk/bldxag.cfg index 19ea8475..78a775d5 100644 --- a/mk/bldxag.cfg +++ b/mk/bldxag.cfg @@ -7,13 +7,13 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_nemo.fcm -inc $COMPIL_DIR/cpp.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/arch_nemo.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/cpp.fcm search_src 1 src::ioipsl $MAIN_DIR/ext/IOIPSL/src -src::nemo $CONFIG_DIR/$NEW_CONF/WORK +src::nemo $NEMO_TDIR/$NEW_CONF/WORK src::ppr_1d $MAIN_DIR/ext/PPR/src bld::target nemo.exe diff --git a/mk/bldxag_tools.cfg b/mk/bldxag_tools.cfg index 45282637..7f54517b 100644 --- a/mk/bldxag_tools.cfg +++ b/mk/bldxag_tools.cfg @@ -7,8 +7,8 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_tools.fcm -inc $COMPIL_DIR/cpp_tools.fcm +inc $TOOLS_DIR/$NEW_CONF/BLD/arch_tools.fcm +inc $TOOLS_DIR/$NEW_CONF/BLD/cpp_tools.fcm search_src 1 diff --git a/mk/bldxagxcdf.cfg b/mk/bldxagxcdf.cfg index d562b61b..28361348 100644 --- a/mk/bldxagxcdf.cfg +++ b/mk/bldxagxcdf.cfg @@ -7,8 +7,8 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_nemo.fcm -inc $COMPIL_DIR/cpp.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/arch_nemo.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/cpp.fcm search_src 1 diff --git a/mk/bldxcdf.cfg b/mk/bldxcdf.cfg index 0d752da9..5a175b45 100644 --- a/mk/bldxcdf.cfg +++ b/mk/bldxcdf.cfg @@ -7,8 +7,8 @@ cfg::version 1.0 # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/arch_nemo.fcm -inc $COMPIL_DIR/cpp.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/arch_nemo.fcm +inc $NEMO_TDIR/$NEW_CONF/BLD/cpp.fcm search_src 1 diff --git a/mk/conv.cfg b/mk/conv.cfg index 759e5f26..f8757962 100644 --- a/mk/conv.cfg +++ b/mk/conv.cfg @@ -7,7 +7,7 @@ cfg::version 1.0 # ------------------------------------------------------------------------------ # Build information # ------------------------------------------------------------------------------ -inc $COMPIL_DIR/$MYARCH +inc $NEMO_TDIR/$NEW_CONF/BLD/$MYARCH bld::tool::cc %CC bld::tool::cflags %CFLAGS diff --git a/mk/tools.txt b/mk/tools.txt deleted file mode 100644 index a6cb4ae5..00000000 --- a/mk/tools.txt +++ /dev/null @@ -1 +0,0 @@ -DOMAINcfg diff --git a/sette/all_functions.sh b/sette/all_functions.sh index 94822b6e..f5f92259 100755 --- a/sette/all_functions.sh +++ b/sette/all_functions.sh @@ -94,8 +94,8 @@ usage=" if value is a string ths is neede syntax : ./set_namelist namelist_name sync_config() { if [ ${SYNC_CONFIGS} == "yes" ]; then - lREF=$3/$1 # reference - lCFG=$3/$2 # target + lREF=$1 # reference + lCFG=$2 # target echo '-------------------------------------------------------------------------------' echo ' SOURCE AND CONFIG FILES SYNCHRONISATION ' @@ -146,24 +146,16 @@ sync_config() { # clean _STg config (input CFG CFG_STg TYPE (test or ref)) clean_config() { if [ ${CLEAN_CONFIGS} == "yes" ]; then - lREF=$1 - lCFG=$2 - lTYP=$3 + lCFG=$1 echo '' echo '-------------------------------------------------------------------------------' echo ' CLEANING CONFIGURATION ' echo '' - echo "./makenemo -n $lCFG -a/-r $lREF -t ${CMP_DIR:-${CONFIG_DIR0}} clean" + echo "./makenemo -n $(basename $lCFG) ${CUSTOM_DIR:+-t ${CMP_DIR}} clean" echo '' - if [ ${lTYP} == 'tests' ]; then - ./makenemo -n $lCFG -t ${CMP_DIR:-${CONFIG_DIR0}} -a $lREF clean - elif [ ${lTYP} == 'cfgs' ]; then - ./makenemo -n $lCFG -t ${CMP_DIR:-${CONFIG_DIR0}} -r $lREF clean - else - echo 'ERROR in the cleaning process'; exit 42 - fi + ./makenemo -n $(basename $lCFG) ${CUSTOM_DIR:+-t ${CMP_DIR}} clean echo '' - echo "$lCFG configuration has been cleaned" + echo "$(basename $lCFG) configuration has been cleaned" echo '' echo '-------------------------------------------------------------------------------' fi diff --git a/sette/prepare_exe_dir.sh b/sette/prepare_exe_dir.sh index b446a7e3..d43feec5 100755 --- a/sette/prepare_exe_dir.sh +++ b/sette/prepare_exe_dir.sh @@ -67,23 +67,25 @@ set -o posix # PREPARE EXEC_DIR #================== if [ -z "${CUSTOM_DIR}" ]; then - export EXE_DIR=${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME} + EXE_DIR=${CONFIG_DIR}/${NEW_CONF} else CMP_NAM_L=$(echo ${CMP_NAM} | tr '[:upper:]' '[:lower:]') if [[ -n "${NEMO_DEBUG}" || ${CMP_NAM_L} =~ ("debug"|"dbg") ]]; then export EXE_DIR=${CUSTOM_DIR}/${SETTE_SUB_VAL}_${NEMO_REV}_DEBUG/${NEW_CONF}/${TEST_NAME} else - export EXE_DIR=${CUSTOM_DIR}/${SETTE_SUB_VAL}_${NEMO_REV}/${NEW_CONF}/${TEST_NAME} + EXE_DIR=${CUSTOM_DIR}/${SETTE_SUB_VAL}_${NEMO_REV}/${NEW_CONF} fi fi -mkdir -p ${EXE_DIR} +mkdir -p ${EXE_DIR}/${TEST_NAME} -cp -RL ${CONFIG_DIR}/${NEW_CONF}/EXP00/* ${EXE_DIR}/. -#cat ${SETTE_DIR}/iodef_sette.xml | sed -e"s;DEF_SHARED;${CONFIG_DIR0}/SHARED;" > ${EXE_DIR}/iodef.xml +#cp -RL ${EXE_DIR:-${CONFIG_DIR}/${NEW_CONF}}/EXP00/* ${EXE_DIR}/${TEST_NAME}/. +cp -an ${EXE_DIR:-${CONFIG_DIR}/${NEW_CONF}}/EXP00/* ${EXE_DIR}/${TEST_NAME}/. +COMP_KEYS="`cat ${EXE_DIR}/cpp_${NEW_CONF}.fcm | sed -e 's/.*fppkeys *//'`" + +export EXE_DIR=${EXE_DIR}/${TEST_NAME} cd ${EXE_DIR} # # Add summary of the sette.sh set-up used and the current list of keys added or deleted -COMP_KEYS="`cat ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm | sed -e 's/.*fppkeys *//'`" echo "Summary of sette environment" > ./sette_config echo "----------------------------" >> ./sette_config echo "requested by the command : "$cmd $cmdargs >> ./sette_config diff --git a/sette/prepare_job.sh b/sette/prepare_job.sh index 335daedb..80d3fa1e 100755 --- a/sette/prepare_job.sh +++ b/sette/prepare_job.sh @@ -104,7 +104,7 @@ echo "" >> ${SETTE_DIR}/output.sette echo "running config: ${NEW_CONF}" >> ${SETTE_DIR}/output.sette echo "" >> ${SETTE_DIR}/output.sette echo "list of cpp_keys: " >> ${SETTE_DIR}/output.sette -echo "`more ${CONFIG_DIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm`" >> ${SETTE_DIR}/output.sette +echo "`more ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm`" >> ${SETTE_DIR}/output.sette echo "" >> ${SETTE_DIR}/output.sette echo "compiling with: ${CMP_NAM}" >> ${SETTE_DIR}/output.sette echo "" >> ${SETTE_DIR}/output.sette @@ -269,7 +269,7 @@ fi -e"s/NXIOPROCS/${NXIO_PROC}/" \ -e"s:DEF_SETTE_DIR:${SETTE_DIR}:" -e"s:DEF_INPUT_DIR:${INPUT_DIR}:" \ -e"s:DEF_EXE_DIR:${EXE_DIR}:" \ - -e"s:DEF_CONFIG_DIR:${CONFIG_DIR}:" \ + -e"s:DEF_CONFIG_DIR:${NEMO_TDIR}:" \ -e"s:DEF_TOOLS_DIR:${TOOLS_DIR}:" \ -e"s:MPI_FLAG:${MPI_FLAG}:" \ -e"s:DEF_NEMO_VALIDATION:${NEMO_VALID}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \ diff --git a/sette/sette_reference-configurations.sh b/sette/sette_reference-configurations.sh index 379ee02a..6fdae259 100755 --- a/sette/sette_reference-configurations.sh +++ b/sette/sette_reference-configurations.sh @@ -155,11 +155,11 @@ if [ ${config} == "GYRE_PISCES" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config GYRE_PISCES ${SETTE_CONFIG} 'cfgs' - clean_config GYRE_PISCES ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # GYRE uses linssh so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r GYRE_PISCES -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r GYRE_PISCES ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "GYRE_PISCES" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for GYRE_PISCES @@ -302,10 +302,10 @@ if [ ${config} == "ORCA2_ICE_PISCES" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs' - clean_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "ORCA2_ICE_PISCES" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for ORCA2_ICE_PISCES @@ -589,11 +589,11 @@ if [ ${config} == "ORCA2_OFF_PISCES" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config ${SETTE_CONFIG} ORCA2_OFF_PISCES_ST 'cfgs' - clean_config ${SETTE_CONFIG} ORCA2_OFF_PISCES_ST 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # ORCA2_OFF_PISCES uses linssh so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_OFF_PISCES -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_OFF_PISCES ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "ORCA2_OFF_PISCES" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for ORCA2_OFF_PISCES @@ -766,10 +766,10 @@ if [ ${config} == "AMM12" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config AMM12 ${SETTE_CONFIG} 'cfgs' - clean_config AMM12 ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AMM12 -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AMM12 ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "AMM12" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for AMM12 @@ -900,11 +900,11 @@ if [ ${config} == "SAS" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config ORCA2_SAS_ICE ${SETTE_CONFIG} 'cfgs' - clean_config ORCA2_SAS_ICE ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # ORCA2_SAS_ICE uses linssh so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_SAS_ICE -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_SAS_ICE ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "SAS" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests @@ -1048,10 +1048,10 @@ if [ ${config} == "ORCA2_ICE_OBS" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs' - clean_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES -d "OCE ICE" -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "key_asminc ${ADD_KEYS}" del_key "key_top ${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES -d "OCE ICE" ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "key_asminc ${ADD_KEYS}" del_key "key_top ${DEL_KEYS}" fi if [ ${config} == "ORCA2_ICE_OBS" ] && [ ${DO_RESTART} == "1" ] ; then ## Reproducibility tests @@ -1172,12 +1172,12 @@ if [ ${config} == "AGRIF" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs' - clean_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # AGRIF_DEMO does not yet support nn_hls=2 => key_loop_fusion can not be used # . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO -j ${CMPL_CORES} add_key "${ADD_KEYS/key_loop_fusion}" del_key "${DEL_KEYS}" - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "AGRIF" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests @@ -1489,11 +1489,11 @@ if [ ${config} == "AGRIF" ] && [ ${DO_CORRUPT} == "1" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs' - clean_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # AGRIF_DEMO does not yet support nn_hls=2 => key_loop_fusion can not be used - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_loop_fusion}" del_key "key_agrif ${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_loop_fusion}" del_key "key_agrif ${DEL_KEYS}" cd ${SETTE_DIR} . ./prepare_exe_dir.sh set_valid_dir @@ -1537,11 +1537,11 @@ if [ ${config} == "WED025" ] ; then cd ${MAIN_DIR} # # syncronisation if target directory/file exist (not done by makenemo) - sync_config WED025 ${SETTE_CONFIG} 'cfgs' - clean_config WED025 ${SETTE_CONFIG} 'cfgs' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # WED025 uses ln_hpg_isf so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r WED025 -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r WED025 ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "WED025" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests diff --git a/sette/sette_test-cases.sh b/sette/sette_test-cases.sh index 1d879f30..e76ae95b 100755 --- a/sette/sette_test-cases.sh +++ b/sette/sette_test-cases.sh @@ -108,7 +108,7 @@ if [ ${USING_MPMD} == "no" ] fi # # Directory to run the tests -CONFIG_DIR0=${MAIN_DIR}/cfgs +CONFIG_DIR0=${MAIN_DIR}/tests TOOLS_DIR=${MAIN_DIR}/tools if [ -n "${CUSTOM_DIR}" ]; then @@ -155,11 +155,10 @@ if [ ${config} == "OVERFLOW" ] ; then cd ${MAIN_DIR} # # - clean_config OVERFLOW ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - sync_config OVERFLOW ${SETTE_CONFIG} 'tests' - # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a OVERFLOW -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a OVERFLOW ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "OVERFLOW" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for OVERFLOW @@ -223,12 +222,12 @@ if [ ${config} == "OVERFLOW" ] && [ ${DO_PHYOPTS} == "1" ] ; then else ITEND=6120 fi - cd ${CONFIG_DIR}/${NEW_CONF}/EXP00 + cd ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/EXP00 for file in $(echo `ls namelist_*_cfg `) ; do TEST_NAME=`echo $file | sed -e "s/namelist_//" | sed -e "s/_cfg//"` TEST_NAME="EXP-${TEST_NAME}" - if [ ! -d ${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME} ] ; then mkdir ${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME} ; fi + if [ ! -d ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/${TEST_NAME} ] ; then mkdir -p ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/${TEST_NAME} ; fi export TEST_NAME="${TEST_NAME}" ## cd ${SETTE_DIR} @@ -240,7 +239,7 @@ if [ ${config} == "OVERFLOW" ] && [ ${DO_PHYOPTS} == "1" ] ; then if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi cd ${EXE_DIR} rm namelist_*_*_*_* - cp -pL ${CONFIG_DIR}/${NEW_CONF}/EXP00/$file namelist_cfg + cp -pL ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/EXP00/$file namelist_cfg set_namelist namelist_cfg nn_it000 1 set_namelist namelist_cfg nn_itend ${ITEND} set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false. @@ -272,11 +271,10 @@ if [ ${config} == "LOCK_EXCHANGE" ] ; then # # syncronisation if target directory/file exist (not done by makenemo) # - clean_config LOCK_EXCHANGE ${SETTE_CONFIG} 'tests' - # - sync_config LOCK_EXCHANGE ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a LOCK_EXCHANGE -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a LOCK_EXCHANGE ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "LOCK_EXCHANGE" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for LOCK_EXCHANGE @@ -339,13 +337,14 @@ if [ ${config} == "LOCK_EXCHANGE" ] && [ ${DO_PHYOPTS} == "1" ] ; then else ITEND=61200 fi - cd ${CONFIG_DIR}/${NEW_CONF}/EXP00 + cd ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/EXP00 + for file in $(echo `ls namelist_*_cfg `) ; do echo '' TEST_NAME=`echo $file | sed -e "s/namelist_//" | sed -e "s/_cfg//"` TEST_NAME="EXP-${TEST_NAME}" - `mkdir ${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME}` + mkdir -p ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/${TEST_NAME} export TEST_NAME="${TEST_NAME}" ## cd ${SETTE_DIR} @@ -357,7 +356,7 @@ if [ ${config} == "LOCK_EXCHANGE" ] && [ ${DO_PHYOPTS} == "1" ] ; then if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi cd ${EXE_DIR} rm namelist_*_*_*_* - cp -pL ${CONFIG_DIR}/${NEW_CONF}/EXP00/$file namelist_cfg + cp -pL ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG}/EXP00/$file namelist_cfg set_namelist namelist_cfg nn_it000 1 set_namelist namelist_cfg nn_itend ${ITEND} set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false. @@ -391,11 +390,10 @@ if [ ${config} == "VORTEX" ] ; then # # syncronisation if target directory/file exist (not done by makenemo) # - clean_config VORTEX ${SETTE_CONFIG} 'tests' - # - sync_config VORTEX ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a VORTEX -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a VORTEX ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "VORTEX" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for VORTEX @@ -585,12 +583,11 @@ if [ ${config} == "ICE_AGRIF" ] ; then # # syncronisation if target directory/file exist (not done by makenemo) # - clean_config ICE_AGRIF ${SETTE_CONFIG} 'tests' - # - sync_config ICE_AGRIF ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # ICE_AGRIF uses linssh so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a ICE_AGRIF -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a ICE_AGRIF ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "ICE_AGRIF" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests for ICE_AGRIF @@ -783,12 +780,11 @@ if [ ${config} == "ISOMIP+" ] ; then # # syncronisation if target directory/file exist (not done by makenemo) # - clean_config ISOMIP+ ${SETTE_CONFIG} 'tests' - # - sync_config ISOMIP+ ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # # ISOMIP+ uses ln_hpg_isf so remove key_qco if added by default - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a ISOMIP+ -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a ISOMIP+ ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}" fi if [ ${config} == "ISOMIP+" ] && [ ${DO_RESTART} == "1" ] ; then ## Restartability tests @@ -928,11 +924,10 @@ if [ ${config} == "SWG" ] && [ ${USING_QCO} == "yes" ] ; then # # syncronisation if target directory/file exist (not done by makenemo) # - clean_config SWG ${SETTE_CONFIG} 'tests' - # - sync_config SWG ${SETTE_CONFIG} 'tests' + clean_config ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} + sync_config ${CONFIG_DIR0}/${config} ${CMP_DIR:-${CONFIG_DIR0}}/${SETTE_CONFIG} # - . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a SWG -t ${CMP_DIR:-${CONFIG_DIR0}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" + . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -a SWG ${CUSTOM_DIR:+-t ${CMP_DIR}} -k 0 ${NEMO_DEBUG} -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}" fi if [ ${config} == "SWG" ] && [ ${DO_RESTART} == "1" ] && [ ${USING_QCO} == "yes" ] ; then ## Restartability tests for SWG diff --git a/tools/maketools b/tools/maketools index 99aab337..cc420971 100755 --- a/tools/maketools +++ b/tools/maketools @@ -146,24 +146,24 @@ export NEMO_TDIR=${NEMO_TDIR:-$TOOLS_DIR} #- Choose a default tool if needed --- #- REBUILD or last one used --- -. ${COMPIL_DIR}/Fcheck_config.sh tools.txt ${NEW_CONF} || exit +. ${COMPIL_DIR}/Fcheck_config.sh ${TOOLS_DIR}/tools.txt ${NEW_CONF} || exit #- Save new configuration --- -echo "${NEW_CONF} " > ${COMPIL_DIR}/tools.txt +echo "${NEW_CONF} " > ${TOOLS_DIR}/tools.txt #- Make the building directory . ${COMPIL_DIR}/Fmake_tools_bld.sh ${TOOLS_DIR} ${NEW_CONF} ${NEMO_TDIR} || exit #- At this stage cpp keys have been updated. we can check the arch file #- When used for the first time, choose a compiler --- -. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm cpp_tools.fcm ${CMP_NAM} || exit +. ${COMPIL_DIR}/Fcheck_archfile.sh ${TOOLS_DIR}/${NEW_CONF}/BLD/arch_tools.fcm ${TOOLS_DIR}/${NEW_CONF}/BLD/cpp_tools.fcm ${CMP_NAM} || exit #- At this stage the configuration has beeen chosen #- We coose the default light file export USEBLD=bldxag_tools.cfg #- We look after agrif -grep key_agrif ${COMPIL_DIR}/cpp_tools.fcm && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} +grep key_agrif ${TOOLS_DIR}/${NEW_CONF}/BLD/cpp_tools.fcm && export AGRIFUSE=1 && export USEBLD=${USEBLD/xag/} . ${COMPIL_DIR}/Fprep_agrif.sh ${NEW_CONF} ${TOOLS_DIR} arch_tools.fcm|| exit 3 -- GitLab