[17] | 1 | #! /bin/bash |
---|
| 2 | |
---|
| 3 | #------------------------------ |
---|
| 4 | # makeles |
---|
| 5 | #------------------------------ |
---|
| 6 | # MMM must be defined |
---|
| 7 | #------------------------------ |
---|
| 8 | # A. Spiga 01/2009 |
---|
| 9 | #------------------------------ |
---|
| 10 | |
---|
| 11 | |
---|
[34] | 12 | echo "Use -n if you don't want to recompile physics" |
---|
| 13 | |
---|
| 14 | |
---|
[17] | 15 | # |
---|
| 16 | # SPECIAL CICLAD |
---|
| 17 | # |
---|
| 18 | |
---|
| 19 | donotcompilephys=0 |
---|
| 20 | while getopts "n" options; do |
---|
| 21 | case $options in |
---|
| 22 | n ) donotcompilephys=1;; ## do not recompile physics |
---|
| 23 | esac |
---|
| 24 | done |
---|
| 25 | |
---|
| 26 | # |
---|
| 27 | # LOCATIONS |
---|
| 28 | # |
---|
| 29 | here=$PWD |
---|
| 30 | whereliblmd=$here |
---|
| 31 | |
---|
| 32 | |
---|
| 33 | ############################################################## |
---|
| 34 | ############################################################## |
---|
| 35 | if [ ${donotcompilephys} -eq 0 ] |
---|
| 36 | then |
---|
| 37 | |
---|
| 38 | # |
---|
| 39 | # COMPILE PHYSICS |
---|
| 40 | # |
---|
| 41 | cd $MMM |
---|
| 42 | makemeso -j |
---|
| 43 | # |
---|
| 44 | #makemeso -rd < last > /dev/null |
---|
| 45 | folder=$PWD'/'$(more what_folder)'/WRFV2/' |
---|
| 46 | libphys_folder=$folder'mars_lmd/libo/' |
---|
| 47 | phymars_folder=$folder'mars_lmd/libf/phymars/' |
---|
| 48 | \rm what_folder 2> /dev/null |
---|
| 49 | |
---|
| 50 | # |
---|
| 51 | # GET liblmd GENERATED LIBRARY and INCLUDEs |
---|
| 52 | # |
---|
| 53 | echo $libphys_folder |
---|
| 54 | cp -rf ${libphys_folder}/liblmd.a ${whereliblmd}/ |
---|
[34] | 55 | #cp -rf ${phymars_folder}/dimphys.h ${here}/modif_mars/ |
---|
| 56 | cp -rf ${phymars_folder}/dimphys.h ${here}/mars_lmd/libf/phymars/ |
---|
| 57 | #cp -rf ${folder}/call_meso_inifis.inc ${here}/modif_mars/ |
---|
| 58 | #cp -rf ${folder}/call_meso_physiq.inc ${here}/modif_mars/ |
---|
| 59 | cp -rf ${folder}/call_meso_inifis.inc ${here}/ |
---|
| 60 | cp -rf ${folder}/call_meso_physiq.inc ${here}/ |
---|
| 61 | #cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/modif_mars/ |
---|
| 62 | cp -rf ${folder}/inc/module_lmd_driver_output*.inc ${here}/inc/ |
---|
| 63 | #cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/modif_mars/ |
---|
| 64 | #cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/modif_mars/ |
---|
| 65 | cp -rf ${phymars_folder}/wrf_output_2d.h ${here}/mars_lmd/libf/phymars/ |
---|
| 66 | cp -rf ${phymars_folder}/wrf_output_3d.h ${here}/mars_lmd/libf/phymars/ |
---|
[17] | 67 | fi |
---|
| 68 | ############################################################## |
---|
| 69 | ############################################################## |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | cd $here |
---|
| 73 | |
---|
| 74 | #------------------------------ |
---|
| 75 | #------------------------------ |
---|
| 76 | # |
---|
| 77 | # MPI (dm) 64 bits |
---|
| 78 | # |
---|
| 79 | #TODO: le rendre adapte aux reponses du user a makemeso |
---|
| 80 | touch conf |
---|
| 81 | echo 3 >> conf |
---|
| 82 | #echo 4 >> conf #openMP n'arrange pas beaucoup de le tps de calcul |
---|
| 83 | echo 1 >> conf |
---|
| 84 | #------------------------------ |
---|
| 85 | #------------------------------ |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | ### SINGLE PROC 32 bits g95 |
---|
| 90 | #touch conf |
---|
| 91 | #echo 5 >> conf |
---|
| 92 | #echo 0 >> conf |
---|
| 93 | |
---|
| 94 | ## SINGLE PROC 64 bits |
---|
| 95 | #touch conf |
---|
| 96 | #echo 1 >> conf |
---|
| 97 | #echo 0 >> conf |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | # |
---|
| 102 | # CONFIGURE |
---|
| 103 | # |
---|
| 104 | echo "configure..." |
---|
| 105 | #touch configure.wrf |
---|
| 106 | \rm configure.wrf |
---|
| 107 | ./configure < conf > /dev/null 2> /dev/null |
---|
| 108 | #./configure |
---|
| 109 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+'mpif90 -f90=$(SFC)'+'/usr/lib64/openmpi/1.2.8-pgf/bin/mpif90'+g | sed s+'mpicc -cc=$(SCC)'+'/usr/lib64/openmpi/1.2.8-gcc/bin/mpicc -DMPI2_SUPPORT'+g > yeah |
---|
| 110 | ## WHERE_MPI must be defined |
---|
| 111 | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"mpif90"+"$WHERE_MPI/mpif90"+g | sed s+"mpicc"+"$WHERE_MPI/mpicc"+g > yeah |
---|
| 112 | #sed s+"# -g"+"-fno-second-underscore # -g"+g configure.wrf | sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g > yeah |
---|
| 113 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf | sed s+"#-g"+"-g"+g > yeah |
---|
| 114 | #sed s+"-lnetcdf"+"-lnetcdf -L$whereliblmd -llmd"+g configure.wrf > yeah |
---|
| 115 | mv yeah configure.wrf |
---|
[18] | 116 | |
---|
[24] | 117 | #### |
---|
| 118 | #### provoque des seg faults.... |
---|
| 119 | #### |
---|
[23] | 120 | #sed s+"-fastsse"+"-fastsse -mcmodel=medium -Mlarge_arrays"+g configure.wrf > yeah |
---|
| 121 | #### TEST TEST |
---|
| 122 | #mv yeah configure.wrf |
---|
[18] | 123 | |
---|
| 124 | sed s+"-fastsse"+" "+g configure.wrf > yeah |
---|
| 125 | # |
---|
| 126 | # sometimes fastsse is problematic |
---|
| 127 | # |
---|
| 128 | |
---|
[17] | 129 | ##sed s+"-fastsse"+"-fastsse -mcmodel=medium"+g configure.wrf > yeah |
---|
| 130 | mv yeah configure.wrf |
---|
| 131 | #sed s+"-mp -Minfo=mp"+"-mp -Minfo=mp -mp=nonuma"+g configure.wrf > yeah |
---|
| 132 | #mv yeah configure.wrf |
---|
| 133 | |
---|
| 134 | \rm conf |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | # |
---|
| 138 | # COMPILE LES TEST CASE w/ LMD PHYSICS |
---|
| 139 | # |
---|
| 140 | touch modif_mars/module_lmd_driver.F |
---|
| 141 | \rm log_compile |
---|
| 142 | \rm log_error |
---|
| 143 | echo "compile LES WRF with LMD Mars physics... look log_compile and log_error" |
---|
| 144 | compile em_les > log_compile 2> log_error |
---|
| 145 | |
---|
| 146 | echo '***********************************' |
---|
| 147 | tail -n 20 log_error |
---|
| 148 | |
---|