source: trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90 @ 3188

Last change on this file since 3188 was 3161, checked in by jbclement, 12 months ago

PEM:

  • Addition of flags defined in the "run_PEM.def" to decide to do or not CO2 & H2O ice metamorphism: 'metam_co2ice' and 'metam_h2oice' (default is false).
  • The variations of infinite reservoirs ('watercap') during the PCM years are now taken into account to update H2O ice at the PEM initialization.
  • 'ini_h2o_bigreservoir' is renamed into 'ini_huge_h2oice'.
  • Some cleanings, in particular for the main program "pem.F90".

JBC

File size: 5.7 KB
Line 
1MODULE conf_pem_mod
2
3!=======================================================================
4!
5! Purpose: Read the parameter for a PEM run in run_pem.def
6!
7! Author: RV, JBC
8!=======================================================================
9
10implicit none
11
12!=======================================================================
13contains
14!=======================================================================
15
16SUBROUTINE conf_pem(i_myear,n_myears)
17
18#ifdef CPP_IOIPSL
19    use IOIPSL,          only: getin
20#else
21    ! if not using IOIPSL, we still need to use (a local version of) getin
22    use ioipsl_getincom, only: getin
23#endif
24
25use time_evol_mod,         only: year_bp_ini, dt_pem, h2o_ice_crit, co2_ice_crit, ps_criterion, Max_iter_pem, &
26                          evol_orbit_pem, var_obl, var_ecc, var_lsp, convert_years
27use comsoil_h_pem,         only: soil_pem, fluxgeo, ini_huge_h2oice, depth_breccia, depth_bedrock, reg_thprop_dependp
28use adsorption_mod,        only: adsorption_pem
29use glaciers_mod,          only: h2oice_flow, co2ice_flow, inf_h2oice_threshold, metam_co2ice_threshold, metam_h2oice_threshold, metam_h2oice, metam_co2ice
30use ice_table_mod,         only: icetable_equilibrium, icetable_dynamic
31use time_phylmdz_mod,      only: ecritphy
32
33implicit none
34
35integer, intent(out) :: i_myear, n_myears ! Current simulated Martian year and maximum number of Martian years to be simulated
36
37character(20), parameter :: modname ='conf_pem'
38integer                  :: ierr
39integer                  :: year_earth_bp_ini ! Initial year (in Earth years) of the simulation of the PEM defined in run.def
40
41!PEM parameters
42
43! #---------- Martian years parameters from launching script
44open(100,file = 'info_PEM.txt',status = 'old',form = 'formatted',iostat = ierr)
45if (ierr /= 0) then
46    write(*,*) 'Cannot find required file "info_PEM.txt"!'
47    write(*,*) 'It should be created by the launching script...'
48    stop
49else
50    read(100,*) i_myear, n_myears, convert_years
51endif
52close(100)
53
54!#---------- Output parameters ----------#
55! Frequency of outputs for the PEM
56ecritphy = 1 ! Default value: every year
57call getin('ecritpem',ecritphy)
58
59!#---------- Orbital parameters ----------#
60evol_orbit_pem = .false.
61call getin('evol_orbit_pem',evol_orbit_pem)
62
63year_bp_ini = 0.
64call getin('year_earth_bp_ini',year_earth_bp_ini)
65year_bp_ini = year_earth_bp_ini/convert_years
66
67var_obl = .true.
68call getin('var_obl',var_obl)
69write(*,*) 'Does obliquity vary ?',var_obl
70
71var_ecc = .true.
72call getin('var_ecc',var_ecc)
73write(*,*) 'Does eccentricity vary ?',var_ecc
74
75var_lsp = .true.
76call getin('var_lsp',var_lsp)
77write(*,*) 'Does Ls peri vary ?',var_lsp
78
79!#---------- Stopping criteria parameters ----------#
80Max_iter_pem = 100000000
81call getin('Max_iter_pem',Max_iter_pem)
82
83h2o_ice_crit = 0.2
84call getin('h2o_ice_crit',h2o_ice_crit)
85
86co2_ice_crit = 0.2
87call getin('co2_ice_crit',co2_ice_crit)
88
89ps_criterion = 0.15
90call getin('ps_criterion',ps_criterion)
91
92dt_pem = 1
93call getin('dt_pem', dt_pem)
94
95!#---------- Subsurface parameters ----------#
96soil_pem = .true.
97call getin('soil_pem',soil_pem)
98
99adsorption_pem = .true.
100call getin('adsorption_pem',adsorption_pem)
101
102reg_thprop_dependp = .false.
103call getin('reg_thprop_dependp',reg_thprop_dependp)
104write(*,*)  'Thermal properties of the regolith vary with pressure ?', reg_thprop_dependp
105
106!#---------- Layering parameters ----------#
107fluxgeo = 0.
108call getin('fluxgeo',fluxgeo)
109write(*,*) 'Flux Geothermal is set to',fluxgeo
110
111depth_breccia = 10.
112call getin('depth_breccia',depth_breccia)
113write(*,*) 'Depth of breccia is set to',depth_breccia
114
115depth_bedrock = 1000.
116call getin('depth_bedrock',depth_bedrock)
117write(*,*) 'Depth of bedrock is set to',depth_bedrock
118
119icetable_equilibrium = .true.
120call getin('icetable_equilibrium',icetable_equilibrium)
121write(*,*)  'Is the ice table computed at equilibrium?', icetable_equilibrium
122
123icetable_dynamic = .false.
124call getin('icetable_dynamic',icetable_dynamic)
125write(*,*)  'Is the ice table computed with the dynamic method?', icetable_dynamic
126if ((.not. soil_pem) .and. ((icetable_equilibrium) .or. (icetable_dynamic))) then
127    write(*,*) 'Ice table  must be used when soil_pem = T'
128    call abort_physic(modname,"Ice table  must be used when soil_pem = T",1)
129endif
130
131if ((.not. soil_pem) .and. adsorption_pem) then
132    write(*,*) 'Adsorption must be used when soil_pem = T'
133    call abort_physic(modname,"Adsorption must be used when soil_pem = T",1)
134endif
135
136if ((.not. soil_pem) .and. (fluxgeo > 0.)) then
137    write(*,*) 'Soil is not activated but Flux Geo > 0.'
138    call abort_physic(modname,"Soil is not activated but Flux Geo > 0.",1)
139endif
140
141if ((.not. soil_pem) .and. reg_thprop_dependp) then
142    write(*,*) 'Regolith properties vary with Ps only when soil is set to true'
143    call abort_physic(modname,'Regolith properties vary with Ps only when soil is set to true',1)
144endif
145
146if (evol_orbit_pem .and. year_bp_ini == 0.) then
147    write(*,*)  'You want to follow the file obl_ecc_lsp.asc for changing orb parameters,'
148    write(*,*)  'but you did not specify from which year to start.'
149    call abort_physic(modname,"evol_orbit_pem=.true. but year_bp_ini=0",1)
150endif
151
152!#---------- Ice management parameters ----------#
153ini_huge_h2oice = 1.e4
154call getin('ini_huge_h2oice',ini_huge_h2oice)
155
156inf_h2oice_threshold = 2.e3
157call getin('inf_h2oice_threshold',inf_h2oice_threshold)
158
159metam_h2oice = .false.
160call getin('metam_h2oice',metam_h2oice)
161
162metam_h2oice_threshold = 5.e-2
163call getin('metam_h2oice_threshold',metam_h2oice_threshold)
164
165h2oice_flow = .true.
166call getin('h2oice_flow',h2oice_flow)
167
168metam_co2ice = .false.
169call getin('metam_co2ice',metam_co2ice)
170
171metam_co2ice_threshold = 16.e3
172call getin('metam_co2ice_threshold',metam_co2ice_threshold)
173
174co2ice_flow = .true.
175call getin('co2ice_flow',co2ice_flow)
176
177END SUBROUTINE conf_pem
178
179END MODULE conf_pem_mod
Note: See TracBrowser for help on using the repository browser.