Changeset 3386 for trunk/LMDZ.COMMON


Ignore:
Timestamp:
Jun 19, 2024, 6:35:12 PM (5 months ago)
Author:
jbclement
Message:

PEM:

  • Correction for the initialization in 1D due to the change of 'ecritphy' into 'outputs_per_sol' in r3369.
  • Correction in the condition to check the normal end of a PCM/PEM run in "jobP*M.slurm" files.
  • Correction of files cleaning in the launching script.
  • Improvement of the launching script to take into account the modification of parameters for a relaunch.

JBC

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

Legend:

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

    r3384 r3386  
    375375== 18/06/2024 == JBC
    376376Correction related to r3330 for the initialization of the global average pressure taken from the PCM: it has to be done before the call of "pemetat0".
     377
     378== 19/06/2024 == JBC
     379- Correction for the initialization in 1D due to the change of 'ecritphy' into 'outputs_per_sol' in r3369.
     380- Correction in the condition to check the normal end of a PCM/PEM run in "jobP*M.slurm" files.
     381- Correction of files cleaning in the launching script.
     382- Improvement of the launching script to take into account the modification of parameters for a relaunch.
  • trunk/LMDZ.COMMON/libf/evolution/deftank/jobPCM.slurm

    r3354 r3386  
    3030cp run_PCM.def run.def
    3131srun --cpu-bind=threads --label -c${OMP_NUM_THREADS:=1} $exePCM > out_runPCM${iPCM} 2>&1
    32 if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPCM${iPCM} | grep -iq "everything is cool!" ]; then # Check if it ended abnormally
     32if [ ! -f "restartfi.nc" ] || ! (tail -n 1 out_runPCM${iPCM} | grep -iq "everything is cool!"); then # Check if it ended abnormally
    3333    echo "Error: the run PCM $iPCM crashed!"
    3434    echo "Be careful: there may be dependent jobs remaining in the SLURM queue with status 'DependencyNeverSatisfied'! You can cancel them by executing the script \"kill_launchPEM.sh\"."
     
    3838# Copy data files and prepare the next run
    3939mv out_runPCM${iPCM} out_PCM/run${iPCM}
    40 mv diagfi.nc diags/diagfi${iPCM}.nc
     40if [ -f "diagfi.nc" ]; then
     41    mv diagfi.nc diags/diagfi${iPCM}.nc
     42fi
    4143if [ -f "diagsoil.nc" ]; then
    4244    mv diagsoil.nc diags/diagsoil${iPCM}.nc
  • trunk/LMDZ.COMMON/libf/evolution/deftank/jobPEM.slurm

    r3363 r3386  
    3838cp run_PEM.def run.def
    3939./$exePEM > out_runPEM${iPEM} 2>&1
    40 if [ ! -f "restartfi.nc" ] || [ ! tail -n 1 out_runPEM${iPEM} | grep -iq "so far, so good!" ]; then # Check if it ended abnormally
     40if [ ! -f "restartfi.nc" ] || ! (tail -n 1 out_runPEM${iPEM} | grep -iq "so far, so good!"); then # Check if it ended abnormally
    4141    echo "Error: the run PEM $iPEM crashed!"
    4242    exit 1
     
    4545# Copy data files and prepare the next run
    4646mv out_runPEM${iPEM} out_PEM/run${iPEM}
    47 mv diagpem.nc diags/diagpem${iPEM}.nc
     47if [ -f "diagpem.nc" ]; then
     48    mv diagpem.nc diags/diagpem${iPEM}.nc
     49fi
    4850if [ -f "diagsoilpem.nc" ]; then
    4951    mv diagsoilpem.nc diags/diagsoilpem${iPEM}.nc
  • trunk/LMDZ.COMMON/libf/evolution/deftank/launchPEM.sh

    r3383 r3386  
    7474            fi
    7575        done
    76         read i_myear n_myear convert_years iPCM iPEM nPCM nPCM_ini < info_PEM.txt
     76        read i_myear n_myear_old convert_years iPCM iPEM nPCM_old nPCM_ini_old < info_PEM.txt
    7777        while true; do
    7878            if [ $relaunch = "PCM" ]; then
     
    101101        date
    102102        checklaunch
     103        convertyears
     104        if [ $nPCM_ini -ne $nPCM_ini_old ]; then
     105            echo "The number of initial PCM runs has been modified from $nPCM_ini_old to $nPCM_ini."
     106        fi
     107        if [ $nPCM -ne $nPCM_old ]; then
     108            echo "The number of PCM runs between each PEM run has been modified from $nPCM_old to $nPCM."
     109        fi
     110        if [ $n_myear -ne $n_myear_old ]; then
     111            echo "The number of initial PCM runs has been modified from $n_myear_old to $n_myear."
     112        fi
     113        sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    103114        if [ $relaunch = "PCM" ]; then
    104115            relaunchPCM
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3383 r3386  
    108108}
    109109
    110 # To initialize the launching script
    111 initlaunch() {
    112     echo "This is a chained simulation for PEM and PCM runs in $dir on $machine by $user."
     110# To convert Earth years into Mars years
     111convertyears() {
    113112    myear=686.9725      # Number of Earth days in Martian year
    114113    eyear=365.256363004 # Number of days in Earth year
     
    122121        echo "Number of years to be simulated: $n_earth_years Earth years = $n_myear Martian years."
    123122    fi
     123}
     124
     125# To initialize the launching script
     126initlaunch() {
     127    echo "This is a chained simulation for PEM and PCM runs in $dir on $machine by $user."
     128    convertyears
    124129    i_myear=0
    125130    iPEM=1
     
    137142
    138143# To submit the PCM runs
     144# arg1: number of PCM runs to launch
     145# arg2: local number of the PCM run from which to start (optional)
    139146submitPCM() {
    140147    find . -type f -name "jobPCM*.slurm" ! -name "jobPCM.slurm" -delete
     
    191198
    192199# To make one cycle of PCM and PEM runs
     200# arg1: number of PCM runs to launch
     201# arg2: local number of the PCM run from which to start (optional)
    193202cyclelaunch() {
    194203    # PCM runs
     
    207216
    208217# To clean files after the starting run of the relaunch
     218# arg1: file name prefix to clean
     219# arg2: file name extension to clean
     220# arg3: file number from which to clean
    209221cleanfiles() {
    210222    prefix=$1
     
    232244    iPCM=$(($irelaunch + 1))
    233245    cleanfiles diags/diagfi .nc $irelaunch
     246    cleanfiles diags/data2reshape .nc $irelaunch
    234247    cleanfiles "out_PCM/run" "" $irelaunch
    235248    cleanfiles starts/restart1D .txt $irelaunch
     
    256269        if [ $irelaunch -eq $(($nPCM_ini - 1)) ]; then
    257270            cp diags/data2reshape${irelaunch}.nc data2reshape_Y1.nc
    258             cleanfiles diags/data2reshape .nc $irelaunch
    259271            cyclelaunch $nPCM_ini $irelaunch
    260272        elif [ $irelaunch -eq $nPCM_ini ]; then
    261273            cp diags/data2reshape$(($irelaunch - 1)).nc data2reshape_Y1.nc
    262274            cp diags/data2reshape${irelaunch}.nc data2reshape_Y2.nc
    263             cleanfiles diags/data2reshape .nc $(($irelaunch - 1))
    264275            submitPEM # The next job is a PEM run
    265276        else
    266             cleanfiles diags/data2reshape .nc 0
    267277            cyclelaunch $nPCM_ini $iPCM
    268278        fi
     
    282292            sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    283293            cp diags/data2reshape${irelaunch}.nc data2reshape_Y1.nc
    284             cleanfiles diags/data2reshape .nc $irelaunch
    285294            cyclelaunch $nPCM $il
    286295        elif [ $il -eq 0 ]; then
     
    289298            cp diags/data2reshape$(($irelaunch - 1)).nc data2reshape_Y1.nc
    290299            cp diags/data2reshape${irelaunch}.nc data2reshape_Y2.nc
    291             cleanfiles diags/data2reshape .nc $(($irelaunch - 1))
    292300            submitPEM # The next job is a PEM run
    293301        else
    294302            i_myear=$(($(awk "NR==$iPEM {print \$1}" "info_PEM.txt") + $il))
    295303            sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    296             cleanfiles diags/data2reshape .nc $irelaunch
    297304            cyclelaunch $nPCM $il
    298305        fi
  • trunk/LMDZ.COMMON/libf/evolution/deftank/visu_layering.py

    • Property svn:executable set to *
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3384 r3386  
    9999    use control_mod,              only: iphysiq, day_step, nsplit_phys
    100100#else
    101     use time_phylmdz_mod,         only: iphysiq, day_step
     101    use time_phylmdz_mod,         only: iphysiq, steps_per_sol
    102102    use regular_lonlat_mod,       only: init_regular_lonlat
    103103    use physics_distribution_mod, only: init_physics_distribution
     
    263263    integer            :: nsplit_phys
    264264    integer, parameter :: jjm_value = jjm - 1
     265    integer            :: day_step
    265266
    266267    ! Dummy variables to use the subroutine 'init_testphys1d'
     
    342343#ifndef CPP_1D
    343344    dtphys = daysec/48. ! Dummy value (overwritten in phyetat0)
     345    day_step = steps_per_sol
    344346    call conf_gcm(99,.true.)
    345347    call infotrac_init
Note: See TracChangeset for help on using the changeset viewer.