Changeset 5464
- Timestamp:
- Jan 2, 2025, 10:16:57 AM (3 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/LMDZ_Setup/setup.sh
r5462 r5464 90 90 #--------------------------------------------------------------------------- 91 91 92 SIM=$(basename "$local ")CTL # name92 SIM=$(basename "$local_d")CTL # name 93 93 phylmd="lmd" #option -p $phylmd for makelmdz 94 94 … … 267 267 echo "Installing model" 268 268 cd "$LMDZD" 269 cp "$local /install_lmdz.sh" .269 cp "$local_d/install_lmdz.sh" . 270 270 chmod +x install_lmdz.sh 271 271 local make_j=8 … … 284 284 set +o pipefail 285 285 mv install_lmdz.sh install_lmdz.$$.sh 286 cd "$local "286 cd "$local_d" 287 287 } 288 288 … … 290 290 function setup_def() { # modify various .def in ./DEF (+ xios xml ) 291 291 #--------------------------------------------------------------------------- 292 cd "$local "292 cd "$local_d" 293 293 294 294 # Utilisation des .def_iso pour LMDZ-ISOtopes … … 310 310 ###################################################################### 311 311 # Changements dans les fichiers DEF/*def 312 # (ils vont se repercuter dans les repertoires de simulation $local /$SIM et de run $SIMRUNDIR)312 # (ils vont se repercuter dans les repertoires de simulation $local_d/$SIM et de run $SIMRUNDIR) 313 313 ###################################################################### 314 314 … … 364 364 # COSP : ok_cosp desactive COSP si on a compile avec; il ne l'active pas si on a compile sans 365 365 sed -i'' -e 's/ok_cosp.*.$/ok_cosp='$cosp'/' DEF/config.def 366 if [[ $cosp = "y" ]]; then \cp -f "$MODEL"/DefLists/cosp*.txt "$local "/DEF/; fi366 if [[ $cosp = "y" ]]; then \cp -f "$MODEL"/DefLists/cosp*.txt "$local_d"/DEF/; fi 367 367 368 368 # Sorties LMDZ en fonction de l'option "xios" … … 399 399 ###################################################################### 400 400 # Si on tourne avec XIOS, mise a jour des fichiers context et field* dans XMLfilesLMDZ 401 # (ils vont se repercuter dans les repertoires de simulation $local /$SIM et de run $SIMRUNDIR)401 # (ils vont se repercuter dans les repertoires de simulation $local_d/$SIM et de run $SIMRUNDIR) 402 402 ###################################################################### 403 403 if [[ $xios = y ]]; then 404 cp -f "$MODEL"/DefLists/context_lmdz.xml "$local "/DEF/XMLfilesLMDZ/.405 cp -f "$MODEL"/DefLists/field_def_lmdz.xml "$local "/DEF/XMLfilesLMDZ/.406 if [[ $cosp = y ]]; then cp -f "$MODEL"/DefLists/field_def_cosp1.xml "$local "/DEF/XMLfilesLMDZ/.; fi404 cp -f "$MODEL"/DefLists/context_lmdz.xml "$local_d"/DEF/XMLfilesLMDZ/. 405 cp -f "$MODEL"/DefLists/field_def_lmdz.xml "$local_d"/DEF/XMLfilesLMDZ/. 406 if [[ $cosp = y ]]; then cp -f "$MODEL"/DefLists/field_def_cosp1.xml "$local_d"/DEF/XMLfilesLMDZ/.; fi 407 407 fi 408 408 } … … 423 423 ce0l=${gcm/gcm/ce0l} 424 424 425 cd "$local "425 cd "$local_d" 426 426 fi 427 427 elif [[ $init = 1 ]]; then … … 433 433 function setup_simu() { 434 434 #--------------------------------------------------------------------------- 435 #SIMRUNTOPDIR="$SIMRUNBASEDIR/$(basename "$local ")"435 #SIMRUNTOPDIR="$SIMRUNBASEDIR/$(basename "$local_d")" 436 436 SIMRUNTOPDIR="$SIMRUNBASEDIR" 437 437 SIMRUNDIR=$SIMRUNTOPDIR … … 443 443 # Creation du repertoire $SIM s'il n'existe pas deja 444 444 ##################################################################### 445 if [[ ! -d $local /$SIM ]]; then446 mkdir "$local /$SIM"447 cd "$local "445 if [[ ! -d $local_d/$SIM ]]; then 446 mkdir "$local_d/$SIM" 447 cd "$local_d" 448 448 449 449 # Edit reb.sh 450 cp reb.sh "$local /$SIM/reb.sh"; chmod +x "$local/$SIM/reb.sh"451 sed -i'' -e "s:^rebuild=.*.$:rebuild=$LMDZD/$LMDZname/modipsl/bin/rebuild:" "$local /$SIM/reb.sh"452 enable_platform "$local /$SIM/reb.sh"450 cp reb.sh "$local_d/$SIM/reb.sh"; chmod +x "$local_d/$SIM/reb.sh" 451 sed -i'' -e "s:^rebuild=.*.$:rebuild=$LMDZD/$LMDZname/modipsl/bin/rebuild:" "$local_d/$SIM/reb.sh" 452 enable_platform "$local_d/$SIM/reb.sh" 453 453 454 454 # Copy .def 455 cp lmdz_env.sh "$local /$SIM/"456 mkdir "$local /$SIM/DEF"; cp DEF/*def DEF/namelis* "$local/$SIM/DEF/"455 cp lmdz_env.sh "$local_d/$SIM/" 456 mkdir "$local_d/$SIM/DEF"; cp DEF/*def DEF/namelis* "$local_d/$SIM/DEF/" 457 457 #Pour XIOS, respectivement COSP, copier aussi les fichiers *xml / *txt 458 if [[ $cosp = "y" ]]; then cp DEF/cosp*txt "$local /$SIM/DEF/"; fi458 if [[ $cosp = "y" ]]; then cp DEF/cosp*txt "$local_d/$SIM/DEF/"; fi 459 459 if [[ $xios = "y" ]]; then 460 cp DEF/XMLfilesLMDZ/*xml "$local /$SIM/DEF/"461 if [[ $veget != 'none' ]]; then cp DEF/XMLfilesOR$veget/*xml "$local /$SIM/DEF/"; fi460 cp DEF/XMLfilesLMDZ/*xml "$local_d/$SIM/DEF/" 461 if [[ $veget != 'none' ]]; then cp DEF/XMLfilesOR$veget/*xml "$local_d/$SIM/DEF/"; fi 462 462 fi 463 chmod u+w "$local /$SIM"/DEF/*463 chmod u+w "$local_d/$SIM"/DEF/* 464 464 465 465 # Gestion du calendrier … … 482 482 cp "$gcm" gcm.e 483 483 fi 484 cd "$local "/..484 cd "$local_d"/.. 485 485 486 486 ##################################################################### … … 497 497 -e "s/cpus-per-task=.*.$/cpus-per-task=$omp/" \ 498 498 -e "s/nthreads=.*./nthreads=$omp/" \ 499 -e "s/MAINDIR=.*.$/MAINDIR=$(basename "$local ")/" \500 -e "s:STORED=.*.*:STORED=$(dirname "$local "):" \499 -e "s/MAINDIR=.*.$/MAINDIR=$(basename "$local_d")/" \ 500 -e "s:STORED=.*.*:STORED=$(dirname "$local_d"):" \ 501 501 -e "s:SCRATCHD=.*.*:SCRATCHD=$SIMRUNBASEDIR:" \ 502 502 -e "s/stopsim=.*.$/stopsim=$stopsim/" \ … … 506 506 -e "s/^climato=.*.$/climato=$climato/" \ 507 507 -e "s/^ok_guide=.*.$/ok_guide=$ok_guide/" \ 508 "$local /script_SIMU" >| "$SIMRUNDIR/tmp_$SIM"508 "$local_d/script_SIMU" >| "$SIMRUNDIR/tmp_$SIM" 509 509 510 510 enable_platform "$SIMRUNDIR/tmp_$SIM" … … 581 581 mo_=$( increment_month $mo_ ) 582 582 done 583 cd $local_d ; ln -sf $LMDZ_INIT/3DInputData/SPLA_WA/ERA5 GUIDE 583 584 fi 584 585 } … … 587 588 function run_sim_or_init() { 588 589 #---------------------------------------------------------------------- 589 cd "$local "590 cd "$local_d" 590 591 591 592 if [[ $init = 1 ]]; then … … 596 597 # Creation du repertoire INIT et mise en place de liens logiques vers les starts 597 598 # en anticipation de leur création : 598 mkdir "$local /$INIT"; cd "$local/$INIT"599 mkdir "$local_d/$INIT"; cd "$local_d/$INIT" 599 600 for an in $mthini $yearini; do for f in start startphy; do ln -s "$f.nc" "$f.$an.nc"; done; done 600 601 601 602 # Creation du repertoire INIT temporaire et rapatriement des fichiers necessaires 602 603 if [[ -d $SIMRUNDIR/$INIT ]]; then mv "$SIMRUNDIR/$INIT" "$SIMRUNDIR/$INIT$$"; fi 603 mkdir "$SIMRUNDIR/$INIT"; cp -r "$local /DEF" "$SIMRUNDIR/$INIT/"604 cd "$SIMRUNDIR/$INIT"; cp DEF/*.def .; cp "$local /lmdz_env.sh" .604 mkdir "$SIMRUNDIR/$INIT"; cp -r "$local_d/DEF" "$SIMRUNDIR/$INIT/" 605 cd "$SIMRUNDIR/$INIT"; cp DEF/*.def .; cp "$local_d/lmdz_env.sh" . 605 606 if [[ $xios = "y" ]]; then 606 607 cp DEF/XMLfilesLMDZ/*xml . … … 700 701 # ANCIEN MULTI STEP interp ) 701 702 if [[ $aerosols = clim ]]; then 702 cp $local /interp_aerosols.sh .; chmod +x interp_aerosols.sh703 cp $local_d/interp_aerosols.sh .; chmod +x interp_aerosols.sh 703 704 # Les aerosols de l'annee 2000 ont été remplacés par "9999" qui pointe vers un fichier moyen sur 1995-2014 704 705 #for year in 2000 1850; do ./interp_aerosols.sh \$year; done … … 708 709 fi 709 710 710 for f in sta* gri*nc; do cp \$f $local /$INIT/\$f; done711 if [[ $climato = 1 ]]; then cp limit.nc $local /$INIT/limit.nc; fi712 mkdir -p $local /$LIMIT713 for f in limit*.nc ; do cp \$f $local /$LIMIT/\$f; done714 if [ $aerosols = clim ]; then for f in aerosols[.0-9]*nc; do cp \$f $local /$LIMIT/\$f; done; fi711 for f in sta* gri*nc; do cp \$f $local_d/$INIT/\$f; done 712 if [[ $climato = 1 ]]; then cp limit.nc $local_d/$INIT/limit.nc; fi 713 mkdir -p $local_d/$LIMIT 714 for f in limit*.nc ; do cp \$f $local_d/$LIMIT/\$f; done 715 if [ $aerosols = clim ]; then for f in aerosols[.0-9]*nc; do cp \$f $local_d/$LIMIT/\$f; done; fi 715 716 # 716 717 cd $SIMRUNDIR … … 753 754 #--------------------------------------------------------------------------- 754 755 if [[ $ok_guide = "y" && $init = 1 ]]; then 755 cd "$local "756 cd "$local_d" 756 757 enable_platform era2gcm_tuto.sh 757 758 echo "Once initialisation is finished, you have to create nudging files" … … 772 773 if [[ ! -f .lmdz_setup_root_dir ]]; then echo "STOP: setup.sh is not located in the root dir ??!!"; exit 1; fi 773 774 # sed root_dir in lmdz_env.sh 774 sed -i'' "s<root_dir=.*<root_dir=$local <" lmdz_env.sh775 sed -i'' "s<root_dir=.*<root_dir=$local_d<" lmdz_env.sh 775 776 776 777 # Set up the appropriate environment … … 778 779 } 779 780 780 local =$(pwd)781 local_d=$(pwd) 781 782 782 783 setup_and_load_lmdz_env
Note: See TracChangeset
for help on using the changeset viewer.