Skip to content
Snippets Groups Projects
Commit 2fae2e53 authored by Tomas Lovato's avatar Tomas Lovato
Browse files

Merge branch 'main' into 100-revise-bdy-structure-of-top-boundary-conditions

parents e6addd68 d3c28dee
No related branches found
No related tags found
No related merge requests found
Showing
with 477 additions and 342 deletions
......@@ -4,12 +4,16 @@ cfgs/work_cfgs.txt
cfgs/*/BLD
cfgs/*/EXP00
cfgs/*/WORK
cfgs/*/NEMOFILES
cfgs/*/AGRIFLIB
cfgs/*_ST
tests/work_cfgs.txt
tests/*/BLD
tests/*/EXP00
tests/*/WORK
tests/*/NEMOFILES
tests/*/AGRIFLIB
tests/*_ST
tools/*/BLD
......
# HPC & configs lists to be tested with SETTE
.parallel_HPC_CFG:
parallel:
matrix:
- HPC: [irene,jean-zay]
CONFIG: [ORCA2_ICE_PISCES,ORCA2_OFF_PISCES,AMM12,AGRIF,WED025,GYRE_PISCES,SAS,ORCA2_ICE_OBS]
# HPC & testcases lists to be tested with SETTE
.parallel_HPC_TST:
parallel:
matrix:
- HPC: [irene,jean-zay]
CONFIG: [SWG,ICE_AGRIF,OVERFLOW,LOCK_EXCHANGE,VORTEX,ISOMIP+]
# variables declared hereafter will be avaible in all jobs
# these 2 variables are needed for each HPC to be tested:
# - SETTE_CFG: SETTE param.cfg file path
# - SETTE_MOD: SETTE modules list
variables:
# JEAN-ZAY
JZ_SETTE_CFG: "/linkhome/rech/genloc01/reee217/nemo_CI/param.cfg"
JZ_SETTE_MOD: "intel-compilers/19.1.3 intel-mpi/2019.9 hdf5/1.12.0-mpi netcdf-c/4.7.4-mpi netcdf-fortran/4.5.3-mpi git/2.25.0"
# IRENE
IR_SETTE_CFG: "/ccc/cont005/dsku/leger/home/user/locean/massons/nemo_CI/param.cfg"
IR_SETTE_MOD: "intel/19.0.5.281 mpi/openmpi/4.0.2 flavor/hdf5/parallel flavor/buildmpi/openmpi/4.0 netcdf-c/4.6.0 netcdf-fortran/4.4.4 hdf5/1.8.20 boost/1.69.0 blitz/0.10 c++/gnu/7.3.0 c/gnu/7.3.0"
# default (but willingly wrong) values
# HPC & configs lists to be tested with SETTE
.parallel_HPC_CFG:
parallel:
matrix:
- HPC: [default]
CONFIG: [default]
# HPC & testcases lists to be tested with SETTE
.parallel_HPC_TST:
parallel:
matrix:
- HPC: [default]
CONFIG: [default]
# HPC & configs lists to be tested with SETTE
.parallel_HPC_CFG:
parallel:
matrix:
- HPC: [aa,belenos]
#CONFIG: [ORCA2_ICE_PISCES,ORCA2_OFF_PISCES,AMM12,AGRIF_DEMO,WED025,GYRE_PISCES,ORCA2_SAS_ICE,ORCA2_ICE_OBS]
CONFIG: [ORCA2_ICE_PISCES,ORCA2_OFF_PISCES,AMM12,WED025,GYRE_PISCES,ORCA2_SAS_ICE,ORCA2_ICE_OBS]
# HPC & testcases lists to be tested with SETTE
.parallel_HPC_TST:
parallel:
matrix:
- HPC: [aa,belenos]
#CONFIG: [SWG,ICE_AGRIF,OVERFLOW,LOCK_EXCHANGE,VORTEX,ISOMIP+]
CONFIG: [SWG,OVERFLOW,LOCK_EXCHANGE,VORTEX,ISOMIP+]
# variables declared hereafter will be avaible in all jobs
# these 2 variables are needed for each HPC to be tested:
# - SETTE_CFG: SETTE param.cfg file path
# - SETTE_MOD: SETTE modules list
variables:
# METEO-FRANCE BELENOS (INTEL_2018+INTEL-MPI)
BL_SETTE_CFG: "/home/ext/mr/smer/samsong/SRC/NEMO/main/sette/param.ci"
BL_SETTE_MOD: "gcc/9.2.0 intel/2018.5.274 intelmpi/2018.5.274 phdf5/1.8.18 netcdf_par/4.7.1_V2 xios/trunk/r2320_intel-impi git/2.27.0"
# ECMWF AA (INTEL_2021+OPEN-MPI)
AA_SETTE_CFG: "/home/ar0s/SRC/NEMO/main/sette/param.ci"
AA_SETTE_MOD: "prgenv/intel intel/2021.4.0 openmpi/4.1.1.1 hdf5-parallel/1.10.6 netcdf4-parallel/4.7.4 xios/trunk/r2320_intel-ompi"
# MERCATOR KARA (TODO)
#KR_SETTE_CFG: "/kara/data1/gsamson/SRC/NEMO/nemo/sette/param.ci"
#KR_SETTE_MOD: "gcc/9.3.0 openmpi/4.0.5_gcc9.3.0 hdf5/1.8.18_gcc9.3.0 netcdf/4.7.1_gcc9.3.0 xios/trunk_rev2136_gcc9.3.0 git/2.34.1"
#----------#
# SETTE CI #
#----------#
include:
# default values will be overwritten depending on commit author
- local: '.gitlab-ci-default.yml'
- local: '.gitlab-ci-cnrs.yml'
rules:
- if: '$CI_COMMIT_AUTHOR =~ /.*masson.*/'
- local: '.gitlab-ci-mercator.yml'
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
#- if: '$CI_COMMIT_AUTHOR =~ /.*samson.*/ || $CI_COMMIT_AUTHOR =~ /.*chanut.*/'
.cache: &cache_CFG
key: ${CONFIG}_${CI_COMMIT_SHORT_SHA}_${CI_PIPELINE_ID}
paths:
- cfgs/${CONFIG}_ST/EXP*
- cfgs/${CONFIG}_ST/BLD/bin
- cfgs/${CONFIG}_ST/cpp_${CONFIG}_ST.fcm
.cache: &cache_TST
key: ${CONFIG}_${CI_COMMIT_SHORT_SHA}_${CI_PIPELINE_ID}
paths:
- tests/${CONFIG}_ST/EXP*
- tests/${CONFIG}_ST/BLD/bin
- tests/${CONFIG}_ST/cpp_${CONFIG}_ST.fcm
stages:
- compile
- run
- check
before_script:
# the following commands will be executed at the beginning of each job
# they are needed to copy param.cfg to SETTE directory and to load the modules
- declare -A HOST_NAME=( ["kara"]="KR" ["aa"]="AA" ["belenoslogin"]="BL" ["irene"]="IR" ["jean-zay"]="JZ" )
- SETTE_MOD=${HOST_NAME[${HOSTNAME//[0-9,-,.]*}]}_SETTE_MOD
- if [ -d ${HOME}/modules ]; then module use ${HOME}/modules; fi
- module purge || true # force to always have 0 as error code (needed for irene)
- module load ${!SETTE_MOD}
- set -x # debug prints
- SETTE_CFG=${HOST_NAME[${HOSTNAME//[0-9,-,.]*}]}_SETTE_CFG
- cp -av ${!SETTE_CFG} sette/param.cfg
- git config core.filemode false # ignore git(lab) symlinks permissions changes when pushing then pulling cache ("old mode 100755 -> new mode 100644")
- SETTE_OPT="-b -u -w"
# JOBS
# sette_cmp_cfgs : compile reference configurations
# sette_cmp_tsts : compile test cases
# sette_run_cfgs : run reference configurations
# sette_run_tsts : run test cases
# sette_rpt_cfgs : check reference configurations results
# sette_rpt_tsts : check test cases results
sette_cmp_cfgs:
stage: compile
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
extends: .parallel_HPC_CFG # HPC + configs loop
cache:
<<: *cache_CFG
policy: push
tags:
- $HPC
script:
- cd sette
- ./sette.sh ${SETTE_OPT} -n ${CONFIG} -x "COMPILE" | tee -a sette_cmp_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- cd -
artifacts:
paths:
- sette/sette_cmp_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
when: always
sette_cmp_tsts:
stage: compile
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
extends: .parallel_HPC_TST # HPC + tests loop
cache:
<<: *cache_TST
policy: push
tags:
- $HPC
script:
- cd sette
- ./sette.sh ${SETTE_OPT} -n ${CONFIG} -x "COMPILE" | tee -a sette_cmp_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- cd -
artifacts:
paths:
- sette/sette_cmp_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
when: always
sette_run_cfgs:
stage: run
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: [sette_cmp_cfgs] # limited to 50 jobs
dependencies: [] # do not retrieve previous artifacts
extends: .parallel_HPC_CFG # HPC + configs loop
cache:
<<: *cache_CFG
policy: pull
tags:
- $HPC
script:
- cd sette
- ./sette.sh ${SETTE_OPT} -n ${CONFIG} -x "RESTART REPRO PHYOPTS CORRUPT" | tee -a sette_run_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- cd -
artifacts:
paths:
- sette/sette_run_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- cfgs/${CONFIG}_ST/*/sette.*.out
- cfgs/${CONFIG}_ST/*/sette.*.err
- cfgs/${CONFIG}_ST/*/ocean.output*
when: always
sette_run_tsts:
stage: run
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: [sette_cmp_tsts] # limited to 50 jobs
dependencies: [] # do not retrieve previous artifacts
extends: .parallel_HPC_TST # HPC + tests loop
cache:
<<: *cache_TST
policy: pull
tags:
- $HPC
script:
- cd sette
- ./sette.sh ${SETTE_OPT} -n ${CONFIG} -x "RESTART REPRO PHYOPTS CORRUPT" | tee -a sette_run_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- cd -
artifacts:
paths:
- sette/sette_run_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
- tests/${CONFIG}_ST/*/sette.*.out
- tests/${CONFIG}_ST/*/sette.*.err
- tests/${CONFIG}_ST/*/ocean.output*
when: always
sette_rpt_cfgs:
stage: check
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: [sette_run_cfgs] # limited to 50 jobs
dependencies: [] # do not retrieve previous artifacts
extends: .parallel_HPC_CFG # HPC + configs loop
tags:
- $HPC
script:
- cd sette
- ./sette_rpt.sh -b -u -n "${CONFIG}" | tee -a sette_rpt_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
artifacts:
paths:
- sette/sette_rpt_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
when: always
sette_rpt_tsts:
stage: check
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
needs: [sette_run_tsts] # limited to 50 jobs
dependencies: [] # do not retrieve previous artifacts
extends: .parallel_HPC_TST # HPC + tests loop
tags:
- $HPC
script:
- cd sette
- ./sette_rpt.sh -b -u -n "${CONFIG}" | tee -a sette_rpt_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
artifacts:
paths:
- sette/sette_rpt_${CONFIG}_${CI_COMMIT_SHORT_SHA}_${HPC}.log
when: always
\ No newline at end of file
.. image:: https://forge.nemo-ocean.eu/nemo/nemo/badges/main/pipeline.svg
:target: https://forge.nemo-ocean.eu/nemo/nemo/-/commits/main
**Contents**
.. contents::
......
......@@ -55,7 +55,8 @@
%CPP cpp
%FC mpifort -c -cpp
%FCFLAGS -march=core-avx2 -i4 -r8 -O3 -fp-model strict -fno-alias -align array64byte
%PROD_FCFLAGS -march=core-avx2 -i4 -r8 -O3 -fp-model strict -fno-alias -align array64byte
%DEBUG_FCFLAGS -march=core-avx2 -i4 -r8 -g -O0 -debug all -traceback -fp-model strict -ftrapuv -check all,noarg_temp_created -fpe-all0 -ftz -init=arrays,snan,huge
%FFLAGS %FCFLAGS
%LD mpifort
%LDFLAGS
......
......@@ -114,7 +114,7 @@
sn_trcsbc(14) = 'dust.orca.new' , -1 , 'dustfer' , .true. , .true. , 'yearly' , '' , '' , ''
sn_trcsbc(23) = 'ndeposition.orca', -12 , 'ndep' , .false. , .true. , 'yearly' , '' , '' , ''
rn_trsfac(5) = 3.774194e-02 ! ( 1E-3 / 31. * 117 )
rn_trsfac(7) = 9.572954e-03 ! ( 8.8 / 28.1 )
rn_trsfac(7) = 9.572954e-03 ! ( 0.269 / 28.1 )
rn_trsfac(14) = 6.2667860e-04 ! ( 0.035 / 55.85 )
rn_trsfac(23) = 5.2232143e-01 ! ( From kgN m-2 s-1 to molC l-1 ====> zfact = 7.3125/14 )
rn_sbc_time = 1. ! Time scaling factor for SBC and CBC data (seconds in a day)
......
......@@ -114,7 +114,7 @@
sn_trcsbc(14) = 'dust.orca.new' , -1 , 'dustfer' , .true. , .true. , 'yearly' , '' , '' , ''
sn_trcsbc(23) = 'ndeposition.orca', -12 , 'ndep' , .false. , .true. , 'yearly' , '' , '' , ''
rn_trsfac(5) = 3.774194e-02 ! ( 1E-3 / 31. * 117 )
rn_trsfac(7) = 9.572954e-03 ! ( 8.8 / 28.1 )
rn_trsfac(7) = 9.572954e-03 ! ( 0.269 / 28.1 )
rn_trsfac(14) = 6.2667860e-04 ! ( 0.035 / 55.85 )
rn_trsfac(23) = 5.2232143e-01 ! ( From kgN m-2 s-1 to molC l-1 ====> zfact = 7.3125/14 )
rn_sbc_time = 1. ! Time scaling factor for SBC and CBC data (seconds in a day)
......
......@@ -9,6 +9,7 @@ use strict;
use warnings;
use Fcm::Timer qw{timestamp_command};
use File::Spec;
# Function declarations
sub catfile;
......
#!/bin/bash
#set -x
set -o posix
#set -x
#set -u
#set -e
#+
#
# ===============
# makenemo
......@@ -16,15 +15,12 @@ set -o posix
# SYNOPSIS
# ========
#
# ::
#
# $ makenemo
#
#
# DESCRIPTION
# ===========
#
#
# This script aims :
#
# - to choose MYCONFIG
......@@ -44,11 +40,8 @@ set -o posix
#
# Locally defined :
#
# - TAB : NEMO subdirectory used (read)
# - MAIN_DIR : self explaining
# - CONFIG_DIR : " " "
# - MODELES_DIR : " " "
# - TOOLS_DIR : " " "
# - NEMO_DIR : " " "
# - REMOTE_CTL : URL link to a remote resource list for an external configuration
# which is not part of the reference suite
......@@ -59,62 +52,26 @@ set -o posix
# EXAMPLES
# ========
#
# ::
#
# $ ./makenemo -m ifort_osx - j3 -n ORCA2_SI3_PISCES
#
#
# TODO
# ====
#
# option debug
#
#
# EVOLUTIONS
# ==========
#
# $Id: makenemo 15186 2021-08-12 16:39:09Z gsamson $
#
#
#
# * creation
#
#-
# $ ./makenemo -m ifort_osx -j 3 -r ORCA2_ICE_PISCES -n MY_ORCA2
#-
##- Initialization of the options ---
# Initialization of the options
x_d=''; x_h=''; x_n=''; x_r=''; x_c='';
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
##- 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}
export MAIN_DIR
#
export CFGS_DIR=${MAIN_DIR}/cfgs
export TESTS_DIR=${MAIN_DIR}/tests
export TOOLS_DIR=${MAIN_DIR}/tools
export COMPIL_DIR=${MAIN_DIR}/mk
export NEMO_DIR=${MAIN_DIR}/${x_s}
export AGRIFUSE='10'
x_j='1'; x_e=''; x_s='src'; x_v='1'
list_key='0'; chk_key='1'
list_add_key=''; list_def_key=''; list_del_key=''
#-
#- FCM and functions location ---
export PATH=${MAIN_DIR}/ext/FCM/bin:$PATH
x_c_cfg=0; x_nocdf=0
# Local variables
MAIN_DIR=$(cd $(dirname "$0"); pwd)
MAIN_DIR=${MAIN_DIR%/+(sette|tools|cfgs|tests|ext|arch)}
COMPIL_DIR=${MAIN_DIR}/mk
PATH=${MAIN_DIR}/ext/FCM/bin:$PATH
#-
#- Choice of the options ---
# Choice of the options
while [ ${#1} -gt 0 ]; do
case "$1" in
......@@ -228,91 +185,107 @@ EOF
shift
done
export NEW_CONF=${x_n}
# Variables definition based on options
NBR_PRC=${x_j}
CMP_NAM=${x_m}
NEM_SUBDIR=${x_d}
REF_CONF=${x_r}
DEMO_CONF=${x_a}
export NEMO_DIR=${MAIN_DIR}/${x_s}
NEMO_DBG=${x_b}
NEMO_DIR=${MAIN_DIR}/${x_s}
# Print available arch files
[ "${CMP_NAM}" == 'all' ] && ${COMPIL_DIR}/Flist_archfile.sh && exit 0
# New config case
if [ -n "${x_n}" ]; then
# Look for already-existing new config
NEW_CONF=${x_n}
if [ -n "${x_t}" ]; then
NEW_DIR=$( find -L ${x_t} -maxdepth 1 -type d -name ${x_n} 2>/dev/null )
else
NEW_DIR=$( find -L ${MAIN_DIR}/cfgs ${MAIN_DIR}/tests -maxdepth 1 -type d -name ${NEW_CONF} 2>/dev/null )
fi
NEW_NB=$( echo ${NEW_DIR} | wc -w )
NEW_CMP=$( grep -l "^${NEW_CONF} " ${MAIN_DIR}/cfgs/*_cfgs.txt ${MAIN_DIR}/tests/*_cfgs.txt | tail -1 )
# Define if new config needs to be created or not
if [[ ${NEW_NB:-0} -eq 0 || -z "${NEW_CMP}" ]]; then
DO_NEW=1
else
DO_NEW=0
NEW_SUB="$( grep "^${NEW_CONF} " ${NEW_CMP} | awk '{$1 = ""; print $0}' )"
if [[ -n "${x_r}" || -n "${x_a}" ]]; then
echo -e "\nWARNING: ${NEW_CONF} configuration is already existing, we ignore \"-r\" & \"-a\" options\n"
fi
fi
[ "${CMP_NAM}" == 'all' ] && . ${COMPIL_DIR}/Flist_archfile.sh all && exit
# '-r': reference config ('cfgs' directory)
if [ -n "${REF_CONF}" ]; then
conf_file=ref_cfgs.txt ; export CONFIG_DIR=${CFGS_DIR} ; TML_CONF=${REF_CONF}
# '-a': testcases ('tests' directory)
elif [ -n "${DEMO_CONF}" ]; then
conf_file=demo_cfgs.txt; export CONFIG_DIR=${TESTS_DIR}; TML_CONF=${DEMO_CONF}
# '-n': new or already-existing config (any directory)
elif [[ -n "${NEW_CONF}" && -z "${conf_file}" ]]; then
# already-existing config (check work_cfgs.txt)
if [ $( grep -l "^${NEW_CONF} " ${CFGS_DIR}/work_cfgs.txt ${TESTS_DIR}/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}
# new config (check ref_cfgs.txt & demo_cfgs.txt)
elif [ $( grep -l "^${NEW_CONF} " ${CFGS_DIR}/ref_cfgs.txt ${TESTS_DIR}/demo_cfgs.txt 2> /dev/null | wc -l ) -eq 1 ]; then
conf_file=$( grep -l "^${NEW_CONF} " ${CFGS_DIR}/ref_cfgs.txt ${TESTS_DIR}/demo_cfgs.txt )
export CONFIG_DIR=$( dirname $conf_file ); conf_file=$( basename $conf_file )
TML_CONF=${NEW_CONF}
# config not found in both cfgs & tests directories
else
echo -e "\033[0;31m\nUser configuration ${NEW_CONF} not found !"
echo -e "Please choose a reference configuration (-r) or a testcase (-a)"
echo -e "among this list to create your own configuration (-n):"
${COMPIL_DIR}/Flist_cfgs.sh
exit 2
fi
# Define ref config if new config not defined or not existing yet
if [[ ${DO_NEW:-0} -eq 1 || -z "${NEW_CONF}" ]]; then
if [[ -n "${x_r}" || -n "${x_a}" ]]; then
REF_DIR=$( find ${MAIN_DIR}/cfgs ${MAIN_DIR}/tests -maxdepth 1 -type d -name ${x_r:-""} -o -name ${x_a:-""} 2>/dev/null )
REF_NB=$( echo ${REF_DIR} | wc -w )
REF_CMP=$( grep -l "^${x_r} \|^${x_a} " ${MAIN_DIR}/cfgs/ref_cfgs.txt ${MAIN_DIR}/tests/demo_cfgs.txt )
if [[ ${REF_NB} -eq 1 && -n "${REF_CMP}" ]]; then
REF_CONF=$(basename ${REF_DIR})
REF_TYPE=$(basename ${REF_DIR%\/*})
REF_FILE=$(basename ${REF_CMP})
REF_SUB="$( grep "^${REF_CONF} " ${REF_CMP} | awk '{$1 = ""; print $0}' )"
elif [ ${REF_NB} -gt 1 ]; then
echo -e "Please choose only one reference configuration (-r) or testcase (-a)"; exit 2
elif [ ${REF_NB} -eq 0 ]; then
echo -e "Please choose at least one reference configuration (-r) or testcase (-a) from:"
${COMPIL_DIR}/Flist_cfgs.sh ${MAIN_DIR}; exit 2
fi
# using both '-r' and '-a' options
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"
echo -e " - Unsupported cases in ./tests ('-a')\033[0m\n"
exit 2
# config found in both cfgs & tests directories
elif [ $( grep -l "^${NEW_CONF} " */work_cfgs.txt 2> /dev/null | wc -l ) -gt 1 ]; then
echo -e "\033[0;31m\nUser configuration ${NEW_CONF} 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
# 'all': list all available configurations
elif [[ "${REF_CONF}" == 'all' || "${DEMO_CONF}" == 'all' ]]; then
${COMPIL_DIR}/Flist_cfgs.sh
exit 0
# any other case
else
exit 2
else
echo -e "Please choose at least one reference configuration (-r) or testcase (-a) from:"
${COMPIL_DIR}/Flist_cfgs.sh ${MAIN_DIR}; exit 2
fi
# force config creation if ref config installed outside nemo directory
if [[ -n "${x_t}" && ${x_t} != ${REF_DIR%\/*} ]]; then DO_NEW=1; fi
fi
if [ -z "${NEW_CONF}" ]; then NEW_CONF=$TML_CONF; fi
export NEMO_TDIR=${x_t:-$CONFIG_DIR}
# Current config (new or ref) definition
CFG_DIR=$( dirname ${NEW_CMP:-${REF_CMP}} )
CUR_DIR=${NEW_DIR:-${REF_DIR}}
CUR_CONF=${NEW_CONF:-${REF_CONF}}
CUR_SUB=${NEW_SUB:-${REF_SUB}}
NEMO_TDIR=${x_t:-${CUR_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
# Config cleaning
if [ -d ${NEMO_TDIR}/${CUR_CONF} ]; then
if [ $x_c_cfg -eq 1 ] ; then
. ${COMPIL_DIR}/Fclean_config.sh
${COMPIL_DIR}/Fclean_config.sh ${NEMO_TDIR}/${CUR_CONF}
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
#read -p "Are you sure that you want to clean $CUR_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/}
# choose & generate fcm cfg file
[ $x_nocdf -eq 1 ] && USEBLD=bldxagxcdf.cfg || USEBLD=bldxag.cfg
grep key_agrif ${NEMO_TDIR}/${CUR_CONF}/BLD/cpp.fcm 2>/dev/null && USEBLD=${USEBLD/xag/}
sed -e "s~MAIN_DIR~${MAIN_DIR}~; s~NEMO_TDIR~${NEMO_TDIR}~; s~CUR_CONF~${CUR_CONF}~; s~COMPIL_DIR~${COMPIL_DIR}~" ${COMPIL_DIR}/${USEBLD} > ${NEMO_TDIR}/${CUR_CONF}/BLD/${USEBLD}
# 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'
fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${NEMO_TDIR}/${CUR_CONF}/BLD/${USEBLD} || exit 1
# remove all build directories
echo -e '\nCleaning '${CUR_CONF}' building directories and variables\n'
for dir in AGRIFLIB BLD LONG NEMOFILES REPRO_* SHORT WORK; do
rm -rf ${NEMO_TDIR}/${NEW_CONF}/$dir
rm -rf ${NEMO_TDIR}/${CUR_CONF}/$dir
done
for file in cpp.history cpp.fcm full_key_list.txt; do
rm -f ${NEMO_TDIR}/${NEW_CONF}/BLD/$file
rm -f ${NEMO_TDIR}/${CUR_CONF}/BLD/$file
done
exit 0
#else
......@@ -320,117 +293,108 @@ if [ $incfg -eq 1 ] ; then
# 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
else
[ $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
# Create/update config components list
NEM_SUBDIR=( ${x_d:-${CUR_SUB}} )
if [ ${DO_NEW:-0} -eq 1 ]; then
echo
printf "\nYou are installing a new configuration %s from %s " ${CUR_CONF} ${REF_CONF}
printf "with sub-components: %s\n" "${NEM_SUBDIR[*]}"
echo
else
echo
printf "\nYou are compiling an existing configuration %s " ${CUR_CONF}
printf "with sub-components: %s\n" "${NEM_SUBDIR[*]}"
echo
fi
## Update sub-comps if needed
if [ -z "${NEM_SUBDIR}" ]; then
NEM_SUBDIR=$( grep "${TML_CONF} " ${CONFIG_DIR}/${conf_file} | awk '{$1 = ""; print $0}' )
if [[ -n "${x_d}" || ${DO_NEW:-0} -eq 1 ]]; then
[ -f ${CFG_DIR}/work_cfgs.txt ] && sed -i "/^${CUR_CONF} /d" ${CFG_DIR}/work_cfgs.txt
echo ${CUR_CONF} "${NEM_SUBDIR[*]}" >> ${CFG_DIR}/work_cfgs.txt
fi
export NEM_SUBDIR="${NEM_SUBDIR}" NEW_CONF="${NEW_CONF}"
## Create new config
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
${COMPIL_DIR}/Fmake_config.sh ${NEMO_TDIR}/${NEW_CONF} ${CONFIG_DIR}/${TML_CONF} # must be called for existing config to create EXP00 if not existing
# Create config directories
${COMPIL_DIR}/Fmake_config.sh ${NEMO_TDIR}/${CUR_CONF} ${REF_DIR:-${NEMO_TDIR}/${CUR_CONF}}
## 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
echo ${NEW_CONF} "${NEM_SUBDIR}" >> ${CONFIG_DIR}/work_cfgs.txt
#- Create the WORK ---
#- Clean links and librairies ---
#- Creating the good links, at first on OCE ---
. ${COMPIL_DIR}/Fmake_WORK.sh ${x_e[@]} || exit 3
# Create/update WORK directory
${COMPIL_DIR}/Fmake_WORK.sh "${NEM_SUBDIR[*]/#/${NEMO_DIR}/}" "${x_e:-"MY_SRC"}" ${NEMO_TDIR}/${CUR_CONF} || exit 3
. ${COMPIL_DIR}/Fmake_bld.sh ${CONFIG_DIR} ${NEW_CONF} ${NEMO_TDIR} || exit 3
# build the complete list of the cpp keys of this configuration
# 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_" ${NEMO_TDIR}/${NEW_CONF}/WORK/* ); do
echo $i | grep key_ | sed -e "s/=.*//"
done \
| sort -d | uniq > ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt
[ ${list_key} -eq 1 ] && echo && cat ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt && exit 0
grep -h "^#.*defined.*" ${NEMO_TDIR}/${CUR_CONF}/WORK/* | \
grep -o "key_[[:alnum:]]\+\|key_[[:alnum:]]\+_[[:alnum:]]\+\|iso_[[:alnum:]]\+_[[:alnum:]]\+" | \
sort | uniq > ${NEMO_TDIR}/${CUR_CONF}/BLD/full_key_list.txt
[ ${list_key} -eq 1 ] && echo && cat ${NEMO_TDIR}/${CUR_CONF}/BLD/full_key_list.txt && exit 0
fi
#- At this stage new configuration has been added, we add or remove keys
[ ! -z "${list_add_key}" ] && { . ${COMPIL_DIR}/Fadd_keys.sh ${NEW_CONF} add_key ${list_add_key}; }
[ ! -z "${list_def_key}" ] && { . ${COMPIL_DIR}/Fdef_keys.sh ${NEW_CONF} def_key ${list_def_key}; }
[ ! -z "${list_del_key}" ] && { . ${COMPIL_DIR}/Fdel_keys.sh ${NEW_CONF} del_key ${list_del_key}; }
#- check that all keys are really existing...
# CPP keys addition/removal
[ -n "${list_add_key}" ] && ${COMPIL_DIR}/Fadd_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_add_key}
[ -n "${list_def_key}" ] && ${COMPIL_DIR}/Fdef_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_def_key}
[ -n "${list_del_key}" ] && ${COMPIL_DIR}/Fdel_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_del_key}
# CPP keys check
if [ $chk_key -eq 1 ] ; then
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 ${NEMO_TDIR}/${NEW_CONF}/BLD/full_key_list.txt ) ]; then
echo
echo "E R R O R : key "$kk" is not found in ${NEMO_TDIR}/${NEW_CONF}/WORK routines..."
echo "we stop..."
echo
exit 1
fi
fi
for kk in $( sed -n "s/bld::tool::fppkeys \+//p" ${NEMO_TDIR}/${CUR_CONF}/cpp_${CUR_CONF}.fcm ); do
if ! grep -q $kk ${NEMO_TDIR}/${CUR_CONF}/BLD/full_key_list.txt; then
echo
echo "E R R O R : key "$kk" is not found in ${NEMO_TDIR}/${CUR_CONF}/WORK routines..."
echo "we stop..."
echo
exit 1
fi
done
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 ${NEMO_TDIR}/${NEW_CONF}/BLD/arch_nemo.fcm ${NEMO_TDIR}/${NEW_CONF}/BLD/cpp.fcm ${CMP_NAM} || exit 3
#-
#_ END OF CONFIGURATION PHASE
#_
#-
#- Compile ---
# CPP & arch files check
ln -sf ${NEMO_TDIR}/${CUR_CONF}/cpp_${CUR_CONF}.fcm ${NEMO_TDIR}/${CUR_CONF}/BLD/cpp.fcm
${COMPIL_DIR}/Fcheck_archfile.sh ${NEMO_TDIR}/${CUR_CONF}/BLD/arch_nemo.fcm ${NEMO_TDIR}/${CUR_CONF}/BLD/cpp.fcm ${MAIN_DIR}/arch/arch-${CMP_NAM}.fcm ${NEMO_DBG} || exit 3
# Compilation
if [ "${NBR_PRC}" -gt 0 ]; then
# We coose the default light file
[ $x_nocdf -eq 1 ] && export USEBLD=bldxagxcdf.cfg || export USEBLD=bldxag.cfg
# choose & generate fcm cfg file
[ $x_nocdf -eq 1 ] && USEBLD=bldxagxcdf.cfg || 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 || exit 1
echo ''
# AGRIF preprocessing
grep key_agrif ${NEMO_TDIR}/${CUR_CONF}/BLD/cpp.fcm 2>/dev/null && USEBLD=${USEBLD/xag/}
if [[ ! ${USEBLD} =~ "xag" ]]; then
${COMPIL_DIR}/Fprep_agrif.sh ${MAIN_DIR} ${NEMO_TDIR}/${CUR_CONF} || exit 3
# compile & copy conv
sed -e "s~MAIN_DIR~${MAIN_DIR}~; s~NEMO_TDIR~${NEMO_TDIR}~; s~CUR_CONF~${CUR_CONF}~; s~COMPIL_DIR~${COMPIL_DIR}~" ${COMPIL_DIR}/conv.cfg > ${NEMO_TDIR}/${CUR_CONF}/BLD/conv.cfg
fcm build ${NEMO_TDIR}/${CUR_CONF}/BLD/conv.cfg || exit 1
ln -sfv ${MAIN_DIR}/ext/AGRIF/agrif_oce.in ${NEMO_TDIR}/${CUR_CONF}/AGRIFLIB/bin/conv ${NEMO_TDIR}/${CUR_CONF}/NEMOFILES/.
sed -e "s~MAIN_DIR~${MAIN_DIR}~; s~NEMO_TDIR~${NEMO_TDIR}~; s~CUR_CONF~${CUR_CONF}~; s~COMPIL_DIR~${COMPIL_DIR}~" ${COMPIL_DIR}/bld_preproagr.cfg > ${NEMO_TDIR}/${CUR_CONF}/BLD/bld_preproagr.cfg
fcm build --ignore-lock -j 1 ${NEMO_TDIR}/${CUR_CONF}/BLD/bld_preproagr.cfg || exit 1
echo
echo "---------------------------------"
echo "CONV preprocessing successfull !!"
echo "---------------------------------"
echo ''
echo
fi
fcm build ${x_c} --ignore-lock -v ${x_v} -j ${NBR_PRC} ${COMPIL_DIR}/$USEBLD || exit 1
sed -e "s~MAIN_DIR~${MAIN_DIR}~; s~NEMO_TDIR~${NEMO_TDIR}~; s~CUR_CONF~${CUR_CONF}~; s~COMPIL_DIR~${COMPIL_DIR}~" ${COMPIL_DIR}/${USEBLD} > ${NEMO_TDIR}/${CUR_CONF}/BLD/${USEBLD}
fcm build --ignore-lock -v ${x_v} -j ${NBR_PRC} ${NEMO_TDIR}/${CUR_CONF}/BLD/${USEBLD} || exit 1
if [ -f ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ]; then
ln -sf ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/nemo.exe ${NEMO_TDIR}/${NEW_CONF}/EXP00/nemo
if [ -f ${NEMO_TDIR}/${CUR_CONF}/BLD/bin/nemo.exe ]; then
(cd ${NEMO_TDIR}/${CUR_CONF}/EXP00; ln -sfv ../BLD/bin/nemo.exe ./nemo)
else
exit 1
fi
fi
#- Unset variables
${COMPIL_DIR}/Fclean_var.sh
exit 0
......@@ -62,16 +62,14 @@ set -o posix
# * creation
#
#-
echo "Adding keys in : ${NEW_CONF}"
for i in ${list_add_key} ; do
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}/" ${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
unset -v list_add_key
echo "Adding keys ${2} in : ${1}"
for i in ${2} ; do
if [ "$(cat ${1}/cpp_$(basename ${1}).fcm | grep -c "\<$i\>" )" -ne 0 ] ; then
echo "key $i already present in cpp_$(basename ${1}).fcm"
else
sed -i "s/$/ ${i}/" ${1}/cpp_$(basename ${1}).fcm
echo "added key $i in $(basename ${1})"
fi
done
......@@ -118,7 +118,7 @@ if [ ${#3} -eq 0 ]; then # arch not specified
fi
fi
else
nb=$( find ${MAIN_DIR}/arch -name arch-${3}.fcm -print | wc -l )
nb=$( find $(dirname ${3}) -name $(basename ${3}) -print | wc -l )
if [ $nb -eq 0 ]; then # no arch file found
echo "Warning !!!"
echo "Compiler not existing"
......@@ -129,12 +129,12 @@ else
if [ $nb -gt 1 ]; then # more than 1 arch file found
echo "Warning !!!"
echo "more than 1 arch file for the same compiler have been found"
find ${MAIN_DIR}/arch -name arch-${3}.fcm -print
find $(dirname ${3}) -name $(basename ${3}) -print
echo "keep only 1"
echo "EXITING..."
exit 1
fi
myarch=$( find ${MAIN_DIR}/arch -name arch-${3}.fcm -print )
myarch=$( find $(dirname ${3}) -name $(basename ${3}) -print )
# we were already using this arch file ?
if [ "$myarch" == "$( cat $(dirname $1)/arch.history 2>/dev/null)" ]; then
if [ -f $1 ]; then
......@@ -151,7 +151,7 @@ else
[ ${#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 $(basename $1) -name arch-${3}.fcm -print )
myarch=$( find -L $(dirname ${3}) -cnewer $(basename $1) -name $(basename ${3}) -print )
[ ${#myarch} -ne 0 ] && cpeval ${myarch} $1
else
cpeval ${myarch} $1
......@@ -185,7 +185,7 @@ then
fi
#- in TOOLS directory looking for USE xios
else
use_iom=$( egrep --exclude-dir=.svn -r USE ${MAIN_DIR}/src/* | grep -c xios )
use_iom=$( egrep --exclude-dir=.svn -r USE $(dirname ${3})/../src/* | grep -c xios )
have_lxios=$( sed -e "s/#.*$//" $1 | grep -c "\-lxios" )
if [[ ( $use_iom -eq 0 ) || ( $have_lxios != 1 ) ]]
then
......@@ -216,7 +216,7 @@ do
done
# Nemo debug ?
if [ -n "${NEMO_DBG}" ]; then
if [ -n "${4}" ]; 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
......
......@@ -69,18 +69,18 @@ declare -a ZTAB
if [ ${#2} -eq 0 ]; then
tail -1 ${CONFIG_DIR}/$1 > ${CONFIG_DIR}/cfg.tmp
read -a ZTAB < ${CONFIG_DIR}/cfg.tmp
NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
CUR_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
\rm ${CONFIG_DIR}/cfg.tmp
echo "Warning !!!"
echo "No configuration specified"
echo "Use makenemo -n MYCONFIG"
echo "or makenemo -h for help"
echo "Using default configuration : ${NEW_CONF}"
echo "Using default configuration : ${CUR_CONF}"
fi
if [ "$1" == cfg.txt ]; then
cat ${CONFIG_DIR}/$1 | grep "${NEW_CONF} " > ${CONFIG_DIR}/cfg.tmp
cat ${CONFIG_DIR}/$1 | grep "${CUR_CONF} " > ${CONFIG_DIR}/cfg.tmp
read -a ZTAB < ${CONFIG_DIR}/cfg.tmp
NEW_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
CUR_CONF=${ZTAB[0]} ; TAB=( ${ZTAB[@]:1} )
\rm ${CONFIG_DIR}/cfg.tmp
fi
......
......@@ -63,31 +63,23 @@ set -o posix
#
#-
NEW_CONF=${x_n}
CONF=$(basename ${1})
CONFIG_DIR=$(dirname ${1})
if [ ${#NEW_CONF} -eq 0 ] ; then
if [ ${#CONF} -eq 0 ] ; then
echo " "
echo "No configuration specified, please use makenemo -n CONFIG clean_config "
else
echo " "
echo "Are you sure that you want to remove this directory $NEW_CONF? [y/n] "
echo "Are you sure that you want to remove this directory $CONF? [y/n] "
read answer
answer=`echo $answer | sed 's/^[y].*$/y/'`
if [ -z "$answer" -o "x$answer" = "xy" ]; then
## testing if configuration exists
if [[ ! $( grep "${NEW_CONF} " */work_cfgs.txt ) ]] ; then
echo "The configuration ${NEW_CONF} does not exist in file work_cfgs.txt"
echo "No removing configuration"
echo " "
else
CONFIG_DIR=${MAIN_DIR}/$( grep -l "${NEW_CONF} " */work_cfgs.txt | cut -d/ -f1 )
rm -rf ${CONFIG_DIR}/${NEW_CONF}
sed -e "/${NEW_CONF} /d" ${CONFIG_DIR}/work_cfgs.txt > ${CONFIG_DIR}/work_cfgs.tmp
mv ${CONFIG_DIR}/work_cfgs.tmp ${CONFIG_DIR}/work_cfgs.txt
echo "${NEW_CONF} configuration REMOVED"
fi
rm -rf ${CONFIG_DIR}/${CONF}
sed -i "/^${CONF} /d" ${CONFIG_DIR}/work_cfgs.txt > ${CONFIG_DIR}/work_cfgs.tmp
echo "${CONF} configuration REMOVED"
else
echo " "
......@@ -95,5 +87,3 @@ else
fi
fi
unset -v answer
#!/bin/bash
#set -x
set -o posix
#set -u
#set -e
#+
#
# =============
# Fclean_var.sh
# =============
#
# ----------------------------
# Clean environment variables
# ----------------------------
#
# SYNOPSIS
# ========
#
# ::
#
# $ Fclean_var.sh
#
#
# DESCRIPTION
# ===========
#
#
# Clean environment variables
#
# EXAMPLES
# ========
#
# ::
#
# $ ./Fclean_var.sh
#
#
# TODO
# ====
#
# option debug
#
#
# EVOLUTIONS
# ==========
#
# $Id: Fclean_var.sh 4990 2014-12-15 16:42:49Z timgraham $
#
#
#
# * creation
#
#-
#- Unset variables
unset -v NSTOP
unset -v TAB
unset -v NEW_CONF
unset -v REF_CONF
unset -v CMP_NAM
unset -v NBR_PRC
unset -v NEM_SUBDIR
unset -v MAIN_DIR
unset -v CONFIG_DIR
unset -v TOOLS_DIR
unset -v COMPIL_DIR
unset -v NEMO_DIR
unset -v USEBLD
......@@ -56,8 +56,5 @@ set -o posix
#
#-
echo "Defining keys in : ${NEW_CONF}"
echo " bld::tool::fppkeys ${list_def_key}" > ${NEMO_TDIR}/${NEW_CONF}/cpp_${NEW_CONF}.fcm
unset -v list_def_key
echo "Defining keys in : $(dirname ${1})"
echo " bld::tool::fppkeys ${2}" > ${1}/cpp_$(basename ${1}).fcm
......@@ -60,22 +60,13 @@ set -o posix
#
#-
echo "Removing keys in : ${NEW_CONF}"
echo "Removing keys ${2} in : ${1}"
for i in ${list_del_key} ; do
if [ "$(echo ${i} | grep -c key_nproc )" -ne 0 ]; then
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 ${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}"
for i in ${2} ; do
if [ "$(echo ${i} | grep -c key_nproc )" -gt 0 ]; then
sed -i "s/key_nproc[ij]=.* //" ${1}/cpp_$(basename ${1}).fcm
elif [ "$(cat ${1}/cpp_$(basename ${1}).fcm | grep -c "$i")" -gt 0 ]; then
sed -i "s/\b${i}\b//" ${1}/cpp_$(basename ${1}).fcm
echo "deleted key $i in $(basename ${1})"
fi
done
unset -v list_del_key
......@@ -67,11 +67,11 @@ archfile_loop() {
echo -e "\n ¤ Generic computing architectures"
archfile_loop ${MAIN_DIR}/arch
archfile_loop ${1}/arch
for dir in $( ls ${MAIN_DIR}/arch | grep -v "fcm$" ); do
echo -e "\n ¤ Specific HPC architectures for "${dir}
archfile_loop ${MAIN_DIR}/arch/$dir
for dir in $( ls ${1}/arch | grep -v "fcm$" ); do
echo -e "\n ¤ Specific HPC architectures for "${dir}
archfile_loop ${1}/arch/$dir
done
echo
#!/bin/bash
echo -e "\n ¤ Reference configurations with default sub-components (can be updated by a new set)"
cat ${MAIN_DIR}/cfgs/ref_cfgs.txt \
cat ${1}/cfgs/ref_cfgs.txt \
| awk '{printf "%-20s", $1}{$1 = ""; printf "%s\n", $0}'
echo -e "\n ¤ Demonstrations cases (see https://github.com/sflavoni/NEMO-test-cases for more)"
cat ${MAIN_DIR}/tests/demo_cfgs.txt \
cat ${1}/tests/demo_cfgs.txt \
| awk '{printf "%-20s", $1}{$1 = ""; printf "%s\n", $0}'
echo -e "\n ¤ Available sub-components ('OCE' is mandatory in any set)"
ls ${MAIN_DIR}/src | awk -F/ '{ print $NF }' | column
ls ${1}/src | awk -F/ '{ print $NF }' | column
echo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment