[2859] | 1 | MODULE conf_pem_mod |
---|
| 2 | |
---|
[2980] | 3 | !======================================================================= |
---|
| 4 | ! |
---|
| 5 | ! Purpose: Read the parameter for a PEM run in run_pem.def |
---|
| 6 | ! |
---|
[3039] | 7 | ! Author: RV, JBC |
---|
[2980] | 8 | !======================================================================= |
---|
| 9 | |
---|
[3076] | 10 | implicit none |
---|
[2859] | 11 | |
---|
[3076] | 12 | !======================================================================= |
---|
| 13 | contains |
---|
| 14 | !======================================================================= |
---|
[2859] | 15 | |
---|
[3076] | 16 | SUBROUTINE conf_pem(i_myear,n_myears) |
---|
[2859] | 17 | |
---|
[2864] | 18 | #ifdef CPP_IOIPSL |
---|
[3076] | 19 | use IOIPSL, only: getin |
---|
[2864] | 20 | #else |
---|
[3076] | 21 | ! if not using IOIPSL, we still need to use (a local version of) getin |
---|
| 22 | use ioipsl_getincom, only: getin |
---|
[2864] | 23 | #endif |
---|
[2918] | 24 | |
---|
[3159] | 25 | use time_evol_mod, only: year_bp_ini, dt_pem, h2o_ice_crit, co2_ice_crit, ps_criterion, Max_iter_pem, & |
---|
[3214] | 26 | evol_orbit_pem, var_obl, var_ecc, var_lsp, convert_years, ecritpem |
---|
[3161] | 27 | use comsoil_h_pem, only: soil_pem, fluxgeo, ini_huge_h2oice, depth_breccia, depth_bedrock, reg_thprop_dependp |
---|
[3159] | 28 | use adsorption_mod, only: adsorption_pem |
---|
[3161] | 29 | use glaciers_mod, only: h2oice_flow, co2ice_flow, inf_h2oice_threshold, metam_co2ice_threshold, metam_h2oice_threshold, metam_h2oice, metam_co2ice |
---|
[3159] | 30 | use ice_table_mod, only: icetable_equilibrium, icetable_dynamic |
---|
[3319] | 31 | use layering_mod, only: layering_algo |
---|
[3349] | 32 | use info_PEM_mod, only: iPCM, iPEM, nPCM, nPCM_ini |
---|
[2893] | 33 | |
---|
[3076] | 34 | implicit none |
---|
[3039] | 35 | |
---|
[3076] | 36 | integer, intent(out) :: i_myear, n_myears ! Current simulated Martian year and maximum number of Martian years to be simulated |
---|
| 37 | |
---|
| 38 | character(20), parameter :: modname ='conf_pem' |
---|
| 39 | integer :: ierr |
---|
| 40 | integer :: year_earth_bp_ini ! Initial year (in Earth years) of the simulation of the PEM defined in run.def |
---|
| 41 | |
---|
[2918] | 42 | !PEM parameters |
---|
[2893] | 43 | |
---|
[3039] | 44 | ! #---------- Martian years parameters from launching script |
---|
[3096] | 45 | open(100,file = 'info_PEM.txt',status = 'old',form = 'formatted',iostat = ierr) |
---|
[3039] | 46 | if (ierr /= 0) then |
---|
[3096] | 47 | write(*,*) 'Cannot find required file "info_PEM.txt"!' |
---|
[3039] | 48 | write(*,*) 'It should be created by the launching script...' |
---|
| 49 | stop |
---|
| 50 | else |
---|
[3349] | 51 | read(100,*) i_myear, n_myears, convert_years, iPCM, iPEM, nPCM, nPCM_ini |
---|
[3039] | 52 | endif |
---|
| 53 | close(100) |
---|
[2918] | 54 | |
---|
[3159] | 55 | !#---------- Output parameters ----------# |
---|
[3082] | 56 | ! Frequency of outputs for the PEM |
---|
[3214] | 57 | ecritpem = 1 ! Default value: every year |
---|
| 58 | call getin('ecritpem',ecritpem) |
---|
[3082] | 59 | |
---|
[3159] | 60 | !#---------- Orbital parameters ----------# |
---|
[3076] | 61 | evol_orbit_pem = .false. |
---|
| 62 | call getin('evol_orbit_pem',evol_orbit_pem) |
---|
[2918] | 63 | |
---|
[3076] | 64 | year_bp_ini = 0. |
---|
| 65 | call getin('year_earth_bp_ini',year_earth_bp_ini) |
---|
[3210] | 66 | year_bp_ini = int(year_earth_bp_ini/convert_years) |
---|
[2859] | 67 | |
---|
[3076] | 68 | var_obl = .true. |
---|
| 69 | call getin('var_obl',var_obl) |
---|
| 70 | write(*,*) 'Does obliquity vary ?',var_obl |
---|
[2859] | 71 | |
---|
[3076] | 72 | var_ecc = .true. |
---|
| 73 | call getin('var_ecc',var_ecc) |
---|
[3149] | 74 | write(*,*) 'Does eccentricity vary ?',var_ecc |
---|
[2963] | 75 | |
---|
[3076] | 76 | var_lsp = .true. |
---|
| 77 | call getin('var_lsp',var_lsp) |
---|
| 78 | write(*,*) 'Does Ls peri vary ?',var_lsp |
---|
[2963] | 79 | |
---|
[3159] | 80 | !#---------- Stopping criteria parameters ----------# |
---|
[3076] | 81 | Max_iter_pem = 100000000 |
---|
| 82 | call getin('Max_iter_pem',Max_iter_pem) |
---|
[2963] | 83 | |
---|
[3159] | 84 | h2o_ice_crit = 0.2 |
---|
| 85 | call getin('h2o_ice_crit',h2o_ice_crit) |
---|
[2859] | 86 | |
---|
[3159] | 87 | co2_ice_crit = 0.2 |
---|
| 88 | call getin('co2_ice_crit',co2_ice_crit) |
---|
[2893] | 89 | |
---|
[3076] | 90 | ps_criterion = 0.15 |
---|
| 91 | call getin('ps_criterion',ps_criterion) |
---|
[2888] | 92 | |
---|
[3076] | 93 | dt_pem = 1 |
---|
| 94 | call getin('dt_pem', dt_pem) |
---|
[2859] | 95 | |
---|
[3159] | 96 | !#---------- Subsurface parameters ----------# |
---|
[3076] | 97 | soil_pem = .true. |
---|
| 98 | call getin('soil_pem',soil_pem) |
---|
[2859] | 99 | |
---|
[3339] | 100 | adsorption_pem = .false. |
---|
[3076] | 101 | call getin('adsorption_pem',adsorption_pem) |
---|
[2888] | 102 | |
---|
[3076] | 103 | reg_thprop_dependp = .false. |
---|
| 104 | call getin('reg_thprop_dependp',reg_thprop_dependp) |
---|
[3490] | 105 | write(*,*) 'Thermal properties of the regolith vary with pressure ?', reg_thprop_dependp |
---|
[2963] | 106 | |
---|
[3076] | 107 | fluxgeo = 0. |
---|
| 108 | call getin('fluxgeo',fluxgeo) |
---|
| 109 | write(*,*) 'Flux Geothermal is set to',fluxgeo |
---|
[2894] | 110 | |
---|
[3076] | 111 | depth_breccia = 10. |
---|
| 112 | call getin('depth_breccia',depth_breccia) |
---|
| 113 | write(*,*) 'Depth of breccia is set to',depth_breccia |
---|
[2895] | 114 | |
---|
[3076] | 115 | depth_bedrock = 1000. |
---|
| 116 | call getin('depth_bedrock',depth_bedrock) |
---|
| 117 | write(*,*) 'Depth of bedrock is set to',depth_bedrock |
---|
[2895] | 118 | |
---|
[3076] | 119 | icetable_equilibrium = .true. |
---|
| 120 | call getin('icetable_equilibrium',icetable_equilibrium) |
---|
[3490] | 121 | write(*,*) 'Is the ice table computed at equilibrium?', icetable_equilibrium |
---|
[2961] | 122 | |
---|
[3076] | 123 | icetable_dynamic = .false. |
---|
| 124 | call getin('icetable_dynamic',icetable_dynamic) |
---|
[3490] | 125 | write(*,*) 'Is the ice table computed with the dynamic method?', icetable_dynamic |
---|
| 126 | if ((.not. soil_pem) .and. (icetable_equilibrium .or. icetable_dynamic)) then |
---|
| 127 | write(*,*) 'Ice table (equilibrium or dynamic method) must be used when soil_pem = T' |
---|
| 128 | call abort_physic(modname,"Ice table must be used when soil_pem = T",1) |
---|
[3076] | 129 | endif |
---|
[2894] | 130 | |
---|
[3076] | 131 | if ((.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) |
---|
| 134 | endif |
---|
[2895] | 135 | |
---|
[3076] | 136 | if ((.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) |
---|
| 139 | endif |
---|
[2895] | 140 | |
---|
[3076] | 141 | if ((.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) |
---|
| 144 | endif |
---|
[2859] | 145 | |
---|
[3076] | 146 | if (evol_orbit_pem .and. year_bp_ini == 0.) then |
---|
[3490] | 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.' |
---|
[3076] | 149 | call abort_physic(modname,"evol_orbit_pem=.true. but year_bp_ini=0",1) |
---|
| 150 | endif |
---|
| 151 | |
---|
[3159] | 152 | !#---------- Ice management parameters ----------# |
---|
[3256] | 153 | ini_huge_h2oice = 9200. ! kg.m-2 (= 10 m) |
---|
[3161] | 154 | call getin('ini_huge_h2oice',ini_huge_h2oice) |
---|
[3076] | 155 | |
---|
[3256] | 156 | inf_h2oice_threshold = 460. ! kg.m-2 (= 0.5 m) |
---|
[3159] | 157 | call getin('inf_h2oice_threshold',inf_h2oice_threshold) |
---|
| 158 | |
---|
[3161] | 159 | metam_h2oice = .false. |
---|
| 160 | call getin('metam_h2oice',metam_h2oice) |
---|
| 161 | |
---|
[3256] | 162 | metam_h2oice_threshold = 460. ! kg.m-2 (= 0.5 m) |
---|
[3159] | 163 | call getin('metam_h2oice_threshold',metam_h2oice_threshold) |
---|
| 164 | |
---|
[3161] | 165 | h2oice_flow = .true. |
---|
| 166 | call getin('h2oice_flow',h2oice_flow) |
---|
| 167 | |
---|
| 168 | metam_co2ice = .false. |
---|
| 169 | call getin('metam_co2ice',metam_co2ice) |
---|
| 170 | |
---|
[3256] | 171 | metam_co2ice_threshold = 16500. ! kg.m-2 (= 10 m) |
---|
[3159] | 172 | call getin('metam_co2ice_threshold',metam_co2ice_threshold) |
---|
| 173 | |
---|
[3161] | 174 | co2ice_flow = .true. |
---|
| 175 | call getin('co2ice_flow',co2ice_flow) |
---|
| 176 | |
---|
[3319] | 177 | !#---------- Layering parameters ----------# |
---|
| 178 | layering_algo = .false. |
---|
| 179 | call getin('layering',layering_algo) |
---|
| 180 | |
---|
[3076] | 181 | END SUBROUTINE conf_pem |
---|
| 182 | |
---|
[2859] | 183 | END MODULE conf_pem_mod |
---|