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
RevLine 
[1542]1#!/bin/bash
[1755]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
[783]6
[4096]7if [[ -f '.lock' && $force_compile == false ]]
8then
[1755]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."
[4096]11    echo "If you are sure that you are not compiling elsewhere,"
12    echo "run makelmdz_fcm with option -force_compile"
13    exit 1
[1542]14fi
[783]15
[4096]16echo "compiling..." > '.lock'
17
[1802]18job=1
[1755]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}"/"
[1802]29  shift;
[1755]30fi
[783]31
[1755]32# run "fcm build" command
[1802]33${dirname}fcm build $*
[783]34
[3647]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
[1755]43# cleanup
[783]44\rm -f '.lock' 
[1542]45
Note: See TracBrowser for help on using the repository browser.