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.
fait_config in trunk/UTIL – NEMO

source: trunk/UTIL/fait_config @ 210

Last change on this file since 210 was 210, checked in by opalod, 19 years ago

RB :UPDATE147: - add a new script fait_config to choose a configuation and build the corresponding links

  • update fait_AA_make because we always check out all the sources
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1#!/bin/ksh
2
3######################################################
4# Author : Rachid benshila for ESOPA
5# Contact : opatlod@lodyc.jussieu.fr
6#
7# This script aims to create the OPA/WORK directory
8# and to link in the WORK the BB_make and BB_make.ldef
9# associated  to a chosen configuration
10#
11######################################################
12
13#- Config name ---
14# Add in LIST the name of a new configuration
15LIST="NEMO_ORCA2_LIM \nGYRE"
16
17#- Some tests ---
18d_n=$(dirname $0); b_n=$(basename $0);
19
20if   [ ${#} -gt 1 ]; then
21  echo 'Only one configuration can be specified in:' 1>&2;
22  echo $LIST 1>&2;
23  exit 3;
24elif [ ${#} -eq 1 ]; then
25   m_n="${1}"
26elif [ ${#} -eq 0 ]; then
27  echo 'You must specify one configuration in :' 1>&2;
28  echo $LIST 1>&2;
29  echo 'You can also complete fait_config to add a new one'
30  exit 3;
31fi
32
33#- Create the WORK
34d_m=`find ${d_n}/.. -name OPA`  ;
35[ -d ${d_m}/WORK ] || mkdir ${d_m}/WORK;
36cd ${d_m}/WORK
37[ -f Makefile ] && gmake clean
38[ -n "`\ls`" ] && \rm *
39
40#- Create the good links
41# Add your configuration in the case loop below
42# 1 .Name
43# 2. Directories needed
44# 3. Links you want to create
45# Example to add a GYRE_TRC config
46# Guess the is a directory modipsl/config/GYRE_TRC/scripts
47# with a BB_make inside
48# Insert :
49# ( GYRE_TRC )
50#         echo " Creating OPA/WORK = OCE_SRC + ICE_SRC + TRC_SRC for GYRE_TRC"
51#         DIR="OCE_SRC ICE_SRC TRC_SRC"
52#         ln -sf ../OCE_SRC/*.[Ffh]90          .
53#         ln -sf ../OCE_SRC/DYN/*.[Ffh]90      .
54#         ln -sf ../OCE_SRC/TRA/*.[Ffh]90      .
55#         ln -sf ../OCE_SRC/TRD/*.[Ffh]90      .
56#         ln -sf ../OCE_SRC/DIA/*.[Ffh]90      .
57#         ln -sf ../OCE_SRC/DOM/*.[Ffh]90      .
58#         ln -sf ../OCE_SRC/OBC/*.[Ffh]90      .
59#         ln -sf ../OCE_SRC/FLO/*.[Ffh]90      .
60#         ln -sf ../OCE_SRC/LDF/*.[Ffh]90      .
61#         ln -sf ../OCE_SRC/ZDF/*.[Ffh]90      .
62#         ln -sf ../OCE_SRC/SOL/*.[Ffh]90      .
63#         ln -sf ../OCE_SRC/DTA/*.[Ffh]90      .
64#         ln -sf ../OCE_SRC/SBC/*.[Ffh]90      .
65#         ln -sf ../ICE_SRC/*.[Ffh]90          . 
66#         \$(RM) *.passivetrc.h                 
67#         \$(RM) trcstp.F90                   
68#         \$(RM) trc_oce.F90                   
69#         ln -sf ../TRC_SRC/*.[Ffh]            .
70#         ln -sf ../TRC_SRC/*.[Ffh]90          .
71#         ln -sf ../TRC_SRC/SMS/*.[Ffh]        .
72#         ln -sf ../TRC_SRC/SMS/*.[Ffh]90      . 
73#         ln -sf ../TRC_SRC/TRP/*.[Ffh]90      . ;;
74
75
76case ${m_n} in
77
78( NEMO_ORCA2_LIM )
79         echo " Creating OPA/WORK = OCE_SRC + ICE_SRC for NEMO_ORCA2_LIM"
80         DIR="OCE_SRC ICE_SRC"
81         ln -sf ../OCE_SRC/*.[Ffh]90          .
82         ln -sf ../OCE_SRC/DYN/*.[Ffh]90      .
83         ln -sf ../OCE_SRC/TRA/*.[Ffh]90      .
84         ln -sf ../OCE_SRC/TRD/*.[Ffh]90      .
85         ln -sf ../OCE_SRC/DIA/*.[Ffh]90      .
86         ln -sf ../OCE_SRC/DOM/*.[Ffh]90      .
87         ln -sf ../OCE_SRC/OBC/*.[Ffh]90      .
88         ln -sf ../OCE_SRC/FLO/*.[Ffh]90      .
89         ln -sf ../OCE_SRC/LDF/*.[Ffh]90      .
90         ln -sf ../OCE_SRC/ZDF/*.[Ffh]90      .
91         ln -sf ../OCE_SRC/SOL/*.[Ffh]90      .
92         ln -sf ../OCE_SRC/DTA/*.[Ffh]90      .
93         ln -sf ../OCE_SRC/SBC/*.[Ffh]90      .
94         ln -sf ../ICE_SRC/*.[Ffh]90          .  ;;
95( GYRE )         
96         echo " Creating OPA/WORK = OCE_SRC + ICE_SRC for GYRE"
97         DIR="OCE_SRC ICE_SRC"
98         ln -sf ../OCE_SRC/*.[Ffh]90          .
99         ln -sf ../OCE_SRC/DYN/*.[Ffh]90      .
100         ln -sf ../OCE_SRC/TRA/*.[Ffh]90      .
101         ln -sf ../OCE_SRC/TRD/*.[Ffh]90      .
102         ln -sf ../OCE_SRC/DIA/*.[Ffh]90      .
103         ln -sf ../OCE_SRC/DOM/*.[Ffh]90      .
104         ln -sf ../OCE_SRC/OBC/*.[Ffh]90      .
105         ln -sf ../OCE_SRC/FLO/*.[Ffh]90      .
106         ln -sf ../OCE_SRC/LDF/*.[Ffh]90      .
107         ln -sf ../OCE_SRC/ZDF/*.[Ffh]90      .
108         ln -sf ../OCE_SRC/SOL/*.[Ffh]90      .
109         ln -sf ../OCE_SRC/DTA/*.[Ffh]90      .
110         ln -sf ../OCE_SRC/SBC/*.[Ffh]90      .
111         ln -sf ../ICE_SRC/*.[Ffh]90          .  ;;
112(*)
113         echo "Configuration "${m_n}" not supported" 1>&2;
114         echo 'Make your choice in :' 1>&2;
115         echo $LIST 1>&2;
116         echo 'You can also complete fait_config to add a new one'
117            exit 1;;
118esac
119    ln -sf ../../../*/${m_n}/scripts/BB_make AA_make ;
120    ln -sf ../../../*/${m_n}/scripts/BB_make.ldef AA_make.ldef ;
121
122# Building the standard list of source files
123     cat >.patron <<"EOF" 
124CVS
125SRC_PARAM
126SRC_FILE_LIST
127tmplist
128AA_make
129KEY_CPP
130Makefile
131*?.o
132 i.?*
133*?.L
134.patron
135bloc.com
136para.com
137defcst.f
138fontbc.f
139icdyna.f
140thersf.f
141EOF
142     ls -1 | fgrep -v -f .patron  >SRC_FILE_LIST ; cp SRC_FILE_LIST SRC_FILE_LIST.temp ;
143#
144     KEY=$(grep P_P AA_make.ldef);
145     [ -f "KEY_CPP" ] || echo $KEY > KEY_CPP;
146 
147   echo ${m_n} ${DIR} >.config
148
149exit 0;
Note: See TracBrowser for help on using the repository browser.