Ignore:
Timestamp:
Feb 17, 2026, 2:45:53 PM (2 weeks ago)
Author:
jbclement
Message:

PEM:

  • Correct management of H2O ice tendency in 1D when there is not enough ice anymore.
  • Clean initialization of allocatable module arrays (especially needed when no slope)
  • One more renaming for consistency + few small updates thoughout the code.

JBC

Location:
trunk/LMDZ.COMMON/libf/evolution/deftank
Files:
6 edited
1 moved

Legend:

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

    r4072 r4074  
    4444    > the xml files for XIOS which can be found in the PCM deftank folder: "iodef.xml", "context_lmdz_physics.xml", "file_def_physics_mars.xml" and "field_def_physics_mars.xml";
    4545    > the def files you want to run the PCM: "run.def", "callphys.def", "traceur.def", etc.
    46       /!\ Do not forget to rename the PCM "run.def" into "run_PCM.def";
     46      /!\ Do not forget to rename the PCM "run.def" into "run_pcm.def";
    4747    > the starting files you want to run the PCM: "startfi.nc", "start.nc"/"start1D.txt"/profiles;
    48     > the necessary PEM files: "pem_workflow.sh", "pem_workflow_lib.sh", "pcm_run.job", "pem_run.job", "run_PEM.def" and "obl_ecc_lsp.asc";
     48    > the necessary PEM files: "pem_workflow.sh", "pem_workflow_lib.sh", "pcm_run.job", "pem_run.job", "run_pem.def" and "obl_ecc_lsp.asc";
    4949    > the optional PEM files: "diagevol.def" to define the PEM variables to be ouputted and "startpem.nc" to set the initial state of the PEM.
    5050
     
    5555    > "pcm_run.job";
    5656    > "pem_run.job";
    57     > def files, especially for "run_PEM.def", "run_PCM.def", "callphys.def".
    58 In addition, the user has to provide a "startfi.nc" whose orbital parameters are consistent with the initial date set in "run_PEM.def". The script "ini_pem_orbit.sh" can do it automatically with "obl_ecc_lsp.asc".
     57    > def files, especially for "run_pem.def", "run_pcm.def", "callphys.def".
     58In addition, the user has to provide a "startfi.nc" whose orbital parameters are consistent with the initial date set in "run_pem.def". The script "ini_pem_orbit.sh" can do it automatically with "obl_ecc_lsp.asc".
    5959
    6060Outputs:
     
    100100      > The PEM executable can have an optional argument which should be specified according to the set-up ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job).
    101101
    102 # run_PEM.def
     102# run_pem.def
    103103  All the possible parameters to define a PEM run (read in "config.F90").
    104   It needs to include in "run_PCM.def" with "INCLUDEDEF=run_PEM.def".
     104  It needs to include in "run_pcm.def" with "INCLUDEDEF=run_pem.def".
    105105
    106106# obl_ecc_lsp.asc [default], obl_ecc_lsp_pos.asc [future years]
     
    114114
    115115# ini_pem_orbit.sh:
    116   Bash script file to set the orbital parameters of a file "startfi.nc" from Laskar's data contained in "obl_ecc_lsp.asc" according to the initial date 'pem_ini_earth_date' defined in "run_PEM.def". See also "modify_startfi_orbit.sh".
     116  Bash script file to set the orbital parameters of a file "startfi.nc" from Laskar's data contained in "obl_ecc_lsp.asc" according to the initial date 'pem_ini_earth_date' defined in "run_pem.def". See also "modify_startfi_orbit.sh".
    117117
    118118# concat_pem.py:
  • trunk/LMDZ.COMMON/libf/evolution/deftank/ini_pem_orbit.sh

    r4072 r4074  
    22######################################################################
    33### Script to modify the orbital parameters of a file "startfi.nc" ###
    4 ### according to the date set in the file "run_PEM.def"            ###
     4### according to the date set in the file "run_pem.def"            ###
    55######################################################################
    66set -e
     
    1717
    1818# Name of the file containing the starting date (Earth years)
    19 date_file="run_PEM.def"
     19date_file="run_pem.def"
    2020######################################################################
    2121
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pcm_run.job

    r4072 r4074  
    2424
    2525# Name of executable for the PCM:
    26 exePCM="gcm_64x48x32_phymars_para.e"
     26pcm_exe="gcm_64x48x32_phymars_para.e"
    2727
    2828# Execution command:
    29 exe_cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$exePCM"
     29exec_cmd="srun --ntasks-per-node=${SLURM_NTASKS_PER_NODE} --cpu-bind=none --mem-bind=none --label -- ./adastra_cpu_binding.sh ./$pcm_exe"
    3030########################################################################
    3131
     
    3636read n_yr_sim ntot_yr_sim r_plnt2earth_yr i_pcm_run i_pem_run n_pcm_runs n_pcm_runs_ini < pem_workflow.sts
    3737echo "Run \"PCM $i_pcm_run\" is starting."
    38 cp run_PCM.def run.def
    39 eval "$exe_cmd > run.log 2>&1"
     38cp run_pcm.def run.def
     39eval "$exec_cmd > run.log 2>&1"
    4040if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally
    4141    echo "Error: the run \"PCM $i_pcm_run\" crashed!"
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pem_run.job

    r4072 r4074  
    2121
    2222# Name of executable for the PEM:
    23 exePEM="pem_64x48x32_phymars_seq.e"
     23pem_exe="pem_64x48x32_phymars_seq.e"
    2424
    2525# Argument for the PEM execution ("--auto-exit" for SLURM and PBS/TORQUE | "" when the script is not run as a job):
    26 arg_pem="--auto-exit"
     26pem_arg="--auto-exit"
    2727########################################################################
    2828
     
    3333read n_yr_sim ntot_yr_sim r_plnt2earth_yr i_pcm_run i_pem_run n_pcm_runs n_pcm_runs_ini < pem_workflow.sts
    3434echo "Run \"PEM $i_pem_run\" is starting."
    35 cp run_PEM.def run.def
    36 eval "./$exePEM $arg_pem > run.log 2>&1"
     35cp run_pem.def run.def
     36eval "./$pem_exe $pem_arg > run.log 2>&1"
    3737if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "so far, so good!"); then # Check if it ended abnormally
    3838    echo "Error: the run \"PEM $i_pem_run\" crashed!"
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow.sh

    r4072 r4074  
    6868        submit_cycle $exec_mode $n_pcm_runs
    6969
    70     # Starting a resume
     70    # Starting a resumption of the workflow
    7171    elif [ $1 = "re" ]; then
    7272        if [ ! -f "pem_workflow.sts" ]; then
     
    132132        fi
    133133
    134     # Continuing the PEM run
    135     elif [ $1 = "cont" ]; then
    136         exec >> pem_workflow.log 2>&1
    137         echo
    138         echo "This is a continuation of the previous PEM run."
    139         date
    140         submit_pem_phase $exec_mode
     134    # Continuing a PEM run
     135    # CANNOT BE DONE FOR NOW BECAUSE THE PEM DOES NOT SAVE ITS STATE TO BE ABLE TO RECOVER
     136    #elif [ $1 = "cont" ]; then
     137    #    exec >> pem_workflow.log 2>&1
     138    #    echo
     139    #    echo "This is a continuation of the previous PEM run."
     140    #    date
     141    #    submit_pem_phase $exec_mode
    141142
    142143    # Default case: error
  • trunk/LMDZ.COMMON/libf/evolution/deftank/pem_workflow_lib.sh

    r4072 r4074  
    4848        ns=$(ncdump -h startfi.nc | sed -n 's/.*nslope = \([0-9]*\) ;.*/\1/p')
    4949    else
    50         for f in run_PCM.def callphys.def; do
     50        for f in run_pcm.def callphys.def; do
    5151            if [[ -f "$f" ]]; then
    5252                while IFS= read -r line; do
     
    162162                  print val
    163163                  exit
    164                   }' run_PCM.def)
     164                  }' run_pcm.def)
    165165
    166166    if [ -z "$sol_in_file" ]; then
    167         echo "Error: no length of year found in \"run_PCM.def\"!"
     167        echo "Error: no length of year found in \"run_pcm.def\"!"
    168168        abort_workflow
    169169    elif [ "$sol_in_file" -eq "$year_sol" ]; then
     
    171171        :
    172172    else
    173         echo "Error: length of year mismatch between \"run_PCM.def\" ($sol_in_file) and \"startfi.nc\" ($year_sol)!"
     173        echo "Error: length of year mismatch between \"run_pcm.def\" ($sol_in_file) and \"startfi.nc\" ($year_sol)!"
    174174        abort_workflow
    175175    fi
     
    212212        abort_workflow
    213213    fi
    214     if [ ! -f "run_PCM.def" ]; then
    215         echo "Error: file \"run_PCM.def\" does not exist in $dir!"
    216         abort_workflow
    217     fi
    218     if [ ! -f "run_PEM.def" ]; then
    219         echo "Error: file \"run_PEM.def\" does not exist in $dir!"
     214    if [ ! -f "run_pcm.def" ]; then
     215        echo "Error: file \"run_pcm.def\" does not exist in $dir!"
     216        abort_workflow
     217    fi
     218    if [ ! -f "run_pem.def" ]; then
     219        echo "Error: file \"run_pem.def\" does not exist in $dir!"
    220220        abort_workflow
    221221    fi
  • trunk/LMDZ.COMMON/libf/evolution/deftank/run_pem.def

    r4073 r4074  
    1717# pem_ini_earth_date=0
    1818
    19 # Do you want the obliquity to eveolve when following "obl_ecc_lsp.asc"? Default = .true.
     19# Do you want the obliquity to evolve when following "obl_ecc_lsp.asc"? Default = .true.
    2020# evol_obl=.true.
    2121
     
    5656
    5757# Do you want to run with adsorption/desorption in the PEM? Default = .false.
    58 # sorption=.false.
     58# do_sorption=.false.
    5959
    6060# Do you want to modify the soil thermal properties with the pressure? Default = .false.
     
    102102# dust2ice_ratio=0.1
    103103
    104 # Some definitions for the physics in file "run_PCM.def"
    105 INCLUDEDEF=run_PCM.def
     104# Some definitions for the physics in file "run_pcm.def"
     105INCLUDEDEF=run_pcm.def
Note: See TracChangeset for help on using the changeset viewer.