Changeset 3791
- Timestamp:
- Jun 4, 2025, 6:27:23 PM (4 days ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3790 r3791 697 697 698 698 == 03/06/2025 == JBC 699 Correction of a small bug for the launching script when restarting the simulation from an initial PCM run + renaming of variables in the visualization scripts for the layering structure 699 Correction of a small bug for the launching script when restarting the simulation from an initial PCM run + renaming of variables in the visualization scripts for the layering structure. 700 701 == 04/06/2025 == JBC 702 Correction and simplification to compute the maximum number of years according to the changes in Lsp + update of "run_PEM.def". -
trunk/LMDZ.COMMON/libf/evolution/deftank/run_PEM.def
r3498 r3791 26 26 # var_lsp=.false. 27 27 28 # Time step length of the PEM in Martian years? Default = 1. 29 # dt=1 30 28 31 #---------- Stopping criteria parameters ----------# 29 32 # If evol_orbit_pem=.false., maximal number of iterations if no stopping criterion is reached? Default=100000000 … … 39 42 # ps_criterion = 0.15 40 43 41 # Time step length of the PEM in Martian years? Default = 1. 42 # dt=1 44 # Acceptance of change for obliquity? Default = 1. 45 # max_change_obl=1. 46 47 # Acceptance of change for eccentricity? Default = 5.e-3 48 # max_change_ecc=5.e-3 49 50 # Acceptance of change for Lsp? Default = 20. 51 # max_change_lsp=20. 43 52 44 53 #---------- Subsurface parameters ----------# -
trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
r3498 r3791 48 48 ! Local variables 49 49 !-------------------------------------------------------- 50 real :: Year ! Year of the simulation 51 real :: Lsp ! Ls perihelion 52 real :: max_change_obl, max_change_ecc, max_change_lsp ! Maximum admissible change 53 real :: max_obl, max_ecc, max_lsp ! Maximum value of orbit param given the admissible change 54 real :: min_obl, min_ecc, min_lsp ! Minimum value of orbit param given the admissible change 55 real :: max_obl_iter, max_ecc_iter, max_lsp_iter ! Maximum year iteration before reaching an inadmissible value of orbit param 56 integer :: ilask ! Loop variable 57 real :: xa, xb, ya, yb ! Variables for interpolation 58 logical :: found_obl, found_ecc, found_lsp ! Flag variables for orbital parameters 59 logical :: crossed_modulo_d, crossed_modulo_i ! Flag variables for modulo of Lsp 50 real :: Year ! Year of the simulation 51 real :: Lsp ! Ls perihelion 52 real :: max_change_obl, max_change_ecc, max_change_lsp ! Maximum admissible change 53 real :: max_obl, max_ecc, max_lsp ! Maximum value of orbit param given the admissible change 54 real :: min_obl, min_ecc, min_lsp ! Minimum value of orbit param given the admissible change 55 real :: max_obl_iter, max_ecc_iter, max_lsp_iter ! Maximum year iteration before reaching an inadmissible value of orbit param 56 integer :: ilask ! Loop variable 57 real :: xa, xb, ya, yb ! Variables for interpolation 58 logical :: found_obl, found_ecc, found_lsp ! Flag variables for orbital parameters 59 real :: lsp_corr ! Lsp corrected if the "modulo is crossed" 60 real :: delta ! Intermediate variable 61 real, dimension(:), allocatable :: lsplask_unwrap ! Unwrapped sequence of Lsp from Laskar's file 60 62 61 63 ! ********************************************************************** … … 65 67 Lsp = lsperi*180./pi ! We convert in degree 66 68 67 call ini_lask_param_mod ! Allocation of variables69 call ini_lask_param_mod() ! Allocation of variables 68 70 69 71 write(*,*) 'orbit_param_criterion, Current year =', Year … … 87 89 endif 88 90 91 ! Unwrap the Lsp changes in Laskar's file 92 allocate(lsplask_unwrap(last_ilask)) 93 lsplask_unwrap(last_ilask) = lsplask(last_ilask) 94 do ilask = last_ilask,2,-1 95 delta = lsplask(ilask - 1) - lsplask(ilask) 96 if (delta > 180.) then 97 lsp_corr = lsplask(ilask - 1) - 360. 98 else if (delta < -180.) then 99 lsp_corr = lsplask(ilask - 1) + 360. 100 else 101 lsp_corr = lsplask(ilask - 1) 102 endif 103 lsplask_unwrap(ilask - 1) = lsplask_unwrap(ilask) + lsp_corr - lsplask(ilask) 104 enddo 105 106 ! Correct the current Lsp according to the unwrapping 107 delta = Lsp - lsplask_unwrap(last_ilask) 108 if (delta > 180.) then 109 Lsp = Lsp - 360. 110 else if (delta < -180.) then 111 Lsp = Lsp + 360. 112 endif 113 89 114 ! Constant max change case 90 max_change_obl = 0.691 max_change_ecc = 2.8e-392 max_change_lsp = 18.115 max_change_obl = 1. 116 max_change_ecc = 5.e-3 117 max_change_lsp = 20. 93 118 94 119 call getin('max_change_obl',max_change_obl) … … 124 149 if (.not. var_ecc) found_ecc = .true. 125 150 if (.not. var_lsp) found_lsp = .true. 126 crossed_modulo_d = .false.127 crossed_modulo_i = .false.128 151 129 152 do ilask = last_ilask,2,-1 … … 159 182 ! Lsp 160 183 if (var_lsp .and. .not. found_lsp) then 161 ya = lsplask(ilask) 162 yb = lsplask(ilask - 1) 163 if (abs(yb - ya) > 300.) then ! If modulo is "crossed" through the interval 164 if (ya < yb) then ! Lsp should be decreasing 165 if (.not. crossed_modulo_i) then 166 yb = yb - 360. 167 if (min_lsp < 0.) crossed_modulo_d = .true. 168 else 169 crossed_modulo_i = .false. 170 endif 171 else ! Lsp should be increasing 172 if (.not. crossed_modulo_d) then 173 yb = yb + 360. 174 if (max_lsp > 360.) crossed_modulo_i = .true. 175 else 176 crossed_modulo_d = .false. 177 endif 178 endif 179 else 180 if (crossed_modulo_d) then ! If decreasing Lsp "crossed" the modulo but min_lsp has not been met yet 181 ya = ya - 360. 182 yb = yb - 360. 183 else if (crossed_modulo_i) then ! If increasing Lsp "crossed" the modulo but max_lsp has not been met yet 184 ya = ya + 360. 185 yb = yb + 360. 186 endif 187 endif 184 ya = lsplask_unwrap(ilask) 185 yb = lsplask_unwrap(ilask - 1) 188 186 if (yb < min_lsp) then ! The minimum accepted is overtaken 189 187 max_lsp_iter = (min_lsp - ya)*(xb - xa)/(yb - ya) + xa - Year … … 198 196 enddo 199 197 198 deallocate(lsplask_unwrap) 199 200 200 if (.not. found_obl) write(*,*) 'The maximum reachable year for obl. could not be found in the file "obl_ecc_lsp.asc".' 201 201 if (.not. found_ecc) write(*,*) 'The maximum reachable year for ecc. could not be found in the file "obl_ecc_lsp.asc".'
Note: See TracChangeset
for help on using the changeset viewer.