source: BOL/script_install/creation_modipsl.sh @ 4502

Last change on this file since 4502 was 4468, checked in by Laurent Fairhead, 16 months ago

IOIPSL updated to version 2.2.5

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 7.6 KB
Line 
1#!/bin/bash
2
3#set -vx
4unset LANG
5
6#####################################################################
7# Choix eventuel de la version : branche ou trunk et svn particuliere
8# Le script est lancé tous les soirs par un script sur lmdz-cq par lmdz
9# On peut aussi le relancé depuis la même machine en interactif
10# si le trusting de la nuit a échoué, soit que la raison soit extérieure
11# au modèle, soit qu'on fasse une correction svn entre temps :
12#   ./creation_modipsl.sh -force -latest 20221004
13# où la dernière version ayant marché est 20221004.trunk
14#####################################################################
15
16branche=IPSLCM6.0.15
17branche=trunk
18rev="-r 4370"
19rev=""
20latest="20221201"
21latest=""
22#latest=20210512 # Pour imposer de tester la convergence avec une version passee
23
24TMP_D=/tmp/lmdz ; mkdir -p $TMP_D
25
26if [ $branche != trunk ] ; then
27    echo cas non prevu
28#     exit
29fi
30
31check=0
32check=1 # On verifie un certain nombre de choses.
33force=0
34
35optionnel=" -cpp ORCHIDEE_NOZ0H "
36
37local=`pwd`
38while (($# > 0)) ; do
39  case $1 in
40      "-h") cat <<fin
41USAGE creation_modipsl.sh
42Crée les archives du modele pour installation par install.sh
43-force : pour créeer une seconde version le meme jour
44fin
45        exit ;;
46      "-force") force=1 ; shift ;;
47      "-r") rev="-r $2" ; shift ; shift ;;
48      "-b") branche="$2" ; shift ; shift ;;
49      "-latest") latest=$2 ; shift ; shift ;;
50      *) echo option non prevue ; ./creation_modipsl.sh -h ; exit
51  esac
52done
53
54# machine_cible=erskine.lmd.jussieu.fr
55#machine_cible=carey
56machine_cible=lmdz-cq
57if [ "`hostname`" != "$machine_cible" ] ; then echo Lancer sur $machine_cible ; exit ; fi
58set -ex
59
60###########################################################################
61# localisation svn
62###########################################################################
63# cvs -d :pserver:lmdzbrowse@cvs.lmd.jussieu.fr:/home/cvsroot checkout LMDZ5
64LMDZv=LMDZ6
65if [ $LMDZv = LMDZ6 ] ; then
66   LMDZ=LMDZ
67else
68   LMDZ=LMDZ5
69fi
70
71if [ $branche == trunk ] ; then
72   branchepath=trunk
73else
74   branchepath=branches/$branche
75fi
76svnmodel=https://svn.lmd.jussieu.fr/LMDZ/$LMDZv/$branchepath
77
78
79##########################################################################
80# Recuperation des infos svn pour le choix du nom du modele
81##########################################################################
82echo svn info $rev $svnmodel :
83svn info $rev $svnmodel
84datesvn=`svn info $rev $svnmodel | grep "Last Changed Date" | awk ' { print $4 } ' | sed -e 's/-//g'`
85echo DATESVN $datesvn
86
87if [  "$datesvn" = "" ] ; then
88#    DATESVN vide
89    datesvn=`svn info https://svn.lmd.jussieu.fr/LMDZ/$LMDZv/$branchepath $rev | grep 'Date de la dern' | awk ' { print $6 } '  | sed -e 's/-//g'`
90fi
91echo datesvn $datesvn
92version=$datesvn.$branche
93echo version $version
94
95##########################################################################
96# Sauvegarde eventuelle de la version precedente si deux versions
97# sont creees le meme jour
98##########################################################################
99if [ -f modipsl.$version.tar.gz ] ; then
100   if [ $force = 1 ] ; then
101      if [ -d $TMP_D/LMDZ$version ] ; then mv -f $TMP_D/LMDZ$version $TMP_D/LMDZ${version}_$$ ; fi
102      cd /home/users/lmdz/WWW/RESUBENCH/$branche/gfortran
103      if [ -f ${datesvn} ] ; then mv -f ${datesvn} ${datesvn}_$$ ; fi
104      ln -sf ${datesvn}_$$ latest
105      cd $local
106      if [ -f modipsl.$version.tar.gz ] ; then mv modipsl.$version.tar.gz modipsl.${version}_$$.tar.gz ; fi
107      echo ${datesvn} ${datesvn}_$$
108    else
109      echo Le fichier modipsl.$version.tar.gz existe deja
110      echo Preparer un changement automatique de nom pour automatiser
111      echo la creation de plusieurs versions dans la journee
112      exit
113    fi
114fi
115
116
117if [ "$latest" != "" ] ; then
118   cd /home/users/lmdz/WWW/RESUBENCH/$branche/gfortran
119   \rm -f latest
120   ln -s `pwd`/$latest latest
121   cd -
122fi
123
124#####################################################################
125# Les fichiers modipsl.vN.tar.gz contiennent des versions successives
126# de IOIPSL
127# Les versions modipsl.20080305.v5.tar.gz contiennent des versions
128# successives avec de modipsl les dates correspondant a des versions
129# successives de LMDZ4 puis LMDZ5
130#####################################################################
131vorig=v8  # updated version of IOIPSL 04/04/2012, including 'rebuild' script
132vorig=v9  # updated version of IOIPSL 07/08/2013, modfication de AA_male.ldef pour g95
133vorig=v10 # 'rebuild' is reintroduced in v9 . Was lost even in v8 ... (FH)
134vorig=v11 # update ORCHIDEE version to r2247, changes needed in install.sh for ORCHIDEE compilation
135vorig=v12 # modification AA_make.gdef pour ada. on garde g95 pour install alors qu'il a disparu dans modipsl
136vorig=v13 # mise a jour ORCHIDEE (r3013) pour problème d'interface après le rajout de sinang=rmu0 dans surf_land_orchidee_mod.F90
137vorig=v14 # dans ioipsl/histcom.f9, nb_var_max : 600 -> 1OOO, nb_zax_max : 5 -> 100, flio_max_dims : 15 -> 50 pour rebuild cosp
138vorig=v15 # modifications pour tenir compte de jean-zay nouvelle machine Idris
139vorig=v16 # 2022/02/17 on bascule sur orchidee CMIP6
140vorig=v18 # 2023/03/09 modification ORCHIDEE pour compatibilité IOIPSL: on rajoute 360_day comme attribut
141vorig=v19 # 2023/03/10 IOIPSL updated to version 2.2.5
142
143modipsltar=modipsl.$vorig.tar
144
145##### tmpdir=/tmp/tmpmodipsl$$
146tmpdir=$local/tmpmodipsl$$
147mkdir -p $tmpdir
148cd $tmpdir
149if [ -f /u/lmdz/WWW/Distrib/$modipsltar.gz ] ; then
150   cp /u/lmdz/WWW/Distrib/$modipsltar.gz .
151else
152   wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$modipsltar.gz
153fi
154
155tar xvf $modipsltar.gz
156#gzip -9 $modipsltar
157
158readme_file=Readme_LMDZ$version.md
159
160cat > $readme_file <<eod
161This model was downloaded from
162http://www.lmd.jussieu.fr/~lmdz/pub/src_archives/unstable/modipsl.$version.tar.gz
163
164It was insalled with the \`install_lmdz.sh\` soft
165
166In order to see all the available versions, check
167http://www.lmd.jussieu.fr/~lmdz/pub/src_archives/unstable/Readme
168
169``
170eod
171
172cd modipsl/modeles
173
174###########################################################################
175# On effectue le svn checkout sur une machine avec un ancien svn
176# pour eviter que les utilisateurs se retrouvent avec un svn plus ancien
177# que celui sur lequel la version a été créée.
178echo Premier svn checkout $rev $svnmodel $LMDZ
179#ssh butler ' ( cd '`pwd`' ; svn checkout '$rev' '$svnmodel' '$LMDZ' ) '
180echo svn checkout $rev $svnmodel $LMDZ 
181svn checkout $rev $svnmodel $LMDZ 
182svn info LMDZ   >> ../../$readme_file
183echo '``'       >> ../../$readme_file
184
185###########################################################################
186
187cd -
188echo $version
189tar cvf modipsl.$version.tar modipsl $readme_file
190
191gzip modipsl.$version.tar
192mv modipsl.$version.tar.gz ~/WWW/Distrib
193
194cd  ~/WWW/Distrib
195ln -sf modipsl.$version.tar.gz modipsl.$branche.tar.gz
196cd ~/WWW/pub/src_archives/unstable/
197
198# Ajout pour la nouvelle arborescence
199ln -sf ../../../Distrib/modipsl.$version.tar.gz .
200ln -sf modipsl.$version.tar.gz modipsl.$branche.tar.gz
201cd  ~/WWW/Distrib
202
203
204####################################################################
205# La partie ci-dessous concerne le check des versions.
206# On devrait sans doute appeler rechech.sh
207####################################################################
208
209if [ $check = 1 ] ; then
210   ./check_version.sh $version  >| WORK/check.out.$version 2>&1
211   cat tmp.resu >> Correspondance
212   cat tmp.resu >> LISMOI.$branche
213   \cp -f LISMOI.trunk ../pub/src_archives/Readme
214###
215### clean up of /tmp/lmdz if everything went smoothly
216###
217grep -q 'OK     OK      OK2     OK' tmp.resu
218RET=$?
219   if [ ${RET} -eq 0 ] ; then
220      echo "Quality control checks out for version $version"
221      echo "We could cleanup /tmp/lmdz/LMDZ$version" 
222      echo "\rm -rf /tmp/lmdz/LMDZ$version" 
223      \rm -rf /tmp/lmdz/LMDZ$version
224   fi
225fi
Note: See TracBrowser for help on using the repository browser.