Ignore:
Timestamp:
Sep 8, 2023, 7:26:52 PM (16 months ago)
Author:
jbclement
Message:

Mars PEM:

  • New version of scripts (launch_pem.sh and exeGCM.sh) to launch the chained simulation of GCM and PEM runs. It should be simpler and clearer for users;
  • Update of README accordingly;
  • ob_ex_lsp.asc is now in Earth years like original Laskar's data + rename obl_ecc_lsp.asc;
  • Some improvements for the script modify_startfi_orbit.sh;
  • Some changes in run_PEM.def and xml files.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh

    r3026 r3038  
    44name_file="startfi.nc"
    55
    6 new_obl=30.0286
    7 new_exc=0.08212066
    8 new_Lsp=347.443947402
     6new_obl=25.18941689
     7new_ecc=0.09340902
     8new_Lsp=251.06881714
     9new_iniLs=0.
    910
    1011
     
    1213year_day=669.
    1314halfaxe=227.94
    14 pi=$(echo "4*a(1)" | bc -l)
    15 degrad=$(echo "360./(2.*$pi)" | bc -l)
     15pi=$(echo "4.*a(1.)" | bc -l)
     16degrad=$(echo "180./$pi" | bc -l)
     17
     18periheli=$(echo "$halfaxe*(1. - $new_ecc)" | bc -l)
     19aphelie=$(echo "$halfaxe*(1. + $new_ecc)" | bc -l)
     20
    1621tan=$(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 ]; then
     22zx0=$(echo "-2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l)
     23if [ $(echo "$zx0 <= 0." | bc -l) -eq 1 ]; then
    1924  zx0=$(echo "$zx0 + 2.*$pi" | bc -l)
    2025fi
    21 solp=$(echo "$year_day*(1.-($zx0 - $new_exc*s($zx0))/(2*$pi))" | bc -l)
     26peri_day=$(echo "$year_day*(1. - ($zx0 - $new_ecc*s($zx0))/(2.*$pi))" | bc -l)
     27
     28ztheta=$(echo "($new_iniLs - $new_Lsp)/$degrad" | bc -l)
     29tan=$(echo "s(0.5*$ztheta)/c(0.5*$ztheta)" | bc -l)
     30zx0=$(echo "2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l)
     31xref=$(echo "$zx0 - $new_ecc*s($zx0)" | bc -l)
     32new_inisol=$(echo "$peri_day + $xref*$year_day/(2.*$pi)" | bc -l)
     33if [ $(echo "$new_inisol < 0." | bc -l) -eq 1 ]; then
     34  new_inisol=$(echo "$new_inisol + $year_day" | bc -l)
     35fi
     36if [ $(echo "$new_inisol >= $year_day" | bc -l) -eq 1 ]; then
     37  new_inisol=$(echo "$new_inisol - $year_day" | bc -l)
     38fi
    2239
    2340# Update the netCDF file
     
    2643# controle(17) = peri_day ! date of perihelion (sols since N. spring)
    2744# controle(18) = obliquit ! Obliquity of the planet (deg)  ̃23.98
     45# controle(3)  = day_ini + int(time) ! initial day
    2846ncap2 -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
    3352
    3453# Rename the temporary file back to the original filename
    3554mv $name_file.temp $name_file
    3655
    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
     56echo "In $name_file:"
     57echo "New obliquit     = $new_obl"
     58echo "New eccentricity = $new_ecc -> new periheli = $periheli"
     59echo "                              -> new aphelie  = $aphelie"
     60echo "New Lsp          = $new_Lsp -> new peri_day = $peri_day"
     61echo "New initial Ls   = $new_iniLs -> New initial sol = $new_inisol"
     62echo "Done!"
Note: See TracChangeset for help on using the changeset viewer.