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.
Fmake_WORK.sh in utils/build/mk – NEMO

source: utils/build/mk/Fmake_WORK.sh @ 14947

Last change on this file since 14947 was 14947, checked in by gsamson, 3 years ago

modify Fmake_WORK.sh script and call in makenemo to correctly handle '-e' option; ticket #2684

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#!/bin/bash
2######################################################
3# Author : Rachid Benshila for NEMO
4# Contact : rblod@locean-ipsl.upmc.fr
5#
6# Some functions called from makenemo
7# Fmake_WORK      : create links in the WORK
8######################################################
9#set -vx
10set -o posix
11#set -u
12#set -e
13#+
14#
15# =============
16# Fmake_WORK.sh
17# =============
18#
19# -----------------------
20# Make the WORK directory
21# -----------------------
22#
23# SYNOPSIS
24# ========
25#
26# ::
27#
28#  $ Fmake_WORK.sh
29#
30#
31# DESCRIPTION
32# ===========
33#
34#
35# Make the WORK directory:
36#
37# - Create line in NEW_CONF/WORK
38# - Use specified sub-directories previously
39# - OCE has to be done first !!!
40#
41#
42# EXAMPLES
43# ========
44#
45# ::
46#
47#  $ ./Fmake_WORK.sh ORCA2_LIM OCE ICE
48#
49#
50# TODO
51# ====
52#
53# option debug
54#
55#
56# EVOLUTIONS
57# ==========
58#
59# $Id$
60#
61#
62#
63#   * creation
64#
65#-
66declare ZSRC=${@}
67ZCONF=${NEW_CONF}
68ZTAB=${NEM_SUBDIR[@]}
69declare i=0 ; declare NDIR=${#ZTAB[@]}
70
71echo 'Creating '${ZCONF}'/WORK = '${ZTAB[*]}' for '${ZCONF}
72
73[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC
74[   -d ${ZCONF}/WORK   ] || \mkdir ${ZCONF}/WORK
75
76for comp in ${ZTAB[*]}; do
77   find ${NEMO_DIR}/$comp -name *.[Ffh]90 -exec ln -sf {} ${ZCONF}/WORK \;
78done
79
80for ZDIR in ${ZSRC[@]}; do
81    if [ -d ${ZDIR} ] ; then
82      ln -sf ${ZDIR}/*.[Ffh]90 ${ZCONF}/WORK/.
83      echo ${ZDIR}' content is linked to '${ZCONF}/WORK
84    elif [ -d ${ZCONF}/${ZDIR} ] ; then
85      ln -rsf ${ZCONF}/${ZDIR}/*.[Ffh]90 ${ZCONF}/WORK/.
86      echo ${ZDIR}' content is linked to '${ZCONF}/WORK
87    else
88      ln -rsf ${ZCONF}/MY_SRC/*.[Ffh]90 ${ZCONF}/WORK/.
89      echo 'External directory for MY_SRC does not exist. Using default.'
90      echo 'MY_SRC content is linked to '${ZCONF}/WORK
91    fi
92done
93
94unset -v ZCONF ZTAB i NDIR
Note: See TracBrowser for help on using the repository browser.