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