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

PEM:
Small corrections in the scripts.
JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r4090 r4091  
    889889== 27/02/2026 == JBC
    890890Update README and change "startpem.nc" into "startevol.nc".
     891
     892== 27/02/2026 == JBC
     893Small corrections in the scripts
  • trunk/LMDZ.COMMON/libf/evolution/config.F90

    r4074 r4091  
    2424
    2525character(7),  parameter :: rundef_name = 'run.def'
    26 character(11), parameter :: runPCMdef_name = 'run_pcm.def'
     26character(11), parameter :: run_pcmdef_name = 'run_pcm.def'
    2727character(12), parameter :: callphys_name = 'callphys.def'
    2828
     
    350350! CODE
    351351! ----
    352 inquire(file = runPCMdef_name,exist = here)
    353 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//runPCMdef_name//'"!',1)
    354 call print_msg('> Reading "'//runPCMdef_name//'"')
    355 open(newunit = funit,file = runPCMdef_name,status = 'old',form = 'formatted',action = 'read',iostat = ierr)
    356 if (ierr /= 0) call stop_clean(__FILE__,__LINE__,'error opening file "'//runPCMdef_name//'"!',ierr)
     352inquire(file = run_pcmdef_name,exist = here)
     353if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//run_pcmdef_name//'"!',1)
     354call print_msg('> Reading "'//run_pcmdef_name//'"')
     355open(newunit = funit,file = run_pcmdef_name,status = 'old',form = 'formatted',action = 'read',iostat = ierr)
     356if (ierr /= 0) call stop_clean(__FILE__,__LINE__,'error opening file "'//run_pcmdef_name//'"!',ierr)
    357357
    358358found = .false.
     
    385385close(funit)
    386386
    387 if (.not. found) call print_msg('Warning: key ''hybrid'' not found in the file "'//runPCMdef_name//'"!')
     387if (.not. found) call print_msg('Warning: key ''hybrid'' not found in the file "'//run_pcmdef_name//'"!')
    388388if (hybrid .eqv. hybrid_in) call print_msg('USING DEFAULTS : hybrid = '//bool2str(hybrid_in))
    389389
  • trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh

    r4090 r4091  
    1212rm -f Bands*.dat
    1313rm -f pem_workflow.sts
    14 find . -type f -name "PCMrun*.job" ! -name "pcm_run.job" -delete
     14find . -type f -name "pcm_run*.job" ! -name "pcm_run.job" -delete
    1515rm -f *.out
    1616rm -f kill_pem_workflow.sh
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pcm_run.job

    r4074 r4091  
    4747
    4848# Copy data files and prepare the next run
    49 mv run.log logs/runPCM${i_pcm_run}.log
     49mv run.log logs/run_pcm${i_pcm_run}.log
    5050if [ -f "diagfi.nc" ]; then
    5151    mv diagfi.nc diags/diagfi${i_pcm_run}.nc
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pem_run.job

    r4090 r4091  
    4141
    4242# Copy data files and prepare the next run
    43 mv run.log logs/runPEM${i_pem_run}.log
     43mv run.log logs/run_pem${i_pem_run}.log
    4444if [ -f "diagevol.nc" ]; then
    4545    mv diagevol.nc diags/diagevol${i_pem_run}.nc
     
    5050cp restartevol.nc starts/restartevol${i_pem_run}.nc
    5151mv restartevol.nc startevol.nc
    52 cp restartfi.nc starts/restartfi_postPEM${i_pem_run}.nc
     52cp restartfi.nc starts/restartfi_postpem${i_pem_run}.nc
    5353mv restartfi.nc startfi.nc
    5454if [ -f "restart.nc" ]; then
    55     cp restart.nc starts/restart_postPEM${i_pem_run}.nc
     55    cp restart.nc starts/restart_postpem${i_pem_run}.nc
    5656    mv restart.nc start.nc
    5757elif [ -f "restart1D.txt" ]; then
    58     cp restart1D.txt starts/restart1D_postPEM${i_pem_run}.txt
     58    cp restart1D.txt starts/restart1D_postpem${i_pem_run}.txt
    5959    mv restart1D.txt start1D.txt
    6060fi
  • 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
  • trunk/LMDZ.COMMON/libf/evolution/deftank/visu_layering_evol.py

    r4090 r4091  
    918918def read_orbital_data_nc(starts_folder, infofile=None):
    919919    """
    920     Read orbital parameters from restartfi_postPEM*.nc files in starts_folder.
     920    Read orbital parameters from restartfi_postpem*.nc files in starts_folder.
    921921    """
    922922    if not os.path.isdir(starts_folder):
     
    929929        dates_yr = None
    930930
    931     pattern = os.path.join(starts_folder, "restartfi_postPEM*.nc")
     931    pattern = os.path.join(starts_folder, "restartfi_postpem*.nc")
    932932    files = glob(pattern)
    933933    if not files:
     
    936936    def extract_number(path):
    937937        name = os.path.basename(path)
    938         prefix = 'restartfi_postPEM'
     938        prefix = 'restartfi_postpem'
    939939        if name.startswith(prefix) and name.endswith('.nc'):
    940940            num_str = name[len(prefix):-3]
Note: See TracChangeset for help on using the changeset viewer.