Changeset 3991 for trunk/LMDZ.COMMON/libf/evolution/orbit.F90
- Timestamp:
- Dec 16, 2025, 4:39:24 PM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/orbit.F90 (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/orbit.F90
r3989 r3991 1 1 MODULE orbit 2 3 !======================================================================= 4 ! 5 ! Purpose: Compute the maximum number of iteration for PEM based on the 6 ! stopping criterion given by the orbital parameters 7 ! 8 ! Author: RV, JBC 9 !======================================================================= 10 2 !----------------------------------------------------------------------- 3 ! NAME 4 ! orbit 5 ! DESCRIPTION 6 ! Compute orbital-parameter-based stopping criteria and update 7 ! planetary orbit parameters. 8 ! AUTHORS & DATE 9 ! R. Vandemeulebrouck 10 ! JB Clement, 2023-2025 11 ! NOTES 12 ! 13 !----------------------------------------------------------------------- 14 15 ! DECLARATION 16 ! ----------- 11 17 implicit none 12 18 19 ! MODULE VARIABLES 20 ! ---------------- 13 21 real, dimension(:), allocatable :: year_lask ! year before present from Laskar et al. 14 real, dimension(:), allocatable :: obl_lask ! obliquity [deg]22 real, dimension(:), allocatable :: obl_lask ! obliquity [deg] 15 23 real, dimension(:), allocatable :: ecc_lask ! eccentricity 16 24 real, dimension(:), allocatable :: lsp_lask ! ls perihelie [deg] 17 25 integer :: iyear_lask ! Index of the line in the file year_obl_lask.asc corresponding to the closest lower year to the current year 18 26 19 !=======================================================================20 27 contains 21 !======================================================================= 22 28 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 29 30 !======================================================================= 23 31 SUBROUTINE read_orbitpm(Year) 24 32 !----------------------------------------------------------------------- 33 ! NAME 34 ! read_orbitpm 35 ! 36 ! DESCRIPTION 37 ! Read Laskar orbital file and prepare arrays; locate index for 38 ! closest lower year relative to current simulation year. 39 ! 40 ! AUTHORS & DATE 41 ! R. Vandemeulebrouck 42 ! JB Clement, 2023-2025 43 ! 44 ! NOTES 45 ! Converts kilo Earth years to Martian years using 'convert_years'. 46 !----------------------------------------------------------------------- 47 48 ! DEPENDENCIES 49 ! ------------ 25 50 use evolution, only: convert_years 26 51 52 ! DECLARATION 53 ! ----------- 27 54 implicit none 28 55 56 ! ARGUMENTS 57 ! --------- 29 58 real, intent(in) :: Year ! Martian year of the simulation 30 59 31 integer :: n ! number of lines in Laskar files 60 ! LOCAL VARIABLES 61 ! --------------- 62 integer :: n ! Number of lines in Laskar files 32 63 integer :: ierr, i 33 64 65 ! CODE 66 ! ---- 34 67 n = 0 35 68 open(1,file = 'obl_ecc_lsp.asc',status = 'old',action = 'read') … … 56 89 57 90 END SUBROUTINE read_orbitpm 58 59 !======================================================================= 60 91 !======================================================================= 92 93 !======================================================================= 61 94 SUBROUTINE end_orbit 62 95 !----------------------------------------------------------------------- 96 ! NAME 97 ! end_orbit 98 ! 99 ! DESCRIPTION 100 ! Deallocate orbital data arrays. 101 ! 102 ! AUTHORS & DATE 103 ! R. Vandemeulebrouck 104 ! JB Clement, 2023-2025 105 ! 106 ! NOTES 107 ! 108 !----------------------------------------------------------------------- 109 110 ! DECLARATION 111 ! ----------- 63 112 implicit none 64 113 114 ! CODE 115 ! ---- 65 116 if (allocated(year_lask)) deallocate(year_lask) 66 if (allocated(obl_lask)) deallocate(obl_lask)67 if (allocated(ecc_lask)) deallocate(ecc_lask)68 if (allocated(lsp_lask)) deallocate(lsp_lask)117 if (allocated(obl_lask)) deallocate(obl_lask) 118 if (allocated(ecc_lask)) deallocate(ecc_lask) 119 if (allocated(lsp_lask)) deallocate(lsp_lask) 69 120 70 121 END SUBROUTINE end_orbit 71 122 !======================================================================= 72 123 124 !======================================================================= 73 125 SUBROUTINE orbit_param_criterion(i_myear,nyears_maxorb) 74 126 !----------------------------------------------------------------------- 127 ! NAME 128 ! orbit_param_criterion 129 ! 130 ! DESCRIPTION 131 ! Determine maximum PEM iterations before orbital params change 132 ! beyond admissible thresholds. 133 ! 134 ! AUTHORS & DATE 135 ! R. Vandemeulebrouck 136 ! JB Clement, 2023-2025 137 ! 138 ! NOTES 139 ! 140 !----------------------------------------------------------------------- 75 141 #ifdef CPP_IOIPSL 76 142 use IOIPSL, only: getin … … 83 149 use evolution, only: year_bp_ini, var_obl, var_ecc, var_lsp, convert_years 84 150 151 ! DECLARATION 152 ! ----------- 85 153 implicit none 86 154 87 !-------------------------------------------------------- 88 ! Input Variables 89 !-------------------------------------------------------- 90 real, intent(in) :: i_myear ! Martian year of the simulation 91 92 !-------------------------------------------------------- 93 ! Output Variables 94 !-------------------------------------------------------- 155 ! ARGUMENTS 156 ! --------- 157 real, intent(in) :: i_myear ! Martian year of the simulation 95 158 real, intent(out) :: nyears_maxorb ! Maximum number of iteration of the PEM before orb changes too much 96 159 97 !-------------------------------------------------------- 98 ! Local variables 99 !-------------------------------------------------------- 160 ! LOCAL VARIABLES 161 ! --------------- 100 162 real :: Year ! Year of the simulation 101 163 real :: Lsp ! Ls perihelion … … 103 165 real :: max_obl, max_ecc, max_lsp ! Maximum value of orbit param given the admissible change 104 166 real :: min_obl, min_ecc, min_lsp ! Minimum value of orbit param given the admissible change 105 real :: nyears_maxobl, nyears_maxecc, nyears_maxlsp ! Maximum year iteration before reaching an inadmissible value of orbit param 106 integer :: i ! Loop variable 107 real :: xa, xb, ya, yb ! Variables for interpolation 108 logical :: found_obl, found_ecc, found_lsp ! Flag variables for orbital parameters 109 real :: lsp_corr ! Lsp corrected if the "modulo is crossed" 110 real :: delta ! Intermediate variable 111 real, dimension(:), allocatable :: lsplask_unwrap ! Unwrapped sequence of Lsp from Laskar's file 112 167 real :: nyears_maxobl, nyears_maxecc, nyears_maxlsp ! Maximum year iteration before reaching an inadmissible value of orbit param 168 real :: xa, xb, ya, yb ! Variables for interpolation 169 logical :: found_obl, found_ecc, found_lsp ! Flag variables for orbital parameters 170 real :: lsp_corr ! Lsp corrected if the "modulo is crossed" 171 real :: delta ! Intermediate variable 172 real, dimension(:), allocatable :: lsplask_unwrap ! Unwrapped sequence of Lsp from Laskar's file 173 integer :: i 174 175 ! CODE 176 ! ---- 113 177 ! ********************************************************************** 114 178 ! 0. Initializations … … 246 310 247 311 END SUBROUTINE orbit_param_criterion 248 249 !*********************************************************************** 250 ! Purpose: Recompute orbit parameters based on values by Laskar et al.312 !======================================================================= 313 314 !======================================================================= 251 315 SUBROUTINE set_new_orbitpm(i_myear,i_myear_leg) 316 !----------------------------------------------------------------------- 317 ! NAME 318 ! set_new_orbitpm 319 ! 320 ! DESCRIPTION 321 ! Recompute orbit parameters from Laskar values at a new year and 322 ! update planetary constants; handles Lsp modulo crossings. 323 ! 324 ! AUTHORS & DATE 325 ! R. Vandemeulebrouck 326 ! JB Clement, 2023-2025 327 ! 328 ! NOTES 329 ! 330 !----------------------------------------------------------------------- 252 331 253 332 use evolution, only: year_bp_ini, var_obl, var_ecc, var_lsp … … 256 335 use call_dayperi_mod, only: call_dayperi 257 336 337 ! DECLARATION 338 ! ----------- 258 339 implicit none 259 340 260 !-------------------------------------------------------- 261 ! Input Variables 262 !-------------------------------------------------------- 341 ! ARGUMENTS 342 ! --------- 263 343 real, intent(in) :: i_myear ! Number of simulated Martian years 264 344 real, intent(in) :: i_myear_leg ! Number of iterations of the PEM 265 345 266 !-------------------------------------------------------- 267 ! Output Variables 268 !-------------------------------------------------------- 269 270 !-------------------------------------------------------- 271 ! Local variables 272 !-------------------------------------------------------- 346 ! LOCAL VARIABLES 347 ! --------------- 273 348 real :: Year ! Year of the simulation 274 349 real :: Lsp ! Ls perihelion 275 integer :: i ! Loop variable276 350 real :: halfaxe ! Million of km 351 integer :: i 277 352 real :: unitastr 278 353 real :: xa, xb, ya, yb ! Variables for interpolation 279 354 logical :: found_year ! Flag variable 280 355 356 ! CODE 357 ! ---- 281 358 ! ********************************************************************** 282 359 ! 0. Initializations … … 353 430 354 431 END SUBROUTINE set_new_orbitpm 432 !======================================================================= 355 433 356 434 END MODULE orbit
Note: See TracChangeset
for help on using the changeset viewer.
