Ignore:
Timestamp:
Feb 27, 2026, 3:54:06 PM (3 days ago)
Author:
jbclement
Message:

PEM:
Small corrections in the scripts.
JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow_lib.sh

    r4090 r4091  
    298298# arg3: local number of the PCM run from which to start (optional)
    299299submit_pcm_phase() {
    300     find . -type f -name "PCMrun*.job" ! -name "pcm_run.job" -delete
     300    find . -type f -name "pcm_run*.job" ! -name "pcm_run.job" -delete
    301301    ii=1
    302302    if [ ! -z $3 ]; then
     
    312312            fi
    313313        else # Mode: submitting jobs
    314             cp pcm_run.job PCMrun${i_pcm_run}.job
    315             sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" PCMrun${i_pcm_run}.job
    316             sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$ii - $2 + 2" | bc)/" PCMrun${i_pcm_run}.job
     314            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
    317317            if [[ "$job_scheduler" == "SLURM" ]]; then
    318                 jobID=$(sbatch --parsable PCMrun${i_pcm_run}.job)
     318                jobID=$(sbatch --parsable pcm_run${i_pcm_run}.job)
    319319            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)
    321321            fi
    322322            # Create a file to cancel the dependent jobs of the cycle
     
    340340                fi
    341341            else # Mode: submitting jobs
    342                 cp pcm_run.job PCMrun${i_pcm_run}.job
    343                 sed -i -E "/^$job_name/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${i_pcm_run}\3/" PCMrun${i_pcm_run}.job
    344                 sed -i "s/^k=-\?[0-9]\+$/k=$(echo "$i - $2 + 2" | bc)/" PCMrun${i_pcm_run}.job
     342                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
    345345                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)
    347347                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)
    349349                fi
    350350                echo $kill_job $jobID >> kill_pem_workflow.sh
     
    447447    cleanup diags/Xoutdaily4pem .nc $i_resume
    448448    cleanup diags/Xoutyearly4pem .nc $i_resume
    449     cleanup logs/runPCM .log $i_resume
     449    cleanup logs/run_pcm .log $i_resume
    450450    cleanup starts/restart1D .txt $i_resume
    451451    cleanup starts/restart .nc $i_resume
     
    464464        cleanup diags/diagevol .nc $(($i_pem_run - 1))
    465465        cleanup diags/diagevol_soil .nc $(($i_pem_run - 1))
    466         cleanup logs/runPEM .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))
     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))
    470470        cleanup starts/restartevol .nc $(($i_pem_run - 1))
    471471        rm -f startevol.nc
     
    494494        cleanup diags/diagevol .nc $(($i_pem_run - 1))
    495495        cleanup diags/diagevol_soil .nc $(($i_pem_run - 1))
    496         cleanup logs/runPEM .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))
     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))
    500500        cleanup starts/restartevol .nc $(($i_pem_run - 1))
    501501        cp starts/restartevol$(($i_pem_run - 1)).nc startevol.nc
     
    525525    cleanup diags/diagfi .nc $(($i_pcm_run - 1))
    526526    cleanup diags/diagsoil .nc $(($i_pcm_run - 1))
    527     cleanup logs/runPCM .log $(($i_pcm_run - 1))
     527    cleanup logs/run_pcm .log $(($i_pcm_run - 1))
    528528    cleanup starts/restart1D .txt $(($i_pcm_run - 1))
    529529    cleanup starts/restart .nc $(($i_pcm_run - 1))
     
    533533    cleanup diags/diagevol .nc $i_resume
    534534    cleanup diags/diagevol_soil .nc $i_resume
    535     cleanup logs/runPEM .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
     535    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
    539539    cleanup starts/restartevol .nc $i_resume
    540540    cp starts/restartevol${i_resume}.nc startevol.nc
    541     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
     541    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
    546546    fi
    547547    submit_cycle $1 $n_pcm_runs
Note: See TracChangeset for help on using the changeset viewer.