Changeset 3791


Ignore:
Timestamp:
Jun 4, 2025, 6:27:23 PM (4 days ago)
Author:
jbclement
Message:

PEM:
Correction and simplification to compute the maximum number of years according to the changes in Lsp + update of "run_PEM.def".
JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3790 r3791  
    697697
    698698== 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
     699Correction 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
     702Correction 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  
    2626# var_lsp=.false.
    2727
     28# Time step length of the PEM in Martian years? Default = 1.
     29# dt=1
     30
    2831#---------- Stopping criteria parameters ----------#
    2932# If evol_orbit_pem=.false., maximal number of iterations if no stopping criterion is reached? Default=100000000
     
    3942# ps_criterion = 0.15
    4043
    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.
    4352
    4453#---------- Subsurface parameters ----------#
  • trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90

    r3498 r3791  
    4848! Local variables
    4949!--------------------------------------------------------
    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
     50real                            :: Year                                           ! Year of the simulation
     51real                            :: Lsp                                            ! Ls perihelion
     52real                            :: max_change_obl, max_change_ecc, max_change_lsp ! Maximum admissible change
     53real                            :: max_obl, max_ecc, max_lsp                      ! Maximum value of orbit param given the admissible change
     54real                            :: min_obl, min_ecc, min_lsp                      ! Minimum value of orbit param given the admissible change
     55real                            :: max_obl_iter, max_ecc_iter, max_lsp_iter       ! Maximum year iteration before reaching an inadmissible value of orbit param
     56integer                         :: ilask                                          ! Loop variable
     57real                            :: xa, xb, ya, yb                                 ! Variables for interpolation
     58logical                         :: found_obl, found_ecc, found_lsp                ! Flag variables for orbital parameters
     59real                            :: lsp_corr                                       ! Lsp corrected if the "modulo is crossed"
     60real                            :: delta                                          ! Intermediate variable
     61real, dimension(:), allocatable :: lsplask_unwrap                                 ! Unwrapped sequence of Lsp from Laskar's file
    6062
    6163! **********************************************************************
     
    6567Lsp = lsperi*180./pi         ! We convert in degree
    6668
    67 call ini_lask_param_mod ! Allocation of variables
     69call ini_lask_param_mod() ! Allocation of variables
    6870
    6971write(*,*) 'orbit_param_criterion, Current year =', Year
     
    8789endif
    8890
     91! Unwrap the Lsp changes in Laskar's file
     92allocate(lsplask_unwrap(last_ilask))
     93lsplask_unwrap(last_ilask) = lsplask(last_ilask)
     94do 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)
     104enddo
     105
     106! Correct the current Lsp according to the unwrapping
     107delta = Lsp - lsplask_unwrap(last_ilask)
     108if (delta > 180.) then
     109    Lsp = Lsp - 360.
     110else if (delta < -180.) then
     111    Lsp = Lsp + 360.
     112endif
     113
    89114! Constant max change case
    90 max_change_obl = 0.6
    91 max_change_ecc = 2.8e-3
    92 max_change_lsp = 18.
     115max_change_obl = 1.
     116max_change_ecc = 5.e-3
     117max_change_lsp = 20.
    93118
    94119call getin('max_change_obl',max_change_obl)
     
    124149if (.not. var_ecc) found_ecc = .true.
    125150if (.not. var_lsp) found_lsp = .true.
    126 crossed_modulo_d = .false.
    127 crossed_modulo_i = .false.
    128151
    129152do ilask = last_ilask,2,-1
     
    159182    ! Lsp
    160183    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)
    188186        if (yb < min_lsp) then ! The minimum accepted is overtaken
    189187            max_lsp_iter = (min_lsp - ya)*(xb - xa)/(yb - ya) + xa - Year
     
    198196enddo
    199197
     198deallocate(lsplask_unwrap)
     199
    200200if (.not. found_obl) write(*,*) 'The maximum reachable year for obl. could not be found in the file "obl_ecc_lsp.asc".'
    201201if (.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.