source: trunk/LMDZ.COMMON/libf/evolution/evolution.F90 @ 4113

Last change on this file since 4113 was 4110, checked in by jbclement, 6 days ago

PEM:

  • Introduction of a configurable display/logging system with options 'out2term', 'out2log', 'verbosity_lvl'. All messages now use verbosity levels ('LVL_NFO', 'LVL_WRN', 'LVL_ERR' and 'LVL_DBG').
  • Code encapsulation improvements with systematic privacy/protection of module variables.
  • Addition of workflow safety checks for required executables, dependencies (e.g. 'ncdump'), input files and callphys keys.
  • Renaming of PEM starting and diagnostic files ("startevol.nc" into "startevo.nc", "diagevol.nc" into "diagevo.nc").

JBC

File size: 3.3 KB
Line 
1MODULE evolution
2!-----------------------------------------------------------------------
3! NAME
4!     evolution
5!
6! DESCRIPTION
7!     Time parameters for the evolution of the simulation.
8!
9! AUTHORS & DATE
10!     JB Clement, 12/2025
11!
12! NOTES
13!
14!-----------------------------------------------------------------------
15
16! DEPENDENCIES
17! ------------
18use numerics, only: dp, di
19
20! DECLARATION
21! -----------
22implicit none
23
24! PARAMETERS
25! ----------
26real(dp), protected :: r_plnt2earth_yr ! Conversion ratio from Planetary years to Earth years
27real(dp), protected :: pem_ini_date    ! Initial year (in Planetary years) of the simulation of the PEM defined in "run.def"
28real(dp), protected :: dt              ! Time step in Planetary years
29real(dp), protected :: nmax_yr_run     ! Maximum number of Planetary years of a PEM run if no stopping criterion is reached
30
31! VARIABLES
32! ---------
33real(dp)    :: ntot_yr_sim ! Total number of Planetary years of the PEM workflow
34real(dp)    :: n_yr_run    ! Number of simulated Planetary years of the PEM run
35real(dp)    :: n_yr_sim    ! Number of simulated Planetary years of the chained simulations
36integer(di) :: idt         ! Number of timesteps of the PEM run
37
38contains
39!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40
41!=======================================================================
42SUBROUTINE set_r_plnt2earth_yr(r_plnt2earth_yr_in)
43!-----------------------------------------------------------------------
44! NAME
45!     set_r_plnt2earth_yr
46!
47! DESCRIPTION
48!     Setter for 'r_plnt2earth_yr'.
49!
50! AUTHORS & DATE
51!     JB Clement, 12/2025
52!
53! NOTES
54!
55!-----------------------------------------------------------------------
56
57! DECLARATION
58! -----------
59implicit none
60
61! ARGUMENTS
62! ---------
63real(dp), intent(in) :: r_plnt2earth_yr_in
64
65! CODE
66! ----
67r_plnt2earth_yr = r_plnt2earth_yr_in
68
69END SUBROUTINE set_r_plnt2earth_yr
70!=======================================================================
71
72!=======================================================================
73SUBROUTINE set_evolution_config(pem_ini_earth_date,dt_in,nmax_yr_run_in)
74!-----------------------------------------------------------------------
75! NAME
76!     set_evolution_config
77!
78! DESCRIPTION
79!     Setter for 'evolution' configuration parameters.
80!
81! AUTHORS & DATE
82!     JB Clement, 02/2026
83!
84! NOTES
85!
86!-----------------------------------------------------------------------
87
88! DEPENDENCIES
89! ------------
90use utility,  only: real2str, int2str
91use display,  only: print_msg, LVL_NFO
92use stoppage, only: stop_clean
93
94! DECLARATION
95! -----------
96implicit none
97
98! ARGUMENTS
99! ---------
100integer(di), intent(in) :: pem_ini_earth_date
101real(dp),    intent(in) :: dt_in, nmax_yr_run_in
102
103! CODE
104! ----
105pem_ini_date = real(pem_ini_earth_date,dp)/r_plnt2earth_yr
106dt = dt_in
107nmax_yr_run = nmax_yr_run_in
108call print_msg('pem_ini_earth_date = '//int2str(pem_ini_earth_date)//' | pem_ini_date = '//real2str(pem_ini_date),LVL_NFO)
109call print_msg('dt                 = '//real2str(dt),LVL_NFO)
110call print_msg('nmax_yr_run        = '//real2str(nmax_yr_run),LVL_NFO)
111if (dt <= 0._dp) call stop_clean(__FILE__,__LINE__,'''dt'' must be positive!',1)
112if (nmax_yr_run <= 0._dp) call stop_clean(__FILE__,__LINE__,'''nmax_yr_run'' must be positive!',1)
113
114END SUBROUTINE set_evolution_config
115!=======================================================================
116
117END MODULE evolution
Note: See TracBrowser for help on using the repository browser.