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

Last change on this file since 9651 was 9651, checked in by nicolasmartin, 3 years ago

Reorganisation plan for NEMO repository: add missing modifications from previous commit

  • 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# - OPA 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=$1 ; shift
67declare ZCONF=$1 ; shift
68ZTAB=( $@ )
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
76if [ "${ZSRC}" != 'none' ] ; then
77
78   if [ -d ${ZSRC} ] ; then
79      ln -sf ${ZSRC}/*.[Ffh]90 ${ZCONF}/MY_SRC/.
80      echo 'MY_SRC content is linked to '${ZSRC}
81   else
82      echo 'External directory for MY_SRC does not exist. Using default.'
83   fi
84
85else
86   echo 'MY_SRC directory is : '${ZCONF}'/MY_SRC'
87fi
88
89#\rm -f ../${1}/WORK/*
90
91for comp in ${ZTAB[*]}; do
92   find ${NEMO_DIR}/$comp -name *.[Ffh]90 -exec ln -sf {} ${ZCONF}/WORK \;
93done
94
95for i in `(cd ${ZCONF}/MY_SRC ; \ls *.[Ffh]90 2>/dev/null ) `; do
96   [ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/.
97done
98
99unset -v ZCONF ZTAB i NDIR
Note: See TracBrowser for help on using the repository browser.