source: BOL/script_install/instal1d.sh @ 1835

Last change on this file since 1835 was 1726, checked in by Laurent Fairhead, 11 years ago

Inclusion d'un nom générique pour récupérer la version voulue du lmdz1d_source*tar.gz


Implementation of a generic name to download the required version of the lmdz1d_source*tar.gz file

  • Property svn:executable set to *
File size: 4.9 KB
Line 
1#!/bin/ksh
2
3###############################################################################
4# Script for installing a 1D version of LMDZ.
5# LMDZ team. For questions : lmdz-svp@lmd.jussieu.fr
6# valid for svn version from 21/12/2012 (end of the world) or svn 1700
7#
8# 1) Modifies the directory LMDZ.../modipsl/modeles/LMDZ5/libf/phy1d
9# which  contains the single column version of the model.
10# 2) installs a series of test cases on LMDZ.../1dcases/
11# 3) compile the lmdz1.F with vertical resolution L39 and L40
12# 4) runs a subset of the cases
13###############################################################################
14
15# Check in ~lmdz/WWW/DistribG95 which 1d version to use
16version1d=20130225
17modele=""
18if [ "$modele" = "" ] ; then
19   if [ -f install.sh ] ; then
20      version=`sed -n "s/version=//p" install.sh | tail -1`
21      echo $version
22      modele=`pwd`/LMDZ${version}
23   elif [ -d modipsl ] ; then
24      modele=`pwd`
25   else
26      echo "You should run instal1d.sh either in the directory"
27      echo "containing install.sh, or in that containing modipsl"
28      echo "or specify the path of LMDZ. modele=LMDZ... in instal1d.sh"
29      exit
30   fi
31fi
32
33###############################################################################
34# Paths of main directories
35# Directories of simulations will be placed in
36# $modele/1dcases
37# Sources of physical routines in  $modele/modipsl/modeles/LMDZ5/libf/phy1d
38###############################################################################
39cd $modele
40LMDGCM=`pwd`
41LMDlibf=$LMDGCM/modipsl/modeles/LMDZ5/libf/
42
43###############################################################################
44# Check if the svn version is more recent than 1700
45# If not, an  older script must be used
46###############################################################################
47cd $LMDGCM/modipsl/modeles
48new1d=`svn info LMDZ5 | grep Revision | awk ' { fl = 0 ; if ( $2 > 1699 )  fl=1 ; print fl } '`
49echo new1d $new1d
50if [ $new1d = 0 ] ; then
51   echo Your model verison is too old for this instal1d.sh script
52   echo You should use instead
53   echo http://www.lmd.jussieu.fr/~lmdz/Distrib/install_old_archive/instal1d.sh
54   exit
55fi
56
57###############################################################################
58# Downloading modified source files and input files
59###############################################################################
60cd $LMDGCM
61interne=no # can be modified once the files have been downloaded
62           # in order to take them directly on your computer
63if [ $interne = no ] ; then
64   wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/lmdz1d_source_${version1d}.tar.gz
65   tar xvfz lmdz1d_source_${version1d}.tar.gz
66   rm -f lmdz1d_source_${version1d}.tar.gz
67   source=${LMDGCM}/lmdz1d_source_${version1d}
68else
69   cp -a /home/jygz/LMDZ/SLMDZ/LMDZ5_source_20120112/lmdz1d_source_20120112 .
70   source=${LMDGCM}/lmdz1d_source_20120112
71fi
72
73################################################################################
74# Creating directory for 1d cases
75################################################################################
76if [ -f 1dcases ] ; then
77  echo '1dcases existe deja'
78  echo 'on continue'
79else
80  echo 'creation du directory 1dcases'
81  mkdir 1dcases
82fi
83cd 1dcases
84
85for cas in ayotte eq_rd_cv case_e hapex92_init twpice toga rico arm_cu ; do
86   if [ -f $cas ] ; then
87      echo $cas existe deja
88      echo 'on continue, mais il  faudra verifier qu il ne manque rien dans '$cas
89   else
90      echo 'creation du directory de simulation '$cas
91      cp -a ${source}/$cas .
92   fi
93   dir $cas
94done
95
96
97
98################################################################################
99# Installing source files and compiling
100################################################################################
101cd $LMDlibf
102chmod +x ../tools/install_1d_src.sh
103../tools/install_1d_src.sh
104
105##   Nettoyage
106\rm -r ${source}
107#
108cd ${LMDlibf}/..
109\rm -f makefile
110./makegcm -d 39 -p 1d lmdz1d
111if [ -f lmdz1d.e ] ; then
112   mv lmdz1d.e lmdz1d_L39.e
113 echo Compilation successfull
114 for rep in ayotte case_e eq_rd_cv hapex92_init rico toga twpice ; do
115    ln -s `pwd`/lmdz1d_L39.e ${LMDGCM}/1dcases/$rep/lmdz1d.e
116 done
117else
118 echo Compilation aborted
119 stop
120fi
121
122echo '#########################################################################'
123echo '   1D test cases'
124echo '#########################################################################'
125
126echo ====================================
127echo TEST CASE : case_e
128echo ====================================
129cd ${LMDGCM}/1dcases/case_e
130./xqt.x NPv3.1
131
132echo ====================================
133echo TEST CASE : toga' (1 month)'
134echo ====================================
135cd ${LMDGCM}/1dcases/toga
136./xqt.x NPv3.1
137
138armcu=1
139if [ $armcu = 1 ] ; then
140   echo ====================================
141   echo TEST CASE : arm_cu
142   echo ====================================
143   cd ${LMDGCM}/1dcases/arm_cu
144   ./compile.x
145   ln -s lmdz1d_L40.e lmdz1d.e
146   ./xqt.x NPv3.1
147fi
148
149echo if the last line \"SIMULATION FINISHED\" is \"Everything is cool!\", the situation went to its end
150
151
152
Note: See TracBrowser for help on using the repository browser.