source: trunk/LMDZ.COMMON/libf/evolution/allocation.F90 @ 4157

Last change on this file since 4157 was 4157, checked in by jbclement, 12 days ago

PEM:

  • Separate variables ownership between the module "planet" for persistent climate state and the program "pem" for transient workflow logic. It provides a meaningful structure.
  • Add lifecycle helpers for clear allocation/deallocation logic.
  • Simplify string suffix for slopes variables.

JBC

File size: 2.9 KB
Line 
1MODULE allocation
2!-----------------------------------------------------------------------
3! NAME
4!     allocation
5!
6! DESCRIPTION
7!     Management of memory throughout the modules of the code.
8!
9! AUTHORS & DATE
10!     JB Clement, 12/2025
11!
12! NOTES
13!
14!-----------------------------------------------------------------------
15
16! DEPENDENCIES
17! ------------
18use geometry,   only: ini_geometry, end_geometry, dim_init
19use atmosphere, only: ini_atmosphere, end_atmosphere
20use tracers,    only: ini_tracers, end_tracers
21use slopes,     only: ini_slopes, end_slopes
22use surface,    only: ini_surface, end_surface
23use surf_temp,  only: ini_surf_temp, end_surf_temp
24use soil_temp,  only: ini_soil_temp, end_soil_temp
25use frost,      only: ini_frost, end_frost
26use soil,       only: ini_soil, end_soil
27use surf_ice,   only: ini_surf_ice, end_surf_ice
28use orbit,      only: ini_orbit, end_orbit
29use output,     only: ini_output, end_output
30use planet,     only: ini_planet, end_planet
31
32! DECLARATION
33! -----------
34implicit none
35
36contains
37!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38
39!=======================================================================
40SUBROUTINE ini_allocation()
41!-----------------------------------------------------------------------
42! NAME
43!     ini_geometry
44!
45! DESCRIPTION
46!     Initialize module arrays.
47!
48! AUTHORS & DATE
49!     JB Clement, 12/2025
50!
51! NOTES
52!
53!-----------------------------------------------------------------------
54
55! DEPENDENCIES
56! ------------
57use stoppage, only: stop_clean
58
59! DECLARATION
60! -----------
61implicit none
62
63! CODE
64! ----
65! Initialize the dimensions
66call ini_geometry()
67if (.not. dim_init) call stop_clean(__FILE__,__LINE__,"Dimensions of module 'geometry' were not correctly initilized.",1)
68
69! Initialize everything else
70call ini_planet()
71call ini_atmosphere()
72call ini_tracers()
73call ini_slopes()
74call ini_surface()
75call ini_surf_temp()
76call ini_soil_temp()
77call ini_frost()
78call ini_soil()
79call ini_surf_ice()
80call ini_orbit()
81call ini_output()
82
83END SUBROUTINE ini_allocation
84!=======================================================================
85
86!=======================================================================
87SUBROUTINE end_allocation()
88!-----------------------------------------------------------------------
89! NAME
90!     end_geometry
91!
92! DESCRIPTION
93!     Deallocate module arrays.
94!
95! AUTHORS & DATE
96!     JB Clement, 12/2025
97!
98! NOTES
99!
100!-----------------------------------------------------------------------
101
102! DECLARATION
103! -----------
104implicit none
105
106! CODE
107! ----
108call end_output()
109call end_orbit()
110call end_surf_ice()
111call end_soil()
112call end_frost()
113call end_soil_temp()
114call end_surf_temp()
115call end_surface()
116call end_slopes()
117call end_tracers()
118call end_atmosphere()
119call end_planet()
120call end_geometry()
121
122END SUBROUTINE end_allocation
123!=======================================================================
124
125END MODULE allocation
126
Note: See TracBrowser for help on using the repository browser.