[2275] | 1 | #! /bin/bash |
---|
| 2 | |
---|
| 3 | ## INSTALLER: MESOSCALE + PHYSTD as LIB |
---|
| 4 | ## A. Spiga -- 03/2020 |
---|
| 5 | |
---|
| 6 | ############ |
---|
| 7 | ## SETTINGS |
---|
| 8 | ############ |
---|
| 9 | kind=lesmpifort_64 |
---|
| 10 | |
---|
| 11 | ############# |
---|
| 12 | ## LOCATIONS |
---|
| 13 | ############# |
---|
| 14 | here=$PWD |
---|
| 15 | mm=$here/code/MESOSCALE/LMD_MM_MARS |
---|
| 16 | fd=$mm/generic_lmd_new_les_mpifort_64/WRFV2 |
---|
| 17 | src=$mm/SRC/ |
---|
| 18 | mod=$src/DEV/simpler_compile_LES_phys/ |
---|
| 19 | |
---|
| 20 | ############################# |
---|
| 21 | ## RECORD WHAT IS BEING DONE |
---|
| 22 | ############################# |
---|
| 23 | exec 1> install.log |
---|
| 24 | exec 2> install.loge |
---|
| 25 | |
---|
| 26 | ################# |
---|
| 27 | ## DOWNLOAD CODE |
---|
| 28 | ################# |
---|
| 29 | ## for physics, both GENERIC/MARS *and* COMMON are needed |
---|
| 30 | \rm -rf $here/code |
---|
| 31 | svn co -N http://svn.lmd.jussieu.fr/Planeto/trunk code |
---|
| 32 | cd $here/code |
---|
| 33 | svn update LMDZ.COMMON |
---|
| 34 | svn update LMDZ.GENERIC |
---|
| 35 | svn update LMDZ.MARS |
---|
| 36 | svn update MESOSCALE |
---|
| 37 | svn info |
---|
| 38 | |
---|
| 39 | ################################### |
---|
| 40 | ## COMPILE PHYSICS AS SEPARATE LIB |
---|
| 41 | ################################### |
---|
| 42 | ## this is without IOIPSL |
---|
| 43 | ## to compile with IOIPSL (e.g. for testing) |
---|
| 44 | ## ... use --revision=2576 |
---|
| 45 | ## ... in install_ioipsl_ciclad.bash: svn co --revision=2576 http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl |
---|
| 46 | ## ... ./makelmdz_fcm -t 1 -p std -b 38x36 -full -s 1 -d 25 -arch CICLADifort -cpp MESOSCALE gcm -j 8 -libphy |
---|
| 47 | ## ... then use specific configure.wrf |
---|
| 48 | cd $here/code/LMDZ.COMMON |
---|
| 49 | ./makelmdz_fcm -t 1 -p std -b 38x36 -full -s 1 -d 25 -arch CICLADifort -cpp MESOSCALE gcm -io noioipsl -j 8 -libphy |
---|
| 50 | |
---|
| 51 | ############################################ |
---|
| 52 | ## DOWNLOAD WRF AND CREATE MODIFIED VERSION |
---|
| 53 | ############################################ |
---|
| 54 | cd $src/LES/ |
---|
| 55 | ./LMD_LES_MARS_install |
---|
| 56 | |
---|
| 57 | ########################################## |
---|
| 58 | ## CREATE THE SPECIFIC FOLDER FOR COMPILE |
---|
| 59 | ########################################## |
---|
| 60 | ## only use of makemeso to install the folder |
---|
| 61 | ## -- configure.wrf is created but this is overridden below |
---|
| 62 | ## -- makemeso is not compiling (this script is sort of makemeso 2.0) |
---|
| 63 | cd $mm |
---|
| 64 | ./makemeso -c les -p generic_lmd_new -d < $here/${kind}.compile |
---|
| 65 | |
---|
| 66 | ########################################################################### |
---|
| 67 | ## COPY WHAT IS NECESSARY TO HAVE CONSISTENCY BETWEEN physics AND dynamics |
---|
| 68 | ########################################################################### |
---|
| 69 | cp $mod/external/io_grib_share/wrf_io_flags.h $fd/external/io_grib_share/wrf_io_flags.h |
---|
| 70 | cp $mod/external/RSL_LITE/module_dm.F $fd/external/RSL_LITE/module_dm.F |
---|
| 71 | |
---|
| 72 | ############################################################### |
---|
| 73 | ## PATCH THE configure.wrf FOR INTERFACE AND COMPILE THE MODEL |
---|
| 74 | ############################################################### |
---|
| 75 | # TODO: link to env variable in the patch instead of absolute links |
---|
| 76 | cd $fd |
---|
| 77 | ./configure < $here/${kind}.configure |
---|
| 78 | patch -b < $here/${kind}.patch |
---|
| 79 | ./compile em_les > log_compile 2> log_error |
---|
| 80 | cd $here |
---|
| 81 | |
---|
| 82 | ######################################## |
---|
| 83 | ## GET THE STATIC DATA NECESSARY TO RUN |
---|
| 84 | ######################################## |
---|
| 85 | # NB: the latest / is important |
---|
| 86 | wget -r --no-parent -nH --cut-dirs=3 https://www.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/ |
---|
| 87 | rm -rf robots.txt |
---|
| 88 | ### one file is missing from the LMDZ repo, get from HITRAN directly |
---|
| 89 | cd datagcm/continuum_data/ |
---|
| 90 | wget https://www.hitran.org/data/CIA/N2-N2_2011.cia |
---|
| 91 | cd ../../ |
---|