Changeset 4939
- Timestamp:
- May 13, 2024, 10:11:39 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/script_install_amaury/install_lmdz.sh
r4934 r4939 58 58 veget="none" 59 59 grid_resolution="32x32x39" 60 physiq="" 60 benchphysiq="" 61 compphysiq="lmd" 61 62 62 63 parallel="none" … … 84 85 85 86 local mpi_file 86 mpi_file=$(readlink - f "$(which mpif90)")87 mpi_file=$(readlink -e -f "$(which mpif90)") 87 88 path_mpi=$(dirname "$mpi_file") 88 89 root_mpi=$(dirname "$path_mpi") … … 128 129 -debug compile everything in debug mode 129 130 130 -physiq to choose which physics package to use in the bench (default <$physiq>) 131 -benchphysiq to choose which physics.def package to use in the bench (default <$benchphysiq>) 132 133 -compilephysiq physics to compile the model with (default <$compphysiq>) 131 134 132 135 -veget surface/vegetation scheme treatment controlled by the single variable veget which can have the following values: none: bucket scheme (default); CMIP6 | veget2.0: orchidee version used in CMIP exercise, rev 5661; veget2.2: orchidee branch 2.2, rev 8529 (bundled); number: orchidee version number (default $veget) 136 137 -spla activate interactive aerosols 138 139 -inlandsis activate new snow scheme 133 140 134 141 -arch name of the arch to use (default <$arch>) … … 165 172 "-name") MODEL=$2; shift; shift;; 166 173 "-netcdf") netcdf=$2; shift; shift;; 167 "-physiq") physiq=$2; shift; shift;; 174 "-benchphysiq") benchphysiq=$2; shift; shift;; 175 "-compilephysiq") compphysiq=$2; shift; shift;; 168 176 "-xios") with_xios=1; shift;; 169 177 "-arch") arch=$2; shift; shift;; 170 178 "-arch_dir") arch_dir=$2; shift; shift;; 171 179 "-veget") veget=$2; shift; shift;; 180 "-spla") aerosols=1; shift;; 181 "-inlandsis") inlandsis=1; shift;; 172 182 "-make_j") make_j=$2; shift; shift;; 173 183 *) bash install_lmdz.sh -h; exit 1 174 184 esac 175 185 done 186 187 # Isotopes : Compile and run with isotopes if lmdz_phys="lmdiso" in main.sh 188 if [[ $compphysiq = "lmdiso" ]]; then isotopes=1; else isotopes=0; fi 176 189 177 190 # Option de compilation pour Cosp … … 182 195 esac 183 196 197 #Define veget-related suffix for gcm name 198 if [[ $veget = 'none' ]]; then 199 suff_orc='' 200 else 201 suff_orc='_orch' 202 fi 203 204 205 if [[ $parallel = "none" ]]; then 206 suff_para='_seq' 207 else 208 suff_para='_para_mem' 209 fi 210 211 if [[ $with_xios = 1 ]]; then opt_makelmdz_xios="-io xios"; fi 212 213 if [[ $aerosols = 1 ]]; then 214 opt_aer="-dust true"; suff_aer="_spla" 215 else 216 opt_aer=""; suff_aer="" 217 fi 218 219 if [[ $inlandsis = 1 ]]; then 220 opt_inlandsis="-inlandsis true" 221 else 222 opt_inlandsis="" 223 fi 224 225 if [[ $isotopes = 1 ]]; then 226 opt_isotopes="-isotopes true"; suff_iso="_iso" 227 else 228 opt_isotopes="" ; suff_iso="" 229 fi 230 231 232 # Name of the model's folder. The convention taken here is that models that requires different compilation sources should have a different names. 233 local xios_name="" 234 if [[ $with_xios = 1 ]]; then xios_name="XIOS"; fi 235 if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version${svn_lmdz}OR$veget$xios_name"; fi 236 237 if [[ $arch_dir = "" ]]; then arch_dir="$MODEL/modipsl/config/IPSLCM7/ARCH/"; fi 238 } 239 240 function ensure_correct_option_combinations { 184 241 # Check on veget version 185 242 if [[ $veget != 'none' && $veget != "CMIP6" && $veget != "orch2.0" && $veget != "orch2.2" ]]; then … … 190 247 fi 191 248 192 #Define veget-related suffix for gcm name193 if [[ $veget = 'none' ]]; then194 suff_orc=''195 else196 suff_orc='_orch'197 fi198 199 200 if [[ $parallel = "none" ]]; then201 suff_exe='_seq'202 else203 suff_exe='_para_mem'204 fi205 206 #Chemin pour placer le modele207 if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn_lmdz$optim_debug"; fi208 209 249 ## if also compiling XIOS, parallel must be mpi_omp 210 250 if [[ $with_xios = 1 && $parallel != "mpi_omp" ]]; then … … 212 252 fi 213 253 214 if [[ $with_xios = 1 ]]; then215 opt_makelmdz_xios="-io xios"216 fi217 218 254 if [[ $cosp = "v2" && $with_xios = 0 ]]; then 219 255 echo "Error, Cospv2 cannot run without Xios"; exit 1 220 256 fi 221 257 222 if [[ $arch_dir = "" ]]; then 223 arch_dir="$MODEL/modipsl/config/IPSLCM7/ARCH/" 224 fi 225 arch_dir=$(readlink -f "$arch_dir") # full path 258 # STOP if trying to use both ORCHIDEE and Isotopes : 259 if [[ $isotopes = 1 && $veget != "NONE" ]]; then 260 echo "STOP: You cannot run LMDZ with ORCHIDEE and ISOtopes at the same time"; exit 1 261 fi 262 263 # STOP if trying to use both SPLA and Isotopes : 264 if [[ $isotopes = 1 && $aerosols = 1 ]]; then 265 echo "STOP: You cannot run LMDZ with Isotopes and aerosols=spla at the same time"; exit 1 266 fi 267 268 # (Temporary) STOP if trying to use Isotopes with XIOS : 269 # TODO Amaury: check if still relevant 270 if [[ $isotopes = 1 && $with_xios = 1 ]]; then 271 echo "STOP: Isotopes cannont yet be run with XIOS"; exit 1 272 fi 273 274 # (Temporary) Constraints for aerosols=spla : 275 # --> resolution 128x88x79 and rad=rrtm 276 if [[ $aerosols = 1 && $grid_resolution != "128x88x79" ]]; then 277 echo 'For now, <aerosols=spla> requires <resol=128x88x79>, and uses the zoomed grid from gcm.def_zNAfrica_BiJe, for which forcing & initial files are available' 278 echo "Right now resol=<$grid_resolution>" 279 exit 1 280 fi 281 282 if [[ $aerosols = 1 && $rad != "rrtm" ]]; then 283 echo "STOP: For the time being, <aerosols=spla> requires <rad=rrtm>"; exit 1 284 fi 226 285 } 227 286 … … 250 309 function download_model { 251 310 mkdir -p "$MODEL" 252 MODEL=$(readlink - f "$MODEL"); echo "$MODEL" # absolute path311 MODEL=$(readlink -e -f "$MODEL"); echo "$MODEL" # absolute path 253 312 254 313 rm -rf "$MODEL/modipsl" … … 292 351 mv MODEL_REF "$MODEL" 293 352 fi 294 MODEL=$(readlink - f "$MODEL"); echo "$MODEL" # absolute path353 MODEL=$(readlink -e -f "$MODEL"); echo "$MODEL" # absolute path 295 354 } 296 355 297 356 function init_arch { 357 arch_dir=$(readlink -e -f "$arch_dir") # full path. readlink must be called *after* the path is created 298 358 if [[ ! -d $arch_dir ]]; then 299 359 echo "Error: no arch dir $arch_dir"; exit 1 … … 559 619 560 620 function get_lmdz_version { 561 LMDZPATH=$(readlink - f "$MODEL/modipsl/modeles/LMD"*)621 LMDZPATH=$(readlink -e -f "$MODEL/modipsl/modeles/LMD"*) 562 622 cd "$LMDZPATH" 563 623 lmdzlog="$(pwd)/lmdz.log" … … 587 647 cd "$LMDZPATH" 588 648 589 exe_name="bin/gcm_${grid_resolution}_phylmd_${rad}${suff_exe}${suff_orc}.e" 649 if [[ $used_lmdz_rev -le 4185 ]]; then 650 exe_name="bin/gcm_${grid_resolution}_phy${compphysiq}_${suff_para}${suff_orc}${suff_aer}${suff_iso}.e" 651 else 652 exe_name="bin/gcm_${grid_resolution}_phy${compphysiq}_${rad}${suff_para}${suff_orc}${suff_aer}${suff_iso}.e" 653 fi 590 654 591 655 local opt_rad … … 608 672 local varenv="IOIPSL_LIBDIR_=\"$IOIPSL_LIBDIR_\" IOIPSL_INCDIR_=\"$IOIPSL_INCDIR_\" ORCH_INCDIR_=\"$ORCH_INCDIR_\" ORCH_LIBDIR_=\"$ORCH_LIBDIR_\" XIOS_INCDIR_=\"$XIOS_INCDIR_\" XIOS_LIBDIR_=\"$XIOS_LIBDIR_\"" 609 673 makelmdz="makelmdz_fcm $optim_debug -arch $arch -j $make_j" 610 if [[ $parallel = "none" ]]; then 611 echo "$varenv ./$makelmdz $opt_rad $opt_cosp -d ${grid_resolution} -v $fcm_veget_version gcm " > compile.sh 612 else 613 echo "$varenv ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios -d ${grid_resolution} -v $fcm_veget_version -mem -parallel $parallel gcm" > compile.sh 614 fi 674 local para_compile_opt="-mem -parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi 675 echo "$varenv ./$makelmdz $opt_rad $opt_cosp $opt_makelmdz_xios $opt_aer $opt_inlandsis $opt_isotopes -p $compphysiq -d ${grid_resolution} -v $fcm_veget_version $para_compile_opt gcm" > compile.sh 615 676 echo "Compiling lmdz using $(\cat compile.sh) (log: $lmdzlog) $(date)" 616 677 chmod +x ./compile.sh … … 621 682 622 683 # Check executable 623 # TODO $mysev -ge 4186 => other name convention ! check original install624 684 if [[ ! -f $exe_name ]]; then 625 685 echo "Compilation failed, can't find the executable"; exit 1 … … 652 712 fi 653 713 654 if [[ -n "$ physiq" ]]; then714 if [[ -n "$benchphysiq" ]]; then 655 715 cd "BENCH${grid_resolution}" 656 if [[ -f "physiq.def_${ physiq}" ]]; then657 cp "physiq.def_${ physiq}"physiq.def658 echo "using physiq.def_${ physiq}"716 if [[ -f "physiq.def_${benchphysiq}" ]]; then 717 cp "physiq.def_${benchphysiq}" benchphysiq.def 718 echo "using physiq.def_${benchphysiq}" 659 719 else 660 720 echo "using standard physiq.def" … … 849 909 set_default_params 850 910 read_cmdline_args "$@" 911 ensure_correct_option_combinations 851 912 #download_model 852 913 create_model_tar
Note: See TracChangeset
for help on using the changeset viewer.