Changeset 3038 for trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh
- Timestamp:
- Sep 8, 2023, 7:26:52 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh
r3026 r3038 4 4 name_file="startfi.nc" 5 5 6 new_obl=30.0286 7 new_exc=0.08212066 8 new_Lsp=347.443947402 6 new_obl=25.18941689 7 new_ecc=0.09340902 8 new_Lsp=251.06881714 9 new_iniLs=0. 9 10 10 11 … … 12 13 year_day=669. 13 14 halfaxe=227.94 14 pi=$(echo "4*a(1)" | bc -l) 15 degrad=$(echo "360./(2.*$pi)" | bc -l) 15 pi=$(echo "4.*a(1.)" | bc -l) 16 degrad=$(echo "180./$pi" | bc -l) 17 18 periheli=$(echo "$halfaxe*(1. - $new_ecc)" | bc -l) 19 aphelie=$(echo "$halfaxe*(1. + $new_ecc)" | bc -l) 20 16 21 tan=$(echo "s(0.5*$new_Lsp/$degrad)/c(0.5*$new_Lsp/$degrad)" | bc -l) 17 zx0=$(echo "-2.*a($tan*sqrt((1. -$new_exc)/(1.+$new_exc)))" | bc -l)18 if [ $(echo "$zx0 <= 0 " | bc -l) -eq 1 ]; then22 zx0=$(echo "-2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l) 23 if [ $(echo "$zx0 <= 0." | bc -l) -eq 1 ]; then 19 24 zx0=$(echo "$zx0 + 2.*$pi" | bc -l) 20 25 fi 21 solp=$(echo "$year_day*(1.-($zx0 - $new_exc*s($zx0))/(2*$pi))" | bc -l) 26 peri_day=$(echo "$year_day*(1. - ($zx0 - $new_ecc*s($zx0))/(2.*$pi))" | bc -l) 27 28 ztheta=$(echo "($new_iniLs - $new_Lsp)/$degrad" | bc -l) 29 tan=$(echo "s(0.5*$ztheta)/c(0.5*$ztheta)" | bc -l) 30 zx0=$(echo "2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l) 31 xref=$(echo "$zx0 - $new_ecc*s($zx0)" | bc -l) 32 new_inisol=$(echo "$peri_day + $xref*$year_day/(2.*$pi)" | bc -l) 33 if [ $(echo "$new_inisol < 0." | bc -l) -eq 1 ]; then 34 new_inisol=$(echo "$new_inisol + $year_day" | bc -l) 35 fi 36 if [ $(echo "$new_inisol >= $year_day" | bc -l) -eq 1 ]; then 37 new_inisol=$(echo "$new_inisol - $year_day" | bc -l) 38 fi 22 39 23 40 # Update the netCDF file … … 26 43 # controle(17) = peri_day ! date of perihelion (sols since N. spring) 27 44 # controle(18) = obliquit ! Obliquity of the planet (deg) ̃23.98 45 # controle(3) = day_ini + int(time) ! initial day 28 46 ncap2 -O -s "controle(17)=$new_obl" \ 29 -s "controle(14)=$halfaxe*(1-$new_exc)" \ 30 -s "controle(15)=$halfaxe*(1+$new_exc)" \ 31 -s "controle(16)=$solp" \ 32 $name_file $name_file.temp 47 -s "controle(14)=$periheli" \ 48 -s "controle(15)=$aphelie" \ 49 -s "controle(16)=$peri_day" \ 50 -s "controle(2)=$new_inisol" \ 51 $name_file $name_file.temp 33 52 34 53 # Rename the temporary file back to the original filename 35 54 mv $name_file.temp $name_file 36 55 37 echo New obliquit = $new_obl 38 echo New periheli = $(echo "$halfaxe*(1-$new_exc)" | bc -l) 39 echo New aphelie = $(echo "$halfaxe*(1+$new_exc)" | bc -l) 40 echo New peri_day = $solp 56 echo "In $name_file:" 57 echo "New obliquit = $new_obl" 58 echo "New eccentricity = $new_ecc -> new periheli = $periheli" 59 echo " -> new aphelie = $aphelie" 60 echo "New Lsp = $new_Lsp -> new peri_day = $peri_day" 61 echo "New initial Ls = $new_iniLs -> New initial sol = $new_inisol" 62 echo "Done!"
Note: See TracChangeset
for help on using the changeset viewer.