Last change
on this file since 3024 was
3024,
checked in by jbclement, 17 months ago
|
Mars Deftank:
Addition of a bash script "modify_startfi.sh" to modify orbital parameters in "startfi.nc". It is needed to initialize the PCM/PEM simulation with right orbital parameters according to the year in Laskar data.
JBC
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3024] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | # Bash script to modify the orbital parameters of a file "startfi.nc" |
---|
| 4 | name_file="startfi.nc" |
---|
| 5 | |
---|
| 6 | new_obl=30. |
---|
| 7 | new_exc=0. |
---|
| 8 | new_Lsp=250. |
---|
| 9 | |
---|
| 10 | year_day=669. |
---|
| 11 | halfaxe=227.94 |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | # Calculate modified values |
---|
| 15 | pi=$(echo "4*a(1)" | bc -l) |
---|
| 16 | arg=$(echo "0.5*2.*$pi*$new_Lsp/360." | bc -l) |
---|
| 17 | zx0=$(echo "-2.*-2.0*a(s($arg)/c($arg)*sqrt((1. - $new_exc)/(1. + $new_exc)))" | bc -l) |
---|
| 18 | if [ $(echo "$zx0 < 0" | bc -l) -eq 1 ]; then |
---|
| 19 | zx0=$(echo "$zx0 + 2.*$pi" | bc -l) |
---|
| 20 | fi |
---|
| 21 | solp=$(echo "$year_day*(1.-($zx0 - $new_exc*s($zx0))/(2*$pi))" | bc -l) |
---|
| 22 | |
---|
| 23 | # Update the netCDF file |
---|
| 24 | # controle(15) = periheli ! min. Sun-Mars distance (Mkm) ̃206.66 |
---|
| 25 | # controle(16) = aphelie ! max. SUn-Mars distance (Mkm) ̃249.22 |
---|
| 26 | # controle(16) = peri_day ! date of perihelion (sols since N. spring) |
---|
| 27 | # controle(18) = obliquit ! Obliquity of the planet (deg) ̃23.98 |
---|
| 28 | 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 |
---|
| 33 | |
---|
| 34 | # Rename the temporary file back to the original filename |
---|
| 35 | mv $name_file.temp $name_file |
---|
Note: See
TracBrowser
for help on using the repository browser.