Ignore:
Timestamp:
Sep 25, 2016, 4:20:20 PM (8 years ago)
Author:
aslmd
Message:

added mesoscale old physics to mesoinstall. added option to choose version

File:
1 edited

Legend:

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

    r1568 r1613  
    1717
    1818meso="on"
    19 while getopts "gn:h" options; do
     19gcm=""
     20while getopts "gn:hv:o" options; do
    2021  case $options in
    2122   n ) name="${OPTARG}";;
    2223   g ) meso="off";;
     24   v ) version="${OPTARG}";;
     25   o ) gcm="old" ;;
    2326   h ) echo "
    2427# OPTIONS
    25 # -n [name] --> name of the folder to be created
    26 # -g        --> only compile GCM (for tests)
     28# -n [name]        --> name of the folder to be created
     29# -g               --> only compile GCM (for tests)
     30# -v [# (or) HEAD] --> svn version
     31# -o               --> old GCM+meso version
    2732" ; exit ;;
    2833  esac
     
    4853echo "*** get structure"
    4954rm -rf $name > /dev/null 2> /dev/null
    50 svn -q co $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN" $name
     55svn -q co $where_is_svn"/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN"$gcm $name
    5156refrepo=$PWD/$name
    5257## fill here user input to obtain independent script
    53 case ${fortcom} in
    54   "ifort") echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;;
     58case ${fortcom}$gcm in
     59  "ifort")    echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;;
     60  "ifortold") echo 1 > $refrepo/wpsin ; echo 5 > $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;
     61              echo 61 >> $refrepo/mesoin ; echo 61 >> $refrepo/mesoin ; echo 61 >> $refrepo/mesoin ;
     62              echo 1 >> $refrepo/mesoin ; echo 1 >> $refrepo/mesoin ;;
    5563esac
    5664
     
    6270svn -q co -N $where_is_svn $refrepo/code
    6371
    64 ## ------------
    65 ## get GCM code
    66 ## ------------
    67 echo "*** get GCM code version "$version
    68 cd $refrepo/code
    69 svn -q update -r $version LMDZ.MARS
    70 svn -q update -r $version LMDZ.COMMON
    71 cd $refrepo/code/LMDZ.COMMON
    72 svn -q co http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2
    73 ln -sf FCM_V1.2/bin/fcm .
    74 
    75 ## --------------
    76 ## compile IOIPSL
    77 ## --------------
    78 log=$refrepo/code/logcompile_ioipsl
    79 echo "*** compile IOIPSL: check progress in "$log
    80 rm -rf $log ; touch $log
    81 cd $refrepo/code/LMDZ.COMMON/ioipsl
    82 ./install_ioipsl_$fortcom".bash" > $log 2> $log
    83 
    84 ## -----------
    85 ## compile GCM
    86 ## -----------
    87 log=$refrepo/code/logcompile_gcm
    88 echo "*** compile GCM: check progress in "$log
    89 rm -rf $log ; touch $log
    90 cd $refrepo/code/LMDZ.COMMON
    91 ./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine$fortcom -parallel mpi -p mars gcm > $log 2> $log
    92 ./makelmdz_fcm              -j 8 -s 2 -d $dimgcm -arch $machine$fortcom               -p mars newstart >> $log 2>> $log
    93 cd $refrepo/gcm
    94 \rm gcm.e
    95 ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm"_phymars_para.e" gcm.e
    96 cd $refrepo/gcm/newstart
    97 \rm newstart.e
    98 ln -sf $refrepo/code/LMDZ.COMMON/bin/newstart_$dimgcm"_phymars_seq.e" newstart.e
     72###################################
     73################################### GCM
     74###################################
     75if [[ "${gcm}" == "old" ]]
     76then
     77
     78 log=$refrepo/code/MESOSCALE/LMDZ.MARS/logcompile_gcm
     79 echo "*** get and compile GCM code version "$version
     80 cd $refrepo/code
     81 svn update -r $version MESOSCALE > /dev/null
     82 cd $refrepo/code/MESOSCALE/LMDZ.MARS
     83 ln -sf makegcm_$fortcom makegcm
     84 ./compile > $log 2> $log
     85 
     86else
     87
     88 ## ------------
     89 ## get GCM code
     90 ## ------------
     91 echo "*** get GCM code version "$version
     92 cd $refrepo/code
     93 svn -q update -r $version LMDZ.MARS
     94 svn -q update -r $version LMDZ.COMMON
     95 cd $refrepo/code/LMDZ.COMMON
     96 svn -q co http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2
     97 ln -sf FCM_V1.2/bin/fcm .
     98
     99 ## --------------
     100 ## compile IOIPSL
     101 ## --------------
     102 log=$refrepo/code/logcompile_ioipsl
     103 echo "*** compile IOIPSL: check progress in "$log
     104 rm -rf $log ; touch $log
     105 cd $refrepo/code/LMDZ.COMMON/ioipsl
     106 ./install_ioipsl_$fortcom".bash" > $log 2> $log
     107
     108 ## -----------
     109 ## compile GCM
     110 ## -----------
     111 log=$refrepo/code/logcompile_gcm
     112 echo "*** compile GCM: check progress in "$log
     113 rm -rf $log ; touch $log
     114 cd $refrepo/code/LMDZ.COMMON
     115 ./makelmdz_fcm -cpp MESOINI -j 8 -s 2 -d $dimgcm -arch $machine$fortcom -parallel mpi -p mars gcm > $log 2> $log
     116 ./makelmdz_fcm              -j 8 -s 2 -d $dimgcm -arch $machine$fortcom               -p mars newstart >> $log 2>> $log
     117 cd $refrepo/gcm
     118 \rm gcm.e
     119 ln -sf $refrepo/code/LMDZ.COMMON/bin/gcm_$dimgcm"_phymars_para.e" gcm.e
     120 cd $refrepo/gcm/newstart
     121 \rm newstart.e
     122 ln -sf $refrepo/code/LMDZ.COMMON/bin/newstart_$dimgcm"_phymars_seq.e" newstart.e
     123
     124 ## ------------------------
     125 ## make a minimal startbase
     126 ## ------------------------
     127 echo "*** make a minimal startbase"
     128 cd $refrepo/gcm/newstart
     129 ./mini_startbase.sh
     130
     131fi
     132
     133###################################
     134################################### MESO
     135###################################
    99136
    100137## START MESOSCALE PART
     
    109146svn update -r $version MESOSCALE > /dev/null
    110147cd $refrepo/code/MESOSCALE/LMD_MM_MARS
     148#
     149if [[ "${gcm}" == "old" ]]
     150then
     151  option=""
     152else
     153  option="-p mars_lmd_new"
     154fi
     155#
    111156ls $refrepo/mesoin
    112157if [[ "$?" == 0 ]] ; then
    113   ./makemeso -p < $refrepo/mesoin
    114 else
    115   ./makemeso -p
     158  ./makemeso $option < $refrepo/mesoin
     159else
     160  ./makemeso $option
    116161fi
    117162rm -rf $refrepo/mesoin
     
    169214## END MESOSCALE PART
    170215
    171 ## ------------------------
    172 ## make a minimal startbase
    173 ## ------------------------
    174 echo "*** make a minimal startbase"
    175 cd $refrepo/gcm/newstart
    176 ./mini_startbase.sh
    177 
    178216## -----
    179217## check
Note: See TracChangeset for help on using the changeset viewer.