Skip to content
Snippets Groups Projects
Commit 6b99f691 authored by Sebastien Masson's avatar Sebastien Masson
Browse files

Resolve "makenemo does not create EXP00 for existing configs"

parent 6ce630d4
No related branches found
No related tags found
No related merge requests found
......@@ -349,8 +349,8 @@ if [ ${TML_CONF} != ${NEW_CONF} ]; then
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
${COMPIL_DIR}/Fmake_config.sh ${NEMO_TDIR}/${NEW_CONF} ${CONFIG_DIR}/${TML_CONF}
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
## 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
......
......@@ -25,12 +25,10 @@ set -o posix
# ===========
#
#
# - Make the config directory
# - Create repositories needed :
#
# - EXP00 for namelist
# - MY_SRC for user sources
# - BLD for compilation
# - Make the config directory if needed
# - Create repositories if needed :
# - EXP00 for namelist, xml and AGRIF_FixedGrids.in
# - MY_SRC for user sources
#
# EXAMPLES
# ========
......@@ -56,12 +54,33 @@ set -o posix
# * creation
#
#-
\mkdir -p ${1}
\mkdir -p ${1}/EXP00
\mkdir -p ${1}/MY_SRC
[ "${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} && $(readlink -f ${f}) =~ "SHARED" ]]; 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
[ ! -d ${1} ] && \mkdir -p ${1}
[ "${2}" != "${1}" ] && \cp -n ${2}/cpp_${2##*/}.fcm ${1}/cpp_${1##*/}.fcm
#
if [ ! -d ${1}/EXP00 ]
then
echo " Creating ${1}/EXP00"
\mkdir -p ${1}/EXP00
echo " -> Copying existing xml, namelist and AGRIF_FixedGrids.in files from ${2}/EXPREF to ${1}/EXP00"
for f in $( ls -1 ${2}/EXPREF/*.xml ${2}/EXPREF/*namelist* ${2}/EXPREF/AGRIF_FixedGrids.in 2>/dev/null )
do
if [[ -L ${f} && $( readlink -f ${f} ) =~ "SHARED" ]]
then
\ln -sf $( readlink -f ${f} ) ${1}/EXP00/$( basename ${f} ) # keep link from SHARED
else
\cp ${f} ${1}/EXP00/.
fi
done
fi
#
if [ ! -d ${1}/MY_SRC ]
then
if [ -d ${2}/MY_SRC ]
then
echo " Copying ${2}/MY_SRC to ${1}/MY_SRC"
\cp -a ${2}/MY_SRC ${1}/MY_SRC 2> /dev/null
else
echo " Creating ${1}/MY_SRC"
\mkdir -p ${1}/MY_SRC # create an empty directory
fi
fi
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