Changeset 3428


Ignore:
Timestamp:
Sep 16, 2024, 6:18:30 PM (2 months ago)
Author:
jbclement
Message:

PEM:
Corrections and improvements for the launching script.
JBC

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

Legend:

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

    r3426 r3428  
    419419== 06/09/2024 == JBC
    420420Modification in the way of updating the soil temperatures to improve the computation time  + Small correction in the calculation of 'timestep'.
     421
     422== 16/09/2024 == JBC
     423Corrections and improvements for the launching script.
  • trunk/LMDZ.COMMON/libf/evolution/deftank/clean.sh

    r3394 r3428  
    3333    cp starts/start1D.txt .
    3434fi
     35if [ -f "starts/startpem.nc" ]; then
     36    cp starts/startpem.nc .
     37fi
    3538# Cleaning of files in the sub-folders
    3639rm -f diags/*
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3403 r3428  
    151151    elif [ -f "star1D.nc" ]; then
    152152        cp star1D.txt starts/
     153    fi
     154    if [ -f "startpem.nc" ]; then
     155        cp startpem.nc starts/
    153156    fi
    154157
     
    317320    else
    318321        # PCM relaunch during a cycle
    319         iPEM=$((($irelaunch - $nPCM_ini)/$nPCM + 1))
    320         il=$(echo "($irelaunch - $nPCM_ini)%$nPCM" | bc -l)
     322        iPEM=$((($irelaunch - $nPCM_ini - 1)/$nPCM + 1))
     323        il=$(echo "($irelaunch - $nPCM_ini - 1)%$nPCM + 1" | bc -l)
    321324        cleanfiles diags/diagpem .nc $iPEM
    322325        cleanfiles "out_PEM/run" "" $iPEM
     
    326329        cleanfiles starts/restartpem .nc $iPEM
    327330        cp starts/restartpem${iPEM}.nc startpem.nc
    328         if [ $il -eq $(($nPCM - 1)) ]; then
     331        if [ $il -eq $(($nPCM - 1)) ]; then # Second to last PCM run
    329332            i_myear=$(($(awk "NR==$iPEM {print \$1}" "info_PEM.txt") + $il))
    330333            sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    331334            cp diags/data2reshape${irelaunch}.nc data2reshape_Y1.nc
    332335            cyclelaunch $1 $nPCM $il
    333         elif [ $il -eq 0 ]; then
     336        elif [ $il -eq $nPCM ]; then # Last PCM run so the next job is a PEM run
    334337            i_myear=$(($(awk "NR==$iPEM {print \$1}" "info_PEM.txt") + $nPCM))
    335338            sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    336339            cp diags/data2reshape$(($irelaunch - 1)).nc data2reshape_Y1.nc
    337340            cp diags/data2reshape${irelaunch}.nc data2reshape_Y2.nc
    338             submitPEM $1 # The next job is a PEM run
     341            submitPEM $1
    339342        else
    340343            i_myear=$(($(awk "NR==$iPEM {print \$1}" "info_PEM.txt") + $il))
     
    349352relaunchPEM() {
    350353    iPEM=$irelaunch
    351     iPCM=$(($nPCM_ini + ($nPCM - 1)*$irelaunch + 1))
     354    iPCM=$(($nPCM_ini + $nPCM*($irelaunch - 1) + 1))
    352355    i_myear=$(awk "NR==$(($iPEM + 1)) {print \$1}" "info_PEM.txt")
    353356    sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
Note: See TracChangeset for help on using the changeset viewer.