source: LMDZ6/trunk/build_gcm @ 4096

Last change on this file since 4096 was 4096, checked in by lguez, 2 years ago

Add option -force_compile to makelmdz_fcm

Instead of asking the user to answer a question interactively, stop
makelmdz_fcm and inform of the possible use of option
-force_compile. The interactive question risked being hidden in
redirection of standard output.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1#!/bin/bash
2# Usage:
3# ./build_gcm [path]
4# where 'path' is an optional argument to this script specifying
5# the full path to where the 'fcm' command is to be found
6
7if [[ -f '.lock' && $force_compile == false ]]
8then
9    echo "WARNING: you are probably already compiling the model somewhere else."
10    echo "Wait until the first compilation is finished before launching this one."
11    echo "If you are sure that you are not compiling elsewhere,"
12    echo "run makelmdz_fcm with option -force_compile"
13    exit 1
14fi
15
16echo "compiling..." > '.lock'
17
18job=1
19dirname="" #path to where the fcm command will be found
20if (( $# >= 1 )) ; then
21  dirname=$1
22  # check that "dirname" exists and is a directory
23  if [[ ! -d $dirname ]] ; then
24    echo "$0 error : $dirname is not a directory"
25    exit
26  fi
27  # add a trailing "/" to $dirname
28  dirname=${dirname}"/"
29  shift;
30fi
31
32# run "fcm build" command
33${dirname}fcm build $*
34
35err=$?
36# Check error message from fcm build
37if [ $err != 0 ] ; then
38  # ERROR IN COMPILING
39  echo ERROR IN COMPILING LMDZ : $err
40  exit 1
41fi
42
43# cleanup
44\rm -f '.lock' 
45
Note: See TracBrowser for help on using the repository browser.