Ignore:
Timestamp:
Jun 9, 2015, 12:53:43 PM (10 years ago)
Author:
aslmd
Message:

new more complete version of meso_install.sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SIMU/meso_install.sh

    r1445 r1447  
    44# A. Spiga 09/06/2015
    55# Install the LMD mesoscale model
     6################################
     7# prerequisite: NETCDF and FCM
     8# -- FCM executable in PATH
     9# -- NETCDF env variable
    610################################
    711## name of the folder
     
    1519## grid definition for GCM
    1620dimgcm="64x48x35"
     21## location of static data
     22webrepo="http://data.spiga.fr/mesoscale_model/STATIC_DATA/"
    1723################################
    1824
     
    2026## import settings and structure
    2127## -----------------------------
    22 svn export $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN" $name
     28echo "*** get structure"
     29rm -rf $name > /dev/null 2> /dev/null
     30svn -q export $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN" $name
    2331refrepo=$PWD/$name
     32## fill here user input to obtain independent script
     33case ${fortcom} in
     34  "ifort") echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;;
     35esac
     36
     37## ----------------
     38## create code repo
     39## ----------------
     40echo "*** get SVN repository"
     41\rm $refrepo/code
     42svn -q co -N $where_is_svn $refrepo/code
     43
     44## ------------
     45## get GCM code
     46## ------------
     47echo "*** get GCM code"
     48cd $refrepo/code
     49svn -q update LMDZ.MARS
     50svn -q update LMDZ.COMMON
     51
     52## --------------
     53## compile IOIPSL
     54## --------------
     55log=$refrepo/code/logcompile_ioipsl
     56echo "*** compile IOIPSL: check progress in "$log
     57rm -rf $log ; touch $log
     58cd $refrepo/code/LMDZ.COMMON/ioipsl
     59./install_ioipsl_$fortcom".bash" > $log 2> $log
    2460
    2561## -----------
    26 ## import code
     62## compile GCM
    2763## -----------
    28 \rm $refrepo/code
    29 svn co -N $where_is_svn $refrepo/code
    30 cd $refrepo/code
    31 svn update LMDZ.MARS
    32 svn update LMDZ.COMMON
    33 svn update MESOSCALE
    34 
    35 ## ------------------
    36 ## import static data
    37 ## ------------------
    38 cd $refrepo/code/MESOSCALE/WPS_GEOG
    39 wget http://data.spiga.fr/mesoscale_model/STATIC_DATA/albedo_TES.tar.gz
    40 tar xzvf albedo_TES.tar.gz
    41 \rm albedo_TES.tar.gz
    42 wget http://data.spiga.fr/mesoscale_model/STATIC_DATA/mola_topo64.tar.gz
    43 tar xzvf mola_topo64.tar.gz
    44 \rm mola_topo64.tar.gz
    45 wget http://data.spiga.fr/mesoscale_model/STATIC_DATA/thermal_TES.tar.gz
    46 tar xzvf thermal_TES.tar.gz
    47 \rm thermal_TES.tar.gz
    48 
    49 ## --------
    50 ## make gcm
    51 ## --------
     64log=$refrepo/code/logcompile_gcm
     65echo "*** compile GCM: check progress in "$log
     66rm -rf $log ; touch $log
    5267cd $refrepo/code/LMDZ.COMMON
    53 ./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine"_"$fortcom -parallel mpi -p mars gcm
     68./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine$fortcom -parallel mpi -p mars gcm > $log 2> $log
    5469cd $refrepo/gcm
    5570\rm gcm.e
    56 ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm_phymars_para.e gcm.e
     71ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm"_phymars_para.e" gcm.e
    5772
    58 ## --------------
    59 ## make mesoscale
    60 ## --------------
     73## ----------------------
     74## get and make mesoscale
     75## ----------------------
     76echo "*** get and compile mesoscale"
     77cd $refrepo/code
     78svn update MESOSCALE > /dev/null
    6179cd $refrepo/code/MESOSCALE/LMD_MM_MARS
    62 ./makemeso -p
    63 \rm $refrepo/code_compiled
     80ls $refrepo/mesoin
     81if [[ "$?" == 0 ]] ; then
     82  ./makemeso -p < $refrepo/mesoin
     83else
     84  ./makemeso -p
     85fi
     86rm -rf $refrepo/mesoin
     87rm -rf $refrepo/code_compiled
    6488ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/LATEST $refrepo/code_compiled
    6589
     
    6791## make ini&bdy tools in mesoscale
    6892## -------------------------------
     93echo "*** compile initialization tools"
    6994cd $refrepo/code_compiled
    7095ln -sf $refrepo/code/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/prepare_ini .
    71 ./prepare_ini
     96./prepare_ini > /dev/null
     97##
    7298cd $refrepo/code_compiled/PREP_MARS
    7399./compile"_"$fortcom
     100##
    74101cd $refrepo/code_compiled/WPS
    75 ./configure
    76 ./compile
     102ls $refrepo/wpsin
     103if [[ "$?" == 0 ]] ; then
     104  ./configure < $refrepo/wpsin > /dev/null 2> /dev/null
     105else
     106  ./configure
     107fi
     108rm -rf $refrepo/wpsin
     109rm -rf logcompile
     110./compile > logcompile 2>&1
     111
     112## ------------------
     113## import static data
     114## ------------------
     115echo "*** get static data"
     116rm -rf $refrepo/data_static
     117svn co -q $where_is_svn/MESOSCALE/LMD_MM_MARS/WPS_GEOG $refrepo/data_static
     118cd $refrepo/data_static
     119rm -rf logdown
     120wget $webrepo"/albedo_TES.tar.gz" -a logdown
     121wget $webrepo"/mola_topo64.tar.gz" -a logdown
     122wget $webrepo"/thermal_TES.tar.gz" -a logdown
     123for fff in *.tar.gz; do
     124  tar xzvf $fff > /dev/null
     125  rm -rf $fff
     126done
     127
     128## -----
     129## check
     130## -----
     131echo "*** CHECKLIST:"
     132ls -lL $refrepo/gcm/gcm.e
     133ls -lL $refrepo/geogrid/geogrid.exe
     134ls -lL $refrepo/metgrid/metgrid.exe
     135ls -lL $refrepo/prep/readmeteo.exe
     136ls -lL $refrepo/data_static/albedo_TES
     137ls -lL $refrepo/real.exe
     138ls -lL $refrepo/wrf.exe
     139
Note: See TracChangeset for help on using the changeset viewer.