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 branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE – NEMO

source: branches/nemo_v3_3_beta/NEMOGCM/TOOLS/COMPILE/Fmake_WORK.sh @ 2520

Last change on this file since 2520 was 2520, checked in by rblod, 13 years ago

Add in core documentation for compilation scripts

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 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 -x
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 lin 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 OPA_SRC LIM_SRC_2
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 ZCONF=$1 ; shift
67ZTAB=( $@ )
68declare i=0 ; declare NDIR=${#ZTAB[@]}
69
70echo "Creating ${ZCONF}/WORK = ${ZTAB[*]} for ${ZCONF}"
71echo ""
72
73[ ! -d ${ZCONF}/MY_SRC ] && \mkdir ${ZCONF}/MY_SRC
74[   -d ${ZCONF}/WORK   ] || \mkdir ${ZCONF}/WORK
75
76\rm -f ../${1}/WORK/*
77
78while [ $i -lt $NDIR ]
79do
80   [ "${ZTAB[i]}" = "OPA_SRC" ] && ln -sf ${NEMO_DIR}/OPA_SRC/*.[Ffh]90 ${ZCONF}/WORK
81   [ "${ZTAB[i]}" = "OPA_SRC" ] && ln -sf ${NEMO_DIR}/OPA_SRC/*/*.[Ffh]90 ${ZCONF}/WORK && break
82   let i=$i+1
83done
84
85i=0
86while [ $i -lt $NDIR ]
87do
88   if [ "${ZTAB[i]}" != "OPA_SRC" ]; then
89      ln -sf ${NEMO_DIR}/${ZTAB[i]}/*.[Ffh]90 ${ZCONF}/WORK
90      ln -sf ${NEMO_DIR}/${ZTAB[i]}/*/*.[Ffh]90 ${ZCONF}/WORK 2>/dev/null
91   fi
92   let i=$i+1
93done
94
95for i in `(cd ${ZCONF}/MY_SRC ; ls *.[Ffh]90 2>/dev/null ) `
96   do
97      [ -f ${ZCONF}/MY_SRC/$i ] &&  ln -sf $PWD/${ZCONF}/MY_SRC/${i} ${ZCONF}/WORK/.
98   done
99
100unset -v  ZCONF
101unset -v ZTAB
102unset -v  i
103unset -v NDIR
104
Note: See TracBrowser for help on using the repository browser.