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 @ 15186

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

simplify commit done at r14979 (#2689) and restore MY_SRC subdir links introduced at r13528

  • 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 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        d=${ZDIR}
83    elif [ -d ${ZCONF}/${ZDIR} ] ; then
84        d=${ZCONF}/${ZDIR}
85    else
86        d=${ZCONF}/MY_SRC
87        echo 'External directory for MY_SRC unspecified or does not exist. Using default.'
88    fi
89
90    for ff in `(find ${d} -name *.[Ffh]90 2>/dev/null)`
91    do
92        f=`basename $ff`
93        ln -sf $ff ${ZCONF}/WORK/.
94    done
95    echo ${d}' content is linked to '${ZCONF}/WORK
96done
97
98unset -v ZCONF ZTAB NDIR
Note: See TracBrowser for help on using the repository browser.