[1445] | 1 | #! /bin/bash |
---|
| 2 | |
---|
| 3 | ################################ |
---|
| 4 | # A. Spiga 09/06/2015 |
---|
| 5 | # Install the LMD mesoscale model |
---|
| 6 | ################################ |
---|
[1456] | 7 | # prerequisite: NETCDF |
---|
[1447] | 8 | # -- NETCDF env variable |
---|
| 9 | ################################ |
---|
[1445] | 10 | ## name of the folder |
---|
| 11 | name="MESORUN" |
---|
| 12 | ## machine on which you will compile |
---|
| 13 | machine="CICLAD" |
---|
| 14 | ## fortran compiler used |
---|
| 15 | fortcom="ifort" |
---|
| 16 | ## server for sources |
---|
| 17 | where_is_svn="http://svn.lmd.jussieu.fr/Planeto/trunk/" |
---|
| 18 | ## grid definition for GCM |
---|
[1455] | 19 | dimgcm="64x48x29" |
---|
[1447] | 20 | ## location of static data |
---|
| 21 | webrepo="http://data.spiga.fr/mesoscale_model/STATIC_DATA/" |
---|
[1445] | 22 | ################################ |
---|
| 23 | |
---|
| 24 | ## ----------------------------- |
---|
| 25 | ## import settings and structure |
---|
| 26 | ## ----------------------------- |
---|
[1447] | 27 | echo "*** get structure" |
---|
| 28 | rm -rf $name > /dev/null 2> /dev/null |
---|
[1455] | 29 | svn -q co $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN" $name |
---|
[1445] | 30 | refrepo=$PWD/$name |
---|
[1447] | 31 | ## fill here user input to obtain independent script |
---|
| 32 | case ${fortcom} in |
---|
| 33 | "ifort") echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;; |
---|
| 34 | esac |
---|
[1445] | 35 | |
---|
[1447] | 36 | ## ---------------- |
---|
| 37 | ## create code repo |
---|
| 38 | ## ---------------- |
---|
| 39 | echo "*** get SVN repository" |
---|
[1445] | 40 | \rm $refrepo/code |
---|
[1447] | 41 | svn -q co -N $where_is_svn $refrepo/code |
---|
| 42 | |
---|
| 43 | ## ------------ |
---|
| 44 | ## get GCM code |
---|
| 45 | ## ------------ |
---|
| 46 | echo "*** get GCM code" |
---|
[1445] | 47 | cd $refrepo/code |
---|
[1447] | 48 | svn -q update LMDZ.MARS |
---|
| 49 | svn -q update LMDZ.COMMON |
---|
[1456] | 50 | cd $refrepo/code/LMDZ.COMMON |
---|
| 51 | svn -q co http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2 |
---|
| 52 | ln -sf FCM_V1.2/bin/fcm . |
---|
[1445] | 53 | |
---|
[1447] | 54 | ## -------------- |
---|
| 55 | ## compile IOIPSL |
---|
| 56 | ## -------------- |
---|
| 57 | log=$refrepo/code/logcompile_ioipsl |
---|
| 58 | echo "*** compile IOIPSL: check progress in "$log |
---|
| 59 | rm -rf $log ; touch $log |
---|
| 60 | cd $refrepo/code/LMDZ.COMMON/ioipsl |
---|
| 61 | ./install_ioipsl_$fortcom".bash" > $log 2> $log |
---|
[1445] | 62 | |
---|
[1447] | 63 | ## ----------- |
---|
| 64 | ## compile GCM |
---|
| 65 | ## ----------- |
---|
| 66 | log=$refrepo/code/logcompile_gcm |
---|
| 67 | echo "*** compile GCM: check progress in "$log |
---|
| 68 | rm -rf $log ; touch $log |
---|
[1445] | 69 | cd $refrepo/code/LMDZ.COMMON |
---|
[1447] | 70 | ./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine$fortcom -parallel mpi -p mars gcm > $log 2> $log |
---|
[1445] | 71 | cd $refrepo/gcm |
---|
| 72 | \rm gcm.e |
---|
[1447] | 73 | ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm"_phymars_para.e" gcm.e |
---|
[1445] | 74 | |
---|
[1447] | 75 | ## ---------------------- |
---|
| 76 | ## get and make mesoscale |
---|
| 77 | ## ---------------------- |
---|
| 78 | echo "*** get and compile mesoscale" |
---|
| 79 | cd $refrepo/code |
---|
| 80 | svn update MESOSCALE > /dev/null |
---|
[1445] | 81 | cd $refrepo/code/MESOSCALE/LMD_MM_MARS |
---|
[1447] | 82 | ls $refrepo/mesoin |
---|
| 83 | if [[ "$?" == 0 ]] ; then |
---|
| 84 | ./makemeso -p < $refrepo/mesoin |
---|
| 85 | else |
---|
| 86 | ./makemeso -p |
---|
| 87 | fi |
---|
| 88 | rm -rf $refrepo/mesoin |
---|
| 89 | rm -rf $refrepo/code_compiled |
---|
[1445] | 90 | ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/LATEST $refrepo/code_compiled |
---|
| 91 | |
---|
| 92 | ## ------------------------------- |
---|
| 93 | ## make ini&bdy tools in mesoscale |
---|
| 94 | ## ------------------------------- |
---|
[1447] | 95 | echo "*** compile initialization tools" |
---|
[1445] | 96 | cd $refrepo/code_compiled |
---|
| 97 | ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/prepare_ini . |
---|
[1447] | 98 | ./prepare_ini > /dev/null |
---|
| 99 | ## |
---|
[1445] | 100 | cd $refrepo/code_compiled/PREP_MARS |
---|
| 101 | ./compile"_"$fortcom |
---|
[1447] | 102 | ## |
---|
[1445] | 103 | cd $refrepo/code_compiled/WPS |
---|
[1447] | 104 | ls $refrepo/wpsin |
---|
| 105 | if [[ "$?" == 0 ]] ; then |
---|
| 106 | ./configure < $refrepo/wpsin > /dev/null 2> /dev/null |
---|
| 107 | else |
---|
| 108 | ./configure |
---|
| 109 | fi |
---|
| 110 | rm -rf $refrepo/wpsin |
---|
| 111 | rm -rf logcompile |
---|
| 112 | ./compile > logcompile 2>&1 |
---|
| 113 | |
---|
| 114 | ## ------------------ |
---|
| 115 | ## import static data |
---|
| 116 | ## ------------------ |
---|
| 117 | echo "*** get static data" |
---|
| 118 | rm -rf $refrepo/data_static |
---|
| 119 | svn co -q $where_is_svn/MESOSCALE/LMD_MM_MARS/WPS_GEOG $refrepo/data_static |
---|
| 120 | cd $refrepo/data_static |
---|
| 121 | rm -rf logdown |
---|
| 122 | wget $webrepo"/albedo_TES.tar.gz" -a logdown |
---|
| 123 | wget $webrepo"/mola_topo64.tar.gz" -a logdown |
---|
| 124 | wget $webrepo"/thermal_TES.tar.gz" -a logdown |
---|
| 125 | for fff in *.tar.gz; do |
---|
| 126 | tar xzvf $fff > /dev/null |
---|
| 127 | rm -rf $fff |
---|
| 128 | done |
---|
| 129 | |
---|
| 130 | ## ----- |
---|
| 131 | ## check |
---|
| 132 | ## ----- |
---|
| 133 | echo "*** CHECKLIST:" |
---|
| 134 | ls -lL $refrepo/gcm/gcm.e |
---|
| 135 | ls -lL $refrepo/geogrid/geogrid.exe |
---|
| 136 | ls -lL $refrepo/metgrid/metgrid.exe |
---|
| 137 | ls -lL $refrepo/prep/readmeteo.exe |
---|
| 138 | ls -lL $refrepo/data_static/albedo_TES |
---|
| 139 | ls -lL $refrepo/real.exe |
---|
| 140 | ls -lL $refrepo/wrf.exe |
---|
| 141 | |
---|