1 | MODULE orbit_param_criterion_mod |
---|
2 | |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | CONTAINS |
---|
6 | |
---|
7 | SUBROUTINE orbit_param_criterion(year_iter_max) |
---|
8 | |
---|
9 | USE temps_mod_evol, ONLY: year_bp_ini, year_PEM |
---|
10 | #ifndef CPP_STD |
---|
11 | USE planete_h, ONLY: e_elips, obliquit, timeperi |
---|
12 | #else |
---|
13 | use planete_mod, only: e_elips, obliquit, timeperi |
---|
14 | #endif |
---|
15 | USE comconst_mod, ONLY: pi |
---|
16 | USE lask_param_mod, only: yearlask,oblask,exlask,lsplask, & |
---|
17 | ini_lask_param_mod,last_ilask |
---|
18 | |
---|
19 | IMPLICIT NONE |
---|
20 | |
---|
21 | !-------------------------------------------------------- |
---|
22 | ! Input Variables |
---|
23 | !-------------------------------------------------------- |
---|
24 | |
---|
25 | !-------------------------------------------------------- |
---|
26 | ! Output Variables |
---|
27 | !-------------------------------------------------------- |
---|
28 | |
---|
29 | integer,intent(out) :: year_iter_max ! Maximum number of iteration of the PEM before orb changes too much |
---|
30 | |
---|
31 | !-------------------------------------------------------- |
---|
32 | ! Local variables |
---|
33 | !-------------------------------------------------------- |
---|
34 | |
---|
35 | real :: Year ! Year of the simulation |
---|
36 | real :: timeperi_ls ! Year of the simulation |
---|
37 | integer nlask,ilask!,last_ilask !Loop variable |
---|
38 | parameter (nlask = 20001) |
---|
39 | |
---|
40 | real max_change_obl,max_change_ex,max_change_lsp ! Percentage of change that is considered to be acceptible |
---|
41 | |
---|
42 | real max_obl,max_ex,max_lsp !Maximum value of orbit param given the acceptable percentage |
---|
43 | real min_obl,min_ex,min_lsp !Maximum value of orbit param given the acceptable percentage |
---|
44 | |
---|
45 | real max_obl_iter,max_ex_iter,max_lsp_iter !Maximum year iteration before reaching an unacceptable value |
---|
46 | |
---|
47 | logical obl_not_found, ex_not_found,lsp_not_found !Loop variable (first call) |
---|
48 | |
---|
49 | ! ********************************************************************** |
---|
50 | ! 0. Initializations |
---|
51 | ! ********************************************************************** |
---|
52 | |
---|
53 | Year=year_bp_ini+year_PEM |
---|
54 | timeperi_ls=timeperi*360/2/pi |
---|
55 | |
---|
56 | call ini_lask_param_mod(nlask) |
---|
57 | |
---|
58 | print *, "orbit_param_criterion, Year in pem.def=", year_bp_ini |
---|
59 | print *, "orbit_param_criterion, Year in the startpem.nc =", year_PEM |
---|
60 | print *, "orbit_param_criterion, Current year=", Year |
---|
61 | print *, "orbit_param_criterion, Current obl=", obliquit |
---|
62 | print *, "orbit_param_criterion, Current ex=", e_elips |
---|
63 | print *, "orbit_param_criterion, Current lsp=", timeperi_ls |
---|
64 | |
---|
65 | open(73,file='ob_ex_lsp.asc') |
---|
66 | do ilask=1,nlask |
---|
67 | read(73,*) yearlask(ilask),oblask(ilask), & |
---|
68 | exlask(ilask),lsplask(ilask) |
---|
69 | yearlask(ilask)=yearlask(ilask)*1000 |
---|
70 | |
---|
71 | if(yearlask(ilask).GT.Year) then |
---|
72 | last_ilask=ilask+1 |
---|
73 | endif |
---|
74 | end do |
---|
75 | close(73) |
---|
76 | |
---|
77 | print *, "Coresponding line in the ob_ex_lsp.asc file=", last_ilask |
---|
78 | |
---|
79 | ! 5% max change case |
---|
80 | |
---|
81 | max_change_obl=0.05 |
---|
82 | max_change_ex=0.05 |
---|
83 | max_change_lsp=0.05 |
---|
84 | |
---|
85 | max_obl=obliquit*(1+max_change_obl) |
---|
86 | min_obl=obliquit*(1-max_change_obl) |
---|
87 | |
---|
88 | max_ex=e_elips*(1+max_change_ex) |
---|
89 | min_ex=e_elips*(1-max_change_ex) |
---|
90 | |
---|
91 | max_lsp=timeperi_ls*(1+max_change_lsp) |
---|
92 | min_lsp=timeperi_ls*(1-max_change_lsp) |
---|
93 | |
---|
94 | !End of 5% max change case |
---|
95 | |
---|
96 | !Constant max change case |
---|
97 | |
---|
98 | max_change_obl=0.01 |
---|
99 | max_change_ex=0.01 |
---|
100 | max_change_lsp=20. |
---|
101 | |
---|
102 | max_obl=obliquit+max_change_obl |
---|
103 | min_obl=obliquit-max_change_obl |
---|
104 | |
---|
105 | max_ex=e_elips+max_change_ex |
---|
106 | min_ex=e_elips-max_change_ex |
---|
107 | |
---|
108 | max_lsp=timeperi_ls+max_change_lsp |
---|
109 | min_lsp=timeperi_ls-max_change_lsp |
---|
110 | |
---|
111 | !End Constant max change case |
---|
112 | |
---|
113 | obl_not_found=.TRUE. |
---|
114 | ex_not_found=.TRUE. |
---|
115 | lsp_not_found=.TRUE. |
---|
116 | |
---|
117 | max_obl_iter=999999999999 |
---|
118 | max_ex_iter =999999999999 |
---|
119 | max_lsp_iter=999999999999 |
---|
120 | |
---|
121 | do ilask=last_ilask+1,1,-1 |
---|
122 | if((oblask(ilask).GT.max_obl).and. obl_not_found ) then |
---|
123 | max_obl_iter=(max_obl-oblask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
124 | / (oblask(ilask-1)-oblask(ilask)) |
---|
125 | obl_not_found=.FALSE. |
---|
126 | elseif((oblask(ilask).LT.min_obl).and. obl_not_found ) then |
---|
127 | max_obl_iter=(min_obl-oblask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
128 | / (oblask(ilask-1)-oblask(ilask)) |
---|
129 | obl_not_found=.FALSE. |
---|
130 | endif |
---|
131 | if((exlask(ilask).GT.max_ex).and. ex_not_found ) then |
---|
132 | max_ex_iter=(max_ex-exlask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
133 | / (exlask(ilask-1)-exlask(ilask)) |
---|
134 | ex_not_found=.FALSE. |
---|
135 | elseif((exlask(ilask).LT.min_ex ).and. ex_not_found ) then |
---|
136 | max_ex_iter=(min_ex-exlask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
137 | / (exlask(ilask-1)-exlask(ilask)) |
---|
138 | ex_not_found=.FALSE. |
---|
139 | endif |
---|
140 | if((lsplask(ilask).GT.max_lsp).and. lsp_not_found ) then |
---|
141 | max_lsp_iter=(max_lsp-lsplask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
142 | / (lsplask(ilask-1)-lsplask(ilask)) |
---|
143 | lsp_not_found=.FALSE. |
---|
144 | elseif((lsplask(ilask).LT.min_lsp ).and. lsp_not_found ) then |
---|
145 | max_lsp_iter=(min_lsp-lsplask(ilask)) * (yearlask(ilask-1)-yearlask(ilask)) & |
---|
146 | / (lsplask(ilask-1)-lsplask(ilask)) |
---|
147 | lsp_not_found=.FALSE. |
---|
148 | endif |
---|
149 | enddo |
---|
150 | |
---|
151 | print *, "Maximum obliquity accepted=", max_obl |
---|
152 | print *, "Minimum obliquity accepted=", min_obl |
---|
153 | print *, "Maximum number of iteration for the obl. parameter=", max_obl_iter |
---|
154 | |
---|
155 | print *, "Maximum excentricity accepted=", max_ex |
---|
156 | print *, "Minimum excentricity accepted=", min_ex |
---|
157 | print *, "Maximum number of iteration for the ex. parameter=", max_ex_iter |
---|
158 | |
---|
159 | print *, "Maximum lsp accepted=", max_obl |
---|
160 | print *, "Minimum lsp accepted=", min_obl |
---|
161 | print *, "Maximum number of iteration for the lsp. parameter=", max_lsp_iter |
---|
162 | |
---|
163 | year_iter_max=min(max_obl_iter,max_ex_iter,max_lsp_iter) |
---|
164 | |
---|
165 | print *, "So the max. number of iteration (year) for the orbital parameter=", year_iter_max |
---|
166 | |
---|
167 | END SUBROUTINE orbit_param_criterion |
---|
168 | |
---|
169 | !******************************************************************************** |
---|
170 | |
---|
171 | END MODULE orbit_param_criterion_mod |
---|