source: BOL/script_install/instal1d.sh @ 1704

Last change on this file since 1704 was 1704, checked in by Laurent Fairhead, 12 years ago

Simplified version for svn >=1700
FH

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