source: trunk/LMDZ.COMMON/libf/evolution/recomp_orb_param_mod.F90 @ 2965

Last change on this file since 2965 was 2963, checked in by romain.vande, 3 years ago

Mars PEM :

Adapt PEM to the subslope PCM configuration, it is now fully compatible.

Create a PEM folder in deftank that contains:

run_pem1: a bash file that runs chained simulation of PEM as well as running a parameterizable number of PCM simulation in between.

It also takes care of reshaping XIOS output as well as renaming outputs etc… in the spirit of run_month1.

It is written for Irene machine and the header needs to be adapted for other machines.

run_PEM.def: A text file that shows the possible parameters to choose before a PEM simulation.

It should be included at the end of run.def just like callphys.def

ob_ex_lsp.asc: An ascii file containing the obliquity, eccentricity, ls_peri data from Laskar in Martian year.
README: A txt file explaining the content of the folder

Adapt field_def_physics_mars.xml to consider the case with 7 subslopes in the PCM.
Change context_lmdz_physics.xml to be able to output the file needed by the PEM.

Correct a few other minor bugs.

RV

File size: 3.9 KB
Line 
1      MODULE recomp_orb_param_mod
2!=======================================================================
3!
4! Purpose: Recompute orbit parameters based on values by Laskar et al.,
5! 2004
6!
7! Authors: RV
8!=======================================================================
9      IMPLICIT NONE
10
11      CONTAINS
12
13      SUBROUTINE recomp_orb_param(final_iter)
14
15      USE temps_mod_evol, ONLY: year_bp_ini, year_PEM, var_obl, var_ex, var_lsp
16#ifndef CPP_STD     
17      USE comconst_mod, ONLY: pi
18      USE planete_h, ONLY: e_elips, obliquit, timeperi, periheli,aphelie,p_elips,peri_day,year_day
19#else
20      use planete_mod, only: e_elips, obliquit, timeperi
21      USE comcstfi_mod, only: pi
22
23#endif
24
25      USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, &
26                                end_lask_param_mod,last_ilask
27
28      IMPLICIT NONE
29
30!--------------------------------------------------------
31! Input Variables
32!--------------------------------------------------------
33
34      integer,intent(in) :: final_iter ! Number of year iteration of the PEM
35
36!--------------------------------------------------------
37! Output Variables
38!--------------------------------------------------------
39
40!--------------------------------------------------------
41! Local variables
42!--------------------------------------------------------
43
44      real :: Year                      ! Year of the simulation
45      real :: timeperi_ls               ! time of peri in ls
46      integer ilask                     ! Loop variable
47      real :: halfaxe                   ! Million of km
48      real :: unitastr
49
50
51      ! **********************************************************************
52      ! 0. Initializations
53      ! **********************************************************************
54
55
56          Year=year_bp_ini+year_PEM+final_iter
57
58          timeperi_ls=timeperi*360/2/pi
59
60!          Year=-953200
61          print *, "recomp_orb_param, Old year=", year_bp_ini+year_PEM
62          print *, "recomp_orb_param, New year=", Year
63          print *, "recomp_orb_param, Old obl=", obliquit
64          print *, "recomp_orb_param, Old ex=", e_elips
65          print *, "recomp_orb_param, Old lsp=", timeperi_ls
66          print *, "recomp_orb_param, Old timeperi=", timeperi
67
68        do ilask=last_ilask,1,-1
69           if(yearlask(ilask) .GT.Year) then
70             if(var_obl) then
71               obliquit=oblask(ilask+1)+(oblask(ilask)-oblask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1))
72             endif
73             if(var_ex) then
74               e_elips=exlask(ilask+1)+(exlask(ilask)-exlask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1))
75             endif
76             if(var_lsp) then
77               if(lsplask(ilask)-lsplask(ilask+1) .gt.200) then
78                 if(lsplask(ilask).lt.lsplask(ilask+1)) then
79                   lsplask(ilask)=lsplask(ilask)+360
80                 else
81                   lsplask(ilask+1)=lsplask(ilask+1)+360
82                 endif
83               endif
84               timeperi_ls=lsplask(ilask+1)+(lsplask(ilask)-lsplask(ilask+1))*(Year-yearlask(ilask+1))/(yearlask(ilask)-yearlask(ilask+1))
85               timeperi_ls=modulo(timeperi_ls,360.)
86             endif
87              exit
88           endif
89        enddo
90        halfaxe=227.94
91        timeperi=timeperi_ls*2*pi/360
92        periheli = halfaxe*(1-e_elips)
93        aphelie =  halfaxe*(1+e_elips)
94        unitastr=149.597927
95        p_elips=0.5*(periheli+aphelie)*(1-e_elips*e_elips)/unitastr
96        call call_dayperi(timeperi,e_elips,peri_day,year_day)
97
98       print *, "recomp_orb_param, Final year of the PEM run:", Year
99       print *, "recomp_orb_param, New obl=", obliquit
100       print *, "recomp_orb_param, New ex=", e_elips
101       print *, "recomp_orb_param, New timeperi=", timeperi
102
103      END SUBROUTINE recomp_orb_param
104
105!********************************************************************************   
106     
107      END MODULE recomp_orb_param_mod
Note: See TracBrowser for help on using the repository browser.