source: BOL/script_install/instal1d.sh @ 2035

Last change on this file since 2035 was 2035, checked in by fhourdin, 10 years ago

new tar file

  • Property svn:executable set to *
File size: 6.0 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
15PATH=~/bin:$PATH
16
17armcu=1
18toga=1
19twpice=1
20
21# Check in ~lmdz/WWW/DistribG95 which 1d version to use
22version1d=20140428
23modele=""
24if [ "$modele" = "" ] ; then
25   if [ -f install.sh ] ; then
26      version=`sed -n "s/^version=//p" install.sh | tail -1`
27      echo $version
28      modele=`pwd`/LMDZ${version}
29   elif [ -d modipsl ] ; then
30      modele=`pwd`
31   else
32      echo "You should run instal1d.sh either in the directory"
33      echo "containing install.sh, or in that containing modipsl"
34      echo "or specify the path of LMDZ. modele=LMDZ... in instal1d.sh"
35      exit
36   fi
37fi
38
39###############################################################################
40# Paths of main directories
41# Directories of simulations will be placed in
42# $modele/1dcases
43# Sources of physical routines in  $modele/modipsl/modeles/LMDZ5/libf/phy1d
44###############################################################################
45cd $modele
46LMDGCM=`pwd`
47LMDlibf=$LMDGCM/modipsl/modeles/LMDZ5/libf/
48
49###############################################################################
50# Check if the svn version is more recent than 1700
51# If not, an  older script must be used
52###############################################################################
53cd $LMDGCM/modipsl/modeles
54new1d=`svn info LMDZ5 | grep Revision | awk ' { fl = 0 ; if ( $2 > 1699 )  fl=1 ; print fl } '`
55echo new1d $new1d
56if [ $new1d = 0 ] ; then
57   echo Your model verison is too old for this instal1d.sh script
58   echo You should use instead
59   echo http://www.lmd.jussieu.fr/~lmdz/Distrib/install_old_archive/instal1d.sh
60   exit
61fi
62
63###############################################################################
64# Downloading modified source files and input files
65###############################################################################
66cd $LMDGCM
67interne=no # can be modified once the files have been downloaded
68           # in order to take them directly on your computer
69if [ $interne = no ] ; then
70   wget http://www.lmd.jussieu.fr/~lmdz/DistribG95/lmdz1d_source_${version1d}.tar.gz
71   tar xvfz lmdz1d_source_${version1d}.tar.gz
72   rm -f lmdz1d_source_${version1d}.tar.gz
73   source=${LMDGCM}/lmdz1d_source_${version1d}
74else
75   cp -a /home/jygz/LMDZ/SLMDZ/LMDZ5_source_20120112/lmdz1d_source_20120112 .
76   source=${LMDGCM}/lmdz1d_source_20120112
77fi
78
79################################################################################
80# Creating directory for 1d cases
81################################################################################
82if [ -d 1dcases ] ; then
83  echo '1dcases existe deja'
84  echo 'on continue'
85else
86  echo 'creation du directory 1dcases'
87  mkdir 1dcases
88fi
89cd 1dcases
90
91for cas in amma arm_cu ayotte case_e eq_rd_cv fire hapex92_init rico toga sanduref sandufast sanduslow twpice ; do
92   if [ -d $cas ] ; then
93      echo $cas existe deja
94      echo 'on continue, mais il  faudra verifier qu il ne manque rien dans '$cas
95   else
96      echo 'creation du directory de simulation '$cas
97      cp -a ${source}/$cas .
98   fi
99   dir $cas
100done
101
102
103
104################################################################################
105# Installing source files and compiling
106################################################################################
107cd $LMDlibf
108chmod +x ../tools/install_1d_src.sh
109../tools/install_1d_src.sh
110
111##   Nettoyage
112\rm -r ${source}
113#
114cd ${LMDlibf}/..
115\rm -f makefile
116./makelmdz -d 39 -p 1d lmdz1d
117if [ -f lmdz1d.e ] ; then
118   mv lmdz1d.e lmdz1d_L39.e
119 echo Compilation successfull
120 for cas in amma ayotte case_e eq_rd_cv fire hapex92_init rico toga sanduref sandufast sanduslow twpice ; do
121    rm -f ${LMDGCM}/1dcases/$cas/lmdz1d.e
122    ln -s `pwd`/lmdz1d_L39.e ${LMDGCM}/1dcases/$cas/lmdz1d.e
123 done
124else
125 echo Compilation aborted
126 exit
127fi
128
129echo '#########################################################################'
130echo '   1D test cases'
131echo '#########################################################################'
132
133if [ $toga = 1 ] ; then
134echo ====================================
135echo TEST CASE : toga' (1 month)'
136echo ====================================
137echo if the last line \"SIMULATION FINISHED\" is \"Everything is cool!\", the situation went to its end
138cd ${LMDGCM}/1dcases/toga
139./xqt.x NPv3.1
140\rm tmp.jnl ; touch tmp.jnl
141rm -f var.gif
142cat <<eod>> tmp.jnl
143use histhf_NPv3.1.nc
144shade/title="cas toga: cloud fraction (-)" rneb
145frame/file=var.gif
146eod
147ferret <<eod
148go tmp.jnl
149quit
150eod
151display var.gif :&
152rm -f tmp.jnl
153rm -f var.gif
154cd ..
155fi
156
157if [ $twpice = 1 ] ; then
158echo ====================================
159echo TEST CASE : twpice
160echo ====================================
161echo if the last line \"SIMULATION FINISHED\" is \"Everything is cool!\", the situation went to its end
162cd twpice
163./xqt.x NPv3.1
164\rm tmp.jnl ; touch tmp.jnl
165rm -f var.gif
166cat <<eod>> tmp.jnl
167use histhf_NPv3.1.nc
168shade/title="cas twpice: cloud fraction (-)" rneb
169frame/file=var.gif
170eod
171ferret <<eod
172go tmp.jnl
173quit
174eod
175display -remote var.gif :&
176rm -f tmp.jnl
177rm -f var.gif
178cd ..
179fi
180
181if [ $armcu = 1 ] ; then
182echo ====================================
183echo TEST CASE : arm_cu
184echo ====================================
185echo if the last line \"SIMULATION FINISHED\" is \"Everything is cool!\", the situation went to its end
186cd arm_cu
187./compile.x
188ln -s lmdz1d.e lmdz1d_L40.e
189./xqt.x NPv3.1
190\rm tmp.jnl ; touch tmp.jnl
191rm -f var.gif
192cat <<eod>> tmp.jnl
193use histhf_NPv3.1.nc
194shade/title="cas arm_cu: cloud fraction (-)" rneb
195frame/file=var.gif
196eod
197ferret <<eod
198go tmp.jnl
199quit
200eod
201display -remote var.gif :&
202rm -f tmp.jnl
203rm -f var.gif
204cd ..
205fi
206
Note: See TracBrowser for help on using the repository browser.