Ignore:
Timestamp:
Dec 1, 2023, 1:48:25 PM (13 months ago)
Author:
jbclement
Message:

PEM:

  • Addition of a script in LMDZ.MARS/deftank/pem/ to launch a chained simulation of 1D PCM runs which follow, year by year, the orbital parameters (obliquity, eccentricity, Ls perihelion) given in a specified file.
  • Small changes to other files of the deftank directory (check and cosmetic).

JBC

Location:
trunk/LMDZ.MARS/deftank/pem
Files:
1 added
3 edited

Legend:

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

    r3143 r3145  
    1919
    2020# Checking if everything is ok
     21if [ ! -d "$directory" ]; then
     22    echo "Error: directory \"$diags\" not found!"
     23    exit 1
     24fi
    2125if [ ${#files[@]} -lt 2 ]; then
    22   echo "Error: there are not enough files for concatenation!"
    23   exit 1
     26    echo "Error: there are not enough files for concatenation!"
     27    exit 1
    2428fi
    2529if [ -f "$output_file" ]; then
  • trunk/LMDZ.MARS/deftank/pem/launch_pem.sh

    r3136 r3145  
    3838exeReshape=reshape_XIOS_output_64x48x29_phymars_seq.e
    3939
    40 #------------------------------ Parameters -----------------------------
    41 myear=686.9725      # Number of Earth days in Martian year
    42 eyear=365.256363004 # Number of days in Earth year
    43 
    4440#------ Check if files/directories necessary for the script exist ------
    4541dir=`pwd`
    4642machine=`hostname`
    4743address=`whoami`
     44if [ ! -f "$exePEM" ]; then
     45    echo "Error: file \"$exePEM\" does not exist in $dir!"
     46    exit 1
     47fi
     48if [ ! -f "$exeReshape" ]; then
     49    echo "Error: file \"$exeReshape\" does not exist in $dir!"
     50    exit 1
     51fi
    4852if [ ! -f "exePCM.sh" ]; then
    4953    echo "Error: file \"exePCM.sh\" does not exist in $dir!"
     
    9296address=`whoami`
    9397echo "This is a chained simulation for PEM and PCM runs in $dir on $machine."
     98myear=686.9725      # Number of Earth days in Martian year
     99eyear=365.256363004 # Number of days in Earth year
    94100convert_years=$(echo "$myear/$eyear" | bc -l)
    95101convert_years=$(printf "%.4f" $convert_years) # Rounding to the 4th decimal to respect the precision of Martian year
     
    110116if [ -f "start.nc" ]; then
    111117    cp start.nc starts/
     118elif [ -f "star1D.nc" ]; then
     119    cp star1D.txt starts/
    112120fi
    113121
  • trunk/LMDZ.MARS/deftank/pem/modify_startfi_orbit.sh

    r3093 r3145  
    1515
    1616# Calculate modified values
     17if [ ! -f "$name_file" ]; then
     18    echo "Error: file \"$name_file\" not found!"
     19    exit 1
     20fi
    1721year_day=669.
    1822halfaxe=227.94
     
    2630zx0=$(echo "-2.*a($tan*sqrt((1. - $new_ecc)/(1. + $new_ecc)))" | bc -l)
    2731if [ $(echo "$zx0 <= 0." | bc -l) -eq 1 ]; then
    28   zx0=$(echo "$zx0 + 2.*$pi" | bc -l)
     32    zx0=$(echo "$zx0 + 2.*$pi" | bc -l)
    2933fi
    3034peri_day=$(echo "$year_day*(1. - ($zx0 - $new_ecc*s($zx0))/(2.*$pi))" | bc -l)
     
    3640new_inisol=$(echo "$peri_day + $xref*$year_day/(2.*$pi)" | bc -l)
    3741if [ $(echo "$new_inisol < 0." | bc -l) -eq 1 ]; then
    38   new_inisol=$(echo "$new_inisol + $year_day" | bc -l)
     42    new_inisol=$(echo "$new_inisol + $year_day" | bc -l)
    3943fi
    4044if [ $(echo "$new_inisol >= $year_day" | bc -l) -eq 1 ]; then
    41   new_inisol=$(echo "$new_inisol - $year_day" | bc -l)
     45    new_inisol=$(echo "$new_inisol - $year_day" | bc -l)
    4246fi
    4347
Note: See TracChangeset for help on using the changeset viewer.