[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 |
---|
[2893] | 31 | |
---|
[3076] | 32 | implicit none |
---|
[3039] | 33 | |
---|
[3076] | 34 | integer, intent(out) :: i_myear, n_myears ! Current simulated Martian year and maximum number of Martian years to be simulated |
---|
| 35 | |
---|
| 36 | character(20), parameter :: modname ='conf_pem' |
---|
| 37 | integer :: ierr |
---|
| 38 | integer :: year_earth_bp_ini ! Initial year (in Earth years) of the simulation of the PEM defined in run.def |
---|
| 39 | |
---|
[2918] | 40 | !PEM parameters |
---|
[2893] | 41 | |
---|
[3039] | 42 | ! #---------- Martian years parameters from launching script |
---|
[3096] | 43 | open(100,file = 'info_PEM.txt',status = 'old',form = 'formatted',iostat = ierr) |
---|
[3039] | 44 | if (ierr /= 0) then |
---|
[3096] | 45 | write(*,*) 'Cannot find required file "info_PEM.txt"!' |
---|
[3039] | 46 | write(*,*) 'It should be created by the launching script...' |
---|
| 47 | stop |
---|
| 48 | else |
---|
| 49 | read(100,*) i_myear, n_myears, convert_years |
---|
| 50 | endif |
---|
| 51 | close(100) |
---|
[2918] | 52 | |
---|
[3159] | 53 | !#---------- Output parameters ----------# |
---|
[3082] | 54 | ! Frequency of outputs for the PEM |
---|
[3214] | 55 | ecritpem = 1 ! Default value: every year |
---|
| 56 | call getin('ecritpem',ecritpem) |
---|
[3082] | 57 | |
---|
[3159] | 58 | !#---------- Orbital parameters ----------# |
---|
[3076] | 59 | evol_orbit_pem = .false. |
---|
| 60 | call getin('evol_orbit_pem',evol_orbit_pem) |
---|
[2918] | 61 | |
---|
[3076] | 62 | year_bp_ini = 0. |
---|
| 63 | call getin('year_earth_bp_ini',year_earth_bp_ini) |
---|
[3210] | 64 | year_bp_ini = int(year_earth_bp_ini/convert_years) |
---|
[2859] | 65 | |
---|
[3076] | 66 | var_obl = .true. |
---|
| 67 | call getin('var_obl',var_obl) |
---|
| 68 | write(*,*) 'Does obliquity vary ?',var_obl |
---|
[2859] | 69 | |
---|
[3076] | 70 | var_ecc = .true. |
---|
| 71 | call getin('var_ecc',var_ecc) |
---|
[3149] | 72 | write(*,*) 'Does eccentricity vary ?',var_ecc |
---|
[2963] | 73 | |
---|
[3076] | 74 | var_lsp = .true. |
---|
| 75 | call getin('var_lsp',var_lsp) |
---|
| 76 | write(*,*) 'Does Ls peri vary ?',var_lsp |
---|
[2963] | 77 | |
---|
[3159] | 78 | !#---------- Stopping criteria parameters ----------# |
---|
[3076] | 79 | Max_iter_pem = 100000000 |
---|
| 80 | call getin('Max_iter_pem',Max_iter_pem) |
---|
[2963] | 81 | |
---|
[3159] | 82 | h2o_ice_crit = 0.2 |
---|
| 83 | call getin('h2o_ice_crit',h2o_ice_crit) |
---|
[2859] | 84 | |
---|
[3159] | 85 | co2_ice_crit = 0.2 |
---|
| 86 | call getin('co2_ice_crit',co2_ice_crit) |
---|
[2893] | 87 | |
---|
[3076] | 88 | ps_criterion = 0.15 |
---|
| 89 | call getin('ps_criterion',ps_criterion) |
---|
[2888] | 90 | |
---|
[3076] | 91 | dt_pem = 1 |
---|
| 92 | call getin('dt_pem', dt_pem) |
---|
[2859] | 93 | |
---|
[3159] | 94 | !#---------- Subsurface parameters ----------# |
---|
[3076] | 95 | soil_pem = .true. |
---|
| 96 | call getin('soil_pem',soil_pem) |
---|
[2859] | 97 | |
---|
[3076] | 98 | adsorption_pem = .true. |
---|
| 99 | call getin('adsorption_pem',adsorption_pem) |
---|
[2888] | 100 | |
---|
[3076] | 101 | reg_thprop_dependp = .false. |
---|
| 102 | call getin('reg_thprop_dependp',reg_thprop_dependp) |
---|
| 103 | write(*,*) 'Thermal properties of the regolith vary with pressure ?', reg_thprop_dependp |
---|
[2963] | 104 | |
---|
[3159] | 105 | !#---------- Layering parameters ----------# |
---|
[3076] | 106 | fluxgeo = 0. |
---|
| 107 | call getin('fluxgeo',fluxgeo) |
---|
| 108 | write(*,*) 'Flux Geothermal is set to',fluxgeo |
---|
[2894] | 109 | |
---|
[3076] | 110 | depth_breccia = 10. |
---|
| 111 | call getin('depth_breccia',depth_breccia) |
---|
| 112 | write(*,*) 'Depth of breccia is set to',depth_breccia |
---|
[2895] | 113 | |
---|
[3076] | 114 | depth_bedrock = 1000. |
---|
| 115 | call getin('depth_bedrock',depth_bedrock) |
---|
| 116 | write(*,*) 'Depth of bedrock is set to',depth_bedrock |
---|
[2895] | 117 | |
---|
[3076] | 118 | icetable_equilibrium = .true. |
---|
| 119 | call getin('icetable_equilibrium',icetable_equilibrium) |
---|
| 120 | write(*,*) 'Is the ice table computed at equilibrium?', icetable_equilibrium |
---|
[2961] | 121 | |
---|
[3076] | 122 | icetable_dynamic = .false. |
---|
| 123 | call getin('icetable_dynamic',icetable_dynamic) |
---|
| 124 | write(*,*) 'Is the ice table computed with the dynamic method?', icetable_dynamic |
---|
| 125 | if ((.not. soil_pem) .and. ((icetable_equilibrium) .or. (icetable_dynamic))) then |
---|
| 126 | write(*,*) 'Ice table must be used when soil_pem = T' |
---|
| 127 | call abort_physic(modname,"Ice table must be used when soil_pem = T",1) |
---|
| 128 | endif |
---|
[2894] | 129 | |
---|
[3076] | 130 | if ((.not. soil_pem) .and. adsorption_pem) then |
---|
| 131 | write(*,*) 'Adsorption must be used when soil_pem = T' |
---|
| 132 | call abort_physic(modname,"Adsorption must be used when soil_pem = T",1) |
---|
| 133 | endif |
---|
[2895] | 134 | |
---|
[3076] | 135 | if ((.not. soil_pem) .and. (fluxgeo > 0.)) then |
---|
| 136 | write(*,*) 'Soil is not activated but Flux Geo > 0.' |
---|
| 137 | call abort_physic(modname,"Soil is not activated but Flux Geo > 0.",1) |
---|
| 138 | endif |
---|
[2895] | 139 | |
---|
[3076] | 140 | if ((.not. soil_pem) .and. reg_thprop_dependp) then |
---|
| 141 | write(*,*) 'Regolith properties vary with Ps only when soil is set to true' |
---|
| 142 | call abort_physic(modname,'Regolith properties vary with Ps only when soil is set to true',1) |
---|
| 143 | endif |
---|
[2859] | 144 | |
---|
[3076] | 145 | if (evol_orbit_pem .and. year_bp_ini == 0.) then |
---|
| 146 | write(*,*) 'You want to follow the file obl_ecc_lsp.asc for changing orb parameters,' |
---|
| 147 | write(*,*) 'but you did not specify from which year to start.' |
---|
| 148 | call abort_physic(modname,"evol_orbit_pem=.true. but year_bp_ini=0",1) |
---|
| 149 | endif |
---|
| 150 | |
---|
[3159] | 151 | !#---------- Ice management parameters ----------# |
---|
[3256] | 152 | ini_huge_h2oice = 9200. ! kg.m-2 (= 10 m) |
---|
[3161] | 153 | call getin('ini_huge_h2oice',ini_huge_h2oice) |
---|
[3076] | 154 | |
---|
[3256] | 155 | inf_h2oice_threshold = 460. ! kg.m-2 (= 0.5 m) |
---|
[3159] | 156 | call getin('inf_h2oice_threshold',inf_h2oice_threshold) |
---|
| 157 | |
---|
[3161] | 158 | metam_h2oice = .false. |
---|
| 159 | call getin('metam_h2oice',metam_h2oice) |
---|
| 160 | |
---|
[3256] | 161 | metam_h2oice_threshold = 460. ! kg.m-2 (= 0.5 m) |
---|
[3159] | 162 | call getin('metam_h2oice_threshold',metam_h2oice_threshold) |
---|
| 163 | |
---|
[3161] | 164 | h2oice_flow = .true. |
---|
| 165 | call getin('h2oice_flow',h2oice_flow) |
---|
| 166 | |
---|
| 167 | metam_co2ice = .false. |
---|
| 168 | call getin('metam_co2ice',metam_co2ice) |
---|
| 169 | |
---|
[3256] | 170 | metam_co2ice_threshold = 16500. ! kg.m-2 (= 10 m) |
---|
[3159] | 171 | call getin('metam_co2ice_threshold',metam_co2ice_threshold) |
---|
| 172 | |
---|
[3161] | 173 | co2ice_flow = .true. |
---|
| 174 | call getin('co2ice_flow',co2ice_flow) |
---|
| 175 | |
---|
[3076] | 176 | END SUBROUTINE conf_pem |
---|
| 177 | |
---|
[2859] | 178 | END MODULE conf_pem_mod |
---|