- Timestamp:
- Feb 27, 2026, 3:54:06 PM (3 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow_lib.sh
r4090 r4091 298 298 # arg3: local number of the PCM run from which to start (optional) 299 299 submit_pcm_phase() { 300 find . -type f -name " PCMrun*.job" ! -name "pcm_run.job" -delete300 find . -type f -name "pcm_run*.job" ! -name "pcm_run.job" -delete 301 301 ii=1 302 302 if [ ! -z $3 ]; then … … 312 312 fi 313 313 else # Mode: submitting jobs 314 cp pcm_run.job PCMrun${i_pcm_run}.job315 sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" PCMrun${i_pcm_run}.job316 sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$ii - $2 + 2" | bc)/" PCMrun${i_pcm_run}.job314 cp pcm_run.job pcm_run${i_pcm_run}.job 315 sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" pcm_run${i_pcm_run}.job 316 sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$ii - $2 + 2" | bc)/" pcm_run${i_pcm_run}.job 317 317 if [[ "$job_scheduler" == "SLURM" ]]; then 318 jobID=$(sbatch --parsable PCMrun${i_pcm_run}.job)318 jobID=$(sbatch --parsable pcm_run${i_pcm_run}.job) 319 319 elif [[ "$job_scheduler" == "PBS" ]]; then 320 jobID=$(qsub PCMrun${i_pcm_run}.job | cut -d. -f1)320 jobID=$(qsub pcm_run${i_pcm_run}.job | cut -d. -f1) 321 321 fi 322 322 # Create a file to cancel the dependent jobs of the cycle … … 340 340 fi 341 341 else # Mode: submitting jobs 342 cp pcm_run.job PCMrun${i_pcm_run}.job343 sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" PCMrun${i_pcm_run}.job344 sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$i - $2 + 2" | bc)/" PCMrun${i_pcm_run}.job342 cp pcm_run.job pcm_run${i_pcm_run}.job 343 sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" pcm_run${i_pcm_run}.job 344 sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$i - $2 + 2" | bc)/" pcm_run${i_pcm_run}.job 345 345 if [[ "$job_scheduler" == "SLURM" ]]; then 346 jobID=$(sbatch --parsable --dependency=afterok:${jobID} PCMrun${i_pcm_run}.job)346 jobID=$(sbatch --parsable --dependency=afterok:${jobID} pcm_run${i_pcm_run}.job) 347 347 elif [[ "$job_scheduler" == "PBS" ]]; then 348 jobID=$(qsub -W depend=afterok:${jobID} PCMrun${i_pcm_run}.job | cut -d. -f1)348 jobID=$(qsub -W depend=afterok:${jobID} pcm_run${i_pcm_run}.job | cut -d. -f1) 349 349 fi 350 350 echo $kill_job $jobID >> kill_pem_workflow.sh … … 447 447 cleanup diags/Xoutdaily4pem .nc $i_resume 448 448 cleanup diags/Xoutyearly4pem .nc $i_resume 449 cleanup logs/run PCM.log $i_resume449 cleanup logs/run_pcm .log $i_resume 450 450 cleanup starts/restart1D .txt $i_resume 451 451 cleanup starts/restart .nc $i_resume … … 464 464 cleanup diags/diagevol .nc $(($i_pem_run - 1)) 465 465 cleanup diags/diagevol_soil .nc $(($i_pem_run - 1)) 466 cleanup logs/run PEM.log $(($i_pem_run - 1))467 cleanup starts/restart1D_post PEM.txt $(($i_pem_run - 1))468 cleanup starts/restart_post PEM.nc $(($i_pem_run - 1))469 cleanup starts/restartfi_post PEM.nc $(($i_pem_run - 1))466 cleanup logs/run_pem .log $(($i_pem_run - 1)) 467 cleanup starts/restart1D_postpem .txt $(($i_pem_run - 1)) 468 cleanup starts/restart_postpem .nc $(($i_pem_run - 1)) 469 cleanup starts/restartfi_postpem .nc $(($i_pem_run - 1)) 470 470 cleanup starts/restartevol .nc $(($i_pem_run - 1)) 471 471 rm -f startevol.nc … … 494 494 cleanup diags/diagevol .nc $(($i_pem_run - 1)) 495 495 cleanup diags/diagevol_soil .nc $(($i_pem_run - 1)) 496 cleanup logs/run PEM.log $(($i_pem_run - 1))497 cleanup starts/restart1D_post PEM.txt $(($i_pem_run - 1))498 cleanup starts/restart_post PEM.nc $(($i_pem_run - 1))499 cleanup starts/restartfi_post PEM.nc $(($i_pem_run - 1))496 cleanup logs/run_pem .log $(($i_pem_run - 1)) 497 cleanup starts/restart1D_postpem .txt $(($i_pem_run - 1)) 498 cleanup starts/restart_postpem .nc $(($i_pem_run - 1)) 499 cleanup starts/restartfi_postpem .nc $(($i_pem_run - 1)) 500 500 cleanup starts/restartevol .nc $(($i_pem_run - 1)) 501 501 cp starts/restartevol$(($i_pem_run - 1)).nc startevol.nc … … 525 525 cleanup diags/diagfi .nc $(($i_pcm_run - 1)) 526 526 cleanup diags/diagsoil .nc $(($i_pcm_run - 1)) 527 cleanup logs/run PCM.log $(($i_pcm_run - 1))527 cleanup logs/run_pcm .log $(($i_pcm_run - 1)) 528 528 cleanup starts/restart1D .txt $(($i_pcm_run - 1)) 529 529 cleanup starts/restart .nc $(($i_pcm_run - 1)) … … 533 533 cleanup diags/diagevol .nc $i_resume 534 534 cleanup diags/diagevol_soil .nc $i_resume 535 cleanup logs/run PEM.log $i_resume536 cleanup starts/restart1D_post PEM.txt $i_resume537 cleanup starts/restart_post PEM.nc $i_resume538 cleanup starts/restartfi_post PEM.nc $i_resume535 cleanup logs/run_pem .log $i_resume 536 cleanup starts/restart1D_postpem .txt $i_resume 537 cleanup starts/restart_postpem .nc $i_resume 538 cleanup starts/restartfi_postpem .nc $i_resume 539 539 cleanup starts/restartevol .nc $i_resume 540 540 cp starts/restartevol${i_resume}.nc startevol.nc 541 cp starts/restartfi_post PEM${i_resume}.nc startfi.nc542 if [ -f "starts/restart_post PEM${i_resume}.nc" ]; then543 cp starts/restart_post PEM${i_resume}.nc start.nc544 elif [ -f "starts/restart1D_post PEM${i_resume}.txt" ]; then545 cp starts/restart1D_post PEM${i_resume}.txt start1D.txt541 cp starts/restartfi_postpem${i_resume}.nc startfi.nc 542 if [ -f "starts/restart_postpem${i_resume}.nc" ]; then 543 cp starts/restart_postpem${i_resume}.nc start.nc 544 elif [ -f "starts/restart1D_postpem${i_resume}.txt" ]; then 545 cp starts/restart1D_postpem${i_resume}.txt start1D.txt 546 546 fi 547 547 submit_cycle $1 $n_pcm_runs
Note: See TracChangeset
for help on using the changeset viewer.
