source: BOL/script_install/creation_modipsl.sh @ 4238

Last change on this file since 4238 was 4197, checked in by Laurent Fairhead, 2 years ago

Resolving issue when using oldrad with the default bench suite

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