Changeset 3666 for trunk/LMDZ.COMMON/libf/evolution/deftank
- Timestamp:
- Feb 28, 2025, 5:51:32 PM (5 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution/deftank
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/deftank/inipem_orbit.sh
r3579 r3666 15 15 # Name of the file containing the orbital data 16 16 orb_data="obl_ecc_lsp.asc" 17 18 # Name of the file containing the starting date (Earth years) 19 date_file="run_PEM.def" 17 20 ###################################################################### 18 21 … … 23 26 exit 1 24 27 fi 25 if [ ! -f " startfi.nc" ]; then28 if [ ! -f "$name_file" ]; then 26 29 echo "Error: file \"$name_file\" not found!" 27 30 exit 1 28 31 fi 29 if [ ! -f " run_PEM.def" ]; then30 echo "Error: file \" run_PEM.def\" not found!"32 if [ ! -f "$date_file" ]; then 33 echo "Error: file \"$date_file\" not found!" 31 34 exit 1 32 35 fi 33 36 34 # Get the number of Earth years before present to start the PEM run from "run_PEM.def" 35 eyears_bp_ini=$(grep 'year_earth_bp_ini=' run_PEM.def | cut -d '=' -f 2 | tr -d '[:space:]') 36 echo "The starting date is $eyears_bp_ini Earth years according to \"run_PEM.def\"." 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:]') 39 echo "In \"$date_file\":" 40 echo "The starting date is $eyears_bp_ini Earth years." 37 41 38 42 # Get the new values for the orbital parameters … … 58 62 fi 59 63 new_Lsp=$(echo "($lsp2 - $lsp1)/($y2 - $y1)*($yearlask - $y1) + $lsp1" | bc -l) 60 echo " New obliquity = $new_obl"61 echo " New eccentricity = $new_ecc"62 echo " New Lsp = $new_Lsp"63 echo " Done!"64 echo "In \"$orb_data\":" 65 echo "Found obliquity = $new_obl" 66 echo "Found eccentricity = $new_ecc" 67 echo "Found Lsp = $new_Lsp" 64 68 break 65 69 fi … … 95 99 peri_day=$(echo "$year_day*(1. - ($zx0 - $new_ecc*s($zx0))/(2.*$pi))" | bc -l) 96 100 97 ztheta=$(echo "($new_iniLs - $new_Lsp)/$degrad" | bc -l)98 tan=$(echo "s(0.5*$ztheta)/c(0.5*$ztheta)" | bc -l)99 zx0=$(echo "2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l)100 xref=$(echo "$zx0 - $new_ecc*s($zx0)" | bc -l)101 new_inisol=$(echo "$peri_day + $xref*$year_day/(2.*$pi)" | bc -l)102 if [ $(echo "$new_inisol < 0." | bc -l) -eq 1 ]; then103 new_inisol=$(echo "$new_inisol + $year_day" | bc -l)104 fi105 if [ $(echo "$new_inisol >= $year_day" | bc -l) -eq 1 ]; then106 new_inisol=$(echo "$new_inisol - $year_day" | bc -l)107 fi108 109 101 # Update the netCDF file 110 102 # controle(15) = periheli ! min. Sun-Mars distance (Mkm) ̃206.66 … … 117 109 -s "controle(15)=$aphelie" \ 118 110 -s "controle(16)=$peri_day" \ 119 -s "controle(2)=$new_inisol" \120 111 $name_file $name_file 121 112 … … 123 114 echo "New obliquit = $new_obl" 124 115 echo "New eccentricity = $new_ecc -> new periheli = $periheli" 125 echo " -> new aphelie = $aphelie"116 echo " -> new aphelie = $aphelie" 126 117 echo "New Lsp = $new_Lsp -> new peri_day = $peri_day" 127 echo "New initial Ls = $new_iniLs -> New initial sol = $new_inisol"128 118 echo "Done!" -
trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh
r3649 r3666 181 181 else # Mode: submitting jobs 182 182 cp PCMrun.job PCMrun${iPCM}.job 183 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPCM}\2/" PCMrun${iPCM}.job183 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPCM}\3/" PCMrun${iPCM}.job 184 184 sed -i "s/^k=[0-9]\+$/k=$(echo "$ii - $3 + 2" | bc)/" PCMrun${iPCM}.job 185 185 jobID=$(eval "$submit_job PCMrun${iPCM}.job") … … 208 208 else # Mode: submitting jobs 209 209 cp PCMrun.job PCMrun${iPCM}.job 210 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPCM}\2/" PCMrun${iPCM}.job210 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPCM}\3/" PCMrun${iPCM}.job 211 211 sed -i "s/^k=[0-9]\+$/k=$(echo "$i - $3 + 2" | bc)/" PCMrun${iPCM}.job 212 212 jobID=$(eval "$submit_dependjob=afterok:${jobID} PCMrun${iPCM}.job") … … 234 234 fi 235 235 else # Mode: submitting jobs 236 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPEM}\2/" PEMrun.job236 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPEM}\3/" PEMrun.job 237 237 jobID=$(eval "$submit_job PEMrun.job") 238 238 # Create a file to cancel the dependent jobs of the cycle … … 264 264 fi 265 265 else # Mode: submitting jobs 266 sed -i -E " s/($name_job[^0-9]*)[0-9]+([^0-9]*)$/\1${iPEM}\2/" PEMrun.job266 sed -i -E "/^$name_job/s/(.*[^0-9])([0-9]+)(_[^0-9]*)?$/\1${iPEM}\3/" PEMrun.job 267 267 jobID=$(eval "$submit_dependjob=afterok:${jobID} PEMrun.job") 268 268 echo $kill_job $jobID >> kill_launchPEM.sh -
trunk/LMDZ.COMMON/libf/evolution/deftank/visu_evol_layering.py
r3460 r3666 151 151 ### Processing 152 152 stratif_data, max_top_elevation, longitude, latitude = process_files(folder_path,base_name) 153 if dz > max_top_elevation: 154 print('The discretization step is higher than the maximum top elevation: please provide a correct value!') 155 exit() 153 156 ref_grid, gridded_stratif_data = interpolate_data(stratif_data,max_top_elevation,dz) 154 157 date_time = read_infofile(infofile)
Note: See TracChangeset
for help on using the changeset viewer.