Ignore:
Timestamp:
Oct 9, 2012, 3:35:26 PM (12 years ago)
Author:
Laurent Fairhead
Message:

Version testing basée sur la r1628

http://lmdz.lmd.jussieu.fr/utilisateurs/distribution-du-modele/versions-intermediaires


Testing release based on r1628

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/grid/dimension/makdim

    r1146 r1665  
    1 for i in $* ; do
    2    list=$list.$i
     1#!/bin/bash
     2#set -xv
     3
     4# sanity check: do we have the required argument ?
     5if (( $# < 1 )) || (( $# > 3 ))
     6then
     7 echo "Wrong number of parameters in $0 !!!"
     8 echo " Usage:"
     9 echo "  $0 [im] [jm] lm"
     10 echo " where im, jm and lm are the dimensions"
     11 exit
     12fi
     13
     14# build "fichnom", the relevant 'dimensions.im.jm.lm' file name
     15for i in $*
     16  do
     17  list=$list.$i
    318done
    419fichdim=dimensions${list}
    520
    6 if [ ! -f $fichdim ] ; then
    7 # si le fichier de dimensions n'existe pas, on le cree
     21if [ ! -f $fichdim ]
     22    then
     23#    echo "$fichdim does not exist"
    824
    9   if [ $# -ge 3 ] ; then
    10      im=$1
    11      jm=$2
    12      lm=$3
    13      n2=$1
    14      ndm=1
     25    # assign values of im, jm and lm
     26    if [ $# -ge 3 ]
     27        then
     28        im=$1
     29        jm=$2
     30        lm=$3
     31        ndm=1
     32    elif [ $# -ge 2 ]
     33        then
     34        im=1
     35        jm=$1
     36        lm=$2
     37        ndm=1
     38    elif [ $# -ge 1 ]
     39        then
     40        im=1
     41        jm=1
     42        lm=$1
     43        ndm=1
     44    fi
    1545
    16 # Le test suivant est commente car il est inutile avec le nouveau
    17 # filtre filtrez. Attention avec le "vieux" filtre (F. Forget,11/1994)
    18 #
    19 #     while [ "$n2" -gt 2 ]; do
    20 #       n2=`expr $n2 / 2`
    21 #       ndm=`expr $ndm + 1`
    22 #       echo $n2
    23 #    done
    24 #    if [ "$n2" != 2 ] ; then
    25 #       echo le nombre de longitude doit etre une puissance de 2
    26 #       exit
    27 #    fi
    28 
    29 
    30   else if [ $# -ge 2 ] ; then
    31       im=1
    32       jm=$1
    33       lm=$2
    34       ndm=1
    35   else if [ $# -ge 1 ] ; then
    36       im=1
    37       jm=1
    38       lm=$1
    39       ndm=1
    40   else
    41          echo il faut au moins une dimension
    42          exit
    43   fi
    44 fi
    45 fi
    46 
     46# since the file doesn't exist, we create it
    4747cat << EOF > $fichdim
    4848!-----------------------------------------------------------------------
     
    6262fi
    6363
     64# remove 'old' dimensions.h file (if any) and replace it with new one
     65if [ -f ../dimensions.h ] ; then
    6466\rm ../dimensions.h
     67fi
    6568tar cf - $fichdim | ( cd .. ; tar xf - ; mv $fichdim dimensions.h )
     69# line above is a trick to preserve time of creation of dimensions.h files
Note: See TracChangeset for help on using the changeset viewer.