Changeset 4065 for trunk/LMDZ.COMMON/libf/evolution/deftank
- Timestamp:
- Feb 12, 2026, 9:09:12 AM (2 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution/deftank
- Files:
-
- 8 edited
-
PCMrun.job (modified) (2 diffs)
-
PEMrun.job (modified) (3 diffs)
-
README (modified) (3 diffs)
-
concat_pem.py (modified) (2 diffs)
-
inipem_orbit.sh (modified) (1 diff)
-
launchPEM.sh (modified) (4 diffs)
-
lib_launchPEM.sh (modified) (13 diffs)
-
run_PEM.def (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/deftank/PCMrun.job
r3981 r4065 34 34 35 35 # Running the PCM 36 read i_ myear n_myear convert_yearsiPCM iPEM nPCM nPCM_ini < launchPEM.info36 read i_year n_year r_plnt2earth_yr iPCM iPEM nPCM nPCM_ini < launchPEM.info 37 37 echo "Run \"PCM $iPCM\" is starting." 38 38 cp run_PCM.def run.def … … 74 74 fi 75 75 ((iPCM++)) 76 sed -i "1s/.*/$i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info76 sed -i "1s/.*/$i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info -
trunk/LMDZ.COMMON/libf/evolution/deftank/PEMrun.job
r3980 r4065 31 31 32 32 # Running the PEM 33 read i_ myear n_myear convert_yearsiPCM iPEM nPCM nPCM_ini < launchPEM.info33 read i_year n_year r_plnt2earth_yr iPCM iPEM nPCM nPCM_ini < launchPEM.info 34 34 echo "Run \"PEM $iPEM\" is starting." 35 35 cp run_PEM.def run.def … … 42 42 # Copy data files and prepare the next run 43 43 mv run.log logs/runPEM${iPEM}.log 44 if [ -f "diag pem.nc" ]; then45 mv diag pem.nc diags/diagpem${iPEM}.nc44 if [ -f "diagevol.nc" ]; then 45 mv diagevol.nc diags/diagevol${iPEM}.nc 46 46 fi 47 if [ -f "diag soilpem.nc" ]; then48 mv diag soilpem.nc diags/diagsoilpem${iPEM}.nc47 if [ -f "diagevol_soil.nc" ]; then 48 mv diagevol_soil.nc diags/diagevol_soil${iPEM}.nc 49 49 fi 50 50 cp restartpem.nc starts/restartpem${iPEM}.nc … … 62 62 # Launch the next cycle 63 63 #if [ "$(awk 'END{print $NF}' launchPEM.info)" -eq 7 ]; then 64 # read i_ myear n_myear convert_yearsiPCM iPEM nPCM nPCM_ini < launchPEM.info64 # read i_year n_year r_plnt2earth_yr iPCM iPEM nPCM nPCM_ini < launchPEM.info 65 65 # ./launchPEM.sh cont # Continue the PEM run if it stopped because of job time limit 66 66 #else -
trunk/LMDZ.COMMON/libf/evolution/deftank/README
r3981 r4065 47 47 > the starting files you want to run the PCM: "startfi.nc", "start.nc"/"start1D.txt"/profiles; 48 48 > the necessary PEM files: "launchPEM.sh", "lib_launchPEM.sh", "PCMrun.job", "PEMrun.job", "run_PEM.def" and "obl_ecc_lsp.asc"; 49 > the optional PEM files: "diag pem.def" to define the PEM variables to be ouputted and "startpem.nc" to set the initial state of the PEM.49 > 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. 50 50 51 51 The PEM files can be found in the deftank folder. … … 64 64 > the XIOS outputs of the PCM: "Xoutdaily4pem*.nc"/"Xoutyearly4pem*.nc"; 65 65 > the outputs of the chained simulation: "launchPEM.log", "launchPEM.info" and possibly "kill_launchPEM.sh"; 66 > the usual outputs of the PEM: "restartfi.nc", "restart.nc"/"restart1D.txt" and "diag pem.nc".66 > the usual outputs of the PEM: "restartfi.nc", "restart.nc"/"restart1D.txt" and "diagevol.nc". 67 67 During the simulation, the PCM/PEM run files are renamed conveniently and stored in the sub-directories "logs" (log files), "starts" (starting files) and "diags" (diagnostic files). 68 68 If you run a simulation by submitting jobs, the script "kill_launchPEM.sh" is automatically generated. It can be used to kill in the queue of the job scheduler the jobs related to your chained simulation. … … 114 114 115 115 # inipem_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 ' year_earth_bp_ini' 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". 117 117 118 118 # concat_pem.py: -
trunk/LMDZ.COMMON/libf/evolution/deftank/concat_pem.py
r3883 r4065 35 35 parser.add_argument( 36 36 "--basename", type=str, 37 help="Base name of the files, e.g., 'diag pem' for files like diagpem1.nc"37 help="Base name of the files, e.g., 'diagevol' for files like diagevol1.nc" 38 38 ) 39 39 parser.add_argument( … … 88 88 # Defaults 89 89 default_folder = args.folder or "diags" 90 default_basename = args.basename or "diag pem"90 default_basename = args.basename or "diagevol" 91 91 92 92 # Prompt for folder and basename with defaults -
trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh
r3666 r4065 36 36 37 37 # Get the number of Earth years before present to start the PEM run 38 eyears_bp_ini=$(grep ' year_earth_bp_ini=' $date_file | cut -d '=' -f 2 | tr -d '[:space:]')38 eyears_bp_ini=$(grep 'pem_ini_earth_date=' $date_file | cut -d '=' -f 2 | tr -d '[:space:]') 39 39 echo "In \"$date_file\":" 40 40 echo "The starting date is $eyears_bp_ini Earth years." -
trunk/LMDZ.COMMON/libf/evolution/deftank/launchPEM.sh
r3981 r4065 14 14 # Modify here the parameters for the simulation 15 15 ############################################### 16 # Set the number of years to be simulated, either Martianor Earth years (> 0):17 n_ mars_years=100.16 # Set the number of years to be simulated, either Planetary or Earth years (> 0): 17 n_planetary_years=100. 18 18 #n_earth_years=300. 19 19 … … 65 65 fi 66 66 fi 67 read i_ myear n_myear convert_yearsiPCM iPEM nPCM nPCM_ini < launchPEM.info67 read i_year n_year r_plnt2earth_yr iPCM iPEM nPCM nPCM_ini < launchPEM.info 68 68 cyclelaunch $mode $nPCM 69 69 … … 85 85 fi 86 86 done 87 read i_ myear n_myear_old convert_yearsiPCM iPEM nPCM_old nPCM_ini_old < launchPEM.info87 read i_year n_year_old r_plnt2earth_yr iPCM iPEM nPCM_old nPCM_ini_old < launchPEM.info 88 88 while true; do 89 89 if [ $relaunch = "PCM" ]; then … … 119 119 echo "The number of PCM years between each PEM run has been modified from $nPCM_old to $nPCM." 120 120 fi 121 if [ "$(echo "$n_ myear != $n_myear_old" | bc)" -eq 1 ]; then122 echo "The number of initial PCM years has been modified from $n_ myear_old to $n_myear."121 if [ "$(echo "$n_year != $n_year_old" | bc)" -eq 1 ]; then 122 echo "The number of initial PCM years has been modified from $n_year_old to $n_year." 123 123 fi 124 sed -i "1s/.*/$i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info124 sed -i "1s/.*/$i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 125 125 if [ -f "kill_launchPEM.sh" ]; then 126 126 ./kill_launchPEM.sh -
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3981 r4065 150 150 # To check if a PCM run is one year 151 151 check_runyear() { 152 if [ -f " run_PCM.def" ]; then152 if [ -f "startfi.nc" ]; then 153 153 year_sol=$(ncdump -v controle startfi.nc 2>/dev/null | \ 154 154 sed -n '/controle =/,/;/p' | tr -d '[:space:]' | \ 155 155 sed 's/.*=//; s/;//' | tr ',' '\n' | sed -n '14p') 156 156 else 157 echo "Warning: no \"startfi.nc\" found! So default year_sol=669 (Mars year) is taken..." 157 158 year_sol=669 # Length of Martian year (sols) 158 159 fi … … 182 183 LC_NUMERIC=en_US.UTF-8 183 184 184 if [ -v n_ mars_years ] && [ ! -z "$n_mars_years" ]; then185 if [ $(echo "$n_ mars_years <= 0." | bc -l) -eq 1 ]; then186 echo "Error: 'n_ mars_years' must be > 0!"185 if [ -v n_planetary_years ] && [ ! -z "$n_planetary_years" ]; then 186 if [ $(echo "$n_planetary_years <= 0." | bc -l) -eq 1 ]; then 187 echo "Error: 'n_planetary_years' must be > 0!" 187 188 errlaunch 188 189 fi … … 259 260 myear=686.9725 # Number of Earth days in Martian year 260 261 eyear=365.256363004 # Number of days in Earth year 261 convert_years=$(echo "$myear/$eyear" | bc -l)262 convert_years=$(printf "%.4f" $convert_years) # Rounding to the 4th decimal to respect the precision of Martian year263 if [ -v n_ mars_years ]; then264 n_ myear=$n_mars_years265 echo "Number of years to be simulated: $n_ myear Martian years."262 r_plnt2earth_yr=$(echo "$myear/$eyear" | bc -l) 263 r_plnt2earth_yr=$(printf "%.4f" $r_plnt2earth_yr) # Rounding to the 4th decimal to respect the precision of Martian year 264 if [ -v n_planetary_years ]; then 265 n_year=$n_planetary_years 266 echo "Number of years to be simulated: $n_year Martian years." 266 267 elif [ -v n_earth_years ]; then 267 n_ myear=$(echo "$n_earth_years/$convert_years" | bc -l)268 echo "Number of years to be simulated: $n_earth_years Earth years = $n_ myear Martian years."268 n_year=$(echo "$n_earth_years/$r_plnt2earth_yr" | bc -l) 269 echo "Number of years to be simulated: $n_earth_years Earth years = $n_year Martian years." 269 270 fi 270 271 } … … 274 275 echo "This is a chained simulation for PEM and PCM runs in $dir on $machine by $user." 275 276 convertyears 276 i_ myear=0.277 i_year=0. 277 278 iPEM=1 278 279 iPCM=1 … … 290 291 291 292 # Create a file to manage years of the chained simulation and store some info from the PEM runs 292 echo $i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini > launchPEM.info293 echo $i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini > launchPEM.info 293 294 } 294 295 … … 303 304 ii=$3 304 305 fi 305 if [ $(echo "$i_ myear < $n_myear" | bc -l) -eq 1 ]; then306 if [ $(echo "$i_year < $n_year" | bc -l) -eq 1 ]; then 306 307 echo "Run \"PCM $iPCM\" ($ii/$2)" 307 308 if [ $1 -eq 0 ]; then # Mode: processing scripts … … 331 332 fi 332 333 for ((i = $ii; i <= $2; i++)); do 333 if [ $(echo "$i_ myear < $n_myear" | bc -l) -eq 1 ]; then334 if [ $(echo "$i_year < $n_year" | bc -l) -eq 1 ]; then 334 335 echo "Run \"PCM $iPCM\" ($i/$2)" 335 336 if [ $1 -eq 0 ]; then # Mode: processing scripts … … 360 361 # arg1: launching mode 361 362 submitPEM() { 362 if [ $(echo "$i_ myear < $n_myear" | bc -l) -eq 1 ]; then363 if [ $(echo "$i_year < $n_year" | bc -l) -eq 1 ]; then 363 364 echo "Run \"PEM $iPEM\"" 364 365 if [ $1 -eq 0 ]; then # Mode: processing scripts … … 393 394 394 395 # PEM run 395 if [ $(echo "$i_ myear < $n_myear" | bc -l) -eq 1 ]; then396 if [ $(echo "$i_year < $n_year" | bc -l) -eq 1 ]; then 396 397 echo "Run \"PEM $iPEM\"" 397 398 if [ $1 -eq 0 ]; then # Mode: processing scripts … … 460 461 # PCM relaunch during the initialization cycle 461 462 iPEM=1 462 i_ myear=0463 sed -i "1s/.*/$i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info464 cleanfiles diags/diag pem.nc $(($iPEM - 1))465 cleanfiles diags/diag soilpem.nc $(($iPEM - 1))463 i_year=0 464 sed -i "1s/.*/$i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 465 cleanfiles diags/diagevol .nc $(($iPEM - 1)) 466 cleanfiles diags/diagevol_soil .nc $(($iPEM - 1)) 466 467 cleanfiles logs/runPEM .log $(($iPEM - 1)) 467 468 cleanfiles starts/restart1D_postPEM .txt $(($iPEM - 1)) … … 490 491 iPEM=$(echo "($iPCM - $nPCM_ini)/$nPCM + 1" | bc) 491 492 il=$(echo "($irelaunch - $nPCM_ini + 1)%$nPCM + 1" | bc) 492 i_ myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info")493 sed -i "1s/.*/$i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info494 cleanfiles diags/diag pem.nc $(($iPEM - 1))495 cleanfiles diags/diag soilpem.nc $(($iPEM - 1))493 i_year=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info") 494 sed -i "1s/.*/$i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 495 cleanfiles diags/diagevol .nc $(($iPEM - 1)) 496 cleanfiles diags/diagevol_soil .nc $(($iPEM - 1)) 496 497 cleanfiles logs/runPEM .log $(($iPEM - 1)) 497 498 cleanfiles starts/restart1D_postPEM .txt $(($iPEM - 1)) … … 521 522 iPEM=$(echo "$irelaunch + 1" | bc) 522 523 iPCM=$(echo "$nPCM_ini + $nPCM*($irelaunch - 1) + 1" | bc) 523 i_ myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info")524 sed -i "1s/.*/$i_ myear $n_myear $convert_years$iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info524 i_year=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "launchPEM.info") 525 sed -i "1s/.*/$i_year $n_year $r_plnt2earth_yr $iPCM $iPEM $nPCM $nPCM_ini/" launchPEM.info 525 526 cleanfiles diags/diagfi .nc $(($iPCM - 1)) 526 527 cleanfiles diags/diagsoil .nc $(($iPCM - 1)) … … 531 532 cleanfiles diags/Xoutdaily4pem .nc $(($iPCM - 1)) 532 533 cleanfiles diags/Xoutyearly4pem .nc $(($iPCM - 1)) 533 cleanfiles diags/diag pem.nc $irelaunch534 cleanfiles diags/diag soilpem.nc $irelaunch534 cleanfiles diags/diagevol .nc $irelaunch 535 cleanfiles diags/diagevol_soil .nc $irelaunch 535 536 cleanfiles logs/runPEM .log $irelaunch 536 537 cleanfiles starts/restart1D_postPEM .txt $irelaunch -
trunk/LMDZ.COMMON/libf/evolution/deftank/run_PEM.def
r3989 r4065 15 15 16 16 # If evol_orbit=.true., number of Earth years before present to start the PEM run. Default = 0 17 # year_earth_bp_ini=017 # pem_ini_earth_date=0 18 18 19 # Do you want t o vary the obliquitywhen following "obl_ecc_lsp.asc"? Default = .true.20 # var_obl=.true.19 # Do you want the obliquity to eveolve when following "obl_ecc_lsp.asc"? Default = .true. 20 # evol_obl=.true. 21 21 22 # Do you want t o vary the eccentricitywhen following "obl_ecc_lsp.asc"? Default = .true.23 # var_ecc=.true.22 # Do you want the eccentricity to evolve when following "obl_ecc_lsp.asc"? Default = .true. 23 # evol_ecc=.true. 24 24 25 # Do you want t o vary the ls perihelie when following "obl_ecc_lsp.asc"? Default = .true.26 # var_lsp=.true.25 # Do you want the ls perihelie to evolve when following "obl_ecc_lsp.asc"? Default = .true. 26 # evol_lsp=.true. 27 27 28 28 # Time step length of the PEM in Martian years? Default = 1. … … 31 31 #---------- Stopping criteria parameters ----------# 32 32 # If evol_orbit=.false., maximal number of iterations if no stopping criterion is reached. Default=100000000. 33 # n years_max=10000000033 # nmax_yr_run=100000000 34 34 35 35 # Acceptance rate of sublimating H2O ice surface change. Default = 0.2 … … 62 62 63 63 # Value of the geothermal flux. Default = 0. 64 # flux geo=0.64 # flux_geo=0. 65 65 66 66 # Depth at which the breccia layer begins. Default = 10 m … … 81 81 82 82 # Threshold to consider the amount of H2O ice as an infinite reservoir. Default = 460. kg.m-2 (= 0.5 m) 83 # h2oice_cap_threshold=460.83 # threshold_h2oice_cap=460. 84 84 85 85 # Do you want the H2O ice to flow along subslope inside a cell? Default = .true. … … 91 91 #---------- Layering parameters ----------# 92 92 # Do you want to run with the layering algorithm? Default = .false. 93 # layering=.false.93 # do_layering=.false. 94 94 95 95 # Value of the dust tendency. Default = 5.78e-2 kg.m-2.y-1 … … 103 103 104 104 # Some definitions for the physics, in file 'callphys.def' 105 INCLUDEDEF= callphys.def105 INCLUDEDEF=run_PCM.def
Note: See TracChangeset
for help on using the changeset viewer.
