Changeset 5175
- Timestamp:
- Sep 9, 2024, 11:33:12 AM (2 months ago)
- Location:
- BOL/LMDZ_Setup_amaury
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup_amaury/lmdz_env.sh
r5078 r5175 7 7 # See the end of <set_env> for the explanation of each 8 8 ######################################################## 9 10 # <root_dir> will be set by sed by setup.sh here 11 root_dir=/home/abarral/PycharmProjects/installLMDZ/LMDZ_Setup 9 12 10 13 function get_hostname { … … 39 42 # alors $STORE, $WORK etc vont designer les espaces de "newproj") 40 43 account="lmd" # $(idrproj | grep active | awk '{ print $1}') doesn't work on compute nodes 41 root_dir="$WORK/LMDZ_Setup";42 44 ARCH="X64_JEANZAY" 43 45 SIMRUNBASEDIR="$SCRATCH/" … … 57 59 module load cdo/2.3.0 58 60 59 root_dir="/data/abarral/LMDZ_SETUP_ROOT/LMDZ_Setup";60 61 ARCH="X64_MESOIPSL-GNU" 61 62 SIMRUNBASEDIR="$SCRATCH/" … … 93 94 94 95 account=$(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-) 95 root_dir="$WORKDIR/LMDZ_Setup";96 96 ARCH="X64_ADASTRA-GNU" 97 97 SIMRUNBASEDIR="$SCRATCHDIR/" … … 108 108 ;; 109 109 *) echo "WARNING: RUNNING THIS SCRIPT ON A LOCAL COMPUTER IS DISCOURAGED (lackluster cpus and memory)" 110 root_dir="/home/abarral/PycharmProjects/installLMDZ/LMDZ_Setup"; # Where you have extracted LMDZ_Setup. Can't use $(pwd) since this script gets copied and ran from several locations111 110 ARCH="local-gfortran-parallel" # The arch file to use 112 111 SIMRUNBASEDIR="/tmp/SCRATCH/" # Where the simulations will be executed ($SIMRUNBASEDIR/LMDZ_Setup/...) … … 128 127 set_env 129 128 130 if [[ ! (-d $root_dir && -f $root_dir/ lmdz_env.sh) ]]; then131 echo "STOP: root_dir $root_dir not found, either you are running on an unsupported cluster, or you haven't edited lmdz_env.sh properly"; exit 1129 if [[ ! (-d $root_dir && -f $root_dir/.lmdz_setup_root_dir && -f $root_dir/lmdz_env.sh) ]]; then 130 echo "STOP: root_dir $root_dir not found, either you are running on an unsupported cluster, or the initialisation failed midway"; exit 1 132 131 fi -
BOL/LMDZ_Setup_amaury/setup.sh
r5078 r5175 7 7 # EXPERT-LEVEL CHOICES, only available in setup.sh, not in main.sh : 8 8 #################################################################### 9 function define_expert_options {9 function define_expert_options() { 10 10 # optim: either "" or "-debug" to compile in debug mode (slower but better diagnosis of segfaults) 11 11 optim="" … … 50 50 # /!\ DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING /!\ 51 51 52 function enable_platform { # In job scripts, sed platform-specific headers52 function enable_platform() { # In job scripts, sed platform-specific headers 53 53 local file="$1" 54 54 local platform … … 64 64 } 65 65 66 function load_install_lib {66 function load_install_lib() { 67 67 # Fetch and source install_lmdz.sh to get `myget` 68 68 if [[ ! -f "install_lmdz.sh" ]]; then … … 74 74 } 75 75 76 function set_default_params {76 function set_default_params() { 77 77 # Default value of script parameters 78 78 SIM=$(basename "$local")CTL # name … … 107 107 } 108 108 109 function read_cmdline_args {109 function read_cmdline_args() { 110 110 while (($# > 0)); do 111 111 case $1 in … … 188 188 } 189 189 190 function ensure_correct_option_combinations {190 function ensure_correct_option_combinations() { 191 191 # AVOID COMBINATIONS OF OPTIONS THAT DON'T WORK in user choices 192 192 if [[ $ok_guide = y && $climato = 1 ]]; then … … 213 213 } 214 214 215 function install_model {215 function install_model() { 216 216 mkdir -p "$LMDZD" 217 217 … … 249 249 } 250 250 251 function setup_def { # modify various .def in ./DEF (+ xios xml as needed)251 function setup_def() { # modify various .def in ./DEF (+ xios xml as needed) 252 252 cd "$local" 253 253 … … 359 359 } 360 360 361 function setup_ce0l { # Verification de l'existance de l'état initial, compilation eventuelle pour sa creation361 function setup_ce0l() { # Verification de l'existance de l'état initial, compilation eventuelle pour sa creation 362 362 if [[ ! -d $INIT ]]; then 363 363 if [[ $init = 0 ]]; then … … 379 379 } 380 380 381 function setup_simu {381 function setup_simu() { 382 382 SIMRUNTOPDIR="$SIMRUNBASEDIR/$(basename "$local")" 383 383 SIMRUNDIR=$SIMRUNTOPDIR … … 461 461 } 462 462 463 function fetch_simu_init_files {463 function fetch_simu_init_files() { 464 464 ##################################################################### 465 465 echo "Recuperation eventuelle de certains fichiers sur $LMDZ_INIT" … … 542 542 } 543 543 544 function run_sim_or_init {544 function run_sim_or_init() { 545 545 cd "$local" 546 546 … … 715 715 } 716 716 717 function message_post_submit {717 function message_post_submit() { 718 718 if [[ $ok_guide = "y" && $init = 1 ]]; then 719 719 cd "$local" … … 731 731 } 732 732 733 # Set up the appropriate environment 734 source lmdz_env.sh 733 function setup_and_load_lmdz_env() { 734 if [[ ! -f .lmdz_setup_root_dir ]]; then echo "STOP: setup.sh is not located in the root dir ??!!"; exit 1; fi 735 # sed root_dir in lmdz_env.sh 736 sed -i'' "s<root_dir=.*<root_dir=$local<" lmdz_env.sh 737 738 # Set up the appropriate environment 739 source lmdz_env.sh 740 } 735 741 736 742 local=$(pwd) 737 743 744 setup_and_load_lmdz_env 738 745 load_install_lib 739 746 define_expert_options
Note: See TracChangeset
for help on using the changeset viewer.