From 3032e96156ddfadc948909694bc11b77851291f8 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 6 Dec 2023 11:03:04 +0000 Subject: [PATCH 01/15] Added CP lifetime routine to remove duplicated code --- process/availability.py | 43 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/process/availability.py b/process/availability.py index ea2e7c7a38..090ced6fa3 100644 --- a/process/availability.py +++ b/process/availability.py @@ -115,17 +115,7 @@ def avail(self, output: bool): # Centrepost lifetime (years) (ST machines only) if pv.itart == 1: - # SC magnets CP lifetime - # Rem : only the TF maximum fluence is considered for now - if tfv.i_tf_sup == 1: - cv.cplife = min( - ctv.nflutfmax / (fwbsv.neut_flux_cp * YEAR_SECONDS), cv.tlife - ) - - # Aluminium/Copper magnets CP lifetime - # For now, we keep the original def, developped for GLIDCOP magnets ... - else: - cv.cplife = min(cv.cpstflnc / pv.wallmw, cv.tlife) + cv.cplife = self.cp_lifetime() # Plant Availability (iavail=0,1) @@ -450,17 +440,7 @@ def calc_u_planned(self, output: bool) -> float: # Centrepost lifetime (years) (ST only) if pv.itart == 1: - # SC magnets CP lifetime - # Rem : only the TF maximum fluence is considered for now - if tfv.i_tf_sup == 1: - cv.cplife = min( - ctv.nflutfmax / (fwbsv.neut_flux_cp * YEAR_SECONDS), cv.tlife - ) - - # Aluminium/Copper magnets CP lifetime - # For now, we keep the original def, developped for GLIDCOP magnets ... - else: - cv.cplife = min(cv.cpstflnc / pv.wallmw, cv.tlife) + cv.cplife = self.cp_lifetime() # Current drive lifetime (assumed equal to first wall and blanket lifetime) cv.cdrlife = fwbsv.bktlife @@ -994,3 +974,22 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: po.oblnkl(self.outfile) return u_unplanned_vacuum + def cp_lifetime(self): + """Calculates Centrepost Lifetime + + This routine calculates the lifetime of the centrepost, either for superconducting or aluminium/resistive magnets. + + :returns: CP lifetime + :rtype: float + """ + # SC magnets CP lifetime + # Rem : only the TF maximum fluence is considered for now + if tfv.i_tf_sup == 1: + cplife = min(ctv.nflutfmax / (fwbsv.neut_flux_cp * YEAR_SECONDS), cv.tlife) + + # Aluminium/Copper magnets CP lifetime + # For now, we keep the original def, developped for GLIDCOP magnets ... + else: + cplife = min(cv.cpstflnc / pv.wallmw, cv.tlife) + + return cplife From fb1017358101d9109f29d40e4e31177d5e1e1218 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 12 Dec 2023 09:33:34 +0000 Subject: [PATCH 02/15] Added variables for avail_st model --- source/fortran/cost_variables.f90 | 1161 ++--- source/fortran/input.f90 | 7696 +++++++++++++++-------------- 2 files changed, 4435 insertions(+), 4422 deletions(-) diff --git a/source/fortran/cost_variables.f90 b/source/fortran/cost_variables.f90 index 1eeadd9b9f..3035be6e82 100644 --- a/source/fortran/cost_variables.f90 +++ b/source/fortran/cost_variables.f90 @@ -1,752 +1,759 @@ module cost_variables - !! author: J. Morris, S. Muldrew, M. Kovari (UKAEA) - !! - !! Module containing global variables relating to the costing algorithms of a fusion power plant. - !! - !!### References - !! - !! - AEA FUS 251: A User's Guide to the PROCESS Systems Code + !! author: J. Morris, S. Muldrew, M. Kovari (UKAEA) + !! + !! Module containing global variables relating to the costing algorithms of a fusion power plant. + !! + !!### References + !! + !! - AEA FUS 251: A User's Guide to the PROCESS Systems Code #ifndef dp - use, intrinsic :: iso_fortran_env, only: dp=>real64 + use, intrinsic :: iso_fortran_env, only: dp=>real64 #endif - implicit none + implicit none - public + public - real(dp) :: abktflnc - !! allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`) + real(dp) :: abktflnc + !! allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`) - real(dp) :: adivflnc - !! allowable divertor heat fluence (MW-yr/m2) + real(dp) :: adivflnc + !! allowable divertor heat fluence (MW-yr/m2) - real(dp) :: blkcst - !! blanket direct cost (M$) + real(dp) :: blkcst + !! blanket direct cost (M$) - real(dp) :: c221 - !! total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates + real(dp) :: c221 + !! total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates - real(dp) :: c222 - !! total account 222 cost (M$) - TF coils + PF coils + real(dp) :: c222 + !! total account 222 cost (M$) - TF coils + PF coils - real(dp) :: capcost - !! total capital cost including interest (M$) + real(dp) :: capcost + !! total capital cost including interest (M$) - real(dp) :: cconfix - !! fixed cost of superconducting cable ($/m) + real(dp) :: cconfix + !! fixed cost of superconducting cable ($/m) - real(dp) :: cconshpf - !! cost of PF coil steel conduit/sheath ($/m) + real(dp) :: cconshpf + !! cost of PF coil steel conduit/sheath ($/m) - real(dp) :: cconshtf - !! cost of TF coil steel conduit/sheath ($/m) + real(dp) :: cconshtf + !! cost of TF coil steel conduit/sheath ($/m) - real(dp) :: cdcost - !! current drive direct costs (M$) + real(dp) :: cdcost + !! current drive direct costs (M$) - real(dp) :: cdirt - !! total plant direct cost (M$) + real(dp) :: cdirt + !! total plant direct cost (M$) - real(dp) :: cdrlife - !! lifetime of heating/current drive system (y) + real(dp) :: cdrlife + !! lifetime of heating/current drive system (y) - real(dp) :: cfactr - !! Total plant availability fraction; input if `iavail=0` + real(dp) :: cfactr + !! Total plant availability fraction; input if `iavail=0` - real(dp) :: cpfact - !! Total plant capacity factor + real(dp) :: cpfact + !! Total plant capacity factor - real(dp), dimension(4) :: cfind - !! indirect cost factor (func of lsa) (cost model = 0) + real(dp), dimension(4) :: cfind + !! indirect cost factor (func of lsa) (cost model = 0) - real(dp) :: cland - !! cost of land (M$) + real(dp) :: cland + !! cost of land (M$) - real(dp) :: coe - !! cost of electricity ($/MW-hr) + real(dp) :: coe + !! cost of electricity ($/MW-hr) - real(dp) :: coecap - !! capital cost of electricity (m$/kW-hr) + real(dp) :: coecap + !! capital cost of electricity (m$/kW-hr) - real(dp) :: coefuelt - !! 'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr) + real(dp) :: coefuelt + !! 'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr) - real(dp) :: coeoam - !! operation and maintenance contribution to cost of electricity (m$/kW-hr) + real(dp) :: coeoam + !! operation and maintenance contribution to cost of electricity (m$/kW-hr) - real(dp) :: concost - !! plant construction cost (M$) + real(dp) :: concost + !! plant construction cost (M$) - real(dp) :: costexp - !! cost exponent for scaling in 2015 costs model + real(dp) :: costexp + !! cost exponent for scaling in 2015 costs model - real(dp) :: costexp_pebbles - !! cost exponent for pebbles in 2015 costs model + real(dp) :: costexp_pebbles + !! cost exponent for pebbles in 2015 costs model - real(dp) :: cost_factor_buildings - !! cost scaling factor for buildings + real(dp) :: cost_factor_buildings + !! cost scaling factor for buildings - real(dp) :: cost_factor_land - !! cost scaling factor for land + real(dp) :: cost_factor_land + !! cost scaling factor for land - real(dp) :: cost_factor_tf_coils - !! cost scaling factor for TF coils + real(dp) :: cost_factor_tf_coils + !! cost scaling factor for TF coils - real(dp) :: cost_factor_fwbs - !! cost scaling factor for fwbs + real(dp) :: cost_factor_fwbs + !! cost scaling factor for fwbs - real(dp) :: cost_factor_rh - !! cost scaling factor for remote handling + real(dp) :: cost_factor_rh + !! cost scaling factor for remote handling - real(dp) :: cost_factor_vv - !! cost scaling factor for vacuum vessel + real(dp) :: cost_factor_vv + !! cost scaling factor for vacuum vessel - real(dp) :: cost_factor_bop - !! cost scaling factor for energy conversion system + real(dp) :: cost_factor_bop + !! cost scaling factor for energy conversion system - real(dp) :: cost_factor_misc - !! cost scaling factor for remaining subsystems + real(dp) :: cost_factor_misc + !! cost scaling factor for remaining subsystems - real(dp) :: maintenance_fwbs - !! Maintenance cost factor: first wall, blanket, shield, divertor + real(dp) :: maintenance_fwbs + !! Maintenance cost factor: first wall, blanket, shield, divertor - real(dp) :: maintenance_gen - !! Maintenance cost factor: All other components except coils, vacuum vessel, - !! thermal shield, cryostat, land + real(dp) :: maintenance_gen + !! Maintenance cost factor: All other components except coils, vacuum vessel, + !! thermal shield, cryostat, land - real(dp) :: amortization - !! amortization factor (fixed charge factor) "A" (years) + real(dp) :: amortization + !! amortization factor (fixed charge factor) "A" (years) - integer :: cost_model - !! Switch for cost model: - !! - !! - =0 use $ 1990 PROCESS model - !! - =1 use $ 2014 Kovari model - !! - =2 use user-provided model + integer :: cost_model + !! Switch for cost model: + !! + !! - =0 use $ 1990 PROCESS model + !! - =1 use $ 2014 Kovari model + !! - =2 use user-provided model - integer :: i_cp_lifetime - !! Switch for the centrepost lifetime constraint - !! 0 : The CP full power year lifetime is set by the user via cplife_input - !! 1 : The CP lifetime is equal to the divertor lifetime - !! 2 : The CP lifetime is equal to the breeding blankets lifetime - !! 3 : The CP lifetime is equal to the plant lifetime + integer :: i_cp_lifetime + !! Switch for the centrepost lifetime constraint + !! 0 : The CP full power year lifetime is set by the user via cplife_input + !! 1 : The CP lifetime is equal to the divertor lifetime + !! 2 : The CP lifetime is equal to the breeding blankets lifetime + !! 3 : The CP lifetime is equal to the plant lifetime - real(dp) :: cowner - !! owner cost factor + real(dp) :: cowner + !! owner cost factor - real(dp) :: cplife_input - !! User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0) + real(dp) :: cplife_input + !! User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0) - real(dp) :: cplife - !! Calculated full power year lifetime of centrepost (years) + real(dp) :: cplife + !! Calculated full power year lifetime of centrepost (years) - real(dp) :: cpstcst - !! ST centrepost direct cost (M$) + real(dp) :: cpstcst + !! ST centrepost direct cost (M$) - real(dp) :: cpstflnc - !! allowable ST centrepost neutron fluence (MW-yr/m2) + real(dp) :: cpstflnc + !! allowable ST centrepost neutron fluence (MW-yr/m2) - real(dp) :: crctcore - !! reactor core costs (categories 221, 222 and 223) + real(dp) :: crctcore + !! reactor core costs (categories 221, 222 and 223) - real(dp) :: csi - !! allowance for site costs (M$) + real(dp) :: csi + !! allowance for site costs (M$) - real(dp) :: cturbb - !! cost of turbine building (M$) + real(dp) :: cturbb + !! cost of turbine building (M$) - real(dp) :: decomf - !! proportion of constructed cost required for decommissioning fund + real(dp) :: decomf + !! proportion of constructed cost required for decommissioning fund - real(dp) :: dintrt - !! diff between borrowing and saving interest rates + real(dp) :: dintrt + !! diff between borrowing and saving interest rates - real(dp) :: divcst - !! divertor direct cost (M$) + real(dp) :: divcst + !! divertor direct cost (M$) - real(dp) :: divlife - !! Full power lifetime of divertor (y) + real(dp) :: divlife + !! Full power lifetime of divertor (y) - real(dp) :: dtlife - !! period prior to the end of the plant life that the decommissioning fund is used (years) + real(dp) :: dtlife + !! period prior to the end of the plant life that the decommissioning fund is used (years) - real(dp) :: fcap0 - !! average cost of money for construction of plant assuming design/construction time of six years + real(dp) :: fcap0 + !! average cost of money for construction of plant assuming design/construction time of six years - real(dp) :: fcap0cp - !! average cost of money for replaceable components assuming lead time for these of two years + real(dp) :: fcap0cp + !! average cost of money for replaceable components assuming lead time for these of two years - real(dp) :: fcdfuel - !! fraction of current drive cost treated as fuel (if `ifueltyp = 1`) + real(dp) :: fcdfuel + !! fraction of current drive cost treated as fuel (if `ifueltyp = 1`) - real(dp) :: fcontng - !! project contingency factor + real(dp) :: fcontng + !! project contingency factor - real(dp) :: fcr0 - !! fixed charge rate during construction + real(dp) :: fcr0 + !! fixed charge rate during construction - real(dp) :: fkind - !! multiplier for Nth of a kind costs + real(dp) :: fkind + !! multiplier for Nth of a kind costs - real(dp) :: fwallcst - !! first wall cost (M$) + real(dp) :: fwallcst + !! first wall cost (M$) - integer :: iavail - !! Switch for plant availability model: - !! - !! - =0 use input value for cfactr - !! - =1 calculate cfactr using Taylor and Ward 1999 model - !! - =2 calculate cfactr using new (2015) model + integer :: iavail + !! Switch for plant availability model: + !! + !! - =0 use input value for cfactr + !! - =1 calculate cfactr using Taylor and Ward 1999 model + !! - =2 calculate cfactr using new (2015) model + !! - =3 calculate cfactr using ST model - integer :: ibkt_life - !! Switch for fw/blanket lifetime calculation in availability module: - !! - !! - =0 use neutron fluence model - !! - =1 use fusion power model (DEMO only) + integer :: ibkt_life + !! Switch for fw/blanket lifetime calculation in availability module: + !! + !! - =0 use neutron fluence model + !! - =1 use fusion power model (DEMO only) - real(dp) :: life_dpa - !! Allowable DPA from DEMO fw/blanket lifetime calculation in availability module + real(dp) :: life_dpa + !! Allowable DPA from DEMO fw/blanket lifetime calculation in availability module - real(dp) :: bktcycles - !! Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation + real(dp) :: bktcycles + !! Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation - real(dp) :: avail_min - !! Minimum availability (`constraint equation 61`) + real(dp) :: avail_min + !! Minimum availability (`constraint equation 61`) - real(dp) :: tok_build_cost_per_vol - !! Unit cost for tokamak complex buildings, including building and site services ($/m3) + real(dp) :: tok_build_cost_per_vol + !! Unit cost for tokamak complex buildings, including building and site services ($/m3) - real(dp) :: light_build_cost_per_vol - !! Unit cost for unshielded non-active buildings ($/m3) + real(dp) :: light_build_cost_per_vol + !! Unit cost for unshielded non-active buildings ($/m3) - real(dp) :: favail - !! F-value for minimum availability (`constraint equation 61`) + real(dp) :: favail + !! F-value for minimum availability (`constraint equation 61`) - integer :: num_rh_systems - !! Number of remote handling systems (1-10) + integer :: num_rh_systems + !! Number of remote handling systems (1-10) - real(dp) :: conf_mag - !! c parameter, which determines the temperature margin at which magnet lifetime starts to decline + real(dp) :: conf_mag + !! c parameter, which determines the temperature margin at which magnet lifetime starts to decline - real(dp) :: div_prob_fail - !! Divertor probability of failure (per op day) + real(dp) :: div_prob_fail + !! Divertor probability of failure (per op day) - real(dp) :: div_umain_time - !! Divertor unplanned maintenance time (years) + real(dp) :: div_umain_time + !! Divertor unplanned maintenance time (years) - real(dp) :: div_nref - !! Reference value for cycle cycle life of divertor + real(dp) :: div_nref + !! Reference value for cycle cycle life of divertor - real(dp) :: div_nu - !! The cycle when the divertor fails with 100% probability + real(dp) :: div_nu + !! The cycle when the divertor fails with 100% probability - real(dp) :: fwbs_nref - !! Reference value for cycle life of blanket + real(dp) :: fwbs_nref + !! Reference value for cycle life of blanket - real(dp) :: fwbs_nu - !! The cycle when the blanket fails with 100% probability + real(dp) :: fwbs_nu + !! The cycle when the blanket fails with 100% probability - real(dp) :: fwbs_prob_fail - !! Fwbs probability of failure (per op day) + real(dp) :: fwbs_prob_fail + !! Fwbs probability of failure (per op day) - real(dp) :: fwbs_umain_time - !! Fwbs unplanned maintenance time (years) + real(dp) :: fwbs_umain_time + !! Fwbs unplanned maintenance time (years) - real(dp) :: redun_vacp - !! Vacuum system pump redundancy level (%) + real(dp) :: redun_vacp + !! Vacuum system pump redundancy level (%) - integer :: redun_vac - !! Number of redundant vacuum pumps + integer :: redun_vac + !! Number of redundant vacuum pumps - real(dp) :: t_operation - !! Operational time (yrs) + real(dp) :: t_operation + !! Operational time (yrs) - real(dp) :: tbktrepl - !! time taken to replace blanket (y) (`iavail=1`) + real(dp) :: tbktrepl + !! time taken to replace blanket (y) (`iavail=1`) - real(dp) :: tcomrepl - !! time taken to replace both blanket and divertor (y) (`iavail=1`) + real(dp) :: tcomrepl + !! time taken to replace both blanket and divertor (y) (`iavail=1`) - real(dp) :: tdivrepl - !! time taken to replace divertor (y) (`iavail=1`) + real(dp) :: tdivrepl + !! time taken to replace divertor (y) (`iavail=1`) - real(dp) :: uubop - !! unplanned unavailability factor for balance of plant (`iavail=1`) + real(dp) :: uubop + !! unplanned unavailability factor for balance of plant (`iavail=1`) - real(dp) :: uucd - !! unplanned unavailability factor for current drive (`iavail=1`) + real(dp) :: uucd + !! unplanned unavailability factor for current drive (`iavail=1`) - real(dp) :: uudiv - !! unplanned unavailability factor for divertor (`iavail=1`) + real(dp) :: uudiv + !! unplanned unavailability factor for divertor (`iavail=1`) - real(dp) :: uufuel - !! unplanned unavailability factor for fuel system (`iavail=1`) + real(dp) :: uufuel + !! unplanned unavailability factor for fuel system (`iavail=1`) - real(dp) :: uufw - !! unplanned unavailability factor for first wall (`iavail=1`) + real(dp) :: uufw + !! unplanned unavailability factor for first wall (`iavail=1`) - real(dp) :: uumag - !! unplanned unavailability factor for magnets (`iavail=1`) + real(dp) :: uumag + !! unplanned unavailability factor for magnets (`iavail=1`) - real(dp) :: uuves - !! unplanned unavailability factor for vessel (`iavail=1`) + real(dp) :: uuves + !! unplanned unavailability factor for vessel (`iavail=1`) - integer :: ifueltyp - !! Switch for fuel type: - !! - !! - =2 treat initial blanket, divertor, first wall - !! as capital costs. Treat all later items and - !! fraction fcdfuel of CD equipment as fuel costs - !! - =1 treat blanket divertor, first wall and - !! fraction fcdfuel of CD equipment as fuel cost - !! - =0 treat these as capital cost + integer :: ifueltyp + !! Switch for fuel type: + !! + !! - =2 treat initial blanket, divertor, first wall + !! as capital costs. Treat all later items and + !! fraction fcdfuel of CD equipment as fuel costs + !! - =1 treat blanket divertor, first wall and + !! fraction fcdfuel of CD equipment as fuel cost + !! - =0 treat these as capital cost - integer :: ipnet - !! Switch for net electric power calculation: - !! - !! - =0 scale so that always > 0 - !! - =1 let go < 0 (no c-o-e) + integer :: ipnet + !! Switch for net electric power calculation: + !! + !! - =0 scale so that always > 0 + !! - =1 let go < 0 (no c-o-e) - integer :: ireactor - !! Switch for net electric power and cost of electricity calculations: - !! - !! - =0 do not calculate MW(electric) or c-o-e - !! - =1 calculate MW(electric) and c-o-e + integer :: ireactor + !! Switch for net electric power and cost of electricity calculations: + !! + !! - =0 do not calculate MW(electric) or c-o-e + !! - =1 calculate MW(electric) and c-o-e - integer :: lsa - !! Level of safety assurance switch (generally, use 3 or 4): - !! - !! - =1 truly passively safe plant - !! - =2,3 in-between - !! - =4 like current fission plant + integer :: lsa + !! Level of safety assurance switch (generally, use 3 or 4): + !! + !! - =1 truly passively safe plant + !! - =2,3 in-between + !! - =4 like current fission plant - real(dp) :: moneyint - !! interest portion of capital cost (M$) + real(dp) :: moneyint + !! interest portion of capital cost (M$) - integer :: output_costs - !! Switch for costs output: - !! - !! - =0 do not write cost-related outputs to file - !! - =1 write cost-related outputs to file + integer :: output_costs + !! Switch for costs output: + !! + !! - =0 do not write cost-related outputs to file + !! - =1 write cost-related outputs to file - real(dp) :: discount_rate - !! effective cost of money in constant dollars + real(dp) :: discount_rate + !! effective cost of money in constant dollars - real(dp) :: startupratio - !! ratio of additional HCD power for start-up to flat-top operational requirements + real(dp) :: startupratio + !! ratio of additional HCD power for start-up to flat-top operational requirements - real(dp) :: startuppwr - !! cost associated with additional HCD system power required on start-up ($) + real(dp) :: startuppwr + !! cost associated with additional HCD system power required on start-up ($) - real(dp) :: tlife - !! Full power year plant lifetime (years) + real(dp) :: tlife + !! Full power year plant lifetime (years) - real(dp), parameter :: ucad = 180.0D0 - !! unit cost for administration buildings (M$/m3) + real(dp) :: tmain + !! Maintenance time for replacing CP (years) (iavail = 3) - real(dp), parameter :: ucaf = 1.5D6 - !! unit cost for aux facility power equipment ($) + real(dp) :: u_unplanned + !! User-input CP unplanned unavailability (iavail = 3) - real(dp), parameter :: ucahts = 31.0D0 - !! unit cost for aux heat transport equipment ($/W**exphts) + real(dp), parameter :: ucad = 180.0D0 + !! unit cost for administration buildings (M$/m3) - real(dp), parameter :: ucap = 17.0D0 - !! unit cost of auxiliary transformer ($/kVA) + real(dp), parameter :: ucaf = 1.5D6 + !! unit cost for aux facility power equipment ($) - real(dp) :: ucblbe - !! unit cost for blanket beryllium ($/kg) + real(dp), parameter :: ucahts = 31.0D0 + !! unit cost for aux heat transport equipment ($/W**exphts) - real(dp) :: ucblbreed - !! unit cost for breeder material ($/kg) (`blktmodel>0`) + real(dp), parameter :: ucap = 17.0D0 + !! unit cost of auxiliary transformer ($/kVA) - real(dp) :: ucblli - !! unit cost for blanket lithium ($/kg) (30% Li6) + real(dp) :: ucblbe + !! unit cost for blanket beryllium ($/kg) - real(dp) :: ucblli2o - !! unit cost for blanket Li_2O ($/kg) + real(dp) :: ucblbreed + !! unit cost for breeder material ($/kg) (`blktmodel>0`) - real(dp) :: ucbllipb - !! unit cost for blanket Li-Pb ($/kg) (30% Li6) + real(dp) :: ucblli + !! unit cost for blanket lithium ($/kg) (30% Li6) - real(dp) :: ucblss - !! unit cost for blanket stainless steel ($/kg) + real(dp) :: ucblli2o + !! unit cost for blanket Li_2O ($/kg) - real(dp) :: ucblvd - !! unit cost for blanket vanadium ($/kg) + real(dp) :: ucbllipb + !! unit cost for blanket Li-Pb ($/kg) (30% Li6) - real(dp), parameter :: ucbpmp = 2.925D5 - !! vacuum system backing pump cost ($) + real(dp) :: ucblss + !! unit cost for blanket stainless steel ($/kg) - real(dp) :: ucbus - !! cost of aluminium bus for TF coil ($/A-m) + real(dp) :: ucblvd + !! unit cost for blanket vanadium ($/kg) - real(dp) :: uccase - !! cost of superconductor case ($/kg) + real(dp), parameter :: ucbpmp = 2.925D5 + !! vacuum system backing pump cost ($) - real(dp), parameter :: ucco = 350.0D0 - !! unit cost for control buildings (M$/m3) + real(dp) :: ucbus + !! cost of aluminium bus for TF coil ($/A-m) - real(dp) :: uccpcl1 - !! cost of high strength tapered copper ($/kg) + real(dp) :: uccase + !! cost of superconductor case ($/kg) - real(dp) :: uccpclb - !! cost of TF outboard leg plate coils ($/kg) + real(dp), parameter :: ucco = 350.0D0 + !! unit cost for control buildings (M$/m3) - real(dp), parameter :: uccpmp = 3.9D5 - !! vacuum system cryopump cost ($) + real(dp) :: uccpcl1 + !! cost of high strength tapered copper ($/kg) - real(dp), parameter :: uccr = 460.0D0 - !! unit cost for cryogenic building (M$/vol) + real(dp) :: uccpclb + !! cost of TF outboard leg plate coils ($/kg) - real(dp) :: uccry - !! heat transport system cryoplant costs ($/W**expcry) + real(dp), parameter :: uccpmp = 3.9D5 + !! vacuum system cryopump cost ($) - real(dp) :: uccryo - !! unit cost for vacuum vessel ($/kg) + real(dp), parameter :: uccr = 460.0D0 + !! unit cost for cryogenic building (M$/vol) - real(dp) :: uccu - !! unit cost for copper in superconducting cable ($/kg) + real(dp) :: uccry + !! heat transport system cryoplant costs ($/W**expcry) - real(dp), parameter :: ucdgen = 1.7D6 - !! cost per 8 MW diesel generator ($) + real(dp) :: uccryo + !! unit cost for vacuum vessel ($/kg) - real(dp) :: ucdiv - !! cost of divertor blade ($) + real(dp) :: uccu + !! unit cost for copper in superconducting cable ($/kg) - real(dp), parameter :: ucdtc = 13.0D0 - !! detritiation, air cleanup cost ($/10000m3/hr) + real(dp), parameter :: ucdgen = 1.7D6 + !! cost per 8 MW diesel generator ($) - real(dp), parameter :: ucduct = 4.225D4 - !! vacuum system duct cost ($/m) + real(dp) :: ucdiv + !! cost of divertor blade ($) - real(dp) :: ucech - !! ECH system cost ($/W) + real(dp), parameter :: ucdtc = 13.0D0 + !! detritiation, air cleanup cost ($/10000m3/hr) - real(dp), parameter :: ucel = 380.0D0 - !! unit cost for electrical equipment building (M$/m3) + real(dp), parameter :: ucduct = 4.225D4 + !! vacuum system duct cost ($/m) - real(dp), parameter :: uces1 = 3.2D4 - !! MGF (motor-generator flywheel) cost factor ($/MVA**0.8) + real(dp) :: ucech + !! ECH system cost ($/W) - real(dp), parameter :: uces2 = 8.8D3 - !! MGF (motor-generator flywheel) cost factor ($/MJ**0.8) + real(dp), parameter :: ucel = 380.0D0 + !! unit cost for electrical equipment building (M$/m3) - real(dp) :: ucf1 - !! cost of fuelling system ($) + real(dp), parameter :: uces1 = 3.2D4 + !! MGF (motor-generator flywheel) cost factor ($/MVA**0.8) - real(dp) :: ucfnc - !! outer PF coil fence support cost ($/kg) + real(dp), parameter :: uces2 = 8.8D3 + !! MGF (motor-generator flywheel) cost factor ($/MJ**0.8) - real(dp), parameter :: ucfpr = 4.4D7 - !! cost of 60g/day tritium processing unit ($) + real(dp) :: ucf1 + !! cost of fuelling system ($) - real(dp) :: ucfuel - !! unit cost of D-T fuel (M$/year/1200MW) + real(dp) :: ucfnc + !! outer PF coil fence support cost ($/kg) - real(dp), parameter :: ucfwa = 6.0D4 - !! first wall armour cost ($/m2) + real(dp), parameter :: ucfpr = 4.4D7 + !! cost of 60g/day tritium processing unit ($) - real(dp), parameter :: ucfwps = 1.0D7 - !! first wall passive stabiliser cost ($) + real(dp) :: ucfuel + !! unit cost of D-T fuel (M$/year/1200MW) - real(dp), parameter :: ucfws = 5.3D4 - !! first wall structure cost ($/m2) + real(dp), parameter :: ucfwa = 6.0D4 + !! first wall armour cost ($/m2) - real(dp), parameter :: ucgss = 35.0D0 - !! cost of reactor structure ($/kg) + real(dp), parameter :: ucfwps = 1.0D7 + !! first wall passive stabiliser cost ($) - real(dp) :: uche3 - !! cost of helium-3 ($/kg) + real(dp), parameter :: ucfws = 5.3D4 + !! first wall structure cost ($/m2) - real(dp) :: uchrs - !! cost of heat rejection system ($) + real(dp), parameter :: ucgss = 35.0D0 + !! cost of reactor structure ($/kg) - real(dp), dimension(2) :: uchts - !! cost of heat transport system equipment per loop ($/W); dependent on coolant type (coolwh) + real(dp) :: uche3 + !! cost of helium-3 ($/kg) - real(dp) :: uciac - !! cost of instrumentation, control & diagnostics ($) + real(dp) :: uchrs + !! cost of heat rejection system ($) - real(dp) :: ucich - !! ICH system cost ($/W) + real(dp), dimension(2) :: uchts + !! cost of heat transport system equipment per loop ($/W); dependent on coolant type (coolwh) - real(dp), parameter :: ucint = 35.0D0 - !! superconductor intercoil structure cost ($/kg) + real(dp) :: uciac + !! cost of instrumentation, control & diagnostics ($) - real(dp) :: uclh - !! lower hybrid system cost ($/W) + real(dp) :: ucich + !! ICH system cost ($/W) - real(dp), parameter :: uclv = 16.0D0 - !! low voltage system cost ($/kVA) + real(dp), parameter :: ucint = 35.0D0 + !! superconductor intercoil structure cost ($/kg) - real(dp), parameter :: ucmb = 260.0D0 - !! unit cost for reactor maintenance building (M$/m3) + real(dp) :: uclh + !! lower hybrid system cost ($/W) - real(dp) :: ucme - !! cost of maintenance equipment ($) + real(dp), parameter :: uclv = 16.0D0 + !! low voltage system cost ($/kVA) - real(dp) :: ucmisc - !! miscellaneous plant allowance ($) + real(dp), parameter :: ucmb = 260.0D0 + !! unit cost for reactor maintenance building (M$/m3) - real(dp) :: ucnbi - !! NBI system cost ($/W) + real(dp) :: ucme + !! cost of maintenance equipment ($) - real(dp), parameter :: ucnbv = 1000.0D0 - !! cost of nuclear building ventilation ($/m3) + real(dp) :: ucmisc + !! miscellaneous plant allowance ($) - real(dp), dimension(4) :: ucoam - !! annual cost of operation and maintenance (M$/year/1200MW**0.5) + real(dp) :: ucnbi + !! NBI system cost ($/W) - real(dp) :: ucpens - !! penetration shield cost ($/kg) + real(dp), parameter :: ucnbv = 1000.0D0 + !! cost of nuclear building ventilation ($/m3) - real(dp) :: ucpfb - !! cost of PF coil buses ($/kA-m) + real(dp), dimension(4) :: ucoam + !! annual cost of operation and maintenance (M$/year/1200MW**0.5) - real(dp) :: ucpfbk - !! cost of PF coil DC breakers ($/MVA**0.7) + real(dp) :: ucpens + !! penetration shield cost ($/kg) - real(dp) :: ucpfbs - !! cost of PF burn power supplies ($/kW**0.7) + real(dp) :: ucpfb + !! cost of PF coil buses ($/kA-m) - real(dp) :: ucpfcb - !! cost of PF coil AC breakers ($/circuit) + real(dp) :: ucpfbk + !! cost of PF coil DC breakers ($/MVA**0.7) - real(dp) :: ucpfdr1 - !! cost factor for dump resistors ($/MJ) + real(dp) :: ucpfbs + !! cost of PF burn power supplies ($/kW**0.7) - real(dp) :: ucpfic - !! cost of PF instrumentation and control ($/channel) + real(dp) :: ucpfcb + !! cost of PF coil AC breakers ($/circuit) - real(dp) :: ucpfps - !! cost of PF coil pulsed power supplies ($/MVA) + real(dp) :: ucpfdr1 + !! cost factor for dump resistors ($/MJ) - real(dp), parameter :: ucphx = 15.0D0 - !! primary heat transport cost ($/W**exphts) + real(dp) :: ucpfic + !! cost of PF instrumentation and control ($/channel) - real(dp), parameter :: ucpp = 48.0D0 - !! cost of primary power transformers ($/kVA**0.9) + real(dp) :: ucpfps + !! cost of PF coil pulsed power supplies ($/MVA) - real(dp) :: ucrb - !! cost of reactor building (M$/m3) + real(dp), parameter :: ucphx = 15.0D0 + !! primary heat transport cost ($/W**exphts) - real(dp), dimension(9) :: ucsc - !! cost of superconductor ($/kg) + real(dp), parameter :: ucpp = 48.0D0 + !! cost of primary power transformers ($/kVA**0.9) - real(dp), parameter :: ucsh = 115.0D0 - !! cost of shops and warehouses (M$/m3) + real(dp) :: ucrb + !! cost of reactor building (M$/m3) - real(dp) :: ucshld - !! cost of shield structural steel ($/kg) + real(dp), dimension(9) :: ucsc + !! cost of superconductor ($/kg) - real(dp), parameter :: ucswyd = 1.84D7 - !! switchyard equipment costs ($) + real(dp), parameter :: ucsh = 115.0D0 + !! cost of shops and warehouses (M$/m3) - real(dp) :: uctfbr - !! cost of TF coil breakers ($/W**0.7) + real(dp) :: ucshld + !! cost of shield structural steel ($/kg) - real(dp) :: uctfbus - !! cost of TF coil bus ($/kg) + real(dp), parameter :: ucswyd = 1.84D7 + !! switchyard equipment costs ($) - real(dp), parameter :: uctfdr = 1.75D-4 - !! cost of TF coil dump resistors ($/J) + real(dp) :: uctfbr + !! cost of TF coil breakers ($/W**0.7) - real(dp), parameter :: uctfgr = 5000.0D0 - !! additional cost of TF coil dump resistors ($/coil) - - real(dp), parameter :: uctfic = 1.0D4 - !! cost of TF coil instrumentation and control ($/coil/30) - - real(dp) :: uctfps - !! cost of TF coil power supplies ($/W**0.7) - - real(dp) :: uctfsw - !! cost of TF coil slow dump switches ($/A) - - real(dp), parameter :: uctpmp = 1.105D5 - !! cost of turbomolecular pump ($) - - real(dp), parameter :: uctr = 370.0D0 - !! cost of tritium building ($/m3) - - real(dp), dimension(2) :: ucturb - !! cost of turbine plant equipment ($) (dependent on coolant type coolwh) - - real(dp), parameter :: ucvalv = 3.9D5 - !! vacuum system valve cost ($) - - real(dp), parameter :: ucvdsh = 26.0D0 - !! vacuum duct shield cost ($/kg) - - real(dp), parameter :: ucviac = 1.3D6 - !! vacuum system instrumentation and control cost ($) - - real(dp) :: ucwindpf - !! cost of PF coil superconductor windings ($/m) - - real(dp) :: ucwindtf - !! cost of TF coil superconductor windings ($/m) - - real(dp), parameter :: ucws = 460.0D0 - !! cost of active assembly shop ($/m3) - - real(dp), dimension(4) :: ucwst - !! cost of waste disposal (M$/y/1200MW) - - contains - - subroutine init_cost_variables - !! Initialise cost variables - implicit none - - abktflnc = 5.0D0 - adivflnc = 7.0D0 - blkcst = 0.0D0 - c221 = 0.0D0 - c222 = 0.0D0 - capcost = 0.0D0 - cconfix = 80.0D0 - cconshpf = 70.0D0 - cconshtf = 75.0D0 - cdcost = 0.0D0 - cdirt = 0.0D0 - cdrlife = 0.0D0 - cfactr = 0.75D0 - cpfact = 0.0D0 - cfind = (/0.244D0, 0.244D0, 0.244D0, 0.29D0/) - cland = 19.2D0 - coe = 0.0D0 - coecap = 0.0D0 - coefuelt = 0.0D0 - coeoam = 0.0D0 - concost = 0.0D0 - costexp = 0.8D0 - costexp_pebbles = 0.6D0 - cost_factor_buildings = 1.0D0 - cost_factor_land = 1.0D0 - cost_factor_tf_coils = 1.0D0 - cost_factor_fwbs = 1.0D0 - cost_factor_rh = 1.0D0 - cost_factor_vv = 1.0D0 - cost_factor_bop = 1.0D0 - cost_factor_misc = 1.0D0 - maintenance_fwbs = 0.2D0 - maintenance_gen = 0.05D0 - amortization = 13.6D0 - cost_model = 1 - cowner = 0.15D0 - cplife = 0.0D0 - cpstcst = 0.0D0 - cpstflnc = 10.0D0 - crctcore = 0.0D0 - csi = 16.0D0 - cturbb = 38.0D0 - decomf = 0.1D0 - dintrt = 0.0D0 - divcst = 0.0D0 - divlife = 0.0D0 - dtlife = 0.0D0 - fcap0 = 1.165D0 - fcap0cp = 1.08D0 - fcdfuel = 0.1D0 - fcontng = 0.195D0 - fcr0 = 0.0966D0 - fkind = 1.0D0 - fwallcst = 0.0D0 - iavail= 2 - ibkt_life = 0 - life_dpa = 50 - bktcycles = 1.0D3 - avail_min = 0.75D0 - tok_build_cost_per_vol = 1283.0D0 - light_build_cost_per_vol = 270.0D0 - favail = 1.0D0 - num_rh_systems = 4 - conf_mag = 0.99D0 - div_prob_fail = 0.0002D0 - div_umain_time = 0.25D0 - div_nref = 7000.0D0 - div_nu = 14000.0D0 - fwbs_nref = 20000.0D0 - fwbs_nu = 40000.0D0 - fwbs_prob_fail = 0.0002D0 - fwbs_umain_time = 0.25D0 - redun_vacp = 25.0D0 - redun_vac = 0 - t_operation = 0.0D0 - tbktrepl = 0.5D0 - tcomrepl = 0.5D0 - tdivrepl = 0.25D0 - uubop = 0.02D0 - uucd = 0.02D0 - uudiv = 0.04D0 - uufuel = 0.02D0 - uufw = 0.04D0 - uumag = 0.02D0 - uuves = 0.04D0 - ifueltyp = 0 - ipnet = 0 - ireactor = 1 - lsa = 4 - moneyint = 0.0D0 - output_costs = 1 - discount_rate = 0.0435D0 - startupratio = 1.0 - startuppwr = 0.0 - tlife = 30.0D0 - ucblbe = 260.0D0 - ucblbreed = 875.0D0 - ucblli = 875.0D0 - ucblli2o = 600.0D0 - ucbllipb = 10.3D0 - ucblss = 90.0D0 - ucblvd = 200.0D0 - ucbus = 0.123D0 - uccase = 50.0D0 - uccpcl1 = 250.0D0 - uccpclb = 150.0D0 - uccry = 9.3D4 - uccryo = 32.0D0 - uccu = 75.0D0 - ucdiv = 2.8D5 - ucech = 3.0D0 - ucf1 = 2.23D7 - ucfnc = 35.0D0 - ucfuel = 3.45D0 - uche3 = 1.0D6 - uchrs = 87.9D6 - uchts = (/15.3D0, 19.1D0/) - uciac = 1.5D8 - ucich = 3.0D0 - uclh = 3.3D0 - ucme = 1.25D8 - ucmisc = 2.5D7 - ucnbi = 3.3D0 - ucoam = (/68.8D0, 68.8D0, 68.8D0, 74.4D0/) - ucpens = 32.0D0 - ucpfb = 210.0D0 - ucpfbk = 1.66D4 - ucpfbs = 4.9D3 - ucpfcb = 7.5D4 - ucpfdr1 = 150.0D0 - ucpfic = 1.0D4 - ucpfps = 3.5D4 - ucrb = 400.0D0 - ucsc = & - (/600.0D0, 600.0D0, 300.0D0, 600.0D0, 600.0D0, 600.0D0, 300.0D0, 1200.0D0, & - 1200.0D0/) - ucshld = 32.0D0 - uctfbr = 1.22D0 - uctfbus = 100.0D0 - uctfps = 24.0D0 - uctfsw = 1.0D0 - ucturb = (/230.0D6, 245.0D6/) - ucwindpf = 465.0D0 - ucwindtf = 480.0D0 - ucwst = (/0.0D0, 3.94D0, 5.91D0, 7.88D0/) - i_cp_lifetime = 0 - cplife_input = 2.0D0 - - end subroutine init_cost_variables + real(dp) :: uctfbus + !! cost of TF coil bus ($/kg) + + real(dp), parameter :: uctfdr = 1.75D-4 + !! cost of TF coil dump resistors ($/J) + + real(dp), parameter :: uctfgr = 5000.0D0 + !! additional cost of TF coil dump resistors ($/coil) + + real(dp), parameter :: uctfic = 1.0D4 + !! cost of TF coil instrumentation and control ($/coil/30) + + real(dp) :: uctfps + !! cost of TF coil power supplies ($/W**0.7) + + real(dp) :: uctfsw + !! cost of TF coil slow dump switches ($/A) + + real(dp), parameter :: uctpmp = 1.105D5 + !! cost of turbomolecular pump ($) + + real(dp), parameter :: uctr = 370.0D0 + !! cost of tritium building ($/m3) + + real(dp), dimension(2) :: ucturb + !! cost of turbine plant equipment ($) (dependent on coolant type coolwh) + + real(dp), parameter :: ucvalv = 3.9D5 + !! vacuum system valve cost ($) + + real(dp), parameter :: ucvdsh = 26.0D0 + !! vacuum duct shield cost ($/kg) + + real(dp), parameter :: ucviac = 1.3D6 + !! vacuum system instrumentation and control cost ($) + + real(dp) :: ucwindpf + !! cost of PF coil superconductor windings ($/m) + + real(dp) :: ucwindtf + !! cost of TF coil superconductor windings ($/m) + + real(dp), parameter :: ucws = 460.0D0 + !! cost of active assembly shop ($/m3) + + real(dp), dimension(4) :: ucwst + !! cost of waste disposal (M$/y/1200MW) + +contains + + subroutine init_cost_variables + !! Initialise cost variables + implicit none + + abktflnc = 5.0D0 + adivflnc = 7.0D0 + blkcst = 0.0D0 + c221 = 0.0D0 + c222 = 0.0D0 + capcost = 0.0D0 + cconfix = 80.0D0 + cconshpf = 70.0D0 + cconshtf = 75.0D0 + cdcost = 0.0D0 + cdirt = 0.0D0 + cdrlife = 0.0D0 + cfactr = 0.75D0 + cpfact = 0.0D0 + cfind = (/0.244D0, 0.244D0, 0.244D0, 0.29D0/) + cland = 19.2D0 + coe = 0.0D0 + coecap = 0.0D0 + coefuelt = 0.0D0 + coeoam = 0.0D0 + concost = 0.0D0 + costexp = 0.8D0 + costexp_pebbles = 0.6D0 + cost_factor_buildings = 1.0D0 + cost_factor_land = 1.0D0 + cost_factor_tf_coils = 1.0D0 + cost_factor_fwbs = 1.0D0 + cost_factor_rh = 1.0D0 + cost_factor_vv = 1.0D0 + cost_factor_bop = 1.0D0 + cost_factor_misc = 1.0D0 + maintenance_fwbs = 0.2D0 + maintenance_gen = 0.05D0 + amortization = 13.6D0 + cost_model = 1 + cowner = 0.15D0 + cplife = 0.0D0 + cpstcst = 0.0D0 + cpstflnc = 10.0D0 + crctcore = 0.0D0 + csi = 16.0D0 + cturbb = 38.0D0 + decomf = 0.1D0 + dintrt = 0.0D0 + divcst = 0.0D0 + divlife = 0.0D0 + dtlife = 0.0D0 + fcap0 = 1.165D0 + fcap0cp = 1.08D0 + fcdfuel = 0.1D0 + fcontng = 0.195D0 + fcr0 = 0.0966D0 + fkind = 1.0D0 + fwallcst = 0.0D0 + iavail= 2 + ibkt_life = 0 + life_dpa = 50 + bktcycles = 1.0D3 + avail_min = 0.75D0 + tok_build_cost_per_vol = 1283.0D0 + light_build_cost_per_vol = 270.0D0 + favail = 1.0D0 + num_rh_systems = 4 + conf_mag = 0.99D0 + div_prob_fail = 0.0002D0 + div_umain_time = 0.25D0 + div_nref = 7000.0D0 + div_nu = 14000.0D0 + fwbs_nref = 20000.0D0 + fwbs_nu = 40000.0D0 + fwbs_prob_fail = 0.0002D0 + fwbs_umain_time = 0.25D0 + redun_vacp = 25.0D0 + redun_vac = 0 + t_operation = 0.0D0 + tbktrepl = 0.5D0 + tcomrepl = 0.5D0 + tdivrepl = 0.25D0 + uubop = 0.02D0 + uucd = 0.02D0 + uudiv = 0.04D0 + uufuel = 0.02D0 + uufw = 0.04D0 + uumag = 0.02D0 + uuves = 0.04D0 + ifueltyp = 0 + ipnet = 0 + ireactor = 1 + lsa = 4 + moneyint = 0.0D0 + output_costs = 1 + discount_rate = 0.0435D0 + startupratio = 1.0 + startuppwr = 0.0 + tlife = 30.0D0 + ucblbe = 260.0D0 + ucblbreed = 875.0D0 + ucblli = 875.0D0 + ucblli2o = 600.0D0 + ucbllipb = 10.3D0 + ucblss = 90.0D0 + ucblvd = 200.0D0 + ucbus = 0.123D0 + uccase = 50.0D0 + uccpcl1 = 250.0D0 + uccpclb = 150.0D0 + uccry = 9.3D4 + uccryo = 32.0D0 + uccu = 75.0D0 + ucdiv = 2.8D5 + ucech = 3.0D0 + ucf1 = 2.23D7 + ucfnc = 35.0D0 + ucfuel = 3.45D0 + uche3 = 1.0D6 + uchrs = 87.9D6 + uchts = (/15.3D0, 19.1D0/) + uciac = 1.5D8 + ucich = 3.0D0 + uclh = 3.3D0 + ucme = 1.25D8 + ucmisc = 2.5D7 + ucnbi = 3.3D0 + ucoam = (/68.8D0, 68.8D0, 68.8D0, 74.4D0/) + ucpens = 32.0D0 + ucpfb = 210.0D0 + ucpfbk = 1.66D4 + ucpfbs = 4.9D3 + ucpfcb = 7.5D4 + ucpfdr1 = 150.0D0 + ucpfic = 1.0D4 + ucpfps = 3.5D4 + ucrb = 400.0D0 + ucsc = & + (/600.0D0, 600.0D0, 300.0D0, 600.0D0, 600.0D0, 600.0D0, 300.0D0, 1200.0D0, & + 1200.0D0/) + ucshld = 32.0D0 + uctfbr = 1.22D0 + uctfbus = 100.0D0 + uctfps = 24.0D0 + uctfsw = 1.0D0 + ucturb = (/230.0D6, 245.0D6/) + ucwindpf = 465.0D0 + ucwindtf = 480.0D0 + ucwst = (/0.0D0, 3.94D0, 5.91D0, 7.88D0/) + i_cp_lifetime = 0 + cplife_input = 2.0D0 + + end subroutine init_cost_variables end module cost_variables diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 05d8221a74..5d1fa05acd 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -6,5171 +6,5177 @@ module process_input - !! Module containing the routines that perform the actual reading - !! and parsing of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! N/A - !! This module provides a set of routines to read in data from the - !! main PROCESS input file (IN.DAT). The format of the file is - !! similar to the F90 NAMELIST structure, but with a few - !! additional features: - !!
    - !!

  1. Comments can be read in that are copied to the standard - !! output channel - these are lines with five (or more) - !! consecutive '*' characters at the start. - !!

  2. Other lines within the file can contain simple comments - !! for the user - these are not copied to the standard output - !! channel. They start with one to four '*' characters. - !!
- !!

Character strings, integers and double precision values can - !! be read in. - !!

The following rules must be obeyed when writing an input - !! file: - !!

- !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Module containing the routines that perform the actual reading + !! and parsing of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! N/A + !! This module provides a set of routines to read in data from the + !! main PROCESS input file (IN.DAT). The format of the file is + !! similar to the F90 NAMELIST structure, but with a few + !! additional features: + !!
    + !!

  1. Comments can be read in that are copied to the standard + !! output channel - these are lines with five (or more) + !! consecutive '*' characters at the start. + !!

  2. Other lines within the file can contain simple comments + !! for the user - these are not copied to the standard output + !! channel. They start with one to four '*' characters. + !!
+ !!

Character strings, integers and double precision values can + !! be read in. + !!

The following rules must be obeyed when writing an input + !! file: + !!

+ !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #ifndef dp - use, intrinsic :: iso_fortran_env, only: dp=>real64 + use, intrinsic :: iso_fortran_env, only: dp=>real64 #endif - implicit none + implicit none - private - public :: input, check_range_int, check_range_real, lower_case, init_input - integer, public, parameter :: nin = 10 + private + public :: input, check_range_int, check_range_real, lower_case, init_input + integer, public, parameter :: nin = 10 #ifdef unit_test - public :: parse_input_file + public :: parse_input_file #endif ! public :: upper_case - integer, parameter :: maxlen = 2000 ! maximum line length - character(len=maxlen) :: line ! current line of text from input file - integer :: linelen, lineno ! current line length, line number - integer :: iptr ! current position on line - integer :: infile, outfile, report_changes, icode - logical :: subscript_present - logical :: error - character(len=78) :: error_message + integer, parameter :: maxlen = 2000 ! maximum line length + character(len=maxlen) :: line ! current line of text from input file + integer :: linelen, lineno ! current line length, line number + integer :: iptr ! current position on line + integer :: infile, outfile, report_changes, icode + logical :: subscript_present + logical :: error + character(len=78) :: error_message - ! Vars for subroutine input() requiring re-initialisation before each new run - integer :: show_changes - logical :: constraints_exist + ! Vars for subroutine input() requiring re-initialisation before each new run + integer :: show_changes + logical :: constraints_exist contains - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine init_input - !! Initialise module variables - implicit none - - error = .False. - show_changes = 0 - constraints_exist = .false. - line = "" - linelen = 0 - lineno = 0 - iptr = 0 - infile = 0 - outfile = 0 - report_changes = 0 - icode = 0 - subscript_present = .false. - error_message = "" - end subroutine init_input - - subroutine input - - !! Routine that calls the main input file parsing routines - !! author: P J Knight, CCFE, Culham Science Centre - !! None - !! This routine provides the interface between the input file - !! reading routines and the rest of PROCESS. - !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - use constants, only: nout - use numerics, only: ipeqns, icc, active_constraints - implicit none - - ! Arguments - - ! Local variables - - integer :: i - ! j - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - call parse_input_file(nin,nout,show_changes) - - ! Set all the values of the active_constraints array - do i = 1, ipeqns - if (icc(i) /= 0) then + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine init_input + !! Initialise module variables + implicit none + + error = .False. + show_changes = 0 + constraints_exist = .false. + line = "" + linelen = 0 + lineno = 0 + iptr = 0 + infile = 0 + outfile = 0 + report_changes = 0 + icode = 0 + subscript_present = .false. + error_message = "" + end subroutine init_input + + subroutine input + + !! Routine that calls the main input file parsing routines + !! author: P J Knight, CCFE, Culham Science Centre + !! None + !! This routine provides the interface between the input file + !! reading routines and the rest of PROCESS. + !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use constants, only: nout + use numerics, only: ipeqns, icc, active_constraints + implicit none + + ! Arguments + + ! Local variables + + integer :: i + ! j + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + call parse_input_file(nin,nout,show_changes) + + ! Set all the values of the active_constraints array + do i = 1, ipeqns + if (icc(i) /= 0) then active_constraints(icc(i)) = .true. constraints_exist = .true. - end if - end do - - ! Set the device type based on the input file's switches - call devtyp - end subroutine input - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine devtyp - !! Set icase description based on device type - use global_variables, only: icase - use ife_variables, only: ife - use stellarator_variables, only: istell - implicit none - - if (ife == 1) then - icase = 'Inertial Fusion model' - else if (istell /= 0) then - icase = 'Stellarator model' - end if - end subroutine devtyp - - subroutine parse_input_file(in_file,out_file,show_changes) - - !! Routine that parses the contents of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! author: J Morris, CCFE, Culham Science Centre - !! author: F Warmer, IPP Greifswald - !! in_file : input integer : Fortran input unit identifier - !! out_file : input integer : Fortran output unit identifier - !! show_changes : input integer : switch to turn on (1) or off (0) - !! reporting of changed values - !! This routine reads the data from the PROCESS input file (IN.DAT), - !! dealing with comments or blank lines correctly, and sets the - !! value of any variables found in the file. Any changes - !! from the default values may be reported if required. - !!

Each possible variable in this block is dealt with - !! individually. (To add additional input variables, simply copy - !! and edit one of the similar existing examples.) - !! The routine also does the extremely useful function of checking - !! that the given value for a variable lies within a sensible - !! predefined range, and stops the program if apparently - !! nonsensical values are attempted. - !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - use constants, only: dcopper, dalu - use global_variables, only: run_tests, verbose, maxcal, runtitle - use build_variables, only: tf_in_cs, fmsfw, blbmoth, blbuith, fmsbc, shldoth, & - fmsdwi, shldtth, shldlth, vgap2, plleni, fwoth, vvblgap, fmsbl, & - thshield_ib, thshield_ob, thshield_vb, iprecomp, & - blbpith, aplasmin, blbuoth, tfcth, fmsdwe, & - iohcl, tftsgap, clhsf, bore, plleno, scrapli, gapomin, ddwex, & - rinboard, fmstf, blnkoth, fseppc, plsepo, fmssh, blnkith, & - ohcth, plsepi, fmsoh, blbmith, gapoh, fcspc, scraplo, vgaptop, & - blbpoth, gapds, fwith, vgap, shldith, sigallpc, tfootfi, f_avspace,& - r_cp_top, d_vv_in, d_vv_out, d_vv_top, d_vv_bot, f_r_cp, i_r_cp_top - use buildings_variables, only: hcwt, conv, wgt, trcl, rbwt, & - esbldgm3, fndt, row, wgt2, pibv, clh1, stcl, clh2, & - tfcbv, hccl, rbrt, triv, shov, admv, i_bldgs_v, i_bldgs_size, & - mbvfac, pfbldgm3, wsvfac, rbvfac, rxcl, shmf, & - aux_build_l, aux_build_w, aux_build_h, auxcool_l, auxcool_w, auxcool_h, & - bioshld_thk, chemlab_l, chemlab_w, chemlab_h, control_buildings_l, & - control_buildings_w, control_buildings_h, crane_arm_h, crane_clrnc_h, & - crane_clrnc_v, cryomag_l, cryomag_w, cryomag_h, cryostore_l, & - cryostore_w, cryostore_h, cryostat_clrnc, elecdist_l, elecdist_w, & - elecdist_h, elecload_l, elecload_w, elecload_h, elecstore_l, & - elecstore_w, elecstore_h, fc_building_l, fc_building_w, & - gas_buildings_l, gas_buildings_w, gas_buildings_h, ground_clrnc, & - hcd_building_l, hcd_building_w, hcd_building_h, hw_storage_l, & - hw_storage_w, hw_storage_h, heat_sink_l, heat_sink_w, heat_sink_h, & - hot_sepdist, hotcell_h, ilw_smelter_l, ilw_smelter_w, ilw_smelter_h, & - ilw_storage_l, ilw_storage_w, ilw_storage_h, llw_storage_l, & - llw_storage_w, llw_storage_h, magnet_pulse_l, magnet_pulse_w, & - magnet_pulse_h, magnet_trains_l, magnet_trains_w, magnet_trains_h, & - maint_cont_l, maint_cont_w, maint_cont_h, nbi_sys_l, nbi_sys_w, & - qnty_sfty_fac, reactor_clrnc, reactor_fndtn_thk, reactor_hall_l, & - reactor_hall_w, reactor_hall_h, reactor_roof_thk, reactor_wall_thk, & - robotics_l, robotics_w, robotics_h, sec_buildings_l, sec_buildings_w, & - sec_buildings_h, staff_buildings_h, staff_buildings_area, & - transp_clrnc, turbine_hall_l, turbine_hall_w, turbine_hall_h, & - tw_storage_l, tw_storage_w, tw_storage_h, warm_shop_l, warm_shop_w, & - warm_shop_h, water_buildings_l, water_buildings_w, water_buildings_h, & - workshop_l, workshop_w, workshop_h - use constraint_variables, only: flhthresh, fpeakb, fpsep, fdivcol, ftcycl, & - betpmx, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & - maxradwallload, pseprmax, fdene, fniterpump, fpinj, pnetelin, powfmax, & - fgamcd, ftbr, mvalim, taulimit, walalw, fmva, fradpwr, nflutfmax, fipir, & - fauxmn, fiooic, fcwr, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & - fstrcond, fptemp, ftmargoh, fvs, fbetatry, vvhealw, fpnetel, ftburn, & - ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & - fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & - ftohs, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, & - fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbetap, fbeta, fjohc, & - fflutf, bmxlim, tbrnmn, fbetatry_lower, fecrh_ignition, fstr_wp, fncycle - use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, & - cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, & - ucbllipb, ucfuel, uumag, ucpfbs, ireactor, uucd, div_umain_time, div_nu, & - maintenance_gen, uctfps, uufw, tbktrepl, cost_factor_fwbs, decomf, & - cconshpf, uche3, ucpfdr1, ucech, uudiv, cost_model, adivflnc, & - cost_factor_rh, cost_factor_bop, ifueltyp, fcontng, fwbs_nref, & - cost_factor_buildings, favail, cconfix, ucblli2o, abktflnc, ucf1, ucfnc, & - ucpfps, iavail, ibkt_life, life_dpa, ucpfbk, cost_factor_tf_coils, costexp_pebbles, & - ucmisc, cpstflnc, uccryo, costexp, fwbs_nu, ucpfic, ucblbreed, tcomrepl, uufuel, & - ucdiv, uccpcl1, discount_rate, uctfbr, uccpclb, ucoam, div_prob_fail, ucnbi, & - uccu, ucwst, cfactr, div_nref, amortization, ucwindtf, ucme, csi, cowner, & - cost_factor_misc, fcr0, cturbb, lsa, fcap0, output_costs, & - cost_factor_land, redun_vacp, ucrb, uctfbus, num_rh_systems, fkind, & - fwbs_umain_time, uchrs, avail_min, uciac, ucshld, tdivrepl, & - ucblli, ucpfcb, tlife, ipnet, fcdfuel, ucbus, ucpfb, uchts, & - maintenance_fwbs, fwbs_prob_fail, uclh, ucblss, ucblvd, ucsc, ucturb, & - ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & - startupratio - use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & - ftritbm, gamma_ecrh, pheat, rho_ecrh, beamwd, enbeam, pheatfix, bscfmax, & - forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & - etalh, frbeam, harnum, xi_ebw - use divertor_variables, only: fdfs, anginc, divdens, divclfr, c4div, & - c5div, ksic, fififi, flux_exp, divplt, delld, c2div, beta_div, betao, divdum, tdiv, c6div, & - omegan, prn1, fgamp, frrp, xpertin, c1div, betai, bpsout, xparain, fdiva, & - zeffdiv, hldivlim, rlenmax, divfix, c3div, divleg_profile_inner, & - divleg_profile_outer, hldiv, i_hldiv - use fwbs_variables, only: fblhebpo, vfblkt, fdiv, fvolso, fwcoolant, & - pitch, iblanket, blktmodel, afwi, fblli2o, nphcdin, breeder_multiplier, & - fw_armour_thickness, roughness, fwclfr, breedmat, fblli, fblvd, & - iblanket_thickness, vfcblkt, breeder_f, fbllipb, fhcd, vfshld, fblhebmi, & - denw, f_neut_shield, fw_th_conductivity, nblktmodti, fw_wall, afwo, & - fvolsi, etahtp, nblktmodpo, fwpressure, emult, fwoutlet, nblktmodpi, & - fblhebpi, fblss, inlet_temp, outlet_temp, fblbreed, qnuc, blpressure, & - blpressure_liq, n_liq_recirc, pnuc_fw_ratio_dcll, f_nuc_pow_bz_struct, & - declblkt, fblhebmo, blkttype, afw, inuclear, declshld, hcdportsize, & - npdiv, peaking_factor, primary_pumping, rpf2dewar, secondary_cycle, secondary_cycle_liq, & - denstl, declfw, nphcdout, iblnkith, vfpblkt, fwinlet, wallpf, fblbe, & - fhole, fwbsshape, coolp, tfwmatmax, irefprop, fw_channel_length, & - li6enrich, etaiso, nblktmodto, fvoldw, i_shield_mat, i_bb_liq, & - icooldual, ifci, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, ipump, ims - use heat_transport_variables, only: htpmw_fw, baseel, fmgdmw, htpmw_div, & - pwpm2, etath, vachtmw, iprimshld, fpumpdiv, pinjmax, htpmw_blkt, etatf, & - htpmw_min, fpumpblkt, ipowerflow, htpmw_shld, fpumpshld, trithtmw, & - iprimnloss, fpumpfw, crypmw_max, f_crypmw - use ife_variables, only: bldzu, etali, sombdr, gainve, cdriv0, v1dzl, & - bldrc, fauxbop, pfusife, dcdrv0, fwdr, pdrive, mcdriv, ucconc, shdr, & - v3dzu, bldzl, rrin, maxmat, shmatf, fwmatf, drveff, flirad, shdzu, v2dzu, & - pifecr, ifedrv, v2dr, chmatf, v1dr, v1matf, dcdrv1, chdzu, dcdrv2, & - ifetyp, fwdzl, htpmw_ife, uccarb, v3matf, fbreed, edrive, ptargf, cdriv2, & - fburn, fwdzu, etave, v3dr, uctarg, shdzl, ucflib, v3dzl, v1dzu, v2dzl, & - chdzl, chrad, cdriv1, tgain, somtdr, v2matf, rrmax, bldr, frrmax, & - blmatf, ife - use impurity_radiation_module, only: coreradius, nimp, impvar, fimpvar, & - coreradiationfraction, fimp - use numerics, only: factor, boundl, minmax, neqns, nvar, epsfcn, ixc, & - epsvmc, ftol, ipnvars, ioptimz, nineqns, ipeqns, boundu, icc, ipnfoms, name_xc - use pfcoil_variables, only: rjconpf, zref, fcuohsu, oh_steel_frac, vf, & - coheof, sigpfcalw, alstroh, ipfres, fcupfsu, fvssu, etapsu, i_cs_stress, & - fbmaxcs, ngc, rpf2, fcohbop, ohhghf, vfohc, isumatoh, ngrpmx, ngc2, rpf1, & - ngrp, isumatpf, nfxfh, alfapf, routr, sigpfcf, pfclres, bmaxcs_lim, & - ncls, nfixmx, cptdin, ipfloc, i_sup_pf_shape, rref, i_pf_current, & - ccl0_ma, ccls_ma, ld_ratio_cst - use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & - rhopedt, cvol, fdeut, ffwal, eped_sf, iculbl, itartpf, ilhthresh, & - fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, csawth, dene, & - ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & - fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & - ifalphap, tauee_in, alphaj, alphat, icurr, q, ti, tesep, rli, triang, & - itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & - teped, fhe3, iwalld, gamma, falpha, fgwped, gtscale, tbeta, ibss, & - iradloss, te, alphan, rmajor, kappa, ifispact, iinvqd, fkzohm, beamfus0, & - tauratio, idensl, ieped, bt, iscrp, ipnlaws, betalim, betalim_lower, & - idia, ips, m_s_limit, burnup_in - use pf_power_variables, only: iscenr, maxpoloidalpower - use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp - - use primary_pumping_variables, only: t_in_bb, t_out_bb, dp_he, p_he, gamma_he - - use scan_module, only: isweep_2, nsweep, isweep, scan_dim, nsweep_2, & - sweep_2, sweep, ipnscns, ipnscnv - use stellarator_variables, only: f_asym, isthtr, n_res, iotabar, fdivwet, & - f_w, bmn, shear, m_res, f_rad, flpitch, istell, max_gyrotron_frequency, & - te0_ecrh_achievable - use tfcoil_variables, only: fcoolcp, tfinsgap, vftf, & - quench_detection_ef, fhts, dr_tf_wp, rcool, rhotfleg, thkcas, & - casthi, n_pancake, bcritsc, i_tf_sup, str_pf_con_res, thwcndut, farc4tf, & - thicndut, tftmp, oacdcp, tmax_croco, ptempalw, tmargmin_tf, tmpcry, & - sig_tf_case_max, dztop, dcond, str_cs_con_res, etapump, drtop, vcool, dcondins, & - i_tf_tresca, dhecoil, tmaxpro, n_tf, tcpav, fcutfsu, jbus, & - casthi_fraction, tmargmin_cs, vdalw, dcase, t_turn_tf,& - cpttf_max, tdmptf, casths, i_tf_turns_integer, quench_model, & - tcritsc, layer_ins, tinstf, n_layer, tcoolin, ripmax, frhocp, & - cpttf, tmargmin, casths_fraction, eff_tf_cryo, eyoung_ins, & - eyoung_steel, eyoung_res_tf_buck, eyoung_cond_axial, f_vforce_inboard, & - fcoolleg, frholeg, ftoroidalgap, i_tf_sc_mat, i_tf_shape, i_tf_bucking, & - n_tf_graded_layers, n_tf_joints, n_tf_joints_contact, poisson_al, & - poisson_copper, poisson_steel, rho_tf_joints, rhotfbus, th_joint_contact,& - i_tf_stress_model, eyoung_al, i_tf_wp_geom, i_tf_case_geom, & - i_tf_turns_integer, n_rad_per_layer, b_crit_upper_nbti, t_crit_nbti, & - i_cp_joints, n_tf_turn, f_t_turn_tf, t_turn_tf_max, t_cable_tf, & - sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, & - str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv - - use times_variables, only: tohs, pulsetimings, tqnch, theat, tramp, tburn, & - tdwell, tohsin - use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, & - initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, & - pumpareafraction, ntype, vacuum_model, pumptp - use rebco_variables, only: hastelloy_thickness, f_coppera_m2, & - rebco_thickness, tape_thickness, tape_width, & - copper_rrr, coppera_m2_max, croco_thick, copper_thick, f_copperaoh_m2, & - copperaoh_m2, copperaoh_m2_max - use reinke_variables, only: reinke_mode, fzactual, impvardiv, lhat - use water_usage_variables, only: airtemp, watertemp, windspeed - use CS_fatigue_variables, only: residual_sig_hoop, t_crack_radial, t_crack_vertical, & - t_structural_vertical, t_structural_radial, n_cycle_min, bkt_life_csf, sf_vertical_crack, & - sf_radial_crack, sf_fast_fracture ,paris_coefficient, paris_power_law, walker_coefficient, & - fracture_toughness - - implicit none - - ! Arguments - - integer, intent(in) :: in_file, out_file, show_changes - - ! Local variables - - integer :: iost - integer :: isub1,isub2,varlen - integer :: no_constraints - integer :: no_iteration - integer :: foundAst - - character(len=32) :: varnam - - logical :: obsolete_var - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ! Initialise local variables - no_constraints = 0 - no_iteration = 0 - obsolete_var = .false. - - ! Initialise module-wide variables - - infile = in_file - outfile = out_file - report_changes = show_changes - - icode = 0 - lineno = 0 - - ! Main loop - - loop_over_lines: do - - subscript_present = .FALSE. - - read(infile,'(A)',iostat=iost) line + end if + end do + + ! Set the device type based on the input file's switches + call devtyp + end subroutine input + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine devtyp + !! Set icase description based on device type + use global_variables, only: icase + use ife_variables, only: ife + use stellarator_variables, only: istell + implicit none + + if (ife == 1) then + icase = 'Inertial Fusion model' + else if (istell /= 0) then + icase = 'Stellarator model' + end if + end subroutine devtyp + + subroutine parse_input_file(in_file,out_file,show_changes) + + !! Routine that parses the contents of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! author: J Morris, CCFE, Culham Science Centre + !! author: F Warmer, IPP Greifswald + !! in_file : input integer : Fortran input unit identifier + !! out_file : input integer : Fortran output unit identifier + !! show_changes : input integer : switch to turn on (1) or off (0) + !! reporting of changed values + !! This routine reads the data from the PROCESS input file (IN.DAT), + !! dealing with comments or blank lines correctly, and sets the + !! value of any variables found in the file. Any changes + !! from the default values may be reported if required. + !!

Each possible variable in this block is dealt with + !! individually. (To add additional input variables, simply copy + !! and edit one of the similar existing examples.) + !! The routine also does the extremely useful function of checking + !! that the given value for a variable lies within a sensible + !! predefined range, and stops the program if apparently + !! nonsensical values are attempted. + !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use constants, only: dcopper, dalu + use global_variables, only: run_tests, verbose, maxcal, runtitle + use build_variables, only: tf_in_cs, fmsfw, blbmoth, blbuith, fmsbc, shldoth, & + fmsdwi, shldtth, shldlth, vgap2, plleni, fwoth, vvblgap, fmsbl, & + thshield_ib, thshield_ob, thshield_vb, iprecomp, & + blbpith, aplasmin, blbuoth, tfcth, fmsdwe, & + iohcl, tftsgap, clhsf, bore, plleno, scrapli, gapomin, ddwex, & + rinboard, fmstf, blnkoth, fseppc, plsepo, fmssh, blnkith, & + ohcth, plsepi, fmsoh, blbmith, gapoh, fcspc, scraplo, vgaptop, & + blbpoth, gapds, fwith, vgap, shldith, sigallpc, tfootfi, f_avspace,& + r_cp_top, d_vv_in, d_vv_out, d_vv_top, d_vv_bot, f_r_cp, i_r_cp_top + use buildings_variables, only: hcwt, conv, wgt, trcl, rbwt, & + esbldgm3, fndt, row, wgt2, pibv, clh1, stcl, clh2, & + tfcbv, hccl, rbrt, triv, shov, admv, i_bldgs_v, i_bldgs_size, & + mbvfac, pfbldgm3, wsvfac, rbvfac, rxcl, shmf, & + aux_build_l, aux_build_w, aux_build_h, auxcool_l, auxcool_w, auxcool_h, & + bioshld_thk, chemlab_l, chemlab_w, chemlab_h, control_buildings_l, & + control_buildings_w, control_buildings_h, crane_arm_h, crane_clrnc_h, & + crane_clrnc_v, cryomag_l, cryomag_w, cryomag_h, cryostore_l, & + cryostore_w, cryostore_h, cryostat_clrnc, elecdist_l, elecdist_w, & + elecdist_h, elecload_l, elecload_w, elecload_h, elecstore_l, & + elecstore_w, elecstore_h, fc_building_l, fc_building_w, & + gas_buildings_l, gas_buildings_w, gas_buildings_h, ground_clrnc, & + hcd_building_l, hcd_building_w, hcd_building_h, hw_storage_l, & + hw_storage_w, hw_storage_h, heat_sink_l, heat_sink_w, heat_sink_h, & + hot_sepdist, hotcell_h, ilw_smelter_l, ilw_smelter_w, ilw_smelter_h, & + ilw_storage_l, ilw_storage_w, ilw_storage_h, llw_storage_l, & + llw_storage_w, llw_storage_h, magnet_pulse_l, magnet_pulse_w, & + magnet_pulse_h, magnet_trains_l, magnet_trains_w, magnet_trains_h, & + maint_cont_l, maint_cont_w, maint_cont_h, nbi_sys_l, nbi_sys_w, & + qnty_sfty_fac, reactor_clrnc, reactor_fndtn_thk, reactor_hall_l, & + reactor_hall_w, reactor_hall_h, reactor_roof_thk, reactor_wall_thk, & + robotics_l, robotics_w, robotics_h, sec_buildings_l, sec_buildings_w, & + sec_buildings_h, staff_buildings_h, staff_buildings_area, & + transp_clrnc, turbine_hall_l, turbine_hall_w, turbine_hall_h, & + tw_storage_l, tw_storage_w, tw_storage_h, warm_shop_l, warm_shop_w, & + warm_shop_h, water_buildings_l, water_buildings_w, water_buildings_h, & + workshop_l, workshop_w, workshop_h + use constraint_variables, only: flhthresh, fpeakb, fpsep, fdivcol, ftcycl, & + betpmx, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & + maxradwallload, pseprmax, fdene, fniterpump, fpinj, pnetelin, powfmax, & + fgamcd, ftbr, mvalim, taulimit, walalw, fmva, fradpwr, nflutfmax, fipir, & + fauxmn, fiooic, fcwr, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & + fstrcond, fptemp, ftmargoh, fvs, fbetatry, vvhealw, fpnetel, ftburn, & + ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & + fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & + ftohs, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, & + fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbetap, fbeta, fjohc, & + fflutf, bmxlim, tbrnmn, fbetatry_lower, fecrh_ignition, fstr_wp, fncycle + use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, & + cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, & + ucbllipb, ucfuel, uumag, ucpfbs, ireactor, uucd, div_umain_time, div_nu, & + maintenance_gen, uctfps, uufw, tbktrepl, cost_factor_fwbs, decomf, & + cconshpf, uche3, ucpfdr1, ucech, uudiv, cost_model, adivflnc, & + cost_factor_rh, cost_factor_bop, ifueltyp, fcontng, fwbs_nref, & + cost_factor_buildings, favail, cconfix, ucblli2o, abktflnc, ucf1, ucfnc, & + ucpfps, iavail, ibkt_life, life_dpa, ucpfbk, cost_factor_tf_coils, costexp_pebbles, & + ucmisc, cpstflnc, uccryo, costexp, fwbs_nu, ucpfic, ucblbreed, tcomrepl, uufuel, & + ucdiv, uccpcl1, discount_rate, uctfbr, uccpclb, ucoam, div_prob_fail, ucnbi, & + uccu, ucwst, cfactr, div_nref, amortization, ucwindtf, ucme, csi, cowner, & + cost_factor_misc, fcr0, cturbb, lsa, fcap0, output_costs, & + cost_factor_land, redun_vacp, ucrb, uctfbus, num_rh_systems, fkind, & + fwbs_umain_time, uchrs, avail_min, uciac, ucshld, tdivrepl, & + ucblli, ucpfcb, tlife, ipnet, fcdfuel, ucbus, ucpfb, uchts, & + maintenance_fwbs, fwbs_prob_fail, uclh, ucblss, ucblvd, ucsc, ucturb, & + ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & + startupratio, tmain, u_unplanned + use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & + ftritbm, gamma_ecrh, pheat, rho_ecrh, beamwd, enbeam, pheatfix, bscfmax, & + forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & + etalh, frbeam, harnum, xi_ebw + use divertor_variables, only: fdfs, anginc, divdens, divclfr, c4div, & + c5div, ksic, fififi, flux_exp, divplt, delld, c2div, beta_div, betao, divdum, tdiv, c6div, & + omegan, prn1, fgamp, frrp, xpertin, c1div, betai, bpsout, xparain, fdiva, & + zeffdiv, hldivlim, rlenmax, divfix, c3div, divleg_profile_inner, & + divleg_profile_outer, hldiv, i_hldiv + use fwbs_variables, only: fblhebpo, vfblkt, fdiv, fvolso, fwcoolant, & + pitch, iblanket, blktmodel, afwi, fblli2o, nphcdin, breeder_multiplier, & + fw_armour_thickness, roughness, fwclfr, breedmat, fblli, fblvd, & + iblanket_thickness, vfcblkt, breeder_f, fbllipb, fhcd, vfshld, fblhebmi, & + denw, f_neut_shield, fw_th_conductivity, nblktmodti, fw_wall, afwo, & + fvolsi, etahtp, nblktmodpo, fwpressure, emult, fwoutlet, nblktmodpi, & + fblhebpi, fblss, inlet_temp, outlet_temp, fblbreed, qnuc, blpressure, & + blpressure_liq, n_liq_recirc, pnuc_fw_ratio_dcll, f_nuc_pow_bz_struct, & + declblkt, fblhebmo, blkttype, afw, inuclear, declshld, hcdportsize, & + npdiv, peaking_factor, primary_pumping, rpf2dewar, secondary_cycle, secondary_cycle_liq, & + denstl, declfw, nphcdout, iblnkith, vfpblkt, fwinlet, wallpf, fblbe, & + fhole, fwbsshape, coolp, tfwmatmax, irefprop, fw_channel_length, & + li6enrich, etaiso, nblktmodto, fvoldw, i_shield_mat, i_bb_liq, & + icooldual, ifci, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, ipump, ims + use heat_transport_variables, only: htpmw_fw, baseel, fmgdmw, htpmw_div, & + pwpm2, etath, vachtmw, iprimshld, fpumpdiv, pinjmax, htpmw_blkt, etatf, & + htpmw_min, fpumpblkt, ipowerflow, htpmw_shld, fpumpshld, trithtmw, & + iprimnloss, fpumpfw, crypmw_max, f_crypmw + use ife_variables, only: bldzu, etali, sombdr, gainve, cdriv0, v1dzl, & + bldrc, fauxbop, pfusife, dcdrv0, fwdr, pdrive, mcdriv, ucconc, shdr, & + v3dzu, bldzl, rrin, maxmat, shmatf, fwmatf, drveff, flirad, shdzu, v2dzu, & + pifecr, ifedrv, v2dr, chmatf, v1dr, v1matf, dcdrv1, chdzu, dcdrv2, & + ifetyp, fwdzl, htpmw_ife, uccarb, v3matf, fbreed, edrive, ptargf, cdriv2, & + fburn, fwdzu, etave, v3dr, uctarg, shdzl, ucflib, v3dzl, v1dzu, v2dzl, & + chdzl, chrad, cdriv1, tgain, somtdr, v2matf, rrmax, bldr, frrmax, & + blmatf, ife + use impurity_radiation_module, only: coreradius, nimp, impvar, fimpvar, & + coreradiationfraction, fimp + use numerics, only: factor, boundl, minmax, neqns, nvar, epsfcn, ixc, & + epsvmc, ftol, ipnvars, ioptimz, nineqns, ipeqns, boundu, icc, ipnfoms, name_xc + use pfcoil_variables, only: rjconpf, zref, fcuohsu, oh_steel_frac, vf, & + coheof, sigpfcalw, alstroh, ipfres, fcupfsu, fvssu, etapsu, i_cs_stress, & + fbmaxcs, ngc, rpf2, fcohbop, ohhghf, vfohc, isumatoh, ngrpmx, ngc2, rpf1, & + ngrp, isumatpf, nfxfh, alfapf, routr, sigpfcf, pfclres, bmaxcs_lim, & + ncls, nfixmx, cptdin, ipfloc, i_sup_pf_shape, rref, i_pf_current, & + ccl0_ma, ccls_ma, ld_ratio_cst + use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & + rhopedt, cvol, fdeut, ffwal, eped_sf, iculbl, itartpf, ilhthresh, & + fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, csawth, dene, & + ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & + fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & + ifalphap, tauee_in, alphaj, alphat, icurr, q, ti, tesep, rli, triang, & + itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & + teped, fhe3, iwalld, gamma, falpha, fgwped, gtscale, tbeta, ibss, & + iradloss, te, alphan, rmajor, kappa, ifispact, iinvqd, fkzohm, beamfus0, & + tauratio, idensl, ieped, bt, iscrp, ipnlaws, betalim, betalim_lower, & + idia, ips, m_s_limit, burnup_in + use pf_power_variables, only: iscenr, maxpoloidalpower + use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp + + use primary_pumping_variables, only: t_in_bb, t_out_bb, dp_he, p_he, gamma_he + + use scan_module, only: isweep_2, nsweep, isweep, scan_dim, nsweep_2, & + sweep_2, sweep, ipnscns, ipnscnv + use stellarator_variables, only: f_asym, isthtr, n_res, iotabar, fdivwet, & + f_w, bmn, shear, m_res, f_rad, flpitch, istell, max_gyrotron_frequency, & + te0_ecrh_achievable + use tfcoil_variables, only: fcoolcp, tfinsgap, vftf, & + quench_detection_ef, fhts, dr_tf_wp, rcool, rhotfleg, thkcas, & + casthi, n_pancake, bcritsc, i_tf_sup, str_pf_con_res, thwcndut, farc4tf, & + thicndut, tftmp, oacdcp, tmax_croco, ptempalw, tmargmin_tf, tmpcry, & + sig_tf_case_max, dztop, dcond, str_cs_con_res, etapump, drtop, vcool, dcondins, & + i_tf_tresca, dhecoil, tmaxpro, n_tf, tcpav, fcutfsu, jbus, & + casthi_fraction, tmargmin_cs, vdalw, dcase, t_turn_tf,& + cpttf_max, tdmptf, casths, i_tf_turns_integer, quench_model, & + tcritsc, layer_ins, tinstf, n_layer, tcoolin, ripmax, frhocp, & + cpttf, tmargmin, casths_fraction, eff_tf_cryo, eyoung_ins, & + eyoung_steel, eyoung_res_tf_buck, eyoung_cond_axial, f_vforce_inboard, & + fcoolleg, frholeg, ftoroidalgap, i_tf_sc_mat, i_tf_shape, i_tf_bucking, & + n_tf_graded_layers, n_tf_joints, n_tf_joints_contact, poisson_al, & + poisson_copper, poisson_steel, rho_tf_joints, rhotfbus, th_joint_contact,& + i_tf_stress_model, eyoung_al, i_tf_wp_geom, i_tf_case_geom, & + i_tf_turns_integer, n_rad_per_layer, b_crit_upper_nbti, t_crit_nbti, & + i_cp_joints, n_tf_turn, f_t_turn_tf, t_turn_tf_max, t_cable_tf, & + sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, & + str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv + + use times_variables, only: tohs, pulsetimings, tqnch, theat, tramp, tburn, & + tdwell, tohsin + use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, & + initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, & + pumpareafraction, ntype, vacuum_model, pumptp + use rebco_variables, only: hastelloy_thickness, f_coppera_m2, & + rebco_thickness, tape_thickness, tape_width, & + copper_rrr, coppera_m2_max, croco_thick, copper_thick, f_copperaoh_m2, & + copperaoh_m2, copperaoh_m2_max + use reinke_variables, only: reinke_mode, fzactual, impvardiv, lhat + use water_usage_variables, only: airtemp, watertemp, windspeed + use CS_fatigue_variables, only: residual_sig_hoop, t_crack_radial, t_crack_vertical, & + t_structural_vertical, t_structural_radial, n_cycle_min, bkt_life_csf, sf_vertical_crack, & + sf_radial_crack, sf_fast_fracture ,paris_coefficient, paris_power_law, walker_coefficient, & + fracture_toughness + + implicit none + + ! Arguments + + integer, intent(in) :: in_file, out_file, show_changes + + ! Local variables + + integer :: iost + integer :: isub1,isub2,varlen + integer :: no_constraints + integer :: no_iteration + integer :: foundAst + + character(len=32) :: varnam + + logical :: obsolete_var + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ! Initialise local variables + no_constraints = 0 + no_iteration = 0 + obsolete_var = .false. + + ! Initialise module-wide variables + + infile = in_file + outfile = out_file + report_changes = show_changes + + icode = 0 + lineno = 0 + + ! Main loop + + loop_over_lines: do + + subscript_present = .FALSE. + + read(infile,'(A)',iostat=iost) line - ! On error or end, return - if (iost /= 0) exit loop_over_lines + ! On error or end, return + if (iost /= 0) exit loop_over_lines - lineno = lineno + 1 + lineno = lineno + 1 - line = adjustl(line) ! rotate any leading blanks to the end - linelen = len_trim(line) + line = adjustl(line) ! rotate any leading blanks to the end + linelen = len_trim(line) -20 continue +20 continue - ! Ignore blank lines + ! Ignore blank lines - if (line == ' ') cycle + if (line == ' ') cycle - ! Ignore comments, unless they start with '*****', - ! in which case print them. + ! Ignore comments, unless they start with '*****', + ! in which case print them. - if (line(1:5) == '*****') write(outfile,*) line(1:76) - if (line(1:1) == '*') cycle - if (line(1:1) == '$') cycle ! in case block delimiters are still present + if (line(1:5) == '*****') write(outfile,*) line(1:76) + if (line(1:1) == '*') cycle + if (line(1:1) == '$') cycle ! in case block delimiters are still present - iptr = 1 + iptr = 1 - !Ignore input comments denoted by asterisk, before assigning variables + !Ignore input comments denoted by asterisk, before assigning variables - if (index(line,'*') > 0) then - foundAst = index(line,'*') - 1 - linelen = min(linelen, foundAst) - line = line(:linelen) - end if + if (index(line,'*') > 0) then + foundAst = index(line,'*') - 1 + linelen = min(linelen, foundAst) + line = line(:linelen) + end if - ! This must be an assignment line, so get the variable name + ! This must be an assignment line, so get the variable name - call get_variable_name(varnam,varlen,isub1,isub2) - if (isub1 /= 0) subscript_present = .TRUE. - if (varlen == 0) then - write(*,*) 'Error in IN.DAT at line ', lineno - write(*,*) line - error = .True. - end if + call get_variable_name(varnam,varlen,isub1,isub2) + if (isub1 /= 0) subscript_present = .TRUE. + if (varlen == 0) then + write(*,*) 'Error in IN.DAT at line ', lineno + write(*,*) line + error = .True. + end if - ! Read the associated data + ! Read the associated data - variable: select case (varnam(1:varlen)) + variable: select case (varnam(1:varlen)) - ! General settings + ! General settings - case ('runtitle') - call parse_string_variable('runtitle', runtitle, & + case ('runtitle') + call parse_string_variable('runtitle', runtitle, & 'title of run') - case ('verbose') - call parse_int_variable('verbose', verbose, 0, 1, & + case ('verbose') + call parse_int_variable('verbose', verbose, 0, 1, & 'Switch for diagnostic output') - case ('run_tests') - call parse_int_variable('run_tests', run_tests, 0, 1, & + case ('run_tests') + call parse_int_variable('run_tests', run_tests, 0, 1, & 'Switch for running built-in tests') - ! Numerical solver settings - case ('boundl') - call parse_real_array('boundl', boundl, isub1, ipnvars, & + ! Numerical solver settings + case ('boundl') + call parse_real_array('boundl', boundl, isub1, ipnvars, & 'Iteration variable lower bound', icode) - case ('boundu') - call parse_real_array('boundu', boundu, isub1, ipnvars, & + case ('boundu') + call parse_real_array('boundu', boundu, isub1, ipnvars, & 'Iteration variable upper bound', icode) - case ('epsfcn') - call parse_real_variable('epsfcn', epsfcn, 0.0D0, 1.0D0, & + case ('epsfcn') + call parse_real_variable('epsfcn', epsfcn, 0.0D0, 1.0D0, & 'HYBRD/VMCON derivative step length') - case ('epsvmc') - call parse_real_variable('epsvmc', epsvmc, 0.0D0, 1.0D0, & + case ('epsvmc') + call parse_real_variable('epsvmc', epsvmc, 0.0D0, 1.0D0, & 'VMCON error tolerance') - case ('factor') - call parse_real_variable('factor', factor, 0.0D0, 10.0D0, & + case ('factor') + call parse_real_variable('factor', factor, 0.0D0, 10.0D0, & 'HYBRD initial step size') - case ('ftol') - call parse_real_variable('ftol', ftol, 0.0D0, 1.0D0, & + case ('ftol') + call parse_real_variable('ftol', ftol, 0.0D0, 1.0D0, & 'HYBRD tolerance') - ! New optional argument startindex used MDK 3/3/17 - ! Allows simplified IN.DAT format for icc and ixc. - case ('icc') - no_constraints = no_constraints + 1 - call parse_int_array('icc', icc, isub1, ipeqns, & + ! New optional argument startindex used MDK 3/3/17 + ! Allows simplified IN.DAT format for icc and ixc. + case ('icc') + no_constraints = no_constraints + 1 + call parse_int_array('icc', icc, isub1, ipeqns, & 'Constraint equation', icode,no_constraints) - no_constraints = isub1 - case ('ixc') - no_iteration = no_iteration + 1 - call parse_int_array('ixc', ixc, isub1, ipnvars, & - 'Iteration variable', icode,no_iteration) - no_iteration = isub1 - - case ('ioptimz') - call parse_int_variable('ioptimz', ioptimz, -2, 1, & + no_constraints = isub1 + case ('ixc') + no_iteration = no_iteration + 1 + call parse_int_array('ixc', ixc, isub1, ipnvars, & + 'Iteration variable', icode,no_iteration) + no_iteration = isub1 + + case ('ioptimz') + call parse_int_variable('ioptimz', ioptimz, -2, 1, & 'Switch for solver method') - case ('maxcal') - call parse_int_variable('maxcal', maxcal, 0, 10000, & + case ('maxcal') + call parse_int_variable('maxcal', maxcal, 0, 10000, & 'Max no of VMCON iterations') - case ('minmax') - call parse_int_variable('minmax', minmax, -ipnfoms, ipnfoms, 'Switch for figure of merit') - case ('neqns') - write(*,*)'The total number of constraints is counted automatically and does not need to be stated in IN.DAT.' - call parse_int_variable('neqns', neqns, 1, ipeqns, 'No of equality constraints') - case ('nineqns') - call parse_int_variable('nineqns', nineqns, 1, ipeqns, 'No of inequality constraints') - case ('nvar') - write(*,*)'The number of iteration variables is counted automatically and does not need to be stated in IN.DAT.' - ! call parse_int_variable('nvar', nvar, 1, ipnvars, 'No of independent variables') - - ! Physics settings - - case ('alphaj') - call parse_real_variable('alphaj', alphaj, 0.0D0, 10.0D0, & + case ('minmax') + call parse_int_variable('minmax', minmax, -ipnfoms, ipnfoms, 'Switch for figure of merit') + case ('neqns') + write(*,*)'The total number of constraints is counted automatically and does not need to be stated in IN.DAT.' + call parse_int_variable('neqns', neqns, 1, ipeqns, 'No of equality constraints') + case ('nineqns') + call parse_int_variable('nineqns', nineqns, 1, ipeqns, 'No of inequality constraints') + case ('nvar') + write(*,*)'The number of iteration variables is counted automatically and does not need to be stated in IN.DAT.' + ! call parse_int_variable('nvar', nvar, 1, ipnvars, 'No of independent variables') + + ! Physics settings + + case ('alphaj') + call parse_real_variable('alphaj', alphaj, 0.0D0, 10.0D0, & 'Current density profile factor') - case ('alphan') - call parse_real_variable('alphan', alphan, 0.0D0, 10.0D0, & + case ('alphan') + call parse_real_variable('alphan', alphan, 0.0D0, 10.0D0, & 'Density profile factor') - case ('alphat') - call parse_real_variable('alphat', alphat, 0.0D0, 10.0D0, & + case ('alphat') + call parse_real_variable('alphat', alphat, 0.0D0, 10.0D0, & 'Temperature profile factor') - case ('aspect') - call parse_real_variable('aspect', aspect, 1.001D0, 40.0D0, & + case ('aspect') + call parse_real_variable('aspect', aspect, 1.001D0, 40.0D0, & 'Aspect ratio') - case ('beamfus0') - call parse_real_variable('beamfus0', beamfus0, 0.01D0, 10.0D0, & + case ('beamfus0') + call parse_real_variable('beamfus0', beamfus0, 0.01D0, 10.0D0, & 'Beam-background fusion multiplier') - case ('beta') - call parse_real_variable('beta', beta, 0.0D0, 1.0D0, & + case ('beta') + call parse_real_variable('beta', beta, 0.0D0, 1.0D0, & 'Plasma beta') - case ('betalim') - call parse_real_variable('betalim', betalim, 0.0D0, 1.0D0, & - 'Plasma beta upper limit') - case ('betalim_lower') - call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & - 'Plasma beta lower limit') - case ('betbm0') - call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, & + case ('betalim') + call parse_real_variable('betalim', betalim, 0.0D0, 1.0D0, & + 'Plasma beta upper limit') + case ('betalim_lower') + call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & + 'Plasma beta lower limit') + case ('betbm0') + call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, & 'Leading coeff. for NB beta fraction') - case ('bt') - call parse_real_variable('bt', bt, 0.0D0, 30.0D0, & + case ('bt') + call parse_real_variable('bt', bt, 0.0D0, 30.0D0, & 'Toroidal field on axis (T)') - case ('burnup_in') - call parse_real_variable('burnup_in', burnup_in, 0.0D0, 1.0D0, & + case ('burnup_in') + call parse_real_variable('burnup_in', burnup_in, 0.0D0, 1.0D0, & 'User input plasma fuel burnup fraction') - case ('coreradius') - call parse_real_variable('coreradius', coreradius, 0.0D0, 1.0D0, & + case ('coreradius') + call parse_real_variable('coreradius', coreradius, 0.0D0, 1.0D0, & 'Normalised core radius') - case ('coreradiationfraction') - call parse_real_variable('coreradiationfraction', coreradiationfraction, 0.0D0, 1.0D0, & + case ('coreradiationfraction') + call parse_real_variable('coreradiationfraction', coreradiationfraction, 0.0D0, 1.0D0, & 'Fraction of core radiation subtracted from P_L') - case ('csawth') - call parse_real_variable('csawth', csawth, 0.0D0, 10.0D0, & + case ('csawth') + call parse_real_variable('csawth', csawth, 0.0D0, 10.0D0, & 'Coefficient for sawteeth effects') - case ('cvol') - call parse_real_variable('cvol', cvol, 0.01D0, 10.0D0, & + case ('cvol') + call parse_real_variable('cvol', cvol, 0.01D0, 10.0D0, & 'Plasma volume multiplier') - case ('cwrmax') - call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & + case ('cwrmax') + call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & 'Max conducting shell to rminor radius') - case ('dene') - call parse_real_variable('dene', dene, 1.0D18, 1.0D22, & + case ('dene') + call parse_real_variable('dene', dene, 1.0D18, 1.0D22, & 'Electron density (/m3)') - case ('dnbeta') - call parse_real_variable('dnbeta', dnbeta, 0.0D0, 20.0D0, & + case ('dnbeta') + call parse_real_variable('dnbeta', dnbeta, 0.0D0, 20.0D0, & 'beta coefficient') - case ('epbetmax') - call parse_real_variable('epbetmax', epbetmax, 0.01D0, 10.0D0, & + case ('epbetmax') + call parse_real_variable('epbetmax', epbetmax, 0.01D0, 10.0D0, & 'Max epsilon*beta value') - case ('eped_sf') - call parse_real_variable('eped_sf', eped_sf, 0.0001D0, 2.0D0, & + case ('eped_sf') + call parse_real_variable('eped_sf', eped_sf, 0.0001D0, 2.0D0, & 'Scaling factor for EPED pedestal model') - case ('falpha') - call parse_real_variable('falpha', falpha, 0.0D0, 1.0D0, & + case ('falpha') + call parse_real_variable('falpha', falpha, 0.0D0, 1.0D0, & 'Fraction of alpha power deposited to plasma') - case ('ftar') - call parse_real_variable('ftar', ftar, 0.0D0, 1.0D0, & + case ('ftar') + call parse_real_variable('ftar', ftar, 0.0D0, 1.0D0, & 'Fraction of power to divertor with lower divertor in double null') - case ('fdeut') - call parse_real_variable('fdeut', fdeut, 0.0D0, 1.0D0, & + case ('fdeut') + call parse_real_variable('fdeut', fdeut, 0.0D0, 1.0D0, & 'Deuterium fuel fraction') - case ('ffwal') - call parse_real_variable('ffwal', ffwal, 0.0D0, 10.0D0, & + case ('ffwal') + call parse_real_variable('ffwal', ffwal, 0.0D0, 10.0D0, & 'Wall load fiddle factor') - case ('fgwped') - call parse_real_variable('fgwped', fgwped, -1.0D0, 5.0D0, & + case ('fgwped') + call parse_real_variable('fgwped', fgwped, -1.0D0, 5.0D0, & 'Fraction of n_G at pedestal top') - case ('fgwsep') - call parse_real_variable('fgwsep', fgwsep, -1.0D0, 1.0D0, & + case ('fgwsep') + call parse_real_variable('fgwsep', fgwsep, -1.0D0, 1.0D0, & 'Fraction of n_G at separatrix') - case ('fhe3') - call parse_real_variable('fhe3', fhe3, 0.0D0, 1.0D0, & + case ('fhe3') + call parse_real_variable('fhe3', fhe3, 0.0D0, 1.0D0, & 'Helium-3 fuel fraction') - case ('fimp') - call parse_real_array('fimp', fimp, isub1, nimp, & + case ('fimp') + call parse_real_array('fimp', fimp, isub1, nimp, & 'Impurity density fraction', icode) - case ('fimpvar') - call parse_real_variable('fimpvar', fimpvar, 1.0D-6, 0.5D0, & + case ('fimpvar') + call parse_real_variable('fimpvar', fimpvar, 1.0D-6, 0.5D0, & 'Impurity fraction to be varied') - case ('fkzohm') - call parse_real_variable('fkzohm', fkzohm, 0.5D0, 2.0D0, & + case ('fkzohm') + call parse_real_variable('fkzohm', fkzohm, 0.5D0, 2.0D0, & 'Zohm elongation scaling multiplier') - case ('fnesep') - call parse_real_variable('fnesep', fnesep, 0.1D0, 2.0D1, & + case ('fnesep') + call parse_real_variable('fnesep', fnesep, 0.1D0, 2.0D1, & 'Eich critical separatrix density') - case ('fradmin') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FRADMIN is now obsolete -' - write(outfile,*) 'please remove it from the input file.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ftaulimit') - call parse_real_variable('ftaulimit', ftaulimit, 0.001D0, 1.0D0, & + case ('fradmin') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FRADMIN is now obsolete -' + write(outfile,*) 'please remove it from the input file.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ftaulimit') + call parse_real_variable('ftaulimit', ftaulimit, 0.001D0, 1.0D0, & 'f-value for lower limit on taup/taueff the ratio of alpha particle to energy confinement times') - case ('ftr') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FTR is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use FTRIT instead).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ftrit') - call parse_real_variable('ftrit', ftrit, 0.0D0, 1.0D0, & + case ('ftr') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FTR is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use FTRIT instead).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ftrit') + call parse_real_variable('ftrit', ftrit, 0.0D0, 1.0D0, & 'Tritium fuel fraction') - case ('fvsbrnni') - call parse_real_variable('fvsbrnni', fvsbrnni, 0.0D0, 1.0D0, & + case ('fvsbrnni') + call parse_real_variable('fvsbrnni', fvsbrnni, 0.0D0, 1.0D0, & 'Non-inductive volt-sec burn fraction') - case ('gamma') - call parse_real_variable('gamma', gamma, 0.1D0, 1.0D0, & + case ('gamma') + call parse_real_variable('gamma', gamma, 0.1D0, 1.0D0, & 'Ejima coefficient for resistive V-s formula') - case ('gtscale') - call parse_int_variable('gtscale', gtscale, 0, 2, & + case ('gtscale') + call parse_int_variable('gtscale', gtscale, 0, 2, & 'Flag to scale beta coefficient with R/a') - case ('hfact') - call parse_real_variable('hfact', hfact, 0.01D0, 10.0D0, & + case ('hfact') + call parse_real_variable('hfact', hfact, 0.01D0, 10.0D0, & 'Energy confinement time H factor') - case ('taumax') - call parse_real_variable('taumax', taumax, 0.1D0, 100.0D0, & + case ('taumax') + call parse_real_variable('taumax', taumax, 0.1D0, 100.0D0, & 'Maximum allowed energy confinement time (s)') - case ('ibss') - call parse_int_variable('ibss', ibss, 1, 4, & + case ('ibss') + call parse_int_variable('ibss', ibss, 1, 4, & 'Switch for bootstrap scaling') - case ('iculbl') - call parse_int_variable('iculbl', iculbl, 0, 3, & + case ('iculbl') + call parse_int_variable('iculbl', iculbl, 0, 3, & 'Switch for beta limit scaling') - case ('iculdl') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ICULDL is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use IDENSL=3 for equivalent model to ICULDL=0).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('icurr') - call parse_int_variable('icurr', icurr, 1, 9, & + case ('iculdl') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ICULDL is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use IDENSL=3 for equivalent model to ICULDL=0).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('icurr') + call parse_int_variable('icurr', icurr, 1, 9, & 'Switch for plasma current scaling') - case ('idensl') - call parse_int_variable('idensl', idensl, 1, 7, & + case ('idensl') + call parse_int_variable('idensl', idensl, 1, 7, & 'Switch for enforced density limit') - case ('idhe3') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IDHE3 is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use fhe3 to adjust 3He fuel fraction).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('idia') - call parse_int_variable('idia', idia, 0, 2, & - 'Switch for diamagnetic scaling') - case ('ifalphap') - call parse_int_variable('ifalphap', ifalphap, 0, 1, & + case ('idhe3') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IDHE3 is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use fhe3 to adjust 3He fuel fraction).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('idia') + call parse_int_variable('idia', idia, 0, 2, & + 'Switch for diamagnetic scaling') + case ('ifalphap') + call parse_int_variable('ifalphap', ifalphap, 0, 1, & 'Switch for fast alpha pressure fit') - case ('ifispact') - call parse_int_variable('ifispact', ifispact, 0, 0, & + case ('ifispact') + call parse_int_variable('ifispact', ifispact, 0, 0, & 'Switch for neutronics calculations') - case ('ignite') - call parse_int_variable('ignite', ignite, 0, 1, & + case ('ignite') + call parse_int_variable('ignite', ignite, 0, 1, & 'Switch for ignited plasma assumption') - case ('iinvqd') - call parse_int_variable('iinvqd', iinvqd, 0, 1, & + case ('iinvqd') + call parse_int_variable('iinvqd', iinvqd, 0, 1, & 'Switch for inverse quadrature') - case ('iiter') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IITER is now obsolete -' - write(outfile,*) 'please remove it from the input file.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ilhthresh') - call parse_int_variable('ilhthresh', ilhthresh, 1, 21, & + case ('iiter') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IITER is now obsolete -' + write(outfile,*) 'please remove it from the input file.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ilhthresh') + call parse_int_variable('ilhthresh', ilhthresh, 1, 21, & 'Switch for L-H power threshold to enforce') - case ('impvar') - call parse_int_variable('impvar', impvar, 3, nimp, & + case ('impvar') + call parse_int_variable('impvar', impvar, 3, nimp, & 'Index for impurity fraction iteration variable') - write(outfile,*) 'impvar is now deprecated - use iteration variables 125-136 instead.' - case ('ipedestal') - call parse_int_variable('ipedestal', ipedestal, 0, 1, & + write(outfile,*) 'impvar is now deprecated - use iteration variables 125-136 instead.' + case ('ipedestal') + call parse_int_variable('ipedestal', ipedestal, 0, 1, & 'Switch for plasma profile type') - case ('iprofile') - call parse_int_variable('iprofile', iprofile, 0, 1, & + case ('iprofile') + call parse_int_variable('iprofile', iprofile, 0, 1, & 'Switch for current profile consistency') - case ('ips') - call parse_int_variable('ips', ips, 0, 1, & + case ('ips') + call parse_int_variable('ips', ips, 0, 1, & 'Switch for Pfirsch-Schlüter scaling') - case ('iradloss') - call parse_int_variable('iradloss', iradloss, 0, 2, & + case ('iradloss') + call parse_int_variable('iradloss', iradloss, 0, 2, & 'Switch for radiation loss term inclusion in pwr balance') - case ('ires') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IRES is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('isc') - call parse_int_variable('isc', isc, 1, ipnlaws, & + case ('ires') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IRES is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('isc') + call parse_int_variable('isc', isc, 1, ipnlaws, & 'Switch for confinement scaling law') - case ('ieped') - call parse_int_variable('ieped', ieped, 0, 1, & + case ('ieped') + call parse_int_variable('ieped', ieped, 0, 1, & 'Switch for scaling pedestal-top temperature with plasma parameters') - case ('iscrp') - call parse_int_variable('iscrp', iscrp, 0, 1, & + case ('iscrp') + call parse_int_variable('iscrp', iscrp, 0, 1, & 'Switch for scrapeoff width') - case ('ishape') - call parse_int_variable('ishape', ishape, 0, 11, & + case ('ishape') + call parse_int_variable('ishape', ishape, 0, 11, & 'Switch for plasma shape vs. aspect') - case ('itart') - call parse_int_variable('itart', itart, 0, 1, & + case ('itart') + call parse_int_variable('itart', itart, 0, 1, & 'Switch for tight aspect ratio physics') - case ('itartpf') - call parse_int_variable('itartpf', itartpf, 0, 1, & + case ('itartpf') + call parse_int_variable('itartpf', itartpf, 0, 1, & 'Switch for tight aspect ratio PF coils') - case ('iwalld') - call parse_int_variable('iwalld', iwalld, 1, 2, & + case ('iwalld') + call parse_int_variable('iwalld', iwalld, 1, 2, & 'Switch for wall load calculation') - case ('kappa') - call parse_real_variable('kappa', kappa, 0.99D0, 5.0D0, & + case ('kappa') + call parse_real_variable('kappa', kappa, 0.99D0, 5.0D0, & 'Plasma separatrix elongation') - case ('kappa95') - call parse_real_variable('kappa95', kappa95, 0.99D0, 5.0D0, & + case ('kappa95') + call parse_real_variable('kappa95', kappa95, 0.99D0, 5.0D0, & 'Plasma 95% elongation') - case ('neped') - call parse_real_variable('neped', neped, 0.0D0, 1.0D21, & + case ('neped') + call parse_real_variable('neped', neped, 0.0D0, 1.0D21, & 'Electron density pedestal height (/m3)') - case ('nesep') - call parse_real_variable('nesep', nesep, 0.0D0, 1.0D21, & + case ('nesep') + call parse_real_variable('nesep', nesep, 0.0D0, 1.0D21, & 'Electron density at separatrix (/m3)') - case('m_s_limit') - call parse_real_variable('m_s_limit', m_s_limit, 0.0D0, 1.0D0, & + case('m_s_limit') + call parse_real_variable('m_s_limit', m_s_limit, 0.0D0, 1.0D0, & 'Vertical stablity margin limit') - case ('plasma_res_factor') - call parse_real_variable('plasma_res_factor', plasma_res_factor, 0.0D0, 1.0D0, & + case ('plasma_res_factor') + call parse_real_variable('plasma_res_factor', plasma_res_factor, 0.0D0, 1.0D0, & 'Plasma resistivity pre-factor') - case ('q') - call parse_real_variable('q', q, 1.00D0, 50.0D0, & + case ('q') + call parse_real_variable('q', q, 1.00D0, 50.0D0, & 'Edge safety factor') - case ('q0') - call parse_real_variable('q0', q0, 0.01D0, 20.0D0, & + case ('q0') + call parse_real_variable('q0', q0, 0.01D0, 20.0D0, & 'Safety factor on axis') - case ('tauratio') - call parse_real_variable('tauratio', tauratio, 0.1D0, 100.0D0, & + case ('tauratio') + call parse_real_variable('tauratio', tauratio, 0.1D0, 100.0D0, & 'Ratio of He and pellet particle confinement times') - case ('rad_fraction_sol') - call parse_real_variable('rad_fraction_sol', rad_fraction_sol, 0.0D0, 1.0D0, & + case ('rad_fraction_sol') + call parse_real_variable('rad_fraction_sol', rad_fraction_sol, 0.0D0, 1.0D0, & 'SoL radiation fraction') - case ('ralpne') - call parse_real_variable('ralpne', ralpne, 1.0D-12, 1.0D0, & + case ('ralpne') + call parse_real_variable('ralpne', ralpne, 1.0D-12, 1.0D0, & 'Thermal alpha density / electron density') - case ('protium') - call parse_real_variable('protium', protium, 0.0D0, 1.0D0, & + case ('protium') + call parse_real_variable('protium', protium, 0.0D0, 1.0D0, & 'Protium density / electron density') - case ('rhopedn') - call parse_real_variable('rhopedn', rhopedn, 0.01D0, 1.0D0, & + case ('rhopedn') + call parse_real_variable('rhopedn', rhopedn, 0.01D0, 1.0D0, & 'Density pedestal r/a') - case ('rhopedt') - call parse_real_variable('rhopedt', rhopedt, 0.01D0, 1.0D0, & + case ('rhopedt') + call parse_real_variable('rhopedt', rhopedt, 0.01D0, 1.0D0, & 'Temperature pedestal r/a') - case ('rli') - call parse_real_variable('rli', rli, 0.0D0, 10.0D0, & + case ('rli') + call parse_real_variable('rli', rli, 0.0D0, 10.0D0, & 'Normalised inductivity') - case ('rmajor') - call parse_real_variable('rmajor', rmajor, 0.1D0, 50.0D0, & + case ('rmajor') + call parse_real_variable('rmajor', rmajor, 0.1D0, 50.0D0, & 'Plasma major radius (m)') - case ('rnbeam') - call parse_real_variable('rnbeam', rnbeam, 0.0D0, 1.0D0, & + case ('rnbeam') + call parse_real_variable('rnbeam', rnbeam, 0.0D0, 1.0D0, & 'Hot beam density / electron density') - case ('i_single_null') - call parse_int_variable('i_single_null', i_single_null, 0, 1, & + case ('i_single_null') + call parse_int_variable('i_single_null', i_single_null, 0, 1, & 'Switch for single/double null plasma') - case ('ssync') - call parse_real_variable('ssync', ssync, 0.0D0, 1.0D0, & + case ('ssync') + call parse_real_variable('ssync', ssync, 0.0D0, 1.0D0, & 'Synchrotron wall reflectivity factor') - case ('tbeta') - call parse_real_variable('tbeta', tbeta, 0.0D0, 4.0D0, & + case ('tbeta') + call parse_real_variable('tbeta', tbeta, 0.0D0, 4.0D0, & 'Temperature profile index beta') - case ('te') - call parse_real_variable('te', te, 1.0D0, 200.0D0, & + case ('te') + call parse_real_variable('te', te, 1.0D0, 200.0D0, & 'Electron temperature (keV)') - case ('tauee_in') - call parse_real_variable('tauee_in', tauee_in, 0.0D0, 100.0D0, & - 'Input electron energy confinement time (sec) (isc=48 only)') - case ('taulimit') - call parse_real_variable('taulimit', taulimit, 1.0D0, 100.0D0, & + case ('tauee_in') + call parse_real_variable('tauee_in', tauee_in, 0.0D0, 100.0D0, & + 'Input electron energy confinement time (sec) (isc=48 only)') + case ('taulimit') + call parse_real_variable('taulimit', taulimit, 1.0D0, 100.0D0, & 'Lower limit on taup/taueff the ratio of alpha particle to energy confinement times') - case ('teped') - call parse_real_variable('teped', teped, 0.0D0, 20.0D0, & + case ('teped') + call parse_real_variable('teped', teped, 0.0D0, 20.0D0, & 'Electron temperature pedestal height (keV)') - case ('tesep') - call parse_real_variable('tesep', tesep, 0.0D0, 20.0D0, & + case ('tesep') + call parse_real_variable('tesep', tesep, 0.0D0, 20.0D0, & 'Electron temperature at separatrix (keV)') - case ('ti') - call parse_real_variable('ti', ti, 5.0D0, 50.0D0, & + case ('ti') + call parse_real_variable('ti', ti, 5.0D0, 50.0D0, & 'Ion temperature (keV)') - case ('tratio') - call parse_real_variable('tratio', tratio, 0.0D0, 2.0D0, & + case ('tratio') + call parse_real_variable('tratio', tratio, 0.0D0, 2.0D0, & 'Ion / electron temperature ratio') - case ('triang') - call parse_real_variable('triang', triang, -1.0D0, 1.0D0, & + case ('triang') + call parse_real_variable('triang', triang, -1.0D0, 1.0D0, & 'Plasma separatrix triangularity') - case ('triang95') - call parse_real_variable('triang95', triang95, 0.0D0, 1.0D0, & + case ('triang95') + call parse_real_variable('triang95', triang95, 0.0D0, 1.0D0, & 'Plasma 95% triangularity') - ! Inequality settings + ! Inequality settings - case ('fniterpump') - call parse_real_variable('fniterpump', fniterpump, 0.001D0, 10.0D0, & + case ('fniterpump') + call parse_real_variable('fniterpump', fniterpump, 0.001D0, 10.0D0, & 'f-value for constraint on number of vacuum pumps') - case ('auxmin') - call parse_real_variable('auxmin', auxmin, 0.01D0, 100.0D0, & + case ('auxmin') + call parse_real_variable('auxmin', auxmin, 0.01D0, 100.0D0, & 'Minimum auxiliary power (MW)') - case ('betpmx') - call parse_real_variable('betpmx', betpmx, 0.01D0, 2.0D0, & + case ('betpmx') + call parse_real_variable('betpmx', betpmx, 0.01D0, 2.0D0, & 'Maximum poloidal beta') - case ('bigqmin') - call parse_real_variable('bigqmin', bigqmin, 0.01D0, 100.0D0, & + case ('bigqmin') + call parse_real_variable('bigqmin', bigqmin, 0.01D0, 100.0D0, & 'Minimum fusion gain Q') - case ('bmxlim') - call parse_real_variable('bmxlim', bmxlim, 0.1D0, 50.0D0, & + case ('bmxlim') + call parse_real_variable('bmxlim', bmxlim, 0.1D0, 50.0D0, & 'Maximum toroidal field (T)') - case ('fauxmn') - call parse_real_variable('fauxmn', fauxmn, 0.001D0, 10.0D0, & + case ('fauxmn') + call parse_real_variable('fauxmn', fauxmn, 0.001D0, 10.0D0, & 'F-value for minimum auxiliary power') - case ('fbeta') - call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & + case ('fbeta') + call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & 'F-value for eps.betap beta limit') - case ('fbetap') - call parse_real_variable('fbetap', fbetap, 0.001D0, 10.0D0, & + case ('fbetap') + call parse_real_variable('fbetap', fbetap, 0.001D0, 10.0D0, & 'F-value for poloidal beta limit') - case ('fbetatry') - call parse_real_variable('fbetatry', fbetatry, 0.001D0, 10.0D0, & + case ('fbetatry') + call parse_real_variable('fbetatry', fbetatry, 0.001D0, 10.0D0, & 'F-value for beta limit') - case ('fbetatry_lower') - call parse_real_variable('fbetatry_lower', fbetatry_lower, 0.001D0, 10.0D0, & + case ('fbetatry_lower') + call parse_real_variable('fbetatry_lower', fbetatry_lower, 0.001D0, 10.0D0, & 'F-value for (lower) beta limit') - case ('fecrh_ignition') - call parse_real_variable('fecrh_ignition', fecrh_ignition, 0.001D0, 10.0D0, & + case ('fecrh_ignition') + call parse_real_variable('fecrh_ignition', fecrh_ignition, 0.001D0, 10.0D0, & 'F-value for ecrh ignition constraint') - case ('fcwr') - call parse_real_variable('fcwr', fcwr, 0.001D0, 10.0D0, & + case ('fcwr') + call parse_real_variable('fcwr', fcwr, 0.001D0, 10.0D0, & 'F-value for conducting wall radius') - case ('fdene') - call parse_real_variable('fdene', fdene, 0.001D0, 10.0D0, & + case ('fdene') + call parse_real_variable('fdene', fdene, 0.001D0, 10.0D0, & 'F-value for density limit') - case ('fdivcol') - call parse_real_variable('fdivcol', fdivcol, 0.001D0, 10.0D0, & + case ('fdivcol') + call parse_real_variable('fdivcol', fdivcol, 0.001D0, 10.0D0, & 'F-value for divertor collisionality') - case ('fdtmp') - call parse_real_variable('fdtmp', fdtmp, 0.001D0, 10.0D0, & + case ('fdtmp') + call parse_real_variable('fdtmp', fdtmp, 0.001D0, 10.0D0, & 'F-value for first wall coolant temp rise') - case ('fgamcd') - call parse_real_variable('fgamcd', fgamcd, 0.001D0, 10.0D0, & + case ('fgamcd') + call parse_real_variable('fgamcd', fgamcd, 0.001D0, 10.0D0, & 'F-value for current drive gamma') - case ('fipir') - call parse_real_variable('fipir', fipir, 0.001D0, 10.0D0, & + case ('fipir') + call parse_real_variable('fipir', fipir, 0.001D0, 10.0D0, & 'F-value for Ip/Irod') - case ('fjohc') - call parse_real_variable('fjohc', fjohc, 0.001D0, 10.0D0, & + case ('fjohc') + call parse_real_variable('fjohc', fjohc, 0.001D0, 10.0D0, & 'F-value for Central Solenoid current at EOF') - case ('fjohc0') - call parse_real_variable('fjohc0', fjohc0, 0.001D0, 10.0D0, & + case ('fjohc0') + call parse_real_variable('fjohc0', fjohc0, 0.001D0, 10.0D0, & 'F-value for Central Solenoid current at BOP') - case ('fjtfc') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FJTFC is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fhldiv') - call parse_real_variable('fhldiv', fhldiv, 0.001D0, 10.0D0, & + case ('fjtfc') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FJTFC is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fhldiv') + call parse_real_variable('fhldiv', fhldiv, 0.001D0, 10.0D0, & 'F-value for divertor heat load') - case ('hldiv') - call parse_real_variable('hldiv', hldiv, 0.0D0, 10.0D0, & + case ('hldiv') + call parse_real_variable('hldiv', hldiv, 0.0D0, 10.0D0, & 'Divertor heat load (MW/m2)') - case ('i_hldiv') - call parse_int_variable('i_hldiv', i_hldiv, 0, 2, & + case ('i_hldiv') + call parse_int_variable('i_hldiv', i_hldiv, 0, 2, & 'Switch for user input hldiv') - case ('fflutf') - call parse_real_variable('fflutf', fflutf, 0.001D0, 10.0D0, & + case ('fflutf') + call parse_real_variable('fflutf', fflutf, 0.001D0, 10.0D0, & 'F-value for neutron fluence on TF coil') - case ('ffuspow') - call parse_real_variable('ffuspow', ffuspow, 0.001D0, 10.0D0, & + case ('ffuspow') + call parse_real_variable('ffuspow', ffuspow, 0.001D0, 10.0D0, & 'F-value for maximum fusion power') - case ('fiooic') - call parse_real_variable('fiooic', fiooic, 0.001D0, 10.0D0, & + case ('fiooic') + call parse_real_variable('fiooic', fiooic, 0.001D0, 10.0D0, & 'F-value for SCTF iop/icrit') - case ('fjprot') - call parse_real_variable('fjprot', fjprot, 0.001D0, 10.0D0, & + case ('fjprot') + call parse_real_variable('fjprot', fjprot, 0.001D0, 10.0D0, & 'F-value for SCTF winding pack J') - case ('flhthresh') - call parse_real_variable('flhthresh', flhthresh, 0.001D0, 1.0D6, & + case ('flhthresh') + call parse_real_variable('flhthresh', flhthresh, 0.001D0, 1.0D6, & 'F-value for L-H power threshold') - case ('fmva') - call parse_real_variable('fmva', fmva, 0.001D0, 10.0D0, & + case ('fmva') + call parse_real_variable('fmva', fmva, 0.001D0, 10.0D0, & 'F-value for maximum MVA') - case ('fnbshinef') - call parse_real_variable('fnbshinef', fnbshinef, 0.001D0, 10.0D0, & + case ('fnbshinef') + call parse_real_variable('fnbshinef', fnbshinef, 0.001D0, 10.0D0, & 'F-value for maximum NBI shine-through fraction') - case ('fncycle') - call parse_real_variable('fncycle', fncycle, 1.0D-8, 1.0D0, & + case ('fncycle') + call parse_real_variable('fncycle', fncycle, 1.0D-8, 1.0D0, & 'F-value for minimum CS coil stress load cycles') - case ('fpeakb') - call parse_real_variable('fpeakb', fpeakb, 0.001D0, 10.0D0, & + case ('fpeakb') + call parse_real_variable('fpeakb', fpeakb, 0.001D0, 10.0D0, & 'F-value for max toroidal field') - case ('fpinj') - call parse_real_variable('fpinj', fpinj, 0.001D0, 10.0D0, & + case ('fpinj') + call parse_real_variable('fpinj', fpinj, 0.001D0, 10.0D0, & 'F-value for injection power') - case ('fpnetel') - call parse_real_variable('fpnetel', fpnetel, 0.001D0, 10.0D0, & + case ('fpnetel') + call parse_real_variable('fpnetel', fpnetel, 0.001D0, 10.0D0, & 'F-value for net electric power') - case ('fportsz') - call parse_real_variable('fportsz', fportsz, 0.001D0, 10.0D0, & + case ('fportsz') + call parse_real_variable('fportsz', fportsz, 0.001D0, 10.0D0, & 'F-value for port size') - case ('fpdivlim') - call parse_real_variable('fpdivlim', fpdivlim, 0.001D0, 1.0D0, & + case ('fpdivlim') + call parse_real_variable('fpdivlim', fpdivlim, 0.001D0, 1.0D0, & 'F-value for minimum pdivt') - case ('ftoroidalgap') - call parse_real_variable('ftoroidalgap', ftoroidalgap, 0.001D0, 10.0D0, & - 'F-value for toroidal gap consistency') - case ('f_avspace') - call parse_real_variable('f_avspace', f_avspace, 0.001D0, 10.0D0, & - 'F-value for radial build consistency (stellarators)') - case ('fpsepr') - call parse_real_variable('fpsepr', fpsepr, 0.001D0, 10.0D0, & + case ('ftoroidalgap') + call parse_real_variable('ftoroidalgap', ftoroidalgap, 0.001D0, 10.0D0, & + 'F-value for toroidal gap consistency') + case ('f_avspace') + call parse_real_variable('f_avspace', f_avspace, 0.001D0, 10.0D0, & + 'F-value for radial build consistency (stellarators)') + case ('fpsepr') + call parse_real_variable('fpsepr', fpsepr, 0.001D0, 10.0D0, & 'F-value for Psep/R limit') - case ('fptemp') - call parse_real_variable('fptemp', fptemp, 0.001D0, 10.0D0, & + case ('fptemp') + call parse_real_variable('fptemp', fptemp, 0.001D0, 10.0D0, & 'F-value for peak centrepost temperature') - case ('fptfnuc') - call parse_real_variable('fptfnuc', fptfnuc, 0.001D0, 10.0D0, & + case ('fptfnuc') + call parse_real_variable('fptfnuc', fptfnuc, 0.001D0, 10.0D0, & 'F-value for max TF coil nuclear heating') - case ('fq') - call parse_real_variable('fq', fq, 0.001D0, 10.0D0, & + case ('fq') + call parse_real_variable('fq', fq, 0.001D0, 10.0D0, & 'F-value for edge safety factor') - case ('fqval') - call parse_real_variable('fqval', fqval, 0.001D0, 10.0D0, & + case ('fqval') + call parse_real_variable('fqval', fqval, 0.001D0, 10.0D0, & 'F-value for fusion gain Q') - case ('fradpwr') - call parse_real_variable('fradpwr', fradpwr, 0.0D0, 1.0D0, & + case ('fradpwr') + call parse_real_variable('fradpwr', fradpwr, 0.0D0, 1.0D0, & 'F-value for radiation power limit') - case ('fradwall') - call parse_real_variable('fradwall', fradwall, 0.001D0, 1.0D0, & + case ('fradwall') + call parse_real_variable('fradwall', fradwall, 0.001D0, 1.0D0, & 'f-value for upper limit on radiation wall load') - case ('freinke') - call parse_real_variable('freinke', freinke, 0.001D0, 1.0D0, & + case ('freinke') + call parse_real_variable('freinke', freinke, 0.001D0, 1.0D0, & 'f-value for upper limit on Reinke detachment criterion') - case ('frminor') - call parse_real_variable('frminor', frminor, 0.001D0, 10.0D0, & + case ('frminor') + call parse_real_variable('frminor', frminor, 0.001D0, 10.0D0, & 'F-value for minor radius limit') - case ('fstrcase') - call parse_real_variable('fstrcase', fstrcase, 0.001D0, 10.0D0, & + case ('fstrcase') + call parse_real_variable('fstrcase', fstrcase, 0.001D0, 10.0D0, & 'F-value for TF coil case stress') - case ('fstrcond') - call parse_real_variable('fstrcond', fstrcond, 0.001D0, 10.0D0, & + case ('fstrcond') + call parse_real_variable('fstrcond', fstrcond, 0.001D0, 10.0D0, & 'F-value for TF coil conduit stress') - case ('fstr_wp') - call parse_real_variable('fstr_wp', fstr_wp, 1.0D-9, 10.0D0, & + case ('fstr_wp') + call parse_real_variable('fstr_wp', fstr_wp, 1.0D-9, 10.0D0, & 'F-value for TF coil strain absolute value') - case ('ftaucq') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ftaucq is now obsolete - (use fmaxvvstress)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fmaxvvstress') - call parse_real_variable('fmaxvvstress', fmaxvvstress, 0.001D0, 1.0D0, & + case ('ftaucq') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ftaucq is now obsolete - (use fmaxvvstress)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fmaxvvstress') + call parse_real_variable('fmaxvvstress', fmaxvvstress, 0.001D0, 1.0D0, & 'F-value for maximum permitted stress of the VV') - case ('ftbr') - call parse_real_variable('ftbr', ftbr, 0.001D0, 10.0D0, & + case ('ftbr') + call parse_real_variable('ftbr', ftbr, 0.001D0, 10.0D0, & 'F-value for tritium breeding ratio limit') - case ('ftburn') - call parse_real_variable('ftburn', ftburn, 0.001D0, 10.0D0, & + case ('ftburn') + call parse_real_variable('ftburn', ftburn, 0.001D0, 10.0D0, & 'F-value for burn time limit') - case ('ftcycl') - call parse_real_variable('ftcycl', ftcycl, 0.001D0, 10.0D0, & + case ('ftcycl') + call parse_real_variable('ftcycl', ftcycl, 0.001D0, 10.0D0, & 'F-value for cycle time') - case ('ftmargtf') - call parse_real_variable('ftmargtf', ftmargtf, 0.001D0, 10.0D0, & + case ('ftmargtf') + call parse_real_variable('ftmargtf', ftmargtf, 0.001D0, 10.0D0, & 'F-value for TF coil temp. margin') - case ('ftmargoh') - call parse_real_variable('ftmargoh', ftmargoh, 0.001D0, 10.0D0, & + case ('ftmargoh') + call parse_real_variable('ftmargoh', ftmargoh, 0.001D0, 10.0D0, & 'F-value for TF coil temp. margin') - case ('ftohs') - call parse_real_variable('ftohs', ftohs, 0.001D0, 10.0D0, & + case ('ftohs') + call parse_real_variable('ftohs', ftohs, 0.001D0, 10.0D0, & 'F-value for plasma current ramp-up time') - case ('ftpeak') - call parse_real_variable('ftpeak', ftpeak, 0.001D0, 10.0D0, & + case ('ftpeak') + call parse_real_variable('ftpeak', ftpeak, 0.001D0, 10.0D0, & 'F-value for peak first wall temperature') - case ('fvdump') - call parse_real_variable('fvdump', fvdump, 0.001D0, 10.0D0, & + case ('fvdump') + call parse_real_variable('fvdump', fvdump, 0.001D0, 10.0D0, & 'F-value for dump voltage') - case ('fvs') - call parse_real_variable('fvs', fvs, 0.001D0, 10.0D0, & + case ('fvs') + call parse_real_variable('fvs', fvs, 0.001D0, 10.0D0, & 'F-value for startup V-s requirement') - case ('fvssu') - call parse_real_variable('fvssu', fvssu, 0.001D0, 10.0D0, & + case ('fvssu') + call parse_real_variable('fvssu', fvssu, 0.001D0, 10.0D0, & 'F-value for start up V-s requirement and availability equality') - case ('fvvhe') - call parse_real_variable('fvvhe', fvvhe, 0.001D0, 10.0D0, & + case ('fvvhe') + call parse_real_variable('fvvhe', fvvhe, 0.001D0, 10.0D0, & 'F-value for VV He concentration limit') - case ('fwalld') - call parse_real_variable('fwalld', fwalld, 0.001D0, 10.0D0, & + case ('fwalld') + call parse_real_variable('fwalld', fwalld, 0.001D0, 10.0D0, & 'F-value for wall load limit') - case ('fzactual') - call parse_real_variable('fzactual', fzactual, 0.0D0, 1.0D0, & + case ('fzactual') + call parse_real_variable('fzactual', fzactual, 0.0D0, 1.0D0, & 'fraction of specified impurity in SOL when constrained by Reinke criteria') - case ('fzeffmax') - call parse_real_variable('fzeffmax', fzeffmax, 0.001D0, 1.0D0, & + case ('fzeffmax') + call parse_real_variable('fzeffmax', fzeffmax, 0.001D0, 1.0D0, & 'f-value for Zeff limit equation') - case ('fpoloidalpower') - call parse_real_variable('fpoloidalpower', fpoloidalpower, 0.001D0, 1.0D0, & + case ('fpoloidalpower') + call parse_real_variable('fpoloidalpower', fpoloidalpower, 0.001D0, 1.0D0, & 'f-value for constraint on rate of change of energy in poloidal field') - case ('fpsep') - call parse_real_variable('fpsep', fpsep, 0.001D0, 1.0D0, & - 'f-value to ensure separatrix power is less than value from Kallen bach divertor') - case ('fpsepbqar') - call parse_real_variable('fpsepbqar', fpsepbqar, 0.001D0, 1.0D0, & - 'f-value for TF coil quench temperature < tmax_croco (constraint equation 74)') - case ('fcqt') - call parse_real_variable('fcqt', fcqt, 0.001D0, 1.0D0, & - 'TF coil quench temparature remains below tmax_croco') - case ('fne0') - call parse_real_variable('fne0', fne0, 0.001D0, 1.0D0, & - 'Central electron temperature remains higher that the pedestal one') - case ('gammax') - call parse_real_variable('gammax', gammax, 0.01D0, 10.0D0, & + case ('fpsep') + call parse_real_variable('fpsep', fpsep, 0.001D0, 1.0D0, & + 'f-value to ensure separatrix power is less than value from Kallen bach divertor') + case ('fpsepbqar') + call parse_real_variable('fpsepbqar', fpsepbqar, 0.001D0, 1.0D0, & + 'f-value for TF coil quench temperature < tmax_croco (constraint equation 74)') + case ('fcqt') + call parse_real_variable('fcqt', fcqt, 0.001D0, 1.0D0, & + 'TF coil quench temparature remains below tmax_croco') + case ('fne0') + call parse_real_variable('fne0', fne0, 0.001D0, 1.0D0, & + 'Central electron temperature remains higher that the pedestal one') + case ('gammax') + call parse_real_variable('gammax', gammax, 0.01D0, 10.0D0, & 'Maximum current drive gamma (A/W-m2)') - case ('maxradwallload') - call parse_real_variable('maxradwallload', maxradwallload, 0.1D0, 10.0D0, & + case ('maxradwallload') + call parse_real_variable('maxradwallload', maxradwallload, 0.1D0, 10.0D0, & 'Maximum permitted radiation wall load (MW/m^2)') - case ('mvalim') - call parse_real_variable('mvalim', mvalim, 0.0D0, 1000.0D0, & + case ('mvalim') + call parse_real_variable('mvalim', mvalim, 0.0D0, 1000.0D0, & 'Maximum MVA limit') - case ('nbshinefmax') - call parse_real_variable('nbshinefmax', nbshinefmax, 1.0D-20, 1.0D-1, & + case ('nbshinefmax') + call parse_real_variable('nbshinefmax', nbshinefmax, 1.0D-20, 1.0D-1, & 'Maximum NB shine-through fraction') - case ('nflutfmax') - call parse_real_variable('nflutfmax', nflutfmax, 1.0D20, 1.0D24, & + case ('nflutfmax') + call parse_real_variable('nflutfmax', nflutfmax, 1.0D20, 1.0D24, & 'Max fast neutron fluence on TF coil (n/m2)') - case ('pdivtlim') - call parse_real_variable('pdivtlim', pdivtlim, 0.1D0, 1.0D3, & + case ('pdivtlim') + call parse_real_variable('pdivtlim', pdivtlim, 0.1D0, 1.0D3, & 'Minimum pdivt (MW) (con. 80, itvar. 153)') - case ('peakfactrad') - call parse_real_variable('peakfactrad', peakfactrad, 0.1D0, 10D0, & + case ('peakfactrad') + call parse_real_variable('peakfactrad', peakfactrad, 0.1D0, 10D0, & 'peaking factor for radiation wall load') - case ('pnetelin') - call parse_real_variable('pnetelin', pnetelin, 1.0D0, 1.0D4, & + case ('pnetelin') + call parse_real_variable('pnetelin', pnetelin, 1.0D0, 1.0D4, & 'Required net electric power (MW)') - case ('powfmax') - call parse_real_variable('powfmax', powfmax, 1.0D0, 1.0D4, & + case ('powfmax') + call parse_real_variable('powfmax', powfmax, 1.0D0, 1.0D4, & 'Maximum fusion power (MW)') - case ('psepbqarmax') - call parse_real_variable('psepbqarmax', psepbqarmax, 1.0D0, 50.0D0, & + case ('psepbqarmax') + call parse_real_variable('psepbqarmax', psepbqarmax, 1.0D0, 50.0D0, & 'Maximum Psep*Bt/q*A*R ratio (MW.T/m)') - case ('pseprmax') - call parse_real_variable('pseprmax', pseprmax, 1.0D0, 60.0D0, & + case ('pseprmax') + call parse_real_variable('pseprmax', pseprmax, 1.0D0, 60.0D0, & 'Maximum Psep/R ratio (MW/m)') - case ('ptfnucmax') - call parse_real_variable('ptfnucmax', ptfnucmax, 1.0D-6, 1.0D0, & + case ('ptfnucmax') + call parse_real_variable('ptfnucmax', ptfnucmax, 1.0D-6, 1.0D0, & 'Maximum TF coil nuclear heating (MW/m3)') - case ('tbrmin') - call parse_real_variable('tbrmin', tbrmin, 0.001D0, 2.0D0, & + case ('tbrmin') + call parse_real_variable('tbrmin', tbrmin, 0.001D0, 2.0D0, & 'Minimum tritium breeding ratio') - case ('tbrnmn') - call parse_real_variable('tbrnmn', tbrnmn, 1.0D-3, 1.0D6, & + case ('tbrnmn') + call parse_real_variable('tbrnmn', tbrnmn, 1.0D-3, 1.0D6, & 'Minimum burn time (s)') - case ('tcycmn') - call parse_real_variable('tcycmn', tcycmn, 1.0D-3, 2.0D6, & + case ('tcycmn') + call parse_real_variable('tcycmn', tcycmn, 1.0D-3, 2.0D6, & 'Minimum cycle time (s)') - case ('vvhealw') - call parse_real_variable('vvhealw', vvhealw, 0.01D0, 10.0D0, & + case ('vvhealw') + call parse_real_variable('vvhealw', vvhealw, 0.01D0, 10.0D0, & 'Allowable maximum He conc. in VV (appm)') - case ('walalw') - call parse_real_variable('walalw', walalw, 0.001D0, 50.0D0, & + case ('walalw') + call parse_real_variable('walalw', walalw, 0.001D0, 50.0D0, & 'Allowable wall load (MW/m2)') - case ('zeffmax') - call parse_real_variable('zeffmax', zeffmax, 1.0D0, 10.0D0, & + case ('zeffmax') + call parse_real_variable('zeffmax', zeffmax, 1.0D0, 10.0D0, & 'Allowable Zeff') - ! Current drive settings + ! Current drive settings - case ('beamwd') - call parse_real_variable('beamwd', beamwd, 0.001D0, 5.0D0, & + case ('beamwd') + call parse_real_variable('beamwd', beamwd, 0.001D0, 5.0D0, & 'Beam width (m)') - case ('bscfmax') - call parse_real_variable('bscfmax', bscfmax, -0.999D0, 0.999D0, & + case ('bscfmax') + call parse_real_variable('bscfmax', bscfmax, -0.999D0, 0.999D0, & '(-fixed)/maximum Bootstrap fraction') - case ('cboot') - call parse_real_variable('cboot', cboot, 0.0D0, 10.0D0, & + case ('cboot') + call parse_real_variable('cboot', cboot, 0.0D0, 10.0D0, & 'Bootstrap current fraction multiplier') - case ('enbeam') - call parse_real_variable('enbeam', enbeam, 1.0D0, 1.0D6, & + case ('enbeam') + call parse_real_variable('enbeam', enbeam, 1.0D0, 1.0D6, & 'Neutral beam energy (keV)') - case ('etalh') - call parse_real_variable('etalh', etalh, 0.0D0, 1.0D0, & + case ('etalh') + call parse_real_variable('etalh', etalh, 0.0D0, 1.0D0, & 'LH wall plug to plasma efficiency') - case ('etaech') - call parse_real_variable('etaech', etaech, 0.0D0, 1.0D0, & + case ('etaech') + call parse_real_variable('etaech', etaech, 0.0D0, 1.0D0, & 'ECH wall plug to injector efficiency') - case ('etanbi') - call parse_real_variable('etanbi', etanbi, 0.0D0, 1.0D0, & + case ('etanbi') + call parse_real_variable('etanbi', etanbi, 0.0D0, 1.0D0, & 'NBI wall plug to injector efficiency') - case ('feffcd') - call parse_real_variable('feffcd', feffcd, 0.0D0, 20.0D0, & + case ('feffcd') + call parse_real_variable('feffcd', feffcd, 0.0D0, 20.0D0, & 'Current drive efficiency fiddle factor') - case ('forbitloss') - call parse_real_variable('forbitloss', forbitloss, 0.0D0, 0.999D0, & + case ('forbitloss') + call parse_real_variable('forbitloss', forbitloss, 0.0D0, 0.999D0, & 'NBI power orbit loss fraction') - case ('frbeam') - call parse_real_variable('frbeam', frbeam, 0.5D0, 2.0D0, & + case ('frbeam') + call parse_real_variable('frbeam', frbeam, 0.5D0, 2.0D0, & 'R_tan / R_major for NBI') - case ('ftritbm') - call parse_real_variable('ftritbm', ftritbm, 0.0D0, 1.0D0, & + case ('ftritbm') + call parse_real_variable('ftritbm', ftritbm, 0.0D0, 1.0D0, & 'Tritium fraction of beam') - case ('gamma_ecrh') - call parse_real_variable('gamma_ecrh', gamma_ecrh, 0.0D0, 1.0D0, & + case ('gamma_ecrh') + call parse_real_variable('gamma_ecrh', gamma_ecrh, 0.0D0, 1.0D0, & 'User input ECRH gamma_CD') - case ('harnum') - call parse_real_variable('harnum', harnum, 1.0D0, 10.0D0, & + case ('harnum') + call parse_real_variable('harnum', harnum, 1.0D0, 10.0D0, & 'cyclotron harmonic frequency number') - case ('rho_ecrh') - call parse_real_variable('rho_ecrh', rho_ecrh, 0.0D0, 1.0D0, & + case ('rho_ecrh') + call parse_real_variable('rho_ecrh', rho_ecrh, 0.0D0, 1.0D0, & 'normalised minor radius at which electron cyclotron current drive is maximum') - case ('xi_ebw') - call parse_real_variable('xi_ebw', xi_ebw, 0.0D0, 1.0D0, & + case ('xi_ebw') + call parse_real_variable('xi_ebw', xi_ebw, 0.0D0, 1.0D0, & 'User input EBW scaling for Plasma Heating') - case ('iefrf') - call parse_int_variable('iefrf', iefrf, 1, 12, & + case ('iefrf') + call parse_int_variable('iefrf', iefrf, 1, 12, & 'Switch for curr drive efficiency model') - case ('iefrffix') - call parse_int_variable('iefrffix', iefrffix, 0, 12, & + case ('iefrffix') + call parse_int_variable('iefrffix', iefrffix, 0, 12, & 'Switch for 2nd curr drive efficiency model') - case ('irfcd') - call parse_int_variable('irfcd', irfcd, 0, 1, & + case ('irfcd') + call parse_int_variable('irfcd', irfcd, 0, 1, & 'Switch for current drive calculation') - case ('nbshield') - call parse_real_variable('nbshield', nbshield, 0.01D0, 0.5D0, & + case ('nbshield') + call parse_real_variable('nbshield', nbshield, 0.01D0, 0.5D0, & 'Wall thickness of neutral beam duct (m)') - case ('pheat') - call parse_real_variable('pheat', pheat, 0.0D0, 1.0D3, & + case ('pheat') + call parse_real_variable('pheat', pheat, 0.0D0, 1.0D3, & 'Heating power not used for C.D. (MW)') - case ('pheatfix') - call parse_real_variable('pheatfix', pheatfix, 0.0D0, 1.0D3, & + case ('pheatfix') + call parse_real_variable('pheatfix', pheatfix, 0.0D0, 1.0D3, & 'Secondary fixed heating power not used for C.D. (MW)') - case ('pinjalw') - call parse_real_variable('pinjalw', pinjalw, 0.0D0, 1.0D3, & + case ('pinjalw') + call parse_real_variable('pinjalw', pinjalw, 0.0D0, 1.0D3, & 'Maximum allowed injection power (MW)') - case ('pinjfixmw') - call parse_real_variable('pinjfixmw', pinjfixmw, 0.0D0, 1.0D3, & + case ('pinjfixmw') + call parse_real_variable('pinjfixmw', pinjfixmw, 0.0D0, 1.0D3, & 'Secondary auxiliary injection power (MW)') - case ('tbeamin') - call parse_real_variable('tbeamin', tbeamin, 0.0D0, 10.0D0, & + case ('tbeamin') + call parse_real_variable('tbeamin', tbeamin, 0.0D0, 10.0D0, & 'No of NB decay lengths to plas centre') - ! Time settings + ! Time settings - case ('tburn') - call parse_real_variable('tburn', tburn, 0.0D0, 1.0D8, & + case ('tburn') + call parse_real_variable('tburn', tburn, 0.0D0, 1.0D8, & 'Burn time (s)') - case ('tdwell') - call parse_real_variable('tdwell', tdwell, 0.0D0, 1.0D8, & + case ('tdwell') + call parse_real_variable('tdwell', tdwell, 0.0D0, 1.0D8, & 'Time between burns (s)') - case ('theat') - call parse_real_variable('theat', theat, 0.0D0, 1.0D4, & + case ('theat') + call parse_real_variable('theat', theat, 0.0D0, 1.0D4, & 'Heating time after current ramp (s)') - case ('tohs') - call parse_real_variable('tohs', tohs, 0.0D0, 1.0D4, & + case ('tohs') + call parse_real_variable('tohs', tohs, 0.0D0, 1.0D4, & 'Plasma current ramp-up time for current init (s)') - case ('tohsin') - call parse_real_variable('tohsin', tohsin, 0.0D0, 1.0D4, & + case ('tohsin') + call parse_real_variable('tohsin', tohsin, 0.0D0, 1.0D4, & 'Switch for TOHS calculation') - case ('tqnch') - call parse_real_variable('tqnch', tqnch, 0.0D0, 1.0D4, & + case ('tqnch') + call parse_real_variable('tqnch', tqnch, 0.0D0, 1.0D4, & 'PF coil shutdown time (s)') - case ('tramp') - call parse_real_variable('tramp', tramp, 0.0D0, 1.0D4, & + case ('tramp') + call parse_real_variable('tramp', tramp, 0.0D0, 1.0D4, & 'Initial charge time for PF coils (s)') - case ('pulsetimings') - call parse_real_variable('pulsetimings', pulsetimings, 0.0D0, 1.0D0, & + case ('pulsetimings') + call parse_real_variable('pulsetimings', pulsetimings, 0.0D0, 1.0D0, & 'Pulse timings switch for lpulse=1') - ! Divertor settings: 2016 Kallenbach model (2016/07/04) - - case ('target_spread', 'lambda_q_omp', 'lcon_factor', 'netau_sol', 'kallenbach_switch', & - 'kallenbach_tests', 'kallenbach_test_option', 'kallenbach_scan_switch', 'kallenbach_scan_var', & - 'kallenbach_scan_start', 'kallenbach_scan_end', 'kallenbach_scan_num', 'targetangle', 'ttarget', & - 'qtargettotal', 'impurity_enrichment', 'fractionwidesol', 'abserr_sol', 'relerr_sol', 'mach0', & - 'neratio') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'The Stellarator model is currently not included in PROCESS.' - write(outfile,*) 'See issue #1853 for more information on the use of Stellarators.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - - ! See HTS coil module for PROCESS.docx - !case ('cable_helium_fraction') - ! call parse_real_variable('cable_helium_fraction', cable_helium_fraction, 0.215D0, 0.99D0, & - ! 'Helium area as a fraction of the cable space.') - - ! Divertor settings - - case ('anginc') - call parse_real_variable('anginc', anginc, 0.0D0, 1.5707D0, & + ! Divertor settings: 2016 Kallenbach model (2016/07/04) + + case ('target_spread', 'lambda_q_omp', 'lcon_factor', 'netau_sol', 'kallenbach_switch', & + 'kallenbach_tests', 'kallenbach_test_option', 'kallenbach_scan_switch', 'kallenbach_scan_var', & + 'kallenbach_scan_start', 'kallenbach_scan_end', 'kallenbach_scan_num', 'targetangle', 'ttarget', & + 'qtargettotal', 'impurity_enrichment', 'fractionwidesol', 'abserr_sol', 'relerr_sol', 'mach0', & + 'neratio') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'The Stellarator model is currently not included in PROCESS.' + write(outfile,*) 'See issue #1853 for more information on the use of Stellarators.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + + ! See HTS coil module for PROCESS.docx + !case ('cable_helium_fraction') + ! call parse_real_variable('cable_helium_fraction', cable_helium_fraction, 0.215D0, 0.99D0, & + ! 'Helium area as a fraction of the cable space.') + + ! Divertor settings + + case ('anginc') + call parse_real_variable('anginc', anginc, 0.0D0, 1.5707D0, & 'Field line ang of incid on dvrtr (rad)') - case ('beta_div') - call parse_real_variable('beta_div', beta_div, 0.0D0, 360.0D0, & + case ('beta_div') + call parse_real_variable('beta_div', beta_div, 0.0D0, 360.0D0, & 'Field line angle wrt divertor target plate (degrees)') - case ('betai') - call parse_real_variable('betai', betai, 0.0D0, 1.5707D0, & + case ('betai') + call parse_real_variable('betai', betai, 0.0D0, 1.5707D0, & 'Poloidal plane angle between inner divertor leg and plate (rad)') - case ('betao') - call parse_real_variable('betao', betao, 0.0D0, 1.5707D0, & + case ('betao') + call parse_real_variable('betao', betao, 0.0D0, 1.5707D0, & 'Poloidal plane angle between outer divertor leg and plate (rad)') - case ('bpsout') - call parse_real_variable('bpsout', bpsout, 0.0D0, 10.0D0, & + case ('bpsout') + call parse_real_variable('bpsout', bpsout, 0.0D0, 10.0D0, & 'Ref B_p at outboard divertor strike point') - case ('c1div') - call parse_real_variable('c1div', c1div, -100.0D0, 100.0D0, & + case ('c1div') + call parse_real_variable('c1div', c1div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c2div') - call parse_real_variable('c2div', c2div, -100.0D0, 100.0D0, & + case ('c2div') + call parse_real_variable('c2div', c2div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c3div') - call parse_real_variable('c3div', c3div, -100.0D0, 100.0D0, & + case ('c3div') + call parse_real_variable('c3div', c3div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c4div') - call parse_real_variable('c4div', c4div, -100.0D0, 100.0D0, & + case ('c4div') + call parse_real_variable('c4div', c4div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c5div') - call parse_real_variable('c5div', c5div, -100.0D0, 100.0D0, & + case ('c5div') + call parse_real_variable('c5div', c5div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c6div') - call parse_real_variable('c6div', c6div, -100.0D0, 100.0D0, & + case ('c6div') + call parse_real_variable('c6div', c6div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('delld') - call parse_real_variable('delld', delld, 0.1D0, 2.0D0, & + case ('delld') + call parse_real_variable('delld', delld, 0.1D0, 2.0D0, & 'Coefficient for power distribution') - case ('divclfr') - call parse_real_variable('divclfr', divclfr, 0.0D0, 1.0D0, & + case ('divclfr') + call parse_real_variable('divclfr', divclfr, 0.0D0, 1.0D0, & 'Divertor coolant fraction') - case ('divdens') - call parse_real_variable('divdens', divdens, 0.1D0, 1.0D5, & + case ('divdens') + call parse_real_variable('divdens', divdens, 0.1D0, 1.0D5, & 'Divertor structure density (kg/m3)') - case ('divdum') - call parse_int_variable('divdum', divdum, 0, 1, & + case ('divdum') + call parse_int_variable('divdum', divdum, 0, 1, & 'Switch for divertor Zeff value') - case ('divfix') - call parse_real_variable('divfix', divfix, 0.1D0, 5.0D0, & + case ('divfix') + call parse_real_variable('divfix', divfix, 0.1D0, 5.0D0, & 'Divertor structure vertical extent (m)') - case('divleg_profile_inner') - call parse_real_variable('divleg_profile_inner', divleg_profile_inner, 0.0D0, 10.0D0, & + case('divleg_profile_inner') + call parse_real_variable('divleg_profile_inner', divleg_profile_inner, 0.0D0, 10.0D0, & 'Divertor inner leg surface, 2D profile (m)') - case('divleg_profile_outer') - call parse_real_variable('divleg_profile_outer', divleg_profile_outer, 0.0D0, 50.0D0, & + case('divleg_profile_outer') + call parse_real_variable('divleg_profile_outer', divleg_profile_outer, 0.0D0, 50.0D0, & 'Divertor outer leg surface, 2D profile (m)') - case ('divplt') - call parse_real_variable('divplt', divplt, 0.01D0, 1.0D0, & + case ('divplt') + call parse_real_variable('divplt', divplt, 0.01D0, 1.0D0, & 'Divertor plate thickness (m)') - case ('fdfs') - call parse_real_variable('fdfs', fdfs, 0.0D0, 20.0D0, & + case ('fdfs') + call parse_real_variable('fdfs', fdfs, 0.0D0, 20.0D0, & 'Radial gradient ratio') - case ('fdiva') - call parse_real_variable('fdiva', fdiva, 0.1D0, 2.0D0, & + case ('fdiva') + call parse_real_variable('fdiva', fdiva, 0.1D0, 2.0D0, & 'Divertor area fiddle factor') - case ('fgamp') - call parse_real_variable('fgamp', fgamp, -100.0D0, 100.0D0, & + case ('fgamp') + call parse_real_variable('fgamp', fgamp, -100.0D0, 100.0D0, & 'Sheath potential factor') - case ('fififi') - call parse_real_variable('fififi', fififi, 1.0D-6, 1.0D0, & + case ('fififi') + call parse_real_variable('fififi', fififi, 1.0D-6, 1.0D0, & 'Coefficient for gamdiv') - case ('flux_exp') - call parse_real_variable('flux_exp', flux_exp, 0.0D0, 10.0D0, & + case ('flux_exp') + call parse_real_variable('flux_exp', flux_exp, 0.0D0, 10.0D0, & 'Plasma flux expansion in the divertor') - case ('frrp') - call parse_real_variable('frrp', frrp, 0.0D0, 1.0D0, & + case ('frrp') + call parse_real_variable('frrp', frrp, 0.0D0, 1.0D0, & 'Fraction of radiated power to plate') - case ('hldivlim') - call parse_real_variable('hldivlim', hldivlim, 0.1D0, 20.0D0, & + case ('hldivlim') + call parse_real_variable('hldivlim', hldivlim, 0.1D0, 20.0D0, & 'Divertor heat load limit (MW/m2)') - case ('ksic') - call parse_real_variable('ksic', ksic, 0.0D0, 2.0D0, & + case ('ksic') + call parse_real_variable('ksic', ksic, 0.0D0, 2.0D0, & 'Divertor power fraction thingy') - case ('omegan') - call parse_real_variable('omegan', omegan, 0.1D0, 10.0D0, & + case ('omegan') + call parse_real_variable('omegan', omegan, 0.1D0, 10.0D0, & 'Pressure ratio (nT)_p / (nT)_s') - case ('plleni') - call parse_real_variable('plleni', plleni, 0.1D0, 10.0D0, & + case ('plleni') + call parse_real_variable('plleni', plleni, 0.1D0, 10.0D0, & 'Poloidal length, inboard divertor plate (m)') - case ('plleno') - call parse_real_variable('plleno', plleno, 0.1D0, 10.0D0, & + case ('plleno') + call parse_real_variable('plleno', plleno, 0.1D0, 10.0D0, & 'Poloidal length, outboard divertor plate (m)') - case ('plsepi') - call parse_real_variable('plsepi', plsepi, 0.1D0, 10.0D0, & + case ('plsepi') + call parse_real_variable('plsepi', plsepi, 0.1D0, 10.0D0, & 'Poloidal length, x to inboard strike point (m)') - case ('plsepo') - call parse_real_variable('plsepo', plsepo, 0.1D0, 10.0D0, & + case ('plsepo') + call parse_real_variable('plsepo', plsepo, 0.1D0, 10.0D0, & 'Poloidal length, x to outboard strike point (m)') - case ('prn1') - call parse_real_variable('prn1', prn1, 0.0D0, 1.0D0, & + case ('prn1') + call parse_real_variable('prn1', prn1, 0.0D0, 1.0D0, & 'n_scrapeoff / n_average plasma') - case ('rlenmax') - call parse_real_variable('rlenmax', rlenmax, 0.0D0, 1.0D0, & + case ('rlenmax') + call parse_real_variable('rlenmax', rlenmax, 0.0D0, 1.0D0, & 'Maximum value for length ratio') - case ('tdiv') - call parse_real_variable('tdiv', tdiv, 0.1D0, 100.0D0, & + case ('tdiv') + call parse_real_variable('tdiv', tdiv, 0.1D0, 100.0D0, & 'Plasma temperature at divertor (eV)') - case ('xparain') - call parse_real_variable('xparain', xparain, 0.01D0, 1.0D4, & + case ('xparain') + call parse_real_variable('xparain', xparain, 0.01D0, 1.0D4, & 'Parallel heat transport coeff (m2/s)') - case ('xpertin') - call parse_real_variable('xpertin', xpertin, 0.0D0, 10.0D0, & + case ('xpertin') + call parse_real_variable('xpertin', xpertin, 0.0D0, 10.0D0, & 'Perpendicular heat trans coeff (m2/s)') - case ('zeffdiv') - call parse_real_variable('zeffdiv', zeffdiv, 0.01D0, 100.0D0, & + case ('zeffdiv') + call parse_real_variable('zeffdiv', zeffdiv, 0.01D0, 100.0D0, & 'Zeff in the divertor region (if divdum.ne.0)') - ! Radial / vertical build settings + ! Radial / vertical build settings - case ('aplasmin') - call parse_real_variable('aplasmin', aplasmin, 0.01D0, 10.0D0, & + case ('aplasmin') + call parse_real_variable('aplasmin', aplasmin, 0.01D0, 10.0D0, & 'Minimum minor radius (m)') - case ('blbmith') - call parse_real_variable('blbmith', blbmith, 0.0D0, 2.0D0, & + case ('blbmith') + call parse_real_variable('blbmith', blbmith, 0.0D0, 2.0D0, & 'Inboard blanket box manifold thickness (m)') - case ('blbmoth') - call parse_real_variable('blbmoth', blbmoth, 0.0D0, 2.0D0, & + case ('blbmoth') + call parse_real_variable('blbmoth', blbmoth, 0.0D0, 2.0D0, & 'Outboard blanket box manifold thickness (m)') - case ('blbpith') - call parse_real_variable('blbpith', blbpith, 0.0D0, 2.0D0, & + case ('blbpith') + call parse_real_variable('blbpith', blbpith, 0.0D0, 2.0D0, & 'Inboard blanket back plate thickness (m)') - case ('blbpoth') - call parse_real_variable('blbpoth', blbpoth, 0.0D0, 2.0D0, & + case ('blbpoth') + call parse_real_variable('blbpoth', blbpoth, 0.0D0, 2.0D0, & 'Outboard blanket back plate thickness (m)') - case ('blbuith') - call parse_real_variable('blbuith', blbuith, 0.0D0, 2.0D0, & + case ('blbuith') + call parse_real_variable('blbuith', blbuith, 0.0D0, 2.0D0, & 'Inboard blanket breeding unit thickness (m)') - case ('blbuoth') - call parse_real_variable('blbuoth', blbuoth, 0.0D0, 2.0D0, & + case ('blbuoth') + call parse_real_variable('blbuoth', blbuoth, 0.0D0, 2.0D0, & 'Outboard blanket breeding unit thickness (m)') - case ('blnkith') - if (iblanket == 3) then - !CCFE HCPB model with Tritium Breeding Ratio calculation + case ('blnkith') + if (iblanket == 3) then + !CCFE HCPB model with Tritium Breeding Ratio calculation + write(outfile,*) '**********' + write(outfile,*) 'ERROR. BLNKITH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + else + call parse_real_variable('blnkith', blnkith, 0.0D0, 10.0D0, & + 'Inboard blanket thickness (m)') + ! Inboard blanket does not exist if the thickness is below a certain limit. + if(blnkith>=0.0D00.and.blnkith<=1.0D-3) then + blnkith = 0.0D00 ! Inboard blanket thickness is zero + iblnkith = 0 ! Inboard blanket does not exist + end if + end if + case ('blnkoth') + if (iblanket == 3) then + !CCFE HCPB model with Tritium Breeding Ratio calculation + write(outfile,*) '**********' + write(outfile,*) 'ERROR. BLNKOTH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + else + call parse_real_variable('blnkoth', blnkoth, 0.0D0, 10.0D0, & + 'Outboard blanket thickness (m)') + end if + case ('blnktth') + write(outfile,*) ' ' write(outfile,*) '**********' - write(outfile,*) 'ERROR. BLNKITH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' + write(outfile,*) 'WARNING. BLNKTTH is now always calculated rather than input -' write(outfile,*) 'please remove it from the input file' write(outfile,*) '**********' - else - call parse_real_variable('blnkith', blnkith, 0.0D0, 10.0D0, & - 'Inboard blanket thickness (m)') - ! Inboard blanket does not exist if the thickness is below a certain limit. - if(blnkith>=0.0D00.and.blnkith<=1.0D-3) then - blnkith = 0.0D00 ! Inboard blanket thickness is zero - iblnkith = 0 ! Inboard blanket does not exist - end if - end if - case ('blnkoth') - if (iblanket == 3) then - !CCFE HCPB model with Tritium Breeding Ratio calculation + write(outfile,*) ' ' + obsolete_var = .true. + case ('bcylth') + write(outfile,*) ' ' write(outfile,*) '**********' - write(outfile,*) 'ERROR. BLNKOTH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' + write(outfile,*) 'ERROR. BCYLTH is now obsolete -' write(outfile,*) 'please remove it from the input file' write(outfile,*) '**********' - else - call parse_real_variable('blnkoth', blnkoth, 0.0D0, 10.0D0, & - 'Outboard blanket thickness (m)') - end if - case ('blnktth') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'WARNING. BLNKTTH is now always calculated rather than input -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('bcylth') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ERROR. BCYLTH is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('bore') - call parse_real_variable('bore', bore, 0.0D0, 50.0D0, & + write(outfile,*) ' ' + obsolete_var = .true. + case ('bore') + call parse_real_variable('bore', bore, 0.0D0, 50.0D0, & 'Machine bore (m)') - case ('clhsf') - call parse_real_variable('clhsf', clhsf, 2.0D0, 10.0D0, & + case ('clhsf') + call parse_real_variable('clhsf', clhsf, 2.0D0, 10.0D0, & 'Cryostat lid height scaling factor (m)') - case ('ddwex') - call parse_real_variable('ddwex', ddwex, 0.0D0, 10.0D0, & + case ('ddwex') + call parse_real_variable('ddwex', ddwex, 0.0D0, 10.0D0, & 'cryostat wall thickness (m)') - case ('d_vv_in') - call parse_real_variable('d_vv_in', d_vv_in, 0.0D0, 10.0D0, & + case ('d_vv_in') + call parse_real_variable('d_vv_in', d_vv_in, 0.0D0, 10.0D0, & 'Inboard vacuum vessel thickness (m)') - case ('d_vv_out') - call parse_real_variable('d_vv_out', d_vv_out, 0.0D0, 10.0D0, & + case ('d_vv_out') + call parse_real_variable('d_vv_out', d_vv_out, 0.0D0, 10.0D0, & 'Outboard vacuum vessel thickness (m)') - case ('d_vv_top') - call parse_real_variable('d_vv_top', d_vv_top, 0.0D0, 10.0D0, & + case ('d_vv_top') + call parse_real_variable('d_vv_top', d_vv_top, 0.0D0, 10.0D0, & 'Topside vacuum vessel thickness (m)') - case ('d_vv_bot') - call parse_real_variable('d_vv_bot', d_vv_bot, 0.0D0, 10.0D0, & + case ('d_vv_bot') + call parse_real_variable('d_vv_bot', d_vv_bot, 0.0D0, 10.0D0, & 'Underside vacuum vessel thickness (m)') - case ('fcspc') - call parse_real_variable('fcspc', fcspc, 0.0D0, 1.0D0, & + case ('fcspc') + call parse_real_variable('fcspc', fcspc, 0.0D0, 1.0D0, & 'Fraction of space occupied by CS pre-comp structure') - case ('fmsbc') - call parse_real_variable('fmsbc', fmsbc, 0.0D0, 1.0D0, & + case ('fmsbc') + call parse_real_variable('fmsbc', fmsbc, 0.0D0, 1.0D0, & 'Martensitic frac of steel in buck cyl') - case ('fmsbl') - call parse_real_variable('fmsbl', fmsbl, 0.0D0, 1.0D0, & + case ('fmsbl') + call parse_real_variable('fmsbl', fmsbl, 0.0D0, 1.0D0, & 'Martensitic frac of steel in blanket') - case ('fmsdwe') - call parse_real_variable('fmsdwe', fmsdwe, 0.0D0, 1.0D0, & + case ('fmsdwe') + call parse_real_variable('fmsdwe', fmsdwe, 0.0D0, 1.0D0, & 'Martensitic frac of steel in cryostat') - case ('fmsdwi') - call parse_real_variable('fmsdwi', fmsdwi, 0.0D0, 1.0D0, & + case ('fmsdwi') + call parse_real_variable('fmsdwi', fmsdwi, 0.0D0, 1.0D0, & 'Martensitic frac of steel in vacuum vessel') - case ('fmsfw') - call parse_real_variable('fmsfw', fmsfw, 0.0D0, 1.0D0, & + case ('fmsfw') + call parse_real_variable('fmsfw', fmsfw, 0.0D0, 1.0D0, & 'Martensitic frac of steel in first wall') - case ('fmsoh') - call parse_real_variable('fmsoh', fmsoh, 0.0D0, 1.0D0, & + case ('fmsoh') + call parse_real_variable('fmsoh', fmsoh, 0.0D0, 1.0D0, & 'Martensitic frac of steel in Central Solenoid') - case ('fmssh') - call parse_real_variable('fmssh', fmssh, 0.0D0, 1.0D0, & + case ('fmssh') + call parse_real_variable('fmssh', fmssh, 0.0D0, 1.0D0, & 'Martensitic frac of steel in shield') - case ('fmstf') - call parse_real_variable('fmstf', fmstf, 0.0D0, 1.0D0, & + case ('fmstf') + call parse_real_variable('fmstf', fmstf, 0.0D0, 1.0D0, & 'Martensitic frac of steel in TF coil') - case ('fseppc') - call parse_real_variable('fseppc', fseppc, 1.0D6, 1.0D9, & + case ('fseppc') + call parse_real_variable('fseppc', fseppc, 1.0D6, 1.0D9, & 'CS separation force held by CS pre-comp structure') - case ('oh_steel_frac') - call parse_real_variable('oh_steel_frac', oh_steel_frac, 1.0D-3, 0.999D0, & + case ('oh_steel_frac') + call parse_real_variable('oh_steel_frac', oh_steel_frac, 1.0D-3, 0.999D0, & 'Central solenoid steel fraction') - case ('foh_stress') - call parse_real_variable('foh_stress', foh_stress, 1.0D-3, 1.0D0, & + case ('foh_stress') + call parse_real_variable('foh_stress', foh_stress, 1.0D-3, 1.0D0, & 'F-value for CS coil Tresca yield criterion') - ! case ('fwith') - ! call parse_real_variable('fwith', fwith, 0.0D0, 10.0D0, & - ! 'Inboard first wall thickness, initial estimate (m)') - ! case ('fwoth') - ! call parse_real_variable('fwoth', fwoth, 0.0D0, 10.0D0, & - ! 'Outboard first wall thickness, initial estimate (m)') - case ('gapoh') - call parse_real_variable('gapoh', gapoh, 0.0D0, 10.0D0, & + ! case ('fwith') + ! call parse_real_variable('fwith', fwith, 0.0D0, 10.0D0, & + ! 'Inboard first wall thickness, initial estimate (m)') + ! case ('fwoth') + ! call parse_real_variable('fwoth', fwoth, 0.0D0, 10.0D0, & + ! 'Outboard first wall thickness, initial estimate (m)') + case ('gapoh') + call parse_real_variable('gapoh', gapoh, 0.0D0, 10.0D0, & 'Gap between OHC and TF coil (m)') - case ('gapds') - call parse_real_variable('gapds', gapds, 0.0D0, 10.0D0, & + case ('gapds') + call parse_real_variable('gapds', gapds, 0.0D0, 10.0D0, & 'Gap between inboard vacuum vessel and shield (m)') - case ('gapomin') - call parse_real_variable('gapomin', gapomin, 0.0D0, 10.0D0, & + case ('gapomin') + call parse_real_variable('gapomin', gapomin, 0.0D0, 10.0D0, & 'Min gap between outboard shield & vac vessel (m)') - case ('iohcl') - call parse_int_variable('iohcl', iohcl, 0, 1, & + case ('iohcl') + call parse_int_variable('iohcl', iohcl, 0, 1, & 'Switch for existence of Central Solenoid') - case ('iprecomp') - call parse_int_variable('iprecomp', iprecomp, 0, 1, & + case ('iprecomp') + call parse_int_variable('iprecomp', iprecomp, 0, 1, & 'Switch for existence of Central Solenoid pre-compression structure') - case ('tf_in_cs') - call parse_int_variable('tf_in_cs', tf_in_cs, 0, 1, & + case ('tf_in_cs') + call parse_int_variable('tf_in_cs', tf_in_cs, 0, 1, & 'Switch for placing TF coils inside of the CS') - case ('ohcth') - call parse_real_variable('ohcth', ohcth, 0.0D0, 10.0D0, & + case ('ohcth') + call parse_real_variable('ohcth', ohcth, 0.0D0, 10.0D0, & 'Central Solenoid thickness (m)') - case ('rinboard') - call parse_real_variable('rinboard', rinboard, 0.1D0, 10.0D0, & + case ('rinboard') + call parse_real_variable('rinboard', rinboard, 0.1D0, 10.0D0, & 'Plasma inboard radius (m)') - case ('rpf2dewar') - call parse_real_variable('rpf2dewar', rpf2dewar, 0.1D0, 5.0D0, & + case ('rpf2dewar') + call parse_real_variable('rpf2dewar', rpf2dewar, 0.1D0, 5.0D0, & 'Outer PF coil to cryostat distance (m)') - case ('i_r_cp_top') - call parse_int_variable('i_r_cp_top', i_r_cp_top, 0, 2, & + case ('i_r_cp_top') + call parse_int_variable('i_r_cp_top', i_r_cp_top, 0, 2, & 'Switch selecting the parametrization of the TF CP top radius (ST only)') - case ('r_cp_top') - call parse_real_variable('r_cp_top', r_cp_top, 0.0010D0, 10.0D0, & - 'Top CP outer radius (ST only) (m)') - case ('f_r_cp') - call parse_real_variable('f_r_cp', f_r_cp, 1.0D0, 100.0D0, & - 'Ratio between the top and the midplane TF CP outer radius (-) ') - case ('scrapli') - call parse_real_variable('scrapli', scrapli, 0.0D0, 10.0D0, & + case ('r_cp_top') + call parse_real_variable('r_cp_top', r_cp_top, 0.0010D0, 10.0D0, & + 'Top CP outer radius (ST only) (m)') + case ('f_r_cp') + call parse_real_variable('f_r_cp', f_r_cp, 1.0D0, 100.0D0, & + 'Ratio between the top and the midplane TF CP outer radius (-) ') + case ('scrapli') + call parse_real_variable('scrapli', scrapli, 0.0D0, 10.0D0, & 'Inboard scrapeoff length (m)') - case ('scraplo') - call parse_real_variable('scraplo', scraplo, 0.0D0, 10.0D0, & + case ('scraplo') + call parse_real_variable('scraplo', scraplo, 0.0D0, 10.0D0, & 'Outboard scrapeoff length (m)') - case ('shldith') - call parse_real_variable('shldith', shldith, 0.0D0, 10.0D0, & + case ('shldith') + call parse_real_variable('shldith', shldith, 0.0D0, 10.0D0, & 'Inboard shield thickness (m)') - case ('shldlth') - call parse_real_variable('shldlth', shldlth, 0.0D0, 10.0D0, & + case ('shldlth') + call parse_real_variable('shldlth', shldlth, 0.0D0, 10.0D0, & 'Lower (divertor) shield thickness (m)') - case ('shldoth') - call parse_real_variable('shldoth', shldoth, 0.0D0, 10.0D0, & + case ('shldoth') + call parse_real_variable('shldoth', shldoth, 0.0D0, 10.0D0, & 'Outboard shield thickness (m)') - case ('shldtth') - call parse_real_variable('shldtth', shldtth, 0.0D0, 10.0D0, & + case ('shldtth') + call parse_real_variable('shldtth', shldtth, 0.0D0, 10.0D0, & 'Top shield thickness (m)') - case ('sigallpc') - call parse_real_variable('sigallpc', sigallpc, 0.0D1, 1.0D9, & + case ('sigallpc') + call parse_real_variable('sigallpc', sigallpc, 0.0D1, 1.0D9, & 'Allowable stress in CS pre-comp structure (Pa)') - ! Issue #514 Make tfcth an output not an input or iteration variable: - ! Eventually this input will be removed. - case ('tfcth') - call parse_real_variable('tfcth', tfcth, 0.0D0, 10.0D0, & + ! Issue #514 Make tfcth an output not an input or iteration variable: + ! Eventually this input will be removed. + case ('tfcth') + call parse_real_variable('tfcth', tfcth, 0.0D0, 10.0D0, & 'TF coil thickness (m)') - case ('dr_tf_wp') - call parse_real_variable('dr_tf_wp', dr_tf_wp, 0.0D0, 10.0D0, & + case ('dr_tf_wp') + call parse_real_variable('dr_tf_wp', dr_tf_wp, 0.0D0, 10.0D0, & 'TF coil winding pack radial thickness (m)') - case ('tfootfi') - call parse_real_variable('tfootfi', tfootfi, 0.2D0, 5.0D0, & + case ('tfootfi') + call parse_real_variable('tfootfi', tfootfi, 0.2D0, 5.0D0, & 'TFC outboard/inboard leg thickness') - case ('tftsgap') - call parse_real_variable('tftsgap', tftsgap, 0.0D0, 5.0D0, & + case ('tftsgap') + call parse_real_variable('tftsgap', tftsgap, 0.0D0, 5.0D0, & 'Minimum gap between TF and thermal shield for manufacturing etc. (m)') - case ('thshield_ib') - call parse_real_variable('thshield_ib', thshield_ib, 0.0D0, 10.0D0, & + case ('thshield_ib') + call parse_real_variable('thshield_ib', thshield_ib, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, inboard (m)') - case ('thshield_ob') - call parse_real_variable('thshield_ob', thshield_ob, 0.0D0, 10.0D0, & + case ('thshield_ob') + call parse_real_variable('thshield_ob', thshield_ob, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, outboard (m)') - case ('thshield_vb') - call parse_real_variable('thshield_vb', thshield_vb, 0.0D0, 10.0D0, & + case ('thshield_vb') + call parse_real_variable('thshield_vb', thshield_vb, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, vertical build (m)') - case ('vgap') - call parse_real_variable('vgap', vgap, 0.0D0, 10.0D0, & + case ('vgap') + call parse_real_variable('vgap', vgap, 0.0D0, 10.0D0, & 'Vert gap between x-pnt and divertor (m)') - case ('vgap2') - call parse_real_variable('vgap2', vgap2, 0.0D0, 10.0D0, & + case ('vgap2') + call parse_real_variable('vgap2', vgap2, 0.0D0, 10.0D0, & 'Vert gap between TF coil and shield (m)') - case ('vgaptop') - call parse_real_variable('vgaptop', vgaptop, 0.0D0, 10.0D0, & + case ('vgaptop') + call parse_real_variable('vgaptop', vgaptop, 0.0D0, 10.0D0, & 'Top vert gap between plasma and first wall (m)') - case ('vvblgap') - call parse_real_variable('vvblgap', vvblgap, 0.0D0, 5.0D0, & + case ('vvblgap') + call parse_real_variable('vvblgap', vvblgap, 0.0D0, 5.0D0, & 'Gap between vacuum vessel and blanket (m)') - ! TF coil settings + ! TF coil settings - case ('bcritsc') - call parse_real_variable('bcritsc', bcritsc, 10.0D0, 50.0D0, & + case ('bcritsc') + call parse_real_variable('bcritsc', bcritsc, 10.0D0, 50.0D0, & 'Critical field for superconductor') - case ('tape_width') - call parse_real_variable('tape_width', tape_width, 0.0D0, 0.1D0, & + case ('tape_width') + call parse_real_variable('tape_width', tape_width, 0.0D0, 0.1D0, & 'Mean width of HTS tape (m)') - case ('tape_thickness') - call parse_real_variable('tape_thickness', tape_thickness, 0.0D0, 0.1D0, & + case ('tape_thickness') + call parse_real_variable('tape_thickness', tape_thickness, 0.0D0, 0.1D0, & 'Thickness of HTS tape (m)') - case ('rebco_thickness') - call parse_real_variable('rebco_thickness', rebco_thickness, 0.01D-6, 100.0D-6, & + case ('rebco_thickness') + call parse_real_variable('rebco_thickness', rebco_thickness, 0.01D-6, 100.0D-6, & 'Thickness of REBCO layer in HTS tape (m)') - if (rebco_thickness > 1.0D-6) then - ! Warning includes concerns raised on Issue #1494 - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'WARNING: the relationship between REBCO layer thickness and current density is not linear.' - write(outfile,*) 'REBCO layer thicknesses > 1um should be considered an aggressive extrapolation of' - write(outfile,*) 'current HTS technology and any results must be considered speculative.' - write(outfile,*) '**********' - write(outfile,*) ' ' - end if - case ('hastelloy_thickness') - call parse_real_variable('hastelloy_thickness', hastelloy_thickness, 0.01D-6, 1000.0D-6, & + if (rebco_thickness > 1.0D-6) then + ! Warning includes concerns raised on Issue #1494 + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'WARNING: the relationship between REBCO layer thickness and current density is not linear.' + write(outfile,*) 'REBCO layer thicknesses > 1um should be considered an aggressive extrapolation of' + write(outfile,*) 'current HTS technology and any results must be considered speculative.' + write(outfile,*) '**********' + write(outfile,*) ' ' + end if + case ('hastelloy_thickness') + call parse_real_variable('hastelloy_thickness', hastelloy_thickness, 0.01D-6, 1000.0D-6, & 'Thickness of Hastelloy layer in HTS tape (m)') - ! case ('croco_id') - ! call parse_real_variable('croco_id', croco_id, 0.0D0, 0.1D0, & - ! 'croco_id') - ! case ('croco_od') - ! call parse_real_variable('croco_od', croco_od, 0.0D0, 0.1D0, & - ! 'Outer diameter of CroCo strand (m)') - case ('croco_thick') - call parse_real_variable('croco_thick', croco_thick, 0.001D0, 0.1D0, & + ! case ('croco_id') + ! call parse_real_variable('croco_id', croco_id, 0.0D0, 0.1D0, & + ! 'croco_id') + ! case ('croco_od') + ! call parse_real_variable('croco_od', croco_od, 0.0D0, 0.1D0, & + ! 'Outer diameter of CroCo strand (m)') + case ('croco_thick') + call parse_real_variable('croco_thick', croco_thick, 0.001D0, 0.1D0, & 'Thickness of CroCo copper tube (m)') - case ('copper_thick') - call parse_real_variable('copper_thick', copper_thick, 0.0D0, 1000.0D-6, & + case ('copper_thick') + call parse_real_variable('copper_thick', copper_thick, 0.0D0, 1000.0D-6, & 'copper_thick (m)') - ! case ('copper_bar') - ! call parse_real_variable('copper_bar', copper_bar, 0.0D0, 0.9D0, & - ! 'area of central copper bar, as a fraction of area inside the jacket') - case ('copper_rrr') - call parse_real_variable('copper_rrr', copper_rrr, 1.0D0, 1.0D4, & + ! case ('copper_bar') + ! call parse_real_variable('copper_bar', copper_bar, 0.0D0, 0.9D0, & + ! 'area of central copper bar, as a fraction of area inside the jacket') + case ('copper_rrr') + call parse_real_variable('copper_rrr', copper_rrr, 1.0D0, 1.0D4, & 'residual resistivity ratio copper in TF superconducting cable') - case ('coppera_m2_max') - call parse_real_variable('coppera_m2_max', copperA_m2_max, 1.0D6, 1.0D10, & + case ('coppera_m2_max') + call parse_real_variable('coppera_m2_max', copperA_m2_max, 1.0D6, 1.0D10, & 'Maximum TF coil current / copper area (A/m2)') - case ('f_coppera_m2') - call parse_real_variable('f_coppera_m2', f_coppera_m2, 1.0D-3, 1.0D1, & + case ('f_coppera_m2') + call parse_real_variable('f_coppera_m2', f_coppera_m2, 1.0D-3, 1.0D1, & 'f-value for constraint 75: TF coil current / copper area < copperA_m2_max') - case ('casthi') - call parse_real_variable('casthi', casthi, 0.0D0, 1.0D0, & + case ('casthi') + call parse_real_variable('casthi', casthi, 0.0D0, 1.0D0, & 'TF coil case inner thickness (m)') - ! OR - case ('casthi_fraction') - call parse_real_variable('casthi_fraction', casthi_fraction, 0.0D0, 1.0D0, & + ! OR + case ('casthi_fraction') + call parse_real_variable('casthi_fraction', casthi_fraction, 0.0D0, 1.0D0, & 'inboard TF coil case plasma side thickness as a fraction of tfcth') - ! Use EITHER - case ('casths') - call parse_real_variable('casths', casths, 0.0D0, 1.0D0, & + ! Use EITHER + case ('casths') + call parse_real_variable('casths', casths, 0.0D0, 1.0D0, & 'TF coil case sidewall thickness (m)') - ! OR - case ('casths_fraction') - call parse_real_variable('casths_fraction', casths_fraction, 0.0D0, 1.0D0, & + ! OR + case ('casths_fraction') + call parse_real_variable('casths_fraction', casths_fraction, 0.0D0, 1.0D0, & 'inboard TF coil sidewall case thickness as a fraction of tftort') - case ('cpttf') - call parse_real_variable('cpttf', cpttf, 0.001D0, 1.0D6, & + case ('cpttf') + call parse_real_variable('cpttf', cpttf, 0.001D0, 1.0D6, & 'TF coil leg current per turn (A)') - case ('cpttf_max') - call parse_real_variable('cpttf_max', cpttf_max, 1.0D0, 1.0D6, & - 'Maximum allowable TF coil leg current per turn (A) (constraint equation 77)') + case ('cpttf_max') + call parse_real_variable('cpttf_max', cpttf_max, 1.0D0, 1.0D6, & + 'Maximum allowable TF coil leg current per turn (A) (constraint equation 77)') - case ('sig_tf_case_max') - call parse_real_variable('sig_tf_case_max', sig_tf_case_max, 1.0D6, 1.0D11, & + case ('sig_tf_case_max') + call parse_real_variable('sig_tf_case_max', sig_tf_case_max, 1.0D6, 1.0D11, & 'Allowable maximum shear stress in TF coil case (Tresca criterion) (Pa)') - case ('sig_tf_wp_max') - call parse_real_variable('sig_tf_wp_max', sig_tf_wp_max, 1.0D6, 1.0D11, & + case ('sig_tf_wp_max') + call parse_real_variable('sig_tf_wp_max', sig_tf_wp_max, 1.0D6, 1.0D11, & 'Allowable maximum shear stress in TF coil conduit (Tresca criterion) (Pa)') - case ('alstroh') - call parse_real_variable('alstroh', alstroh, 1.0D6, 1.0D11, & + case ('alstroh') + call parse_real_variable('alstroh', alstroh, 1.0D6, 1.0D11, & 'Allowable hoop stress in Central Solenoid structural material (Pa)') - case ('i_cs_stress') - call parse_int_variable('i_cs_stress', i_cs_stress, 0, 1, & + case ('i_cs_stress') + call parse_int_variable('i_cs_stress', i_cs_stress, 0, 1, & 'Switch for CS stress calculation') - case ('dcase') - call parse_real_variable('dcase', dcase, 1.0D3, 1.0D5, & + case ('dcase') + call parse_real_variable('dcase', dcase, 1.0D3, 1.0D5, & 'Density of TF coil case (kg/m3)') - case ('dcond') - call parse_real_array('dcond', dcond, isub1, 9, & + case ('dcond') + call parse_real_array('dcond', dcond, isub1, 9, & 'TF/PF coil superconductor density (kg/m3)', icode) - case ('dcondins') - call parse_real_variable('dcondins', dcondins, 5.0D2, 1.0D4, & + case ('dcondins') + call parse_real_variable('dcondins', dcondins, 5.0D2, 1.0D4, & 'Density of TF coil insulation (kg/m3)') - case ('dcopper') - call parse_real_variable('dcopper', dcopper, 8.0D3, 1.0D4, & + case ('dcopper') + call parse_real_variable('dcopper', dcopper, 8.0D3, 1.0D4, & 'Density of copper (kg/m3)') - case ('dalu') - call parse_real_variable('dalu', dalu, 2.5D3, 3.0D4, & + case ('dalu') + call parse_real_variable('dalu', dalu, 2.5D3, 3.0D4, & 'Density of Alumium (kg/m3)') - case ('dhecoil') - call parse_real_variable('dhecoil', dhecoil, 0.0d0, 0.1d0, & + case ('dhecoil') + call parse_real_variable('dhecoil', dhecoil, 0.0d0, 0.1d0, & 'Diameter of He coil in TF winding (m)') - case ('drtop') - call parse_real_variable('drtop', drtop, -1.5D0, 1.5D0, & + case ('drtop') + call parse_real_variable('drtop', drtop, -1.5D0, 1.5D0, & 'ST CP top radius adjust (m)') - case ('dztop') - call parse_real_variable('dztop', dztop, -0.5D0, 0.5D0, & + case ('dztop') + call parse_real_variable('dztop', dztop, -0.5D0, 0.5D0, & 'ST CP taper height adjust (m)') - case ('etapump') - call parse_real_variable('etapump', etapump, 0.0D0, 1.0D0, & + case ('etapump') + call parse_real_variable('etapump', etapump, 0.0D0, 1.0D0, & 'Efficiency of c/p coolant pump') - case ('eyoung_steel') - call parse_real_variable('eyoung_steel', eyoung_steel, 1.0D8, 1.0D13, & + case ('eyoung_steel') + call parse_real_variable('eyoung_steel', eyoung_steel, 1.0D8, 1.0D13, & 'Steel case Youngs Modulus (Pa)') - case ('eyoung_ins') - call parse_real_variable('eyoung_ins', eyoung_ins, 1.0D8, 1.0D13, & + case ('eyoung_ins') + call parse_real_variable('eyoung_ins', eyoung_ins, 1.0D8, 1.0D13, & 'Insulator Youngs Modulus (Pa)') - case ('eyoung_cond_axial') - call parse_real_variable('eyoung_cond_axial', eyoung_cond_axial, 0.0D0, 1.0D13, & + case ('eyoung_cond_axial') + call parse_real_variable('eyoung_cond_axial', eyoung_cond_axial, 0.0D0, 1.0D13, & 'SC TF coil Youngs Modulus, axial (Pa)') - case ('eyoung_cond_trans') - call parse_real_variable('eyoung_cond_trans', eyoung_cond_trans, 0.0D0, 1.0D13, & + case ('eyoung_cond_trans') + call parse_real_variable('eyoung_cond_trans', eyoung_cond_trans, 0.0D0, 1.0D13, & 'SC TF coil Youngs Modulus, transverse (Pa)') - case ('eyoung_al') - call parse_real_variable('eyoung_al', eyoung_al, 0.0D0, 1.0D0, & + case ('eyoung_al') + call parse_real_variable('eyoung_al', eyoung_al, 0.0D0, 1.0D0, & 'Reinforced aluminium Young modulus for TF stress calc.') - case ('eyoung_res_tf_buck') - call parse_real_variable('eyoung_res_tf_buck', eyoung_res_tf_buck, 1.0D-10, 1.0D12, & + case ('eyoung_res_tf_buck') + call parse_real_variable('eyoung_res_tf_buck', eyoung_res_tf_buck, 1.0D-10, 1.0D12, & 'Reinforced aluminium Young modulus for TF stress calc.') - case ('farc4tf') - call parse_real_variable('farc4tf', farc4tf, 0.0D0, 1.0D0, & + case ('farc4tf') + call parse_real_variable('farc4tf', farc4tf, 0.0D0, 1.0D0, & 'TF coil shape parameter') - case ('t_crit_nbti') - call parse_real_variable('t_crit_nbti ', t_crit_nbti , 0.0D0, 15.0D0, & + case ('t_crit_nbti') + call parse_real_variable('t_crit_nbti ', t_crit_nbti , 0.0D0, 15.0D0, & 'Critical temperature of GL_nbti ') - case ('b_crit_upper_nbti') - call parse_real_variable('b_crit_upper_nbti', b_crit_upper_nbti, 0.0D0, 30.0D0, & - 'Upper critical field of GL_nbti ') - case ('fcoolcp') - call parse_real_variable('fcoolcp', fcoolcp, 0.0D0, 1.0D0, & + case ('b_crit_upper_nbti') + call parse_real_variable('b_crit_upper_nbti', b_crit_upper_nbti, 0.0D0, 30.0D0, & + 'Upper critical field of GL_nbti ') + case ('fcoolcp') + call parse_real_variable('fcoolcp', fcoolcp, 0.0D0, 1.0D0, & 'Coolant fraction of TF centrepost (itart=1) or the whole magnet (itart=0)') - case ('fcoolleg') - call parse_real_variable('fcoolleg', fcoolleg, 0.0D0, 1.0D0, & + case ('fcoolleg') + call parse_real_variable('fcoolleg', fcoolleg, 0.0D0, 1.0D0, & 'Coolant fraction of TF outboard leg (itart=1 only)') - case ('fcutfsu') - call parse_real_variable('fcutfsu', fcutfsu, 0.0D0, 1.0D0, & + case ('fcutfsu') + call parse_real_variable('fcutfsu', fcutfsu, 0.0D0, 1.0D0, & 'Cu fraction of SCTF cable conductor') - case ('fhts') - call parse_real_variable('fhts', fhts, 0.01D0, 1.0D0, & + case ('fhts') + call parse_real_variable('fhts', fhts, 0.01D0, 1.0D0, & 'Technology adjustment factor for Bi-2212 HTS') - case ('frhocp') - call parse_real_variable('frhocp', frhocp, 0.01D0, 5.0D0, & + case ('frhocp') + call parse_real_variable('frhocp', frhocp, 0.01D0, 5.0D0, & 'Centrepost (itart=1) or global (itart=0) resistivity enhancement factor') - case ('frholeg') - call parse_real_variable('frholeg', frholeg, 0.01D0, 5.0D0, & + case ('frholeg') + call parse_real_variable('frholeg', frholeg, 0.01D0, 5.0D0, & 'TART outboard leg resistivity enhancement factor') - case ('rho_tf_joints') - call parse_real_variable('rho_tf_joints', rho_tf_joints, 0.0D0, 1.0D-2, & + case ('rho_tf_joints') + call parse_real_variable('rho_tf_joints', rho_tf_joints, 0.0D0, 1.0D-2, & 'TF joints surfacic resistivity') - case ('i_cp_joints') - call parse_int_variable('i_cp_joints', i_cp_joints, 0, 1, & + case ('i_cp_joints') + call parse_int_variable('i_cp_joints', i_cp_joints, 0, 1, & 'Switch for CP demoutable joints type') - case ('th_joint_contact') - call parse_real_variable('th_joint_contact', th_joint_contact, 0.0D0, 1.0D0, & + case ('th_joint_contact') + call parse_real_variable('th_joint_contact', th_joint_contact, 0.0D0, 1.0D0, & 'TF sliding joints contact pad width') - case ('n_tf_joints_contact') - call parse_int_variable('n_tf_joints_contact', n_tf_joints_contact, 1, 50, & + case ('n_tf_joints_contact') + call parse_int_variable('n_tf_joints_contact', n_tf_joints_contact, 1, 50, & 'Number of contact per sliding joint') - case ('n_tf_joints') - call parse_int_variable('n_tf_joints', n_tf_joints, 1, 50, & + case ('n_tf_joints') + call parse_int_variable('n_tf_joints', n_tf_joints, 1, 50, & 'Number of joints per turn') - case ('eff_tf_cryo') - call parse_real_variable('eff_tf_cryo', eff_tf_cryo, 0.0D0, 1.0D0, & + case ('eff_tf_cryo') + call parse_real_variable('eff_tf_cryo', eff_tf_cryo, 0.0D0, 1.0D0, & 'TF coil cryo-plane efficiency') - case ('i_tf_stress_model') - call parse_int_variable('i_tf_stress_model', i_tf_stress_model, 0, 2, & + case ('i_tf_stress_model') + call parse_int_variable('i_tf_stress_model', i_tf_stress_model, 0, 2, & 'Switch for the TF stress model') - case ('i_tf_tresca') - call parse_int_variable('i_tf_tresca', i_tf_tresca, 0, 1, & - 'Switch for TF coil Tresca criterion') - case ('i_tf_wp_geom') - call parse_int_variable('i_tf_wp_geom', i_tf_wp_geom, 0, 2, & - 'Switch for TF WP geometry selection') - case ('i_tf_case_geom') - call parse_int_variable('i_tf_case_geom', i_tf_case_geom, 0, 1, & - 'Switch for TF case geometry selection') - case ('i_tf_turns_integer') - call parse_int_variable('i_tf_turns_integer', i_tf_turns_integer, 0, 1, & - 'Switch for TF coil integer/non-integer turns') - case ('i_tf_bucking') - call parse_int_variable('i_tf_bucking', i_tf_bucking, 0, 3, & + case ('i_tf_tresca') + call parse_int_variable('i_tf_tresca', i_tf_tresca, 0, 1, & + 'Switch for TF coil Tresca criterion') + case ('i_tf_wp_geom') + call parse_int_variable('i_tf_wp_geom', i_tf_wp_geom, 0, 2, & + 'Switch for TF WP geometry selection') + case ('i_tf_case_geom') + call parse_int_variable('i_tf_case_geom', i_tf_case_geom, 0, 1, & + 'Switch for TF case geometry selection') + case ('i_tf_turns_integer') + call parse_int_variable('i_tf_turns_integer', i_tf_turns_integer, 0, 1, & + 'Switch for TF coil integer/non-integer turns') + case ('i_tf_bucking') + call parse_int_variable('i_tf_bucking', i_tf_bucking, 0, 3, & 'Switch for bucking cylinder (case)') - case ('i_tf_sc_mat') - call parse_int_variable('i_tf_sc_mat', i_tf_sc_mat, 1, 9, & + case ('i_tf_sc_mat') + call parse_int_variable('i_tf_sc_mat', i_tf_sc_mat, 1, 9, & 'TF coil superconductor material') - if (i_tf_sc_mat == 2) then - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'Warning if you are using an old input file:' - write(outfile,*) 'i_tf_sc_mat=2 usage has changed -' - write(outfile,*) 'please check validity!' - write(outfile,*) '**********' - write(outfile,*) ' ' - end if - case ('itfmod') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ITFMOD is now obsolete -' - write(outfile,*) 'please remove it from the input file' - ! write(outfile,*) 'and replace it with TFC_MODEL' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('i_tf_sup') - call parse_int_variable('i_tf_sup', i_tf_sup, 0, 2, & + if (i_tf_sc_mat == 2) then + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'Warning if you are using an old input file:' + write(outfile,*) 'i_tf_sc_mat=2 usage has changed -' + write(outfile,*) 'please check validity!' + write(outfile,*) '**********' + write(outfile,*) ' ' + end if + case ('itfmod') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ITFMOD is now obsolete -' + write(outfile,*) 'please remove it from the input file' + ! write(outfile,*) 'and replace it with TFC_MODEL' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('i_tf_sup') + call parse_int_variable('i_tf_sup', i_tf_sup, 0, 2, & 'Switch for TF coil type') - case ('i_tf_shape') - call parse_int_variable('i_tf_shape', i_tf_shape, 0, 2, & - 'Switch for TF coil shape') - case ('i_tf_cond_eyoung_axial') - call parse_int_variable('i_tf_cond_eyoung_axial', i_tf_cond_eyoung_axial, 0, 2, & - 'Switch for the behavior of the TF coil conductor elastic axial properties') - case ('i_tf_cond_eyoung_trans') - call parse_int_variable('i_tf_cond_eyoung_trans', i_tf_cond_eyoung_trans, 0, 1, & - 'Switch for the TF coil conductor transverse behavior') - case ('i_str_wp') - call parse_int_variable('i_str_wp', i_str_wp, 0, 1, & - 'Switch for the TF coil strain behavior') - case ('jbus') - call parse_real_variable('jbus', jbus, 1.0D4, 1.0D8, & + case ('i_tf_shape') + call parse_int_variable('i_tf_shape', i_tf_shape, 0, 2, & + 'Switch for TF coil shape') + case ('i_tf_cond_eyoung_axial') + call parse_int_variable('i_tf_cond_eyoung_axial', i_tf_cond_eyoung_axial, 0, 2, & + 'Switch for the behavior of the TF coil conductor elastic axial properties') + case ('i_tf_cond_eyoung_trans') + call parse_int_variable('i_tf_cond_eyoung_trans', i_tf_cond_eyoung_trans, 0, 1, & + 'Switch for the TF coil conductor transverse behavior') + case ('i_str_wp') + call parse_int_variable('i_str_wp', i_str_wp, 0, 1, & + 'Switch for the TF coil strain behavior') + case ('jbus') + call parse_real_variable('jbus', jbus, 1.0D4, 1.0D8, & 'TF coil bus current density (A/m2)') - case ('jcrit_model') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'JCRIT_MODEL is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('jcritsc') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'JCRITSC is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('n_pancake') - call parse_int_variable('n_pancake', n_pancake, 1, 100, & + case ('jcrit_model') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'JCRIT_MODEL is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('jcritsc') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'JCRITSC is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('n_pancake') + call parse_int_variable('n_pancake', n_pancake, 1, 100, & 'Number of pancakes in TF coil (i_tf_turns_integer=1)') - case ('n_layer') - call parse_int_variable('n_layer', n_layer, 1, 100, & + case ('n_layer') + call parse_int_variable('n_layer', n_layer, 1, 100, & 'Number of layers in TF coil (i_tf_turns_integer=1)') - case ('n_tf_graded_layers') - call parse_int_variable('n_tf_graded_layers', n_tf_graded_layers, 1, 20, & + case ('n_tf_graded_layers') + call parse_int_variable('n_tf_graded_layers', n_tf_graded_layers, 1, 20, & 'Number of layers of different stress properties in the WP') - case ('n_rad_per_layer') - call parse_int_variable('n_rad_per_layer', n_rad_per_layer, 1, 500, & + case ('n_rad_per_layer') + call parse_int_variable('n_rad_per_layer', n_rad_per_layer, 1, 500, & 'Size of the arrays per layers storing the radial dependent stress ') - case ('oacdcp') - call parse_real_variable('oacdcp', oacdcp, 1.0D4, 1.0D9, & + case ('oacdcp') + call parse_real_variable('oacdcp', oacdcp, 1.0D4, 1.0D9, & 'Overall J in inboard TF coil midplane') - case ('poisson_steel') - call parse_real_variable('poisson_steel', poisson_steel, 0.0D0, 1.0D0, & + case ('poisson_steel') + call parse_real_variable('poisson_steel', poisson_steel, 0.0D0, 1.0D0, & 'Steel Poissons ratio for TF stress calc.') - case ('poisson_copper') - call parse_real_variable('poisson_copper', poisson_copper, 0.0D0, 1.0D0, & + case ('poisson_copper') + call parse_real_variable('poisson_copper', poisson_copper, 0.0D0, 1.0D0, & 'Steel Poissons ratio for TF stress calc.') - case ('poisson_al') - call parse_real_variable('poisson_al', poisson_al, 0.0D0, 1.0D0, & + case ('poisson_al') + call parse_real_variable('poisson_al', poisson_al, 0.0D0, 1.0D0, & 'Aluminium Poissons ratio for TF stress calc.') - case ('ptempalw') - call parse_real_variable('ptempalw', ptempalw, 4.0D0, 573.15D0, & + case ('ptempalw') + call parse_real_variable('ptempalw', ptempalw, 4.0D0, 573.15D0, & 'Maximum peak centrepost temp. (K)') - case ('rcool') - call parse_real_variable('rcool', rcool, 1.0D-6, 1.0D0, & + case ('rcool') + call parse_real_variable('rcool', rcool, 1.0D-6, 1.0D0, & 'Centrepost coolant channel radius') - case ('ripmax') - call parse_real_variable('ripmax', ripmax, 0.1D0, 100.0D0, & + case ('ripmax') + call parse_real_variable('ripmax', ripmax, 0.1D0, 100.0D0, & 'Max allowed ripple ampl. at plasma edge (%)') - case ('sigvvall') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'sigvvall is now obsolete - (use max_vv_stress)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('theta1_coil') - call parse_real_variable('theta1_coil', theta1_coil, 1.0D-1, 6.0D1, & + case ('sigvvall') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'sigvvall is now obsolete - (use max_vv_stress)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('theta1_coil') + call parse_real_variable('theta1_coil', theta1_coil, 1.0D-1, 6.0D1, & 'The angle of the outboard arc forming the TF coil current center line (deg)') - case ('theta1_vv') - call parse_real_variable('theta1_vv', theta1_vv, 1.0D-1, 6.0D1, & + case ('theta1_vv') + call parse_real_variable('theta1_vv', theta1_vv, 1.0D-1, 6.0D1, & 'The angle of the outboard arc forming the VV current center line (deg)') - case ('max_vv_stress') - call parse_real_variable('max_vv_stress', max_vv_stress, 0.1D6, 500.0D6, & + case ('max_vv_stress') + call parse_real_variable('max_vv_stress', max_vv_stress, 0.1D6, 500.0D6, & 'The maximum shear stress that the Vacuum Vessel should experience (Pa)') - case ('str_cs_con_res') - call parse_real_variable('str_cs_con_res', str_cs_con_res, -0.02D0, 0.02D0, & + case ('str_cs_con_res') + call parse_real_variable('str_cs_con_res', str_cs_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in CS superconductor material') - case ('str_pf_con_res') - call parse_real_variable('str_pf_con_res', str_pf_con_res, -0.02D0, 0.02D0, & + case ('str_pf_con_res') + call parse_real_variable('str_pf_con_res', str_pf_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in PF superconductor material') - case ('str_tf_con_res') - call parse_real_variable('str_tf_con_res', str_tf_con_res, -0.02D0, 0.02D0, & + case ('str_tf_con_res') + call parse_real_variable('str_tf_con_res', str_tf_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in TF superconductor material') - case ('str_wp_max') - call parse_real_variable('str_wp_max', str_wp_max, 0.0D0, 0.3D0, & + case ('str_wp_max') + call parse_real_variable('str_wp_max', str_wp_max, 0.0D0, 0.3D0, & 'Maximum allowed absolute value of the strain in the TF coil') - case ('tcoolin') - call parse_real_variable('tcoolin', tcoolin, 4.0D0, 373.15D0, & + case ('tcoolin') + call parse_real_variable('tcoolin', tcoolin, 4.0D0, 373.15D0, & 'Centrepost coolant inlet temperature (K)') - case ('tcpav') - call parse_real_variable('tcpav', tcpav, 4.0D0, 573.15D0, & + case ('tcpav') + call parse_real_variable('tcpav', tcpav, 4.0D0, 573.15D0, & 'Average centrepost coolant temperature (K)') - case ('tcritsc') - call parse_real_variable('tcritsc', tcritsc, 1.0D0, 300.0D0, & + case ('tcritsc') + call parse_real_variable('tcritsc', tcritsc, 1.0D0, 300.0D0, & 'Critical temperature for superconductor') - case ('tdmptf') - call parse_real_variable('tdmptf', tdmptf, 0.1D0, 100.0D0, & + case ('tdmptf') + call parse_real_variable('tdmptf', tdmptf, 0.1D0, 100.0D0, & 'Dump time for TF coil (s)') - ! case ('tfc_model') - ! call parse_int_variable('tfc_model', tfc_model, 0, 1, & - ! 'Switch for TF coil model') - case ('tfinsgap') - call parse_real_variable('tfinsgap', tfinsgap, 1.0D-10, 1.0D-1, & + ! case ('tfc_model') + ! call parse_int_variable('tfc_model', tfc_model, 0, 1, & + ! 'Switch for TF coil model') + case ('tfinsgap') + call parse_real_variable('tfinsgap', tfinsgap, 1.0D-10, 1.0D-1, & 'TF coil WP insertion gap (m)') - case ('rhotfbus') - call parse_real_variable('rhotfbus', rhotfbus, 0.0D0, 1.0D-5, & + case ('rhotfbus') + call parse_real_variable('rhotfbus', rhotfbus, 0.0D0, 1.0D-5, & 'TF coil bus (feeders) resistivity (ohm-m)') - case ('n_tf') - call parse_real_variable('n_tf', n_tf, 0.0D0, 100.0D0, & + case ('n_tf') + call parse_real_variable('n_tf', n_tf, 0.0D0, 100.0D0, & 'Number of TF coils') - case ('n_tf_turn') - call parse_real_variable('n_tf_turn', n_tf_turn, 0.0D0, 100.0D0, & + case ('n_tf_turn') + call parse_real_variable('n_tf_turn', n_tf_turn, 0.0D0, 100.0D0, & 'number of turns per TF coil') - case ('tftmp') - call parse_real_variable('tftmp', tftmp, 0.01D0, 293.0D0, & + case ('tftmp') + call parse_real_variable('tftmp', tftmp, 0.01D0, 293.0D0, & 'Peak TF coil He coolant temp. (K)') - case ('t_turn_tf') - call parse_real_variable('t_turn_tf', t_turn_tf, 0.0D0, 0.1D0, & + case ('t_turn_tf') + call parse_real_variable('t_turn_tf', t_turn_tf, 0.0D0, 0.1D0, & 'TF turn square dimensions (m)') - case ('f_t_turn_tf') - call parse_real_variable('f_t_turn_tf', f_t_turn_tf, 0.0D0, 1.D0, & - 'f-value for TF coils WP trurn squared dimension constraint') - case ('t_turn_tf_max') - call parse_real_variable('t_turn_tf_max', t_turn_tf_max, 0.0D0, 1.D0, & - 'TF coils WP turn squared dimension upper limit (m)') - case ('t_cable_tf') - call parse_real_variable('t_cable_tf', t_cable_tf, 0.0D0, 0.1D0, & + case ('f_t_turn_tf') + call parse_real_variable('f_t_turn_tf', f_t_turn_tf, 0.0D0, 1.D0, & + 'f-value for TF coils WP trurn squared dimension constraint') + case ('t_turn_tf_max') + call parse_real_variable('t_turn_tf_max', t_turn_tf_max, 0.0D0, 1.D0, & + 'TF coils WP turn squared dimension upper limit (m)') + case ('t_cable_tf') + call parse_real_variable('t_cable_tf', t_cable_tf, 0.0D0, 0.1D0, & 'TF coil cable square/rounded dimensions (m)') - case ('thicndut') - call parse_real_variable('thicndut', thicndut, 0.0D0, 0.1D0, & + case ('thicndut') + call parse_real_variable('thicndut', thicndut, 0.0D0, 0.1D0, & 'Conduit insulation thickness (m)') - case ('layer_ins') - call parse_real_variable('layer_ins', layer_ins, 0.0D0, 0.1D0, & + case ('layer_ins') + call parse_real_variable('layer_ins', layer_ins, 0.0D0, 0.1D0, & 'Additional insulation thickness between layers (m)') - case ('thkcas') - call parse_real_variable('thkcas', thkcas, 0.0D0, 1.0D0, & + case ('thkcas') + call parse_real_variable('thkcas', thkcas, 0.0D0, 1.0D0, & 'External supercond. case thickness (m)') - case ('thwcndut') - call parse_real_variable('thwcndut', thwcndut, 0.0D0, 0.1D0, & + case ('thwcndut') + call parse_real_variable('thwcndut', thwcndut, 0.0D0, 0.1D0, & 'TF coil conduit case thickness (m)') - case ('tinstf') - call parse_real_variable('tinstf', tinstf, 0.0D0, 0.1D0, & + case ('tinstf') + call parse_real_variable('tinstf', tinstf, 0.0D0, 0.1D0, & 'Ground wall insulation thickness (m)') - case ('tmargmin_tf') - call parse_real_variable('tmargmin_tf', tmargmin_tf, 0.0D0, 20.0D0, & + case ('tmargmin_tf') + call parse_real_variable('tmargmin_tf', tmargmin_tf, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: TF coil (K)') - case ('tmargmin_cs') - call parse_real_variable('tmargmin_cs', tmargmin_cs, 0.0D0, 20.0D0, & + case ('tmargmin_cs') + call parse_real_variable('tmargmin_cs', tmargmin_cs, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: CS (K)') - case ('tmargmin') - call parse_real_variable('tmargmin', tmargmin, 0.0D0, 20.0D0, & + case ('tmargmin') + call parse_real_variable('tmargmin', tmargmin, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: TFC AND CS (K)') - case ('tmaxpro') - call parse_real_variable('tmaxpro', tmaxpro, 0.0D0, 1.0D3, & + case ('tmaxpro') + call parse_real_variable('tmaxpro', tmaxpro, 0.0D0, 1.0D3, & 'Maximum temp rise during quench (K)') - case ('quench_model') - call parse_string_variable('quench_model', quench_model, 'quench_model') - case ('quench_detection_ef') - call parse_real_variable('quench_detection_ef', quench_detection_ef, 0.0D0, 1.0D1, & + case ('quench_model') + call parse_string_variable('quench_model', quench_model, 'quench_model') + case ('quench_detection_ef') + call parse_real_variable('quench_detection_ef', quench_detection_ef, 0.0D0, 1.0D1, & 'Electric field at which TF quench is detected and discharge begins (V/m)') - case ('tmax_croco') - call parse_real_variable('tmax_croco', tmax_croco, 4.0D0, 1.0D3, & + case ('tmax_croco') + call parse_real_variable('tmax_croco', tmax_croco, 4.0D0, 1.0D3, & 'CroCo strand: maximum temp during a quench (K)') - ! case ('tmax_jacket') - ! call parse_real_variable('tmax_jacket', tmax_jacket, 4.0D0, 1.0D3, & - ! 'Jacket: maximum temp during a quench (K)') - case ('tmpcry') - call parse_real_variable('tmpcry', tmpcry, 0.01D0, 293.0D0, & + ! case ('tmax_jacket') + ! call parse_real_variable('tmax_jacket', tmax_jacket, 4.0D0, 1.0D3, & + ! 'Jacket: maximum temp during a quench (K)') + case ('tmpcry') + call parse_real_variable('tmpcry', tmpcry, 0.01D0, 293.0D0, & 'Cryogenic temperature (K)') - case ('vcool') - call parse_real_variable('vcool', vcool, 0.001D0, 100.0D0, & + case ('vcool') + call parse_real_variable('vcool', vcool, 0.001D0, 100.0D0, & 'Inlet centrepost coolant speed (m/s)') - case ('vdalw') - call parse_real_variable('vdalw', vdalw, 0.0D0, 100.0D0, & + case ('vdalw') + call parse_real_variable('vdalw', vdalw, 0.0D0, 100.0D0, & 'Max V across TFC during quench (kV)') - case ('f_vforce_inboard') - call parse_real_variable('f_vforce_inboard', f_vforce_inboard, 0.0D0, 1.0D0, & + case ('f_vforce_inboard') + call parse_real_variable('f_vforce_inboard', f_vforce_inboard, 0.0D0, 1.0D0, & 'Fraction of vertical force taken by the TF inboard leg') - case ('vftf') - call parse_real_variable('vftf', vftf, 0.0D0, 1.0D0, & + case ('vftf') + call parse_real_variable('vftf', vftf, 0.0D0, 1.0D0, & 'Coolant fraction of TF coil leg') - ! PF coil settings + ! PF coil settings - case ('bmaxcs_lim') - call parse_real_variable('bmaxcs_lim', bmaxcs_lim, 0.01D0, 100.0D0, & + case ('bmaxcs_lim') + call parse_real_variable('bmaxcs_lim', bmaxcs_lim, 0.01D0, 100.0D0, & 'Maximum allowed peak field on central solenoid') - case ('fbmaxcs') - call parse_real_variable('fbmaxcs', fbmaxcs, 0.01D0, 1.0D0, & + case ('fbmaxcs') + call parse_real_variable('fbmaxcs', fbmaxcs, 0.01D0, 1.0D0, & 'F-value for max peak CS field (con. 79, itvar 149)') - case ('alfapf') - call parse_real_variable('alfapf', alfapf, 1.0D-12, 1.0D0, & + case ('alfapf') + call parse_real_variable('alfapf', alfapf, 1.0D-12, 1.0D0, & 'PF coil current smoothing parameter') - case ('coheof') - call parse_real_variable('coheof', coheof, 1.0D4, 5.0D8, & + case ('coheof') + call parse_real_variable('coheof', coheof, 1.0D4, 5.0D8, & 'Central Solenoid current density at EOF') - case ('cptdin') - call parse_real_array('cptdin', cptdin, isub1, ngc2, & + case ('cptdin') + call parse_real_array('cptdin', cptdin, isub1, ngc2, & 'Current per turn for PF coil', icode) - case ('etapsu') - call parse_real_variable('etapsu', etapsu, 0.0D0, 1.0D0, & + case ('etapsu') + call parse_real_variable('etapsu', etapsu, 0.0D0, 1.0D0, & 'Efficiency of ohmic heating') - case ('fcohbof') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FCOHBOF is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fcohbop') - call parse_real_variable('fcohbop', fcohbop, 0.0D0, 1.0D0, & + case ('fcohbof') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FCOHBOF is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fcohbop') + call parse_real_variable('fcohbop', fcohbop, 0.0D0, 1.0D0, & 'Central Solenoid J ratio : BOP/EOF') - case ('fcuohsu') - call parse_real_variable('fcuohsu', fcuohsu, 0.0D0, 1.0D0, & + case ('fcuohsu') + call parse_real_variable('fcuohsu', fcuohsu, 0.0D0, 1.0D0, & 'Cu frac of conductor in Central Solenoid cable') - case ('fcupfsu') - call parse_real_variable('fcupfsu', fcupfsu, 0.0D0, 1.0D0, & + case ('fcupfsu') + call parse_real_variable('fcupfsu', fcupfsu, 0.0D0, 1.0D0, & 'Cu fraction of PF cable conductor') - case ('ipfloc') - call parse_int_array('ipfloc', ipfloc, isub1, ngrpmx, & + case ('ipfloc') + call parse_int_array('ipfloc', ipfloc, isub1, ngrpmx, & 'PF coil location', icode) - case ('ipfres') - call parse_int_variable('ipfres', ipfres, 0, 1, & + case ('ipfres') + call parse_int_variable('ipfres', ipfres, 0, 1, & 'Switch for supercond / resist PF coils') - case ('isumatoh') - call parse_int_variable('isumatoh', isumatoh, 1, 9, & + case ('isumatoh') + call parse_int_variable('isumatoh', isumatoh, 1, 9, & 'Central Solenoid superconductor material') - case ('isumatpf') - call parse_int_variable('isumatpf', isumatpf, 1, 9, & + case ('isumatpf') + call parse_int_variable('isumatpf', isumatpf, 1, 9, & 'PF coil superconductor material') - case ('i_pf_current') - call parse_int_variable('i_pf_current', i_pf_current, 0, 2, & + case ('i_pf_current') + call parse_int_variable('i_pf_current', i_pf_current, 0, 2, & 'Switch for controlling the current of the PF coils') - case ('i_sup_pf_shape') - call parse_int_variable('i_sup_pf_shape', i_sup_pf_shape, 0, 1, & + case ('i_sup_pf_shape') + call parse_int_variable('i_sup_pf_shape', i_sup_pf_shape, 0, 1, & 'Switch to place outboard PF coils when TF superconducting') - case ('ncls') - call parse_int_array('ncls', ncls, isub1, ngrpmx+2, & + case ('ncls') + call parse_int_array('ncls', ncls, isub1, ngrpmx+2, & 'No of coils in PF group', icode) - case ('nfxfh') - call parse_int_variable('nfxfh', nfxfh, 1, nfixmx/2, & + case ('nfxfh') + call parse_int_variable('nfxfh', nfxfh, 1, nfixmx/2, & 'Central Solenoid splitting parameter') - case ('ngrp') - call parse_int_variable('ngrp', ngrp, 0, ngrpmx, & + case ('ngrp') + call parse_int_variable('ngrp', ngrp, 0, ngrpmx, & 'No of groups of PF coils') - case ('ohhghf') - call parse_real_variable('ohhghf', ohhghf, 0.0D0, 2.0D0, & + case ('ohhghf') + call parse_real_variable('ohhghf', ohhghf, 0.0D0, 2.0D0, & 'Central Solenoid height / TF coil height') - case ('pfclres') - call parse_real_variable('pfclres', pfclres, 0.0D0, 1.0D-4, & + case ('pfclres') + call parse_real_variable('pfclres', pfclres, 0.0D0, 1.0D-4, & 'PF coil resistivity (ohm-m)') - case ('rjconpf') - call parse_real_array('rjconpf', rjconpf, isub1, ngc2, & + case ('rjconpf') + call parse_real_array('rjconpf', rjconpf, isub1, ngc2, & 'Average J of PF coil (A/m2)', icode) - case ('routr') - call parse_real_variable('routr', routr, -3.0D0, 3.0D0, & + case ('routr') + call parse_real_variable('routr', routr, -3.0D0, 3.0D0, & 'Gap from outboard TFC leg for PFC') - case ('rpf1') - call parse_real_variable('rpf1', rpf1, 0.0D0, 3.0D0, & + case ('rpf1') + call parse_real_variable('rpf1', rpf1, 0.0D0, 3.0D0, & 'Radial offset for location 1 PF coils') - case ('rpf2') - call parse_real_variable('rpf2', rpf2, -3.0D0, 3.0D0, & + case ('rpf2') + call parse_real_variable('rpf2', rpf2, -3.0D0, 3.0D0, & 'Radial offset for location 2 PF coils') - case ('rref') - call parse_real_array('rref', rref, isub1, ngrpmx, & + case ('rref') + call parse_real_array('rref', rref, isub1, ngrpmx, & 'radius of location 4 coil groups, minor radii from major radius', icode) - case ('ccl0_ma') - call parse_real_array('ccl0_ma', ccl0_ma, isub1, ngrpmx, & + case ('ccl0_ma') + call parse_real_array('ccl0_ma', ccl0_ma, isub1, ngrpmx, & 'Flux-swing cancel current of PF coil groups, MA', icode) - case ('ccls_ma') - call parse_real_array('ccls_ma', ccls_ma, isub1, ngrpmx, & + case ('ccls_ma') + call parse_real_array('ccls_ma', ccls_ma, isub1, ngrpmx, & 'Equilibrium current of PF coil groups, MA', icode) - case ('sigpfcalw') - call parse_real_variable('sigpfcalw', sigpfcalw, 1.0D0, 1.0D3, & + case ('sigpfcalw') + call parse_real_variable('sigpfcalw', sigpfcalw, 1.0D0, 1.0D3, & 'Allowable stress in the PF coil case (MPa)') - case ('sigpfcf') - call parse_real_variable('sigpfcf', sigpfcf, 0.1D0, 1.0D0, & + case ('sigpfcf') + call parse_real_variable('sigpfcf', sigpfcf, 0.1D0, 1.0D0, & 'Fraction of JxB force supported by PF coil case') - case ('vf') - call parse_real_array('vf', vf, isub1, ngc2, & + case ('vf') + call parse_real_array('vf', vf, isub1, ngc2, & 'Void fraction of PF coil', icode) - case ('vfohc') - call parse_real_variable('vfohc', vfohc, 0.0D0, 1.0D0, & + case ('vfohc') + call parse_real_variable('vfohc', vfohc, 0.0D0, 1.0D0, & 'Central Solenoid void fraction for coolant') - case ('zref') - call parse_real_array('zref', zref, isub1, ngrpmx, & + case ('zref') + call parse_real_array('zref', zref, isub1, ngrpmx, & 'height of location 3 and 4 coil groups / minor radius', icode) - case ('afw') - call parse_real_variable('afw', afw, 1.0D-3, 0.5D0, & + case ('afw') + call parse_real_variable('afw', afw, 1.0D-3, 0.5D0, & 'Inner radius of first wall coolant channel (m)') - case ('fw_wall') - call parse_real_variable('fw_wall', fw_wall, 0.5D-3, 0.1D0, & + case ('fw_wall') + call parse_real_variable('fw_wall', fw_wall, 0.5D-3, 0.1D0, & 'wall thickness of first wall coolant channels (m)') - case ('pitch') - call parse_real_variable('pitch', pitch, 0.5D-3, 0.1D0, & + case ('pitch') + call parse_real_variable('pitch', pitch, 0.5D-3, 0.1D0, & 'pitch of first wall cooling channels (m)') - case ('fwinlet') - call parse_real_variable('fwinlet', fwinlet, 300.0d0, 1500.0D0, & + case ('fwinlet') + call parse_real_variable('fwinlet', fwinlet, 300.0d0, 1500.0D0, & 'inlet temperature of first wall coolant (K)') - case ('fwoutlet') - call parse_real_variable('fwoutlet', fwoutlet, 300.0d0, 1500.0D0, & + case ('fwoutlet') + call parse_real_variable('fwoutlet', fwoutlet, 300.0d0, 1500.0D0, & 'outlet temperature of first wall coolant (K)') - case ('fwpressure') - call parse_real_variable('fwpressure', fwpressure, 1.0d5, 1.0D8, & + case ('fwpressure') + call parse_real_variable('fwpressure', fwpressure, 1.0d5, 1.0D8, & 'first wall coolant pressure (Pa)') - case ('fwcoolant') - call parse_string_variable('fwcoolant', fwcoolant, 'first wall coolant') - call lower_case(fwcoolant) - case ('roughness') - call parse_real_variable('roughness', roughness, 0.0d0, 1.0D-2, & + case ('fwcoolant') + call parse_string_variable('fwcoolant', fwcoolant, 'first wall coolant') + call lower_case(fwcoolant) + case ('roughness') + call parse_real_variable('roughness', roughness, 0.0d0, 1.0D-2, & 'first wall channel roughness epsilon') - case ('fw_channel_length') - call parse_real_variable('fw_channel_length', fw_channel_length, 1.0D-3, 1.0D3, & + case ('fw_channel_length') + call parse_real_variable('fw_channel_length', fw_channel_length, 1.0D-3, 1.0D3, & 'first wall channel length') - case ('peaking_factor') - call parse_real_variable('peaking_factor', peaking_factor, 1.0d0, 100.0D0, & + case ('peaking_factor') + call parse_real_variable('peaking_factor', peaking_factor, 1.0d0, 100.0D0, & 'peaking factor for first wall heat loads') - case ('bctmp') - call parse_real_variable('bctmp', bctmp, 1.0D0, 800.0D0, & + case ('bctmp') + call parse_real_variable('bctmp', bctmp, 1.0D0, 800.0D0, & 'First wall bulk coolant temperature (C)') - case ('blpressure') - call parse_real_variable('blpressure', blpressure, 1.0D5, 1.0D8, & + case ('blpressure') + call parse_real_variable('blpressure', blpressure, 1.0D5, 1.0D8, & 'Blanket coolant pressure (Pa)') - case ('blpressure_liq') - call parse_real_variable('blpressure_liq', blpressure_liq, 1.0D5, 1.0D8, & + case ('blpressure_liq') + call parse_real_variable('blpressure_liq', blpressure_liq, 1.0D5, 1.0D8, & 'Blanket liquid metal breeder/coolant pressure (Pa)') - case ('n_liq_recirc') - call parse_int_variable('n_liq_recirc', n_liq_recirc, 1, 50, & + case ('n_liq_recirc') + call parse_int_variable('n_liq_recirc', n_liq_recirc, 1, 50, & 'Selected number of liquid metal breeder recirculations per day') - case ('bz_channel_conduct_liq') - call parse_real_variable('bz_channel_conduct_liq', bz_channel_conduct_liq, 1.0D-6, 1.0D6, & + case ('bz_channel_conduct_liq') + call parse_real_variable('bz_channel_conduct_liq', bz_channel_conduct_liq, 1.0D-6, 1.0D6, & 'Conductance of liquid metal breeder duct walls (A V-1 m-1)') - case ('pnuc_fw_ratio_dcll') - call parse_real_variable('pnuc_fw_ratio_dcll', pnuc_fw_ratio_dcll, 0.0D0, 1.0D0, & + case ('pnuc_fw_ratio_dcll') + call parse_real_variable('pnuc_fw_ratio_dcll', pnuc_fw_ratio_dcll, 0.0D0, 1.0D0, & 'Ratio of FW nuclear power as fraction of total (FW+BB)') - case ('f_nuc_pow_bz_struct') - call parse_real_variable('f_nuc_pow_bz_struct', f_nuc_pow_bz_struct, 0.0D0, 1.0D0, & + case ('f_nuc_pow_bz_struct') + call parse_real_variable('f_nuc_pow_bz_struct', f_nuc_pow_bz_struct, 0.0D0, 1.0D0, & 'Fraction of BZ power cooled by primary coolant for dual-coolant balnket') - case ('coolp') - call parse_real_variable('coolp', coolp, 1.0D5, 1.0D8, & + case ('coolp') + call parse_real_variable('coolp', coolp, 1.0D5, 1.0D8, & 'blanket coolant pressure (Pa) stellarator ONLY') - case ('dtstor') - call parse_real_variable('dtstor', dtstor, 50.0D0, 500.0D0, & + case ('dtstor') + call parse_real_variable('dtstor', dtstor, 50.0D0, 500.0D0, & 'Max temp change in thermal storage medium (K)') - case ('istore') - call parse_int_variable('istore', istore, 1, 3, & + case ('istore') + call parse_int_variable('istore', istore, 1, 3, & 'Switch for thermal storage option') - case ('itcycl') - call parse_int_variable('itcycl', itcycl, 1, 3, & + case ('itcycl') + call parse_int_variable('itcycl', itcycl, 1, 3, & 'Switch for 1st wall axial stress model') - case ('lpulse') - call parse_int_variable('lpulse', lpulse, 0, 1, & + case ('lpulse') + call parse_int_variable('lpulse', lpulse, 0, 1, & 'Switch for pulsed reactor model') - case ('copperaoh_m2') - call parse_real_variable('copperaoh_m2', copperaoh_m2, 1.0D0, 1.0D10, & - 'CS coil current / copper area (A/m2)') - case ('copperaoh_m2_max') - call parse_real_variable('copperaoh_m2_max', copperaoh_m2_max, 1.0D4, 1.0D10, & + case ('copperaoh_m2') + call parse_real_variable('copperaoh_m2', copperaoh_m2, 1.0D0, 1.0D10, & + 'CS coil current / copper area (A/m2)') + case ('copperaoh_m2_max') + call parse_real_variable('copperaoh_m2_max', copperaoh_m2_max, 1.0D4, 1.0D10, & 'Maximum CS coil current / copper area (A/m2)') - case ('f_copperaoh_m2') - call parse_real_variable('f_copperaoh_m2', f_copperaoh_m2, 1.0D-3, 1.0D0, & + case ('f_copperaoh_m2') + call parse_real_variable('f_copperaoh_m2', f_copperaoh_m2, 1.0D-3, 1.0D0, & 'f-value for constraint 75: CS coil current / copper area < copperaoh_m2_max') - ! First wall, blanket, shield settings + ! First wall, blanket, shield settings - case ('primary_pumping') - call parse_int_variable('primary_pumping', primary_pumping, 0, 3, & + case ('primary_pumping') + call parse_int_variable('primary_pumping', primary_pumping, 0, 3, & 'Switch for pumping of primary coolant') - case ('htpmw_blkt') - call parse_real_variable('htpmw_blkt', htpmw_blkt, 0.0D0, 1.0D3, & + case ('htpmw_blkt') + call parse_real_variable('htpmw_blkt', htpmw_blkt, 0.0D0, 1.0D3, & 'blanket coolant mechanical pumping power (MW)') - case ('htpmw_div') - call parse_real_variable('htpmw_div', htpmw_div, 0.0D0, 1.0D3, & + case ('htpmw_div') + call parse_real_variable('htpmw_div', htpmw_div, 0.0D0, 1.0D3, & 'divertor coolant mechanical pumping power (MW)') - case ('htpmw_fw') - call parse_real_variable('htpmw_fw', htpmw_fw, 0.0D0, 1.0D3, & + case ('htpmw_fw') + call parse_real_variable('htpmw_fw', htpmw_fw, 0.0D0, 1.0D3, & 'first wall coolant mechanical pumping power (MW)') - case ('htpmw_shld') - call parse_real_variable('htpmw_shld', htpmw_shld, 0.0D0, 1.0D3, & + case ('htpmw_shld') + call parse_real_variable('htpmw_shld', htpmw_shld, 0.0D0, 1.0D3, & 'shield and vacuum vessel coolant mechanical pumping power (MW)') - case ('i_shield_mat') - call parse_int_variable('i_shield_mat', i_shield_mat, 0, 1, & + case ('i_shield_mat') + call parse_int_variable('i_shield_mat', i_shield_mat, 0, 1, & 'Switch for shield material)') - case ('i_bb_liq') - call parse_int_variable('i_bb_liq', i_bb_liq, 0, 1, & + case ('i_bb_liq') + call parse_int_variable('i_bb_liq', i_bb_liq, 0, 1, & 'Switch for breeding blaket liquid metal') - case ('icooldual') - call parse_int_variable('icooldual', icooldual, 0, 2, & + case ('icooldual') + call parse_int_variable('icooldual', icooldual, 0, 2, & 'Switch for single or dual-coolant blanket)') - case ('ifci') - call parse_int_variable('ifci', ifci, 0, 2, & + case ('ifci') + call parse_int_variable('ifci', ifci, 0, 2, & 'Switch for blanket FCIs)') - case ('inlet_temp_liq') - call parse_real_variable('inlet_temp_liq', inlet_temp_liq, 508.D0, 1.5D3, & + case ('inlet_temp_liq') + call parse_real_variable('inlet_temp_liq', inlet_temp_liq, 508.D0, 1.5D3, & 'Inlet temperature for blanket liquid metal') - case ('outlet_temp_liq') - call parse_real_variable('outlet_temp_liq', outlet_temp_liq, 508.D0, 1.5D3, & + case ('outlet_temp_liq') + call parse_real_variable('outlet_temp_liq', outlet_temp_liq, 508.D0, 1.5D3, & 'Outlet temperature for blanket liquid metal') - case ('ipump') - call parse_int_variable('ipump', ipump, 0, 2, & + case ('ipump') + call parse_int_variable('ipump', ipump, 0, 2, & 'Switch for same or different pumping system for FW/BB') - case ('ims') - call parse_int_variable('ims', ims, 0, 1, & + case ('ims') + call parse_int_variable('ims', ims, 0, 1, & ' Switch for Multi or Single Modle Segment (MMS or SMS)') - case ('secondary_cycle') - call parse_int_variable('secondary_cycle', secondary_cycle, 0, 4, & + case ('secondary_cycle') + call parse_int_variable('secondary_cycle', secondary_cycle, 0, 4, & 'Switch for blanket thermodynamic model') - case ('secondary_cycle_liq') - call parse_int_variable('secondary_cycle_liq', secondary_cycle_liq, 2, 4, & + case ('secondary_cycle_liq') + call parse_int_variable('secondary_cycle_liq', secondary_cycle_liq, 2, 4, & 'Switch for blanket thermodynamic model - liquid breeder') - case ('afwi') - call parse_real_variable('afwi', afwi, 1.0D-3, 0.05D0, & + case ('afwi') + call parse_real_variable('afwi', afwi, 1.0D-3, 0.05D0, & 'I/B fw/blkt coolant channel inner radius (m)') - case ('afwo') - call parse_real_variable('afwo', afwo, 1.0D-3, 0.05D0, & + case ('afwo') + call parse_real_variable('afwo', afwo, 1.0D-3, 0.05D0, & 'O/B fw/blkt coolant channel inner radius (m)') - case ('inlet_temp') - call parse_real_variable('inlet_temp', inlet_temp, 200.0D0, 600.0D0, & + case ('inlet_temp') + call parse_real_variable('inlet_temp', inlet_temp, 200.0D0, 600.0D0, & 'Coolant inlet temperature (K)') - case ('irefprop') - call parse_int_variable('irefprop', irefprop, 0, 1, & + case ('irefprop') + call parse_int_variable('irefprop', irefprop, 0, 1, & 'Switch to use REFPROP routines') - case ('outlet_temp') - call parse_real_variable('outlet_temp', outlet_temp, 450.0D0, 900.0D0, & + case ('outlet_temp') + call parse_real_variable('outlet_temp', outlet_temp, 450.0D0, 900.0D0, & 'Coolant outlet temperature (K)') - case ('nblktmodpo') - call parse_int_variable('nblktmodpo', nblktmodpo, 1, 16, & + case ('nblktmodpo') + call parse_int_variable('nblktmodpo', nblktmodpo, 1, 16, & 'No of o/b blanket modules in poloidal direction') - case ('nblktmodpi') - call parse_int_variable('nblktmodpi', nblktmodpi, 1, 16, & + case ('nblktmodpi') + call parse_int_variable('nblktmodpi', nblktmodpi, 1, 16, & 'No of i/b blanket modules in poloidal direction') - case ('nblktmodto') - call parse_int_variable('nblktmodto', nblktmodto, 8, 96, & + case ('nblktmodto') + call parse_int_variable('nblktmodto', nblktmodto, 8, 96, & 'No of o/b blanket modules in toroidal direction') - case ('nblktmodti') - call parse_int_variable('nblktmodti', nblktmodti, 8, 96, & + case ('nblktmodti') + call parse_int_variable('nblktmodti', nblktmodti, 8, 96, & 'No of i/b blanket modules in toroidal direction') - case ('tfwmatmax') - call parse_real_variable('tfwmatmax', tfwmatmax, 500.0D0, 2000.0D0, & + case ('tfwmatmax') + call parse_real_variable('tfwmatmax', tfwmatmax, 500.0D0, 2000.0D0, & 'Max temperature of first wall material (K)') - case ('fw_th_conductivity') - call parse_real_variable('fw_th_conductivity', fw_th_conductivity, 1.0D0, 100.0D0, & + case ('fw_th_conductivity') + call parse_real_variable('fw_th_conductivity', fw_th_conductivity, 1.0D0, 100.0D0, & 'thermal conductivity of first wall material at 293 K (W/m/K)') - case ('etaiso') - call parse_real_variable('etaiso', etaiso, 0.1D0, 1.0D0, & + case ('etaiso') + call parse_real_variable('etaiso', etaiso, 0.1D0, 1.0D0, & 'Isentropic efficiency of coolant pumps') - case ('blkttype') - call parse_int_variable('blkttype', blkttype, 1, 3, & + case ('blkttype') + call parse_int_variable('blkttype', blkttype, 1, 3, & 'Switch for blanket type') - case ('blktmodel') - call parse_int_variable('blktmodel', blktmodel, 0, 1, & + case ('blktmodel') + call parse_int_variable('blktmodel', blktmodel, 0, 1, & 'Switch for blanket neutronics calculations') - case ('breedmat') - call parse_int_variable('breedmat', breedmat, 1, 3, & + case ('breedmat') + call parse_int_variable('breedmat', breedmat, 1, 3, & 'Switch for blanket breeder material') - case ('declblkt') - call parse_real_variable('declblkt', declblkt, 0.01D0, 0.2D0, & + case ('declblkt') + call parse_real_variable('declblkt', declblkt, 0.01D0, 0.2D0, & 'Neutron decay length in blanket') - case ('declfw') - call parse_real_variable('declfw', declfw, 0.01D0, 0.2D0, & + case ('declfw') + call parse_real_variable('declfw', declfw, 0.01D0, 0.2D0, & 'Neutron decay length in first wall') - case ('declshld') - call parse_real_variable('declshld', declshld, 0.01D0, 0.2D0, & + case ('declshld') + call parse_real_variable('declshld', declshld, 0.01D0, 0.2D0, & 'Neutron decay length in blanket') - case ('denstl') - call parse_real_variable('denstl', denstl, 5.0D3, 1.0D4, & + case ('denstl') + call parse_real_variable('denstl', denstl, 5.0D3, 1.0D4, & 'Density of steel (kg/m3)') - case ('denw') - call parse_real_variable('denw', denw, 1.0D4, 5.0D4, & + case ('denw') + call parse_real_variable('denw', denw, 1.0D4, 5.0D4, & 'Density of tungsten (kg/m3)') - case ('emult') - call parse_real_variable('emult', emult, 1.0D0, 2.0D0, & + case ('emult') + call parse_real_variable('emult', emult, 1.0D0, 2.0D0, & 'Energy multip. in blanket and shield') - case ('fblbe') - call parse_real_variable('fblbe', fblbe, 0.0D0, 1.0D0, & + case ('fblbe') + call parse_real_variable('fblbe', fblbe, 0.0D0, 1.0D0, & 'Beryllium fraction of blanket') - case ('fblbreed') - call parse_real_variable('fblbreed', fblbreed, 0.0D0, 1.0D0, & + case ('fblbreed') + call parse_real_variable('fblbreed', fblbreed, 0.0D0, 1.0D0, & 'Breeder fraction of blanket breeding unit') - case ('fblhebmi') - call parse_real_variable('fblhebmi', fblhebmi, 0.0D0, 1.0D0, & + case ('fblhebmi') + call parse_real_variable('fblhebmi', fblhebmi, 0.0D0, 1.0D0, & 'Helium fraction of IB blanket box manifold') - case ('fblhebmo') - call parse_real_variable('fblhebmo', fblhebmo, 0.0D0, 1.0D0, & + case ('fblhebmo') + call parse_real_variable('fblhebmo', fblhebmo, 0.0D0, 1.0D0, & 'Helium fraction of OB blanket box manifold') - case ('fblhebpi') - call parse_real_variable('fblhebpi', fblhebpi, 0.0D0, 1.0D0, & + case ('fblhebpi') + call parse_real_variable('fblhebpi', fblhebpi, 0.0D0, 1.0D0, & 'Helium fraction of IB blanket back plate') - case ('fblhebpo') - call parse_real_variable('fblhebpo', fblhebpo, 0.0D0, 1.0D0, & + case ('fblhebpo') + call parse_real_variable('fblhebpo', fblhebpo, 0.0D0, 1.0D0, & 'Helium fraction of OB blanket back plate') - case ('fblli') - call parse_real_variable('fblli', fblli, 0.0D0, 1.0D0, & + case ('fblli') + call parse_real_variable('fblli', fblli, 0.0D0, 1.0D0, & 'Lithium fraction of blanket') - case ('fblli2o') - call parse_real_variable('fblli2o', fblli2o, 0.0D0, 1.0D0, & + case ('fblli2o') + call parse_real_variable('fblli2o', fblli2o, 0.0D0, 1.0D0, & 'Li2O fraction of blanket') - case ('fbllipb') - call parse_real_variable('fbllipb', fbllipb, 0.0D0, 1.0D0, & + case ('fbllipb') + call parse_real_variable('fbllipb', fbllipb, 0.0D0, 1.0D0, & 'Li-Pb fraction of blanket') - case ('fblss') - call parse_real_variable('fblss', fblss, 0.0D0, 1.0D0, & + case ('fblss') + call parse_real_variable('fblss', fblss, 0.0D0, 1.0D0, & 'Stainless steel fraction of blanket') - case ('fblvd') - call parse_real_variable('fblvd', fblvd, 0.0D0, 1.0D0, & + case ('fblvd') + call parse_real_variable('fblvd', fblvd, 0.0D0, 1.0D0, & 'Vanadium fraction of blanket') - case ('fdiv') - call parse_real_variable('fdiv', fdiv, 0.0D0, 1.0D0, & + case ('fdiv') + call parse_real_variable('fdiv', fdiv, 0.0D0, 1.0D0, & 'Divertor area fraction') - case ('fhcd') - call parse_real_variable('fhcd', fhcd, 0.0D0, 1.0D0, & + case ('fhcd') + call parse_real_variable('fhcd', fhcd, 0.0D0, 1.0D0, & 'HCD + diagnostics area fraction') - case ('fhole') - call parse_real_variable('fhole', fhole, 0.0D0, 1.0D0, & + case ('fhole') + call parse_real_variable('fhole', fhole, 0.0D0, 1.0D0, & 'Hole area fraction') - case ('fvolbi') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLBI is now obsolete - (use FHOLE)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvolbo') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLBO is now obsolete - (use FHOLE)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvolcry') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLCRY is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvoldw') - call parse_real_variable('fvoldw', fvoldw, 0.0D0, 10.0D0, & + case ('fvolbi') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLBI is now obsolete - (use FHOLE)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvolbo') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLBO is now obsolete - (use FHOLE)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvolcry') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLCRY is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvoldw') + call parse_real_variable('fvoldw', fvoldw, 0.0D0, 10.0D0, & 'Fudge factor for vacuum vessel volume') - !+PJK FVOLSI, FVOLSO should now be restricted to <= 1 - case ('fvolsi') - call parse_real_variable('fvolsi', fvolsi, 0.0D0, 10.0D0, & + !+PJK FVOLSI, FVOLSO should now be restricted to <= 1 + case ('fvolsi') + call parse_real_variable('fvolsi', fvolsi, 0.0D0, 10.0D0, & 'Fudge factor for inboard shield volume') - case ('fvolso') - call parse_real_variable('fvolso', fvolso, 0.0D0, 10.0D0, & + case ('fvolso') + call parse_real_variable('fvolso', fvolso, 0.0D0, 10.0D0, & 'Fudge factor for outboard shield volume') - !-PJK - case ('fwclfr') - call parse_real_variable('fwclfr', fwclfr, 0.0D0, 1.0D0, & + !-PJK + case ('fwclfr') + call parse_real_variable('fwclfr', fwclfr, 0.0D0, 1.0D0, & 'First wall coolant fraction') - case ('fwbsshape') - call parse_int_variable('fwbsshape', fwbsshape, 1, 2, & + case ('fwbsshape') + call parse_int_variable('fwbsshape', fwbsshape, 1, 2, & 'Switch for fw/blanket/shield/vv shape') - case ('fw_armour_thickness') - call parse_real_variable('fw_armour_thickness', fw_armour_thickness, 0.0D0, 1.0D0, & + case ('fw_armour_thickness') + call parse_real_variable('fw_armour_thickness', fw_armour_thickness, 0.0D0, 1.0D0, & 'First wall W coating thickness (m)') - case ('hcdportsize') - call parse_int_variable('hcdportsize', hcdportsize, 1, 2, & + case ('hcdportsize') + call parse_int_variable('hcdportsize', hcdportsize, 1, 2, & 'H/CD port size') - case ('iblanket') - call parse_int_variable('iblanket', iblanket, 1, 5, 'Switch for blanket model') - if ((iblanket == 2).or.(iblanket == 4)) then - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'iblanket = 2/4, KIT HCPB/HCLL model has been removed -' - write(outfile,*) 'please select a different blanket model.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - endif - - if (iblanket == 3) then - fwith = 0.03D0 - fwoth = 0.03D0 - fw_armour_thickness = 0.003D0 - end if - case ('iblnkith') - call parse_int_variable('iblnkith', iblnkith, 0, 1, 'Switch for inboard blanket') - - case ('inuclear') - call parse_int_variable('inuclear', inuclear, 0, 1, & - 'switch for nuclear heating in the coils') - case ('qnuc') - call parse_real_variable('qnuc', qnuc, 0.0D0, 1.0D6, & + case ('iblanket') + call parse_int_variable('iblanket', iblanket, 1, 5, 'Switch for blanket model') + if ((iblanket == 2).or.(iblanket == 4)) then + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'iblanket = 2/4, KIT HCPB/HCLL model has been removed -' + write(outfile,*) 'please select a different blanket model.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + endif + + if (iblanket == 3) then + fwith = 0.03D0 + fwoth = 0.03D0 + fw_armour_thickness = 0.003D0 + end if + case ('iblnkith') + call parse_int_variable('iblnkith', iblnkith, 0, 1, 'Switch for inboard blanket') + + case ('inuclear') + call parse_int_variable('inuclear', inuclear, 0, 1, & + 'switch for nuclear heating in the coils') + case ('qnuc') + call parse_real_variable('qnuc', qnuc, 0.0D0, 1.0D6, & 'nuclear heating in the coils (W)') - case ('li6enrich') - call parse_real_variable('li6enrich', li6enrich, 7.40D0, 100.0D0, & + case ('li6enrich') + call parse_real_variable('li6enrich', li6enrich, 7.40D0, 100.0D0, & 'Li-6 enrichment') - ! CCFE hcpb BB module (also includes the CP shielding for ST) - case ('breeder_f') - call parse_real_variable('breeder_f', breeder_f, 0.00D0, 1.0D0, & + ! CCFE hcpb BB module (also includes the CP shielding for ST) + case ('breeder_f') + call parse_real_variable('breeder_f', breeder_f, 0.00D0, 1.0D0, & 'Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)') - case ('breeder_multiplier') - call parse_real_variable('breeder_multiplier', breeder_multiplier, 0.0D0, 1.0D0, & + case ('breeder_multiplier') + call parse_real_variable('breeder_multiplier', breeder_multiplier, 0.0D0, 1.0D0, & 'combined breeder/multipler fraction of blanket by volume') - case ('vfcblkt') - call parse_real_variable('vfcblkt', vfcblkt, 0.0D0, 1.0D0, & + case ('vfcblkt') + call parse_real_variable('vfcblkt', vfcblkt, 0.0D0, 1.0D0, & 'He coolant fraction of blanket by volume') - case ('vfpblkt') - call parse_real_variable('vfpblkt', vfpblkt, 0.0D0, 1.0D0, & + case ('vfpblkt') + call parse_real_variable('vfpblkt', vfpblkt, 0.0D0, 1.0D0, & + 'He purge gas fraction of blanket by volume') + case ('f_neut_shield') + call parse_real_variable('f_neut_shield', f_neut_shield, 0.0D0, 1.0D0, & 'He purge gas fraction of blanket by volume') - case ('f_neut_shield') - call parse_real_variable('f_neut_shield', f_neut_shield, 0.0D0, 1.0D0, & - 'He purge gas fraction of blanket by volume') - case ('iblanket_thickness') - call parse_int_variable('iblanket_thickness', iblanket_thickness, 1, 3, & + case ('iblanket_thickness') + call parse_int_variable('iblanket_thickness', iblanket_thickness, 1, 3, & 'Blanket thickness switch') - if (iblanket_thickness == 1) then - blnkith = 0.53D0 - blnkoth = 0.91D0 - else if (iblanket_thickness == 2) then - blnkith = 0.64D0 - blnkoth = 1.11D0 - else if (iblanket_thickness == 3) then - blnkith = 0.75D0 - blnkoth = 1.30D0 - end if - case ('npdiv') - call parse_int_variable('npdiv', npdiv, 0, 4, & + if (iblanket_thickness == 1) then + blnkith = 0.53D0 + blnkoth = 0.91D0 + else if (iblanket_thickness == 2) then + blnkith = 0.64D0 + blnkoth = 1.11D0 + else if (iblanket_thickness == 3) then + blnkith = 0.75D0 + blnkoth = 1.30D0 + end if + case ('npdiv') + call parse_int_variable('npdiv', npdiv, 0, 4, & 'Number of divertor ports') - case ('nphcdin') - call parse_int_variable('nphcdin', nphcdin, 0, 4, & + case ('nphcdin') + call parse_int_variable('nphcdin', nphcdin, 0, 4, & 'Number of inboard H/CD ports') - case ('nphcdout') - call parse_int_variable('nphcdout', nphcdout, 0, 4, & + case ('nphcdout') + call parse_int_variable('nphcdout', nphcdout, 0, 4, & 'Number of outboard H/CD ports') - case ('vfblkt') - call parse_real_variable('vfblkt', vfblkt, 0.0D0, 1.0D0, & + case ('vfblkt') + call parse_real_variable('vfblkt', vfblkt, 0.0D0, 1.0D0, & 'Coolant void fraction in blanket') - case ('vfshld') - call parse_real_variable('vfshld', vfshld, 0.0D0, 1.0D0, & + case ('vfshld') + call parse_real_variable('vfshld', vfshld, 0.0D0, 1.0D0, & 'Coolant void fraction in shield') - case ('wallpf') - call parse_real_variable('wallpf', wallpf, 1.0D0, 2.0D0, & + case ('wallpf') + call parse_real_variable('wallpf', wallpf, 1.0D0, 2.0D0, & 'Neutron wall load peaking factor') - ! Heat transport / power settings + ! Heat transport / power settings - case ('baseel') - call parse_real_variable('baseel', baseel, 1.0D6, 1.0D10, & + case ('baseel') + call parse_real_variable('baseel', baseel, 1.0D6, 1.0D10, & 'Base plant electric load (W)') - case ('crypmw_max') - call parse_real_variable('crypmw_max', crypmw_max, 0.01D0, 200.0D0, & + case ('crypmw_max') + call parse_real_variable('crypmw_max', crypmw_max, 0.01D0, 200.0D0, & ' Maximum cryogenic plant power (MW)') - case ('f_crypmw') - call parse_real_variable('f_crypmw', f_crypmw, 0.0D0, 100.0D0, & - ' f-value for cryogenic plant power (icc = 87, c = 164)') - case ('etahtp') - call parse_real_variable('etahtp', etahtp, 0.1D0, 1.0D0, & + case ('f_crypmw') + call parse_real_variable('f_crypmw', f_crypmw, 0.0D0, 100.0D0, & + ' f-value for cryogenic plant power (icc = 87, c = 164)') + case ('etahtp') + call parse_real_variable('etahtp', etahtp, 0.1D0, 1.0D0, & 'Coolant pump electrical efficiency') - case ('etatf') - call parse_real_variable('etatf', etatf, 0.0D0, 1.0D0, & + case ('etatf') + call parse_real_variable('etatf', etatf, 0.0D0, 1.0D0, & 'AC to resistive power conversion for TF coils') - case ('etath') - call parse_real_variable('etath', etath, 0.0D0, 1.0D0, & + case ('etath') + call parse_real_variable('etath', etath, 0.0D0, 1.0D0, & 'Thermal-electric conversion efficiency') - case ('fmgdmw') - call parse_real_variable('fmgdmw', fmgdmw, 0.0D0, 100.0D0, & + case ('fmgdmw') + call parse_real_variable('fmgdmw', fmgdmw, 0.0D0, 100.0D0, & 'Power to MGF units (MW)') - case ('fpumpblkt') - call parse_real_variable('fpumpblkt', fpumpblkt, 0.0D0, 0.2D0, & + case ('fpumpblkt') + call parse_real_variable('fpumpblkt', fpumpblkt, 0.0D0, 0.2D0, & 'Blanket pumping/thermal power ratio') - case ('fpumpdiv') - call parse_real_variable('fpumpdiv', fpumpdiv, 0.0D0, 0.2D0, & + case ('fpumpdiv') + call parse_real_variable('fpumpdiv', fpumpdiv, 0.0D0, 0.2D0, & 'Divertor pumping/thermal power ratio') - case ('fpumpfw') - call parse_real_variable('fpumpfw', fpumpfw, 0.0D0, 0.2D0, & + case ('fpumpfw') + call parse_real_variable('fpumpfw', fpumpfw, 0.0D0, 0.2D0, & 'First wall pumping/thermal power ratio') - case ('fpumpshld') - call parse_real_variable('fpumpshld', fpumpshld, 0.0D0, 0.2D0, & + case ('fpumpshld') + call parse_real_variable('fpumpshld', fpumpshld, 0.0D0, 0.2D0, & 'Shield pumping/thermal power ratio') - case ('htpmw_min') - call parse_real_variable('htpmw_min', htpmw_min, 0.0D0, 500.0D0, & + case ('htpmw_min') + call parse_real_variable('htpmw_min', htpmw_min, 0.0D0, 500.0D0, & 'Minimum total electrical power for primary coolant pumps (MW)') - case ('ipowerflow') - call parse_int_variable('ipowerflow', ipowerflow, 0, 1, & + case ('ipowerflow') + call parse_int_variable('ipowerflow', ipowerflow, 0, 1, & 'Switch for power flow model') - case ('iprimnloss') - call parse_int_variable('iprimnloss', iprimnloss, 0, 1, & + case ('iprimnloss') + call parse_int_variable('iprimnloss', iprimnloss, 0, 1, & 'Switch for lost neutron power destiny') - case ('iprimshld') - call parse_int_variable('iprimshld', iprimshld, 0, 1, & + case ('iprimshld') + call parse_int_variable('iprimshld', iprimshld, 0, 1, & 'Switch for shield thermal power destiny') - case ('pwpm2') - call parse_real_variable('pwpm2', pwpm2, 0.0D0, 1.0D3, & + case ('pwpm2') + call parse_real_variable('pwpm2', pwpm2, 0.0D0, 1.0D3, & 'Base AC power requirement (W/m2)') - case ('pinjmax') - call parse_real_variable('pinjmax', pinjmax, 0.0D0, 1.0D3, & + case ('pinjmax') + call parse_real_variable('pinjmax', pinjmax, 0.0D0, 1.0D3, & 'Maximum injector wall plug power during pulse (MW)') - case ('trithtmw') - call parse_real_variable('trithtmw', trithtmw, 0.0D0, 100.0D0, & + case ('trithtmw') + call parse_real_variable('trithtmw', trithtmw, 0.0D0, 100.0D0, & 'Tritium process power (MW)') - case ('vachtmw') - call parse_real_variable('vachtmw', vachtmw, 0.0D0, 100.0D0, & + case ('vachtmw') + call parse_real_variable('vachtmw', vachtmw, 0.0D0, 100.0D0, & 'Vacuum pump power (MW)') - case ('t_in_bb') - call parse_real_variable('t_in_bb', t_in_bb, 200.0D0, 1000.0D0, & + case ('t_in_bb') + call parse_real_variable('t_in_bb', t_in_bb, 200.0D0, 1000.0D0, & 'Helium or Gas Inlet Temperature (K)') - case ('t_out_bb') - call parse_real_variable('t_out_bb', t_out_bb, 200.0D0, 1000.0D0, & - 'Helium or Gas Outlet Temperature (K)') - case ('dp_he') - call parse_real_variable('dp_he', dp_he, 0.0D0, 10.0D6, & - 'Helium Pressure drop or Gas Pressure drop (Pa)') - case ('p_he') - call parse_real_variable('p_he', p_he, 0.0D0, 100.0D6, & - 'Pressure in FW and blanket coolant at pump exit') + case ('t_out_bb') + call parse_real_variable('t_out_bb', t_out_bb, 200.0D0, 1000.0D0, & + 'Helium or Gas Outlet Temperature (K)') + case ('dp_he') + call parse_real_variable('dp_he', dp_he, 0.0D0, 10.0D6, & + 'Helium Pressure drop or Gas Pressure drop (Pa)') + case ('p_he') + call parse_real_variable('p_he', p_he, 0.0D0, 100.0D6, & + 'Pressure in FW and blanket coolant at pump exit') - case ('gamma_he') - call parse_real_variable('gamma_he', gamma_he, 1.0D0, 2.0D0, & - 'Ratio of specific heats for helium or for another Gas') + case ('gamma_he') + call parse_real_variable('gamma_he', gamma_he, 1.0D0, 2.0D0, & + 'Ratio of specific heats for helium or for another Gas') - ! Cost information settings + ! Cost information settings - case ('abktflnc') - call parse_real_variable('abktflnc', abktflnc, 0.1D0, 100.0D0, & + case ('abktflnc') + call parse_real_variable('abktflnc', abktflnc, 0.1D0, 100.0D0, & 'Allowable blanket fluence (MW-yr/m2)') - case ('adivflnc') - call parse_real_variable('adivflnc', adivflnc, 0.1D0, 100.0D0, & + case ('adivflnc') + call parse_real_variable('adivflnc', adivflnc, 0.1D0, 100.0D0, & 'Allowable divertor fluence (MW-yr/m2)') - case ('cfactr') - call parse_real_variable('cfactr', cfactr, 0.0D0, 1.0D0, & + case ('cfactr') + call parse_real_variable('cfactr', cfactr, 0.0D0, 1.0D0, & 'Plant capacity factor or availability') - case ('cfind') - call parse_real_array('cfind', cfind, isub1, 4, & + case ('cfind') + call parse_real_array('cfind', cfind, isub1, 4, & 'Indirect cost factor vs LSA', icode) - case ('cpstflnc') - call parse_real_variable('cpstflnc', cpstflnc, 0.01D0, 30.0D0, & + case ('cpstflnc') + call parse_real_variable('cpstflnc', cpstflnc, 0.01D0, 30.0D0, & 'Allowable centrepost neutron fluence (MW-yr/m2)') - case ('cplife_input') - call parse_real_variable('cplife_input', cplife_input, 0.001D0, 50.0D0, & - 'Full power centrepost lifetime (yr)') - case ('decomf') - call parse_real_variable('decomf', decomf, 0.0D0, 1.0D0, & + case ('cplife_input') + call parse_real_variable('cplife_input', cplife_input, 0.001D0, 50.0D0, & + 'Full power centrepost lifetime (yr)') + case ('decomf') + call parse_real_variable('decomf', decomf, 0.0D0, 1.0D0, & 'Decommissioning fund fraction') - case ('dintrt') - call parse_real_variable('dintrt', dintrt, 0.0D0, 0.1D0, & + case ('dintrt') + call parse_real_variable('dintrt', dintrt, 0.0D0, 0.1D0, & 'Borrowing - saving interest rate difference') - case ('dtlife') - call parse_real_variable('dtlife', dtlife, 0.0D0, 15.0D0, & + case ('dtlife') + call parse_real_variable('dtlife', dtlife, 0.0D0, 15.0D0, & 'Decommissioning time prior to end of plant') - case ('fcap0') - call parse_real_variable('fcap0', fcap0, 1.0D0, 1.5D0, & + case ('fcap0') + call parse_real_variable('fcap0', fcap0, 1.0D0, 1.5D0, & 'Ave cost of money for plant construction') - case ('fcap0cp') - call parse_real_variable('fcap0cp', fcap0cp, 1.0D0, 1.5D0, & + case ('fcap0cp') + call parse_real_variable('fcap0cp', fcap0cp, 1.0D0, 1.5D0, & 'Ave cost of money for replaceable components') - case ('fcdfuel') - call parse_real_variable('fcdfuel', fcdfuel, 0.0D0, 1.0D0, & + case ('fcdfuel') + call parse_real_variable('fcdfuel', fcdfuel, 0.0D0, 1.0D0, & 'Fraction of CD cost assumed fuel cost') - case ('fcr0') - call parse_real_variable('fcr0', fcr0, 0.0D0, 1.0D0, & + case ('fcr0') + call parse_real_variable('fcr0', fcr0, 0.0D0, 1.0D0, & 'Fixed charge rate during construction') - case ('fkind') - call parse_real_variable('fkind', fkind, 0.5D0, 1.0D0, & + case ('fkind') + call parse_real_variable('fkind', fkind, 0.5D0, 1.0D0, & 'Multiplier for Nth of a kind costs') - case ('i_cp_lifetime') - call parse_int_variable('i_cp_lifetime', i_cp_lifetime, 0, 3, & - 'Switch for ST centrepost lifetime contraint (10) setting') - case ('ifueltyp') - call parse_int_variable('ifueltyp', ifueltyp, 0, 2, & + case ('i_cp_lifetime') + call parse_int_variable('i_cp_lifetime', i_cp_lifetime, 0, 3, & + 'Switch for ST centrepost lifetime contraint (10) setting') + case ('ifueltyp') + call parse_int_variable('ifueltyp', ifueltyp, 0, 2, & 'Switch for costing of 1st wall etc.') - case ('ipnet') - call parse_int_variable('ipnet', ipnet, 0, 1, & + case ('ipnet') + call parse_int_variable('ipnet', ipnet, 0, 1, & 'Switch for net electric power calc.') - case ('ireactor') - call parse_int_variable('ireactor', ireactor, 0, 1, & + case ('ireactor') + call parse_int_variable('ireactor', ireactor, 0, 1, & 'Switch for MWe / C-o-E calculation') - case ('lsa') - call parse_int_variable('lsa', lsa, 1, 4, & + case ('lsa') + call parse_int_variable('lsa', lsa, 1, 4, & 'Level of safety assurance') - case ('output_costs') - call parse_int_variable('output_costs', output_costs, 0, 1, & + case ('output_costs') + call parse_int_variable('output_costs', output_costs, 0, 1, & 'Switch for writing costs to file') - case ('discount_rate') - call parse_real_variable('discount_rate', discount_rate, 0.0D0, 0.5D0, & + case ('discount_rate') + call parse_real_variable('discount_rate', discount_rate, 0.0D0, 0.5D0, & 'Effective cost of money') - case ('startupratio') - call parse_real_variable('startupratio', startupratio, 0.0D0, 10.0D0, & + case ('startupratio') + call parse_real_variable('startupratio', startupratio, 0.0D0, 10.0D0, & 'Ratio (additional HCD power for start-up) / (flat-top operational requirements)') + case ('tmain') + call parse_real_variable('tmain', tmain, 0.0D0, 100.0D0, & + 'Maintenance time for replacing CP (years) (iavail = 3)') + case ('u_unplanned') + call parse_real_variable('u_unplanned', u_unplanned, 0.0D0, 1.0D0, & + 'User-input CP unplanned unavailability (iavail = 3)') - ! Unit cost settings + ! Unit cost settings - case ('cconfix') - call parse_real_variable('cconfix', cconfix, 50.0D0, 200.0D0, & + case ('cconfix') + call parse_real_variable('cconfix', cconfix, 50.0D0, 200.0D0, & 'Fixed cost of superconducting cable ($/m)') - case ('cconshpf') - call parse_real_variable('cconshpf', cconshpf, 50.0D0, 200.0D0, & + case ('cconshpf') + call parse_real_variable('cconshpf', cconshpf, 50.0D0, 200.0D0, & 'PF coil steel conduit/sheath cost ($/m)') - case ('cconshtf') - call parse_real_variable('cconshtf', cconshtf, 50.0D0, 200.0D0, & + case ('cconshtf') + call parse_real_variable('cconshtf', cconshtf, 50.0D0, 200.0D0, & 'TF coil steel conduit/sheath cost ($/m)') - case ('cland') - call parse_real_variable('cland', cland, 10.0D0, 100.0D0, & + case ('cland') + call parse_real_variable('cland', cland, 10.0D0, 100.0D0, & 'Cost of land (M$)') - case ('costexp') - call parse_real_variable('costexp', costexp, 0.01D0, 5.0D0, & + case ('costexp') + call parse_real_variable('costexp', costexp, 0.01D0, 5.0D0, & 'Cost exponent for 2015 costs model') - case ('costexp_pebbles') - call parse_real_variable('costexp_pebbles', costexp_pebbles, 0.01D0, 5.0D0, & + case ('costexp_pebbles') + call parse_real_variable('costexp_pebbles', costexp_pebbles, 0.01D0, 5.0D0, & 'cost exponent for pebbles in 2015 costs model') - case ('cost_factor_buildings') - call parse_real_variable('cost_factor_buildings', cost_factor_buildings, 0.1D0, 10.0D0, & - 'Cost scaling factor for buildings (2015 costs model)') - case ('cost_factor_land') - call parse_real_variable('cost_factor_land', cost_factor_land, 0.1D0, 10.0D0, & - 'Cost scaling factor for land (2015 costs model)') - case ('cost_factor_tf_coils') - call parse_real_variable('cost_factor_tf_coils', cost_factor_tf_coils, 0.1D0, 10.0D0, & - 'Cost scaling factor for TF coils (2015 costs model)') - case ('cost_factor_fwbs') - call parse_real_variable('cost_factor_fwbs', cost_factor_fwbs, 0.1D0, 10.0D0, & - 'Cost scaling factor for fwbs (2015 costs model)') - case ('cost_factor_rh') - call parse_real_variable('cost_factor_rh', cost_factor_rh, 0.1D0, 10.0D0, & - 'Cost scaling factor for remote handling (2015 costs model)') - case ('cost_factor_vv') - call parse_real_variable('cost_factor_vv', cost_factor_vv, 0.1D0, 10.0D0, & - 'Cost scaling factor for vacuum vessel (2015 costs model)') - case ('cost_factor_bop') - call parse_real_variable('cost_factor_bop', cost_factor_bop, 0.1D0, 10.0D0, & - 'Cost scaling factor for energy conversion system (2015 costs model)') - case ('cost_factor_misc') - call parse_real_variable('cost_factor_misc', cost_factor_misc, 0.1D0, 10.0D0, & - 'Cost scaling factor for remaining subsystems (2015 costs model)') - case ('maintenance_fwbs') - call parse_real_variable('maintenance_fwbs', maintenance_fwbs, 0.0D0, 1.0D0, & - 'Maintenance cost factor: first wall, blanket, shield, divertor') - case ('maintenance_gen') - call parse_real_variable('maintenance_gen', maintenance_gen, 0.0D0, 1.0D0, & - 'Maintenance cost factor: All other components except coils, vacuum vessel, thermal shield, cryostat, land') - case ('amortization') - call parse_real_variable('amortization', amortization, 1.0D0, 50.0D0, & + case ('cost_factor_buildings') + call parse_real_variable('cost_factor_buildings', cost_factor_buildings, 0.1D0, 10.0D0, & + 'Cost scaling factor for buildings (2015 costs model)') + case ('cost_factor_land') + call parse_real_variable('cost_factor_land', cost_factor_land, 0.1D0, 10.0D0, & + 'Cost scaling factor for land (2015 costs model)') + case ('cost_factor_tf_coils') + call parse_real_variable('cost_factor_tf_coils', cost_factor_tf_coils, 0.1D0, 10.0D0, & + 'Cost scaling factor for TF coils (2015 costs model)') + case ('cost_factor_fwbs') + call parse_real_variable('cost_factor_fwbs', cost_factor_fwbs, 0.1D0, 10.0D0, & + 'Cost scaling factor for fwbs (2015 costs model)') + case ('cost_factor_rh') + call parse_real_variable('cost_factor_rh', cost_factor_rh, 0.1D0, 10.0D0, & + 'Cost scaling factor for remote handling (2015 costs model)') + case ('cost_factor_vv') + call parse_real_variable('cost_factor_vv', cost_factor_vv, 0.1D0, 10.0D0, & + 'Cost scaling factor for vacuum vessel (2015 costs model)') + case ('cost_factor_bop') + call parse_real_variable('cost_factor_bop', cost_factor_bop, 0.1D0, 10.0D0, & + 'Cost scaling factor for energy conversion system (2015 costs model)') + case ('cost_factor_misc') + call parse_real_variable('cost_factor_misc', cost_factor_misc, 0.1D0, 10.0D0, & + 'Cost scaling factor for remaining subsystems (2015 costs model)') + case ('maintenance_fwbs') + call parse_real_variable('maintenance_fwbs', maintenance_fwbs, 0.0D0, 1.0D0, & + 'Maintenance cost factor: first wall, blanket, shield, divertor') + case ('maintenance_gen') + call parse_real_variable('maintenance_gen', maintenance_gen, 0.0D0, 1.0D0, & + 'Maintenance cost factor: All other components except coils, vacuum vessel, thermal shield, cryostat, land') + case ('amortization') + call parse_real_variable('amortization', amortization, 1.0D0, 50.0D0, & 'amortization factor (fixed charge factor) "A" (years)') - case ('cost_model') - call parse_int_variable('cost_model', cost_model, 0, 2, & + case ('cost_model') + call parse_int_variable('cost_model', cost_model, 0, 2, & 'Switch for cost model') - case ('cowner') - call parse_real_variable('cowner', cowner, 0.0D0, 1.0D0, & + case ('cowner') + call parse_real_variable('cowner', cowner, 0.0D0, 1.0D0, & 'Owner cost factor') - case ('csi') - call parse_real_variable('csi', csi, 1.0D0, 100.0D0, & + case ('csi') + call parse_real_variable('csi', csi, 1.0D0, 100.0D0, & 'Allowance for site costs (M$)') - case ('cturbb') - call parse_real_variable('cturbb', cturbb, 100.0D0, 1000.0D0, & + case ('cturbb') + call parse_real_variable('cturbb', cturbb, 100.0D0, 1000.0D0, & 'Cost of turbine building (M$)') - case ('fcontng') - call parse_real_variable('fcontng', fcontng, 0.0D0, 1.0D0, & + case ('fcontng') + call parse_real_variable('fcontng', fcontng, 0.0D0, 1.0D0, & 'Project contingency factor') - case ('ucblbe') - call parse_real_variable('ucblbe', ucblbe, 1.0D0, 1.0D3, & + case ('ucblbe') + call parse_real_variable('ucblbe', ucblbe, 1.0D0, 1.0D3, & 'Unit cost for blanket Be ($/kg)') - case ('ucblbreed') - call parse_real_variable('ucblbreed', ucblbreed, 1.0D0, 1.0D3, & + case ('ucblbreed') + call parse_real_variable('ucblbreed', ucblbreed, 1.0D0, 1.0D3, & 'Unit cost for blanket breeder material ($/kg)') - case ('ucblli') - call parse_real_variable('ucblli', ucblli, 1.0D1, 1.0D4, & + case ('ucblli') + call parse_real_variable('ucblli', ucblli, 1.0D1, 1.0D4, & 'Unit cost for blanket Li ($/kg)') - case ('ucblli2o') - call parse_real_variable('ucblli2o', ucblli2o, 1.0D2, 1.0D4, & + case ('ucblli2o') + call parse_real_variable('ucblli2o', ucblli2o, 1.0D2, 1.0D4, & 'Unit cost for blanket Li2O ($/kg)') - case ('ucbllipb') - call parse_real_variable('ucbllipb', ucbllipb, 1.0D2, 1.0D4, & + case ('ucbllipb') + call parse_real_variable('ucbllipb', ucbllipb, 1.0D2, 1.0D4, & 'Unit cost for blanket Li-Pb ($/kg)') - case ('ucblss') - call parse_real_variable('ucblss', ucblss, 10.0D0, 1.0D3, & + case ('ucblss') + call parse_real_variable('ucblss', ucblss, 10.0D0, 1.0D3, & 'Unit cost for blanket st.steel ($/kg)') - case ('ucblvd') - call parse_real_variable('ucblvd', ucblvd, 100.0D0, 1.0D3, & + case ('ucblvd') + call parse_real_variable('ucblvd', ucblvd, 100.0D0, 1.0D3, & 'Unit cost for blanket Vd ($/kg)') - case ('ucbus') - call parse_real_variable('ucbus', ucbus, 0.01D0, 10.0D0, & + case ('ucbus') + call parse_real_variable('ucbus', ucbus, 0.01D0, 10.0D0, & 'Cost of Al bus for TF coil ($/A-m)') - case ('uccase') - call parse_real_variable('uccase', uccase, 1.0D0, 1.0D3, & + case ('uccase') + call parse_real_variable('uccase', uccase, 1.0D0, 1.0D3, & 'Cost of superconductor case ($/kg)') - case ('uccpcl1') - call parse_real_variable('uccpcl1', uccpcl1, 1.0D0, 1.0D3, & + case ('uccpcl1') + call parse_real_variable('uccpcl1', uccpcl1, 1.0D0, 1.0D3, & 'Cost of tapered copper ($/kg)') - case ('uccpclb') - call parse_real_variable('uccpclb', uccpclb, 1.0D0, 1.0D3, & + case ('uccpclb') + call parse_real_variable('uccpclb', uccpclb, 1.0D0, 1.0D3, & 'Cost TF outer leg plate coils ($/kg)') - case ('uccry') - call parse_real_variable('uccry', uccry, 1.0D4, 1.0D6, & + case ('uccry') + call parse_real_variable('uccry', uccry, 1.0D4, 1.0D6, & 'Heat transport cryoplant costs ($/W)') - case ('uccryo') - call parse_real_variable('uccryo', uccryo, 1.0D0, 1.0D3, & + case ('uccryo') + call parse_real_variable('uccryo', uccryo, 1.0D0, 1.0D3, & 'Unit cost for cryostat ($/kg)') - case ('uccu') - call parse_real_variable('uccu', uccu, 10.0D0, 1.0D2, & + case ('uccu') + call parse_real_variable('uccu', uccu, 10.0D0, 1.0D2, & 'Copper in SC cable cost ($/kg)') - case ('ucdiv') - call parse_real_variable('ucdiv', ucdiv, 1.0D3, 1.0D7, & + case ('ucdiv') + call parse_real_variable('ucdiv', ucdiv, 1.0D3, 1.0D7, & 'Cost of divertor blade ($)') - case ('ucech') - call parse_real_variable('ucech', ucech, 1.0D0, 10.0D0, & + case ('ucech') + call parse_real_variable('ucech', ucech, 1.0D0, 10.0D0, & 'ECH system cost ($/W)') - case ('ucf1') - call parse_real_variable('ucf1', ucf1, 1.0D6, 50.0D6, & + case ('ucf1') + call parse_real_variable('ucf1', ucf1, 1.0D6, 50.0D6, & 'Fuelling system cost ($)') - case ('ucfnc') - call parse_real_variable('ucfnc', ucfnc, 10.0D0, 100.0D0, & + case ('ucfnc') + call parse_real_variable('ucfnc', ucfnc, 10.0D0, 100.0D0, & 'Outer PF fence support cost ($/kg)') - case ('ucfuel') - call parse_real_variable('ucfuel', ucfuel, 1.0D0, 10.0D0, & + case ('ucfuel') + call parse_real_variable('ucfuel', ucfuel, 1.0D0, 10.0D0, & 'Cost of fuel (M$/yr)') - case ('uche3') - call parse_real_variable('uche3', uche3, 1.0D5, 1.0D7, & + case ('uche3') + call parse_real_variable('uche3', uche3, 1.0D5, 1.0D7, & 'Cost of He3 fuel ($/kg)') - case ('uchrs') - call parse_real_variable('uchrs', uchrs, 1.0D7, 5.0D8, & + case ('uchrs') + call parse_real_variable('uchrs', uchrs, 1.0D7, 5.0D8, & 'Cost of heat rejection system ($)') - case ('uchts') - call parse_real_array('uchts', uchts, isub1, 2, & + case ('uchts') + call parse_real_array('uchts', uchts, isub1, 2, & 'Cost of heat transp system equip per loop ($/W)', icode) - case ('uciac') - call parse_real_variable('uciac', uciac, 1.0D7, 1.0D9, & + case ('uciac') + call parse_real_variable('uciac', uciac, 1.0D7, 1.0D9, & 'Cost of instrum, control & diag.($)') - case ('ucich') - call parse_real_variable('ucich', ucich, 1.0D0, 10.0D0, & + case ('ucich') + call parse_real_variable('ucich', ucich, 1.0D0, 10.0D0, & 'Cost of ICH system ($/W)') - case ('uclh') - call parse_real_variable('uclh', uclh, 1.0D0, 10.0D0, & + case ('uclh') + call parse_real_variable('uclh', uclh, 1.0D0, 10.0D0, & 'LH system cost ($/W)') - case ('ucme') - call parse_real_variable('ucme', ucme, 1.0D7, 1.0D9, & + case ('ucme') + call parse_real_variable('ucme', ucme, 1.0D7, 1.0D9, & 'cost of maintenance equip. ($)') - case ('ucmisc') - call parse_real_variable('ucmisc', ucmisc, 1.0D7, 5.0D7, & + case ('ucmisc') + call parse_real_variable('ucmisc', ucmisc, 1.0D7, 5.0D7, & 'Miscellaneous plant allowance ($)') - case ('ucnbi') - call parse_real_variable('ucnbi', ucnbi, 1.0D0, 10.0D0, & + case ('ucnbi') + call parse_real_variable('ucnbi', ucnbi, 1.0D0, 10.0D0, & 'NBI system cost ($/W)') - case ('ucoam') - call parse_real_array('ucoam', ucoam, isub1, 4, & + case ('ucoam') + call parse_real_array('ucoam', ucoam, isub1, 4, & 'Annual cost of operation and maintenance', icode) - case ('ucpens') - call parse_real_variable('ucpens', ucpens, 1.0D0, 100.0D0, & + case ('ucpens') + call parse_real_variable('ucpens', ucpens, 1.0D0, 100.0D0, & 'Penetration shield cost ($/kg)') - case ('ucpfb') - call parse_real_variable('ucpfb', ucpfb, 1.0D0, 1.0D3, & + case ('ucpfb') + call parse_real_variable('ucpfb', ucpfb, 1.0D0, 1.0D3, & 'Cost of PF coil buses ($/kA-m)') - case ('ucpfbk') - call parse_real_variable('ucpfbk', ucpfbk, 1.0D3, 1.0D5, & + case ('ucpfbk') + call parse_real_variable('ucpfbk', ucpfbk, 1.0D3, 1.0D5, & 'Cost of PF coil DC breakers ($/MVA)') - case ('ucpfbs') - call parse_real_variable('ucpfbs', ucpfbs, 1.0D3, 1.0D4, & + case ('ucpfbs') + call parse_real_variable('ucpfbs', ucpfbs, 1.0D3, 1.0D4, & 'Cost of PF burn power supplies ($/kW**0.7)') - case ('ucpfcb') - call parse_real_variable('ucpfcb', ucpfcb, 1.0D3, 1.0D5, & + case ('ucpfcb') + call parse_real_variable('ucpfcb', ucpfcb, 1.0D3, 1.0D5, & 'Cost of PF coil AC breakers ($/circ)') - case ('ucpfdr1') - call parse_real_variable('ucpfdr1', ucpfdr1, 1.0D0, 1.0D3, & + case ('ucpfdr1') + call parse_real_variable('ucpfdr1', ucpfdr1, 1.0D0, 1.0D3, & 'Cost factor for dump resistors ($/MJ)') - case ('ucpfic') - call parse_real_variable('ucpfic', ucpfic, 1.0D3, 1.0D5, & + case ('ucpfic') + call parse_real_variable('ucpfic', ucpfic, 1.0D3, 1.0D5, & 'Cost of PF instrum & cont ($/channel)') - case ('ucpfps') - call parse_real_variable('ucpfps', ucpfps, 1.0D3, 1.0D5, & + case ('ucpfps') + call parse_real_variable('ucpfps', ucpfps, 1.0D3, 1.0D5, & 'Cost of PF coil pulsed P.S. ($/MVA)') - case ('ucrb') - call parse_real_variable('ucrb', ucrb, 1.0D2, 1.0D3, & + case ('ucrb') + call parse_real_variable('ucrb', ucrb, 1.0D2, 1.0D3, & 'Cost of reactor building ($/m3)') - case ('ucsc') - call parse_real_array('ucsc', ucsc, isub1, 9, & + case ('ucsc') + call parse_real_array('ucsc', ucsc, isub1, 9, & 'Cost of superconductor ($/kg)', icode) - case ('ucshld') - call parse_real_variable('ucshld', ucshld, 1.0D0, 100.0D0, & + case ('ucshld') + call parse_real_variable('ucshld', ucshld, 1.0D0, 100.0D0, & 'Cost of shield structural steel ($/kg)') - case ('uctfbr') - call parse_real_variable('uctfbr', uctfbr, 1.0D0, 10.0D0, & + case ('uctfbr') + call parse_real_variable('uctfbr', uctfbr, 1.0D0, 10.0D0, & 'Cost of TF coil breakers ($/W**0.7)') - case ('uctfbus') - call parse_real_variable('uctfbus', uctfbus, 1.0D0, 1.0D3, & + case ('uctfbus') + call parse_real_variable('uctfbus', uctfbus, 1.0D0, 1.0D3, & 'Cost of TF coil bus ($/kg)') - case ('uctfps') - call parse_real_variable('uctfps', uctfps, 1.0D0, 1.0D3, & + case ('uctfps') + call parse_real_variable('uctfps', uctfps, 1.0D0, 1.0D3, & 'Cost of TF power supplies ($/W**0.7)') - case ('uctfsw') - call parse_real_variable('uctfsw', uctfsw, 0.1D0, 10.0D0, & + case ('uctfsw') + call parse_real_variable('uctfsw', uctfsw, 0.1D0, 10.0D0, & 'Cost of TF slow dump switches ($/A)') - case ('ucturb') - call parse_real_array('ucturb', ucturb, isub1, 2, & + case ('ucturb') + call parse_real_array('ucturb', ucturb, isub1, 2, & 'Cost of turbine plant equipment ($)', icode) - case ('ucwindpf') - call parse_real_variable('ucwindpf', ucwindpf, 100.0D0, 1.0D3, & + case ('ucwindpf') + call parse_real_variable('ucwindpf', ucwindpf, 100.0D0, 1.0D3, & 'Cost of SCPF windings ($/m)') - case ('ucwindtf') - call parse_real_variable('ucwindtf', ucwindtf, 100.0D0, 1.0D3, & + case ('ucwindtf') + call parse_real_variable('ucwindtf', ucwindtf, 100.0D0, 1.0D3, & 'Cost of SCTF windings ($/m)') - case ('ucwst') - call parse_real_array('ucwst', ucwst, isub1, 4, & + case ('ucwst') + call parse_real_array('ucwst', ucwst, isub1, 4, & 'cost of waste disposal (M$/yr)', icode) - ! Availability settings + ! Availability settings - case ('iavail') - call parse_int_variable('iavail', iavail, 0, 2, & + case ('iavail') + call parse_int_variable('iavail', iavail, 0, 3, & 'Switch for plant availability model') - case ('ibkt_life') - call parse_int_variable('ibkt_life', ibkt_life, 0, 2, & + case ('ibkt_life') + call parse_int_variable('ibkt_life', ibkt_life, 0, 2, & 'Switch for DEMO fw/blanket lifetime calculation') - case ('life_dpa') - call parse_real_variable('life_dpa', life_dpa, 1.0D1, 1.0D2, & + case ('life_dpa') + call parse_real_variable('life_dpa', life_dpa, 1.0D1, 1.0D2, & 'Allowable DPA for DEMO fw/blanket lifetime calculation') - case ('avail_min') - call parse_real_variable('avail_min', avail_min, 0.0D0, 1.0D0, & + case ('avail_min') + call parse_real_variable('avail_min', avail_min, 0.0D0, 1.0D0, & 'Required minimum availability (constraint equation 61)') - case ('favail') - call parse_real_variable('favail', favail, 0.0D0, 1.0D0, & + case ('favail') + call parse_real_variable('favail', favail, 0.0D0, 1.0D0, & 'F-value for minimum availability (constraint equation 61)') - case ('num_rh_systems') - call parse_int_variable('num_rh_systems', num_rh_systems, 1, 10, & + case ('num_rh_systems') + call parse_int_variable('num_rh_systems', num_rh_systems, 1, 10, & 'Number of remote handling systems (from 1-10)') - case ('conf_mag') - call parse_real_variable('conf_mag', conf_mag, 0.9D0, 1.0D0, & + case ('conf_mag') + call parse_real_variable('conf_mag', conf_mag, 0.9D0, 1.0D0, & 'c parameter, which determines the temperature margin at which magnet lifetime starts to decline') - case ('div_prob_fail') - call parse_real_variable('div_prob_fail', div_prob_fail, 0.0D0, 1.0D0, & + case ('div_prob_fail') + call parse_real_variable('div_prob_fail', div_prob_fail, 0.0D0, 1.0D0, & 'Divertor probability of failure (per op day)') - case ('div_umain_time') - call parse_real_variable('div_umain_time', div_umain_time, 0.1D0, 2.0D0, & + case ('div_umain_time') + call parse_real_variable('div_umain_time', div_umain_time, 0.1D0, 2.0D0, & 'Divertor unplanned maintenance time (years)') - case ('div_nref') - call parse_real_variable('div_nref', div_nref, 1.0D3, 1.0D8, & + case ('div_nref') + call parse_real_variable('div_nref', div_nref, 1.0D3, 1.0D8, & 'Reference value for cycle life of divertor') - case ('div_nu') - call parse_real_variable('div_nu', div_nu, 1.0D3, 1.0D8, & + case ('div_nu') + call parse_real_variable('div_nu', div_nu, 1.0D3, 1.0D8, & 'The cycle when the divertor fails with 100% probability') - case ('fwbs_nref') - call parse_real_variable('fwbs_nref', fwbs_nref, 1.0D3, 1.0D8, & + case ('fwbs_nref') + call parse_real_variable('fwbs_nref', fwbs_nref, 1.0D3, 1.0D8, & 'Reference value for cycle life of blanket') - case ('fwbs_nu') - call parse_real_variable('fwbs_nu', fwbs_nu, 1.0D3, 1.0D8, & + case ('fwbs_nu') + call parse_real_variable('fwbs_nu', fwbs_nu, 1.0D3, 1.0D8, & 'The cycle when the blanket fails with 100% probability') - case ('fwbs_prob_fail') - call parse_real_variable('fwbs_prob_fail', fwbs_prob_fail, 0.0D0, 1.0D0, & + case ('fwbs_prob_fail') + call parse_real_variable('fwbs_prob_fail', fwbs_prob_fail, 0.0D0, 1.0D0, & 'Fwbs probability of failure (per op day)') - case ('fwbs_umain_time') - call parse_real_variable('fwbs_umain_time', fwbs_umain_time, 0.1D0, 2.0D0, & + case ('fwbs_umain_time') + call parse_real_variable('fwbs_umain_time', fwbs_umain_time, 0.1D0, 2.0D0, & 'Fwbs unplanned maintenace time (years)') - case ('redun_vacp') - call parse_real_variable('redun_vacp', redun_vacp, 0.0D0, 100.0D0, & + case ('redun_vacp') + call parse_real_variable('redun_vacp', redun_vacp, 0.0D0, 100.0D0, & 'Vacuum system pump redundancy level (%)') - case ('tbktrepl') - call parse_real_variable('tbktrepl', tbktrepl, 0.01D0, 2.0D0, & + case ('tbktrepl') + call parse_real_variable('tbktrepl', tbktrepl, 0.01D0, 2.0D0, & 'Time needed to replace blanket (yr)') - case ('tcomrepl') - call parse_real_variable('tcomrepl', tcomrepl, 0.01D0, 2.0D0, & + case ('tcomrepl') + call parse_real_variable('tcomrepl', tcomrepl, 0.01D0, 2.0D0, & 'Time needed to replace blanket+divertor (yr)') - case ('tdivrepl') - call parse_real_variable('tdivrepl', tdivrepl, 0.01D0, 2.0D0, & + case ('tdivrepl') + call parse_real_variable('tdivrepl', tdivrepl, 0.01D0, 2.0D0, & 'Time needed to replace divertor (yr)') - case ('tlife') - call parse_real_variable('tlife', tlife, 1.0D0, 100.0D0, & + case ('tlife') + call parse_real_variable('tlife', tlife, 1.0D0, 100.0D0, & 'Plant life (yr)') - case ('uubop') - call parse_real_variable('uubop', uubop, 0.005D0, 0.1D0, & + case ('uubop') + call parse_real_variable('uubop', uubop, 0.005D0, 0.1D0, & 'Unplanned unavailability for BOP') - case ('uucd') - call parse_real_variable('uucd', uucd, 0.005D0, 0.1D0, & + case ('uucd') + call parse_real_variable('uucd', uucd, 0.005D0, 0.1D0, & 'Unplanned unavailability for CD system') - case ('uudiv') - call parse_real_variable('uudiv', uudiv, 0.005D0, 0.1D0, & + case ('uudiv') + call parse_real_variable('uudiv', uudiv, 0.005D0, 0.1D0, & 'Unplanned unavailability for divertor') - case ('uufuel') - call parse_real_variable('uufuel', uufuel, 0.005D0, 0.1D0, & + case ('uufuel') + call parse_real_variable('uufuel', uufuel, 0.005D0, 0.1D0, & 'Unplanned unavailability for fuel system') - case ('uufw') - call parse_real_variable('uufw', uufw, 0.005D0, 0.1D0, & + case ('uufw') + call parse_real_variable('uufw', uufw, 0.005D0, 0.1D0, & 'Unplanned unavailability for first wall') - case ('uumag') - call parse_real_variable('uumag', uumag, 0.005D0, 0.1D0, & + case ('uumag') + call parse_real_variable('uumag', uumag, 0.005D0, 0.1D0, & 'Unplanned unavailability for magnets') - case ('uuves') - call parse_real_variable('uuves', uuves, 0.005D0, 0.1D0, & + case ('uuves') + call parse_real_variable('uuves', uuves, 0.005D0, 0.1D0, & 'Unplanned unavailability for vessel') - ! Sweep settings + ! Sweep settings - case ('isweep') - call parse_int_variable('isweep', isweep, 0, ipnscns, & + case ('isweep') + call parse_int_variable('isweep', isweep, 0, ipnscns, & 'Number of scans to perform') - case ('nsweep') - call parse_int_variable('nsweep', nsweep, 1, ipnscnv, & + case ('nsweep') + call parse_int_variable('nsweep', nsweep, 1, ipnscnv, & 'Variable used in scan') - case ('sweep') - call parse_real_array('sweep', sweep, isub1, ipnscns, & + case ('sweep') + call parse_real_array('sweep', sweep, isub1, ipnscns, & 'Actual values to use in scan', icode) - case ('scan_dim') - call parse_int_variable('scan_dim', scan_dim, 1, 2, & + case ('scan_dim') + call parse_int_variable('scan_dim', scan_dim, 1, 2, & 'Switch for 1-D or 2-D scan') - case ('isweep_2') - call parse_int_variable('isweep_2', isweep_2, 0, ipnscns, & + case ('isweep_2') + call parse_int_variable('isweep_2', isweep_2, 0, ipnscns, & 'Number of 2D scans to perform') - case ('nsweep_2') - call parse_int_variable('nsweep_2', nsweep_2, 1, ipnscnv, & + case ('nsweep_2') + call parse_int_variable('nsweep_2', nsweep_2, 1, ipnscnv, & 'Second variable used in 2D scan') - case ('sweep_2') - call parse_real_array('sweep_2', sweep_2, isub1, ipnscns, & + case ('sweep_2') + call parse_real_array('sweep_2', sweep_2, isub1, ipnscns, & 'Actual values to use in 2D scan', icode) - ! Buildings settings + ! Buildings settings - case('i_bldgs_size') - call parse_int_variable('i_bldgs_size', i_bldgs_size, 0, 1, & + case('i_bldgs_size') + call parse_int_variable('i_bldgs_size', i_bldgs_size, 0, 1, & 'Switch between routines estimating building sizes') - case('i_bldgs_v') - call parse_int_variable('i_bldgs_v', i_bldgs_v, 0, 1, & + case('i_bldgs_v') + call parse_int_variable('i_bldgs_v', i_bldgs_v, 0, 1, & 'Switch for verbose buildings output') - case ('admv') - call parse_real_variable('admv', admv, 1.0D4, 1.0D6, & + case ('admv') + call parse_real_variable('admv', admv, 1.0D4, 1.0D6, & 'Administration building volume (m3)') - case ('clh1') - call parse_real_variable('clh1', clh1, 0.0D0, 20.0D0, & + case ('clh1') + call parse_real_variable('clh1', clh1, 0.0D0, 20.0D0, & 'Clearance TF coil to cryostat top (m)') - case ('clh2') - call parse_real_variable('clh2', clh2, 0.0D0, 30.0D0, & + case ('clh2') + call parse_real_variable('clh2', clh2, 0.0D0, 30.0D0, & 'Clearance TF coil to foundation (m)') - case ('conv') - call parse_real_variable('conv', conv, 1.0D4, 1.0D6, & + case ('conv') + call parse_real_variable('conv', conv, 1.0D4, 1.0D6, & 'Control building volume (m3)') - case ('esbldgm3') - call parse_real_variable('esbldgm3', esbldgm3, 1.0D3, 1.0D6, & + case ('esbldgm3') + call parse_real_variable('esbldgm3', esbldgm3, 1.0D3, 1.0D6, & 'Energy storage building volume (m3)') - case ('fndt') - call parse_real_variable('fndt', fndt, 0.0D0, 10.0D0, & + case ('fndt') + call parse_real_variable('fndt', fndt, 0.0D0, 10.0D0, & 'Foundation thickness (m)') - case ('hccl') - call parse_real_variable('hccl', hccl, 0.0D0, 10.0D0, & + case ('hccl') + call parse_real_variable('hccl', hccl, 0.0D0, 10.0D0, & 'Clearance around components in hot cell (m)') - case ('hcwt') - call parse_real_variable('hcwt', hcwt, 0.0D0, 10.0D0, & + case ('hcwt') + call parse_real_variable('hcwt', hcwt, 0.0D0, 10.0D0, & 'Hot cell wall thickness (m)') - case ('mbvfac') - call parse_real_variable('mbvfac', mbvfac, 0.9D0, 3.0D0, & + case ('mbvfac') + call parse_real_variable('mbvfac', mbvfac, 0.9D0, 3.0D0, & 'Maintenance building volume multiplier') - case ('pfbldgm3') - call parse_real_variable('pfbldgm3', pfbldgm3, 1.0D4, 1.0D6, & + case ('pfbldgm3') + call parse_real_variable('pfbldgm3', pfbldgm3, 1.0D4, 1.0D6, & 'PF coil power conv. bldg volume (m3)') - case ('pibv') - call parse_real_variable('pibv', pibv, 1.0D3, 1.0D5, & + case ('pibv') + call parse_real_variable('pibv', pibv, 1.0D3, 1.0D5, & 'Power injection building volume (m3)') - case ('rbrt') - call parse_real_variable('rbrt', rbrt, 0.0D0, 10.0D0, & + case ('rbrt') + call parse_real_variable('rbrt', rbrt, 0.0D0, 10.0D0, & 'Reactor building roof thickness (m)') - case ('rbvfac') - call parse_real_variable('rbvfac', rbvfac, 0.9D0, 3.0D0, & + case ('rbvfac') + call parse_real_variable('rbvfac', rbvfac, 0.9D0, 3.0D0, & 'Reactor building volume multiplier') - case ('rbwt') - call parse_real_variable('rbwt', rbwt, 0.0D0, 10.0D0, & + case ('rbwt') + call parse_real_variable('rbwt', rbwt, 0.0D0, 10.0D0, & 'Reactor building wall thickness (m)') - case ('row') - call parse_real_variable('row', row, 0.0D0, 10.0D0, & + case ('row') + call parse_real_variable('row', row, 0.0D0, 10.0D0, & 'Wall clearance for cranes (m)') - case ('rxcl') - call parse_real_variable('rxcl', rxcl, 0.0D0, 10.0D0, & + case ('rxcl') + call parse_real_variable('rxcl', rxcl, 0.0D0, 10.0D0, & 'Clearance around reactor (m)') - case ('shmf') - call parse_real_variable('shmf', shmf, 0.0D0, 1.0D0, & + case ('shmf') + call parse_real_variable('shmf', shmf, 0.0D0, 1.0D0, & 'Fraction of TF shield mass per lift') - case ('shov') - call parse_real_variable('shov', shov, 1.0D3, 1.0D6, & + case ('shov') + call parse_real_variable('shov', shov, 1.0D3, 1.0D6, & 'Shops and warehouse volume (m3)') - case ('stcl') - call parse_real_variable('stcl', stcl, 0.0D0, 10.0D0, & + case ('stcl') + call parse_real_variable('stcl', stcl, 0.0D0, 10.0D0, & 'Clearance above crane to roof (m)') - case ('tfcbv') - call parse_real_variable('tfcbv', tfcbv, 1.0D4, 1.0D6, & + case ('tfcbv') + call parse_real_variable('tfcbv', tfcbv, 1.0D4, 1.0D6, & 'TF coil power conv. bldg volume (m3)') - case ('trcl') - call parse_real_variable('trcl', trcl, 0.0D0, 10.0D0, & + case ('trcl') + call parse_real_variable('trcl', trcl, 0.0D0, 10.0D0, & 'Transport clearance between comps (m)') - case ('triv') - call parse_real_variable('triv', triv, 1.0D4, 1.0D6, & + case ('triv') + call parse_real_variable('triv', triv, 1.0D4, 1.0D6, & 'Tritium building volume (m3)') - case ('wgt') - call parse_real_variable('wgt', wgt, 1.0D4, 1.0D6, & + case ('wgt') + call parse_real_variable('wgt', wgt, 1.0D4, 1.0D6, & 'Reactor building crane capacity (kg)') - case ('wgt2') - call parse_real_variable('wgt2', wgt2, 1.0D4, 1.0D6, & + case ('wgt2') + call parse_real_variable('wgt2', wgt2, 1.0D4, 1.0D6, & 'Hot cell crane capacity (kg)') - case ('wsvfac') - call parse_real_variable('wsvfac', wsvfac, 0.9D0, 3.0D0, & + case ('wsvfac') + call parse_real_variable('wsvfac', wsvfac, 0.9D0, 3.0D0, & 'Warm shop building volume multiplier') - case ('aux_build_l') - call parse_real_variable('aux_build_l', aux_build_l, 10.0D0, 1000.0D0, & + case ('aux_build_l') + call parse_real_variable('aux_build_l', aux_build_l, 10.0D0, 1000.0D0, & 'aux building supporting tokamak processes, length (m)') - case ('aux_build_w') - call parse_real_variable('aux_build_w', aux_build_w, 10.0D0, 1000.0D0, & + case ('aux_build_w') + call parse_real_variable('aux_build_w', aux_build_w, 10.0D0, 1000.0D0, & 'aux building supporting tokamak processes, width (m)') - case ('aux_build_h') - call parse_real_variable('aux_build_h', aux_build_h, 1.0D0, 100.0D0, & + case ('aux_build_h') + call parse_real_variable('aux_build_h', aux_build_h, 1.0D0, 100.0D0, & 'aux building supporting tokamak processes, height (m)') - case ('auxcool_l') - call parse_real_variable('auxcool_l', auxcool_l, 10.0D0, 1000.0D0, & + case ('auxcool_l') + call parse_real_variable('auxcool_l', auxcool_l, 10.0D0, 1000.0D0, & 'Site-Wide Auxiliary Cooling Water facility, length (m)') - case ('auxcool_w') - call parse_real_variable('auxcool_w', auxcool_w, 10.0D0, 1000.0D0, & + case ('auxcool_w') + call parse_real_variable('auxcool_w', auxcool_w, 10.0D0, 1000.0D0, & 'Site-Wide Auxiliary Cooling Water facility, width (m)') - case ('auxcool_h') - call parse_real_variable('auxcool_h', auxcool_h, 1.0D0, 100.0D0, & + case ('auxcool_h') + call parse_real_variable('auxcool_h', auxcool_h, 1.0D0, 100.0D0, & 'Site-Wide Auxiliary Cooling Water facility, height (m)') - case ('bioshld_thk') - call parse_real_variable('bioshld_thk', bioshld_thk, 0.25D0, 25.0D0, & + case ('bioshld_thk') + call parse_real_variable('bioshld_thk', bioshld_thk, 0.25D0, 25.0D0, & 'Radial thickness of bio-shield around reactor (m)') - case ('chemlab_l') - call parse_real_variable('chemlab_l', chemlab_l, 10.0D0, 1000.0D0, & + case ('chemlab_l') + call parse_real_variable('chemlab_l', chemlab_l, 10.0D0, 1000.0D0, & 'Chemistry labs and treatment buldings, length (m)') - case ('chemlab_w') - call parse_real_variable('chemlab_w', chemlab_w, 10.0D0, 1000.0D0, & + case ('chemlab_w') + call parse_real_variable('chemlab_w', chemlab_w, 10.0D0, 1000.0D0, & 'Chemistry labs and treatment buldings, width (m)') - case ('chemlab_h') - call parse_real_variable('chemlab_h', chemlab_h, 1.0D0, 100.0D0, & + case ('chemlab_h') + call parse_real_variable('chemlab_h', chemlab_h, 1.0D0, 100.0D0, & 'Chemistry labs and treatment buldings, height (m)') - case ('control_buildings_l') - call parse_real_variable('control_buildings_l', control_buildings_l, 10.0D0, 1000.0D0, & + case ('control_buildings_l') + call parse_real_variable('control_buildings_l', control_buildings_l, 10.0D0, 1000.0D0, & 'control building, length (m)') - case ('control_buildings_w') - call parse_real_variable('control_buildings_w', control_buildings_w, 10.0D0, 1000.0D0, & + case ('control_buildings_w') + call parse_real_variable('control_buildings_w', control_buildings_w, 10.0D0, 1000.0D0, & 'control building, width (m)') - case ('control_buildings_h') - call parse_real_variable('control_buildings_h', control_buildings_h, 1.0D0, 100.0D0, & + case ('control_buildings_h') + call parse_real_variable('control_buildings_h', control_buildings_h, 1.0D0, 100.0D0, & 'control building, height (m)') - case ('crane_arm_h') - call parse_real_variable('crane_arm_h', crane_arm_h, 1.0D0, 100.0D0, & + case ('crane_arm_h') + call parse_real_variable('crane_arm_h', crane_arm_h, 1.0D0, 100.0D0, & 'vertical dimension of crane arm, operating over reactor (m)') - case ('crane_clrnc_h') - call parse_real_variable('crane_clrnc_h', crane_clrnc_h, 0.0D0, 10.0D0, & + case ('crane_clrnc_h') + call parse_real_variable('crane_clrnc_h', crane_clrnc_h, 0.0D0, 10.0D0, & 'horizontal clearance to building wall for crane operation (m)') - case ('crane_clrnc_v') - call parse_real_variable('crane_clrnc_v', crane_clrnc_v, 0.0D0, 10.0D0, & + case ('crane_clrnc_v') + call parse_real_variable('crane_clrnc_v', crane_clrnc_v, 0.0D0, 10.0D0, & 'vertical clearance for crane operation (m)') - case ('cryomag_l') - call parse_real_variable('cryomag_l', cryomag_l, 10.0D0, 1000.0D0, & + case ('cryomag_l') + call parse_real_variable('cryomag_l', cryomag_l, 10.0D0, 1000.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, length (m)') - case ('cryomag_w') - call parse_real_variable('cryomag_w', cryomag_w, 10.0D0, 1000.0D0, & + case ('cryomag_w') + call parse_real_variable('cryomag_w', cryomag_w, 10.0D0, 1000.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, width (m)') - case ('cryomag_h') - call parse_real_variable('cryomag_h', cryomag_h, 1.0D0, 100.0D0, & + case ('cryomag_h') + call parse_real_variable('cryomag_h', cryomag_h, 1.0D0, 100.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, height (m)') - case ('cryostore_l') - call parse_real_variable('cryostore_l', cryostore_l, 10.0D0, 1000.0D0, & + case ('cryostore_l') + call parse_real_variable('cryostore_l', cryostore_l, 10.0D0, 1000.0D0, & 'Magnet Cryo Storage Tanks, length (m)') - case ('cryostore_w') - call parse_real_variable('cryostore_w', cryostore_w, 10.0D0, 1000.0D0, & + case ('cryostore_w') + call parse_real_variable('cryostore_w', cryostore_w, 10.0D0, 1000.0D0, & 'Magnet Cryo Storage Tanks, width (m)') - case ('cryostore_h') - call parse_real_variable('cryostore_h', cryostore_h, 1.0D0, 100.0D0, & + case ('cryostore_h') + call parse_real_variable('cryostore_h', cryostore_h, 1.0D0, 100.0D0, & 'Magnet Cryo Storage Tanks, height (m)') - case ('cryostat_clrnc') - call parse_real_variable('cryostat_clrnc', cryostat_clrnc, 0.0D0, 10.0D0, & + case ('cryostat_clrnc') + call parse_real_variable('cryostat_clrnc', cryostat_clrnc, 0.0D0, 10.0D0, & 'vertical clearance from TF coil to cryostat (m)') - case ('elecdist_l') - call parse_real_variable('elecdist_l', elecdist_l, 10.0D0, 1000.0D0, & + case ('elecdist_l') + call parse_real_variable('elecdist_l', elecdist_l, 10.0D0, 1000.0D0, & 'Transformers and electrical distribution facilities, length (m)') - case ('elecdist_w') - call parse_real_variable('elecdist_w', elecdist_w, 10.0D0, 1000.0D0, & + case ('elecdist_w') + call parse_real_variable('elecdist_w', elecdist_w, 10.0D0, 1000.0D0, & 'Transformers and electrical distribution facilities, width (m)') - case ('elecdist_h') - call parse_real_variable('elecdist_h', elecdist_h, 1.0D0, 100.0D0, & + case ('elecdist_h') + call parse_real_variable('elecdist_h', elecdist_h, 1.0D0, 100.0D0, & 'Transformers and electrical distribution facilities, height (m)') - case ('elecload_l') - call parse_real_variable('elecload_l', elecload_l, 10.0D0, 1000.0D0, & + case ('elecload_l') + call parse_real_variable('elecload_l', elecload_l, 10.0D0, 1000.0D0, & 'Electric (eesential and non-essential) load centres, length (m)') - case ('elecload_w') - call parse_real_variable('elecload_w', elecload_w, 10.0D0, 1000.0D0, & + case ('elecload_w') + call parse_real_variable('elecload_w', elecload_w, 10.0D0, 1000.0D0, & 'Electric (eesential and non-essential) load centres, width (m)') - case ('elecload_h') - call parse_real_variable('elecload_h', elecload_h, 1.0D0, 100.0D0, & + case ('elecload_h') + call parse_real_variable('elecload_h', elecload_h, 1.0D0, 100.0D0, & 'Electric (eesential and non-essential) load centres, height (m)') - case ('elecstore_l') - call parse_real_variable('elecstore_l', elecstore_l, 10.0D0, 1000.0D0, & + case ('elecstore_l') + call parse_real_variable('elecstore_l', elecstore_l, 10.0D0, 1000.0D0, & 'Energy Storage facilities, length (m)') - case ('elecstore_w') - call parse_real_variable('elecstore_w', elecstore_w, 10.0D0, 1000.0D0, & + case ('elecstore_w') + call parse_real_variable('elecstore_w', elecstore_w, 10.0D0, 1000.0D0, & 'Energy Storage facilities, width (m)') - case ('elecstore_h') - call parse_real_variable('elecstore_h', elecstore_h, 1.0D0, 100.0D0, & + case ('elecstore_h') + call parse_real_variable('elecstore_h', elecstore_h, 1.0D0, 100.0D0, & 'Energy Storage facilities, height (m)') - case ('fc_building_l') - call parse_real_variable('fc_building_l', fc_building_l, 10.0D0, 1000.0D0, & + case ('fc_building_l') + call parse_real_variable('fc_building_l', fc_building_l, 10.0D0, 1000.0D0, & 'Fuel Cycle facilities, length (m)') - case ('fc_building_w') - call parse_real_variable('fc_building_w', fc_building_w, 10.0D0, 1000.0D0, & + case ('fc_building_w') + call parse_real_variable('fc_building_w', fc_building_w, 10.0D0, 1000.0D0, & 'Fuel Cycle facilities, width (m)') - case ('gas_buildings_l') - call parse_real_variable('gas_buildings_l', gas_buildings_l, 10.0D0, 1000.0D0, & + case ('gas_buildings_l') + call parse_real_variable('gas_buildings_l', gas_buildings_l, 10.0D0, 1000.0D0, & 'air & gas supply (amalgamated) buildings, length (m)') - case ('gas_buildings_w') - call parse_real_variable('gas_buildings_w', gas_buildings_w, 10.0D0, 1000.0D0, & + case ('gas_buildings_w') + call parse_real_variable('gas_buildings_w', gas_buildings_w, 10.0D0, 1000.0D0, & 'air & gas supply (amalgamated) buildings, width (m)') - case ('gas_buildings_h') - call parse_real_variable('gas_buildings_h', gas_buildings_h, 1.0D0, 100.0D0, & + case ('gas_buildings_h') + call parse_real_variable('gas_buildings_h', gas_buildings_h, 1.0D0, 100.0D0, & 'air & gas supply (amalgamated) buildings, height (m)') - case ('ground_clrnc') - call parse_real_variable('ground_clrnc', ground_clrnc, 0.0D0, 10.0D0, & + case ('ground_clrnc') + call parse_real_variable('ground_clrnc', ground_clrnc, 0.0D0, 10.0D0, & 'clearance beneath TF coil (m)') - case ('hcd_building_l') - call parse_real_variable('hcd_building_l', hcd_building_l, 10.0D0, 1000.0D0, & + case ('hcd_building_l') + call parse_real_variable('hcd_building_l', hcd_building_l, 10.0D0, 1000.0D0, & 'HCD building, length (m)') - case ('hcd_building_w') - call parse_real_variable('hcd_building_w', hcd_building_w, 10.0D0, 1000.0D0, & + case ('hcd_building_w') + call parse_real_variable('hcd_building_w', hcd_building_w, 10.0D0, 1000.0D0, & 'HCD building, width (m)') - case ('hcd_building_h') - call parse_real_variable('hcd_building_h', hcd_building_h, 1.0D0, 100.0D0, & + case ('hcd_building_h') + call parse_real_variable('hcd_building_h', hcd_building_h, 1.0D0, 100.0D0, & 'HCD building, height (m)') - case ('hw_storage_l') - call parse_real_variable('hw_storage_l', hw_storage_l, 10.0D0, 1000.0D0, & + case ('hw_storage_l') + call parse_real_variable('hw_storage_l', hw_storage_l, 10.0D0, 1000.0D0, & 'hazardous waste storage building, length (m)') - case ('hw_storage_w') - call parse_real_variable('hw_storage_w', hw_storage_w, 10.0D0, 1000.0D0, & + case ('hw_storage_w') + call parse_real_variable('hw_storage_w', hw_storage_w, 10.0D0, 1000.0D0, & 'hazardous waste storage building, width (m)') - case ('hw_storage_h') - call parse_real_variable('hw_storage_h', hw_storage_h, 1.0D0, 100.0D0, & + case ('hw_storage_h') + call parse_real_variable('hw_storage_h', hw_storage_h, 1.0D0, 100.0D0, & 'hazardous waste storage building, height (m)') - case ('heat_sink_l') - call parse_real_variable('heat_sink_l', heat_sink_l, 10.0D0, 1000.0D0, & + case ('heat_sink_l') + call parse_real_variable('heat_sink_l', heat_sink_l, 10.0D0, 1000.0D0, & 'heat sinks, length (m)') - case ('heat_sink_w') - call parse_real_variable('heat_sink_w', heat_sink_w, 10.0D0, 1000.0D0, & + case ('heat_sink_w') + call parse_real_variable('heat_sink_w', heat_sink_w, 10.0D0, 1000.0D0, & 'heat sinks, width (m)') - case ('heat_sink_h') - call parse_real_variable('heat_sink_h', heat_sink_h, 1.0D0, 100.0D0, & + case ('heat_sink_h') + call parse_real_variable('heat_sink_h', heat_sink_h, 1.0D0, 100.0D0, & 'heat sinks, height (m)') - case ('hot_sepdist') - call parse_real_variable('hot_sepdist', hot_sepdist, 0.0D0, 10.0D0, & + case ('hot_sepdist') + call parse_real_variable('hot_sepdist', hot_sepdist, 0.0D0, 10.0D0, & '') - case ('hotcell_h') - call parse_real_variable('hotcell_h', hotcell_h, 1.0D0, 100.0D0, & + case ('hotcell_h') + call parse_real_variable('hotcell_h', hotcell_h, 1.0D0, 100.0D0, & 'hot cell storage component separation distance (m)') - case ('ilw_smelter_l') - call parse_real_variable('ilw_smelter_l', ilw_smelter_l, 10.0D0, 1000.0D0, & + case ('ilw_smelter_l') + call parse_real_variable('ilw_smelter_l', ilw_smelter_l, 10.0D0, 1000.0D0, & 'radioactive waste smelting facility, length (m)') - case ('ilw_smelter_w') - call parse_real_variable('ilw_smelter_w', ilw_smelter_w, 10.0D0, 1000.0D0, & + case ('ilw_smelter_w') + call parse_real_variable('ilw_smelter_w', ilw_smelter_w, 10.0D0, 1000.0D0, & 'radioactive waste smelting facility, width (m)') - case ('ilw_smelter_h') - call parse_real_variable('ilw_smelter_h', ilw_smelter_h, 1.0D0, 100.0D0, & + case ('ilw_smelter_h') + call parse_real_variable('ilw_smelter_h', ilw_smelter_h, 1.0D0, 100.0D0, & 'radioactive waste smelting facility, height (m)') - case ('ilw_storage_l') - call parse_real_variable('ilw_storage_l', ilw_storage_l, 10.0D0, 1000.0D0, & + case ('ilw_storage_l') + call parse_real_variable('ilw_storage_l', ilw_storage_l, 10.0D0, 1000.0D0, & 'ILW waste storage building, length (m)') - case ('ilw_storage_w') - call parse_real_variable('ilw_storage_w', ilw_storage_w, 10.0D0, 1000.0D0, & + case ('ilw_storage_w') + call parse_real_variable('ilw_storage_w', ilw_storage_w, 10.0D0, 1000.0D0, & 'ILW waste storage building, width (m)') - case ('ilw_storage_h') - call parse_real_variable('ilw_storage_h', ilw_storage_h, 1.0D0, 100.0D0, & + case ('ilw_storage_h') + call parse_real_variable('ilw_storage_h', ilw_storage_h, 1.0D0, 100.0D0, & 'ILW waste storage building, height (m)') - case ('llw_storage_l') - call parse_real_variable('llw_storage_l', llw_storage_l, 10.0D0, 1000.0D0, & + case ('llw_storage_l') + call parse_real_variable('llw_storage_l', llw_storage_l, 10.0D0, 1000.0D0, & 'LLW waste storage building, length (m)') - case ('llw_storage_w') - call parse_real_variable('llw_storage_w', llw_storage_w, 10.0D0, 1000.0D0, & + case ('llw_storage_w') + call parse_real_variable('llw_storage_w', llw_storage_w, 10.0D0, 1000.0D0, & 'LLW waste storage building, width (m)') - case ('llw_storage_h') - call parse_real_variable('llw_storage_h', llw_storage_h, 1.0D0, 100.0D0, & + case ('llw_storage_h') + call parse_real_variable('llw_storage_h', llw_storage_h, 1.0D0, 100.0D0, & 'LLW waste storage building, height (m)') - case ('magnet_pulse_l') - call parse_real_variable('magnet_pulse_l', magnet_pulse_l, 10.0D0, 1000.0D0, & + case ('magnet_pulse_l') + call parse_real_variable('magnet_pulse_l', magnet_pulse_l, 10.0D0, 1000.0D0, & 'pulsed magnet power building, length (m)') - case ('magnet_pulse_w') - call parse_real_variable('magnet_pulse_w', magnet_pulse_w, 10.0D0, 1000.0D0, & + case ('magnet_pulse_w') + call parse_real_variable('magnet_pulse_w', magnet_pulse_w, 10.0D0, 1000.0D0, & 'pulsed magnet power building, width (m)') - case ('magnet_pulse_h') - call parse_real_variable('magnet_pulse_h', magnet_pulse_h, 1.0D0, 100.0D0, & + case ('magnet_pulse_h') + call parse_real_variable('magnet_pulse_h', magnet_pulse_h, 1.0D0, 100.0D0, & 'pulsed magnet power building, height (m)') - case ('magnet_trains_l') - call parse_real_variable('magnet_trains_l', magnet_trains_l, 10.0D0, 1000.0D0, & + case ('magnet_trains_l') + call parse_real_variable('magnet_trains_l', magnet_trains_l, 10.0D0, 1000.0D0, & 'steady state magnet power trains building, length (m)') - case ('magnet_trains_w') - call parse_real_variable('magnet_trains_w', magnet_trains_w, 10.0D0, 1000.0D0, & + case ('magnet_trains_w') + call parse_real_variable('magnet_trains_w', magnet_trains_w, 10.0D0, 1000.0D0, & 'steady state magnet power trains building, width (m)') - case ('magnet_trains_h') - call parse_real_variable('magnet_trains_h', magnet_trains_h, 1.0D0, 100.0D0, & + case ('magnet_trains_h') + call parse_real_variable('magnet_trains_h', magnet_trains_h, 1.0D0, 100.0D0, & 'steady state magnet power trains building, height (m)') - case ('maint_cont_l') - call parse_real_variable('maint_cont_l', maint_cont_l, 10.0D0, 1000.0D0, & + case ('maint_cont_l') + call parse_real_variable('maint_cont_l', maint_cont_l, 10.0D0, 1000.0D0, & 'maintenance control building, length (m)') - case ('maint_cont_w') - call parse_real_variable('maint_cont_w', maint_cont_w, 10.0D0, 1000.0D0, & + case ('maint_cont_w') + call parse_real_variable('maint_cont_w', maint_cont_w, 10.0D0, 1000.0D0, & 'maintenance control building, width (m)') - case ('maint_cont_h') - call parse_real_variable('maint_cont_h', maint_cont_h, 1.0D0, 100.0D0, & + case ('maint_cont_h') + call parse_real_variable('maint_cont_h', maint_cont_h, 1.0D0, 100.0D0, & 'maintenance control building, height (m)') - case ('nbi_sys_l') - call parse_real_variable('nbi_sys_l', nbi_sys_l, 10.0D0, 1000.0D0, & + case ('nbi_sys_l') + call parse_real_variable('nbi_sys_l', nbi_sys_l, 10.0D0, 1000.0D0, & 'NBI system length (m)') - case ('nbi_sys_w') - call parse_real_variable('nbi_sys_w', nbi_sys_w, 10.0D0, 1000.0D0, & + case ('nbi_sys_w') + call parse_real_variable('nbi_sys_w', nbi_sys_w, 10.0D0, 1000.0D0, & 'NBI system width (m)') - case ('qnty_sfty_fac') - call parse_real_variable('qnty_sfty_fac', qnty_sfty_fac, 0.0D0, 10.0D0, & + case ('qnty_sfty_fac') + call parse_real_variable('qnty_sfty_fac', qnty_sfty_fac, 0.0D0, 10.0D0, & 'quantity safety factor for component use during plant lifetime') - case ('reactor_clrnc') - call parse_real_variable('reactor_clrnc', reactor_clrnc, 0.0D0, 10.0D0, & + case ('reactor_clrnc') + call parse_real_variable('reactor_clrnc', reactor_clrnc, 0.0D0, 10.0D0, & 'clearance around reactor (m)') - case ('reactor_fndtn_thk') - call parse_real_variable('reactor_fndtn_thk', reactor_fndtn_thk, 0.25D0, 25.0D0, & + case ('reactor_fndtn_thk') + call parse_real_variable('reactor_fndtn_thk', reactor_fndtn_thk, 0.25D0, 25.0D0, & 'reactor building foundation thickness (m)') - case ('reactor_hall_l') - call parse_real_variable('reactor_hall_l', reactor_hall_l, 10.0D0, 1000.0D0, & + case ('reactor_hall_l') + call parse_real_variable('reactor_hall_l', reactor_hall_l, 10.0D0, 1000.0D0, & 'reactor building, length (m)') - case ('reactor_hall_w') - call parse_real_variable('reactor_hall_w', reactor_hall_w, 10.0D0, 1000.0D0, & + case ('reactor_hall_w') + call parse_real_variable('reactor_hall_w', reactor_hall_w, 10.0D0, 1000.0D0, & 'reactor building, width (m)') - case ('reactor_hall_h') - call parse_real_variable('reactor_hall_h', reactor_hall_h, 1.0D0, 100.0D0, & + case ('reactor_hall_h') + call parse_real_variable('reactor_hall_h', reactor_hall_h, 1.0D0, 100.0D0, & 'reactor building, height (m)') - case ('reactor_roof_thk') - call parse_real_variable('reactor_roof_thk', reactor_roof_thk, 0.25D0, 25.0D0, & + case ('reactor_roof_thk') + call parse_real_variable('reactor_roof_thk', reactor_roof_thk, 0.25D0, 25.0D0, & 'reactor building roof thickness (m)') - case ('reactor_wall_thk') - call parse_real_variable('reactor_wall_thk', reactor_wall_thk, 0.25D0, 25.0D0, & + case ('reactor_wall_thk') + call parse_real_variable('reactor_wall_thk', reactor_wall_thk, 0.25D0, 25.0D0, & 'reactor building wall thickness (m)') - case ('robotics_l') - call parse_real_variable('robotics_l', robotics_l, 10.0D0, 1000.0D0, & + case ('robotics_l') + call parse_real_variable('robotics_l', robotics_l, 10.0D0, 1000.0D0, & 'robotics buildings, length (m)') - case ('robotics_w') - call parse_real_variable('robotics_w', robotics_w, 10.0D0, 1000.0D0, & + case ('robotics_w') + call parse_real_variable('robotics_w', robotics_w, 10.0D0, 1000.0D0, & 'robotics buildings, width (m)') - case ('robotics_h') - call parse_real_variable('robotics_h', robotics_h, 1.0D0, 100.0D0, & + case ('robotics_h') + call parse_real_variable('robotics_h', robotics_h, 1.0D0, 100.0D0, & 'robotics buildings, height (m)') - case ('sec_buildings_l') - call parse_real_variable('sec_buildings_l', sec_buildings_l, 10.0D0, 1000.0D0, & + case ('sec_buildings_l') + call parse_real_variable('sec_buildings_l', sec_buildings_l, 10.0D0, 1000.0D0, & 'security & safety buildings, length (m)') - case ('sec_buildings_w') - call parse_real_variable('sec_buildings_w', sec_buildings_w, 10.0D0, 1000.0D0, & + case ('sec_buildings_w') + call parse_real_variable('sec_buildings_w', sec_buildings_w, 10.0D0, 1000.0D0, & 'security & safety buildings, width (m)') - case ('sec_buildings_h') - call parse_real_variable('sec_buildings_h', sec_buildings_h, 1.0D0, 100.0D0, & + case ('sec_buildings_h') + call parse_real_variable('sec_buildings_h', sec_buildings_h, 1.0D0, 100.0D0, & 'security & safety buildings, height (m)') - case ('staff_buildings_h') - call parse_real_variable('staff_buildings_h', staff_buildings_h, 1.0D0, 100.0D0, & + case ('staff_buildings_h') + call parse_real_variable('staff_buildings_h', staff_buildings_h, 1.0D0, 100.0D0, & 'staff buildings height (m)') - case ('staff_buildings_area') - call parse_real_variable('staff_buildings_area', staff_buildings_area, 1.0D4, 1.0D6, & + case ('staff_buildings_area') + call parse_real_variable('staff_buildings_area', staff_buildings_area, 1.0D4, 1.0D6, & 'footprint of staff buildings (m2)') - case ('transp_clrnc') - call parse_real_variable('transp_clrnc', transp_clrnc, 0.0D0, 10.0D0, & + case ('transp_clrnc') + call parse_real_variable('transp_clrnc', transp_clrnc, 0.0D0, 10.0D0, & 'transportation clearance between components (m)') - case ('turbine_hall_l') - call parse_real_variable('turbine_hall_l', turbine_hall_l, 10.0D0, 1000.0D0, & + case ('turbine_hall_l') + call parse_real_variable('turbine_hall_l', turbine_hall_l, 10.0D0, 1000.0D0, & 'turbine hall, length (m)') - case ('turbine_hall_w') - call parse_real_variable('turbine_hall_w', turbine_hall_w, 10.0D0, 1000.0D0, & + case ('turbine_hall_w') + call parse_real_variable('turbine_hall_w', turbine_hall_w, 10.0D0, 1000.0D0, & 'turbine hall, width (m)') - case ('turbine_hall_h') - call parse_real_variable('turbine_hall_h', turbine_hall_h, 1.0D0, 100.0D0, & + case ('turbine_hall_h') + call parse_real_variable('turbine_hall_h', turbine_hall_h, 1.0D0, 100.0D0, & 'turbine hall, height (m)') - case ('tw_storage_l') - call parse_real_variable('tw_storage_l', tw_storage_l, 10.0D0, 1000.0D0, & + case ('tw_storage_l') + call parse_real_variable('tw_storage_l', tw_storage_l, 10.0D0, 1000.0D0, & 'tritiated waste storage building, length (m)') - case ('tw_storage_w') - call parse_real_variable('tw_storage_w', tw_storage_w, 10.0D0, 1000.0D0, & + case ('tw_storage_w') + call parse_real_variable('tw_storage_w', tw_storage_w, 10.0D0, 1000.0D0, & 'tritiated waste storage building, width (m)') - case ('tw_storage_h') - call parse_real_variable('tw_storage_h', tw_storage_h, 1.0D0, 100.0D0, & + case ('tw_storage_h') + call parse_real_variable('tw_storage_h', tw_storage_h, 1.0D0, 100.0D0, & 'tritiated waste storage building, height (m)') - case ('warm_shop_l') - call parse_real_variable('warm_shop_l', warm_shop_l, 10.0D0, 1000.0D0, & + case ('warm_shop_l') + call parse_real_variable('warm_shop_l', warm_shop_l, 10.0D0, 1000.0D0, & 'warm shop, length (m)') - case ('warm_shop_w') - call parse_real_variable('warm_shop_w', warm_shop_w, 10.0D0, 1000.0D0, & + case ('warm_shop_w') + call parse_real_variable('warm_shop_w', warm_shop_w, 10.0D0, 1000.0D0, & 'warm shop, width (m)') - case ('warm_shop_h') - call parse_real_variable('warm_shop_h', warm_shop_h, 1.0D0, 100.0D0, & + case ('warm_shop_h') + call parse_real_variable('warm_shop_h', warm_shop_h, 1.0D0, 100.0D0, & 'warm shop, height (m)') - case ('water_buildings_l') - call parse_real_variable('water_buildings_l', water_buildings_l, 10.0D0, 1000.0D0, & + case ('water_buildings_l') + call parse_real_variable('water_buildings_l', water_buildings_l, 10.0D0, 1000.0D0, & 'water, laundry & drainage buildings, length (m)') - case ('water_buildings_w') - call parse_real_variable('water_buildings_w', water_buildings_w, 10.0D0, 1000.0D0, & + case ('water_buildings_w') + call parse_real_variable('water_buildings_w', water_buildings_w, 10.0D0, 1000.0D0, & 'water, laundry & drainage buildings, width (m)') - case ('water_buildings_h') - call parse_real_variable('water_buildings_h', water_buildings_h, 1.0D0, 100.0D0, & + case ('water_buildings_h') + call parse_real_variable('water_buildings_h', water_buildings_h, 1.0D0, 100.0D0, & 'water, laundry & drainage buildings, height (m)') - case ('workshop_l') - call parse_real_variable('workshop_l', workshop_l, 10.0D0, 1000.0D0, & + case ('workshop_l') + call parse_real_variable('workshop_l', workshop_l, 10.0D0, 1000.0D0, & 'workshop buildings, length (m)') - case ('workshop_w') - call parse_real_variable('workshop_w', workshop_w, 10.0D0, 1000.0D0, & + case ('workshop_w') + call parse_real_variable('workshop_w', workshop_w, 10.0D0, 1000.0D0, & 'workshop buildings, width (m)') - case ('workshop_h') - call parse_real_variable('workshop_h', workshop_h, 1.0D0, 100.0D0, & + case ('workshop_h') + call parse_real_variable('workshop_h', workshop_h, 1.0D0, 100.0D0, & 'workshop buildings, height (m)') - ! Energy storage settings + ! Energy storage settings - case ('iscenr') - call parse_int_variable('iscenr', iscenr, 1, 3, & + case ('iscenr') + call parse_int_variable('iscenr', iscenr, 1, 3, & 'Switch for energy storage option') - case ('maxpoloidalpower') - call parse_real_variable('maxpoloidalpower', maxpoloidalpower, 0.0D0, 2.0D3, & + case ('maxpoloidalpower') + call parse_real_variable('maxpoloidalpower', maxpoloidalpower, 0.0D0, 2.0D3, & 'Maximum permitted absolute rate of change of stored energy in poloidal field (MW)') - ! Output file options settings + ! Output file options settings - case ('sect01', 'sect02', 'sect03', 'sect04', 'sect05', & - 'sect06', 'sect07', 'sect08', 'sect09', 'sect10', & - 'sect11', 'sect12', 'sect13', 'sect14', 'sect15', & - 'sect16', 'sect17', 'sect18', 'sect19', 'sect20', & - 'sect21') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'SECT flags are now ignored -' - write(outfile,*) 'please remove them from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' + case ('sect01', 'sect02', 'sect03', 'sect04', 'sect05', & + 'sect06', 'sect07', 'sect08', 'sect09', 'sect10', & + 'sect11', 'sect12', 'sect13', 'sect14', 'sect15', & + 'sect16', 'sect17', 'sect18', 'sect19', 'sect20', & + 'sect21') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'SECT flags are now ignored -' + write(outfile,*) 'please remove them from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' - ! Vacuum system settings + ! Vacuum system settings - case ('vacuum_model') - call parse_string_variable('vacuum_model', vacuum_model, 'vacuum_model') + case ('vacuum_model') + call parse_string_variable('vacuum_model', vacuum_model, 'vacuum_model') - case ('ntype') - call parse_int_variable('ntype', ntype, 0, 1, & + case ('ntype') + call parse_int_variable('ntype', ntype, 0, 1, & 'Pump type') - case ('pbase') - call parse_real_variable('pbase', pbase, 1.0D-8, 1.0D-3, & + case ('pbase') + call parse_real_variable('pbase', pbase, 1.0D-8, 1.0D-3, & 'Base pressure (Pa)') - case ('prdiv') - call parse_real_variable('prdiv', prdiv, 0.0D0, 10.0D0, & + case ('prdiv') + call parse_real_variable('prdiv', prdiv, 0.0D0, 10.0D0, & 'Divertor chamber pressure in burn (Pa)') - case ('pumptp') - call parse_real_variable('pumptp', pumptp, 0.0D0, 1.0D30, & + case ('pumptp') + call parse_real_variable('pumptp', pumptp, 0.0D0, 1.0D30, & 'Pump throughput (molecules/s) (default is ITER value)') - case ('rat') - call parse_real_variable('rat', rat, 1.0D-10, 1.0D-6, & + case ('rat') + call parse_real_variable('rat', rat, 1.0D-10, 1.0D-6, & 'Plas chamber wall outgas rate (Pa-m/s)') - case ('tn') - call parse_real_variable('tn', tn, 1.0D0, 1.0D3, & + case ('tn') + call parse_real_variable('tn', tn, 1.0D0, 1.0D3, & 'Neutral gas temp in chamber (K)') - case ('dwell_pump') - call parse_int_variable('dwell_pump', dwell_pump, 0, 2, & + case ('dwell_pump') + call parse_int_variable('dwell_pump', dwell_pump, 0, 2, & 'switch for dwell pumping options') - case ('pumpareafraction') - call parse_real_variable('pumpareafraction', pumpareafraction, 1.0D-6, 1.0D0, & + case ('pumpareafraction') + call parse_real_variable('pumpareafraction', pumpareafraction, 1.0D-6, 1.0D0, & 'Area of one pumping port as a fraction of plasma surface area') - case ('pumpspeedmax') - call parse_real_variable('pumpspeedmax', pumpspeedmax, 1.0D-6, 1.0D3, & + case ('pumpspeedmax') + call parse_real_variable('pumpspeedmax', pumpspeedmax, 1.0D-6, 1.0D3, & 'Maximum pumping speed per unit area for deuterium & tritium, molecular flow') - case ('pumpspeedfactor') - call parse_real_variable('pumpspeedfactor', pumpspeedfactor, 1.0D-6, 1.0D0, & + case ('pumpspeedfactor') + call parse_real_variable('pumpspeedfactor', pumpspeedfactor, 1.0D-6, 1.0D0, & 'Effective pumping speed reduction factor due to duct impedance') - case ('initialpressure') - call parse_real_variable('initialpressure', initialpressure, 1.0D-6, 1.0D4, & + case ('initialpressure') + call parse_real_variable('initialpressure', initialpressure, 1.0D-6, 1.0D4, & 'initial neutral pressure at the beginning of the dwell phase (Pa)') - case ('outgasindex') - call parse_real_variable('outgasindex', outgasindex, 1.0D-6, 1.0D3, & + case ('outgasindex') + call parse_real_variable('outgasindex', outgasindex, 1.0D-6, 1.0D3, & 'outgassing decay index') - case ('outgasfactor') - call parse_real_variable('outgasfactor', outgasfactor, 1.0D-6, 1.0D3, & + case ('outgasfactor') + call parse_real_variable('outgasfactor', outgasfactor, 1.0D-6, 1.0D3, & 'outgassing prefactor kw: outgassing rate at 1 s per unit area (Pa m s-1)') - ! Reinke criterion - case ('lhat') - call parse_real_variable('lhat', lhat, 1.0D0, 1.5D1, & + ! Reinke criterion + case ('lhat') + call parse_real_variable('lhat', lhat, 1.0D0, 1.5D1, & 'connection length factor') - case ('reinke_mode') - call parse_int_variable('reinke_mode', reinke_mode, 0, 1, & + case ('reinke_mode') + call parse_int_variable('reinke_mode', reinke_mode, 0, 1, & 'Switch for Reinke Criterion mode (0=H, 1=I)') - case ('impvardiv') - call parse_int_variable('impvardiv', impvardiv, 3, nimp, & + case ('impvardiv') + call parse_int_variable('impvardiv', impvardiv, 3, nimp, & 'Index of impurity to be iterated for Reike criterion') - ! Stellarator settings + ! Stellarator settings - case ('istell') - call parse_int_variable('istell', istell, 0, 6, & + case ('istell') + call parse_int_variable('istell', istell, 0, 6, & 'Stellarator machine specification (1=Helias5, 2=Helias4, 3=Helias3, 4=W7X50, 5=W7X30, 6=jsoninput)') - case ('bmn') - call parse_real_variable('bmn', bmn, 1.0D-4, 1.0D-2, & + case ('bmn') + call parse_real_variable('bmn', bmn, 1.0D-4, 1.0D-2, & 'Relative radial field perturbation') - case ('max_gyrotron_frequency') - call parse_real_variable('max_gyrotron_frequency', max_gyrotron_frequency, 1.0d9, 1.0d14, & - 'Maximum avail. gyrotron frequency') - case ('te0_ecrh_achievable') - call parse_real_variable('te0_ecrh_achievable', te0_ecrh_achievable, 1.0d0, 1.0d3, & - 'Maximum achievable ecrh temperature (peak value)') - case ('f_asym') - call parse_real_variable('f_asym', f_asym, 0.9D0, 2.0D0, & + case ('max_gyrotron_frequency') + call parse_real_variable('max_gyrotron_frequency', max_gyrotron_frequency, 1.0d9, 1.0d14, & + 'Maximum avail. gyrotron frequency') + case ('te0_ecrh_achievable') + call parse_real_variable('te0_ecrh_achievable', te0_ecrh_achievable, 1.0d0, 1.0d3, & + 'Maximum achievable ecrh temperature (peak value)') + case ('f_asym') + call parse_real_variable('f_asym', f_asym, 0.9D0, 2.0D0, & 'Heat load peaking factor') - case ('f_rad') - call parse_real_variable('f_rad', f_rad, 0.0D0, 1.0D0, & + case ('f_rad') + call parse_real_variable('f_rad', f_rad, 0.0D0, 1.0D0, & 'Radiated power fraction in SOL') - case ('f_w') - call parse_real_variable('f_w', f_w, 0.1D0, 1.0D0, & + case ('f_w') + call parse_real_variable('f_w', f_w, 0.1D0, 1.0D0, & 'Island size fraction factor') - case ('fdivwet') - call parse_real_variable('fdivwet', fdivwet, 0.01D0, 1.0D0, & + case ('fdivwet') + call parse_real_variable('fdivwet', fdivwet, 0.01D0, 1.0D0, & 'Wetted area fraction of divertor plates') - case ('flpitch') - call parse_real_variable('flpitch', flpitch, 1.0D-4, 1.0D-2, & + case ('flpitch') + call parse_real_variable('flpitch', flpitch, 1.0D-4, 1.0D-2, & 'Field line pitch (rad)') - case ('iotabar') - call parse_real_variable('iotabar', iotabar, 0.1D0, 10.0D0, & + case ('iotabar') + call parse_real_variable('iotabar', iotabar, 0.1D0, 10.0D0, & 'Stellarator rotational transform (at s=2/3)') - case ('isthtr') - call parse_int_variable('isthtr', isthtr, 1, 3, & + case ('isthtr') + call parse_int_variable('isthtr', isthtr, 1, 3, & 'Stellarator method of auxiliary heating') - case ('m_res') - call parse_int_variable('m_res', m_res, 1, 10, & + case ('m_res') + call parse_int_variable('m_res', m_res, 1, 10, & 'Poloidal resonance number') - case ('n_res') - call parse_int_variable('n_res', n_res, 3, 6, & + case ('n_res') + call parse_int_variable('n_res', n_res, 3, 6, & 'Toroidal resonance number') - case ('shear') - call parse_real_variable('shear', shear, 0.1D0, 10.0D0, & + case ('shear') + call parse_real_variable('shear', shear, 0.1D0, 10.0D0, & 'Magnetic shear') - ! Inertial Fusion Energy plant settings - - case ('ife') - call parse_int_variable('ife', ife, 0, 1, & - 'Switch for Inertial Fusion Energy model') - case ('bldr') - call parse_real_variable('bldr', bldr, 0.0D0, 10.0D0, & - 'IFE blanket radial thickness (m)') - case ('bldrc') - call parse_real_variable('bldrc', bldrc, 0.0D0, 10.0D0, & - 'IFE curtain radial thickness (m)') - case ('bldzl') - call parse_real_variable('bldzl', bldzl, 0.0D0, 10.0D0, & - 'IFE blanket bottom part thickness (m)') - case ('bldzu') - call parse_real_variable('bldzu', bldzu, 0.0D0, 10.0D0, & - 'IFE blanket top part thickness (m)') - case ('blmatf') ! N.B. actually a 2-D array - call parse_real_array('blmatf', blmatf, isub1, 3*(maxmat+1), & - 'IFE blanket material fraction', icode) - case ('cdriv0') - call parse_real_variable('cdriv0', cdriv0, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('cdriv1') - call parse_real_variable('cdriv1', cdriv1, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('cdriv2') - call parse_real_variable('cdriv2', cdriv2, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('chdzl') - call parse_real_variable('chdzl', chdzl, 0.0D0, 10.0D0, & - 'IFE chamber bottom part thickness (m)') - case ('chdzu') - call parse_real_variable('chdzu', chdzu, 0.0D0, 10.0D0, & - 'IFE chamber top part thickness (m)') - case ('chmatf') - call parse_real_array('chmatf', chmatf, isub1, maxmat+1, & - 'IFE chamber material fraction', icode) - case ('chrad') - call parse_real_variable('chrad', chrad, 0.1D0, 20.0D0, & - 'IFE chamber radial thickness (m)') - case ('dcdrv0') - call parse_real_variable('dcdrv0', dcdrv0, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('dcdrv1') - call parse_real_variable('dcdrv1', dcdrv1, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('dcdrv2') - call parse_real_variable('dcdrv2', dcdrv2, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('drveff') - call parse_real_variable('drveff', drveff, 0.01D0, 1.0D0, & - 'IFE driver efficiency') - case ('edrive') - call parse_real_variable('edrive', edrive, 1.0D5, 50.0D8, & - 'IFE driver energy (J)') - case ('etali') - call parse_real_variable('etali', etali, 0.0D0, 1.0D0, & - 'IFE lithium pump wall plug efficiency') - case ('etave') - call parse_real_array('etave', etave, isub1, 10, & - 'IFE driver efficiency vs driver energy', icode) - case ('fauxbop') - call parse_real_variable('fauxbop', fauxbop, 0.0D0, 1.0D0, & - 'Frac. of gross electric power to BOP (IFE)') - case ('fbreed') - call parse_real_variable('fbreed', fbreed, 0.0D0, 0.999D0, & - 'Fraction of breeder outside core') - case ('fburn') - call parse_real_variable('fburn', fburn, 0.01D0, 1.0D0, & - 'IFE burn fraction') - case ('flirad') - call parse_real_variable('flirad', flirad, 0.0D0, 10.0D0, & - 'Radius of FLiBe inlet (HYLIFE) (m)') - case ('frrmax') - call parse_real_variable('frrmax', frrmax, 1.0D-6, 1.0D0, & - 'F-value for IFE repetition rate') - case ('fwdr') - call parse_real_variable('fwdr', fwdr, 0.0D0, 10.0D0, & - 'IFE first wall radial thickness (m)') - case ('fwdzl') - call parse_real_variable('fwdzl', fwdzl, 0.0D0, 10.0D0, & - 'IFE first wall bottom part thickness (m)') - case ('fwdzu') - call parse_real_variable('fwdzu', fwdzu, 0.0D0, 10.0D0, & - 'IFE first wall top part thickness (m)') - case ('fwmatf') ! N.B. actually a 2-D array - call parse_real_array('fwmatf', fwmatf, isub1, 3*(maxmat+1), & - 'IFE first wall material fraction', icode) - case ('gainve') - call parse_real_array('gainve', gainve, isub1, 10, & - 'IFE target gain vs driver energy', icode) - case ('htpmw_ife') - call parse_real_variable('htpmw_ife', htpmw_ife, 0.0D0, 1.0D3, & - 'IFE heat transport system electrical pump power (MW)') - case ('ifedrv') - call parse_int_variable('ifedrv', ifedrv, -1, 3, & - 'IFE driver type') - case ('ifetyp') - call parse_int_variable('ifetyp', ifetyp, 0, 4, & - 'IFE device build type') - case ('mcdriv') - call parse_real_variable('mcdriv', mcdriv, 0.1D0, 10.0D0, & - 'IFE driver cost multiplier') - case ('pdrive') - call parse_real_variable('pdrive', pdrive, 1.0D6, 200.0D6, & - 'IFE driver power to target (W)') - case ('pfusife') - call parse_real_variable('pfusife', pfusife, 0.0D0, 1.0D4, & - 'IFE input fusion power (MW) (ifedrv=3 only)') - case ('pifecr') - call parse_real_variable('pifecr', pifecr, 0.0D0, 100.0D0, & - 'IFE cryogenic power (MW)') - case ('ptargf') - call parse_real_variable('ptargf', ptargf, 0.1D0, 100.0D0, & - 'IFE target factory power at 6Hz (MW)') - case ('rrin') - call parse_real_variable('rrin', rrin, 0.1D0, 50.0D0, & - 'Input IFE repetition rate (Hz) (ifedrv=3 only)') - case ('rrmax') - call parse_real_variable('rrmax', rrmax, 1.0D0, 50.0D0, & - 'Maximum IFE repetition rate (Hz)') - case ('shdr') - call parse_real_variable('shdr', shdr, 0.0D0, 10.0D0, & - 'IFE shield radial thickness (m)') - case ('shdzl') - call parse_real_variable('shdzl', shdzl, 0.0D0, 10.0D0, & - 'IFE shield bottom part thickness (m)') - case ('shdzu') - call parse_real_variable('shdzu', shdzu, 0.0D0, 10.0D0, & - 'IFE shield top part thickness (m)') - case ('shmatf') ! N.B. actually a 2-D array - call parse_real_array('shmatf', shmatf, isub1, 3*(maxmat+1), & - 'IFE shield material fraction', icode) - case ('sombdr') - call parse_real_variable('sombdr', sombdr, 0.0D0, 10.0D0, & - 'Radius of SOMBRERO blanket bottom (m)') - case ('somtdr') - call parse_real_variable('somtdr', somtdr, 0.0D0, 10.0D0, & - 'Radius of SOMBRERO blanket top (m)') - case ('tgain') - call parse_real_variable('tgain', tgain, 1.0D0, 500.0D0, & - 'IFE target gain') - case ('uccarb') - call parse_real_variable('uccarb', uccarb, 10.0D0, 1.0D3, & - 'Cost of carbon cloth ($/kg)') - case ('ucconc') - call parse_real_variable('ucconc', ucconc, 0.1D0, 1.0D3, & - 'Cost of concrete ($/kg)') - case ('ucflib') - call parse_real_variable('ucflib', ucflib, 10.0D0, 1.0D3, & - 'Cost of FLiBe ($/kg)') - case ('uctarg') - call parse_real_variable('uctarg', uctarg, 0.1D0, 1.0D3, & - 'Cost per IFE target ($/target)') - case ('v1dr') - call parse_real_variable('v1dr', v1dr, 0.0D0, 10.0D0, & - 'IFE void 1 radial thickness (m)') - case ('v1dzl') - call parse_real_variable('v1dzl', v1dzl, 0.0D0, 10.0D0, & - 'IFE void 1 bottom part thickness (m)') - case ('v1dzu') - call parse_real_variable('v1dzu', v1dzu, 0.0D0, 10.0D0, & - 'IFE void 1 top part thickness (m)') - case ('v1matf') ! N.B. actually a 2-D array - call parse_real_array('v1matf', v1matf, isub1, 3*(maxmat+1), & - 'IFE void 1 material fraction', icode) - case ('v2dr') - call parse_real_variable('v2dr', v2dr, 0.0D0, 10.0D0, & - 'IFE void 2 radial thickness (m)') - case ('v2dzl') - call parse_real_variable('v2dzl', v2dzl, 0.0D0, 10.0D0, & - 'IFE void 2 bottom part thickness (m)') - case ('v2dzu') - call parse_real_variable('v2dzu', v2dzu, 0.0D0, 10.0D0, & - 'IFE void 2 top part thickness (m)') - case ('v2matf') ! N.B. actually a 2-D array - call parse_real_array('v2matf', v2matf, isub1, 3*(maxmat+1), & - 'IFE void 2 material fraction', icode) - case ('v3dr') - call parse_real_variable('v3dr', v3dr, 0.0D0, 50.0D0, & - 'IFE void 3 radial thickness (m)') - case ('v3dzl') - call parse_real_variable('v3dzl', v3dzl, 0.0D0, 30.0D0, & - 'IFE void 3 bottom part thickness (m)') - case ('v3dzu') - call parse_real_variable('v3dzu', v3dzu, 0.0D0, 30.0D0, & - 'IFE void 3 top part thickness (m)') - case ('v3matf') ! N.B. actually a 2-D array - call parse_real_array('v3matf', v3matf, isub1, 3*(maxmat+1), & - 'IFE void 3 material fraction', icode) - - ! Water usage settings - - case ('airtemp') - call parse_real_variable('airtemp', airtemp, -15.0D0, 40.0D0, & + ! Inertial Fusion Energy plant settings + + case ('ife') + call parse_int_variable('ife', ife, 0, 1, & + 'Switch for Inertial Fusion Energy model') + case ('bldr') + call parse_real_variable('bldr', bldr, 0.0D0, 10.0D0, & + 'IFE blanket radial thickness (m)') + case ('bldrc') + call parse_real_variable('bldrc', bldrc, 0.0D0, 10.0D0, & + 'IFE curtain radial thickness (m)') + case ('bldzl') + call parse_real_variable('bldzl', bldzl, 0.0D0, 10.0D0, & + 'IFE blanket bottom part thickness (m)') + case ('bldzu') + call parse_real_variable('bldzu', bldzu, 0.0D0, 10.0D0, & + 'IFE blanket top part thickness (m)') + case ('blmatf') ! N.B. actually a 2-D array + call parse_real_array('blmatf', blmatf, isub1, 3*(maxmat+1), & + 'IFE blanket material fraction', icode) + case ('cdriv0') + call parse_real_variable('cdriv0', cdriv0, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('cdriv1') + call parse_real_variable('cdriv1', cdriv1, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('cdriv2') + call parse_real_variable('cdriv2', cdriv2, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('chdzl') + call parse_real_variable('chdzl', chdzl, 0.0D0, 10.0D0, & + 'IFE chamber bottom part thickness (m)') + case ('chdzu') + call parse_real_variable('chdzu', chdzu, 0.0D0, 10.0D0, & + 'IFE chamber top part thickness (m)') + case ('chmatf') + call parse_real_array('chmatf', chmatf, isub1, maxmat+1, & + 'IFE chamber material fraction', icode) + case ('chrad') + call parse_real_variable('chrad', chrad, 0.1D0, 20.0D0, & + 'IFE chamber radial thickness (m)') + case ('dcdrv0') + call parse_real_variable('dcdrv0', dcdrv0, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('dcdrv1') + call parse_real_variable('dcdrv1', dcdrv1, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('dcdrv2') + call parse_real_variable('dcdrv2', dcdrv2, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('drveff') + call parse_real_variable('drveff', drveff, 0.01D0, 1.0D0, & + 'IFE driver efficiency') + case ('edrive') + call parse_real_variable('edrive', edrive, 1.0D5, 50.0D8, & + 'IFE driver energy (J)') + case ('etali') + call parse_real_variable('etali', etali, 0.0D0, 1.0D0, & + 'IFE lithium pump wall plug efficiency') + case ('etave') + call parse_real_array('etave', etave, isub1, 10, & + 'IFE driver efficiency vs driver energy', icode) + case ('fauxbop') + call parse_real_variable('fauxbop', fauxbop, 0.0D0, 1.0D0, & + 'Frac. of gross electric power to BOP (IFE)') + case ('fbreed') + call parse_real_variable('fbreed', fbreed, 0.0D0, 0.999D0, & + 'Fraction of breeder outside core') + case ('fburn') + call parse_real_variable('fburn', fburn, 0.01D0, 1.0D0, & + 'IFE burn fraction') + case ('flirad') + call parse_real_variable('flirad', flirad, 0.0D0, 10.0D0, & + 'Radius of FLiBe inlet (HYLIFE) (m)') + case ('frrmax') + call parse_real_variable('frrmax', frrmax, 1.0D-6, 1.0D0, & + 'F-value for IFE repetition rate') + case ('fwdr') + call parse_real_variable('fwdr', fwdr, 0.0D0, 10.0D0, & + 'IFE first wall radial thickness (m)') + case ('fwdzl') + call parse_real_variable('fwdzl', fwdzl, 0.0D0, 10.0D0, & + 'IFE first wall bottom part thickness (m)') + case ('fwdzu') + call parse_real_variable('fwdzu', fwdzu, 0.0D0, 10.0D0, & + 'IFE first wall top part thickness (m)') + case ('fwmatf') ! N.B. actually a 2-D array + call parse_real_array('fwmatf', fwmatf, isub1, 3*(maxmat+1), & + 'IFE first wall material fraction', icode) + case ('gainve') + call parse_real_array('gainve', gainve, isub1, 10, & + 'IFE target gain vs driver energy', icode) + case ('htpmw_ife') + call parse_real_variable('htpmw_ife', htpmw_ife, 0.0D0, 1.0D3, & + 'IFE heat transport system electrical pump power (MW)') + case ('ifedrv') + call parse_int_variable('ifedrv', ifedrv, -1, 3, & + 'IFE driver type') + case ('ifetyp') + call parse_int_variable('ifetyp', ifetyp, 0, 4, & + 'IFE device build type') + case ('mcdriv') + call parse_real_variable('mcdriv', mcdriv, 0.1D0, 10.0D0, & + 'IFE driver cost multiplier') + case ('pdrive') + call parse_real_variable('pdrive', pdrive, 1.0D6, 200.0D6, & + 'IFE driver power to target (W)') + case ('pfusife') + call parse_real_variable('pfusife', pfusife, 0.0D0, 1.0D4, & + 'IFE input fusion power (MW) (ifedrv=3 only)') + case ('pifecr') + call parse_real_variable('pifecr', pifecr, 0.0D0, 100.0D0, & + 'IFE cryogenic power (MW)') + case ('ptargf') + call parse_real_variable('ptargf', ptargf, 0.1D0, 100.0D0, & + 'IFE target factory power at 6Hz (MW)') + case ('rrin') + call parse_real_variable('rrin', rrin, 0.1D0, 50.0D0, & + 'Input IFE repetition rate (Hz) (ifedrv=3 only)') + case ('rrmax') + call parse_real_variable('rrmax', rrmax, 1.0D0, 50.0D0, & + 'Maximum IFE repetition rate (Hz)') + case ('shdr') + call parse_real_variable('shdr', shdr, 0.0D0, 10.0D0, & + 'IFE shield radial thickness (m)') + case ('shdzl') + call parse_real_variable('shdzl', shdzl, 0.0D0, 10.0D0, & + 'IFE shield bottom part thickness (m)') + case ('shdzu') + call parse_real_variable('shdzu', shdzu, 0.0D0, 10.0D0, & + 'IFE shield top part thickness (m)') + case ('shmatf') ! N.B. actually a 2-D array + call parse_real_array('shmatf', shmatf, isub1, 3*(maxmat+1), & + 'IFE shield material fraction', icode) + case ('sombdr') + call parse_real_variable('sombdr', sombdr, 0.0D0, 10.0D0, & + 'Radius of SOMBRERO blanket bottom (m)') + case ('somtdr') + call parse_real_variable('somtdr', somtdr, 0.0D0, 10.0D0, & + 'Radius of SOMBRERO blanket top (m)') + case ('tgain') + call parse_real_variable('tgain', tgain, 1.0D0, 500.0D0, & + 'IFE target gain') + case ('uccarb') + call parse_real_variable('uccarb', uccarb, 10.0D0, 1.0D3, & + 'Cost of carbon cloth ($/kg)') + case ('ucconc') + call parse_real_variable('ucconc', ucconc, 0.1D0, 1.0D3, & + 'Cost of concrete ($/kg)') + case ('ucflib') + call parse_real_variable('ucflib', ucflib, 10.0D0, 1.0D3, & + 'Cost of FLiBe ($/kg)') + case ('uctarg') + call parse_real_variable('uctarg', uctarg, 0.1D0, 1.0D3, & + 'Cost per IFE target ($/target)') + case ('v1dr') + call parse_real_variable('v1dr', v1dr, 0.0D0, 10.0D0, & + 'IFE void 1 radial thickness (m)') + case ('v1dzl') + call parse_real_variable('v1dzl', v1dzl, 0.0D0, 10.0D0, & + 'IFE void 1 bottom part thickness (m)') + case ('v1dzu') + call parse_real_variable('v1dzu', v1dzu, 0.0D0, 10.0D0, & + 'IFE void 1 top part thickness (m)') + case ('v1matf') ! N.B. actually a 2-D array + call parse_real_array('v1matf', v1matf, isub1, 3*(maxmat+1), & + 'IFE void 1 material fraction', icode) + case ('v2dr') + call parse_real_variable('v2dr', v2dr, 0.0D0, 10.0D0, & + 'IFE void 2 radial thickness (m)') + case ('v2dzl') + call parse_real_variable('v2dzl', v2dzl, 0.0D0, 10.0D0, & + 'IFE void 2 bottom part thickness (m)') + case ('v2dzu') + call parse_real_variable('v2dzu', v2dzu, 0.0D0, 10.0D0, & + 'IFE void 2 top part thickness (m)') + case ('v2matf') ! N.B. actually a 2-D array + call parse_real_array('v2matf', v2matf, isub1, 3*(maxmat+1), & + 'IFE void 2 material fraction', icode) + case ('v3dr') + call parse_real_variable('v3dr', v3dr, 0.0D0, 50.0D0, & + 'IFE void 3 radial thickness (m)') + case ('v3dzl') + call parse_real_variable('v3dzl', v3dzl, 0.0D0, 30.0D0, & + 'IFE void 3 bottom part thickness (m)') + case ('v3dzu') + call parse_real_variable('v3dzu', v3dzu, 0.0D0, 30.0D0, & + 'IFE void 3 top part thickness (m)') + case ('v3matf') ! N.B. actually a 2-D array + call parse_real_array('v3matf', v3matf, isub1, 3*(maxmat+1), & + 'IFE void 3 material fraction', icode) + + ! Water usage settings + + case ('airtemp') + call parse_real_variable('airtemp', airtemp, -15.0D0, 40.0D0, & 'ambient air temperature (degrees C)') - case ('watertemp') - call parse_real_variable('watertemp', watertemp, 0.0D0, 25.0D0, & + case ('watertemp') + call parse_real_variable('watertemp', watertemp, 0.0D0, 25.0D0, & 'water temperature (degrees C)') - case ('windspeed') - call parse_real_variable('windspeed', windspeed, 0.0D0, 10.0D0, & + case ('windspeed') + call parse_real_variable('windspeed', windspeed, 0.0D0, 10.0D0, & 'wind speed (m/s)') - ! CS fatigue settings + ! CS fatigue settings - case('residual_sig_hoop') - call parse_real_variable('residual_sig_hoop',residual_sig_hoop, 0.0D0, 1.0D9, & + case('residual_sig_hoop') + call parse_real_variable('residual_sig_hoop',residual_sig_hoop, 0.0D0, 1.0D9, & 'residual hoop stress in strucutal material (Pa) ') - case('n_cycle_min') - call parse_real_variable('n_cycle_min',n_cycle_min, 0.0D0, 1.0D8, & + case('n_cycle_min') + call parse_real_variable('n_cycle_min',n_cycle_min, 0.0D0, 1.0D8, & 'Minimum required cycles for CS') - case('t_crack_radial') - call parse_real_variable('t_crack_radial',t_crack_radial, 1.0D-5, 1.0D0, & + case('t_crack_radial') + call parse_real_variable('t_crack_radial',t_crack_radial, 1.0D-5, 1.0D0, & 'Inital radial crack size (m)') - case('t_crack_vertical') - call parse_real_variable('t_crack_vertical',t_crack_vertical, 1.0D-5, 1.0D0, & + case('t_crack_vertical') + call parse_real_variable('t_crack_vertical',t_crack_vertical, 1.0D-5, 1.0D0, & 'Inital vertical crack size (m)') - case('t_structural_radial') - call parse_real_variable('t_structural_radial',t_structural_radial, 1.0D-3, 1.0D0, & - 'CS structural radial thickness (m)') - case('t_structural_vertical') - call parse_real_variable('t_structural_vertical',t_structural_vertical, 1.0D-3, 1.0D0, & - 'CS structural vertical thickness (m)') - case('ld_ratio_cst') + case('t_structural_radial') + call parse_real_variable('t_structural_radial',t_structural_radial, 1.0D-3, 1.0D0, & + 'CS structural radial thickness (m)') + case('t_structural_vertical') + call parse_real_variable('t_structural_vertical',t_structural_vertical, 1.0D-3, 1.0D0, & + 'CS structural vertical thickness (m)') + case('ld_ratio_cst') call parse_real_variable('ld_ratio_cst',ld_ratio_cst, 0.0D0, 5.0D0, & 'CS coil turn conduit length to depth ratio') - case('bkt_life_csf') + case('bkt_life_csf') call parse_real_variable('bkt_life_csf',bkt_life_csf, 0.0D0, 1.0D0, & 'Switch for bkt_life -> n_cycle_min') - case('sf_vertical_crack') + case('sf_vertical_crack') call parse_real_variable('sf_vertical_crack',sf_vertical_crack, 1.0D0, 1.0D1, & 'Safety factor for vertical crack size (-)') - case('sf_radial_crack') + case('sf_radial_crack') call parse_real_variable('sf_radial_crack',sf_radial_crack, 1.0D0, 1.0D1, & 'Safety factor for radial crack size (-)') - case('sf_fast_fracture') + case('sf_fast_fracture') call parse_real_variable('sf_fast_fracture',sf_fast_fracture, 1.0D0, 1.0D1, & 'safety factor for stress intensity factor (-)') - case('paris_coefficient') + case('paris_coefficient') call parse_real_variable('paris_coefficient',paris_coefficient, 1.0D-20, 1.0D1, & 'Paris equation material coefficient (-)') - case('paris_power_law') + case('paris_power_law') call parse_real_variable('paris_power_law',paris_power_law, 1.0D0, 1.0D1, & 'Paris equation material power law (-)') - case('walker_coefficient') + case('walker_coefficient') call parse_real_variable('walker_coefficient',walker_coefficient, 1.0D-1, 1.0D1, & 'walker coefficient (-)') - case('fracture_toughness') + case('fracture_toughness') call parse_real_variable('fracture_toughness',fracture_toughness, 1.0D-1, 1.0D8, & 'fracture toughness (MPa m^1/2)') - case default - error_message = 'Unknown variable in input file: '//varnam(1:varlen) - write(*,*) error_message - write(*,*) 'Error occurred at this line in the IN.DAT file:', lineno - write(*,*) line - error = .True. + case default + error_message = 'Unknown variable in input file: '//varnam(1:varlen) + write(*,*) error_message + write(*,*) 'Error occurred at this line in the IN.DAT file:', lineno + write(*,*) line + error = .True. - end select variable + end select variable - ! Uncomment the following to abort the code if an obsolete variable name - ! has been found in the input file + ! Uncomment the following to abort the code if an obsolete variable name + ! has been found in the input file - if (obsolete_var) then - error_message = 'Obsolete variable specified' - write(*,*) error_message - write(*,*) 'Error occurred at this line in the IN.DAT file: ', lineno - write(*,*) line - error = .True. - end if + if (obsolete_var) then + error_message = 'Obsolete variable specified' + write(*,*) error_message + write(*,*) 'Error occurred at this line in the IN.DAT file: ', lineno + write(*,*) line + error = .True. + end if - ! If we have just read in an array, a different loop-back is needed + ! If we have just read in an array, a different loop-back is needed - if (icode == -1) goto 20 + if (icode == -1) goto 20 - cycle + cycle - end do loop_over_lines + end do loop_over_lines - if(neqns == 0) then - ! The value of neqns has not been set in the input file. Default = 0. - neqns = no_constraints - nineqns - else - ! The value of neqns has been set in the input file. - nineqns = no_constraints - neqns - end if + if(neqns == 0) then + ! The value of neqns has not been set in the input file. Default = 0. + neqns = no_constraints - nineqns + else + ! The value of neqns has been set in the input file. + nineqns = no_constraints - neqns + end if - nvar = no_iteration + nvar = no_iteration - if (error .eqv. .True.) stop 1 + if (error .eqv. .True.) stop 1 - ! MDK Try allocating here - if (allocated(name_xc)) deallocate(name_xc) - allocate(name_xc(nvar)) - ! Ensure array is initialised - name_xc = "" + ! MDK Try allocating here + if (allocated(name_xc)) deallocate(name_xc) + allocate(name_xc(nvar)) + ! Ensure array is initialised + name_xc = "" - end subroutine parse_input_file + end subroutine parse_input_file - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_real_variable(varnam,varval,vmin,vmax,description) + subroutine parse_real_variable(varnam,varval,vmin,vmax,description) - !! Routine that obtains the value of a real variable from the input - !! file and checks that it lies within the expected range - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output real : value of the variable - !! vmin : input real : minimum allowed value for the variable - !! vmax : input real : maximum allowed value for the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for a real variable, extracting the value from the line - !! and checking whether it lies between user-defined lower and - !! upper limits. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of a real variable from the input + !! file and checks that it lies within the expected range + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output real : value of the variable + !! vmin : input real : minimum allowed value for the variable + !! vmax : input real : maximum allowed value for the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for a real variable, extracting the value from the line + !! and checking whether it lies between user-defined lower and + !! upper limits. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - real(dp), intent(inout) :: varval - real(dp), intent(in) :: vmin, vmax + character(len=*), intent(in) :: varnam, description + real(dp), intent(inout) :: varval + real(dp), intent(in) :: vmin, vmax - ! Local variables + ! Local variables - real(dp) :: oldval + real(dp) :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found at line ', lineno - write(*,*) 'Variable name and description:' - write(*,*) varnam, ', ', description - error = .True. - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found at line ', lineno + write(*,*) 'Variable name and description:' + write(*,*) varnam, ', ', description + error = .True. + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval + oldval = varval - call get_value_real(varval,icode) + call get_value_real(varval,icode) - if (icode /= 0) then - write(*,*) 'Error whilst reading input file. Variable name and description:' - write(*,*) varnam, ', ', description - write(*,*) 'Comments should be indicated by an asterisk' - error = .True. - end if + if (icode /= 0) then + write(*,*) 'Error whilst reading input file. Variable name and description:' + write(*,*) varnam, ', ', description + write(*,*) 'Comments should be indicated by an asterisk' + error = .True. + end if - ! Check variable lies within range + ! Check variable lies within range - call check_range_real(varnam,varval,vmin,vmax) + call check_range_real(varnam,varval,vmin,vmax) - if ((report_changes == 1).and.(varval /= oldval)) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(varval /= oldval)) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_real_variable + end subroutine parse_real_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_int_variable(varnam,varval,vmin,vmax,description) + subroutine parse_int_variable(varnam,varval,vmin,vmax,description) - !! Routine that obtains the value of an integer variable from the - !! input file and checks that it lies within the expected range - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output integer : value of the variable - !! vmin : input integer : minimum allowed value for the variable - !! vmax : input integer : maximum allowed value for the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for an integer variable, extracting the value from the line - !! and checking whether it lies between user-defined lower and - !! upper limits. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of an integer variable from the + !! input file and checks that it lies within the expected range + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output integer : value of the variable + !! vmin : input integer : minimum allowed value for the variable + !! vmax : input integer : maximum allowed value for the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for an integer variable, extracting the value from the line + !! and checking whether it lies between user-defined lower and + !! upper limits. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use constants, only: nout - implicit none + use constants, only: nout + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: varval - integer, intent(in) :: vmin, vmax + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: varval + integer, intent(in) :: vmin, vmax - ! Local variables + ! Local variables - integer :: oldval + integer :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno - write(*,*) 'Name and description of variable: ' - write(*,*) varnam, description - error = .True. - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno + write(*,*) 'Name and description of variable: ' + write(*,*) varnam, description + error = .True. + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval - call get_value_int(varval,icode) - if (icode /= 0) then - write(*,*) 'Error found in input file, check line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + oldval = varval + call get_value_int(varval,icode) + if (icode /= 0) then + write(*,*) 'Error found in input file, check line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - ! Check variable lies within range + ! Check variable lies within range - call check_range_int(varnam,varval,vmin,vmax) + call check_range_int(varnam,varval,vmin,vmax) - if ((report_changes == 1).and.(varval /= oldval)) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(varval /= oldval)) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_int_variable + end subroutine parse_int_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_string_variable(varnam,varval,description) + subroutine parse_string_variable(varnam,varval,description) - !! Routine that obtains the value of a string variable from the - !! input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output string : value of the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for a string variable, extracting the value from the line. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of a string variable from the + !! input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output string : value of the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for a string variable, extracting the value from the line. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - character(len=*), intent(inout) :: varval + character(len=*), intent(in) :: varnam, description + character(len=*), intent(inout) :: varval - ! Local variables + ! Local variables - character(len=maxlen) :: oldval + character(len=maxlen) :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno - write(*,*) 'Name and description of variable: ' - write(*,*) varnam, description - error = .True. - !stop 1 - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno + write(*,*) 'Name and description of variable: ' + write(*,*) varnam, description + error = .True. + !stop 1 + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval - call get_substring(varval,icode) - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + oldval = varval + call get_substring(varval,icode) + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - if ((report_changes == 1).and.(trim(varval) /= trim(oldval))) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(trim(varval) /= trim(oldval))) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_string_variable + end subroutine parse_string_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_real_array(varnam,varval,isub1,n,description,icode) + subroutine parse_real_array(varnam,varval,isub1,n,description,icode) - !! Routine that obtains the values of a real array from the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval(n) : input/output real array : value of the variable - !! isub1 : input integer : array element pointer - !! n : input integer : size of varval array - !! icode : output integer : diagnostic flag - !! description : input string : brief description of the variable - !! This routine parses a line in one of the two following forms: - !!

-    !! name = v1[, v2, ...]
-    !! name(element) = v
-    !! 
- !! to read in and extract one or more values for a real 1-D array. - !!

N.B. No array bounds or value range checking is performed. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the values of a real array from the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval(n) : input/output real array : value of the variable + !! isub1 : input integer : array element pointer + !! n : input integer : size of varval array + !! icode : output integer : diagnostic flag + !! description : input string : brief description of the variable + !! This routine parses a line in one of the two following forms: + !!

+      !! name = v1[, v2, ...]
+      !! name(element) = v
+      !! 
+ !! to read in and extract one or more values for a real 1-D array. + !!

N.B. No array bounds or value range checking is performed. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: isub1 - integer, intent(in) :: n - integer, intent(out) :: icode - real(dp), dimension(n), intent(inout) :: varval + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: isub1 + integer, intent(in) :: n + integer, intent(out) :: icode + real(dp), dimension(n), intent(inout) :: varval - ! Local variables + ! Local variables - real(dp) :: oldval, val + real(dp) :: oldval, val - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - if (subscript_present) then + if (subscript_present) then - oldval = varval(isub1) - call get_value_real(val,icode) + oldval = varval(isub1) + call get_value_real(val,icode) - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - - else - - isub1 = 1 - do - call get_value_real(val,icode) - ! icode == 1 denotes an error - ! icode == -1 denotes end of line, so the next line needs to be read in - ! (hence the 'goto 20' in the calling routine) - if (icode /= 0) return - - oldval = varval(isub1) - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + + else + + isub1 = 1 + do + call get_value_real(val,icode) + ! icode == 1 denotes an error + ! icode == -1 denotes end of line, so the next line needs to be read in + ! (hence the 'goto 20' in the calling routine) + if (icode /= 0) return + + oldval = varval(isub1) + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - isub1 = isub1 + 1 - end do - end if - -10 format(a,a,a,a1,i3,a,e14.6e2) - - end subroutine parse_real_array - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine parse_int_array(varnam,varval,isub1,n,description,icode,startindex) - - !! Routine that obtains the values of an integer array - !! from the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval(n) : input/output integer array : value of the variable - !! isub1 : input integer : array element pointer - !! n : input integer : size of varval array - !! icode : output integer : diagnostic flag - !! description : input string : brief description of the variable - !! This routine parses a line in one of the two following forms: - !!

-    !! name = v1[, v2, ...]
-    !! name(element) = v
-    !! 
- !! to read in and extract one or more values for an integer 1-D array. - !!

N.B. No array bounds or value range checking is performed. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - implicit none - - ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: isub1 - integer, intent(in) :: n - integer, intent(out) :: icode - integer, dimension(n), intent(inout) :: varval - integer, intent(in), optional :: startindex - - ! Local variables - integer :: oldval, val - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - - if (subscript_present) then - - oldval = varval(isub1) - call get_value_int(val,icode) - - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if - - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + isub1 = isub1 + 1 + end do + end if + +10 format(a,a,a,a1,i3,a,e14.6e2) + + end subroutine parse_real_array + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine parse_int_array(varnam,varval,isub1,n,description,icode,startindex) + + !! Routine that obtains the values of an integer array + !! from the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval(n) : input/output integer array : value of the variable + !! isub1 : input integer : array element pointer + !! n : input integer : size of varval array + !! icode : output integer : diagnostic flag + !! description : input string : brief description of the variable + !! This routine parses a line in one of the two following forms: + !!

+      !! name = v1[, v2, ...]
+      !! name(element) = v
+      !! 
+ !! to read in and extract one or more values for an integer 1-D array. + !!

N.B. No array bounds or value range checking is performed. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + implicit none + + ! Arguments + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: isub1 + integer, intent(in) :: n + integer, intent(out) :: icode + integer, dimension(n), intent(inout) :: varval + integer, intent(in), optional :: startindex + + ! Local variables + integer :: oldval, val + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + + if (subscript_present) then + + oldval = varval(isub1) + call get_value_int(val,icode) + + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if + + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - - else ! subscript is not present - - isub1 = 1 - if(present(startindex))isub1 = startindex - do - call get_value_int(val,icode) - - ! icode == 1 denotes an error - ! icode == -1 denotes end of line - if (icode /= 0) then - ! Make sure isub1 = the last array index - isub1 = isub1 - 1 - return - end if - - oldval = varval(isub1) - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + + else ! subscript is not present + + isub1 = 1 + if(present(startindex))isub1 = startindex + do + call get_value_int(val,icode) + + ! icode == 1 denotes an error + ! icode == -1 denotes end of line + if (icode /= 0) then + ! Make sure isub1 = the last array index + isub1 = isub1 - 1 + return + end if + + oldval = varval(isub1) + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - isub1 = isub1 + 1 - end do - - end if - -10 format(a,a,a,a1,i3,a,i12) - - end subroutine parse_int_array - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine string_to_int(string,length,ivar,icode) - - !! Routine that converts the ASCII digits in a string to - !! an integer - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : contains digits of the number - !! length : input integer : useful length of character string - !! ivar : output integer : value stored in the string - !! icode : output integer : diagnostic flag - !! This routine converts the ASCII digits in string(1:length) - !! to the integer ivar. It is equivalent to doing - !! 'READ(STRING(1:LENGTH),I) IVAR' but this routine conforms - !! to the ANSI standard. - !! Each digit is parsed in turn, the current total is multiplied - !! by ten and the new digit is added. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - implicit none - - ! Arguments - - character(len=*), intent(in) :: string - integer, intent(in) :: length - integer, intent(out) :: ivar, icode - - ! Local variables - - character(len=maxlen) :: xstr - integer :: iptr,izero,xlen - logical :: negate - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ivar = 0 - icode = 0 - - if (length <= 0) goto 1000 - - negate = .false. - izero = ichar('0') - iptr = 1 - xstr = string(1:length) - - ! *** Ignore trailing spaces - - xlen = len_trim(xstr) - if (xlen <= 0) goto 1000 - - ! *** Ignore leading spaces - -10 continue - if (xstr(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - goto 10 - end if - - ! *** Check for leading + or - - - if (xstr(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - else if (xstr(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - else - continue - end if - - ! *** Ignore leading zeros - -20 continue - if (xstr(iptr:iptr) == '0') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - goto 20 - end if - - ! *** Check for number too large - - if ((xlen-iptr+1) > 10) then - if (negate) then - ivar = -1234567890 - else - ivar = 1234567890 - write(*,*) '1 Problem with IN file, please check line' - write(*,*) xstr - error = .True. - end if - icode = 1 - goto 1000 - else if ((xlen-iptr+1) == 10) then - if (xstr(iptr:xlen) > '2147483647') then - if (negate) then - ivar = -1234567890 - else - ivar = 1234567890 - end if - icode = 1 - goto 1000 - end if - else - continue - end if + end if + isub1 = isub1 + 1 + end do + + end if + +10 format(a,a,a,a1,i3,a,i12) + + end subroutine parse_int_array + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine string_to_int(string,length,ivar,icode) + + !! Routine that converts the ASCII digits in a string to + !! an integer + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : contains digits of the number + !! length : input integer : useful length of character string + !! ivar : output integer : value stored in the string + !! icode : output integer : diagnostic flag + !! This routine converts the ASCII digits in string(1:length) + !! to the integer ivar. It is equivalent to doing + !! 'READ(STRING(1:LENGTH),I) IVAR' but this routine conforms + !! to the ANSI standard. + !! Each digit is parsed in turn, the current total is multiplied + !! by ten and the new digit is added. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + implicit none + + ! Arguments + + character(len=*), intent(in) :: string + integer, intent(in) :: length + integer, intent(out) :: ivar, icode + + ! Local variables + + character(len=maxlen) :: xstr + integer :: iptr,izero,xlen + logical :: negate + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ivar = 0 + icode = 0 + + if (length <= 0) goto 1000 + + negate = .false. + izero = ichar('0') + iptr = 1 + xstr = string(1:length) + + ! *** Ignore trailing spaces + + xlen = len_trim(xstr) + if (xlen <= 0) goto 1000 + + ! *** Ignore leading spaces + +10 continue + if (xstr(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + goto 10 + end if + + ! *** Check for leading + or - + + if (xstr(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + else if (xstr(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + else + continue + end if + + ! *** Ignore leading zeros - ! *** Parse the digits +20 continue + if (xstr(iptr:iptr) == '0') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + goto 20 + end if -30 continue - if ((xstr(iptr:iptr) >= '0').and.(xstr(iptr:iptr) <= '9')) then - ivar = (ivar * 10) + (ichar(xstr(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr <= xlen) goto 30 + ! *** Check for number too large - ! *** This is the normal exit path... + if ((xlen-iptr+1) > 10) then + if (negate) then + ivar = -1234567890 + else + ivar = 1234567890 + write(*,*) '1 Problem with IN file, please check line' + write(*,*) xstr + error = .True. + end if + icode = 1 + goto 1000 + else if ((xlen-iptr+1) == 10) then + if (xstr(iptr:xlen) > '2147483647') then + if (negate) then + ivar = -1234567890 + else + ivar = 1234567890 + end if + icode = 1 + goto 1000 + end if + else + continue + end if + + ! *** Parse the digits + +30 continue + if ((xstr(iptr:iptr) >= '0').and.(xstr(iptr:iptr) <= '9')) then + ivar = (ivar * 10) + (ichar(xstr(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr <= xlen) goto 30 + + ! *** This is the normal exit path... + + if (negate) ivar = -ivar - if (negate) ivar = -ivar + else + if(ivar /= 0) then + write(*,*) 'Problem with IN file, please check line' + write(*,*) xstr + write(*,*) 'Comments should be indicated by an asterisk (*)' + error = .True. + end if + icode = 1 + end if - else - if(ivar /= 0) then - write(*,*) 'Problem with IN file, please check line' - write(*,*) xstr - write(*,*) 'Comments should be indicated by an asterisk (*)' - error = .True. - end if - icode = 1 - end if +1000 continue -1000 continue + end subroutine string_to_int - end subroutine string_to_int + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine string_to_real(string,length,rval,icode) - subroutine string_to_real(string,length,rval,icode) + !! Routine that converts the ASCII digits in a string to + !! a real value + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : contains digits of the number + !! length : input integer : useful length of character string + !! rvar : output real : value stored in the string + !! icode : output integer : diagnostic flag + !! This routine converts the ASCII digits in string(1:length) + !! to the real variable rvar. + !! The string is parsed one character at a time, from the left, + !! handling the mantissa, and all other components of the real + !! number separately, combining them at the end. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that converts the ASCII digits in a string to - !! a real value - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : contains digits of the number - !! length : input integer : useful length of character string - !! rvar : output real : value stored in the string - !! icode : output integer : diagnostic flag - !! This routine converts the ASCII digits in string(1:length) - !! to the real variable rvar. - !! The string is parsed one character at a time, from the left, - !! handling the mantissa, and all other components of the real - !! number separately, combining them at the end. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - implicit none - - ! Arguments + implicit none - character(len=*), intent(in) :: string - integer, intent(in) :: length - real(dp), intent(out) :: rval - integer, intent(out) :: icode - - ! Local variables - - real(dp) :: valbdp,valadp,xfact - integer :: iptr,izero,iexpon - logical :: negatm,negate + ! Arguments - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + character(len=*), intent(in) :: string + integer, intent(in) :: length + real(dp), intent(out) :: rval + integer, intent(out) :: icode - iptr = 1 + ! Local variables - ! *** Ignore leading spaces + real(dp) :: valbdp,valadp,xfact + integer :: iptr,izero,iexpon + logical :: negatm,negate -10 continue - if (string(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= length) goto 10 - end if + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Initialise real value + iptr = 1 - rval = 0.0D0 + ! *** Ignore leading spaces - ! *** ASCII '0' +10 continue + if (string(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= length) goto 10 + end if - izero = ichar('0') + ! *** Initialise real value - ! *** If negative mantissa + rval = 0.0D0 - negatm = .false. + ! *** ASCII '0' - ! *** If negative exponent + izero = ichar('0') - negate = .false. + ! *** If negative mantissa - ! *** Value before decimal point + negatm = .false. - valbdp = 0.0D0 + ! *** If negative exponent - ! *** Value after decimal point + negate = .false. - valadp = 0.0D0 + ! *** Value before decimal point - ! *** Exponent + valbdp = 0.0D0 - iexpon = 0 + ! *** Value after decimal point - ! *** First character can be +, -, ., or + valadp = 0.0D0 - if (string(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > length) goto 50 - else if (string(iptr:iptr) == '-') then - iptr = iptr + 1 - if (iptr > length) goto 50 - negatm = .true. - else - continue - end if + ! *** Exponent - ! *** Parse the mantissa - before the decimal point + iexpon = 0 - valbdp = 0.0D0 - xfact = 0.1D0 -20 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - valbdp = (valbdp * 10.0D0) + dble(ichar(string(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr > length) goto 50 - goto 20 - end if + ! *** First character can be +, -, ., or - ! *** After the mantissa, we expect '.' or 'd' or 'e' + if (string(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > length) goto 50 + else if (string(iptr:iptr) == '-') then + iptr = iptr + 1 + if (iptr > length) goto 50 + negatm = .true. + else + continue + end if - if (string(iptr:iptr) == '.') then - iptr = iptr + 1 - if (iptr > length) goto 50 - end if + ! *** Parse the mantissa - before the decimal point - ! *** Parse the mantissa - after the decimal point + valbdp = 0.0D0 + xfact = 0.1D0 +20 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + valbdp = (valbdp * 10.0D0) + dble(ichar(string(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr > length) goto 50 + goto 20 + end if - valadp = 0.0D0 -30 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - valadp = valadp + (dble(ichar(string(iptr:iptr))-izero)*xfact) - xfact = xfact * 0.1D0 - iptr = iptr + 1 - if (iptr > length) goto 50 - goto 30 - end if + ! *** After the mantissa, we expect '.' or 'd' or 'e' - ! *** Now we expect the exponent + if (string(iptr:iptr) == '.') then + iptr = iptr + 1 + if (iptr > length) goto 50 + end if - if ( (string(iptr:iptr) == 'D').or. & + ! *** Parse the mantissa - after the decimal point + + valadp = 0.0D0 +30 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + valadp = valadp + (dble(ichar(string(iptr:iptr))-izero)*xfact) + xfact = xfact * 0.1D0 + iptr = iptr + 1 + if (iptr > length) goto 50 + goto 30 + end if + + ! *** Now we expect the exponent + + if ( (string(iptr:iptr) == 'D').or. & (string(iptr:iptr) == 'E').or. & (string(iptr:iptr) == 'd').or. & (string(iptr:iptr) == 'e')) then - iptr = iptr + 1 - if (iptr > length) goto 50 - - ! *** First character can be +, -, ., or - - if (string(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > length) goto 50 - else if (string(iptr:iptr) == '-') then - iptr = iptr + 1 - if (iptr > length) goto 50 - negate = .true. - else - continue - end if + iptr = iptr + 1 + if (iptr > length) goto 50 + + ! *** First character can be +, -, ., or + + if (string(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > length) goto 50 + else if (string(iptr:iptr) == '-') then + iptr = iptr + 1 + if (iptr > length) goto 50 + negate = .true. + else + continue + end if - ! *** Parse the exponent + ! *** Parse the exponent -40 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - iexpon = (iexpon * 10) + (ichar(string(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr <= length) goto 40 - else - goto 60 - end if - else - goto 60 - end if +40 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + iexpon = (iexpon * 10) + (ichar(string(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr <= length) goto 40 + else + goto 60 + end if + else + goto 60 + end if -50 continue +50 continue - ! *** Negative exponent? + ! *** Negative exponent? - if (negate) iexpon = -iexpon + if (negate) iexpon = -iexpon - ! *** Build the number at last + ! *** Build the number at last - if (iexpon == 0) then - rval = (valbdp + valadp) - else - rval = (valbdp + valadp) * (10.0D0 ** iexpon) - end if + if (iexpon == 0) then + rval = (valbdp + valadp) + else + rval = (valbdp + valadp) * (10.0D0 ** iexpon) + end if - ! *** Negative mantissa? + ! *** Negative mantissa? - if (negatm) rval = -rval + if (negatm) rval = -rval - ! *** All OK + ! *** All OK - icode = 0 - goto 1000 + icode = 0 + goto 1000 - ! *** Errors + ! *** Errors -60 continue +60 continue - write(*,*) 'Problem with IN file, please check line' - write(*,*) string - write(*,*) 'Comments should be indicated by an asterisk (*)' - error = .True. + write(*,*) 'Problem with IN file, please check line' + write(*,*) string + write(*,*) 'Comments should be indicated by an asterisk (*)' + error = .True. - icode = 1 + icode = 1 -1000 continue +1000 continue - end subroutine string_to_real + end subroutine string_to_real - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_value_int(ival,icode) + subroutine get_value_int(ival,icode) - !! Routine that extracts an integer value from a line of the - !! input file - !! author: P J Knight, CCFE, Culham Science Centre - !! ival : output integer : extracted integer value - !! icode : output integer : diagnostic flag - !! This routine extracts an integer value from the current line of - !! the input file, i.e. the value of an integer variable as - !! specified by the user. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts an integer value from a line of the + !! input file + !! author: P J Knight, CCFE, Culham Science Centre + !! ival : output integer : extracted integer value + !! icode : output integer : diagnostic flag + !! This routine extracts an integer value from the current line of + !! the input file, i.e. the value of an integer variable as + !! specified by the user. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: ival, icode + integer, intent(out) :: ival, icode - ! Local variables + ! Local variables - character(len=maxlen) :: varval - integer :: varlen - integer :: foundComma, foundAst, foundPoint + character(len=maxlen) :: varval + integer :: varlen + integer :: foundComma, foundAst, foundPoint - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Ignore leading spaces + ! *** Ignore leading spaces -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if - if (iptr > linelen) goto 60 + if (iptr > linelen) goto 60 ! 40 continue !KE I guess I can remove this too - ! *** Put rest of line into varval (makes it easier to parse) - - varval = line(iptr:) + ! *** Put rest of line into varval (makes it easier to parse) - ! *** Exclude any input after * or , - these denote an input comment + varval = line(iptr:) - varlen = len_trim(varval) - foundComma = varlen - foundAst = varlen - foundPoint = 0 + ! *** Exclude any input after * or , - these denote an input comment - if (index(varval,',') > 0) then - foundComma = index(varval,',') - 1 - end if - if (index(varval,'*') > 0) then - foundAst = index(varval,'*') - 1 - end if - varlen = min(varlen, foundComma, foundAst) + varlen = len_trim(varval) + foundComma = varlen + foundAst = varlen + foundPoint = 0 - if (varlen <= 0) varlen = index(varval,' ') - 1 - if (varlen <= 0) varlen = iptr + if (index(varval,',') > 0) then + foundComma = index(varval,',') - 1 + end if + if (index(varval,'*') > 0) then + foundAst = index(varval,'*') - 1 + end if + varlen = min(varlen, foundComma, foundAst) - varval = varval(:varlen) + if (varlen <= 0) varlen = index(varval,' ') - 1 + if (varlen <= 0) varlen = iptr - varlen = len_trim(varval) + varval = varval(:varlen) - foundPoint = index(varval,'.') - 1 - if (foundPoint > 0) then - varlen = foundPoint - write(*,*) 'Integer value expected in following input line...' - write(*,*) ' ',line(1:50),'...' - error = .True. - end if + varlen = len_trim(varval) - ! *** Update pointer + foundPoint = index(varval,'.') - 1 + if (foundPoint > 0) then + varlen = foundPoint + write(*,*) 'Integer value expected in following input line...' + write(*,*) ' ',line(1:50),'...' + error = .True. + end if - iptr = iptr + varlen + ! *** Update pointer - ! *** Ignore trailing spaces + iptr = iptr + varlen -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if + ! *** Ignore trailing spaces - ! *** Ignore comma, if present +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + ! *** Ignore comma, if present - ! *** Convert the ASCII text into an integer value + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - call string_to_int(varval,varlen,ival,icode) + ! *** Convert the ASCII text into an integer value - goto 1000 + call string_to_int(varval,varlen,ival,icode) -60 continue - icode = 1 + goto 1000 -1000 continue +60 continue + icode = 1 - end subroutine get_value_int +1000 continue - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end subroutine get_value_int - subroutine get_value_real(rval,icode) + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that extracts a real value from a line of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! rval : output real : extracted real value - !! icode : output integer : diagnostic flag - !! This routine extracts a real value from the current line of - !! the input file, i.e. the value of a real variable as specified - !! by the user. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine get_value_real(rval,icode) - implicit none + !! Routine that extracts a real value from a line of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! rval : output real : extracted real value + !! icode : output integer : diagnostic flag + !! This routine extracts a real value from the current line of + !! the input file, i.e. the value of a real variable as specified + !! by the user. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Arguments + implicit none - integer, intent(out) :: icode - real(dp), intent(out) :: rval + ! Arguments - ! Local variables + integer, intent(out) :: icode + real(dp), intent(out) :: rval - character(len=maxlen) :: varval - integer :: varlen - integer :: foundComma, foundAst + ! Local variables - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + character(len=maxlen) :: varval + integer :: varlen + integer :: foundComma, foundAst - ! *** Ignore leading spaces + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if - if (iptr > linelen) goto 60 + ! *** Ignore leading spaces - ! *** Put rest of line into varval (makes it easier to parse) +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if + if (iptr > linelen) goto 60 - varval = line(iptr:) + ! *** Put rest of line into varval (makes it easier to parse) - ! *** Exclude any input after * or , - these denote an input comment + varval = line(iptr:) - varlen = len_trim(varval) - foundComma = varlen - foundAst = varlen + ! *** Exclude any input after * or , - these denote an input comment - if (index(varval,',') > 0) then - foundComma = index(varval,',') - 1 - end if - if (index(varval,'*') > 0) then - foundAst = index(varval,'*') - 1 - end if - varlen = min(varlen, foundComma, foundAst) + varlen = len_trim(varval) + foundComma = varlen + foundAst = varlen - if (varlen <= 0) varlen = index(varval,' ') - 1 - if (varlen <= 0) varlen = iptr + if (index(varval,',') > 0) then + foundComma = index(varval,',') - 1 + end if + if (index(varval,'*') > 0) then + foundAst = index(varval,'*') - 1 + end if + varlen = min(varlen, foundComma, foundAst) - varval = varval(:varlen) + if (varlen <= 0) varlen = index(varval,' ') - 1 + if (varlen <= 0) varlen = iptr - varlen = len_trim(varval) + varval = varval(:varlen) - ! *** Update pointer + varlen = len_trim(varval) - iptr = iptr + varlen + ! *** Update pointer - ! *** Ignore trailing spaces + iptr = iptr + varlen -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if + ! *** Ignore trailing spaces - ! *** Ignore comma, if present +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + ! *** Ignore comma, if present - ! *** Convert the ASCII text into a real value + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - call string_to_real(varval,varlen,rval,icode) + ! *** Convert the ASCII text into a real value - goto 1000 + call string_to_real(varval,varlen,rval,icode) -60 continue - icode = 1 + goto 1000 -1000 continue +60 continue + icode = 1 - end subroutine get_value_real +1000 continue - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end subroutine get_value_real - subroutine get_substring(string,icode) + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that extracts a substring from a line of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! string : output string : extracted string - !! icode : output integer : diagnostic flag - !! This routine extracts a string from the current line of - !! the input file, i.e. the value of a string variable as specified - !! by the user. Unlike routine - !! get_substring_trim, - !! this routine does not truncate the string found at its first - !! non-leading blank. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine get_substring(string,icode) - implicit none + !! Routine that extracts a substring from a line of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! string : output string : extracted string + !! icode : output integer : diagnostic flag + !! This routine extracts a string from the current line of + !! the input file, i.e. the value of a string variable as specified + !! by the user. Unlike routine + !! get_substring_trim, + !! this routine does not truncate the string found at its first + !! non-leading blank. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Arguments + implicit none - integer, intent(out) :: icode - character(len=*), intent(out) :: string + ! Arguments - ! Local variables + integer, intent(out) :: icode + character(len=*), intent(out) :: string - character(len=maxlen) :: varval - integer :: varlen + ! Local variables - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + character(len=maxlen) :: varval + integer :: varlen - ! *** Ignore leading spaces + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if - if (iptr > linelen) goto 60 + ! *** Ignore leading spaces - ! *** Put rest of line into varval (makes it easier to parse) +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if + if (iptr > linelen) goto 60 - varval = line(iptr:) - varlen = len_trim(varval) + ! *** Put rest of line into varval (makes it easier to parse) - if (varlen <= 0) varlen = iptr + varval = line(iptr:) + varlen = len_trim(varval) - ! *** Update pointer + if (varlen <= 0) varlen = iptr - iptr = iptr + varlen + ! *** Update pointer - ! *** Ignore trailing spaces + iptr = iptr + varlen -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if + ! *** Ignore trailing spaces - ! *** Ignore comma, if present +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + ! *** Ignore comma, if present - ! *** Write the text into the variable + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - string = varval + ! *** Write the text into the variable - goto 1000 + string = varval -60 continue - icode = 1 + goto 1000 -1000 continue +60 continue + icode = 1 - end subroutine get_substring +1000 continue - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end subroutine get_substring - subroutine get_subscript(isub1,isub2,icode) + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that extracts any subscripts present in a line of - !! the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! isub1 : output integer : first subscript found - !! isub2 : output integer : second subscript found - !! icode : output integer : diagnostic flag - !! This routine extracts any subscripts from the current line of - !! the input file, i.e. if any array elements are specified - !! by the user. It looks at the next non-space character in the - !! line, and if it is a left bracket, it assumes that at - !! least one subscript is to follow and extracts it/them. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine get_subscript(isub1,isub2,icode) - implicit none + !! Routine that extracts any subscripts present in a line of + !! the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! isub1 : output integer : first subscript found + !! isub2 : output integer : second subscript found + !! icode : output integer : diagnostic flag + !! This routine extracts any subscripts from the current line of + !! the input file, i.e. if any array elements are specified + !! by the user. It looks at the next non-space character in the + !! line, and if it is a left bracket, it assumes that at + !! least one subscript is to follow and extracts it/them. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Arguments + implicit none - integer, intent(out) :: isub1, isub2, icode + ! Arguments - ! Local variables + integer, intent(out) :: isub1, isub2, icode - integer :: izero - logical :: negate + ! Local variables - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + integer :: izero + logical :: negate - ! *** Initial values + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - isub1 = 0 - isub2 = 0 + ! *** Initial values - ! *** First character should be '(' + isub1 = 0 + isub2 = 0 - if (line(iptr:iptr) /= '(') goto 70 - iptr = iptr + 1 - if (iptr > linelen) goto 80 + ! *** First character should be '(' - ! *** Parse the first subscript - ! *** Ignore leading spaces + if (line(iptr:iptr) /= '(') goto 70 + iptr = iptr + 1 + if (iptr > linelen) goto 80 -10 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 10 - end if + ! *** Parse the first subscript + ! *** Ignore leading spaces - izero = ichar('0') - negate = .false. +10 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 10 + end if - ! *** Extract and evaluate the first subscript - ! *** Subscript may be prefaced by '+' or '-' + izero = ichar('0') + negate = .false. - if (line(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else if (line(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else - continue - end if + ! *** Extract and evaluate the first subscript + ! *** Subscript may be prefaced by '+' or '-' -20 continue + if (line(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else if (line(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else + continue + end if - if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then - isub1 = isub1 * 10 + ichar(line(iptr:iptr)) - izero - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 20 - end if - if (negate) isub1 = -isub1 +20 continue - ! *** Ignore trailing spaces of first subscript + if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then + isub1 = isub1 * 10 + ichar(line(iptr:iptr)) - izero + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 20 + end if + if (negate) isub1 = -isub1 -30 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 70 - goto 30 - end if + ! *** Ignore trailing spaces of first subscript - ! *** Is there a second subscript? +30 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 70 + goto 30 + end if - if (line(iptr:iptr) == ',') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 + ! *** Is there a second subscript? - ! *** Ignore leading spaces of second subscript + if (line(iptr:iptr) == ',') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 -40 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 40 - end if + ! *** Ignore leading spaces of second subscript - ! *** Extract and evaluate the second subscript +40 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 40 + end if - negate = .false. + ! *** Extract and evaluate the second subscript + + negate = .false. - ! *** Subscript may be prefaced by '+' or '-' + ! *** Subscript may be prefaced by '+' or '-' - if (line(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else if (line(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else - continue - end if -50 continue - if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then - isub2 = isub2 * 10 + ichar(line(iptr:iptr)) - izero - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 50 - end if + if (line(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else if (line(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else + continue + end if +50 continue + if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then + isub2 = isub2 * 10 + ichar(line(iptr:iptr)) - izero + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 50 + end if - ! *** Is it a negative subscript? + ! *** Is it a negative subscript? - if (negate) isub2 = -isub2 + if (negate) isub2 = -isub2 - ! *** Ignore trailing spaces of second subscript + ! *** Ignore trailing spaces of second subscript -60 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 60 - end if +60 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 60 + end if - end if + end if - ! *** Must end with ')' + ! *** Must end with ')' - if (line(iptr:iptr) /= ')') goto 80 - iptr = iptr + 1 + if (line(iptr:iptr) /= ')') goto 80 + iptr = iptr + 1 -70 continue - icode = 0 - goto 1000 +70 continue + icode = 0 + goto 1000 -80 continue - icode = 1 +80 continue + icode = 1 -1000 continue +1000 continue - end subroutine get_subscript + end subroutine get_subscript - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_variable_name(varnam,varlen,isub1,isub2) + subroutine get_variable_name(varnam,varlen,isub1,isub2) - !! Routine that extracts a variable name from a line of - !! the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : output string : extracted variable name - !! varlen : output integer : length of variable name - !! isub1 : output integer : first subscript found - !! isub2 : output integer : second subscript found - !! This routine extracts a variable name from the current line of - !! the input file. It also extracts any subscripts present. - !! On exit, the counter iptr points to the first - !! character of the value to be assigned to the variable. - !! If the routine finds an error a value of 0 is returned in - !! variable varlen. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts a variable name from a line of + !! the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : output string : extracted variable name + !! varlen : output integer : length of variable name + !! isub1 : output integer : first subscript found + !! isub2 : output integer : second subscript found + !! This routine extracts a variable name from the current line of + !! the input file. It also extracts any subscripts present. + !! On exit, the counter iptr points to the first + !! character of the value to be assigned to the variable. + !! If the routine finds an error a value of 0 is returned in + !! variable varlen. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: varlen, isub1, isub2 - character(len=*), intent(out) :: varnam + integer, intent(out) :: varlen, isub1, isub2 + character(len=*), intent(out) :: varnam - ! Local variables + ! Local variables - character(len=maxlen) :: line1 - integer :: ifrom,ito,icode + character(len=maxlen) :: line1 + integer :: ifrom,ito,icode - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Store LINE in local variable + ! *** Store LINE in local variable - line1 = line + line1 = line - ! *** Convert string to lower case + ! *** Convert string to lower case - call lower_case(line) + call lower_case(line) - varlen = 0 - ifrom = iptr + varlen = 0 + ifrom = iptr - ! *** First character must be alphabetic + ! *** First character must be alphabetic - if ((line(iptr:iptr) < 'a').or.(line(iptr:iptr) > 'z')) goto 1000 - iptr = iptr + 1 - if (iptr > linelen) goto 1000 + if ((line(iptr:iptr) < 'a').or.(line(iptr:iptr) > 'z')) goto 1000 + iptr = iptr + 1 + if (iptr > linelen) goto 1000 - ! *** Now parse the rest of the letters (must be alphanumeric or _ ) + ! *** Now parse the rest of the letters (must be alphanumeric or _ ) -10 continue - if ( ((line(iptr:iptr) >= 'a').and.(line(iptr:iptr) <= 'z')).or. & +10 continue + if ( ((line(iptr:iptr) >= 'a').and.(line(iptr:iptr) <= 'z')).or. & ((line(iptr:iptr) == '_')).or. & ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) ) then - iptr = iptr + 1 - if (iptr <= linelen) goto 10 - end if + iptr = iptr + 1 + if (iptr <= linelen) goto 10 + end if - ! *** Extract variable name + ! *** Extract variable name - ito = iptr - 1 - varlen = ito - ifrom + 1 - if (varlen > 0) varnam = line(ifrom:ito) + ito = iptr - 1 + varlen = ito - ifrom + 1 + if (varlen > 0) varnam = line(ifrom:ito) - ! *** Ignore intervening spaces + ! *** Ignore intervening spaces -20 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 20 - end if +20 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 20 + end if - ! *** Now extract any subscript + ! *** Now extract any subscript - call get_subscript(isub1,isub2,icode) - if (icode /= 0) then - varlen = 0 - goto 1000 - end if + call get_subscript(isub1,isub2,icode) + if (icode /= 0) then + varlen = 0 + goto 1000 + end if - ! *** Ignore intervening spaces + ! *** Ignore intervening spaces -30 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 30 - end if +30 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 30 + end if - ! *** We now expect '=' + ! *** We now expect '=' - if (line(iptr:iptr) == '=') then - iptr = iptr + 1 + if (line(iptr:iptr) == '=') then + iptr = iptr + 1 - ! *** Restore original string's upper/lower case after '=' sign + ! *** Restore original string's upper/lower case after '=' sign - line(iptr:linelen) = line1(iptr:linelen) + line(iptr:linelen) = line1(iptr:linelen) - else - varlen = 0 - end if + else + varlen = 0 + end if -1000 continue +1000 continue - end subroutine get_variable_name + end subroutine get_variable_name - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine check_range_int(cvar,varval,min_value,max_value) + subroutine check_range_int(cvar,varval,min_value,max_value) - !! Routine that checks whether an integer variable lies within - !! the desired range - !! author: P J Knight, CCFE, Culham Science Centre - !! outfile : input integer : Fortran output unit identifier - !! cvar : input string : name of variable - !! varval : input integer : value of variable - !! min_value : input integer : minimum allowed value of variable - !! max_value : input integer : maximum allowed value of variable - !! This routine checks whether an integer variable lies within - !! the range predetermined by the user, and reports an error - !! and stops if it doesn't. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that checks whether an integer variable lies within + !! the desired range + !! author: P J Knight, CCFE, Culham Science Centre + !! outfile : input integer : Fortran output unit identifier + !! cvar : input string : name of variable + !! varval : input integer : value of variable + !! min_value : input integer : minimum allowed value of variable + !! max_value : input integer : maximum allowed value of variable + !! This routine checks whether an integer variable lies within + !! the range predetermined by the user, and reports an error + !! and stops if it doesn't. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: cvar - integer, intent(in) :: varval,min_value,max_value + character(len=*), intent(in) :: cvar + integer, intent(in) :: varval,min_value,max_value - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (min_value > max_value) then - write(outfile,*) 'Illegal relative values of min_value and max_value' - write(outfile,*) 'for variable ',cvar + if (min_value > max_value) then + write(outfile,*) 'Illegal relative values of min_value and max_value' + write(outfile,*) 'for variable ',cvar - write(*,*) 'Illegal relative values of min_value and max_value' - write(*,*) 'for variable ',cvar - error = .True. - end if + write(*,*) 'Illegal relative values of min_value and max_value' + write(*,*) 'for variable ',cvar + error = .True. + end if - if ((varval < min_value).or.(varval > max_value)) then - write(outfile,*) cvar,' lies outside its allowed range :' - write(outfile,*) 'Minimum value = ',min_value - write(outfile,*) 'Maximum value = ',max_value - write(outfile,*) ' Actual value = ',varval + if ((varval < min_value).or.(varval > max_value)) then + write(outfile,*) cvar,' lies outside its allowed range :' + write(outfile,*) 'Minimum value = ',min_value + write(outfile,*) 'Maximum value = ',max_value + write(outfile,*) ' Actual value = ',varval - write(*,*) cvar,' lies outside its allowed range :' - write(*,*) 'Minimum value = ',min_value - write(*,*) 'Maximum value = ',max_value - write(*,*) ' Actual value = ',varval - error = .True. - end if + write(*,*) cvar,' lies outside its allowed range :' + write(*,*) 'Minimum value = ',min_value + write(*,*) 'Maximum value = ',max_value + write(*,*) ' Actual value = ',varval + error = .True. + end if - end subroutine check_range_int + end subroutine check_range_int - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine check_range_real(cvar,varval,min_value,max_value) + subroutine check_range_real(cvar,varval,min_value,max_value) - !! Routine that checks whether a real variable lies within - !! the desired range - !! author: P J Knight, CCFE, Culham Science Centre - !! cvar : input string : name of variable - !! varval : input real : value of variable - !! min_value : input real : minimum allowed value of variable - !! max_value : input real : maximum allowed value of variable - !! This routine checks whether a real variable lies within - !! the range predetermined by the user, and reports an error - !! and stops if it doesn't. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that checks whether a real variable lies within + !! the desired range + !! author: P J Knight, CCFE, Culham Science Centre + !! cvar : input string : name of variable + !! varval : input real : value of variable + !! min_value : input real : minimum allowed value of variable + !! max_value : input real : maximum allowed value of variable + !! This routine checks whether a real variable lies within + !! the range predetermined by the user, and reports an error + !! and stops if it doesn't. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: cvar - real(dp), intent(in) :: varval,min_value,max_value + character(len=*), intent(in) :: cvar + real(dp), intent(in) :: varval,min_value,max_value - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (min_value > max_value) then - write(outfile,*) 'Illegal relative values of min_value and max_value' - write(outfile,*) 'for variable ',cvar + if (min_value > max_value) then + write(outfile,*) 'Illegal relative values of min_value and max_value' + write(outfile,*) 'for variable ',cvar - write(*,*) 'Illegal relative values of min_value and max_value' - write(*,*) 'for variable ',cvar - error = .True. - end if + write(*,*) 'Illegal relative values of min_value and max_value' + write(*,*) 'for variable ',cvar + error = .True. + end if - if ((varval < min_value).or.(varval > max_value)) then - write(outfile,*) cvar,' lies outside its allowed range :' - write(outfile,*) 'Minimum value = ',min_value - write(outfile,*) 'Maximum value = ',max_value - write(outfile,*) ' Actual value = ',varval + if ((varval < min_value).or.(varval > max_value)) then + write(outfile,*) cvar,' lies outside its allowed range :' + write(outfile,*) 'Minimum value = ',min_value + write(outfile,*) 'Maximum value = ',max_value + write(outfile,*) ' Actual value = ',varval - write(*,*) cvar,' lies outside its allowed range :' - write(*,*) 'Minimum value = ',min_value - write(*,*) 'Maximum value = ',max_value - write(*,*) ' Actual value = ',varval - error = .True. - end if + write(*,*) cvar,' lies outside its allowed range :' + write(*,*) 'Minimum value = ',min_value + write(*,*) 'Maximum value = ',max_value + write(*,*) ' Actual value = ',varval + error = .True. + end if + + end subroutine check_range_real - end subroutine check_range_real + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine lower_case(string,start,finish) - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine lower_case(string,start,finish) + !! Routine that converts a (sub-)string to lowercase + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : character string of interest + !! start : optional input integer : starting character for conversion + !! finish : optional input integer : final character for conversion + !! This routine converts the specified section of a string + !! to lowercase. By default, the whole string will be converted. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that converts a (sub-)string to lowercase - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : character string of interest - !! start : optional input integer : starting character for conversion - !! finish : optional input integer : final character for conversion - !! This routine converts the specified section of a string - !! to lowercase. By default, the whole string will be converted. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + implicit none - implicit none + ! Arguments - ! Arguments + character(len=*), intent(inout) :: string + integer, optional, intent(in) :: start,finish - character(len=*), intent(inout) :: string - integer, optional, intent(in) :: start,finish + ! Local variables - ! Local variables + character(len=1) :: letter + character(len=27), parameter :: lowtab = 'abcdefghijklmnopqrstuvwxyz_' + integer :: loop, i - character(len=1) :: letter - character(len=27), parameter :: lowtab = 'abcdefghijklmnopqrstuvwxyz_' - integer :: loop, i + integer :: first, last - integer :: first, last + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + if (present(start)) then + first = start + else + first = 1 + end if - if (present(start)) then - first = start - else - first = 1 - end if - - if (present(finish)) then - last = finish - else - last = len(string) - end if - - if (first <= last) then - do loop = first,last - letter = string(loop:loop) - i = index('ABCDEFGHIJKLMNOPQRSTUVWXYZ_',letter) - if (i > 0) string(loop:loop) = lowtab(i:i) - end do - end if + if (present(finish)) then + last = finish + else + last = len(string) + end if - end subroutine lower_case + if (first <= last) then + do loop = first,last + letter = string(loop:loop) + i = index('ABCDEFGHIJKLMNOPQRSTUVWXYZ_',letter) + if (i > 0) string(loop:loop) = lowtab(i:i) + end do + end if + + end subroutine lower_case end module process_input #ifdef unit_test program test - use process_input - implicit none + use process_input + implicit none - open(unit=1,file='IN.DAT',status='old') - call parse_input_file(1,6,1) - close(unit=1) + open(unit=1,file='IN.DAT',status='old') + call parse_input_file(1,6,1) + close(unit=1) end program test #endif From ac0b4826f6729d7b406f446dfe7468b64dbd8168 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 12 Dec 2023 09:33:59 +0000 Subject: [PATCH 03/15] Added avail_st model and tests --- process/availability.py | 105 ++++++++++++++++++++++++++++++-- tests/unit/test_availability.py | 50 +++++++++++++++ 2 files changed, 151 insertions(+), 4 deletions(-) diff --git a/process/availability.py b/process/availability.py index 090ced6fa3..80e2f758c7 100644 --- a/process/availability.py +++ b/process/availability.py @@ -47,12 +47,15 @@ def run(self, output: bool = False): 0 | Input value for cfactr 1 | Ward and Taylor model (1999) 2 | Morris model (2015) + 3 | ST model (2023) :param output: indicate whether output should be written to the output file, or not (default = False) :type output: boolean """ - if cv.iavail > 1: + if cv.iavail == 3: + self.avail_st(output) # ST model (2023) + elif cv.iavail == 2: self.avail_2(output) # Morris model (2015) else: self.avail(output) # Taylor and Ward model (1999) @@ -479,7 +482,6 @@ def calc_u_planned(self, output: bool) -> float: # Output if output: - po.oheadr(self.outfile, "Plant Availability (2014 Model)") po.ocmmnt(self.outfile, "Planned unavailability:") @@ -590,7 +592,6 @@ def calc_u_unplanned_magnets(self, output: bool) -> float: # !!!!!!!!! if output: - po.ocmmnt(self.outfile, "Magnets:") po.oblnkl(self.outfile) po.ovarre( @@ -924,7 +925,6 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: sum_prob = 0.0e0 for n in range(cv.redun_vac + 1, total_pumps + 1): - # Probability for n failures in the operational period, n > number of redundant pumps # vac_fail_p.append(maths_library.binomial(total_pumps,n) * (cryo_nfailure_rate**(total_pumps-n)) *(cryo_failure_rate**n)) @@ -974,6 +974,103 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: po.oblnkl(self.outfile) return u_unplanned_vacuum + + def avail_st(self, output: bool): + """Routine to calculate availability for plant with an ST + :param output: indicate whether output should be written to the output file, or not + :type output: boolean + """ + # CP lifetime + cv.cplife = self.cp_lifetime() + + # Time for a maintenance cycle (years) + # Lifetime of CP + time to replace + maint_cycle = cv.cplife + cv.tmain + + # Number of maintenance cycles over plant lifetime + n_cycles_main = cv.tlife / maint_cycle + + # Number of centre columns over plant lifetime + n_centre_cols = math.ceil(n_cycles_main) + + # Planned unavailability + u_planned = cv.tmain / maint_cycle + + # Operational time (years) + cv.t_operation = cv.tlife * (1.0e0 - u_planned) + + # Total availability + cv.cfactr = max( + 1.0e0 - (u_planned + cv.u_unplanned + u_planned * cv.u_unplanned), 0.0e0 + ) + + # Capacity factor + cv.cpfact = cv.cfactr * (tv.tburn / tv.tcycle) + + if output: + po.oheadr(self.outfile, "Plant Availability") + po.ovarre( + self.outfile, + "Total planned unavailability", + "(u_planned)", + u_planned, + "OP ", + ) + po.ovarre( + self.outfile, + "Total unplanned unavailability", + "(u_unplanned)", + cv.u_unplanned, + "IP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Length of maintenance cycle (years)", + "(maint_cycle)", + maint_cycle, + "OP ", + ) + po.ovarre( + self.outfile, + "Number of maintenance cycles over lifetime", + "(n_cycles_main)", + n_cycles_main, + "OP ", + ) + po.ovarre( + self.outfile, + "Number of centre columns over lifetime", + "(n_centre_cols)", + n_centre_cols, + "OP ", + ) + po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Total plant availability fraction", + "(cfactr)", + cv.cfactr, + "OP ", + ) + po.ovarre( + self.outfile, + "Capacity factor: total lifetime elec. energy output / output power", + "(cpfact)", + cv.cpfact, + "OP ", + ) + po.ovarre( + self.outfile, + "Total DT operational time (years)", + "(t_operation)", + cv.t_operation, + "OP ", + ) + po.ovarre( + self.outfile, "Total plant lifetime (years)", "(tlife)", cv.tlife, "OP" + ) + def cp_lifetime(self): """Calculates Centrepost Lifetime diff --git a/tests/unit/test_availability.py b/tests/unit/test_availability.py index e711c19346..2a6b76fb24 100644 --- a/tests/unit/test_availability.py +++ b/tests/unit/test_availability.py @@ -2,7 +2,11 @@ from process import fortran from process.availability import Availability from process.fortran import cost_variables as cv +from process.fortran import physics_variables as pv from process.fortran import tfcoil_variables as tfv +from process.fortran import constraint_variables as ctv +from process.fortran import fwbs_variables as fwbsv +from process.fortran import times_variables as tv import pytest from pytest import approx @@ -385,3 +389,49 @@ def test_calc_u_unplanned_fwbs(calc_u_unplanned_fwbs_fix, availability): # then assert the result is the expected one result = availability.calc_u_unplanned_fwbs(output=False) assert result == calc_u_unplanned_fwbs_fix + + +def test_avail_st(monkeypatch, availability): + """Test avail_st routine + + :param monkeypatch: Mock fixture + :type monkeypatch: object + + :param availability: fixture containing an initialised `Availability` object + :type availability: tests.unit.test_availability.availability (functional fixture) + """ + + monkeypatch.setattr(cv, "tmain", 1.0) + monkeypatch.setattr(cv, "tlife", 30.0) + monkeypatch.setattr(cv, "u_unplanned", 0.1) + monkeypatch.setattr(tv, "tburn", 5.0) + monkeypatch.setattr(tv, "tcycle", 10.0) + + availability.avail_st(output=False) + + assert pytest.approx(cv.t_operation) == 29.03225806 + assert pytest.approx(cv.cfactr) == 0.86451613 + assert pytest.approx(cv.cpfact) == 0.43225806 + + +@pytest.mark.parametrize("i_tf_sup, exp", ((1, 6.337618), (0, 4))) +def test_cp_lifetime(monkeypatch, availability, i_tf_sup, exp): + """Test cp_lifetime routine + + :param monkeypatch: Mock fixture + :type monkeypatch: object + + :param availability: fixture containing an initialised `Availability` object + :type availability: tests.unit.test_availability.availability (functional fixture) + """ + + monkeypatch.setattr(tfv, "i_tf_sup", i_tf_sup) + monkeypatch.setattr(ctv, "nflutfmax", 1.0e23) + monkeypatch.setattr(fwbsv, "neut_flux_cp", 5.0e14) + monkeypatch.setattr(cv, "cpstflnc", 20.0) + monkeypatch.setattr(pv, "wallmw", 5.0) + monkeypatch.setattr(cv, "tlife", 30.0) + + cplife = availability.cp_lifetime() + + assert pytest.approx(cplife) == exp From 3a435f821c2f5f0703fde8ca9e3084b720300c94 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Mon, 8 Jan 2024 16:52:38 +0000 Subject: [PATCH 04/15] Added error if itart not set to ST --- process/availability.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/process/availability.py b/process/availability.py index 80e2f758c7..791395ab21 100644 --- a/process/availability.py +++ b/process/availability.py @@ -54,6 +54,10 @@ def run(self, output: bool = False): """ if cv.iavail == 3: + if pv.itart != 1: + raise ValueError( + f"{cv.iavail=} is for a Spherical Tokamak. Please set itart=1 to use this model." + ) self.avail_st(output) # ST model (2023) elif cv.iavail == 2: self.avail_2(output) # Morris model (2015) From 3c6758141233e27e432efacc4c8bc62c323854f6 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Mon, 8 Jan 2024 16:53:49 +0000 Subject: [PATCH 05/15] Added relevant flux and fluence outputs and CP lifetime --- process/availability.py | 57 +++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/process/availability.py b/process/availability.py index 791395ab21..c2d609b711 100644 --- a/process/availability.py +++ b/process/availability.py @@ -1013,20 +1013,43 @@ def avail_st(self, output: bool): if output: po.oheadr(self.outfile, "Plant Availability") + if tfv.i_tf_sup == 1: + po.ovarre( + self.outfile, + "Max fast neutron fluence on TF coil (n/m2)", + "(nflutfmax)", + ctv.nflutfmax, + "OP ", + ) + po.ovarre( + self.outfile, + "Centrepost TF fast neutron flux (E > 0.1 MeV) (m^(-2).^(-1))", + "(neut_flux_cp)", + fwbsv.neut_flux_cp, + "OP ", + ) + else: + po.ovarre( + self.outfile, + "Allowable ST centrepost neutron fluence (MW-yr/m2)", + "(cpstflnc)", + cv.cpstflnc, + "OP ", + ) + po.ovarre( + self.outfile, + "Average neutron wall load (MW/m2)", + "(wallmw)", + pv.wallmw, + "OP ", + ) po.ovarre( self.outfile, - "Total planned unavailability", - "(u_planned)", - u_planned, + "Centrepost lifetime (years)", + "(cplife)", + cv.cplife, "OP ", ) - po.ovarre( - self.outfile, - "Total unplanned unavailability", - "(u_unplanned)", - cv.u_unplanned, - "IP ", - ) po.oblnkl(self.outfile) po.ovarre( self.outfile, @@ -1050,6 +1073,20 @@ def avail_st(self, output: bool): "OP ", ) po.oblnkl(self.outfile) + po.ovarre( + self.outfile, + "Total planned unavailability", + "(u_planned)", + u_planned, + "OP ", + ) + po.ovarre( + self.outfile, + "Total unplanned unavailability", + "(u_unplanned)", + cv.u_unplanned, + "IP ", + ) po.ovarre( self.outfile, "Total plant availability fraction", From 7f7f46cdc4ad64c361faa0c838074cf2342c998a Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 30 Jan 2024 13:08:34 +0000 Subject: [PATCH 06/15] Revert "Added variables for avail_st model" This reverts commit fb1017358101d9109f29d40e4e31177d5e1e1218. Reversing commit above to correct autoformatting inserting unwanted changes. --- source/fortran/cost_variables.f90 | 1161 +++-- source/fortran/input.f90 | 7696 ++++++++++++++--------------- 2 files changed, 4422 insertions(+), 4435 deletions(-) diff --git a/source/fortran/cost_variables.f90 b/source/fortran/cost_variables.f90 index 3035be6e82..1eeadd9b9f 100644 --- a/source/fortran/cost_variables.f90 +++ b/source/fortran/cost_variables.f90 @@ -1,759 +1,752 @@ module cost_variables - !! author: J. Morris, S. Muldrew, M. Kovari (UKAEA) - !! - !! Module containing global variables relating to the costing algorithms of a fusion power plant. - !! - !!### References - !! - !! - AEA FUS 251: A User's Guide to the PROCESS Systems Code + !! author: J. Morris, S. Muldrew, M. Kovari (UKAEA) + !! + !! Module containing global variables relating to the costing algorithms of a fusion power plant. + !! + !!### References + !! + !! - AEA FUS 251: A User's Guide to the PROCESS Systems Code #ifndef dp - use, intrinsic :: iso_fortran_env, only: dp=>real64 + use, intrinsic :: iso_fortran_env, only: dp=>real64 #endif - implicit none + implicit none - public + public - real(dp) :: abktflnc - !! allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`) + real(dp) :: abktflnc + !! allowable first wall/blanket neutron fluence (MW-yr/m2) (`blktmodel=0`) - real(dp) :: adivflnc - !! allowable divertor heat fluence (MW-yr/m2) + real(dp) :: adivflnc + !! allowable divertor heat fluence (MW-yr/m2) - real(dp) :: blkcst - !! blanket direct cost (M$) + real(dp) :: blkcst + !! blanket direct cost (M$) - real(dp) :: c221 - !! total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates + real(dp) :: c221 + !! total account 221 cost (M$) - first wall, blanket, shield, support structure and div plates - real(dp) :: c222 - !! total account 222 cost (M$) - TF coils + PF coils + real(dp) :: c222 + !! total account 222 cost (M$) - TF coils + PF coils - real(dp) :: capcost - !! total capital cost including interest (M$) + real(dp) :: capcost + !! total capital cost including interest (M$) - real(dp) :: cconfix - !! fixed cost of superconducting cable ($/m) + real(dp) :: cconfix + !! fixed cost of superconducting cable ($/m) - real(dp) :: cconshpf - !! cost of PF coil steel conduit/sheath ($/m) + real(dp) :: cconshpf + !! cost of PF coil steel conduit/sheath ($/m) - real(dp) :: cconshtf - !! cost of TF coil steel conduit/sheath ($/m) + real(dp) :: cconshtf + !! cost of TF coil steel conduit/sheath ($/m) - real(dp) :: cdcost - !! current drive direct costs (M$) + real(dp) :: cdcost + !! current drive direct costs (M$) - real(dp) :: cdirt - !! total plant direct cost (M$) + real(dp) :: cdirt + !! total plant direct cost (M$) - real(dp) :: cdrlife - !! lifetime of heating/current drive system (y) + real(dp) :: cdrlife + !! lifetime of heating/current drive system (y) - real(dp) :: cfactr - !! Total plant availability fraction; input if `iavail=0` + real(dp) :: cfactr + !! Total plant availability fraction; input if `iavail=0` - real(dp) :: cpfact - !! Total plant capacity factor + real(dp) :: cpfact + !! Total plant capacity factor - real(dp), dimension(4) :: cfind - !! indirect cost factor (func of lsa) (cost model = 0) + real(dp), dimension(4) :: cfind + !! indirect cost factor (func of lsa) (cost model = 0) - real(dp) :: cland - !! cost of land (M$) + real(dp) :: cland + !! cost of land (M$) - real(dp) :: coe - !! cost of electricity ($/MW-hr) + real(dp) :: coe + !! cost of electricity ($/MW-hr) - real(dp) :: coecap - !! capital cost of electricity (m$/kW-hr) + real(dp) :: coecap + !! capital cost of electricity (m$/kW-hr) - real(dp) :: coefuelt - !! 'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr) + real(dp) :: coefuelt + !! 'fuel' (including replaceable components) contribution to cost of electricity (m$/kW-hr) - real(dp) :: coeoam - !! operation and maintenance contribution to cost of electricity (m$/kW-hr) + real(dp) :: coeoam + !! operation and maintenance contribution to cost of electricity (m$/kW-hr) - real(dp) :: concost - !! plant construction cost (M$) + real(dp) :: concost + !! plant construction cost (M$) - real(dp) :: costexp - !! cost exponent for scaling in 2015 costs model + real(dp) :: costexp + !! cost exponent for scaling in 2015 costs model - real(dp) :: costexp_pebbles - !! cost exponent for pebbles in 2015 costs model + real(dp) :: costexp_pebbles + !! cost exponent for pebbles in 2015 costs model - real(dp) :: cost_factor_buildings - !! cost scaling factor for buildings + real(dp) :: cost_factor_buildings + !! cost scaling factor for buildings - real(dp) :: cost_factor_land - !! cost scaling factor for land + real(dp) :: cost_factor_land + !! cost scaling factor for land - real(dp) :: cost_factor_tf_coils - !! cost scaling factor for TF coils + real(dp) :: cost_factor_tf_coils + !! cost scaling factor for TF coils - real(dp) :: cost_factor_fwbs - !! cost scaling factor for fwbs + real(dp) :: cost_factor_fwbs + !! cost scaling factor for fwbs - real(dp) :: cost_factor_rh - !! cost scaling factor for remote handling + real(dp) :: cost_factor_rh + !! cost scaling factor for remote handling - real(dp) :: cost_factor_vv - !! cost scaling factor for vacuum vessel + real(dp) :: cost_factor_vv + !! cost scaling factor for vacuum vessel - real(dp) :: cost_factor_bop - !! cost scaling factor for energy conversion system + real(dp) :: cost_factor_bop + !! cost scaling factor for energy conversion system - real(dp) :: cost_factor_misc - !! cost scaling factor for remaining subsystems + real(dp) :: cost_factor_misc + !! cost scaling factor for remaining subsystems - real(dp) :: maintenance_fwbs - !! Maintenance cost factor: first wall, blanket, shield, divertor + real(dp) :: maintenance_fwbs + !! Maintenance cost factor: first wall, blanket, shield, divertor - real(dp) :: maintenance_gen - !! Maintenance cost factor: All other components except coils, vacuum vessel, - !! thermal shield, cryostat, land + real(dp) :: maintenance_gen + !! Maintenance cost factor: All other components except coils, vacuum vessel, + !! thermal shield, cryostat, land - real(dp) :: amortization - !! amortization factor (fixed charge factor) "A" (years) + real(dp) :: amortization + !! amortization factor (fixed charge factor) "A" (years) - integer :: cost_model - !! Switch for cost model: - !! - !! - =0 use $ 1990 PROCESS model - !! - =1 use $ 2014 Kovari model - !! - =2 use user-provided model + integer :: cost_model + !! Switch for cost model: + !! + !! - =0 use $ 1990 PROCESS model + !! - =1 use $ 2014 Kovari model + !! - =2 use user-provided model - integer :: i_cp_lifetime - !! Switch for the centrepost lifetime constraint - !! 0 : The CP full power year lifetime is set by the user via cplife_input - !! 1 : The CP lifetime is equal to the divertor lifetime - !! 2 : The CP lifetime is equal to the breeding blankets lifetime - !! 3 : The CP lifetime is equal to the plant lifetime + integer :: i_cp_lifetime + !! Switch for the centrepost lifetime constraint + !! 0 : The CP full power year lifetime is set by the user via cplife_input + !! 1 : The CP lifetime is equal to the divertor lifetime + !! 2 : The CP lifetime is equal to the breeding blankets lifetime + !! 3 : The CP lifetime is equal to the plant lifetime - real(dp) :: cowner - !! owner cost factor + real(dp) :: cowner + !! owner cost factor - real(dp) :: cplife_input - !! User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0) + real(dp) :: cplife_input + !! User input full power year lifetime of the centrepost (years) (i_cp_lifetime = 0) - real(dp) :: cplife - !! Calculated full power year lifetime of centrepost (years) + real(dp) :: cplife + !! Calculated full power year lifetime of centrepost (years) - real(dp) :: cpstcst - !! ST centrepost direct cost (M$) + real(dp) :: cpstcst + !! ST centrepost direct cost (M$) - real(dp) :: cpstflnc - !! allowable ST centrepost neutron fluence (MW-yr/m2) + real(dp) :: cpstflnc + !! allowable ST centrepost neutron fluence (MW-yr/m2) - real(dp) :: crctcore - !! reactor core costs (categories 221, 222 and 223) + real(dp) :: crctcore + !! reactor core costs (categories 221, 222 and 223) - real(dp) :: csi - !! allowance for site costs (M$) + real(dp) :: csi + !! allowance for site costs (M$) - real(dp) :: cturbb - !! cost of turbine building (M$) + real(dp) :: cturbb + !! cost of turbine building (M$) - real(dp) :: decomf - !! proportion of constructed cost required for decommissioning fund + real(dp) :: decomf + !! proportion of constructed cost required for decommissioning fund - real(dp) :: dintrt - !! diff between borrowing and saving interest rates + real(dp) :: dintrt + !! diff between borrowing and saving interest rates - real(dp) :: divcst - !! divertor direct cost (M$) + real(dp) :: divcst + !! divertor direct cost (M$) - real(dp) :: divlife - !! Full power lifetime of divertor (y) + real(dp) :: divlife + !! Full power lifetime of divertor (y) - real(dp) :: dtlife - !! period prior to the end of the plant life that the decommissioning fund is used (years) + real(dp) :: dtlife + !! period prior to the end of the plant life that the decommissioning fund is used (years) - real(dp) :: fcap0 - !! average cost of money for construction of plant assuming design/construction time of six years + real(dp) :: fcap0 + !! average cost of money for construction of plant assuming design/construction time of six years - real(dp) :: fcap0cp - !! average cost of money for replaceable components assuming lead time for these of two years + real(dp) :: fcap0cp + !! average cost of money for replaceable components assuming lead time for these of two years - real(dp) :: fcdfuel - !! fraction of current drive cost treated as fuel (if `ifueltyp = 1`) + real(dp) :: fcdfuel + !! fraction of current drive cost treated as fuel (if `ifueltyp = 1`) - real(dp) :: fcontng - !! project contingency factor + real(dp) :: fcontng + !! project contingency factor - real(dp) :: fcr0 - !! fixed charge rate during construction + real(dp) :: fcr0 + !! fixed charge rate during construction - real(dp) :: fkind - !! multiplier for Nth of a kind costs + real(dp) :: fkind + !! multiplier for Nth of a kind costs - real(dp) :: fwallcst - !! first wall cost (M$) + real(dp) :: fwallcst + !! first wall cost (M$) - integer :: iavail - !! Switch for plant availability model: - !! - !! - =0 use input value for cfactr - !! - =1 calculate cfactr using Taylor and Ward 1999 model - !! - =2 calculate cfactr using new (2015) model - !! - =3 calculate cfactr using ST model + integer :: iavail + !! Switch for plant availability model: + !! + !! - =0 use input value for cfactr + !! - =1 calculate cfactr using Taylor and Ward 1999 model + !! - =2 calculate cfactr using new (2015) model - integer :: ibkt_life - !! Switch for fw/blanket lifetime calculation in availability module: - !! - !! - =0 use neutron fluence model - !! - =1 use fusion power model (DEMO only) + integer :: ibkt_life + !! Switch for fw/blanket lifetime calculation in availability module: + !! + !! - =0 use neutron fluence model + !! - =1 use fusion power model (DEMO only) - real(dp) :: life_dpa - !! Allowable DPA from DEMO fw/blanket lifetime calculation in availability module + real(dp) :: life_dpa + !! Allowable DPA from DEMO fw/blanket lifetime calculation in availability module - real(dp) :: bktcycles - !! Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation + real(dp) :: bktcycles + !! Number of fusion cycles to reach allowable DPA from DEMO fw/blanket lifetime calculation - real(dp) :: avail_min - !! Minimum availability (`constraint equation 61`) + real(dp) :: avail_min + !! Minimum availability (`constraint equation 61`) - real(dp) :: tok_build_cost_per_vol - !! Unit cost for tokamak complex buildings, including building and site services ($/m3) + real(dp) :: tok_build_cost_per_vol + !! Unit cost for tokamak complex buildings, including building and site services ($/m3) - real(dp) :: light_build_cost_per_vol - !! Unit cost for unshielded non-active buildings ($/m3) + real(dp) :: light_build_cost_per_vol + !! Unit cost for unshielded non-active buildings ($/m3) - real(dp) :: favail - !! F-value for minimum availability (`constraint equation 61`) + real(dp) :: favail + !! F-value for minimum availability (`constraint equation 61`) - integer :: num_rh_systems - !! Number of remote handling systems (1-10) + integer :: num_rh_systems + !! Number of remote handling systems (1-10) - real(dp) :: conf_mag - !! c parameter, which determines the temperature margin at which magnet lifetime starts to decline + real(dp) :: conf_mag + !! c parameter, which determines the temperature margin at which magnet lifetime starts to decline - real(dp) :: div_prob_fail - !! Divertor probability of failure (per op day) + real(dp) :: div_prob_fail + !! Divertor probability of failure (per op day) - real(dp) :: div_umain_time - !! Divertor unplanned maintenance time (years) + real(dp) :: div_umain_time + !! Divertor unplanned maintenance time (years) - real(dp) :: div_nref - !! Reference value for cycle cycle life of divertor + real(dp) :: div_nref + !! Reference value for cycle cycle life of divertor - real(dp) :: div_nu - !! The cycle when the divertor fails with 100% probability + real(dp) :: div_nu + !! The cycle when the divertor fails with 100% probability - real(dp) :: fwbs_nref - !! Reference value for cycle life of blanket + real(dp) :: fwbs_nref + !! Reference value for cycle life of blanket - real(dp) :: fwbs_nu - !! The cycle when the blanket fails with 100% probability + real(dp) :: fwbs_nu + !! The cycle when the blanket fails with 100% probability - real(dp) :: fwbs_prob_fail - !! Fwbs probability of failure (per op day) + real(dp) :: fwbs_prob_fail + !! Fwbs probability of failure (per op day) - real(dp) :: fwbs_umain_time - !! Fwbs unplanned maintenance time (years) + real(dp) :: fwbs_umain_time + !! Fwbs unplanned maintenance time (years) - real(dp) :: redun_vacp - !! Vacuum system pump redundancy level (%) + real(dp) :: redun_vacp + !! Vacuum system pump redundancy level (%) - integer :: redun_vac - !! Number of redundant vacuum pumps + integer :: redun_vac + !! Number of redundant vacuum pumps - real(dp) :: t_operation - !! Operational time (yrs) + real(dp) :: t_operation + !! Operational time (yrs) - real(dp) :: tbktrepl - !! time taken to replace blanket (y) (`iavail=1`) + real(dp) :: tbktrepl + !! time taken to replace blanket (y) (`iavail=1`) - real(dp) :: tcomrepl - !! time taken to replace both blanket and divertor (y) (`iavail=1`) + real(dp) :: tcomrepl + !! time taken to replace both blanket and divertor (y) (`iavail=1`) - real(dp) :: tdivrepl - !! time taken to replace divertor (y) (`iavail=1`) + real(dp) :: tdivrepl + !! time taken to replace divertor (y) (`iavail=1`) - real(dp) :: uubop - !! unplanned unavailability factor for balance of plant (`iavail=1`) + real(dp) :: uubop + !! unplanned unavailability factor for balance of plant (`iavail=1`) - real(dp) :: uucd - !! unplanned unavailability factor for current drive (`iavail=1`) + real(dp) :: uucd + !! unplanned unavailability factor for current drive (`iavail=1`) - real(dp) :: uudiv - !! unplanned unavailability factor for divertor (`iavail=1`) + real(dp) :: uudiv + !! unplanned unavailability factor for divertor (`iavail=1`) - real(dp) :: uufuel - !! unplanned unavailability factor for fuel system (`iavail=1`) + real(dp) :: uufuel + !! unplanned unavailability factor for fuel system (`iavail=1`) - real(dp) :: uufw - !! unplanned unavailability factor for first wall (`iavail=1`) + real(dp) :: uufw + !! unplanned unavailability factor for first wall (`iavail=1`) - real(dp) :: uumag - !! unplanned unavailability factor for magnets (`iavail=1`) + real(dp) :: uumag + !! unplanned unavailability factor for magnets (`iavail=1`) - real(dp) :: uuves - !! unplanned unavailability factor for vessel (`iavail=1`) + real(dp) :: uuves + !! unplanned unavailability factor for vessel (`iavail=1`) - integer :: ifueltyp - !! Switch for fuel type: - !! - !! - =2 treat initial blanket, divertor, first wall - !! as capital costs. Treat all later items and - !! fraction fcdfuel of CD equipment as fuel costs - !! - =1 treat blanket divertor, first wall and - !! fraction fcdfuel of CD equipment as fuel cost - !! - =0 treat these as capital cost + integer :: ifueltyp + !! Switch for fuel type: + !! + !! - =2 treat initial blanket, divertor, first wall + !! as capital costs. Treat all later items and + !! fraction fcdfuel of CD equipment as fuel costs + !! - =1 treat blanket divertor, first wall and + !! fraction fcdfuel of CD equipment as fuel cost + !! - =0 treat these as capital cost - integer :: ipnet - !! Switch for net electric power calculation: - !! - !! - =0 scale so that always > 0 - !! - =1 let go < 0 (no c-o-e) + integer :: ipnet + !! Switch for net electric power calculation: + !! + !! - =0 scale so that always > 0 + !! - =1 let go < 0 (no c-o-e) - integer :: ireactor - !! Switch for net electric power and cost of electricity calculations: - !! - !! - =0 do not calculate MW(electric) or c-o-e - !! - =1 calculate MW(electric) and c-o-e + integer :: ireactor + !! Switch for net electric power and cost of electricity calculations: + !! + !! - =0 do not calculate MW(electric) or c-o-e + !! - =1 calculate MW(electric) and c-o-e - integer :: lsa - !! Level of safety assurance switch (generally, use 3 or 4): - !! - !! - =1 truly passively safe plant - !! - =2,3 in-between - !! - =4 like current fission plant + integer :: lsa + !! Level of safety assurance switch (generally, use 3 or 4): + !! + !! - =1 truly passively safe plant + !! - =2,3 in-between + !! - =4 like current fission plant - real(dp) :: moneyint - !! interest portion of capital cost (M$) + real(dp) :: moneyint + !! interest portion of capital cost (M$) - integer :: output_costs - !! Switch for costs output: - !! - !! - =0 do not write cost-related outputs to file - !! - =1 write cost-related outputs to file + integer :: output_costs + !! Switch for costs output: + !! + !! - =0 do not write cost-related outputs to file + !! - =1 write cost-related outputs to file - real(dp) :: discount_rate - !! effective cost of money in constant dollars + real(dp) :: discount_rate + !! effective cost of money in constant dollars - real(dp) :: startupratio - !! ratio of additional HCD power for start-up to flat-top operational requirements + real(dp) :: startupratio + !! ratio of additional HCD power for start-up to flat-top operational requirements - real(dp) :: startuppwr - !! cost associated with additional HCD system power required on start-up ($) + real(dp) :: startuppwr + !! cost associated with additional HCD system power required on start-up ($) - real(dp) :: tlife - !! Full power year plant lifetime (years) + real(dp) :: tlife + !! Full power year plant lifetime (years) - real(dp) :: tmain - !! Maintenance time for replacing CP (years) (iavail = 3) + real(dp), parameter :: ucad = 180.0D0 + !! unit cost for administration buildings (M$/m3) - real(dp) :: u_unplanned - !! User-input CP unplanned unavailability (iavail = 3) + real(dp), parameter :: ucaf = 1.5D6 + !! unit cost for aux facility power equipment ($) - real(dp), parameter :: ucad = 180.0D0 - !! unit cost for administration buildings (M$/m3) + real(dp), parameter :: ucahts = 31.0D0 + !! unit cost for aux heat transport equipment ($/W**exphts) - real(dp), parameter :: ucaf = 1.5D6 - !! unit cost for aux facility power equipment ($) + real(dp), parameter :: ucap = 17.0D0 + !! unit cost of auxiliary transformer ($/kVA) - real(dp), parameter :: ucahts = 31.0D0 - !! unit cost for aux heat transport equipment ($/W**exphts) + real(dp) :: ucblbe + !! unit cost for blanket beryllium ($/kg) - real(dp), parameter :: ucap = 17.0D0 - !! unit cost of auxiliary transformer ($/kVA) + real(dp) :: ucblbreed + !! unit cost for breeder material ($/kg) (`blktmodel>0`) - real(dp) :: ucblbe - !! unit cost for blanket beryllium ($/kg) + real(dp) :: ucblli + !! unit cost for blanket lithium ($/kg) (30% Li6) - real(dp) :: ucblbreed - !! unit cost for breeder material ($/kg) (`blktmodel>0`) + real(dp) :: ucblli2o + !! unit cost for blanket Li_2O ($/kg) - real(dp) :: ucblli - !! unit cost for blanket lithium ($/kg) (30% Li6) + real(dp) :: ucbllipb + !! unit cost for blanket Li-Pb ($/kg) (30% Li6) - real(dp) :: ucblli2o - !! unit cost for blanket Li_2O ($/kg) + real(dp) :: ucblss + !! unit cost for blanket stainless steel ($/kg) - real(dp) :: ucbllipb - !! unit cost for blanket Li-Pb ($/kg) (30% Li6) + real(dp) :: ucblvd + !! unit cost for blanket vanadium ($/kg) - real(dp) :: ucblss - !! unit cost for blanket stainless steel ($/kg) + real(dp), parameter :: ucbpmp = 2.925D5 + !! vacuum system backing pump cost ($) - real(dp) :: ucblvd - !! unit cost for blanket vanadium ($/kg) + real(dp) :: ucbus + !! cost of aluminium bus for TF coil ($/A-m) - real(dp), parameter :: ucbpmp = 2.925D5 - !! vacuum system backing pump cost ($) + real(dp) :: uccase + !! cost of superconductor case ($/kg) - real(dp) :: ucbus - !! cost of aluminium bus for TF coil ($/A-m) + real(dp), parameter :: ucco = 350.0D0 + !! unit cost for control buildings (M$/m3) - real(dp) :: uccase - !! cost of superconductor case ($/kg) + real(dp) :: uccpcl1 + !! cost of high strength tapered copper ($/kg) - real(dp), parameter :: ucco = 350.0D0 - !! unit cost for control buildings (M$/m3) + real(dp) :: uccpclb + !! cost of TF outboard leg plate coils ($/kg) - real(dp) :: uccpcl1 - !! cost of high strength tapered copper ($/kg) + real(dp), parameter :: uccpmp = 3.9D5 + !! vacuum system cryopump cost ($) - real(dp) :: uccpclb - !! cost of TF outboard leg plate coils ($/kg) + real(dp), parameter :: uccr = 460.0D0 + !! unit cost for cryogenic building (M$/vol) - real(dp), parameter :: uccpmp = 3.9D5 - !! vacuum system cryopump cost ($) + real(dp) :: uccry + !! heat transport system cryoplant costs ($/W**expcry) - real(dp), parameter :: uccr = 460.0D0 - !! unit cost for cryogenic building (M$/vol) + real(dp) :: uccryo + !! unit cost for vacuum vessel ($/kg) - real(dp) :: uccry - !! heat transport system cryoplant costs ($/W**expcry) + real(dp) :: uccu + !! unit cost for copper in superconducting cable ($/kg) - real(dp) :: uccryo - !! unit cost for vacuum vessel ($/kg) + real(dp), parameter :: ucdgen = 1.7D6 + !! cost per 8 MW diesel generator ($) - real(dp) :: uccu - !! unit cost for copper in superconducting cable ($/kg) + real(dp) :: ucdiv + !! cost of divertor blade ($) - real(dp), parameter :: ucdgen = 1.7D6 - !! cost per 8 MW diesel generator ($) + real(dp), parameter :: ucdtc = 13.0D0 + !! detritiation, air cleanup cost ($/10000m3/hr) - real(dp) :: ucdiv - !! cost of divertor blade ($) + real(dp), parameter :: ucduct = 4.225D4 + !! vacuum system duct cost ($/m) - real(dp), parameter :: ucdtc = 13.0D0 - !! detritiation, air cleanup cost ($/10000m3/hr) + real(dp) :: ucech + !! ECH system cost ($/W) - real(dp), parameter :: ucduct = 4.225D4 - !! vacuum system duct cost ($/m) + real(dp), parameter :: ucel = 380.0D0 + !! unit cost for electrical equipment building (M$/m3) - real(dp) :: ucech - !! ECH system cost ($/W) + real(dp), parameter :: uces1 = 3.2D4 + !! MGF (motor-generator flywheel) cost factor ($/MVA**0.8) - real(dp), parameter :: ucel = 380.0D0 - !! unit cost for electrical equipment building (M$/m3) + real(dp), parameter :: uces2 = 8.8D3 + !! MGF (motor-generator flywheel) cost factor ($/MJ**0.8) - real(dp), parameter :: uces1 = 3.2D4 - !! MGF (motor-generator flywheel) cost factor ($/MVA**0.8) + real(dp) :: ucf1 + !! cost of fuelling system ($) - real(dp), parameter :: uces2 = 8.8D3 - !! MGF (motor-generator flywheel) cost factor ($/MJ**0.8) + real(dp) :: ucfnc + !! outer PF coil fence support cost ($/kg) - real(dp) :: ucf1 - !! cost of fuelling system ($) + real(dp), parameter :: ucfpr = 4.4D7 + !! cost of 60g/day tritium processing unit ($) - real(dp) :: ucfnc - !! outer PF coil fence support cost ($/kg) + real(dp) :: ucfuel + !! unit cost of D-T fuel (M$/year/1200MW) - real(dp), parameter :: ucfpr = 4.4D7 - !! cost of 60g/day tritium processing unit ($) + real(dp), parameter :: ucfwa = 6.0D4 + !! first wall armour cost ($/m2) - real(dp) :: ucfuel - !! unit cost of D-T fuel (M$/year/1200MW) + real(dp), parameter :: ucfwps = 1.0D7 + !! first wall passive stabiliser cost ($) - real(dp), parameter :: ucfwa = 6.0D4 - !! first wall armour cost ($/m2) + real(dp), parameter :: ucfws = 5.3D4 + !! first wall structure cost ($/m2) - real(dp), parameter :: ucfwps = 1.0D7 - !! first wall passive stabiliser cost ($) + real(dp), parameter :: ucgss = 35.0D0 + !! cost of reactor structure ($/kg) - real(dp), parameter :: ucfws = 5.3D4 - !! first wall structure cost ($/m2) + real(dp) :: uche3 + !! cost of helium-3 ($/kg) - real(dp), parameter :: ucgss = 35.0D0 - !! cost of reactor structure ($/kg) + real(dp) :: uchrs + !! cost of heat rejection system ($) - real(dp) :: uche3 - !! cost of helium-3 ($/kg) + real(dp), dimension(2) :: uchts + !! cost of heat transport system equipment per loop ($/W); dependent on coolant type (coolwh) - real(dp) :: uchrs - !! cost of heat rejection system ($) + real(dp) :: uciac + !! cost of instrumentation, control & diagnostics ($) - real(dp), dimension(2) :: uchts - !! cost of heat transport system equipment per loop ($/W); dependent on coolant type (coolwh) + real(dp) :: ucich + !! ICH system cost ($/W) - real(dp) :: uciac - !! cost of instrumentation, control & diagnostics ($) + real(dp), parameter :: ucint = 35.0D0 + !! superconductor intercoil structure cost ($/kg) - real(dp) :: ucich - !! ICH system cost ($/W) + real(dp) :: uclh + !! lower hybrid system cost ($/W) - real(dp), parameter :: ucint = 35.0D0 - !! superconductor intercoil structure cost ($/kg) + real(dp), parameter :: uclv = 16.0D0 + !! low voltage system cost ($/kVA) - real(dp) :: uclh - !! lower hybrid system cost ($/W) + real(dp), parameter :: ucmb = 260.0D0 + !! unit cost for reactor maintenance building (M$/m3) - real(dp), parameter :: uclv = 16.0D0 - !! low voltage system cost ($/kVA) + real(dp) :: ucme + !! cost of maintenance equipment ($) - real(dp), parameter :: ucmb = 260.0D0 - !! unit cost for reactor maintenance building (M$/m3) + real(dp) :: ucmisc + !! miscellaneous plant allowance ($) - real(dp) :: ucme - !! cost of maintenance equipment ($) + real(dp) :: ucnbi + !! NBI system cost ($/W) - real(dp) :: ucmisc - !! miscellaneous plant allowance ($) + real(dp), parameter :: ucnbv = 1000.0D0 + !! cost of nuclear building ventilation ($/m3) - real(dp) :: ucnbi - !! NBI system cost ($/W) + real(dp), dimension(4) :: ucoam + !! annual cost of operation and maintenance (M$/year/1200MW**0.5) - real(dp), parameter :: ucnbv = 1000.0D0 - !! cost of nuclear building ventilation ($/m3) + real(dp) :: ucpens + !! penetration shield cost ($/kg) - real(dp), dimension(4) :: ucoam - !! annual cost of operation and maintenance (M$/year/1200MW**0.5) + real(dp) :: ucpfb + !! cost of PF coil buses ($/kA-m) - real(dp) :: ucpens - !! penetration shield cost ($/kg) + real(dp) :: ucpfbk + !! cost of PF coil DC breakers ($/MVA**0.7) - real(dp) :: ucpfb - !! cost of PF coil buses ($/kA-m) + real(dp) :: ucpfbs + !! cost of PF burn power supplies ($/kW**0.7) - real(dp) :: ucpfbk - !! cost of PF coil DC breakers ($/MVA**0.7) + real(dp) :: ucpfcb + !! cost of PF coil AC breakers ($/circuit) - real(dp) :: ucpfbs - !! cost of PF burn power supplies ($/kW**0.7) + real(dp) :: ucpfdr1 + !! cost factor for dump resistors ($/MJ) - real(dp) :: ucpfcb - !! cost of PF coil AC breakers ($/circuit) + real(dp) :: ucpfic + !! cost of PF instrumentation and control ($/channel) - real(dp) :: ucpfdr1 - !! cost factor for dump resistors ($/MJ) + real(dp) :: ucpfps + !! cost of PF coil pulsed power supplies ($/MVA) - real(dp) :: ucpfic - !! cost of PF instrumentation and control ($/channel) + real(dp), parameter :: ucphx = 15.0D0 + !! primary heat transport cost ($/W**exphts) - real(dp) :: ucpfps - !! cost of PF coil pulsed power supplies ($/MVA) + real(dp), parameter :: ucpp = 48.0D0 + !! cost of primary power transformers ($/kVA**0.9) - real(dp), parameter :: ucphx = 15.0D0 - !! primary heat transport cost ($/W**exphts) + real(dp) :: ucrb + !! cost of reactor building (M$/m3) - real(dp), parameter :: ucpp = 48.0D0 - !! cost of primary power transformers ($/kVA**0.9) + real(dp), dimension(9) :: ucsc + !! cost of superconductor ($/kg) - real(dp) :: ucrb - !! cost of reactor building (M$/m3) + real(dp), parameter :: ucsh = 115.0D0 + !! cost of shops and warehouses (M$/m3) - real(dp), dimension(9) :: ucsc - !! cost of superconductor ($/kg) + real(dp) :: ucshld + !! cost of shield structural steel ($/kg) - real(dp), parameter :: ucsh = 115.0D0 - !! cost of shops and warehouses (M$/m3) + real(dp), parameter :: ucswyd = 1.84D7 + !! switchyard equipment costs ($) - real(dp) :: ucshld - !! cost of shield structural steel ($/kg) + real(dp) :: uctfbr + !! cost of TF coil breakers ($/W**0.7) - real(dp), parameter :: ucswyd = 1.84D7 - !! switchyard equipment costs ($) + real(dp) :: uctfbus + !! cost of TF coil bus ($/kg) - real(dp) :: uctfbr - !! cost of TF coil breakers ($/W**0.7) + real(dp), parameter :: uctfdr = 1.75D-4 + !! cost of TF coil dump resistors ($/J) - real(dp) :: uctfbus - !! cost of TF coil bus ($/kg) - - real(dp), parameter :: uctfdr = 1.75D-4 - !! cost of TF coil dump resistors ($/J) - - real(dp), parameter :: uctfgr = 5000.0D0 - !! additional cost of TF coil dump resistors ($/coil) - - real(dp), parameter :: uctfic = 1.0D4 - !! cost of TF coil instrumentation and control ($/coil/30) - - real(dp) :: uctfps - !! cost of TF coil power supplies ($/W**0.7) - - real(dp) :: uctfsw - !! cost of TF coil slow dump switches ($/A) - - real(dp), parameter :: uctpmp = 1.105D5 - !! cost of turbomolecular pump ($) - - real(dp), parameter :: uctr = 370.0D0 - !! cost of tritium building ($/m3) - - real(dp), dimension(2) :: ucturb - !! cost of turbine plant equipment ($) (dependent on coolant type coolwh) - - real(dp), parameter :: ucvalv = 3.9D5 - !! vacuum system valve cost ($) - - real(dp), parameter :: ucvdsh = 26.0D0 - !! vacuum duct shield cost ($/kg) - - real(dp), parameter :: ucviac = 1.3D6 - !! vacuum system instrumentation and control cost ($) - - real(dp) :: ucwindpf - !! cost of PF coil superconductor windings ($/m) - - real(dp) :: ucwindtf - !! cost of TF coil superconductor windings ($/m) - - real(dp), parameter :: ucws = 460.0D0 - !! cost of active assembly shop ($/m3) - - real(dp), dimension(4) :: ucwst - !! cost of waste disposal (M$/y/1200MW) - -contains - - subroutine init_cost_variables - !! Initialise cost variables - implicit none - - abktflnc = 5.0D0 - adivflnc = 7.0D0 - blkcst = 0.0D0 - c221 = 0.0D0 - c222 = 0.0D0 - capcost = 0.0D0 - cconfix = 80.0D0 - cconshpf = 70.0D0 - cconshtf = 75.0D0 - cdcost = 0.0D0 - cdirt = 0.0D0 - cdrlife = 0.0D0 - cfactr = 0.75D0 - cpfact = 0.0D0 - cfind = (/0.244D0, 0.244D0, 0.244D0, 0.29D0/) - cland = 19.2D0 - coe = 0.0D0 - coecap = 0.0D0 - coefuelt = 0.0D0 - coeoam = 0.0D0 - concost = 0.0D0 - costexp = 0.8D0 - costexp_pebbles = 0.6D0 - cost_factor_buildings = 1.0D0 - cost_factor_land = 1.0D0 - cost_factor_tf_coils = 1.0D0 - cost_factor_fwbs = 1.0D0 - cost_factor_rh = 1.0D0 - cost_factor_vv = 1.0D0 - cost_factor_bop = 1.0D0 - cost_factor_misc = 1.0D0 - maintenance_fwbs = 0.2D0 - maintenance_gen = 0.05D0 - amortization = 13.6D0 - cost_model = 1 - cowner = 0.15D0 - cplife = 0.0D0 - cpstcst = 0.0D0 - cpstflnc = 10.0D0 - crctcore = 0.0D0 - csi = 16.0D0 - cturbb = 38.0D0 - decomf = 0.1D0 - dintrt = 0.0D0 - divcst = 0.0D0 - divlife = 0.0D0 - dtlife = 0.0D0 - fcap0 = 1.165D0 - fcap0cp = 1.08D0 - fcdfuel = 0.1D0 - fcontng = 0.195D0 - fcr0 = 0.0966D0 - fkind = 1.0D0 - fwallcst = 0.0D0 - iavail= 2 - ibkt_life = 0 - life_dpa = 50 - bktcycles = 1.0D3 - avail_min = 0.75D0 - tok_build_cost_per_vol = 1283.0D0 - light_build_cost_per_vol = 270.0D0 - favail = 1.0D0 - num_rh_systems = 4 - conf_mag = 0.99D0 - div_prob_fail = 0.0002D0 - div_umain_time = 0.25D0 - div_nref = 7000.0D0 - div_nu = 14000.0D0 - fwbs_nref = 20000.0D0 - fwbs_nu = 40000.0D0 - fwbs_prob_fail = 0.0002D0 - fwbs_umain_time = 0.25D0 - redun_vacp = 25.0D0 - redun_vac = 0 - t_operation = 0.0D0 - tbktrepl = 0.5D0 - tcomrepl = 0.5D0 - tdivrepl = 0.25D0 - uubop = 0.02D0 - uucd = 0.02D0 - uudiv = 0.04D0 - uufuel = 0.02D0 - uufw = 0.04D0 - uumag = 0.02D0 - uuves = 0.04D0 - ifueltyp = 0 - ipnet = 0 - ireactor = 1 - lsa = 4 - moneyint = 0.0D0 - output_costs = 1 - discount_rate = 0.0435D0 - startupratio = 1.0 - startuppwr = 0.0 - tlife = 30.0D0 - ucblbe = 260.0D0 - ucblbreed = 875.0D0 - ucblli = 875.0D0 - ucblli2o = 600.0D0 - ucbllipb = 10.3D0 - ucblss = 90.0D0 - ucblvd = 200.0D0 - ucbus = 0.123D0 - uccase = 50.0D0 - uccpcl1 = 250.0D0 - uccpclb = 150.0D0 - uccry = 9.3D4 - uccryo = 32.0D0 - uccu = 75.0D0 - ucdiv = 2.8D5 - ucech = 3.0D0 - ucf1 = 2.23D7 - ucfnc = 35.0D0 - ucfuel = 3.45D0 - uche3 = 1.0D6 - uchrs = 87.9D6 - uchts = (/15.3D0, 19.1D0/) - uciac = 1.5D8 - ucich = 3.0D0 - uclh = 3.3D0 - ucme = 1.25D8 - ucmisc = 2.5D7 - ucnbi = 3.3D0 - ucoam = (/68.8D0, 68.8D0, 68.8D0, 74.4D0/) - ucpens = 32.0D0 - ucpfb = 210.0D0 - ucpfbk = 1.66D4 - ucpfbs = 4.9D3 - ucpfcb = 7.5D4 - ucpfdr1 = 150.0D0 - ucpfic = 1.0D4 - ucpfps = 3.5D4 - ucrb = 400.0D0 - ucsc = & - (/600.0D0, 600.0D0, 300.0D0, 600.0D0, 600.0D0, 600.0D0, 300.0D0, 1200.0D0, & - 1200.0D0/) - ucshld = 32.0D0 - uctfbr = 1.22D0 - uctfbus = 100.0D0 - uctfps = 24.0D0 - uctfsw = 1.0D0 - ucturb = (/230.0D6, 245.0D6/) - ucwindpf = 465.0D0 - ucwindtf = 480.0D0 - ucwst = (/0.0D0, 3.94D0, 5.91D0, 7.88D0/) - i_cp_lifetime = 0 - cplife_input = 2.0D0 - - end subroutine init_cost_variables + real(dp), parameter :: uctfgr = 5000.0D0 + !! additional cost of TF coil dump resistors ($/coil) + + real(dp), parameter :: uctfic = 1.0D4 + !! cost of TF coil instrumentation and control ($/coil/30) + + real(dp) :: uctfps + !! cost of TF coil power supplies ($/W**0.7) + + real(dp) :: uctfsw + !! cost of TF coil slow dump switches ($/A) + + real(dp), parameter :: uctpmp = 1.105D5 + !! cost of turbomolecular pump ($) + + real(dp), parameter :: uctr = 370.0D0 + !! cost of tritium building ($/m3) + + real(dp), dimension(2) :: ucturb + !! cost of turbine plant equipment ($) (dependent on coolant type coolwh) + + real(dp), parameter :: ucvalv = 3.9D5 + !! vacuum system valve cost ($) + + real(dp), parameter :: ucvdsh = 26.0D0 + !! vacuum duct shield cost ($/kg) + + real(dp), parameter :: ucviac = 1.3D6 + !! vacuum system instrumentation and control cost ($) + + real(dp) :: ucwindpf + !! cost of PF coil superconductor windings ($/m) + + real(dp) :: ucwindtf + !! cost of TF coil superconductor windings ($/m) + + real(dp), parameter :: ucws = 460.0D0 + !! cost of active assembly shop ($/m3) + + real(dp), dimension(4) :: ucwst + !! cost of waste disposal (M$/y/1200MW) + + contains + + subroutine init_cost_variables + !! Initialise cost variables + implicit none + + abktflnc = 5.0D0 + adivflnc = 7.0D0 + blkcst = 0.0D0 + c221 = 0.0D0 + c222 = 0.0D0 + capcost = 0.0D0 + cconfix = 80.0D0 + cconshpf = 70.0D0 + cconshtf = 75.0D0 + cdcost = 0.0D0 + cdirt = 0.0D0 + cdrlife = 0.0D0 + cfactr = 0.75D0 + cpfact = 0.0D0 + cfind = (/0.244D0, 0.244D0, 0.244D0, 0.29D0/) + cland = 19.2D0 + coe = 0.0D0 + coecap = 0.0D0 + coefuelt = 0.0D0 + coeoam = 0.0D0 + concost = 0.0D0 + costexp = 0.8D0 + costexp_pebbles = 0.6D0 + cost_factor_buildings = 1.0D0 + cost_factor_land = 1.0D0 + cost_factor_tf_coils = 1.0D0 + cost_factor_fwbs = 1.0D0 + cost_factor_rh = 1.0D0 + cost_factor_vv = 1.0D0 + cost_factor_bop = 1.0D0 + cost_factor_misc = 1.0D0 + maintenance_fwbs = 0.2D0 + maintenance_gen = 0.05D0 + amortization = 13.6D0 + cost_model = 1 + cowner = 0.15D0 + cplife = 0.0D0 + cpstcst = 0.0D0 + cpstflnc = 10.0D0 + crctcore = 0.0D0 + csi = 16.0D0 + cturbb = 38.0D0 + decomf = 0.1D0 + dintrt = 0.0D0 + divcst = 0.0D0 + divlife = 0.0D0 + dtlife = 0.0D0 + fcap0 = 1.165D0 + fcap0cp = 1.08D0 + fcdfuel = 0.1D0 + fcontng = 0.195D0 + fcr0 = 0.0966D0 + fkind = 1.0D0 + fwallcst = 0.0D0 + iavail= 2 + ibkt_life = 0 + life_dpa = 50 + bktcycles = 1.0D3 + avail_min = 0.75D0 + tok_build_cost_per_vol = 1283.0D0 + light_build_cost_per_vol = 270.0D0 + favail = 1.0D0 + num_rh_systems = 4 + conf_mag = 0.99D0 + div_prob_fail = 0.0002D0 + div_umain_time = 0.25D0 + div_nref = 7000.0D0 + div_nu = 14000.0D0 + fwbs_nref = 20000.0D0 + fwbs_nu = 40000.0D0 + fwbs_prob_fail = 0.0002D0 + fwbs_umain_time = 0.25D0 + redun_vacp = 25.0D0 + redun_vac = 0 + t_operation = 0.0D0 + tbktrepl = 0.5D0 + tcomrepl = 0.5D0 + tdivrepl = 0.25D0 + uubop = 0.02D0 + uucd = 0.02D0 + uudiv = 0.04D0 + uufuel = 0.02D0 + uufw = 0.04D0 + uumag = 0.02D0 + uuves = 0.04D0 + ifueltyp = 0 + ipnet = 0 + ireactor = 1 + lsa = 4 + moneyint = 0.0D0 + output_costs = 1 + discount_rate = 0.0435D0 + startupratio = 1.0 + startuppwr = 0.0 + tlife = 30.0D0 + ucblbe = 260.0D0 + ucblbreed = 875.0D0 + ucblli = 875.0D0 + ucblli2o = 600.0D0 + ucbllipb = 10.3D0 + ucblss = 90.0D0 + ucblvd = 200.0D0 + ucbus = 0.123D0 + uccase = 50.0D0 + uccpcl1 = 250.0D0 + uccpclb = 150.0D0 + uccry = 9.3D4 + uccryo = 32.0D0 + uccu = 75.0D0 + ucdiv = 2.8D5 + ucech = 3.0D0 + ucf1 = 2.23D7 + ucfnc = 35.0D0 + ucfuel = 3.45D0 + uche3 = 1.0D6 + uchrs = 87.9D6 + uchts = (/15.3D0, 19.1D0/) + uciac = 1.5D8 + ucich = 3.0D0 + uclh = 3.3D0 + ucme = 1.25D8 + ucmisc = 2.5D7 + ucnbi = 3.3D0 + ucoam = (/68.8D0, 68.8D0, 68.8D0, 74.4D0/) + ucpens = 32.0D0 + ucpfb = 210.0D0 + ucpfbk = 1.66D4 + ucpfbs = 4.9D3 + ucpfcb = 7.5D4 + ucpfdr1 = 150.0D0 + ucpfic = 1.0D4 + ucpfps = 3.5D4 + ucrb = 400.0D0 + ucsc = & + (/600.0D0, 600.0D0, 300.0D0, 600.0D0, 600.0D0, 600.0D0, 300.0D0, 1200.0D0, & + 1200.0D0/) + ucshld = 32.0D0 + uctfbr = 1.22D0 + uctfbus = 100.0D0 + uctfps = 24.0D0 + uctfsw = 1.0D0 + ucturb = (/230.0D6, 245.0D6/) + ucwindpf = 465.0D0 + ucwindtf = 480.0D0 + ucwst = (/0.0D0, 3.94D0, 5.91D0, 7.88D0/) + i_cp_lifetime = 0 + cplife_input = 2.0D0 + + end subroutine init_cost_variables end module cost_variables diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 5d1fa05acd..05d8221a74 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -6,5177 +6,5171 @@ module process_input - !! Module containing the routines that perform the actual reading - !! and parsing of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! N/A - !! This module provides a set of routines to read in data from the - !! main PROCESS input file (IN.DAT). The format of the file is - !! similar to the F90 NAMELIST structure, but with a few - !! additional features: - !!

    - !!

  1. Comments can be read in that are copied to the standard - !! output channel - these are lines with five (or more) - !! consecutive '*' characters at the start. - !!

  2. Other lines within the file can contain simple comments - !! for the user - these are not copied to the standard output - !! channel. They start with one to four '*' characters. - !!
- !!

Character strings, integers and double precision values can - !! be read in. - !!

The following rules must be obeyed when writing an input - !! file: - !!

- !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Module containing the routines that perform the actual reading + !! and parsing of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! N/A + !! This module provides a set of routines to read in data from the + !! main PROCESS input file (IN.DAT). The format of the file is + !! similar to the F90 NAMELIST structure, but with a few + !! additional features: + !!
    + !!

  1. Comments can be read in that are copied to the standard + !! output channel - these are lines with five (or more) + !! consecutive '*' characters at the start. + !!

  2. Other lines within the file can contain simple comments + !! for the user - these are not copied to the standard output + !! channel. They start with one to four '*' characters. + !!
+ !!

Character strings, integers and double precision values can + !! be read in. + !!

The following rules must be obeyed when writing an input + !! file: + !!

+ !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #ifndef dp - use, intrinsic :: iso_fortran_env, only: dp=>real64 + use, intrinsic :: iso_fortran_env, only: dp=>real64 #endif - implicit none + implicit none - private - public :: input, check_range_int, check_range_real, lower_case, init_input - integer, public, parameter :: nin = 10 + private + public :: input, check_range_int, check_range_real, lower_case, init_input + integer, public, parameter :: nin = 10 #ifdef unit_test - public :: parse_input_file + public :: parse_input_file #endif ! public :: upper_case - integer, parameter :: maxlen = 2000 ! maximum line length - character(len=maxlen) :: line ! current line of text from input file - integer :: linelen, lineno ! current line length, line number - integer :: iptr ! current position on line - integer :: infile, outfile, report_changes, icode - logical :: subscript_present - logical :: error - character(len=78) :: error_message + integer, parameter :: maxlen = 2000 ! maximum line length + character(len=maxlen) :: line ! current line of text from input file + integer :: linelen, lineno ! current line length, line number + integer :: iptr ! current position on line + integer :: infile, outfile, report_changes, icode + logical :: subscript_present + logical :: error + character(len=78) :: error_message - ! Vars for subroutine input() requiring re-initialisation before each new run - integer :: show_changes - logical :: constraints_exist + ! Vars for subroutine input() requiring re-initialisation before each new run + integer :: show_changes + logical :: constraints_exist contains - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine init_input - !! Initialise module variables - implicit none - - error = .False. - show_changes = 0 - constraints_exist = .false. - line = "" - linelen = 0 - lineno = 0 - iptr = 0 - infile = 0 - outfile = 0 - report_changes = 0 - icode = 0 - subscript_present = .false. - error_message = "" - end subroutine init_input - - subroutine input - - !! Routine that calls the main input file parsing routines - !! author: P J Knight, CCFE, Culham Science Centre - !! None - !! This routine provides the interface between the input file - !! reading routines and the rest of PROCESS. - !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - use constants, only: nout - use numerics, only: ipeqns, icc, active_constraints - implicit none - - ! Arguments - - ! Local variables - - integer :: i - ! j - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - call parse_input_file(nin,nout,show_changes) - - ! Set all the values of the active_constraints array - do i = 1, ipeqns - if (icc(i) /= 0) then + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine init_input + !! Initialise module variables + implicit none + + error = .False. + show_changes = 0 + constraints_exist = .false. + line = "" + linelen = 0 + lineno = 0 + iptr = 0 + infile = 0 + outfile = 0 + report_changes = 0 + icode = 0 + subscript_present = .false. + error_message = "" + end subroutine init_input + + subroutine input + + !! Routine that calls the main input file parsing routines + !! author: P J Knight, CCFE, Culham Science Centre + !! None + !! This routine provides the interface between the input file + !! reading routines and the rest of PROCESS. + !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use constants, only: nout + use numerics, only: ipeqns, icc, active_constraints + implicit none + + ! Arguments + + ! Local variables + + integer :: i + ! j + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + call parse_input_file(nin,nout,show_changes) + + ! Set all the values of the active_constraints array + do i = 1, ipeqns + if (icc(i) /= 0) then active_constraints(icc(i)) = .true. constraints_exist = .true. - end if - end do - - ! Set the device type based on the input file's switches - call devtyp - end subroutine input - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine devtyp - !! Set icase description based on device type - use global_variables, only: icase - use ife_variables, only: ife - use stellarator_variables, only: istell - implicit none - - if (ife == 1) then - icase = 'Inertial Fusion model' - else if (istell /= 0) then - icase = 'Stellarator model' - end if - end subroutine devtyp - - subroutine parse_input_file(in_file,out_file,show_changes) - - !! Routine that parses the contents of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! author: J Morris, CCFE, Culham Science Centre - !! author: F Warmer, IPP Greifswald - !! in_file : input integer : Fortran input unit identifier - !! out_file : input integer : Fortran output unit identifier - !! show_changes : input integer : switch to turn on (1) or off (0) - !! reporting of changed values - !! This routine reads the data from the PROCESS input file (IN.DAT), - !! dealing with comments or blank lines correctly, and sets the - !! value of any variables found in the file. Any changes - !! from the default values may be reported if required. - !!

Each possible variable in this block is dealt with - !! individually. (To add additional input variables, simply copy - !! and edit one of the similar existing examples.) - !! The routine also does the extremely useful function of checking - !! that the given value for a variable lies within a sensible - !! predefined range, and stops the program if apparently - !! nonsensical values are attempted. - !! A User's Guide to the PROCESS Systems Code, P. J. Knight, - !! AEA Fusion Report AEA FUS 251, 1993 - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - use constants, only: dcopper, dalu - use global_variables, only: run_tests, verbose, maxcal, runtitle - use build_variables, only: tf_in_cs, fmsfw, blbmoth, blbuith, fmsbc, shldoth, & - fmsdwi, shldtth, shldlth, vgap2, plleni, fwoth, vvblgap, fmsbl, & - thshield_ib, thshield_ob, thshield_vb, iprecomp, & - blbpith, aplasmin, blbuoth, tfcth, fmsdwe, & - iohcl, tftsgap, clhsf, bore, plleno, scrapli, gapomin, ddwex, & - rinboard, fmstf, blnkoth, fseppc, plsepo, fmssh, blnkith, & - ohcth, plsepi, fmsoh, blbmith, gapoh, fcspc, scraplo, vgaptop, & - blbpoth, gapds, fwith, vgap, shldith, sigallpc, tfootfi, f_avspace,& - r_cp_top, d_vv_in, d_vv_out, d_vv_top, d_vv_bot, f_r_cp, i_r_cp_top - use buildings_variables, only: hcwt, conv, wgt, trcl, rbwt, & - esbldgm3, fndt, row, wgt2, pibv, clh1, stcl, clh2, & - tfcbv, hccl, rbrt, triv, shov, admv, i_bldgs_v, i_bldgs_size, & - mbvfac, pfbldgm3, wsvfac, rbvfac, rxcl, shmf, & - aux_build_l, aux_build_w, aux_build_h, auxcool_l, auxcool_w, auxcool_h, & - bioshld_thk, chemlab_l, chemlab_w, chemlab_h, control_buildings_l, & - control_buildings_w, control_buildings_h, crane_arm_h, crane_clrnc_h, & - crane_clrnc_v, cryomag_l, cryomag_w, cryomag_h, cryostore_l, & - cryostore_w, cryostore_h, cryostat_clrnc, elecdist_l, elecdist_w, & - elecdist_h, elecload_l, elecload_w, elecload_h, elecstore_l, & - elecstore_w, elecstore_h, fc_building_l, fc_building_w, & - gas_buildings_l, gas_buildings_w, gas_buildings_h, ground_clrnc, & - hcd_building_l, hcd_building_w, hcd_building_h, hw_storage_l, & - hw_storage_w, hw_storage_h, heat_sink_l, heat_sink_w, heat_sink_h, & - hot_sepdist, hotcell_h, ilw_smelter_l, ilw_smelter_w, ilw_smelter_h, & - ilw_storage_l, ilw_storage_w, ilw_storage_h, llw_storage_l, & - llw_storage_w, llw_storage_h, magnet_pulse_l, magnet_pulse_w, & - magnet_pulse_h, magnet_trains_l, magnet_trains_w, magnet_trains_h, & - maint_cont_l, maint_cont_w, maint_cont_h, nbi_sys_l, nbi_sys_w, & - qnty_sfty_fac, reactor_clrnc, reactor_fndtn_thk, reactor_hall_l, & - reactor_hall_w, reactor_hall_h, reactor_roof_thk, reactor_wall_thk, & - robotics_l, robotics_w, robotics_h, sec_buildings_l, sec_buildings_w, & - sec_buildings_h, staff_buildings_h, staff_buildings_area, & - transp_clrnc, turbine_hall_l, turbine_hall_w, turbine_hall_h, & - tw_storage_l, tw_storage_w, tw_storage_h, warm_shop_l, warm_shop_w, & - warm_shop_h, water_buildings_l, water_buildings_w, water_buildings_h, & - workshop_l, workshop_w, workshop_h - use constraint_variables, only: flhthresh, fpeakb, fpsep, fdivcol, ftcycl, & - betpmx, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & - maxradwallload, pseprmax, fdene, fniterpump, fpinj, pnetelin, powfmax, & - fgamcd, ftbr, mvalim, taulimit, walalw, fmva, fradpwr, nflutfmax, fipir, & - fauxmn, fiooic, fcwr, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & - fstrcond, fptemp, ftmargoh, fvs, fbetatry, vvhealw, fpnetel, ftburn, & - ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & - fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & - ftohs, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, & - fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbetap, fbeta, fjohc, & - fflutf, bmxlim, tbrnmn, fbetatry_lower, fecrh_ignition, fstr_wp, fncycle - use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, & - cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, & - ucbllipb, ucfuel, uumag, ucpfbs, ireactor, uucd, div_umain_time, div_nu, & - maintenance_gen, uctfps, uufw, tbktrepl, cost_factor_fwbs, decomf, & - cconshpf, uche3, ucpfdr1, ucech, uudiv, cost_model, adivflnc, & - cost_factor_rh, cost_factor_bop, ifueltyp, fcontng, fwbs_nref, & - cost_factor_buildings, favail, cconfix, ucblli2o, abktflnc, ucf1, ucfnc, & - ucpfps, iavail, ibkt_life, life_dpa, ucpfbk, cost_factor_tf_coils, costexp_pebbles, & - ucmisc, cpstflnc, uccryo, costexp, fwbs_nu, ucpfic, ucblbreed, tcomrepl, uufuel, & - ucdiv, uccpcl1, discount_rate, uctfbr, uccpclb, ucoam, div_prob_fail, ucnbi, & - uccu, ucwst, cfactr, div_nref, amortization, ucwindtf, ucme, csi, cowner, & - cost_factor_misc, fcr0, cturbb, lsa, fcap0, output_costs, & - cost_factor_land, redun_vacp, ucrb, uctfbus, num_rh_systems, fkind, & - fwbs_umain_time, uchrs, avail_min, uciac, ucshld, tdivrepl, & - ucblli, ucpfcb, tlife, ipnet, fcdfuel, ucbus, ucpfb, uchts, & - maintenance_fwbs, fwbs_prob_fail, uclh, ucblss, ucblvd, ucsc, ucturb, & - ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & - startupratio, tmain, u_unplanned - use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & - ftritbm, gamma_ecrh, pheat, rho_ecrh, beamwd, enbeam, pheatfix, bscfmax, & - forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & - etalh, frbeam, harnum, xi_ebw - use divertor_variables, only: fdfs, anginc, divdens, divclfr, c4div, & - c5div, ksic, fififi, flux_exp, divplt, delld, c2div, beta_div, betao, divdum, tdiv, c6div, & - omegan, prn1, fgamp, frrp, xpertin, c1div, betai, bpsout, xparain, fdiva, & - zeffdiv, hldivlim, rlenmax, divfix, c3div, divleg_profile_inner, & - divleg_profile_outer, hldiv, i_hldiv - use fwbs_variables, only: fblhebpo, vfblkt, fdiv, fvolso, fwcoolant, & - pitch, iblanket, blktmodel, afwi, fblli2o, nphcdin, breeder_multiplier, & - fw_armour_thickness, roughness, fwclfr, breedmat, fblli, fblvd, & - iblanket_thickness, vfcblkt, breeder_f, fbllipb, fhcd, vfshld, fblhebmi, & - denw, f_neut_shield, fw_th_conductivity, nblktmodti, fw_wall, afwo, & - fvolsi, etahtp, nblktmodpo, fwpressure, emult, fwoutlet, nblktmodpi, & - fblhebpi, fblss, inlet_temp, outlet_temp, fblbreed, qnuc, blpressure, & - blpressure_liq, n_liq_recirc, pnuc_fw_ratio_dcll, f_nuc_pow_bz_struct, & - declblkt, fblhebmo, blkttype, afw, inuclear, declshld, hcdportsize, & - npdiv, peaking_factor, primary_pumping, rpf2dewar, secondary_cycle, secondary_cycle_liq, & - denstl, declfw, nphcdout, iblnkith, vfpblkt, fwinlet, wallpf, fblbe, & - fhole, fwbsshape, coolp, tfwmatmax, irefprop, fw_channel_length, & - li6enrich, etaiso, nblktmodto, fvoldw, i_shield_mat, i_bb_liq, & - icooldual, ifci, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, ipump, ims - use heat_transport_variables, only: htpmw_fw, baseel, fmgdmw, htpmw_div, & - pwpm2, etath, vachtmw, iprimshld, fpumpdiv, pinjmax, htpmw_blkt, etatf, & - htpmw_min, fpumpblkt, ipowerflow, htpmw_shld, fpumpshld, trithtmw, & - iprimnloss, fpumpfw, crypmw_max, f_crypmw - use ife_variables, only: bldzu, etali, sombdr, gainve, cdriv0, v1dzl, & - bldrc, fauxbop, pfusife, dcdrv0, fwdr, pdrive, mcdriv, ucconc, shdr, & - v3dzu, bldzl, rrin, maxmat, shmatf, fwmatf, drveff, flirad, shdzu, v2dzu, & - pifecr, ifedrv, v2dr, chmatf, v1dr, v1matf, dcdrv1, chdzu, dcdrv2, & - ifetyp, fwdzl, htpmw_ife, uccarb, v3matf, fbreed, edrive, ptargf, cdriv2, & - fburn, fwdzu, etave, v3dr, uctarg, shdzl, ucflib, v3dzl, v1dzu, v2dzl, & - chdzl, chrad, cdriv1, tgain, somtdr, v2matf, rrmax, bldr, frrmax, & - blmatf, ife - use impurity_radiation_module, only: coreradius, nimp, impvar, fimpvar, & - coreradiationfraction, fimp - use numerics, only: factor, boundl, minmax, neqns, nvar, epsfcn, ixc, & - epsvmc, ftol, ipnvars, ioptimz, nineqns, ipeqns, boundu, icc, ipnfoms, name_xc - use pfcoil_variables, only: rjconpf, zref, fcuohsu, oh_steel_frac, vf, & - coheof, sigpfcalw, alstroh, ipfres, fcupfsu, fvssu, etapsu, i_cs_stress, & - fbmaxcs, ngc, rpf2, fcohbop, ohhghf, vfohc, isumatoh, ngrpmx, ngc2, rpf1, & - ngrp, isumatpf, nfxfh, alfapf, routr, sigpfcf, pfclres, bmaxcs_lim, & - ncls, nfixmx, cptdin, ipfloc, i_sup_pf_shape, rref, i_pf_current, & - ccl0_ma, ccls_ma, ld_ratio_cst - use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & - rhopedt, cvol, fdeut, ffwal, eped_sf, iculbl, itartpf, ilhthresh, & - fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, csawth, dene, & - ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & - fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & - ifalphap, tauee_in, alphaj, alphat, icurr, q, ti, tesep, rli, triang, & - itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & - teped, fhe3, iwalld, gamma, falpha, fgwped, gtscale, tbeta, ibss, & - iradloss, te, alphan, rmajor, kappa, ifispact, iinvqd, fkzohm, beamfus0, & - tauratio, idensl, ieped, bt, iscrp, ipnlaws, betalim, betalim_lower, & - idia, ips, m_s_limit, burnup_in - use pf_power_variables, only: iscenr, maxpoloidalpower - use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp - - use primary_pumping_variables, only: t_in_bb, t_out_bb, dp_he, p_he, gamma_he - - use scan_module, only: isweep_2, nsweep, isweep, scan_dim, nsweep_2, & - sweep_2, sweep, ipnscns, ipnscnv - use stellarator_variables, only: f_asym, isthtr, n_res, iotabar, fdivwet, & - f_w, bmn, shear, m_res, f_rad, flpitch, istell, max_gyrotron_frequency, & - te0_ecrh_achievable - use tfcoil_variables, only: fcoolcp, tfinsgap, vftf, & - quench_detection_ef, fhts, dr_tf_wp, rcool, rhotfleg, thkcas, & - casthi, n_pancake, bcritsc, i_tf_sup, str_pf_con_res, thwcndut, farc4tf, & - thicndut, tftmp, oacdcp, tmax_croco, ptempalw, tmargmin_tf, tmpcry, & - sig_tf_case_max, dztop, dcond, str_cs_con_res, etapump, drtop, vcool, dcondins, & - i_tf_tresca, dhecoil, tmaxpro, n_tf, tcpav, fcutfsu, jbus, & - casthi_fraction, tmargmin_cs, vdalw, dcase, t_turn_tf,& - cpttf_max, tdmptf, casths, i_tf_turns_integer, quench_model, & - tcritsc, layer_ins, tinstf, n_layer, tcoolin, ripmax, frhocp, & - cpttf, tmargmin, casths_fraction, eff_tf_cryo, eyoung_ins, & - eyoung_steel, eyoung_res_tf_buck, eyoung_cond_axial, f_vforce_inboard, & - fcoolleg, frholeg, ftoroidalgap, i_tf_sc_mat, i_tf_shape, i_tf_bucking, & - n_tf_graded_layers, n_tf_joints, n_tf_joints_contact, poisson_al, & - poisson_copper, poisson_steel, rho_tf_joints, rhotfbus, th_joint_contact,& - i_tf_stress_model, eyoung_al, i_tf_wp_geom, i_tf_case_geom, & - i_tf_turns_integer, n_rad_per_layer, b_crit_upper_nbti, t_crit_nbti, & - i_cp_joints, n_tf_turn, f_t_turn_tf, t_turn_tf_max, t_cable_tf, & - sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, & - str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv - - use times_variables, only: tohs, pulsetimings, tqnch, theat, tramp, tburn, & - tdwell, tohsin - use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, & - initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, & - pumpareafraction, ntype, vacuum_model, pumptp - use rebco_variables, only: hastelloy_thickness, f_coppera_m2, & - rebco_thickness, tape_thickness, tape_width, & - copper_rrr, coppera_m2_max, croco_thick, copper_thick, f_copperaoh_m2, & - copperaoh_m2, copperaoh_m2_max - use reinke_variables, only: reinke_mode, fzactual, impvardiv, lhat - use water_usage_variables, only: airtemp, watertemp, windspeed - use CS_fatigue_variables, only: residual_sig_hoop, t_crack_radial, t_crack_vertical, & - t_structural_vertical, t_structural_radial, n_cycle_min, bkt_life_csf, sf_vertical_crack, & - sf_radial_crack, sf_fast_fracture ,paris_coefficient, paris_power_law, walker_coefficient, & - fracture_toughness - - implicit none - - ! Arguments - - integer, intent(in) :: in_file, out_file, show_changes - - ! Local variables - - integer :: iost - integer :: isub1,isub2,varlen - integer :: no_constraints - integer :: no_iteration - integer :: foundAst - - character(len=32) :: varnam - - logical :: obsolete_var - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ! Initialise local variables - no_constraints = 0 - no_iteration = 0 - obsolete_var = .false. - - ! Initialise module-wide variables - - infile = in_file - outfile = out_file - report_changes = show_changes - - icode = 0 - lineno = 0 - - ! Main loop - - loop_over_lines: do - - subscript_present = .FALSE. - - read(infile,'(A)',iostat=iost) line + end if + end do + + ! Set the device type based on the input file's switches + call devtyp + end subroutine input + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine devtyp + !! Set icase description based on device type + use global_variables, only: icase + use ife_variables, only: ife + use stellarator_variables, only: istell + implicit none + + if (ife == 1) then + icase = 'Inertial Fusion model' + else if (istell /= 0) then + icase = 'Stellarator model' + end if + end subroutine devtyp + + subroutine parse_input_file(in_file,out_file,show_changes) + + !! Routine that parses the contents of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! author: J Morris, CCFE, Culham Science Centre + !! author: F Warmer, IPP Greifswald + !! in_file : input integer : Fortran input unit identifier + !! out_file : input integer : Fortran output unit identifier + !! show_changes : input integer : switch to turn on (1) or off (0) + !! reporting of changed values + !! This routine reads the data from the PROCESS input file (IN.DAT), + !! dealing with comments or blank lines correctly, and sets the + !! value of any variables found in the file. Any changes + !! from the default values may be reported if required. + !!

Each possible variable in this block is dealt with + !! individually. (To add additional input variables, simply copy + !! and edit one of the similar existing examples.) + !! The routine also does the extremely useful function of checking + !! that the given value for a variable lies within a sensible + !! predefined range, and stops the program if apparently + !! nonsensical values are attempted. + !! A User's Guide to the PROCESS Systems Code, P. J. Knight, + !! AEA Fusion Report AEA FUS 251, 1993 + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use constants, only: dcopper, dalu + use global_variables, only: run_tests, verbose, maxcal, runtitle + use build_variables, only: tf_in_cs, fmsfw, blbmoth, blbuith, fmsbc, shldoth, & + fmsdwi, shldtth, shldlth, vgap2, plleni, fwoth, vvblgap, fmsbl, & + thshield_ib, thshield_ob, thshield_vb, iprecomp, & + blbpith, aplasmin, blbuoth, tfcth, fmsdwe, & + iohcl, tftsgap, clhsf, bore, plleno, scrapli, gapomin, ddwex, & + rinboard, fmstf, blnkoth, fseppc, plsepo, fmssh, blnkith, & + ohcth, plsepi, fmsoh, blbmith, gapoh, fcspc, scraplo, vgaptop, & + blbpoth, gapds, fwith, vgap, shldith, sigallpc, tfootfi, f_avspace,& + r_cp_top, d_vv_in, d_vv_out, d_vv_top, d_vv_bot, f_r_cp, i_r_cp_top + use buildings_variables, only: hcwt, conv, wgt, trcl, rbwt, & + esbldgm3, fndt, row, wgt2, pibv, clh1, stcl, clh2, & + tfcbv, hccl, rbrt, triv, shov, admv, i_bldgs_v, i_bldgs_size, & + mbvfac, pfbldgm3, wsvfac, rbvfac, rxcl, shmf, & + aux_build_l, aux_build_w, aux_build_h, auxcool_l, auxcool_w, auxcool_h, & + bioshld_thk, chemlab_l, chemlab_w, chemlab_h, control_buildings_l, & + control_buildings_w, control_buildings_h, crane_arm_h, crane_clrnc_h, & + crane_clrnc_v, cryomag_l, cryomag_w, cryomag_h, cryostore_l, & + cryostore_w, cryostore_h, cryostat_clrnc, elecdist_l, elecdist_w, & + elecdist_h, elecload_l, elecload_w, elecload_h, elecstore_l, & + elecstore_w, elecstore_h, fc_building_l, fc_building_w, & + gas_buildings_l, gas_buildings_w, gas_buildings_h, ground_clrnc, & + hcd_building_l, hcd_building_w, hcd_building_h, hw_storage_l, & + hw_storage_w, hw_storage_h, heat_sink_l, heat_sink_w, heat_sink_h, & + hot_sepdist, hotcell_h, ilw_smelter_l, ilw_smelter_w, ilw_smelter_h, & + ilw_storage_l, ilw_storage_w, ilw_storage_h, llw_storage_l, & + llw_storage_w, llw_storage_h, magnet_pulse_l, magnet_pulse_w, & + magnet_pulse_h, magnet_trains_l, magnet_trains_w, magnet_trains_h, & + maint_cont_l, maint_cont_w, maint_cont_h, nbi_sys_l, nbi_sys_w, & + qnty_sfty_fac, reactor_clrnc, reactor_fndtn_thk, reactor_hall_l, & + reactor_hall_w, reactor_hall_h, reactor_roof_thk, reactor_wall_thk, & + robotics_l, robotics_w, robotics_h, sec_buildings_l, sec_buildings_w, & + sec_buildings_h, staff_buildings_h, staff_buildings_area, & + transp_clrnc, turbine_hall_l, turbine_hall_w, turbine_hall_h, & + tw_storage_l, tw_storage_w, tw_storage_h, warm_shop_l, warm_shop_w, & + warm_shop_h, water_buildings_l, water_buildings_w, water_buildings_h, & + workshop_l, workshop_w, workshop_h + use constraint_variables, only: flhthresh, fpeakb, fpsep, fdivcol, ftcycl, & + betpmx, fpsepbqar, ftmargtf, fradwall, fptfnuc, fnesep, fportsz, tbrmin, & + maxradwallload, pseprmax, fdene, fniterpump, fpinj, pnetelin, powfmax, & + fgamcd, ftbr, mvalim, taulimit, walalw, fmva, fradpwr, nflutfmax, fipir, & + fauxmn, fiooic, fcwr, fjohc0, frminor, psepbqarmax, ftpeak, bigqmin, & + fstrcond, fptemp, ftmargoh, fvs, fbetatry, vvhealw, fpnetel, ftburn, & + ffuspow, fpsepr, ptfnucmax, fvdump, pdivtlim, ftaulimit, nbshinefmax, & + fcqt, fzeffmax, fstrcase, fhldiv, foh_stress, fwalld, gammax, fjprot, & + ftohs, tcycmn, auxmin, zeffmax, peakfactrad, fdtmp, fpoloidalpower, & + fnbshinef, freinke, fvvhe, fqval, fq, fmaxvvstress, fbetap, fbeta, fjohc, & + fflutf, bmxlim, tbrnmn, fbetatry_lower, fecrh_ignition, fstr_wp, fncycle + use cost_variables, only: ucich, uctfsw, dintrt, ucblbe, uubop, dtlife, & + cost_factor_vv, cfind, uccry, fcap0cp, uccase, uuves, cconshtf, conf_mag, & + ucbllipb, ucfuel, uumag, ucpfbs, ireactor, uucd, div_umain_time, div_nu, & + maintenance_gen, uctfps, uufw, tbktrepl, cost_factor_fwbs, decomf, & + cconshpf, uche3, ucpfdr1, ucech, uudiv, cost_model, adivflnc, & + cost_factor_rh, cost_factor_bop, ifueltyp, fcontng, fwbs_nref, & + cost_factor_buildings, favail, cconfix, ucblli2o, abktflnc, ucf1, ucfnc, & + ucpfps, iavail, ibkt_life, life_dpa, ucpfbk, cost_factor_tf_coils, costexp_pebbles, & + ucmisc, cpstflnc, uccryo, costexp, fwbs_nu, ucpfic, ucblbreed, tcomrepl, uufuel, & + ucdiv, uccpcl1, discount_rate, uctfbr, uccpclb, ucoam, div_prob_fail, ucnbi, & + uccu, ucwst, cfactr, div_nref, amortization, ucwindtf, ucme, csi, cowner, & + cost_factor_misc, fcr0, cturbb, lsa, fcap0, output_costs, & + cost_factor_land, redun_vacp, ucrb, uctfbus, num_rh_systems, fkind, & + fwbs_umain_time, uchrs, avail_min, uciac, ucshld, tdivrepl, & + ucblli, ucpfcb, tlife, ipnet, fcdfuel, ucbus, ucpfb, uchts, & + maintenance_fwbs, fwbs_prob_fail, uclh, ucblss, ucblvd, ucsc, ucturb, & + ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & + startupratio + use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & + ftritbm, gamma_ecrh, pheat, rho_ecrh, beamwd, enbeam, pheatfix, bscfmax, & + forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & + etalh, frbeam, harnum, xi_ebw + use divertor_variables, only: fdfs, anginc, divdens, divclfr, c4div, & + c5div, ksic, fififi, flux_exp, divplt, delld, c2div, beta_div, betao, divdum, tdiv, c6div, & + omegan, prn1, fgamp, frrp, xpertin, c1div, betai, bpsout, xparain, fdiva, & + zeffdiv, hldivlim, rlenmax, divfix, c3div, divleg_profile_inner, & + divleg_profile_outer, hldiv, i_hldiv + use fwbs_variables, only: fblhebpo, vfblkt, fdiv, fvolso, fwcoolant, & + pitch, iblanket, blktmodel, afwi, fblli2o, nphcdin, breeder_multiplier, & + fw_armour_thickness, roughness, fwclfr, breedmat, fblli, fblvd, & + iblanket_thickness, vfcblkt, breeder_f, fbllipb, fhcd, vfshld, fblhebmi, & + denw, f_neut_shield, fw_th_conductivity, nblktmodti, fw_wall, afwo, & + fvolsi, etahtp, nblktmodpo, fwpressure, emult, fwoutlet, nblktmodpi, & + fblhebpi, fblss, inlet_temp, outlet_temp, fblbreed, qnuc, blpressure, & + blpressure_liq, n_liq_recirc, pnuc_fw_ratio_dcll, f_nuc_pow_bz_struct, & + declblkt, fblhebmo, blkttype, afw, inuclear, declshld, hcdportsize, & + npdiv, peaking_factor, primary_pumping, rpf2dewar, secondary_cycle, secondary_cycle_liq, & + denstl, declfw, nphcdout, iblnkith, vfpblkt, fwinlet, wallpf, fblbe, & + fhole, fwbsshape, coolp, tfwmatmax, irefprop, fw_channel_length, & + li6enrich, etaiso, nblktmodto, fvoldw, i_shield_mat, i_bb_liq, & + icooldual, ifci, inlet_temp_liq, outlet_temp_liq, bz_channel_conduct_liq, ipump, ims + use heat_transport_variables, only: htpmw_fw, baseel, fmgdmw, htpmw_div, & + pwpm2, etath, vachtmw, iprimshld, fpumpdiv, pinjmax, htpmw_blkt, etatf, & + htpmw_min, fpumpblkt, ipowerflow, htpmw_shld, fpumpshld, trithtmw, & + iprimnloss, fpumpfw, crypmw_max, f_crypmw + use ife_variables, only: bldzu, etali, sombdr, gainve, cdriv0, v1dzl, & + bldrc, fauxbop, pfusife, dcdrv0, fwdr, pdrive, mcdriv, ucconc, shdr, & + v3dzu, bldzl, rrin, maxmat, shmatf, fwmatf, drveff, flirad, shdzu, v2dzu, & + pifecr, ifedrv, v2dr, chmatf, v1dr, v1matf, dcdrv1, chdzu, dcdrv2, & + ifetyp, fwdzl, htpmw_ife, uccarb, v3matf, fbreed, edrive, ptargf, cdriv2, & + fburn, fwdzu, etave, v3dr, uctarg, shdzl, ucflib, v3dzl, v1dzu, v2dzl, & + chdzl, chrad, cdriv1, tgain, somtdr, v2matf, rrmax, bldr, frrmax, & + blmatf, ife + use impurity_radiation_module, only: coreradius, nimp, impvar, fimpvar, & + coreradiationfraction, fimp + use numerics, only: factor, boundl, minmax, neqns, nvar, epsfcn, ixc, & + epsvmc, ftol, ipnvars, ioptimz, nineqns, ipeqns, boundu, icc, ipnfoms, name_xc + use pfcoil_variables, only: rjconpf, zref, fcuohsu, oh_steel_frac, vf, & + coheof, sigpfcalw, alstroh, ipfres, fcupfsu, fvssu, etapsu, i_cs_stress, & + fbmaxcs, ngc, rpf2, fcohbop, ohhghf, vfohc, isumatoh, ngrpmx, ngc2, rpf1, & + ngrp, isumatpf, nfxfh, alfapf, routr, sigpfcf, pfclres, bmaxcs_lim, & + ncls, nfixmx, cptdin, ipfloc, i_sup_pf_shape, rref, i_pf_current, & + ccl0_ma, ccls_ma, ld_ratio_cst + use physics_variables, only: ipedestal, taumax, i_single_null, fvsbrnni, & + rhopedt, cvol, fdeut, ffwal, eped_sf, iculbl, itartpf, ilhthresh, & + fpdivlim, epbetmax, isc, kappa95, aspect, cwrmax, nesep, csawth, dene, & + ftar, plasma_res_factor, ssync, rnbeam, beta, neped, hfact, dnbeta, & + fgwsep, rhopedn, tratio, q0, ishape, fne0, ignite, ftrit, & + ifalphap, tauee_in, alphaj, alphat, icurr, q, ti, tesep, rli, triang, & + itart, ralpne, iprofile, triang95, rad_fraction_sol, betbm0, protium, & + teped, fhe3, iwalld, gamma, falpha, fgwped, gtscale, tbeta, ibss, & + iradloss, te, alphan, rmajor, kappa, ifispact, iinvqd, fkzohm, beamfus0, & + tauratio, idensl, ieped, bt, iscrp, ipnlaws, betalim, betalim_lower, & + idia, ips, m_s_limit, burnup_in + use pf_power_variables, only: iscenr, maxpoloidalpower + use pulse_variables, only: lpulse, dtstor, itcycl, istore, bctmp + + use primary_pumping_variables, only: t_in_bb, t_out_bb, dp_he, p_he, gamma_he + + use scan_module, only: isweep_2, nsweep, isweep, scan_dim, nsweep_2, & + sweep_2, sweep, ipnscns, ipnscnv + use stellarator_variables, only: f_asym, isthtr, n_res, iotabar, fdivwet, & + f_w, bmn, shear, m_res, f_rad, flpitch, istell, max_gyrotron_frequency, & + te0_ecrh_achievable + use tfcoil_variables, only: fcoolcp, tfinsgap, vftf, & + quench_detection_ef, fhts, dr_tf_wp, rcool, rhotfleg, thkcas, & + casthi, n_pancake, bcritsc, i_tf_sup, str_pf_con_res, thwcndut, farc4tf, & + thicndut, tftmp, oacdcp, tmax_croco, ptempalw, tmargmin_tf, tmpcry, & + sig_tf_case_max, dztop, dcond, str_cs_con_res, etapump, drtop, vcool, dcondins, & + i_tf_tresca, dhecoil, tmaxpro, n_tf, tcpav, fcutfsu, jbus, & + casthi_fraction, tmargmin_cs, vdalw, dcase, t_turn_tf,& + cpttf_max, tdmptf, casths, i_tf_turns_integer, quench_model, & + tcritsc, layer_ins, tinstf, n_layer, tcoolin, ripmax, frhocp, & + cpttf, tmargmin, casths_fraction, eff_tf_cryo, eyoung_ins, & + eyoung_steel, eyoung_res_tf_buck, eyoung_cond_axial, f_vforce_inboard, & + fcoolleg, frholeg, ftoroidalgap, i_tf_sc_mat, i_tf_shape, i_tf_bucking, & + n_tf_graded_layers, n_tf_joints, n_tf_joints_contact, poisson_al, & + poisson_copper, poisson_steel, rho_tf_joints, rhotfbus, th_joint_contact,& + i_tf_stress_model, eyoung_al, i_tf_wp_geom, i_tf_case_geom, & + i_tf_turns_integer, n_rad_per_layer, b_crit_upper_nbti, t_crit_nbti, & + i_cp_joints, n_tf_turn, f_t_turn_tf, t_turn_tf_max, t_cable_tf, & + sig_tf_wp_max, eyoung_cond_trans, i_tf_cond_eyoung_axial, i_tf_cond_eyoung_trans, & + str_wp_max, str_tf_con_res, i_str_wp, max_vv_stress, theta1_coil, theta1_vv + + use times_variables, only: tohs, pulsetimings, tqnch, theat, tramp, tburn, & + tdwell, tohsin + use vacuum_variables, only: dwell_pump, pbase, tn, pumpspeedfactor, & + initialpressure, outgasfactor, prdiv, pumpspeedmax, rat, outgasindex, & + pumpareafraction, ntype, vacuum_model, pumptp + use rebco_variables, only: hastelloy_thickness, f_coppera_m2, & + rebco_thickness, tape_thickness, tape_width, & + copper_rrr, coppera_m2_max, croco_thick, copper_thick, f_copperaoh_m2, & + copperaoh_m2, copperaoh_m2_max + use reinke_variables, only: reinke_mode, fzactual, impvardiv, lhat + use water_usage_variables, only: airtemp, watertemp, windspeed + use CS_fatigue_variables, only: residual_sig_hoop, t_crack_radial, t_crack_vertical, & + t_structural_vertical, t_structural_radial, n_cycle_min, bkt_life_csf, sf_vertical_crack, & + sf_radial_crack, sf_fast_fracture ,paris_coefficient, paris_power_law, walker_coefficient, & + fracture_toughness + + implicit none + + ! Arguments + + integer, intent(in) :: in_file, out_file, show_changes + + ! Local variables + + integer :: iost + integer :: isub1,isub2,varlen + integer :: no_constraints + integer :: no_iteration + integer :: foundAst + + character(len=32) :: varnam + + logical :: obsolete_var + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ! Initialise local variables + no_constraints = 0 + no_iteration = 0 + obsolete_var = .false. + + ! Initialise module-wide variables + + infile = in_file + outfile = out_file + report_changes = show_changes + + icode = 0 + lineno = 0 + + ! Main loop + + loop_over_lines: do + + subscript_present = .FALSE. + + read(infile,'(A)',iostat=iost) line - ! On error or end, return - if (iost /= 0) exit loop_over_lines + ! On error or end, return + if (iost /= 0) exit loop_over_lines - lineno = lineno + 1 + lineno = lineno + 1 - line = adjustl(line) ! rotate any leading blanks to the end - linelen = len_trim(line) + line = adjustl(line) ! rotate any leading blanks to the end + linelen = len_trim(line) -20 continue +20 continue - ! Ignore blank lines + ! Ignore blank lines - if (line == ' ') cycle + if (line == ' ') cycle - ! Ignore comments, unless they start with '*****', - ! in which case print them. + ! Ignore comments, unless they start with '*****', + ! in which case print them. - if (line(1:5) == '*****') write(outfile,*) line(1:76) - if (line(1:1) == '*') cycle - if (line(1:1) == '$') cycle ! in case block delimiters are still present + if (line(1:5) == '*****') write(outfile,*) line(1:76) + if (line(1:1) == '*') cycle + if (line(1:1) == '$') cycle ! in case block delimiters are still present - iptr = 1 + iptr = 1 - !Ignore input comments denoted by asterisk, before assigning variables + !Ignore input comments denoted by asterisk, before assigning variables - if (index(line,'*') > 0) then - foundAst = index(line,'*') - 1 - linelen = min(linelen, foundAst) - line = line(:linelen) - end if + if (index(line,'*') > 0) then + foundAst = index(line,'*') - 1 + linelen = min(linelen, foundAst) + line = line(:linelen) + end if - ! This must be an assignment line, so get the variable name + ! This must be an assignment line, so get the variable name - call get_variable_name(varnam,varlen,isub1,isub2) - if (isub1 /= 0) subscript_present = .TRUE. - if (varlen == 0) then - write(*,*) 'Error in IN.DAT at line ', lineno - write(*,*) line - error = .True. - end if + call get_variable_name(varnam,varlen,isub1,isub2) + if (isub1 /= 0) subscript_present = .TRUE. + if (varlen == 0) then + write(*,*) 'Error in IN.DAT at line ', lineno + write(*,*) line + error = .True. + end if - ! Read the associated data + ! Read the associated data - variable: select case (varnam(1:varlen)) + variable: select case (varnam(1:varlen)) - ! General settings + ! General settings - case ('runtitle') - call parse_string_variable('runtitle', runtitle, & + case ('runtitle') + call parse_string_variable('runtitle', runtitle, & 'title of run') - case ('verbose') - call parse_int_variable('verbose', verbose, 0, 1, & + case ('verbose') + call parse_int_variable('verbose', verbose, 0, 1, & 'Switch for diagnostic output') - case ('run_tests') - call parse_int_variable('run_tests', run_tests, 0, 1, & + case ('run_tests') + call parse_int_variable('run_tests', run_tests, 0, 1, & 'Switch for running built-in tests') - ! Numerical solver settings - case ('boundl') - call parse_real_array('boundl', boundl, isub1, ipnvars, & + ! Numerical solver settings + case ('boundl') + call parse_real_array('boundl', boundl, isub1, ipnvars, & 'Iteration variable lower bound', icode) - case ('boundu') - call parse_real_array('boundu', boundu, isub1, ipnvars, & + case ('boundu') + call parse_real_array('boundu', boundu, isub1, ipnvars, & 'Iteration variable upper bound', icode) - case ('epsfcn') - call parse_real_variable('epsfcn', epsfcn, 0.0D0, 1.0D0, & + case ('epsfcn') + call parse_real_variable('epsfcn', epsfcn, 0.0D0, 1.0D0, & 'HYBRD/VMCON derivative step length') - case ('epsvmc') - call parse_real_variable('epsvmc', epsvmc, 0.0D0, 1.0D0, & + case ('epsvmc') + call parse_real_variable('epsvmc', epsvmc, 0.0D0, 1.0D0, & 'VMCON error tolerance') - case ('factor') - call parse_real_variable('factor', factor, 0.0D0, 10.0D0, & + case ('factor') + call parse_real_variable('factor', factor, 0.0D0, 10.0D0, & 'HYBRD initial step size') - case ('ftol') - call parse_real_variable('ftol', ftol, 0.0D0, 1.0D0, & + case ('ftol') + call parse_real_variable('ftol', ftol, 0.0D0, 1.0D0, & 'HYBRD tolerance') - ! New optional argument startindex used MDK 3/3/17 - ! Allows simplified IN.DAT format for icc and ixc. - case ('icc') - no_constraints = no_constraints + 1 - call parse_int_array('icc', icc, isub1, ipeqns, & + ! New optional argument startindex used MDK 3/3/17 + ! Allows simplified IN.DAT format for icc and ixc. + case ('icc') + no_constraints = no_constraints + 1 + call parse_int_array('icc', icc, isub1, ipeqns, & 'Constraint equation', icode,no_constraints) - no_constraints = isub1 - case ('ixc') - no_iteration = no_iteration + 1 - call parse_int_array('ixc', ixc, isub1, ipnvars, & - 'Iteration variable', icode,no_iteration) - no_iteration = isub1 - - case ('ioptimz') - call parse_int_variable('ioptimz', ioptimz, -2, 1, & + no_constraints = isub1 + case ('ixc') + no_iteration = no_iteration + 1 + call parse_int_array('ixc', ixc, isub1, ipnvars, & + 'Iteration variable', icode,no_iteration) + no_iteration = isub1 + + case ('ioptimz') + call parse_int_variable('ioptimz', ioptimz, -2, 1, & 'Switch for solver method') - case ('maxcal') - call parse_int_variable('maxcal', maxcal, 0, 10000, & + case ('maxcal') + call parse_int_variable('maxcal', maxcal, 0, 10000, & 'Max no of VMCON iterations') - case ('minmax') - call parse_int_variable('minmax', minmax, -ipnfoms, ipnfoms, 'Switch for figure of merit') - case ('neqns') - write(*,*)'The total number of constraints is counted automatically and does not need to be stated in IN.DAT.' - call parse_int_variable('neqns', neqns, 1, ipeqns, 'No of equality constraints') - case ('nineqns') - call parse_int_variable('nineqns', nineqns, 1, ipeqns, 'No of inequality constraints') - case ('nvar') - write(*,*)'The number of iteration variables is counted automatically and does not need to be stated in IN.DAT.' - ! call parse_int_variable('nvar', nvar, 1, ipnvars, 'No of independent variables') - - ! Physics settings - - case ('alphaj') - call parse_real_variable('alphaj', alphaj, 0.0D0, 10.0D0, & + case ('minmax') + call parse_int_variable('minmax', minmax, -ipnfoms, ipnfoms, 'Switch for figure of merit') + case ('neqns') + write(*,*)'The total number of constraints is counted automatically and does not need to be stated in IN.DAT.' + call parse_int_variable('neqns', neqns, 1, ipeqns, 'No of equality constraints') + case ('nineqns') + call parse_int_variable('nineqns', nineqns, 1, ipeqns, 'No of inequality constraints') + case ('nvar') + write(*,*)'The number of iteration variables is counted automatically and does not need to be stated in IN.DAT.' + ! call parse_int_variable('nvar', nvar, 1, ipnvars, 'No of independent variables') + + ! Physics settings + + case ('alphaj') + call parse_real_variable('alphaj', alphaj, 0.0D0, 10.0D0, & 'Current density profile factor') - case ('alphan') - call parse_real_variable('alphan', alphan, 0.0D0, 10.0D0, & + case ('alphan') + call parse_real_variable('alphan', alphan, 0.0D0, 10.0D0, & 'Density profile factor') - case ('alphat') - call parse_real_variable('alphat', alphat, 0.0D0, 10.0D0, & + case ('alphat') + call parse_real_variable('alphat', alphat, 0.0D0, 10.0D0, & 'Temperature profile factor') - case ('aspect') - call parse_real_variable('aspect', aspect, 1.001D0, 40.0D0, & + case ('aspect') + call parse_real_variable('aspect', aspect, 1.001D0, 40.0D0, & 'Aspect ratio') - case ('beamfus0') - call parse_real_variable('beamfus0', beamfus0, 0.01D0, 10.0D0, & + case ('beamfus0') + call parse_real_variable('beamfus0', beamfus0, 0.01D0, 10.0D0, & 'Beam-background fusion multiplier') - case ('beta') - call parse_real_variable('beta', beta, 0.0D0, 1.0D0, & + case ('beta') + call parse_real_variable('beta', beta, 0.0D0, 1.0D0, & 'Plasma beta') - case ('betalim') - call parse_real_variable('betalim', betalim, 0.0D0, 1.0D0, & - 'Plasma beta upper limit') - case ('betalim_lower') - call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & - 'Plasma beta lower limit') - case ('betbm0') - call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, & + case ('betalim') + call parse_real_variable('betalim', betalim, 0.0D0, 1.0D0, & + 'Plasma beta upper limit') + case ('betalim_lower') + call parse_real_variable('betalim_lower', betalim_lower, 0.0D0, 1.0D0, & + 'Plasma beta lower limit') + case ('betbm0') + call parse_real_variable('betbm0', betbm0, 0.0D0, 10.0D0, & 'Leading coeff. for NB beta fraction') - case ('bt') - call parse_real_variable('bt', bt, 0.0D0, 30.0D0, & + case ('bt') + call parse_real_variable('bt', bt, 0.0D0, 30.0D0, & 'Toroidal field on axis (T)') - case ('burnup_in') - call parse_real_variable('burnup_in', burnup_in, 0.0D0, 1.0D0, & + case ('burnup_in') + call parse_real_variable('burnup_in', burnup_in, 0.0D0, 1.0D0, & 'User input plasma fuel burnup fraction') - case ('coreradius') - call parse_real_variable('coreradius', coreradius, 0.0D0, 1.0D0, & + case ('coreradius') + call parse_real_variable('coreradius', coreradius, 0.0D0, 1.0D0, & 'Normalised core radius') - case ('coreradiationfraction') - call parse_real_variable('coreradiationfraction', coreradiationfraction, 0.0D0, 1.0D0, & + case ('coreradiationfraction') + call parse_real_variable('coreradiationfraction', coreradiationfraction, 0.0D0, 1.0D0, & 'Fraction of core radiation subtracted from P_L') - case ('csawth') - call parse_real_variable('csawth', csawth, 0.0D0, 10.0D0, & + case ('csawth') + call parse_real_variable('csawth', csawth, 0.0D0, 10.0D0, & 'Coefficient for sawteeth effects') - case ('cvol') - call parse_real_variable('cvol', cvol, 0.01D0, 10.0D0, & + case ('cvol') + call parse_real_variable('cvol', cvol, 0.01D0, 10.0D0, & 'Plasma volume multiplier') - case ('cwrmax') - call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & + case ('cwrmax') + call parse_real_variable('cwrmax', cwrmax, 1.0D0, 3.0D0, & 'Max conducting shell to rminor radius') - case ('dene') - call parse_real_variable('dene', dene, 1.0D18, 1.0D22, & + case ('dene') + call parse_real_variable('dene', dene, 1.0D18, 1.0D22, & 'Electron density (/m3)') - case ('dnbeta') - call parse_real_variable('dnbeta', dnbeta, 0.0D0, 20.0D0, & + case ('dnbeta') + call parse_real_variable('dnbeta', dnbeta, 0.0D0, 20.0D0, & 'beta coefficient') - case ('epbetmax') - call parse_real_variable('epbetmax', epbetmax, 0.01D0, 10.0D0, & + case ('epbetmax') + call parse_real_variable('epbetmax', epbetmax, 0.01D0, 10.0D0, & 'Max epsilon*beta value') - case ('eped_sf') - call parse_real_variable('eped_sf', eped_sf, 0.0001D0, 2.0D0, & + case ('eped_sf') + call parse_real_variable('eped_sf', eped_sf, 0.0001D0, 2.0D0, & 'Scaling factor for EPED pedestal model') - case ('falpha') - call parse_real_variable('falpha', falpha, 0.0D0, 1.0D0, & + case ('falpha') + call parse_real_variable('falpha', falpha, 0.0D0, 1.0D0, & 'Fraction of alpha power deposited to plasma') - case ('ftar') - call parse_real_variable('ftar', ftar, 0.0D0, 1.0D0, & + case ('ftar') + call parse_real_variable('ftar', ftar, 0.0D0, 1.0D0, & 'Fraction of power to divertor with lower divertor in double null') - case ('fdeut') - call parse_real_variable('fdeut', fdeut, 0.0D0, 1.0D0, & + case ('fdeut') + call parse_real_variable('fdeut', fdeut, 0.0D0, 1.0D0, & 'Deuterium fuel fraction') - case ('ffwal') - call parse_real_variable('ffwal', ffwal, 0.0D0, 10.0D0, & + case ('ffwal') + call parse_real_variable('ffwal', ffwal, 0.0D0, 10.0D0, & 'Wall load fiddle factor') - case ('fgwped') - call parse_real_variable('fgwped', fgwped, -1.0D0, 5.0D0, & + case ('fgwped') + call parse_real_variable('fgwped', fgwped, -1.0D0, 5.0D0, & 'Fraction of n_G at pedestal top') - case ('fgwsep') - call parse_real_variable('fgwsep', fgwsep, -1.0D0, 1.0D0, & + case ('fgwsep') + call parse_real_variable('fgwsep', fgwsep, -1.0D0, 1.0D0, & 'Fraction of n_G at separatrix') - case ('fhe3') - call parse_real_variable('fhe3', fhe3, 0.0D0, 1.0D0, & + case ('fhe3') + call parse_real_variable('fhe3', fhe3, 0.0D0, 1.0D0, & 'Helium-3 fuel fraction') - case ('fimp') - call parse_real_array('fimp', fimp, isub1, nimp, & + case ('fimp') + call parse_real_array('fimp', fimp, isub1, nimp, & 'Impurity density fraction', icode) - case ('fimpvar') - call parse_real_variable('fimpvar', fimpvar, 1.0D-6, 0.5D0, & + case ('fimpvar') + call parse_real_variable('fimpvar', fimpvar, 1.0D-6, 0.5D0, & 'Impurity fraction to be varied') - case ('fkzohm') - call parse_real_variable('fkzohm', fkzohm, 0.5D0, 2.0D0, & + case ('fkzohm') + call parse_real_variable('fkzohm', fkzohm, 0.5D0, 2.0D0, & 'Zohm elongation scaling multiplier') - case ('fnesep') - call parse_real_variable('fnesep', fnesep, 0.1D0, 2.0D1, & + case ('fnesep') + call parse_real_variable('fnesep', fnesep, 0.1D0, 2.0D1, & 'Eich critical separatrix density') - case ('fradmin') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FRADMIN is now obsolete -' - write(outfile,*) 'please remove it from the input file.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ftaulimit') - call parse_real_variable('ftaulimit', ftaulimit, 0.001D0, 1.0D0, & + case ('fradmin') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FRADMIN is now obsolete -' + write(outfile,*) 'please remove it from the input file.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ftaulimit') + call parse_real_variable('ftaulimit', ftaulimit, 0.001D0, 1.0D0, & 'f-value for lower limit on taup/taueff the ratio of alpha particle to energy confinement times') - case ('ftr') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FTR is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use FTRIT instead).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ftrit') - call parse_real_variable('ftrit', ftrit, 0.0D0, 1.0D0, & + case ('ftr') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FTR is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use FTRIT instead).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ftrit') + call parse_real_variable('ftrit', ftrit, 0.0D0, 1.0D0, & 'Tritium fuel fraction') - case ('fvsbrnni') - call parse_real_variable('fvsbrnni', fvsbrnni, 0.0D0, 1.0D0, & + case ('fvsbrnni') + call parse_real_variable('fvsbrnni', fvsbrnni, 0.0D0, 1.0D0, & 'Non-inductive volt-sec burn fraction') - case ('gamma') - call parse_real_variable('gamma', gamma, 0.1D0, 1.0D0, & + case ('gamma') + call parse_real_variable('gamma', gamma, 0.1D0, 1.0D0, & 'Ejima coefficient for resistive V-s formula') - case ('gtscale') - call parse_int_variable('gtscale', gtscale, 0, 2, & + case ('gtscale') + call parse_int_variable('gtscale', gtscale, 0, 2, & 'Flag to scale beta coefficient with R/a') - case ('hfact') - call parse_real_variable('hfact', hfact, 0.01D0, 10.0D0, & + case ('hfact') + call parse_real_variable('hfact', hfact, 0.01D0, 10.0D0, & 'Energy confinement time H factor') - case ('taumax') - call parse_real_variable('taumax', taumax, 0.1D0, 100.0D0, & + case ('taumax') + call parse_real_variable('taumax', taumax, 0.1D0, 100.0D0, & 'Maximum allowed energy confinement time (s)') - case ('ibss') - call parse_int_variable('ibss', ibss, 1, 4, & + case ('ibss') + call parse_int_variable('ibss', ibss, 1, 4, & 'Switch for bootstrap scaling') - case ('iculbl') - call parse_int_variable('iculbl', iculbl, 0, 3, & + case ('iculbl') + call parse_int_variable('iculbl', iculbl, 0, 3, & 'Switch for beta limit scaling') - case ('iculdl') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ICULDL is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use IDENSL=3 for equivalent model to ICULDL=0).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('icurr') - call parse_int_variable('icurr', icurr, 1, 9, & + case ('iculdl') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ICULDL is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use IDENSL=3 for equivalent model to ICULDL=0).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('icurr') + call parse_int_variable('icurr', icurr, 1, 9, & 'Switch for plasma current scaling') - case ('idensl') - call parse_int_variable('idensl', idensl, 1, 7, & + case ('idensl') + call parse_int_variable('idensl', idensl, 1, 7, & 'Switch for enforced density limit') - case ('idhe3') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IDHE3 is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '(use fhe3 to adjust 3He fuel fraction).' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('idia') - call parse_int_variable('idia', idia, 0, 2, & - 'Switch for diamagnetic scaling') - case ('ifalphap') - call parse_int_variable('ifalphap', ifalphap, 0, 1, & + case ('idhe3') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IDHE3 is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '(use fhe3 to adjust 3He fuel fraction).' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('idia') + call parse_int_variable('idia', idia, 0, 2, & + 'Switch for diamagnetic scaling') + case ('ifalphap') + call parse_int_variable('ifalphap', ifalphap, 0, 1, & 'Switch for fast alpha pressure fit') - case ('ifispact') - call parse_int_variable('ifispact', ifispact, 0, 0, & + case ('ifispact') + call parse_int_variable('ifispact', ifispact, 0, 0, & 'Switch for neutronics calculations') - case ('ignite') - call parse_int_variable('ignite', ignite, 0, 1, & + case ('ignite') + call parse_int_variable('ignite', ignite, 0, 1, & 'Switch for ignited plasma assumption') - case ('iinvqd') - call parse_int_variable('iinvqd', iinvqd, 0, 1, & + case ('iinvqd') + call parse_int_variable('iinvqd', iinvqd, 0, 1, & 'Switch for inverse quadrature') - case ('iiter') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IITER is now obsolete -' - write(outfile,*) 'please remove it from the input file.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('ilhthresh') - call parse_int_variable('ilhthresh', ilhthresh, 1, 21, & + case ('iiter') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IITER is now obsolete -' + write(outfile,*) 'please remove it from the input file.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('ilhthresh') + call parse_int_variable('ilhthresh', ilhthresh, 1, 21, & 'Switch for L-H power threshold to enforce') - case ('impvar') - call parse_int_variable('impvar', impvar, 3, nimp, & + case ('impvar') + call parse_int_variable('impvar', impvar, 3, nimp, & 'Index for impurity fraction iteration variable') - write(outfile,*) 'impvar is now deprecated - use iteration variables 125-136 instead.' - case ('ipedestal') - call parse_int_variable('ipedestal', ipedestal, 0, 1, & + write(outfile,*) 'impvar is now deprecated - use iteration variables 125-136 instead.' + case ('ipedestal') + call parse_int_variable('ipedestal', ipedestal, 0, 1, & 'Switch for plasma profile type') - case ('iprofile') - call parse_int_variable('iprofile', iprofile, 0, 1, & + case ('iprofile') + call parse_int_variable('iprofile', iprofile, 0, 1, & 'Switch for current profile consistency') - case ('ips') - call parse_int_variable('ips', ips, 0, 1, & + case ('ips') + call parse_int_variable('ips', ips, 0, 1, & 'Switch for Pfirsch-Schlüter scaling') - case ('iradloss') - call parse_int_variable('iradloss', iradloss, 0, 2, & + case ('iradloss') + call parse_int_variable('iradloss', iradloss, 0, 2, & 'Switch for radiation loss term inclusion in pwr balance') - case ('ires') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'IRES is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('isc') - call parse_int_variable('isc', isc, 1, ipnlaws, & + case ('ires') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'IRES is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('isc') + call parse_int_variable('isc', isc, 1, ipnlaws, & 'Switch for confinement scaling law') - case ('ieped') - call parse_int_variable('ieped', ieped, 0, 1, & + case ('ieped') + call parse_int_variable('ieped', ieped, 0, 1, & 'Switch for scaling pedestal-top temperature with plasma parameters') - case ('iscrp') - call parse_int_variable('iscrp', iscrp, 0, 1, & + case ('iscrp') + call parse_int_variable('iscrp', iscrp, 0, 1, & 'Switch for scrapeoff width') - case ('ishape') - call parse_int_variable('ishape', ishape, 0, 11, & + case ('ishape') + call parse_int_variable('ishape', ishape, 0, 11, & 'Switch for plasma shape vs. aspect') - case ('itart') - call parse_int_variable('itart', itart, 0, 1, & + case ('itart') + call parse_int_variable('itart', itart, 0, 1, & 'Switch for tight aspect ratio physics') - case ('itartpf') - call parse_int_variable('itartpf', itartpf, 0, 1, & + case ('itartpf') + call parse_int_variable('itartpf', itartpf, 0, 1, & 'Switch for tight aspect ratio PF coils') - case ('iwalld') - call parse_int_variable('iwalld', iwalld, 1, 2, & + case ('iwalld') + call parse_int_variable('iwalld', iwalld, 1, 2, & 'Switch for wall load calculation') - case ('kappa') - call parse_real_variable('kappa', kappa, 0.99D0, 5.0D0, & + case ('kappa') + call parse_real_variable('kappa', kappa, 0.99D0, 5.0D0, & 'Plasma separatrix elongation') - case ('kappa95') - call parse_real_variable('kappa95', kappa95, 0.99D0, 5.0D0, & + case ('kappa95') + call parse_real_variable('kappa95', kappa95, 0.99D0, 5.0D0, & 'Plasma 95% elongation') - case ('neped') - call parse_real_variable('neped', neped, 0.0D0, 1.0D21, & + case ('neped') + call parse_real_variable('neped', neped, 0.0D0, 1.0D21, & 'Electron density pedestal height (/m3)') - case ('nesep') - call parse_real_variable('nesep', nesep, 0.0D0, 1.0D21, & + case ('nesep') + call parse_real_variable('nesep', nesep, 0.0D0, 1.0D21, & 'Electron density at separatrix (/m3)') - case('m_s_limit') - call parse_real_variable('m_s_limit', m_s_limit, 0.0D0, 1.0D0, & + case('m_s_limit') + call parse_real_variable('m_s_limit', m_s_limit, 0.0D0, 1.0D0, & 'Vertical stablity margin limit') - case ('plasma_res_factor') - call parse_real_variable('plasma_res_factor', plasma_res_factor, 0.0D0, 1.0D0, & + case ('plasma_res_factor') + call parse_real_variable('plasma_res_factor', plasma_res_factor, 0.0D0, 1.0D0, & 'Plasma resistivity pre-factor') - case ('q') - call parse_real_variable('q', q, 1.00D0, 50.0D0, & + case ('q') + call parse_real_variable('q', q, 1.00D0, 50.0D0, & 'Edge safety factor') - case ('q0') - call parse_real_variable('q0', q0, 0.01D0, 20.0D0, & + case ('q0') + call parse_real_variable('q0', q0, 0.01D0, 20.0D0, & 'Safety factor on axis') - case ('tauratio') - call parse_real_variable('tauratio', tauratio, 0.1D0, 100.0D0, & + case ('tauratio') + call parse_real_variable('tauratio', tauratio, 0.1D0, 100.0D0, & 'Ratio of He and pellet particle confinement times') - case ('rad_fraction_sol') - call parse_real_variable('rad_fraction_sol', rad_fraction_sol, 0.0D0, 1.0D0, & + case ('rad_fraction_sol') + call parse_real_variable('rad_fraction_sol', rad_fraction_sol, 0.0D0, 1.0D0, & 'SoL radiation fraction') - case ('ralpne') - call parse_real_variable('ralpne', ralpne, 1.0D-12, 1.0D0, & + case ('ralpne') + call parse_real_variable('ralpne', ralpne, 1.0D-12, 1.0D0, & 'Thermal alpha density / electron density') - case ('protium') - call parse_real_variable('protium', protium, 0.0D0, 1.0D0, & + case ('protium') + call parse_real_variable('protium', protium, 0.0D0, 1.0D0, & 'Protium density / electron density') - case ('rhopedn') - call parse_real_variable('rhopedn', rhopedn, 0.01D0, 1.0D0, & + case ('rhopedn') + call parse_real_variable('rhopedn', rhopedn, 0.01D0, 1.0D0, & 'Density pedestal r/a') - case ('rhopedt') - call parse_real_variable('rhopedt', rhopedt, 0.01D0, 1.0D0, & + case ('rhopedt') + call parse_real_variable('rhopedt', rhopedt, 0.01D0, 1.0D0, & 'Temperature pedestal r/a') - case ('rli') - call parse_real_variable('rli', rli, 0.0D0, 10.0D0, & + case ('rli') + call parse_real_variable('rli', rli, 0.0D0, 10.0D0, & 'Normalised inductivity') - case ('rmajor') - call parse_real_variable('rmajor', rmajor, 0.1D0, 50.0D0, & + case ('rmajor') + call parse_real_variable('rmajor', rmajor, 0.1D0, 50.0D0, & 'Plasma major radius (m)') - case ('rnbeam') - call parse_real_variable('rnbeam', rnbeam, 0.0D0, 1.0D0, & + case ('rnbeam') + call parse_real_variable('rnbeam', rnbeam, 0.0D0, 1.0D0, & 'Hot beam density / electron density') - case ('i_single_null') - call parse_int_variable('i_single_null', i_single_null, 0, 1, & + case ('i_single_null') + call parse_int_variable('i_single_null', i_single_null, 0, 1, & 'Switch for single/double null plasma') - case ('ssync') - call parse_real_variable('ssync', ssync, 0.0D0, 1.0D0, & + case ('ssync') + call parse_real_variable('ssync', ssync, 0.0D0, 1.0D0, & 'Synchrotron wall reflectivity factor') - case ('tbeta') - call parse_real_variable('tbeta', tbeta, 0.0D0, 4.0D0, & + case ('tbeta') + call parse_real_variable('tbeta', tbeta, 0.0D0, 4.0D0, & 'Temperature profile index beta') - case ('te') - call parse_real_variable('te', te, 1.0D0, 200.0D0, & + case ('te') + call parse_real_variable('te', te, 1.0D0, 200.0D0, & 'Electron temperature (keV)') - case ('tauee_in') - call parse_real_variable('tauee_in', tauee_in, 0.0D0, 100.0D0, & - 'Input electron energy confinement time (sec) (isc=48 only)') - case ('taulimit') - call parse_real_variable('taulimit', taulimit, 1.0D0, 100.0D0, & + case ('tauee_in') + call parse_real_variable('tauee_in', tauee_in, 0.0D0, 100.0D0, & + 'Input electron energy confinement time (sec) (isc=48 only)') + case ('taulimit') + call parse_real_variable('taulimit', taulimit, 1.0D0, 100.0D0, & 'Lower limit on taup/taueff the ratio of alpha particle to energy confinement times') - case ('teped') - call parse_real_variable('teped', teped, 0.0D0, 20.0D0, & + case ('teped') + call parse_real_variable('teped', teped, 0.0D0, 20.0D0, & 'Electron temperature pedestal height (keV)') - case ('tesep') - call parse_real_variable('tesep', tesep, 0.0D0, 20.0D0, & + case ('tesep') + call parse_real_variable('tesep', tesep, 0.0D0, 20.0D0, & 'Electron temperature at separatrix (keV)') - case ('ti') - call parse_real_variable('ti', ti, 5.0D0, 50.0D0, & + case ('ti') + call parse_real_variable('ti', ti, 5.0D0, 50.0D0, & 'Ion temperature (keV)') - case ('tratio') - call parse_real_variable('tratio', tratio, 0.0D0, 2.0D0, & + case ('tratio') + call parse_real_variable('tratio', tratio, 0.0D0, 2.0D0, & 'Ion / electron temperature ratio') - case ('triang') - call parse_real_variable('triang', triang, -1.0D0, 1.0D0, & + case ('triang') + call parse_real_variable('triang', triang, -1.0D0, 1.0D0, & 'Plasma separatrix triangularity') - case ('triang95') - call parse_real_variable('triang95', triang95, 0.0D0, 1.0D0, & + case ('triang95') + call parse_real_variable('triang95', triang95, 0.0D0, 1.0D0, & 'Plasma 95% triangularity') - ! Inequality settings + ! Inequality settings - case ('fniterpump') - call parse_real_variable('fniterpump', fniterpump, 0.001D0, 10.0D0, & + case ('fniterpump') + call parse_real_variable('fniterpump', fniterpump, 0.001D0, 10.0D0, & 'f-value for constraint on number of vacuum pumps') - case ('auxmin') - call parse_real_variable('auxmin', auxmin, 0.01D0, 100.0D0, & + case ('auxmin') + call parse_real_variable('auxmin', auxmin, 0.01D0, 100.0D0, & 'Minimum auxiliary power (MW)') - case ('betpmx') - call parse_real_variable('betpmx', betpmx, 0.01D0, 2.0D0, & + case ('betpmx') + call parse_real_variable('betpmx', betpmx, 0.01D0, 2.0D0, & 'Maximum poloidal beta') - case ('bigqmin') - call parse_real_variable('bigqmin', bigqmin, 0.01D0, 100.0D0, & + case ('bigqmin') + call parse_real_variable('bigqmin', bigqmin, 0.01D0, 100.0D0, & 'Minimum fusion gain Q') - case ('bmxlim') - call parse_real_variable('bmxlim', bmxlim, 0.1D0, 50.0D0, & + case ('bmxlim') + call parse_real_variable('bmxlim', bmxlim, 0.1D0, 50.0D0, & 'Maximum toroidal field (T)') - case ('fauxmn') - call parse_real_variable('fauxmn', fauxmn, 0.001D0, 10.0D0, & + case ('fauxmn') + call parse_real_variable('fauxmn', fauxmn, 0.001D0, 10.0D0, & 'F-value for minimum auxiliary power') - case ('fbeta') - call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & + case ('fbeta') + call parse_real_variable('fbeta', fbeta, 0.001D0, 10.0D0, & 'F-value for eps.betap beta limit') - case ('fbetap') - call parse_real_variable('fbetap', fbetap, 0.001D0, 10.0D0, & + case ('fbetap') + call parse_real_variable('fbetap', fbetap, 0.001D0, 10.0D0, & 'F-value for poloidal beta limit') - case ('fbetatry') - call parse_real_variable('fbetatry', fbetatry, 0.001D0, 10.0D0, & + case ('fbetatry') + call parse_real_variable('fbetatry', fbetatry, 0.001D0, 10.0D0, & 'F-value for beta limit') - case ('fbetatry_lower') - call parse_real_variable('fbetatry_lower', fbetatry_lower, 0.001D0, 10.0D0, & + case ('fbetatry_lower') + call parse_real_variable('fbetatry_lower', fbetatry_lower, 0.001D0, 10.0D0, & 'F-value for (lower) beta limit') - case ('fecrh_ignition') - call parse_real_variable('fecrh_ignition', fecrh_ignition, 0.001D0, 10.0D0, & + case ('fecrh_ignition') + call parse_real_variable('fecrh_ignition', fecrh_ignition, 0.001D0, 10.0D0, & 'F-value for ecrh ignition constraint') - case ('fcwr') - call parse_real_variable('fcwr', fcwr, 0.001D0, 10.0D0, & + case ('fcwr') + call parse_real_variable('fcwr', fcwr, 0.001D0, 10.0D0, & 'F-value for conducting wall radius') - case ('fdene') - call parse_real_variable('fdene', fdene, 0.001D0, 10.0D0, & + case ('fdene') + call parse_real_variable('fdene', fdene, 0.001D0, 10.0D0, & 'F-value for density limit') - case ('fdivcol') - call parse_real_variable('fdivcol', fdivcol, 0.001D0, 10.0D0, & + case ('fdivcol') + call parse_real_variable('fdivcol', fdivcol, 0.001D0, 10.0D0, & 'F-value for divertor collisionality') - case ('fdtmp') - call parse_real_variable('fdtmp', fdtmp, 0.001D0, 10.0D0, & + case ('fdtmp') + call parse_real_variable('fdtmp', fdtmp, 0.001D0, 10.0D0, & 'F-value for first wall coolant temp rise') - case ('fgamcd') - call parse_real_variable('fgamcd', fgamcd, 0.001D0, 10.0D0, & + case ('fgamcd') + call parse_real_variable('fgamcd', fgamcd, 0.001D0, 10.0D0, & 'F-value for current drive gamma') - case ('fipir') - call parse_real_variable('fipir', fipir, 0.001D0, 10.0D0, & + case ('fipir') + call parse_real_variable('fipir', fipir, 0.001D0, 10.0D0, & 'F-value for Ip/Irod') - case ('fjohc') - call parse_real_variable('fjohc', fjohc, 0.001D0, 10.0D0, & + case ('fjohc') + call parse_real_variable('fjohc', fjohc, 0.001D0, 10.0D0, & 'F-value for Central Solenoid current at EOF') - case ('fjohc0') - call parse_real_variable('fjohc0', fjohc0, 0.001D0, 10.0D0, & + case ('fjohc0') + call parse_real_variable('fjohc0', fjohc0, 0.001D0, 10.0D0, & 'F-value for Central Solenoid current at BOP') - case ('fjtfc') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FJTFC is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fhldiv') - call parse_real_variable('fhldiv', fhldiv, 0.001D0, 10.0D0, & + case ('fjtfc') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FJTFC is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fhldiv') + call parse_real_variable('fhldiv', fhldiv, 0.001D0, 10.0D0, & 'F-value for divertor heat load') - case ('hldiv') - call parse_real_variable('hldiv', hldiv, 0.0D0, 10.0D0, & + case ('hldiv') + call parse_real_variable('hldiv', hldiv, 0.0D0, 10.0D0, & 'Divertor heat load (MW/m2)') - case ('i_hldiv') - call parse_int_variable('i_hldiv', i_hldiv, 0, 2, & + case ('i_hldiv') + call parse_int_variable('i_hldiv', i_hldiv, 0, 2, & 'Switch for user input hldiv') - case ('fflutf') - call parse_real_variable('fflutf', fflutf, 0.001D0, 10.0D0, & + case ('fflutf') + call parse_real_variable('fflutf', fflutf, 0.001D0, 10.0D0, & 'F-value for neutron fluence on TF coil') - case ('ffuspow') - call parse_real_variable('ffuspow', ffuspow, 0.001D0, 10.0D0, & + case ('ffuspow') + call parse_real_variable('ffuspow', ffuspow, 0.001D0, 10.0D0, & 'F-value for maximum fusion power') - case ('fiooic') - call parse_real_variable('fiooic', fiooic, 0.001D0, 10.0D0, & + case ('fiooic') + call parse_real_variable('fiooic', fiooic, 0.001D0, 10.0D0, & 'F-value for SCTF iop/icrit') - case ('fjprot') - call parse_real_variable('fjprot', fjprot, 0.001D0, 10.0D0, & + case ('fjprot') + call parse_real_variable('fjprot', fjprot, 0.001D0, 10.0D0, & 'F-value for SCTF winding pack J') - case ('flhthresh') - call parse_real_variable('flhthresh', flhthresh, 0.001D0, 1.0D6, & + case ('flhthresh') + call parse_real_variable('flhthresh', flhthresh, 0.001D0, 1.0D6, & 'F-value for L-H power threshold') - case ('fmva') - call parse_real_variable('fmva', fmva, 0.001D0, 10.0D0, & + case ('fmva') + call parse_real_variable('fmva', fmva, 0.001D0, 10.0D0, & 'F-value for maximum MVA') - case ('fnbshinef') - call parse_real_variable('fnbshinef', fnbshinef, 0.001D0, 10.0D0, & + case ('fnbshinef') + call parse_real_variable('fnbshinef', fnbshinef, 0.001D0, 10.0D0, & 'F-value for maximum NBI shine-through fraction') - case ('fncycle') - call parse_real_variable('fncycle', fncycle, 1.0D-8, 1.0D0, & + case ('fncycle') + call parse_real_variable('fncycle', fncycle, 1.0D-8, 1.0D0, & 'F-value for minimum CS coil stress load cycles') - case ('fpeakb') - call parse_real_variable('fpeakb', fpeakb, 0.001D0, 10.0D0, & + case ('fpeakb') + call parse_real_variable('fpeakb', fpeakb, 0.001D0, 10.0D0, & 'F-value for max toroidal field') - case ('fpinj') - call parse_real_variable('fpinj', fpinj, 0.001D0, 10.0D0, & + case ('fpinj') + call parse_real_variable('fpinj', fpinj, 0.001D0, 10.0D0, & 'F-value for injection power') - case ('fpnetel') - call parse_real_variable('fpnetel', fpnetel, 0.001D0, 10.0D0, & + case ('fpnetel') + call parse_real_variable('fpnetel', fpnetel, 0.001D0, 10.0D0, & 'F-value for net electric power') - case ('fportsz') - call parse_real_variable('fportsz', fportsz, 0.001D0, 10.0D0, & + case ('fportsz') + call parse_real_variable('fportsz', fportsz, 0.001D0, 10.0D0, & 'F-value for port size') - case ('fpdivlim') - call parse_real_variable('fpdivlim', fpdivlim, 0.001D0, 1.0D0, & + case ('fpdivlim') + call parse_real_variable('fpdivlim', fpdivlim, 0.001D0, 1.0D0, & 'F-value for minimum pdivt') - case ('ftoroidalgap') - call parse_real_variable('ftoroidalgap', ftoroidalgap, 0.001D0, 10.0D0, & - 'F-value for toroidal gap consistency') - case ('f_avspace') - call parse_real_variable('f_avspace', f_avspace, 0.001D0, 10.0D0, & - 'F-value for radial build consistency (stellarators)') - case ('fpsepr') - call parse_real_variable('fpsepr', fpsepr, 0.001D0, 10.0D0, & + case ('ftoroidalgap') + call parse_real_variable('ftoroidalgap', ftoroidalgap, 0.001D0, 10.0D0, & + 'F-value for toroidal gap consistency') + case ('f_avspace') + call parse_real_variable('f_avspace', f_avspace, 0.001D0, 10.0D0, & + 'F-value for radial build consistency (stellarators)') + case ('fpsepr') + call parse_real_variable('fpsepr', fpsepr, 0.001D0, 10.0D0, & 'F-value for Psep/R limit') - case ('fptemp') - call parse_real_variable('fptemp', fptemp, 0.001D0, 10.0D0, & + case ('fptemp') + call parse_real_variable('fptemp', fptemp, 0.001D0, 10.0D0, & 'F-value for peak centrepost temperature') - case ('fptfnuc') - call parse_real_variable('fptfnuc', fptfnuc, 0.001D0, 10.0D0, & + case ('fptfnuc') + call parse_real_variable('fptfnuc', fptfnuc, 0.001D0, 10.0D0, & 'F-value for max TF coil nuclear heating') - case ('fq') - call parse_real_variable('fq', fq, 0.001D0, 10.0D0, & + case ('fq') + call parse_real_variable('fq', fq, 0.001D0, 10.0D0, & 'F-value for edge safety factor') - case ('fqval') - call parse_real_variable('fqval', fqval, 0.001D0, 10.0D0, & + case ('fqval') + call parse_real_variable('fqval', fqval, 0.001D0, 10.0D0, & 'F-value for fusion gain Q') - case ('fradpwr') - call parse_real_variable('fradpwr', fradpwr, 0.0D0, 1.0D0, & + case ('fradpwr') + call parse_real_variable('fradpwr', fradpwr, 0.0D0, 1.0D0, & 'F-value for radiation power limit') - case ('fradwall') - call parse_real_variable('fradwall', fradwall, 0.001D0, 1.0D0, & + case ('fradwall') + call parse_real_variable('fradwall', fradwall, 0.001D0, 1.0D0, & 'f-value for upper limit on radiation wall load') - case ('freinke') - call parse_real_variable('freinke', freinke, 0.001D0, 1.0D0, & + case ('freinke') + call parse_real_variable('freinke', freinke, 0.001D0, 1.0D0, & 'f-value for upper limit on Reinke detachment criterion') - case ('frminor') - call parse_real_variable('frminor', frminor, 0.001D0, 10.0D0, & + case ('frminor') + call parse_real_variable('frminor', frminor, 0.001D0, 10.0D0, & 'F-value for minor radius limit') - case ('fstrcase') - call parse_real_variable('fstrcase', fstrcase, 0.001D0, 10.0D0, & + case ('fstrcase') + call parse_real_variable('fstrcase', fstrcase, 0.001D0, 10.0D0, & 'F-value for TF coil case stress') - case ('fstrcond') - call parse_real_variable('fstrcond', fstrcond, 0.001D0, 10.0D0, & + case ('fstrcond') + call parse_real_variable('fstrcond', fstrcond, 0.001D0, 10.0D0, & 'F-value for TF coil conduit stress') - case ('fstr_wp') - call parse_real_variable('fstr_wp', fstr_wp, 1.0D-9, 10.0D0, & + case ('fstr_wp') + call parse_real_variable('fstr_wp', fstr_wp, 1.0D-9, 10.0D0, & 'F-value for TF coil strain absolute value') - case ('ftaucq') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ftaucq is now obsolete - (use fmaxvvstress)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fmaxvvstress') - call parse_real_variable('fmaxvvstress', fmaxvvstress, 0.001D0, 1.0D0, & + case ('ftaucq') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ftaucq is now obsolete - (use fmaxvvstress)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fmaxvvstress') + call parse_real_variable('fmaxvvstress', fmaxvvstress, 0.001D0, 1.0D0, & 'F-value for maximum permitted stress of the VV') - case ('ftbr') - call parse_real_variable('ftbr', ftbr, 0.001D0, 10.0D0, & + case ('ftbr') + call parse_real_variable('ftbr', ftbr, 0.001D0, 10.0D0, & 'F-value for tritium breeding ratio limit') - case ('ftburn') - call parse_real_variable('ftburn', ftburn, 0.001D0, 10.0D0, & + case ('ftburn') + call parse_real_variable('ftburn', ftburn, 0.001D0, 10.0D0, & 'F-value for burn time limit') - case ('ftcycl') - call parse_real_variable('ftcycl', ftcycl, 0.001D0, 10.0D0, & + case ('ftcycl') + call parse_real_variable('ftcycl', ftcycl, 0.001D0, 10.0D0, & 'F-value for cycle time') - case ('ftmargtf') - call parse_real_variable('ftmargtf', ftmargtf, 0.001D0, 10.0D0, & + case ('ftmargtf') + call parse_real_variable('ftmargtf', ftmargtf, 0.001D0, 10.0D0, & 'F-value for TF coil temp. margin') - case ('ftmargoh') - call parse_real_variable('ftmargoh', ftmargoh, 0.001D0, 10.0D0, & + case ('ftmargoh') + call parse_real_variable('ftmargoh', ftmargoh, 0.001D0, 10.0D0, & 'F-value for TF coil temp. margin') - case ('ftohs') - call parse_real_variable('ftohs', ftohs, 0.001D0, 10.0D0, & + case ('ftohs') + call parse_real_variable('ftohs', ftohs, 0.001D0, 10.0D0, & 'F-value for plasma current ramp-up time') - case ('ftpeak') - call parse_real_variable('ftpeak', ftpeak, 0.001D0, 10.0D0, & + case ('ftpeak') + call parse_real_variable('ftpeak', ftpeak, 0.001D0, 10.0D0, & 'F-value for peak first wall temperature') - case ('fvdump') - call parse_real_variable('fvdump', fvdump, 0.001D0, 10.0D0, & + case ('fvdump') + call parse_real_variable('fvdump', fvdump, 0.001D0, 10.0D0, & 'F-value for dump voltage') - case ('fvs') - call parse_real_variable('fvs', fvs, 0.001D0, 10.0D0, & + case ('fvs') + call parse_real_variable('fvs', fvs, 0.001D0, 10.0D0, & 'F-value for startup V-s requirement') - case ('fvssu') - call parse_real_variable('fvssu', fvssu, 0.001D0, 10.0D0, & + case ('fvssu') + call parse_real_variable('fvssu', fvssu, 0.001D0, 10.0D0, & 'F-value for start up V-s requirement and availability equality') - case ('fvvhe') - call parse_real_variable('fvvhe', fvvhe, 0.001D0, 10.0D0, & + case ('fvvhe') + call parse_real_variable('fvvhe', fvvhe, 0.001D0, 10.0D0, & 'F-value for VV He concentration limit') - case ('fwalld') - call parse_real_variable('fwalld', fwalld, 0.001D0, 10.0D0, & + case ('fwalld') + call parse_real_variable('fwalld', fwalld, 0.001D0, 10.0D0, & 'F-value for wall load limit') - case ('fzactual') - call parse_real_variable('fzactual', fzactual, 0.0D0, 1.0D0, & + case ('fzactual') + call parse_real_variable('fzactual', fzactual, 0.0D0, 1.0D0, & 'fraction of specified impurity in SOL when constrained by Reinke criteria') - case ('fzeffmax') - call parse_real_variable('fzeffmax', fzeffmax, 0.001D0, 1.0D0, & + case ('fzeffmax') + call parse_real_variable('fzeffmax', fzeffmax, 0.001D0, 1.0D0, & 'f-value for Zeff limit equation') - case ('fpoloidalpower') - call parse_real_variable('fpoloidalpower', fpoloidalpower, 0.001D0, 1.0D0, & + case ('fpoloidalpower') + call parse_real_variable('fpoloidalpower', fpoloidalpower, 0.001D0, 1.0D0, & 'f-value for constraint on rate of change of energy in poloidal field') - case ('fpsep') - call parse_real_variable('fpsep', fpsep, 0.001D0, 1.0D0, & - 'f-value to ensure separatrix power is less than value from Kallen bach divertor') - case ('fpsepbqar') - call parse_real_variable('fpsepbqar', fpsepbqar, 0.001D0, 1.0D0, & - 'f-value for TF coil quench temperature < tmax_croco (constraint equation 74)') - case ('fcqt') - call parse_real_variable('fcqt', fcqt, 0.001D0, 1.0D0, & - 'TF coil quench temparature remains below tmax_croco') - case ('fne0') - call parse_real_variable('fne0', fne0, 0.001D0, 1.0D0, & - 'Central electron temperature remains higher that the pedestal one') - case ('gammax') - call parse_real_variable('gammax', gammax, 0.01D0, 10.0D0, & + case ('fpsep') + call parse_real_variable('fpsep', fpsep, 0.001D0, 1.0D0, & + 'f-value to ensure separatrix power is less than value from Kallen bach divertor') + case ('fpsepbqar') + call parse_real_variable('fpsepbqar', fpsepbqar, 0.001D0, 1.0D0, & + 'f-value for TF coil quench temperature < tmax_croco (constraint equation 74)') + case ('fcqt') + call parse_real_variable('fcqt', fcqt, 0.001D0, 1.0D0, & + 'TF coil quench temparature remains below tmax_croco') + case ('fne0') + call parse_real_variable('fne0', fne0, 0.001D0, 1.0D0, & + 'Central electron temperature remains higher that the pedestal one') + case ('gammax') + call parse_real_variable('gammax', gammax, 0.01D0, 10.0D0, & 'Maximum current drive gamma (A/W-m2)') - case ('maxradwallload') - call parse_real_variable('maxradwallload', maxradwallload, 0.1D0, 10.0D0, & + case ('maxradwallload') + call parse_real_variable('maxradwallload', maxradwallload, 0.1D0, 10.0D0, & 'Maximum permitted radiation wall load (MW/m^2)') - case ('mvalim') - call parse_real_variable('mvalim', mvalim, 0.0D0, 1000.0D0, & + case ('mvalim') + call parse_real_variable('mvalim', mvalim, 0.0D0, 1000.0D0, & 'Maximum MVA limit') - case ('nbshinefmax') - call parse_real_variable('nbshinefmax', nbshinefmax, 1.0D-20, 1.0D-1, & + case ('nbshinefmax') + call parse_real_variable('nbshinefmax', nbshinefmax, 1.0D-20, 1.0D-1, & 'Maximum NB shine-through fraction') - case ('nflutfmax') - call parse_real_variable('nflutfmax', nflutfmax, 1.0D20, 1.0D24, & + case ('nflutfmax') + call parse_real_variable('nflutfmax', nflutfmax, 1.0D20, 1.0D24, & 'Max fast neutron fluence on TF coil (n/m2)') - case ('pdivtlim') - call parse_real_variable('pdivtlim', pdivtlim, 0.1D0, 1.0D3, & + case ('pdivtlim') + call parse_real_variable('pdivtlim', pdivtlim, 0.1D0, 1.0D3, & 'Minimum pdivt (MW) (con. 80, itvar. 153)') - case ('peakfactrad') - call parse_real_variable('peakfactrad', peakfactrad, 0.1D0, 10D0, & + case ('peakfactrad') + call parse_real_variable('peakfactrad', peakfactrad, 0.1D0, 10D0, & 'peaking factor for radiation wall load') - case ('pnetelin') - call parse_real_variable('pnetelin', pnetelin, 1.0D0, 1.0D4, & + case ('pnetelin') + call parse_real_variable('pnetelin', pnetelin, 1.0D0, 1.0D4, & 'Required net electric power (MW)') - case ('powfmax') - call parse_real_variable('powfmax', powfmax, 1.0D0, 1.0D4, & + case ('powfmax') + call parse_real_variable('powfmax', powfmax, 1.0D0, 1.0D4, & 'Maximum fusion power (MW)') - case ('psepbqarmax') - call parse_real_variable('psepbqarmax', psepbqarmax, 1.0D0, 50.0D0, & + case ('psepbqarmax') + call parse_real_variable('psepbqarmax', psepbqarmax, 1.0D0, 50.0D0, & 'Maximum Psep*Bt/q*A*R ratio (MW.T/m)') - case ('pseprmax') - call parse_real_variable('pseprmax', pseprmax, 1.0D0, 60.0D0, & + case ('pseprmax') + call parse_real_variable('pseprmax', pseprmax, 1.0D0, 60.0D0, & 'Maximum Psep/R ratio (MW/m)') - case ('ptfnucmax') - call parse_real_variable('ptfnucmax', ptfnucmax, 1.0D-6, 1.0D0, & + case ('ptfnucmax') + call parse_real_variable('ptfnucmax', ptfnucmax, 1.0D-6, 1.0D0, & 'Maximum TF coil nuclear heating (MW/m3)') - case ('tbrmin') - call parse_real_variable('tbrmin', tbrmin, 0.001D0, 2.0D0, & + case ('tbrmin') + call parse_real_variable('tbrmin', tbrmin, 0.001D0, 2.0D0, & 'Minimum tritium breeding ratio') - case ('tbrnmn') - call parse_real_variable('tbrnmn', tbrnmn, 1.0D-3, 1.0D6, & + case ('tbrnmn') + call parse_real_variable('tbrnmn', tbrnmn, 1.0D-3, 1.0D6, & 'Minimum burn time (s)') - case ('tcycmn') - call parse_real_variable('tcycmn', tcycmn, 1.0D-3, 2.0D6, & + case ('tcycmn') + call parse_real_variable('tcycmn', tcycmn, 1.0D-3, 2.0D6, & 'Minimum cycle time (s)') - case ('vvhealw') - call parse_real_variable('vvhealw', vvhealw, 0.01D0, 10.0D0, & + case ('vvhealw') + call parse_real_variable('vvhealw', vvhealw, 0.01D0, 10.0D0, & 'Allowable maximum He conc. in VV (appm)') - case ('walalw') - call parse_real_variable('walalw', walalw, 0.001D0, 50.0D0, & + case ('walalw') + call parse_real_variable('walalw', walalw, 0.001D0, 50.0D0, & 'Allowable wall load (MW/m2)') - case ('zeffmax') - call parse_real_variable('zeffmax', zeffmax, 1.0D0, 10.0D0, & + case ('zeffmax') + call parse_real_variable('zeffmax', zeffmax, 1.0D0, 10.0D0, & 'Allowable Zeff') - ! Current drive settings + ! Current drive settings - case ('beamwd') - call parse_real_variable('beamwd', beamwd, 0.001D0, 5.0D0, & + case ('beamwd') + call parse_real_variable('beamwd', beamwd, 0.001D0, 5.0D0, & 'Beam width (m)') - case ('bscfmax') - call parse_real_variable('bscfmax', bscfmax, -0.999D0, 0.999D0, & + case ('bscfmax') + call parse_real_variable('bscfmax', bscfmax, -0.999D0, 0.999D0, & '(-fixed)/maximum Bootstrap fraction') - case ('cboot') - call parse_real_variable('cboot', cboot, 0.0D0, 10.0D0, & + case ('cboot') + call parse_real_variable('cboot', cboot, 0.0D0, 10.0D0, & 'Bootstrap current fraction multiplier') - case ('enbeam') - call parse_real_variable('enbeam', enbeam, 1.0D0, 1.0D6, & + case ('enbeam') + call parse_real_variable('enbeam', enbeam, 1.0D0, 1.0D6, & 'Neutral beam energy (keV)') - case ('etalh') - call parse_real_variable('etalh', etalh, 0.0D0, 1.0D0, & + case ('etalh') + call parse_real_variable('etalh', etalh, 0.0D0, 1.0D0, & 'LH wall plug to plasma efficiency') - case ('etaech') - call parse_real_variable('etaech', etaech, 0.0D0, 1.0D0, & + case ('etaech') + call parse_real_variable('etaech', etaech, 0.0D0, 1.0D0, & 'ECH wall plug to injector efficiency') - case ('etanbi') - call parse_real_variable('etanbi', etanbi, 0.0D0, 1.0D0, & + case ('etanbi') + call parse_real_variable('etanbi', etanbi, 0.0D0, 1.0D0, & 'NBI wall plug to injector efficiency') - case ('feffcd') - call parse_real_variable('feffcd', feffcd, 0.0D0, 20.0D0, & + case ('feffcd') + call parse_real_variable('feffcd', feffcd, 0.0D0, 20.0D0, & 'Current drive efficiency fiddle factor') - case ('forbitloss') - call parse_real_variable('forbitloss', forbitloss, 0.0D0, 0.999D0, & + case ('forbitloss') + call parse_real_variable('forbitloss', forbitloss, 0.0D0, 0.999D0, & 'NBI power orbit loss fraction') - case ('frbeam') - call parse_real_variable('frbeam', frbeam, 0.5D0, 2.0D0, & + case ('frbeam') + call parse_real_variable('frbeam', frbeam, 0.5D0, 2.0D0, & 'R_tan / R_major for NBI') - case ('ftritbm') - call parse_real_variable('ftritbm', ftritbm, 0.0D0, 1.0D0, & + case ('ftritbm') + call parse_real_variable('ftritbm', ftritbm, 0.0D0, 1.0D0, & 'Tritium fraction of beam') - case ('gamma_ecrh') - call parse_real_variable('gamma_ecrh', gamma_ecrh, 0.0D0, 1.0D0, & + case ('gamma_ecrh') + call parse_real_variable('gamma_ecrh', gamma_ecrh, 0.0D0, 1.0D0, & 'User input ECRH gamma_CD') - case ('harnum') - call parse_real_variable('harnum', harnum, 1.0D0, 10.0D0, & + case ('harnum') + call parse_real_variable('harnum', harnum, 1.0D0, 10.0D0, & 'cyclotron harmonic frequency number') - case ('rho_ecrh') - call parse_real_variable('rho_ecrh', rho_ecrh, 0.0D0, 1.0D0, & + case ('rho_ecrh') + call parse_real_variable('rho_ecrh', rho_ecrh, 0.0D0, 1.0D0, & 'normalised minor radius at which electron cyclotron current drive is maximum') - case ('xi_ebw') - call parse_real_variable('xi_ebw', xi_ebw, 0.0D0, 1.0D0, & + case ('xi_ebw') + call parse_real_variable('xi_ebw', xi_ebw, 0.0D0, 1.0D0, & 'User input EBW scaling for Plasma Heating') - case ('iefrf') - call parse_int_variable('iefrf', iefrf, 1, 12, & + case ('iefrf') + call parse_int_variable('iefrf', iefrf, 1, 12, & 'Switch for curr drive efficiency model') - case ('iefrffix') - call parse_int_variable('iefrffix', iefrffix, 0, 12, & + case ('iefrffix') + call parse_int_variable('iefrffix', iefrffix, 0, 12, & 'Switch for 2nd curr drive efficiency model') - case ('irfcd') - call parse_int_variable('irfcd', irfcd, 0, 1, & + case ('irfcd') + call parse_int_variable('irfcd', irfcd, 0, 1, & 'Switch for current drive calculation') - case ('nbshield') - call parse_real_variable('nbshield', nbshield, 0.01D0, 0.5D0, & + case ('nbshield') + call parse_real_variable('nbshield', nbshield, 0.01D0, 0.5D0, & 'Wall thickness of neutral beam duct (m)') - case ('pheat') - call parse_real_variable('pheat', pheat, 0.0D0, 1.0D3, & + case ('pheat') + call parse_real_variable('pheat', pheat, 0.0D0, 1.0D3, & 'Heating power not used for C.D. (MW)') - case ('pheatfix') - call parse_real_variable('pheatfix', pheatfix, 0.0D0, 1.0D3, & + case ('pheatfix') + call parse_real_variable('pheatfix', pheatfix, 0.0D0, 1.0D3, & 'Secondary fixed heating power not used for C.D. (MW)') - case ('pinjalw') - call parse_real_variable('pinjalw', pinjalw, 0.0D0, 1.0D3, & + case ('pinjalw') + call parse_real_variable('pinjalw', pinjalw, 0.0D0, 1.0D3, & 'Maximum allowed injection power (MW)') - case ('pinjfixmw') - call parse_real_variable('pinjfixmw', pinjfixmw, 0.0D0, 1.0D3, & + case ('pinjfixmw') + call parse_real_variable('pinjfixmw', pinjfixmw, 0.0D0, 1.0D3, & 'Secondary auxiliary injection power (MW)') - case ('tbeamin') - call parse_real_variable('tbeamin', tbeamin, 0.0D0, 10.0D0, & + case ('tbeamin') + call parse_real_variable('tbeamin', tbeamin, 0.0D0, 10.0D0, & 'No of NB decay lengths to plas centre') - ! Time settings + ! Time settings - case ('tburn') - call parse_real_variable('tburn', tburn, 0.0D0, 1.0D8, & + case ('tburn') + call parse_real_variable('tburn', tburn, 0.0D0, 1.0D8, & 'Burn time (s)') - case ('tdwell') - call parse_real_variable('tdwell', tdwell, 0.0D0, 1.0D8, & + case ('tdwell') + call parse_real_variable('tdwell', tdwell, 0.0D0, 1.0D8, & 'Time between burns (s)') - case ('theat') - call parse_real_variable('theat', theat, 0.0D0, 1.0D4, & + case ('theat') + call parse_real_variable('theat', theat, 0.0D0, 1.0D4, & 'Heating time after current ramp (s)') - case ('tohs') - call parse_real_variable('tohs', tohs, 0.0D0, 1.0D4, & + case ('tohs') + call parse_real_variable('tohs', tohs, 0.0D0, 1.0D4, & 'Plasma current ramp-up time for current init (s)') - case ('tohsin') - call parse_real_variable('tohsin', tohsin, 0.0D0, 1.0D4, & + case ('tohsin') + call parse_real_variable('tohsin', tohsin, 0.0D0, 1.0D4, & 'Switch for TOHS calculation') - case ('tqnch') - call parse_real_variable('tqnch', tqnch, 0.0D0, 1.0D4, & + case ('tqnch') + call parse_real_variable('tqnch', tqnch, 0.0D0, 1.0D4, & 'PF coil shutdown time (s)') - case ('tramp') - call parse_real_variable('tramp', tramp, 0.0D0, 1.0D4, & + case ('tramp') + call parse_real_variable('tramp', tramp, 0.0D0, 1.0D4, & 'Initial charge time for PF coils (s)') - case ('pulsetimings') - call parse_real_variable('pulsetimings', pulsetimings, 0.0D0, 1.0D0, & + case ('pulsetimings') + call parse_real_variable('pulsetimings', pulsetimings, 0.0D0, 1.0D0, & 'Pulse timings switch for lpulse=1') - ! Divertor settings: 2016 Kallenbach model (2016/07/04) - - case ('target_spread', 'lambda_q_omp', 'lcon_factor', 'netau_sol', 'kallenbach_switch', & - 'kallenbach_tests', 'kallenbach_test_option', 'kallenbach_scan_switch', 'kallenbach_scan_var', & - 'kallenbach_scan_start', 'kallenbach_scan_end', 'kallenbach_scan_num', 'targetangle', 'ttarget', & - 'qtargettotal', 'impurity_enrichment', 'fractionwidesol', 'abserr_sol', 'relerr_sol', 'mach0', & - 'neratio') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'The Stellarator model is currently not included in PROCESS.' - write(outfile,*) 'See issue #1853 for more information on the use of Stellarators.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - - ! See HTS coil module for PROCESS.docx - !case ('cable_helium_fraction') - ! call parse_real_variable('cable_helium_fraction', cable_helium_fraction, 0.215D0, 0.99D0, & - ! 'Helium area as a fraction of the cable space.') - - ! Divertor settings - - case ('anginc') - call parse_real_variable('anginc', anginc, 0.0D0, 1.5707D0, & + ! Divertor settings: 2016 Kallenbach model (2016/07/04) + + case ('target_spread', 'lambda_q_omp', 'lcon_factor', 'netau_sol', 'kallenbach_switch', & + 'kallenbach_tests', 'kallenbach_test_option', 'kallenbach_scan_switch', 'kallenbach_scan_var', & + 'kallenbach_scan_start', 'kallenbach_scan_end', 'kallenbach_scan_num', 'targetangle', 'ttarget', & + 'qtargettotal', 'impurity_enrichment', 'fractionwidesol', 'abserr_sol', 'relerr_sol', 'mach0', & + 'neratio') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'The Stellarator model is currently not included in PROCESS.' + write(outfile,*) 'See issue #1853 for more information on the use of Stellarators.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + + ! See HTS coil module for PROCESS.docx + !case ('cable_helium_fraction') + ! call parse_real_variable('cable_helium_fraction', cable_helium_fraction, 0.215D0, 0.99D0, & + ! 'Helium area as a fraction of the cable space.') + + ! Divertor settings + + case ('anginc') + call parse_real_variable('anginc', anginc, 0.0D0, 1.5707D0, & 'Field line ang of incid on dvrtr (rad)') - case ('beta_div') - call parse_real_variable('beta_div', beta_div, 0.0D0, 360.0D0, & + case ('beta_div') + call parse_real_variable('beta_div', beta_div, 0.0D0, 360.0D0, & 'Field line angle wrt divertor target plate (degrees)') - case ('betai') - call parse_real_variable('betai', betai, 0.0D0, 1.5707D0, & + case ('betai') + call parse_real_variable('betai', betai, 0.0D0, 1.5707D0, & 'Poloidal plane angle between inner divertor leg and plate (rad)') - case ('betao') - call parse_real_variable('betao', betao, 0.0D0, 1.5707D0, & + case ('betao') + call parse_real_variable('betao', betao, 0.0D0, 1.5707D0, & 'Poloidal plane angle between outer divertor leg and plate (rad)') - case ('bpsout') - call parse_real_variable('bpsout', bpsout, 0.0D0, 10.0D0, & + case ('bpsout') + call parse_real_variable('bpsout', bpsout, 0.0D0, 10.0D0, & 'Ref B_p at outboard divertor strike point') - case ('c1div') - call parse_real_variable('c1div', c1div, -100.0D0, 100.0D0, & + case ('c1div') + call parse_real_variable('c1div', c1div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c2div') - call parse_real_variable('c2div', c2div, -100.0D0, 100.0D0, & + case ('c2div') + call parse_real_variable('c2div', c2div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c3div') - call parse_real_variable('c3div', c3div, -100.0D0, 100.0D0, & + case ('c3div') + call parse_real_variable('c3div', c3div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c4div') - call parse_real_variable('c4div', c4div, -100.0D0, 100.0D0, & + case ('c4div') + call parse_real_variable('c4div', c4div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c5div') - call parse_real_variable('c5div', c5div, -100.0D0, 100.0D0, & + case ('c5div') + call parse_real_variable('c5div', c5div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('c6div') - call parse_real_variable('c6div', c6div, -100.0D0, 100.0D0, & + case ('c6div') + call parse_real_variable('c6div', c6div, -100.0D0, 100.0D0, & 'Divertor model fitting coefficient') - case ('delld') - call parse_real_variable('delld', delld, 0.1D0, 2.0D0, & + case ('delld') + call parse_real_variable('delld', delld, 0.1D0, 2.0D0, & 'Coefficient for power distribution') - case ('divclfr') - call parse_real_variable('divclfr', divclfr, 0.0D0, 1.0D0, & + case ('divclfr') + call parse_real_variable('divclfr', divclfr, 0.0D0, 1.0D0, & 'Divertor coolant fraction') - case ('divdens') - call parse_real_variable('divdens', divdens, 0.1D0, 1.0D5, & + case ('divdens') + call parse_real_variable('divdens', divdens, 0.1D0, 1.0D5, & 'Divertor structure density (kg/m3)') - case ('divdum') - call parse_int_variable('divdum', divdum, 0, 1, & + case ('divdum') + call parse_int_variable('divdum', divdum, 0, 1, & 'Switch for divertor Zeff value') - case ('divfix') - call parse_real_variable('divfix', divfix, 0.1D0, 5.0D0, & + case ('divfix') + call parse_real_variable('divfix', divfix, 0.1D0, 5.0D0, & 'Divertor structure vertical extent (m)') - case('divleg_profile_inner') - call parse_real_variable('divleg_profile_inner', divleg_profile_inner, 0.0D0, 10.0D0, & + case('divleg_profile_inner') + call parse_real_variable('divleg_profile_inner', divleg_profile_inner, 0.0D0, 10.0D0, & 'Divertor inner leg surface, 2D profile (m)') - case('divleg_profile_outer') - call parse_real_variable('divleg_profile_outer', divleg_profile_outer, 0.0D0, 50.0D0, & + case('divleg_profile_outer') + call parse_real_variable('divleg_profile_outer', divleg_profile_outer, 0.0D0, 50.0D0, & 'Divertor outer leg surface, 2D profile (m)') - case ('divplt') - call parse_real_variable('divplt', divplt, 0.01D0, 1.0D0, & + case ('divplt') + call parse_real_variable('divplt', divplt, 0.01D0, 1.0D0, & 'Divertor plate thickness (m)') - case ('fdfs') - call parse_real_variable('fdfs', fdfs, 0.0D0, 20.0D0, & + case ('fdfs') + call parse_real_variable('fdfs', fdfs, 0.0D0, 20.0D0, & 'Radial gradient ratio') - case ('fdiva') - call parse_real_variable('fdiva', fdiva, 0.1D0, 2.0D0, & + case ('fdiva') + call parse_real_variable('fdiva', fdiva, 0.1D0, 2.0D0, & 'Divertor area fiddle factor') - case ('fgamp') - call parse_real_variable('fgamp', fgamp, -100.0D0, 100.0D0, & + case ('fgamp') + call parse_real_variable('fgamp', fgamp, -100.0D0, 100.0D0, & 'Sheath potential factor') - case ('fififi') - call parse_real_variable('fififi', fififi, 1.0D-6, 1.0D0, & + case ('fififi') + call parse_real_variable('fififi', fififi, 1.0D-6, 1.0D0, & 'Coefficient for gamdiv') - case ('flux_exp') - call parse_real_variable('flux_exp', flux_exp, 0.0D0, 10.0D0, & + case ('flux_exp') + call parse_real_variable('flux_exp', flux_exp, 0.0D0, 10.0D0, & 'Plasma flux expansion in the divertor') - case ('frrp') - call parse_real_variable('frrp', frrp, 0.0D0, 1.0D0, & + case ('frrp') + call parse_real_variable('frrp', frrp, 0.0D0, 1.0D0, & 'Fraction of radiated power to plate') - case ('hldivlim') - call parse_real_variable('hldivlim', hldivlim, 0.1D0, 20.0D0, & + case ('hldivlim') + call parse_real_variable('hldivlim', hldivlim, 0.1D0, 20.0D0, & 'Divertor heat load limit (MW/m2)') - case ('ksic') - call parse_real_variable('ksic', ksic, 0.0D0, 2.0D0, & + case ('ksic') + call parse_real_variable('ksic', ksic, 0.0D0, 2.0D0, & 'Divertor power fraction thingy') - case ('omegan') - call parse_real_variable('omegan', omegan, 0.1D0, 10.0D0, & + case ('omegan') + call parse_real_variable('omegan', omegan, 0.1D0, 10.0D0, & 'Pressure ratio (nT)_p / (nT)_s') - case ('plleni') - call parse_real_variable('plleni', plleni, 0.1D0, 10.0D0, & + case ('plleni') + call parse_real_variable('plleni', plleni, 0.1D0, 10.0D0, & 'Poloidal length, inboard divertor plate (m)') - case ('plleno') - call parse_real_variable('plleno', plleno, 0.1D0, 10.0D0, & + case ('plleno') + call parse_real_variable('plleno', plleno, 0.1D0, 10.0D0, & 'Poloidal length, outboard divertor plate (m)') - case ('plsepi') - call parse_real_variable('plsepi', plsepi, 0.1D0, 10.0D0, & + case ('plsepi') + call parse_real_variable('plsepi', plsepi, 0.1D0, 10.0D0, & 'Poloidal length, x to inboard strike point (m)') - case ('plsepo') - call parse_real_variable('plsepo', plsepo, 0.1D0, 10.0D0, & + case ('plsepo') + call parse_real_variable('plsepo', plsepo, 0.1D0, 10.0D0, & 'Poloidal length, x to outboard strike point (m)') - case ('prn1') - call parse_real_variable('prn1', prn1, 0.0D0, 1.0D0, & + case ('prn1') + call parse_real_variable('prn1', prn1, 0.0D0, 1.0D0, & 'n_scrapeoff / n_average plasma') - case ('rlenmax') - call parse_real_variable('rlenmax', rlenmax, 0.0D0, 1.0D0, & + case ('rlenmax') + call parse_real_variable('rlenmax', rlenmax, 0.0D0, 1.0D0, & 'Maximum value for length ratio') - case ('tdiv') - call parse_real_variable('tdiv', tdiv, 0.1D0, 100.0D0, & + case ('tdiv') + call parse_real_variable('tdiv', tdiv, 0.1D0, 100.0D0, & 'Plasma temperature at divertor (eV)') - case ('xparain') - call parse_real_variable('xparain', xparain, 0.01D0, 1.0D4, & + case ('xparain') + call parse_real_variable('xparain', xparain, 0.01D0, 1.0D4, & 'Parallel heat transport coeff (m2/s)') - case ('xpertin') - call parse_real_variable('xpertin', xpertin, 0.0D0, 10.0D0, & + case ('xpertin') + call parse_real_variable('xpertin', xpertin, 0.0D0, 10.0D0, & 'Perpendicular heat trans coeff (m2/s)') - case ('zeffdiv') - call parse_real_variable('zeffdiv', zeffdiv, 0.01D0, 100.0D0, & + case ('zeffdiv') + call parse_real_variable('zeffdiv', zeffdiv, 0.01D0, 100.0D0, & 'Zeff in the divertor region (if divdum.ne.0)') - ! Radial / vertical build settings + ! Radial / vertical build settings - case ('aplasmin') - call parse_real_variable('aplasmin', aplasmin, 0.01D0, 10.0D0, & + case ('aplasmin') + call parse_real_variable('aplasmin', aplasmin, 0.01D0, 10.0D0, & 'Minimum minor radius (m)') - case ('blbmith') - call parse_real_variable('blbmith', blbmith, 0.0D0, 2.0D0, & + case ('blbmith') + call parse_real_variable('blbmith', blbmith, 0.0D0, 2.0D0, & 'Inboard blanket box manifold thickness (m)') - case ('blbmoth') - call parse_real_variable('blbmoth', blbmoth, 0.0D0, 2.0D0, & + case ('blbmoth') + call parse_real_variable('blbmoth', blbmoth, 0.0D0, 2.0D0, & 'Outboard blanket box manifold thickness (m)') - case ('blbpith') - call parse_real_variable('blbpith', blbpith, 0.0D0, 2.0D0, & + case ('blbpith') + call parse_real_variable('blbpith', blbpith, 0.0D0, 2.0D0, & 'Inboard blanket back plate thickness (m)') - case ('blbpoth') - call parse_real_variable('blbpoth', blbpoth, 0.0D0, 2.0D0, & + case ('blbpoth') + call parse_real_variable('blbpoth', blbpoth, 0.0D0, 2.0D0, & 'Outboard blanket back plate thickness (m)') - case ('blbuith') - call parse_real_variable('blbuith', blbuith, 0.0D0, 2.0D0, & + case ('blbuith') + call parse_real_variable('blbuith', blbuith, 0.0D0, 2.0D0, & 'Inboard blanket breeding unit thickness (m)') - case ('blbuoth') - call parse_real_variable('blbuoth', blbuoth, 0.0D0, 2.0D0, & + case ('blbuoth') + call parse_real_variable('blbuoth', blbuoth, 0.0D0, 2.0D0, & 'Outboard blanket breeding unit thickness (m)') - case ('blnkith') - if (iblanket == 3) then - !CCFE HCPB model with Tritium Breeding Ratio calculation - write(outfile,*) '**********' - write(outfile,*) 'ERROR. BLNKITH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - else - call parse_real_variable('blnkith', blnkith, 0.0D0, 10.0D0, & - 'Inboard blanket thickness (m)') - ! Inboard blanket does not exist if the thickness is below a certain limit. - if(blnkith>=0.0D00.and.blnkith<=1.0D-3) then - blnkith = 0.0D00 ! Inboard blanket thickness is zero - iblnkith = 0 ! Inboard blanket does not exist - end if - end if - case ('blnkoth') - if (iblanket == 3) then - !CCFE HCPB model with Tritium Breeding Ratio calculation - write(outfile,*) '**********' - write(outfile,*) 'ERROR. BLNKOTH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - else - call parse_real_variable('blnkoth', blnkoth, 0.0D0, 10.0D0, & - 'Outboard blanket thickness (m)') - end if - case ('blnktth') - write(outfile,*) ' ' + case ('blnkith') + if (iblanket == 3) then + !CCFE HCPB model with Tritium Breeding Ratio calculation write(outfile,*) '**********' - write(outfile,*) 'WARNING. BLNKTTH is now always calculated rather than input -' + write(outfile,*) 'ERROR. BLNKITH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' write(outfile,*) 'please remove it from the input file' write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('bcylth') - write(outfile,*) ' ' + else + call parse_real_variable('blnkith', blnkith, 0.0D0, 10.0D0, & + 'Inboard blanket thickness (m)') + ! Inboard blanket does not exist if the thickness is below a certain limit. + if(blnkith>=0.0D00.and.blnkith<=1.0D-3) then + blnkith = 0.0D00 ! Inboard blanket thickness is zero + iblnkith = 0 ! Inboard blanket does not exist + end if + end if + case ('blnkoth') + if (iblanket == 3) then + !CCFE HCPB model with Tritium Breeding Ratio calculation write(outfile,*) '**********' - write(outfile,*) 'ERROR. BCYLTH is now obsolete -' + write(outfile,*) 'ERROR. BLNKOTH input is not required for CCFE HCPB model with Tritium Breeding Ratio calculation -' write(outfile,*) 'please remove it from the input file' write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('bore') - call parse_real_variable('bore', bore, 0.0D0, 50.0D0, & + else + call parse_real_variable('blnkoth', blnkoth, 0.0D0, 10.0D0, & + 'Outboard blanket thickness (m)') + end if + case ('blnktth') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'WARNING. BLNKTTH is now always calculated rather than input -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('bcylth') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ERROR. BCYLTH is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('bore') + call parse_real_variable('bore', bore, 0.0D0, 50.0D0, & 'Machine bore (m)') - case ('clhsf') - call parse_real_variable('clhsf', clhsf, 2.0D0, 10.0D0, & + case ('clhsf') + call parse_real_variable('clhsf', clhsf, 2.0D0, 10.0D0, & 'Cryostat lid height scaling factor (m)') - case ('ddwex') - call parse_real_variable('ddwex', ddwex, 0.0D0, 10.0D0, & + case ('ddwex') + call parse_real_variable('ddwex', ddwex, 0.0D0, 10.0D0, & 'cryostat wall thickness (m)') - case ('d_vv_in') - call parse_real_variable('d_vv_in', d_vv_in, 0.0D0, 10.0D0, & + case ('d_vv_in') + call parse_real_variable('d_vv_in', d_vv_in, 0.0D0, 10.0D0, & 'Inboard vacuum vessel thickness (m)') - case ('d_vv_out') - call parse_real_variable('d_vv_out', d_vv_out, 0.0D0, 10.0D0, & + case ('d_vv_out') + call parse_real_variable('d_vv_out', d_vv_out, 0.0D0, 10.0D0, & 'Outboard vacuum vessel thickness (m)') - case ('d_vv_top') - call parse_real_variable('d_vv_top', d_vv_top, 0.0D0, 10.0D0, & + case ('d_vv_top') + call parse_real_variable('d_vv_top', d_vv_top, 0.0D0, 10.0D0, & 'Topside vacuum vessel thickness (m)') - case ('d_vv_bot') - call parse_real_variable('d_vv_bot', d_vv_bot, 0.0D0, 10.0D0, & + case ('d_vv_bot') + call parse_real_variable('d_vv_bot', d_vv_bot, 0.0D0, 10.0D0, & 'Underside vacuum vessel thickness (m)') - case ('fcspc') - call parse_real_variable('fcspc', fcspc, 0.0D0, 1.0D0, & + case ('fcspc') + call parse_real_variable('fcspc', fcspc, 0.0D0, 1.0D0, & 'Fraction of space occupied by CS pre-comp structure') - case ('fmsbc') - call parse_real_variable('fmsbc', fmsbc, 0.0D0, 1.0D0, & + case ('fmsbc') + call parse_real_variable('fmsbc', fmsbc, 0.0D0, 1.0D0, & 'Martensitic frac of steel in buck cyl') - case ('fmsbl') - call parse_real_variable('fmsbl', fmsbl, 0.0D0, 1.0D0, & + case ('fmsbl') + call parse_real_variable('fmsbl', fmsbl, 0.0D0, 1.0D0, & 'Martensitic frac of steel in blanket') - case ('fmsdwe') - call parse_real_variable('fmsdwe', fmsdwe, 0.0D0, 1.0D0, & + case ('fmsdwe') + call parse_real_variable('fmsdwe', fmsdwe, 0.0D0, 1.0D0, & 'Martensitic frac of steel in cryostat') - case ('fmsdwi') - call parse_real_variable('fmsdwi', fmsdwi, 0.0D0, 1.0D0, & + case ('fmsdwi') + call parse_real_variable('fmsdwi', fmsdwi, 0.0D0, 1.0D0, & 'Martensitic frac of steel in vacuum vessel') - case ('fmsfw') - call parse_real_variable('fmsfw', fmsfw, 0.0D0, 1.0D0, & + case ('fmsfw') + call parse_real_variable('fmsfw', fmsfw, 0.0D0, 1.0D0, & 'Martensitic frac of steel in first wall') - case ('fmsoh') - call parse_real_variable('fmsoh', fmsoh, 0.0D0, 1.0D0, & + case ('fmsoh') + call parse_real_variable('fmsoh', fmsoh, 0.0D0, 1.0D0, & 'Martensitic frac of steel in Central Solenoid') - case ('fmssh') - call parse_real_variable('fmssh', fmssh, 0.0D0, 1.0D0, & + case ('fmssh') + call parse_real_variable('fmssh', fmssh, 0.0D0, 1.0D0, & 'Martensitic frac of steel in shield') - case ('fmstf') - call parse_real_variable('fmstf', fmstf, 0.0D0, 1.0D0, & + case ('fmstf') + call parse_real_variable('fmstf', fmstf, 0.0D0, 1.0D0, & 'Martensitic frac of steel in TF coil') - case ('fseppc') - call parse_real_variable('fseppc', fseppc, 1.0D6, 1.0D9, & + case ('fseppc') + call parse_real_variable('fseppc', fseppc, 1.0D6, 1.0D9, & 'CS separation force held by CS pre-comp structure') - case ('oh_steel_frac') - call parse_real_variable('oh_steel_frac', oh_steel_frac, 1.0D-3, 0.999D0, & + case ('oh_steel_frac') + call parse_real_variable('oh_steel_frac', oh_steel_frac, 1.0D-3, 0.999D0, & 'Central solenoid steel fraction') - case ('foh_stress') - call parse_real_variable('foh_stress', foh_stress, 1.0D-3, 1.0D0, & + case ('foh_stress') + call parse_real_variable('foh_stress', foh_stress, 1.0D-3, 1.0D0, & 'F-value for CS coil Tresca yield criterion') - ! case ('fwith') - ! call parse_real_variable('fwith', fwith, 0.0D0, 10.0D0, & - ! 'Inboard first wall thickness, initial estimate (m)') - ! case ('fwoth') - ! call parse_real_variable('fwoth', fwoth, 0.0D0, 10.0D0, & - ! 'Outboard first wall thickness, initial estimate (m)') - case ('gapoh') - call parse_real_variable('gapoh', gapoh, 0.0D0, 10.0D0, & + ! case ('fwith') + ! call parse_real_variable('fwith', fwith, 0.0D0, 10.0D0, & + ! 'Inboard first wall thickness, initial estimate (m)') + ! case ('fwoth') + ! call parse_real_variable('fwoth', fwoth, 0.0D0, 10.0D0, & + ! 'Outboard first wall thickness, initial estimate (m)') + case ('gapoh') + call parse_real_variable('gapoh', gapoh, 0.0D0, 10.0D0, & 'Gap between OHC and TF coil (m)') - case ('gapds') - call parse_real_variable('gapds', gapds, 0.0D0, 10.0D0, & + case ('gapds') + call parse_real_variable('gapds', gapds, 0.0D0, 10.0D0, & 'Gap between inboard vacuum vessel and shield (m)') - case ('gapomin') - call parse_real_variable('gapomin', gapomin, 0.0D0, 10.0D0, & + case ('gapomin') + call parse_real_variable('gapomin', gapomin, 0.0D0, 10.0D0, & 'Min gap between outboard shield & vac vessel (m)') - case ('iohcl') - call parse_int_variable('iohcl', iohcl, 0, 1, & + case ('iohcl') + call parse_int_variable('iohcl', iohcl, 0, 1, & 'Switch for existence of Central Solenoid') - case ('iprecomp') - call parse_int_variable('iprecomp', iprecomp, 0, 1, & + case ('iprecomp') + call parse_int_variable('iprecomp', iprecomp, 0, 1, & 'Switch for existence of Central Solenoid pre-compression structure') - case ('tf_in_cs') - call parse_int_variable('tf_in_cs', tf_in_cs, 0, 1, & + case ('tf_in_cs') + call parse_int_variable('tf_in_cs', tf_in_cs, 0, 1, & 'Switch for placing TF coils inside of the CS') - case ('ohcth') - call parse_real_variable('ohcth', ohcth, 0.0D0, 10.0D0, & + case ('ohcth') + call parse_real_variable('ohcth', ohcth, 0.0D0, 10.0D0, & 'Central Solenoid thickness (m)') - case ('rinboard') - call parse_real_variable('rinboard', rinboard, 0.1D0, 10.0D0, & + case ('rinboard') + call parse_real_variable('rinboard', rinboard, 0.1D0, 10.0D0, & 'Plasma inboard radius (m)') - case ('rpf2dewar') - call parse_real_variable('rpf2dewar', rpf2dewar, 0.1D0, 5.0D0, & + case ('rpf2dewar') + call parse_real_variable('rpf2dewar', rpf2dewar, 0.1D0, 5.0D0, & 'Outer PF coil to cryostat distance (m)') - case ('i_r_cp_top') - call parse_int_variable('i_r_cp_top', i_r_cp_top, 0, 2, & + case ('i_r_cp_top') + call parse_int_variable('i_r_cp_top', i_r_cp_top, 0, 2, & 'Switch selecting the parametrization of the TF CP top radius (ST only)') - case ('r_cp_top') - call parse_real_variable('r_cp_top', r_cp_top, 0.0010D0, 10.0D0, & - 'Top CP outer radius (ST only) (m)') - case ('f_r_cp') - call parse_real_variable('f_r_cp', f_r_cp, 1.0D0, 100.0D0, & - 'Ratio between the top and the midplane TF CP outer radius (-) ') - case ('scrapli') - call parse_real_variable('scrapli', scrapli, 0.0D0, 10.0D0, & + case ('r_cp_top') + call parse_real_variable('r_cp_top', r_cp_top, 0.0010D0, 10.0D0, & + 'Top CP outer radius (ST only) (m)') + case ('f_r_cp') + call parse_real_variable('f_r_cp', f_r_cp, 1.0D0, 100.0D0, & + 'Ratio between the top and the midplane TF CP outer radius (-) ') + case ('scrapli') + call parse_real_variable('scrapli', scrapli, 0.0D0, 10.0D0, & 'Inboard scrapeoff length (m)') - case ('scraplo') - call parse_real_variable('scraplo', scraplo, 0.0D0, 10.0D0, & + case ('scraplo') + call parse_real_variable('scraplo', scraplo, 0.0D0, 10.0D0, & 'Outboard scrapeoff length (m)') - case ('shldith') - call parse_real_variable('shldith', shldith, 0.0D0, 10.0D0, & + case ('shldith') + call parse_real_variable('shldith', shldith, 0.0D0, 10.0D0, & 'Inboard shield thickness (m)') - case ('shldlth') - call parse_real_variable('shldlth', shldlth, 0.0D0, 10.0D0, & + case ('shldlth') + call parse_real_variable('shldlth', shldlth, 0.0D0, 10.0D0, & 'Lower (divertor) shield thickness (m)') - case ('shldoth') - call parse_real_variable('shldoth', shldoth, 0.0D0, 10.0D0, & + case ('shldoth') + call parse_real_variable('shldoth', shldoth, 0.0D0, 10.0D0, & 'Outboard shield thickness (m)') - case ('shldtth') - call parse_real_variable('shldtth', shldtth, 0.0D0, 10.0D0, & + case ('shldtth') + call parse_real_variable('shldtth', shldtth, 0.0D0, 10.0D0, & 'Top shield thickness (m)') - case ('sigallpc') - call parse_real_variable('sigallpc', sigallpc, 0.0D1, 1.0D9, & + case ('sigallpc') + call parse_real_variable('sigallpc', sigallpc, 0.0D1, 1.0D9, & 'Allowable stress in CS pre-comp structure (Pa)') - ! Issue #514 Make tfcth an output not an input or iteration variable: - ! Eventually this input will be removed. - case ('tfcth') - call parse_real_variable('tfcth', tfcth, 0.0D0, 10.0D0, & + ! Issue #514 Make tfcth an output not an input or iteration variable: + ! Eventually this input will be removed. + case ('tfcth') + call parse_real_variable('tfcth', tfcth, 0.0D0, 10.0D0, & 'TF coil thickness (m)') - case ('dr_tf_wp') - call parse_real_variable('dr_tf_wp', dr_tf_wp, 0.0D0, 10.0D0, & + case ('dr_tf_wp') + call parse_real_variable('dr_tf_wp', dr_tf_wp, 0.0D0, 10.0D0, & 'TF coil winding pack radial thickness (m)') - case ('tfootfi') - call parse_real_variable('tfootfi', tfootfi, 0.2D0, 5.0D0, & + case ('tfootfi') + call parse_real_variable('tfootfi', tfootfi, 0.2D0, 5.0D0, & 'TFC outboard/inboard leg thickness') - case ('tftsgap') - call parse_real_variable('tftsgap', tftsgap, 0.0D0, 5.0D0, & + case ('tftsgap') + call parse_real_variable('tftsgap', tftsgap, 0.0D0, 5.0D0, & 'Minimum gap between TF and thermal shield for manufacturing etc. (m)') - case ('thshield_ib') - call parse_real_variable('thshield_ib', thshield_ib, 0.0D0, 10.0D0, & + case ('thshield_ib') + call parse_real_variable('thshield_ib', thshield_ib, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, inboard (m)') - case ('thshield_ob') - call parse_real_variable('thshield_ob', thshield_ob, 0.0D0, 10.0D0, & + case ('thshield_ob') + call parse_real_variable('thshield_ob', thshield_ob, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, outboard (m)') - case ('thshield_vb') - call parse_real_variable('thshield_vb', thshield_vb, 0.0D0, 10.0D0, & + case ('thshield_vb') + call parse_real_variable('thshield_vb', thshield_vb, 0.0D0, 10.0D0, & 'TF/VV thermal shield thickness, vertical build (m)') - case ('vgap') - call parse_real_variable('vgap', vgap, 0.0D0, 10.0D0, & + case ('vgap') + call parse_real_variable('vgap', vgap, 0.0D0, 10.0D0, & 'Vert gap between x-pnt and divertor (m)') - case ('vgap2') - call parse_real_variable('vgap2', vgap2, 0.0D0, 10.0D0, & + case ('vgap2') + call parse_real_variable('vgap2', vgap2, 0.0D0, 10.0D0, & 'Vert gap between TF coil and shield (m)') - case ('vgaptop') - call parse_real_variable('vgaptop', vgaptop, 0.0D0, 10.0D0, & + case ('vgaptop') + call parse_real_variable('vgaptop', vgaptop, 0.0D0, 10.0D0, & 'Top vert gap between plasma and first wall (m)') - case ('vvblgap') - call parse_real_variable('vvblgap', vvblgap, 0.0D0, 5.0D0, & + case ('vvblgap') + call parse_real_variable('vvblgap', vvblgap, 0.0D0, 5.0D0, & 'Gap between vacuum vessel and blanket (m)') - ! TF coil settings + ! TF coil settings - case ('bcritsc') - call parse_real_variable('bcritsc', bcritsc, 10.0D0, 50.0D0, & + case ('bcritsc') + call parse_real_variable('bcritsc', bcritsc, 10.0D0, 50.0D0, & 'Critical field for superconductor') - case ('tape_width') - call parse_real_variable('tape_width', tape_width, 0.0D0, 0.1D0, & + case ('tape_width') + call parse_real_variable('tape_width', tape_width, 0.0D0, 0.1D0, & 'Mean width of HTS tape (m)') - case ('tape_thickness') - call parse_real_variable('tape_thickness', tape_thickness, 0.0D0, 0.1D0, & + case ('tape_thickness') + call parse_real_variable('tape_thickness', tape_thickness, 0.0D0, 0.1D0, & 'Thickness of HTS tape (m)') - case ('rebco_thickness') - call parse_real_variable('rebco_thickness', rebco_thickness, 0.01D-6, 100.0D-6, & + case ('rebco_thickness') + call parse_real_variable('rebco_thickness', rebco_thickness, 0.01D-6, 100.0D-6, & 'Thickness of REBCO layer in HTS tape (m)') - if (rebco_thickness > 1.0D-6) then - ! Warning includes concerns raised on Issue #1494 - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'WARNING: the relationship between REBCO layer thickness and current density is not linear.' - write(outfile,*) 'REBCO layer thicknesses > 1um should be considered an aggressive extrapolation of' - write(outfile,*) 'current HTS technology and any results must be considered speculative.' - write(outfile,*) '**********' - write(outfile,*) ' ' - end if - case ('hastelloy_thickness') - call parse_real_variable('hastelloy_thickness', hastelloy_thickness, 0.01D-6, 1000.0D-6, & + if (rebco_thickness > 1.0D-6) then + ! Warning includes concerns raised on Issue #1494 + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'WARNING: the relationship between REBCO layer thickness and current density is not linear.' + write(outfile,*) 'REBCO layer thicknesses > 1um should be considered an aggressive extrapolation of' + write(outfile,*) 'current HTS technology and any results must be considered speculative.' + write(outfile,*) '**********' + write(outfile,*) ' ' + end if + case ('hastelloy_thickness') + call parse_real_variable('hastelloy_thickness', hastelloy_thickness, 0.01D-6, 1000.0D-6, & 'Thickness of Hastelloy layer in HTS tape (m)') - ! case ('croco_id') - ! call parse_real_variable('croco_id', croco_id, 0.0D0, 0.1D0, & - ! 'croco_id') - ! case ('croco_od') - ! call parse_real_variable('croco_od', croco_od, 0.0D0, 0.1D0, & - ! 'Outer diameter of CroCo strand (m)') - case ('croco_thick') - call parse_real_variable('croco_thick', croco_thick, 0.001D0, 0.1D0, & + ! case ('croco_id') + ! call parse_real_variable('croco_id', croco_id, 0.0D0, 0.1D0, & + ! 'croco_id') + ! case ('croco_od') + ! call parse_real_variable('croco_od', croco_od, 0.0D0, 0.1D0, & + ! 'Outer diameter of CroCo strand (m)') + case ('croco_thick') + call parse_real_variable('croco_thick', croco_thick, 0.001D0, 0.1D0, & 'Thickness of CroCo copper tube (m)') - case ('copper_thick') - call parse_real_variable('copper_thick', copper_thick, 0.0D0, 1000.0D-6, & + case ('copper_thick') + call parse_real_variable('copper_thick', copper_thick, 0.0D0, 1000.0D-6, & 'copper_thick (m)') - ! case ('copper_bar') - ! call parse_real_variable('copper_bar', copper_bar, 0.0D0, 0.9D0, & - ! 'area of central copper bar, as a fraction of area inside the jacket') - case ('copper_rrr') - call parse_real_variable('copper_rrr', copper_rrr, 1.0D0, 1.0D4, & + ! case ('copper_bar') + ! call parse_real_variable('copper_bar', copper_bar, 0.0D0, 0.9D0, & + ! 'area of central copper bar, as a fraction of area inside the jacket') + case ('copper_rrr') + call parse_real_variable('copper_rrr', copper_rrr, 1.0D0, 1.0D4, & 'residual resistivity ratio copper in TF superconducting cable') - case ('coppera_m2_max') - call parse_real_variable('coppera_m2_max', copperA_m2_max, 1.0D6, 1.0D10, & + case ('coppera_m2_max') + call parse_real_variable('coppera_m2_max', copperA_m2_max, 1.0D6, 1.0D10, & 'Maximum TF coil current / copper area (A/m2)') - case ('f_coppera_m2') - call parse_real_variable('f_coppera_m2', f_coppera_m2, 1.0D-3, 1.0D1, & + case ('f_coppera_m2') + call parse_real_variable('f_coppera_m2', f_coppera_m2, 1.0D-3, 1.0D1, & 'f-value for constraint 75: TF coil current / copper area < copperA_m2_max') - case ('casthi') - call parse_real_variable('casthi', casthi, 0.0D0, 1.0D0, & + case ('casthi') + call parse_real_variable('casthi', casthi, 0.0D0, 1.0D0, & 'TF coil case inner thickness (m)') - ! OR - case ('casthi_fraction') - call parse_real_variable('casthi_fraction', casthi_fraction, 0.0D0, 1.0D0, & + ! OR + case ('casthi_fraction') + call parse_real_variable('casthi_fraction', casthi_fraction, 0.0D0, 1.0D0, & 'inboard TF coil case plasma side thickness as a fraction of tfcth') - ! Use EITHER - case ('casths') - call parse_real_variable('casths', casths, 0.0D0, 1.0D0, & + ! Use EITHER + case ('casths') + call parse_real_variable('casths', casths, 0.0D0, 1.0D0, & 'TF coil case sidewall thickness (m)') - ! OR - case ('casths_fraction') - call parse_real_variable('casths_fraction', casths_fraction, 0.0D0, 1.0D0, & + ! OR + case ('casths_fraction') + call parse_real_variable('casths_fraction', casths_fraction, 0.0D0, 1.0D0, & 'inboard TF coil sidewall case thickness as a fraction of tftort') - case ('cpttf') - call parse_real_variable('cpttf', cpttf, 0.001D0, 1.0D6, & + case ('cpttf') + call parse_real_variable('cpttf', cpttf, 0.001D0, 1.0D6, & 'TF coil leg current per turn (A)') - case ('cpttf_max') - call parse_real_variable('cpttf_max', cpttf_max, 1.0D0, 1.0D6, & - 'Maximum allowable TF coil leg current per turn (A) (constraint equation 77)') + case ('cpttf_max') + call parse_real_variable('cpttf_max', cpttf_max, 1.0D0, 1.0D6, & + 'Maximum allowable TF coil leg current per turn (A) (constraint equation 77)') - case ('sig_tf_case_max') - call parse_real_variable('sig_tf_case_max', sig_tf_case_max, 1.0D6, 1.0D11, & + case ('sig_tf_case_max') + call parse_real_variable('sig_tf_case_max', sig_tf_case_max, 1.0D6, 1.0D11, & 'Allowable maximum shear stress in TF coil case (Tresca criterion) (Pa)') - case ('sig_tf_wp_max') - call parse_real_variable('sig_tf_wp_max', sig_tf_wp_max, 1.0D6, 1.0D11, & + case ('sig_tf_wp_max') + call parse_real_variable('sig_tf_wp_max', sig_tf_wp_max, 1.0D6, 1.0D11, & 'Allowable maximum shear stress in TF coil conduit (Tresca criterion) (Pa)') - case ('alstroh') - call parse_real_variable('alstroh', alstroh, 1.0D6, 1.0D11, & + case ('alstroh') + call parse_real_variable('alstroh', alstroh, 1.0D6, 1.0D11, & 'Allowable hoop stress in Central Solenoid structural material (Pa)') - case ('i_cs_stress') - call parse_int_variable('i_cs_stress', i_cs_stress, 0, 1, & + case ('i_cs_stress') + call parse_int_variable('i_cs_stress', i_cs_stress, 0, 1, & 'Switch for CS stress calculation') - case ('dcase') - call parse_real_variable('dcase', dcase, 1.0D3, 1.0D5, & + case ('dcase') + call parse_real_variable('dcase', dcase, 1.0D3, 1.0D5, & 'Density of TF coil case (kg/m3)') - case ('dcond') - call parse_real_array('dcond', dcond, isub1, 9, & + case ('dcond') + call parse_real_array('dcond', dcond, isub1, 9, & 'TF/PF coil superconductor density (kg/m3)', icode) - case ('dcondins') - call parse_real_variable('dcondins', dcondins, 5.0D2, 1.0D4, & + case ('dcondins') + call parse_real_variable('dcondins', dcondins, 5.0D2, 1.0D4, & 'Density of TF coil insulation (kg/m3)') - case ('dcopper') - call parse_real_variable('dcopper', dcopper, 8.0D3, 1.0D4, & + case ('dcopper') + call parse_real_variable('dcopper', dcopper, 8.0D3, 1.0D4, & 'Density of copper (kg/m3)') - case ('dalu') - call parse_real_variable('dalu', dalu, 2.5D3, 3.0D4, & + case ('dalu') + call parse_real_variable('dalu', dalu, 2.5D3, 3.0D4, & 'Density of Alumium (kg/m3)') - case ('dhecoil') - call parse_real_variable('dhecoil', dhecoil, 0.0d0, 0.1d0, & + case ('dhecoil') + call parse_real_variable('dhecoil', dhecoil, 0.0d0, 0.1d0, & 'Diameter of He coil in TF winding (m)') - case ('drtop') - call parse_real_variable('drtop', drtop, -1.5D0, 1.5D0, & + case ('drtop') + call parse_real_variable('drtop', drtop, -1.5D0, 1.5D0, & 'ST CP top radius adjust (m)') - case ('dztop') - call parse_real_variable('dztop', dztop, -0.5D0, 0.5D0, & + case ('dztop') + call parse_real_variable('dztop', dztop, -0.5D0, 0.5D0, & 'ST CP taper height adjust (m)') - case ('etapump') - call parse_real_variable('etapump', etapump, 0.0D0, 1.0D0, & + case ('etapump') + call parse_real_variable('etapump', etapump, 0.0D0, 1.0D0, & 'Efficiency of c/p coolant pump') - case ('eyoung_steel') - call parse_real_variable('eyoung_steel', eyoung_steel, 1.0D8, 1.0D13, & + case ('eyoung_steel') + call parse_real_variable('eyoung_steel', eyoung_steel, 1.0D8, 1.0D13, & 'Steel case Youngs Modulus (Pa)') - case ('eyoung_ins') - call parse_real_variable('eyoung_ins', eyoung_ins, 1.0D8, 1.0D13, & + case ('eyoung_ins') + call parse_real_variable('eyoung_ins', eyoung_ins, 1.0D8, 1.0D13, & 'Insulator Youngs Modulus (Pa)') - case ('eyoung_cond_axial') - call parse_real_variable('eyoung_cond_axial', eyoung_cond_axial, 0.0D0, 1.0D13, & + case ('eyoung_cond_axial') + call parse_real_variable('eyoung_cond_axial', eyoung_cond_axial, 0.0D0, 1.0D13, & 'SC TF coil Youngs Modulus, axial (Pa)') - case ('eyoung_cond_trans') - call parse_real_variable('eyoung_cond_trans', eyoung_cond_trans, 0.0D0, 1.0D13, & + case ('eyoung_cond_trans') + call parse_real_variable('eyoung_cond_trans', eyoung_cond_trans, 0.0D0, 1.0D13, & 'SC TF coil Youngs Modulus, transverse (Pa)') - case ('eyoung_al') - call parse_real_variable('eyoung_al', eyoung_al, 0.0D0, 1.0D0, & + case ('eyoung_al') + call parse_real_variable('eyoung_al', eyoung_al, 0.0D0, 1.0D0, & 'Reinforced aluminium Young modulus for TF stress calc.') - case ('eyoung_res_tf_buck') - call parse_real_variable('eyoung_res_tf_buck', eyoung_res_tf_buck, 1.0D-10, 1.0D12, & + case ('eyoung_res_tf_buck') + call parse_real_variable('eyoung_res_tf_buck', eyoung_res_tf_buck, 1.0D-10, 1.0D12, & 'Reinforced aluminium Young modulus for TF stress calc.') - case ('farc4tf') - call parse_real_variable('farc4tf', farc4tf, 0.0D0, 1.0D0, & + case ('farc4tf') + call parse_real_variable('farc4tf', farc4tf, 0.0D0, 1.0D0, & 'TF coil shape parameter') - case ('t_crit_nbti') - call parse_real_variable('t_crit_nbti ', t_crit_nbti , 0.0D0, 15.0D0, & + case ('t_crit_nbti') + call parse_real_variable('t_crit_nbti ', t_crit_nbti , 0.0D0, 15.0D0, & 'Critical temperature of GL_nbti ') - case ('b_crit_upper_nbti') - call parse_real_variable('b_crit_upper_nbti', b_crit_upper_nbti, 0.0D0, 30.0D0, & - 'Upper critical field of GL_nbti ') - case ('fcoolcp') - call parse_real_variable('fcoolcp', fcoolcp, 0.0D0, 1.0D0, & + case ('b_crit_upper_nbti') + call parse_real_variable('b_crit_upper_nbti', b_crit_upper_nbti, 0.0D0, 30.0D0, & + 'Upper critical field of GL_nbti ') + case ('fcoolcp') + call parse_real_variable('fcoolcp', fcoolcp, 0.0D0, 1.0D0, & 'Coolant fraction of TF centrepost (itart=1) or the whole magnet (itart=0)') - case ('fcoolleg') - call parse_real_variable('fcoolleg', fcoolleg, 0.0D0, 1.0D0, & + case ('fcoolleg') + call parse_real_variable('fcoolleg', fcoolleg, 0.0D0, 1.0D0, & 'Coolant fraction of TF outboard leg (itart=1 only)') - case ('fcutfsu') - call parse_real_variable('fcutfsu', fcutfsu, 0.0D0, 1.0D0, & + case ('fcutfsu') + call parse_real_variable('fcutfsu', fcutfsu, 0.0D0, 1.0D0, & 'Cu fraction of SCTF cable conductor') - case ('fhts') - call parse_real_variable('fhts', fhts, 0.01D0, 1.0D0, & + case ('fhts') + call parse_real_variable('fhts', fhts, 0.01D0, 1.0D0, & 'Technology adjustment factor for Bi-2212 HTS') - case ('frhocp') - call parse_real_variable('frhocp', frhocp, 0.01D0, 5.0D0, & + case ('frhocp') + call parse_real_variable('frhocp', frhocp, 0.01D0, 5.0D0, & 'Centrepost (itart=1) or global (itart=0) resistivity enhancement factor') - case ('frholeg') - call parse_real_variable('frholeg', frholeg, 0.01D0, 5.0D0, & + case ('frholeg') + call parse_real_variable('frholeg', frholeg, 0.01D0, 5.0D0, & 'TART outboard leg resistivity enhancement factor') - case ('rho_tf_joints') - call parse_real_variable('rho_tf_joints', rho_tf_joints, 0.0D0, 1.0D-2, & + case ('rho_tf_joints') + call parse_real_variable('rho_tf_joints', rho_tf_joints, 0.0D0, 1.0D-2, & 'TF joints surfacic resistivity') - case ('i_cp_joints') - call parse_int_variable('i_cp_joints', i_cp_joints, 0, 1, & + case ('i_cp_joints') + call parse_int_variable('i_cp_joints', i_cp_joints, 0, 1, & 'Switch for CP demoutable joints type') - case ('th_joint_contact') - call parse_real_variable('th_joint_contact', th_joint_contact, 0.0D0, 1.0D0, & + case ('th_joint_contact') + call parse_real_variable('th_joint_contact', th_joint_contact, 0.0D0, 1.0D0, & 'TF sliding joints contact pad width') - case ('n_tf_joints_contact') - call parse_int_variable('n_tf_joints_contact', n_tf_joints_contact, 1, 50, & + case ('n_tf_joints_contact') + call parse_int_variable('n_tf_joints_contact', n_tf_joints_contact, 1, 50, & 'Number of contact per sliding joint') - case ('n_tf_joints') - call parse_int_variable('n_tf_joints', n_tf_joints, 1, 50, & + case ('n_tf_joints') + call parse_int_variable('n_tf_joints', n_tf_joints, 1, 50, & 'Number of joints per turn') - case ('eff_tf_cryo') - call parse_real_variable('eff_tf_cryo', eff_tf_cryo, 0.0D0, 1.0D0, & + case ('eff_tf_cryo') + call parse_real_variable('eff_tf_cryo', eff_tf_cryo, 0.0D0, 1.0D0, & 'TF coil cryo-plane efficiency') - case ('i_tf_stress_model') - call parse_int_variable('i_tf_stress_model', i_tf_stress_model, 0, 2, & + case ('i_tf_stress_model') + call parse_int_variable('i_tf_stress_model', i_tf_stress_model, 0, 2, & 'Switch for the TF stress model') - case ('i_tf_tresca') - call parse_int_variable('i_tf_tresca', i_tf_tresca, 0, 1, & - 'Switch for TF coil Tresca criterion') - case ('i_tf_wp_geom') - call parse_int_variable('i_tf_wp_geom', i_tf_wp_geom, 0, 2, & - 'Switch for TF WP geometry selection') - case ('i_tf_case_geom') - call parse_int_variable('i_tf_case_geom', i_tf_case_geom, 0, 1, & - 'Switch for TF case geometry selection') - case ('i_tf_turns_integer') - call parse_int_variable('i_tf_turns_integer', i_tf_turns_integer, 0, 1, & - 'Switch for TF coil integer/non-integer turns') - case ('i_tf_bucking') - call parse_int_variable('i_tf_bucking', i_tf_bucking, 0, 3, & + case ('i_tf_tresca') + call parse_int_variable('i_tf_tresca', i_tf_tresca, 0, 1, & + 'Switch for TF coil Tresca criterion') + case ('i_tf_wp_geom') + call parse_int_variable('i_tf_wp_geom', i_tf_wp_geom, 0, 2, & + 'Switch for TF WP geometry selection') + case ('i_tf_case_geom') + call parse_int_variable('i_tf_case_geom', i_tf_case_geom, 0, 1, & + 'Switch for TF case geometry selection') + case ('i_tf_turns_integer') + call parse_int_variable('i_tf_turns_integer', i_tf_turns_integer, 0, 1, & + 'Switch for TF coil integer/non-integer turns') + case ('i_tf_bucking') + call parse_int_variable('i_tf_bucking', i_tf_bucking, 0, 3, & 'Switch for bucking cylinder (case)') - case ('i_tf_sc_mat') - call parse_int_variable('i_tf_sc_mat', i_tf_sc_mat, 1, 9, & + case ('i_tf_sc_mat') + call parse_int_variable('i_tf_sc_mat', i_tf_sc_mat, 1, 9, & 'TF coil superconductor material') - if (i_tf_sc_mat == 2) then - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'Warning if you are using an old input file:' - write(outfile,*) 'i_tf_sc_mat=2 usage has changed -' - write(outfile,*) 'please check validity!' - write(outfile,*) '**********' - write(outfile,*) ' ' - end if - case ('itfmod') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'ITFMOD is now obsolete -' - write(outfile,*) 'please remove it from the input file' - ! write(outfile,*) 'and replace it with TFC_MODEL' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('i_tf_sup') - call parse_int_variable('i_tf_sup', i_tf_sup, 0, 2, & + if (i_tf_sc_mat == 2) then + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'Warning if you are using an old input file:' + write(outfile,*) 'i_tf_sc_mat=2 usage has changed -' + write(outfile,*) 'please check validity!' + write(outfile,*) '**********' + write(outfile,*) ' ' + end if + case ('itfmod') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'ITFMOD is now obsolete -' + write(outfile,*) 'please remove it from the input file' + ! write(outfile,*) 'and replace it with TFC_MODEL' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('i_tf_sup') + call parse_int_variable('i_tf_sup', i_tf_sup, 0, 2, & 'Switch for TF coil type') - case ('i_tf_shape') - call parse_int_variable('i_tf_shape', i_tf_shape, 0, 2, & - 'Switch for TF coil shape') - case ('i_tf_cond_eyoung_axial') - call parse_int_variable('i_tf_cond_eyoung_axial', i_tf_cond_eyoung_axial, 0, 2, & - 'Switch for the behavior of the TF coil conductor elastic axial properties') - case ('i_tf_cond_eyoung_trans') - call parse_int_variable('i_tf_cond_eyoung_trans', i_tf_cond_eyoung_trans, 0, 1, & - 'Switch for the TF coil conductor transverse behavior') - case ('i_str_wp') - call parse_int_variable('i_str_wp', i_str_wp, 0, 1, & - 'Switch for the TF coil strain behavior') - case ('jbus') - call parse_real_variable('jbus', jbus, 1.0D4, 1.0D8, & + case ('i_tf_shape') + call parse_int_variable('i_tf_shape', i_tf_shape, 0, 2, & + 'Switch for TF coil shape') + case ('i_tf_cond_eyoung_axial') + call parse_int_variable('i_tf_cond_eyoung_axial', i_tf_cond_eyoung_axial, 0, 2, & + 'Switch for the behavior of the TF coil conductor elastic axial properties') + case ('i_tf_cond_eyoung_trans') + call parse_int_variable('i_tf_cond_eyoung_trans', i_tf_cond_eyoung_trans, 0, 1, & + 'Switch for the TF coil conductor transverse behavior') + case ('i_str_wp') + call parse_int_variable('i_str_wp', i_str_wp, 0, 1, & + 'Switch for the TF coil strain behavior') + case ('jbus') + call parse_real_variable('jbus', jbus, 1.0D4, 1.0D8, & 'TF coil bus current density (A/m2)') - case ('jcrit_model') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'JCRIT_MODEL is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('jcritsc') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'JCRITSC is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('n_pancake') - call parse_int_variable('n_pancake', n_pancake, 1, 100, & + case ('jcrit_model') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'JCRIT_MODEL is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('jcritsc') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'JCRITSC is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('n_pancake') + call parse_int_variable('n_pancake', n_pancake, 1, 100, & 'Number of pancakes in TF coil (i_tf_turns_integer=1)') - case ('n_layer') - call parse_int_variable('n_layer', n_layer, 1, 100, & + case ('n_layer') + call parse_int_variable('n_layer', n_layer, 1, 100, & 'Number of layers in TF coil (i_tf_turns_integer=1)') - case ('n_tf_graded_layers') - call parse_int_variable('n_tf_graded_layers', n_tf_graded_layers, 1, 20, & + case ('n_tf_graded_layers') + call parse_int_variable('n_tf_graded_layers', n_tf_graded_layers, 1, 20, & 'Number of layers of different stress properties in the WP') - case ('n_rad_per_layer') - call parse_int_variable('n_rad_per_layer', n_rad_per_layer, 1, 500, & + case ('n_rad_per_layer') + call parse_int_variable('n_rad_per_layer', n_rad_per_layer, 1, 500, & 'Size of the arrays per layers storing the radial dependent stress ') - case ('oacdcp') - call parse_real_variable('oacdcp', oacdcp, 1.0D4, 1.0D9, & + case ('oacdcp') + call parse_real_variable('oacdcp', oacdcp, 1.0D4, 1.0D9, & 'Overall J in inboard TF coil midplane') - case ('poisson_steel') - call parse_real_variable('poisson_steel', poisson_steel, 0.0D0, 1.0D0, & + case ('poisson_steel') + call parse_real_variable('poisson_steel', poisson_steel, 0.0D0, 1.0D0, & 'Steel Poissons ratio for TF stress calc.') - case ('poisson_copper') - call parse_real_variable('poisson_copper', poisson_copper, 0.0D0, 1.0D0, & + case ('poisson_copper') + call parse_real_variable('poisson_copper', poisson_copper, 0.0D0, 1.0D0, & 'Steel Poissons ratio for TF stress calc.') - case ('poisson_al') - call parse_real_variable('poisson_al', poisson_al, 0.0D0, 1.0D0, & + case ('poisson_al') + call parse_real_variable('poisson_al', poisson_al, 0.0D0, 1.0D0, & 'Aluminium Poissons ratio for TF stress calc.') - case ('ptempalw') - call parse_real_variable('ptempalw', ptempalw, 4.0D0, 573.15D0, & + case ('ptempalw') + call parse_real_variable('ptempalw', ptempalw, 4.0D0, 573.15D0, & 'Maximum peak centrepost temp. (K)') - case ('rcool') - call parse_real_variable('rcool', rcool, 1.0D-6, 1.0D0, & + case ('rcool') + call parse_real_variable('rcool', rcool, 1.0D-6, 1.0D0, & 'Centrepost coolant channel radius') - case ('ripmax') - call parse_real_variable('ripmax', ripmax, 0.1D0, 100.0D0, & + case ('ripmax') + call parse_real_variable('ripmax', ripmax, 0.1D0, 100.0D0, & 'Max allowed ripple ampl. at plasma edge (%)') - case ('sigvvall') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'sigvvall is now obsolete - (use max_vv_stress)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('theta1_coil') - call parse_real_variable('theta1_coil', theta1_coil, 1.0D-1, 6.0D1, & + case ('sigvvall') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'sigvvall is now obsolete - (use max_vv_stress)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('theta1_coil') + call parse_real_variable('theta1_coil', theta1_coil, 1.0D-1, 6.0D1, & 'The angle of the outboard arc forming the TF coil current center line (deg)') - case ('theta1_vv') - call parse_real_variable('theta1_vv', theta1_vv, 1.0D-1, 6.0D1, & + case ('theta1_vv') + call parse_real_variable('theta1_vv', theta1_vv, 1.0D-1, 6.0D1, & 'The angle of the outboard arc forming the VV current center line (deg)') - case ('max_vv_stress') - call parse_real_variable('max_vv_stress', max_vv_stress, 0.1D6, 500.0D6, & + case ('max_vv_stress') + call parse_real_variable('max_vv_stress', max_vv_stress, 0.1D6, 500.0D6, & 'The maximum shear stress that the Vacuum Vessel should experience (Pa)') - case ('str_cs_con_res') - call parse_real_variable('str_cs_con_res', str_cs_con_res, -0.02D0, 0.02D0, & + case ('str_cs_con_res') + call parse_real_variable('str_cs_con_res', str_cs_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in CS superconductor material') - case ('str_pf_con_res') - call parse_real_variable('str_pf_con_res', str_pf_con_res, -0.02D0, 0.02D0, & + case ('str_pf_con_res') + call parse_real_variable('str_pf_con_res', str_pf_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in PF superconductor material') - case ('str_tf_con_res') - call parse_real_variable('str_tf_con_res', str_tf_con_res, -0.02D0, 0.02D0, & + case ('str_tf_con_res') + call parse_real_variable('str_tf_con_res', str_tf_con_res, -0.02D0, 0.02D0, & 'Residual manufacturing strain in TF superconductor material') - case ('str_wp_max') - call parse_real_variable('str_wp_max', str_wp_max, 0.0D0, 0.3D0, & + case ('str_wp_max') + call parse_real_variable('str_wp_max', str_wp_max, 0.0D0, 0.3D0, & 'Maximum allowed absolute value of the strain in the TF coil') - case ('tcoolin') - call parse_real_variable('tcoolin', tcoolin, 4.0D0, 373.15D0, & + case ('tcoolin') + call parse_real_variable('tcoolin', tcoolin, 4.0D0, 373.15D0, & 'Centrepost coolant inlet temperature (K)') - case ('tcpav') - call parse_real_variable('tcpav', tcpav, 4.0D0, 573.15D0, & + case ('tcpav') + call parse_real_variable('tcpav', tcpav, 4.0D0, 573.15D0, & 'Average centrepost coolant temperature (K)') - case ('tcritsc') - call parse_real_variable('tcritsc', tcritsc, 1.0D0, 300.0D0, & + case ('tcritsc') + call parse_real_variable('tcritsc', tcritsc, 1.0D0, 300.0D0, & 'Critical temperature for superconductor') - case ('tdmptf') - call parse_real_variable('tdmptf', tdmptf, 0.1D0, 100.0D0, & + case ('tdmptf') + call parse_real_variable('tdmptf', tdmptf, 0.1D0, 100.0D0, & 'Dump time for TF coil (s)') - ! case ('tfc_model') - ! call parse_int_variable('tfc_model', tfc_model, 0, 1, & - ! 'Switch for TF coil model') - case ('tfinsgap') - call parse_real_variable('tfinsgap', tfinsgap, 1.0D-10, 1.0D-1, & + ! case ('tfc_model') + ! call parse_int_variable('tfc_model', tfc_model, 0, 1, & + ! 'Switch for TF coil model') + case ('tfinsgap') + call parse_real_variable('tfinsgap', tfinsgap, 1.0D-10, 1.0D-1, & 'TF coil WP insertion gap (m)') - case ('rhotfbus') - call parse_real_variable('rhotfbus', rhotfbus, 0.0D0, 1.0D-5, & + case ('rhotfbus') + call parse_real_variable('rhotfbus', rhotfbus, 0.0D0, 1.0D-5, & 'TF coil bus (feeders) resistivity (ohm-m)') - case ('n_tf') - call parse_real_variable('n_tf', n_tf, 0.0D0, 100.0D0, & + case ('n_tf') + call parse_real_variable('n_tf', n_tf, 0.0D0, 100.0D0, & 'Number of TF coils') - case ('n_tf_turn') - call parse_real_variable('n_tf_turn', n_tf_turn, 0.0D0, 100.0D0, & + case ('n_tf_turn') + call parse_real_variable('n_tf_turn', n_tf_turn, 0.0D0, 100.0D0, & 'number of turns per TF coil') - case ('tftmp') - call parse_real_variable('tftmp', tftmp, 0.01D0, 293.0D0, & + case ('tftmp') + call parse_real_variable('tftmp', tftmp, 0.01D0, 293.0D0, & 'Peak TF coil He coolant temp. (K)') - case ('t_turn_tf') - call parse_real_variable('t_turn_tf', t_turn_tf, 0.0D0, 0.1D0, & + case ('t_turn_tf') + call parse_real_variable('t_turn_tf', t_turn_tf, 0.0D0, 0.1D0, & 'TF turn square dimensions (m)') - case ('f_t_turn_tf') - call parse_real_variable('f_t_turn_tf', f_t_turn_tf, 0.0D0, 1.D0, & - 'f-value for TF coils WP trurn squared dimension constraint') - case ('t_turn_tf_max') - call parse_real_variable('t_turn_tf_max', t_turn_tf_max, 0.0D0, 1.D0, & - 'TF coils WP turn squared dimension upper limit (m)') - case ('t_cable_tf') - call parse_real_variable('t_cable_tf', t_cable_tf, 0.0D0, 0.1D0, & + case ('f_t_turn_tf') + call parse_real_variable('f_t_turn_tf', f_t_turn_tf, 0.0D0, 1.D0, & + 'f-value for TF coils WP trurn squared dimension constraint') + case ('t_turn_tf_max') + call parse_real_variable('t_turn_tf_max', t_turn_tf_max, 0.0D0, 1.D0, & + 'TF coils WP turn squared dimension upper limit (m)') + case ('t_cable_tf') + call parse_real_variable('t_cable_tf', t_cable_tf, 0.0D0, 0.1D0, & 'TF coil cable square/rounded dimensions (m)') - case ('thicndut') - call parse_real_variable('thicndut', thicndut, 0.0D0, 0.1D0, & + case ('thicndut') + call parse_real_variable('thicndut', thicndut, 0.0D0, 0.1D0, & 'Conduit insulation thickness (m)') - case ('layer_ins') - call parse_real_variable('layer_ins', layer_ins, 0.0D0, 0.1D0, & + case ('layer_ins') + call parse_real_variable('layer_ins', layer_ins, 0.0D0, 0.1D0, & 'Additional insulation thickness between layers (m)') - case ('thkcas') - call parse_real_variable('thkcas', thkcas, 0.0D0, 1.0D0, & + case ('thkcas') + call parse_real_variable('thkcas', thkcas, 0.0D0, 1.0D0, & 'External supercond. case thickness (m)') - case ('thwcndut') - call parse_real_variable('thwcndut', thwcndut, 0.0D0, 0.1D0, & + case ('thwcndut') + call parse_real_variable('thwcndut', thwcndut, 0.0D0, 0.1D0, & 'TF coil conduit case thickness (m)') - case ('tinstf') - call parse_real_variable('tinstf', tinstf, 0.0D0, 0.1D0, & + case ('tinstf') + call parse_real_variable('tinstf', tinstf, 0.0D0, 0.1D0, & 'Ground wall insulation thickness (m)') - case ('tmargmin_tf') - call parse_real_variable('tmargmin_tf', tmargmin_tf, 0.0D0, 20.0D0, & + case ('tmargmin_tf') + call parse_real_variable('tmargmin_tf', tmargmin_tf, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: TF coil (K)') - case ('tmargmin_cs') - call parse_real_variable('tmargmin_cs', tmargmin_cs, 0.0D0, 20.0D0, & + case ('tmargmin_cs') + call parse_real_variable('tmargmin_cs', tmargmin_cs, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: CS (K)') - case ('tmargmin') - call parse_real_variable('tmargmin', tmargmin, 0.0D0, 20.0D0, & + case ('tmargmin') + call parse_real_variable('tmargmin', tmargmin, 0.0D0, 20.0D0, & 'Minimum allowable temp margin: TFC AND CS (K)') - case ('tmaxpro') - call parse_real_variable('tmaxpro', tmaxpro, 0.0D0, 1.0D3, & + case ('tmaxpro') + call parse_real_variable('tmaxpro', tmaxpro, 0.0D0, 1.0D3, & 'Maximum temp rise during quench (K)') - case ('quench_model') - call parse_string_variable('quench_model', quench_model, 'quench_model') - case ('quench_detection_ef') - call parse_real_variable('quench_detection_ef', quench_detection_ef, 0.0D0, 1.0D1, & + case ('quench_model') + call parse_string_variable('quench_model', quench_model, 'quench_model') + case ('quench_detection_ef') + call parse_real_variable('quench_detection_ef', quench_detection_ef, 0.0D0, 1.0D1, & 'Electric field at which TF quench is detected and discharge begins (V/m)') - case ('tmax_croco') - call parse_real_variable('tmax_croco', tmax_croco, 4.0D0, 1.0D3, & + case ('tmax_croco') + call parse_real_variable('tmax_croco', tmax_croco, 4.0D0, 1.0D3, & 'CroCo strand: maximum temp during a quench (K)') - ! case ('tmax_jacket') - ! call parse_real_variable('tmax_jacket', tmax_jacket, 4.0D0, 1.0D3, & - ! 'Jacket: maximum temp during a quench (K)') - case ('tmpcry') - call parse_real_variable('tmpcry', tmpcry, 0.01D0, 293.0D0, & + ! case ('tmax_jacket') + ! call parse_real_variable('tmax_jacket', tmax_jacket, 4.0D0, 1.0D3, & + ! 'Jacket: maximum temp during a quench (K)') + case ('tmpcry') + call parse_real_variable('tmpcry', tmpcry, 0.01D0, 293.0D0, & 'Cryogenic temperature (K)') - case ('vcool') - call parse_real_variable('vcool', vcool, 0.001D0, 100.0D0, & + case ('vcool') + call parse_real_variable('vcool', vcool, 0.001D0, 100.0D0, & 'Inlet centrepost coolant speed (m/s)') - case ('vdalw') - call parse_real_variable('vdalw', vdalw, 0.0D0, 100.0D0, & + case ('vdalw') + call parse_real_variable('vdalw', vdalw, 0.0D0, 100.0D0, & 'Max V across TFC during quench (kV)') - case ('f_vforce_inboard') - call parse_real_variable('f_vforce_inboard', f_vforce_inboard, 0.0D0, 1.0D0, & + case ('f_vforce_inboard') + call parse_real_variable('f_vforce_inboard', f_vforce_inboard, 0.0D0, 1.0D0, & 'Fraction of vertical force taken by the TF inboard leg') - case ('vftf') - call parse_real_variable('vftf', vftf, 0.0D0, 1.0D0, & + case ('vftf') + call parse_real_variable('vftf', vftf, 0.0D0, 1.0D0, & 'Coolant fraction of TF coil leg') - ! PF coil settings + ! PF coil settings - case ('bmaxcs_lim') - call parse_real_variable('bmaxcs_lim', bmaxcs_lim, 0.01D0, 100.0D0, & + case ('bmaxcs_lim') + call parse_real_variable('bmaxcs_lim', bmaxcs_lim, 0.01D0, 100.0D0, & 'Maximum allowed peak field on central solenoid') - case ('fbmaxcs') - call parse_real_variable('fbmaxcs', fbmaxcs, 0.01D0, 1.0D0, & + case ('fbmaxcs') + call parse_real_variable('fbmaxcs', fbmaxcs, 0.01D0, 1.0D0, & 'F-value for max peak CS field (con. 79, itvar 149)') - case ('alfapf') - call parse_real_variable('alfapf', alfapf, 1.0D-12, 1.0D0, & + case ('alfapf') + call parse_real_variable('alfapf', alfapf, 1.0D-12, 1.0D0, & 'PF coil current smoothing parameter') - case ('coheof') - call parse_real_variable('coheof', coheof, 1.0D4, 5.0D8, & + case ('coheof') + call parse_real_variable('coheof', coheof, 1.0D4, 5.0D8, & 'Central Solenoid current density at EOF') - case ('cptdin') - call parse_real_array('cptdin', cptdin, isub1, ngc2, & + case ('cptdin') + call parse_real_array('cptdin', cptdin, isub1, ngc2, & 'Current per turn for PF coil', icode) - case ('etapsu') - call parse_real_variable('etapsu', etapsu, 0.0D0, 1.0D0, & + case ('etapsu') + call parse_real_variable('etapsu', etapsu, 0.0D0, 1.0D0, & 'Efficiency of ohmic heating') - case ('fcohbof') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FCOHBOF is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fcohbop') - call parse_real_variable('fcohbop', fcohbop, 0.0D0, 1.0D0, & + case ('fcohbof') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FCOHBOF is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fcohbop') + call parse_real_variable('fcohbop', fcohbop, 0.0D0, 1.0D0, & 'Central Solenoid J ratio : BOP/EOF') - case ('fcuohsu') - call parse_real_variable('fcuohsu', fcuohsu, 0.0D0, 1.0D0, & + case ('fcuohsu') + call parse_real_variable('fcuohsu', fcuohsu, 0.0D0, 1.0D0, & 'Cu frac of conductor in Central Solenoid cable') - case ('fcupfsu') - call parse_real_variable('fcupfsu', fcupfsu, 0.0D0, 1.0D0, & + case ('fcupfsu') + call parse_real_variable('fcupfsu', fcupfsu, 0.0D0, 1.0D0, & 'Cu fraction of PF cable conductor') - case ('ipfloc') - call parse_int_array('ipfloc', ipfloc, isub1, ngrpmx, & + case ('ipfloc') + call parse_int_array('ipfloc', ipfloc, isub1, ngrpmx, & 'PF coil location', icode) - case ('ipfres') - call parse_int_variable('ipfres', ipfres, 0, 1, & + case ('ipfres') + call parse_int_variable('ipfres', ipfres, 0, 1, & 'Switch for supercond / resist PF coils') - case ('isumatoh') - call parse_int_variable('isumatoh', isumatoh, 1, 9, & + case ('isumatoh') + call parse_int_variable('isumatoh', isumatoh, 1, 9, & 'Central Solenoid superconductor material') - case ('isumatpf') - call parse_int_variable('isumatpf', isumatpf, 1, 9, & + case ('isumatpf') + call parse_int_variable('isumatpf', isumatpf, 1, 9, & 'PF coil superconductor material') - case ('i_pf_current') - call parse_int_variable('i_pf_current', i_pf_current, 0, 2, & + case ('i_pf_current') + call parse_int_variable('i_pf_current', i_pf_current, 0, 2, & 'Switch for controlling the current of the PF coils') - case ('i_sup_pf_shape') - call parse_int_variable('i_sup_pf_shape', i_sup_pf_shape, 0, 1, & + case ('i_sup_pf_shape') + call parse_int_variable('i_sup_pf_shape', i_sup_pf_shape, 0, 1, & 'Switch to place outboard PF coils when TF superconducting') - case ('ncls') - call parse_int_array('ncls', ncls, isub1, ngrpmx+2, & + case ('ncls') + call parse_int_array('ncls', ncls, isub1, ngrpmx+2, & 'No of coils in PF group', icode) - case ('nfxfh') - call parse_int_variable('nfxfh', nfxfh, 1, nfixmx/2, & + case ('nfxfh') + call parse_int_variable('nfxfh', nfxfh, 1, nfixmx/2, & 'Central Solenoid splitting parameter') - case ('ngrp') - call parse_int_variable('ngrp', ngrp, 0, ngrpmx, & + case ('ngrp') + call parse_int_variable('ngrp', ngrp, 0, ngrpmx, & 'No of groups of PF coils') - case ('ohhghf') - call parse_real_variable('ohhghf', ohhghf, 0.0D0, 2.0D0, & + case ('ohhghf') + call parse_real_variable('ohhghf', ohhghf, 0.0D0, 2.0D0, & 'Central Solenoid height / TF coil height') - case ('pfclres') - call parse_real_variable('pfclres', pfclres, 0.0D0, 1.0D-4, & + case ('pfclres') + call parse_real_variable('pfclres', pfclres, 0.0D0, 1.0D-4, & 'PF coil resistivity (ohm-m)') - case ('rjconpf') - call parse_real_array('rjconpf', rjconpf, isub1, ngc2, & + case ('rjconpf') + call parse_real_array('rjconpf', rjconpf, isub1, ngc2, & 'Average J of PF coil (A/m2)', icode) - case ('routr') - call parse_real_variable('routr', routr, -3.0D0, 3.0D0, & + case ('routr') + call parse_real_variable('routr', routr, -3.0D0, 3.0D0, & 'Gap from outboard TFC leg for PFC') - case ('rpf1') - call parse_real_variable('rpf1', rpf1, 0.0D0, 3.0D0, & + case ('rpf1') + call parse_real_variable('rpf1', rpf1, 0.0D0, 3.0D0, & 'Radial offset for location 1 PF coils') - case ('rpf2') - call parse_real_variable('rpf2', rpf2, -3.0D0, 3.0D0, & + case ('rpf2') + call parse_real_variable('rpf2', rpf2, -3.0D0, 3.0D0, & 'Radial offset for location 2 PF coils') - case ('rref') - call parse_real_array('rref', rref, isub1, ngrpmx, & + case ('rref') + call parse_real_array('rref', rref, isub1, ngrpmx, & 'radius of location 4 coil groups, minor radii from major radius', icode) - case ('ccl0_ma') - call parse_real_array('ccl0_ma', ccl0_ma, isub1, ngrpmx, & + case ('ccl0_ma') + call parse_real_array('ccl0_ma', ccl0_ma, isub1, ngrpmx, & 'Flux-swing cancel current of PF coil groups, MA', icode) - case ('ccls_ma') - call parse_real_array('ccls_ma', ccls_ma, isub1, ngrpmx, & + case ('ccls_ma') + call parse_real_array('ccls_ma', ccls_ma, isub1, ngrpmx, & 'Equilibrium current of PF coil groups, MA', icode) - case ('sigpfcalw') - call parse_real_variable('sigpfcalw', sigpfcalw, 1.0D0, 1.0D3, & + case ('sigpfcalw') + call parse_real_variable('sigpfcalw', sigpfcalw, 1.0D0, 1.0D3, & 'Allowable stress in the PF coil case (MPa)') - case ('sigpfcf') - call parse_real_variable('sigpfcf', sigpfcf, 0.1D0, 1.0D0, & + case ('sigpfcf') + call parse_real_variable('sigpfcf', sigpfcf, 0.1D0, 1.0D0, & 'Fraction of JxB force supported by PF coil case') - case ('vf') - call parse_real_array('vf', vf, isub1, ngc2, & + case ('vf') + call parse_real_array('vf', vf, isub1, ngc2, & 'Void fraction of PF coil', icode) - case ('vfohc') - call parse_real_variable('vfohc', vfohc, 0.0D0, 1.0D0, & + case ('vfohc') + call parse_real_variable('vfohc', vfohc, 0.0D0, 1.0D0, & 'Central Solenoid void fraction for coolant') - case ('zref') - call parse_real_array('zref', zref, isub1, ngrpmx, & + case ('zref') + call parse_real_array('zref', zref, isub1, ngrpmx, & 'height of location 3 and 4 coil groups / minor radius', icode) - case ('afw') - call parse_real_variable('afw', afw, 1.0D-3, 0.5D0, & + case ('afw') + call parse_real_variable('afw', afw, 1.0D-3, 0.5D0, & 'Inner radius of first wall coolant channel (m)') - case ('fw_wall') - call parse_real_variable('fw_wall', fw_wall, 0.5D-3, 0.1D0, & + case ('fw_wall') + call parse_real_variable('fw_wall', fw_wall, 0.5D-3, 0.1D0, & 'wall thickness of first wall coolant channels (m)') - case ('pitch') - call parse_real_variable('pitch', pitch, 0.5D-3, 0.1D0, & + case ('pitch') + call parse_real_variable('pitch', pitch, 0.5D-3, 0.1D0, & 'pitch of first wall cooling channels (m)') - case ('fwinlet') - call parse_real_variable('fwinlet', fwinlet, 300.0d0, 1500.0D0, & + case ('fwinlet') + call parse_real_variable('fwinlet', fwinlet, 300.0d0, 1500.0D0, & 'inlet temperature of first wall coolant (K)') - case ('fwoutlet') - call parse_real_variable('fwoutlet', fwoutlet, 300.0d0, 1500.0D0, & + case ('fwoutlet') + call parse_real_variable('fwoutlet', fwoutlet, 300.0d0, 1500.0D0, & 'outlet temperature of first wall coolant (K)') - case ('fwpressure') - call parse_real_variable('fwpressure', fwpressure, 1.0d5, 1.0D8, & + case ('fwpressure') + call parse_real_variable('fwpressure', fwpressure, 1.0d5, 1.0D8, & 'first wall coolant pressure (Pa)') - case ('fwcoolant') - call parse_string_variable('fwcoolant', fwcoolant, 'first wall coolant') - call lower_case(fwcoolant) - case ('roughness') - call parse_real_variable('roughness', roughness, 0.0d0, 1.0D-2, & + case ('fwcoolant') + call parse_string_variable('fwcoolant', fwcoolant, 'first wall coolant') + call lower_case(fwcoolant) + case ('roughness') + call parse_real_variable('roughness', roughness, 0.0d0, 1.0D-2, & 'first wall channel roughness epsilon') - case ('fw_channel_length') - call parse_real_variable('fw_channel_length', fw_channel_length, 1.0D-3, 1.0D3, & + case ('fw_channel_length') + call parse_real_variable('fw_channel_length', fw_channel_length, 1.0D-3, 1.0D3, & 'first wall channel length') - case ('peaking_factor') - call parse_real_variable('peaking_factor', peaking_factor, 1.0d0, 100.0D0, & + case ('peaking_factor') + call parse_real_variable('peaking_factor', peaking_factor, 1.0d0, 100.0D0, & 'peaking factor for first wall heat loads') - case ('bctmp') - call parse_real_variable('bctmp', bctmp, 1.0D0, 800.0D0, & + case ('bctmp') + call parse_real_variable('bctmp', bctmp, 1.0D0, 800.0D0, & 'First wall bulk coolant temperature (C)') - case ('blpressure') - call parse_real_variable('blpressure', blpressure, 1.0D5, 1.0D8, & + case ('blpressure') + call parse_real_variable('blpressure', blpressure, 1.0D5, 1.0D8, & 'Blanket coolant pressure (Pa)') - case ('blpressure_liq') - call parse_real_variable('blpressure_liq', blpressure_liq, 1.0D5, 1.0D8, & + case ('blpressure_liq') + call parse_real_variable('blpressure_liq', blpressure_liq, 1.0D5, 1.0D8, & 'Blanket liquid metal breeder/coolant pressure (Pa)') - case ('n_liq_recirc') - call parse_int_variable('n_liq_recirc', n_liq_recirc, 1, 50, & + case ('n_liq_recirc') + call parse_int_variable('n_liq_recirc', n_liq_recirc, 1, 50, & 'Selected number of liquid metal breeder recirculations per day') - case ('bz_channel_conduct_liq') - call parse_real_variable('bz_channel_conduct_liq', bz_channel_conduct_liq, 1.0D-6, 1.0D6, & + case ('bz_channel_conduct_liq') + call parse_real_variable('bz_channel_conduct_liq', bz_channel_conduct_liq, 1.0D-6, 1.0D6, & 'Conductance of liquid metal breeder duct walls (A V-1 m-1)') - case ('pnuc_fw_ratio_dcll') - call parse_real_variable('pnuc_fw_ratio_dcll', pnuc_fw_ratio_dcll, 0.0D0, 1.0D0, & + case ('pnuc_fw_ratio_dcll') + call parse_real_variable('pnuc_fw_ratio_dcll', pnuc_fw_ratio_dcll, 0.0D0, 1.0D0, & 'Ratio of FW nuclear power as fraction of total (FW+BB)') - case ('f_nuc_pow_bz_struct') - call parse_real_variable('f_nuc_pow_bz_struct', f_nuc_pow_bz_struct, 0.0D0, 1.0D0, & + case ('f_nuc_pow_bz_struct') + call parse_real_variable('f_nuc_pow_bz_struct', f_nuc_pow_bz_struct, 0.0D0, 1.0D0, & 'Fraction of BZ power cooled by primary coolant for dual-coolant balnket') - case ('coolp') - call parse_real_variable('coolp', coolp, 1.0D5, 1.0D8, & + case ('coolp') + call parse_real_variable('coolp', coolp, 1.0D5, 1.0D8, & 'blanket coolant pressure (Pa) stellarator ONLY') - case ('dtstor') - call parse_real_variable('dtstor', dtstor, 50.0D0, 500.0D0, & + case ('dtstor') + call parse_real_variable('dtstor', dtstor, 50.0D0, 500.0D0, & 'Max temp change in thermal storage medium (K)') - case ('istore') - call parse_int_variable('istore', istore, 1, 3, & + case ('istore') + call parse_int_variable('istore', istore, 1, 3, & 'Switch for thermal storage option') - case ('itcycl') - call parse_int_variable('itcycl', itcycl, 1, 3, & + case ('itcycl') + call parse_int_variable('itcycl', itcycl, 1, 3, & 'Switch for 1st wall axial stress model') - case ('lpulse') - call parse_int_variable('lpulse', lpulse, 0, 1, & + case ('lpulse') + call parse_int_variable('lpulse', lpulse, 0, 1, & 'Switch for pulsed reactor model') - case ('copperaoh_m2') - call parse_real_variable('copperaoh_m2', copperaoh_m2, 1.0D0, 1.0D10, & - 'CS coil current / copper area (A/m2)') - case ('copperaoh_m2_max') - call parse_real_variable('copperaoh_m2_max', copperaoh_m2_max, 1.0D4, 1.0D10, & + case ('copperaoh_m2') + call parse_real_variable('copperaoh_m2', copperaoh_m2, 1.0D0, 1.0D10, & + 'CS coil current / copper area (A/m2)') + case ('copperaoh_m2_max') + call parse_real_variable('copperaoh_m2_max', copperaoh_m2_max, 1.0D4, 1.0D10, & 'Maximum CS coil current / copper area (A/m2)') - case ('f_copperaoh_m2') - call parse_real_variable('f_copperaoh_m2', f_copperaoh_m2, 1.0D-3, 1.0D0, & + case ('f_copperaoh_m2') + call parse_real_variable('f_copperaoh_m2', f_copperaoh_m2, 1.0D-3, 1.0D0, & 'f-value for constraint 75: CS coil current / copper area < copperaoh_m2_max') - ! First wall, blanket, shield settings + ! First wall, blanket, shield settings - case ('primary_pumping') - call parse_int_variable('primary_pumping', primary_pumping, 0, 3, & + case ('primary_pumping') + call parse_int_variable('primary_pumping', primary_pumping, 0, 3, & 'Switch for pumping of primary coolant') - case ('htpmw_blkt') - call parse_real_variable('htpmw_blkt', htpmw_blkt, 0.0D0, 1.0D3, & + case ('htpmw_blkt') + call parse_real_variable('htpmw_blkt', htpmw_blkt, 0.0D0, 1.0D3, & 'blanket coolant mechanical pumping power (MW)') - case ('htpmw_div') - call parse_real_variable('htpmw_div', htpmw_div, 0.0D0, 1.0D3, & + case ('htpmw_div') + call parse_real_variable('htpmw_div', htpmw_div, 0.0D0, 1.0D3, & 'divertor coolant mechanical pumping power (MW)') - case ('htpmw_fw') - call parse_real_variable('htpmw_fw', htpmw_fw, 0.0D0, 1.0D3, & + case ('htpmw_fw') + call parse_real_variable('htpmw_fw', htpmw_fw, 0.0D0, 1.0D3, & 'first wall coolant mechanical pumping power (MW)') - case ('htpmw_shld') - call parse_real_variable('htpmw_shld', htpmw_shld, 0.0D0, 1.0D3, & + case ('htpmw_shld') + call parse_real_variable('htpmw_shld', htpmw_shld, 0.0D0, 1.0D3, & 'shield and vacuum vessel coolant mechanical pumping power (MW)') - case ('i_shield_mat') - call parse_int_variable('i_shield_mat', i_shield_mat, 0, 1, & + case ('i_shield_mat') + call parse_int_variable('i_shield_mat', i_shield_mat, 0, 1, & 'Switch for shield material)') - case ('i_bb_liq') - call parse_int_variable('i_bb_liq', i_bb_liq, 0, 1, & + case ('i_bb_liq') + call parse_int_variable('i_bb_liq', i_bb_liq, 0, 1, & 'Switch for breeding blaket liquid metal') - case ('icooldual') - call parse_int_variable('icooldual', icooldual, 0, 2, & + case ('icooldual') + call parse_int_variable('icooldual', icooldual, 0, 2, & 'Switch for single or dual-coolant blanket)') - case ('ifci') - call parse_int_variable('ifci', ifci, 0, 2, & + case ('ifci') + call parse_int_variable('ifci', ifci, 0, 2, & 'Switch for blanket FCIs)') - case ('inlet_temp_liq') - call parse_real_variable('inlet_temp_liq', inlet_temp_liq, 508.D0, 1.5D3, & + case ('inlet_temp_liq') + call parse_real_variable('inlet_temp_liq', inlet_temp_liq, 508.D0, 1.5D3, & 'Inlet temperature for blanket liquid metal') - case ('outlet_temp_liq') - call parse_real_variable('outlet_temp_liq', outlet_temp_liq, 508.D0, 1.5D3, & + case ('outlet_temp_liq') + call parse_real_variable('outlet_temp_liq', outlet_temp_liq, 508.D0, 1.5D3, & 'Outlet temperature for blanket liquid metal') - case ('ipump') - call parse_int_variable('ipump', ipump, 0, 2, & + case ('ipump') + call parse_int_variable('ipump', ipump, 0, 2, & 'Switch for same or different pumping system for FW/BB') - case ('ims') - call parse_int_variable('ims', ims, 0, 1, & + case ('ims') + call parse_int_variable('ims', ims, 0, 1, & ' Switch for Multi or Single Modle Segment (MMS or SMS)') - case ('secondary_cycle') - call parse_int_variable('secondary_cycle', secondary_cycle, 0, 4, & + case ('secondary_cycle') + call parse_int_variable('secondary_cycle', secondary_cycle, 0, 4, & 'Switch for blanket thermodynamic model') - case ('secondary_cycle_liq') - call parse_int_variable('secondary_cycle_liq', secondary_cycle_liq, 2, 4, & + case ('secondary_cycle_liq') + call parse_int_variable('secondary_cycle_liq', secondary_cycle_liq, 2, 4, & 'Switch for blanket thermodynamic model - liquid breeder') - case ('afwi') - call parse_real_variable('afwi', afwi, 1.0D-3, 0.05D0, & + case ('afwi') + call parse_real_variable('afwi', afwi, 1.0D-3, 0.05D0, & 'I/B fw/blkt coolant channel inner radius (m)') - case ('afwo') - call parse_real_variable('afwo', afwo, 1.0D-3, 0.05D0, & + case ('afwo') + call parse_real_variable('afwo', afwo, 1.0D-3, 0.05D0, & 'O/B fw/blkt coolant channel inner radius (m)') - case ('inlet_temp') - call parse_real_variable('inlet_temp', inlet_temp, 200.0D0, 600.0D0, & + case ('inlet_temp') + call parse_real_variable('inlet_temp', inlet_temp, 200.0D0, 600.0D0, & 'Coolant inlet temperature (K)') - case ('irefprop') - call parse_int_variable('irefprop', irefprop, 0, 1, & + case ('irefprop') + call parse_int_variable('irefprop', irefprop, 0, 1, & 'Switch to use REFPROP routines') - case ('outlet_temp') - call parse_real_variable('outlet_temp', outlet_temp, 450.0D0, 900.0D0, & + case ('outlet_temp') + call parse_real_variable('outlet_temp', outlet_temp, 450.0D0, 900.0D0, & 'Coolant outlet temperature (K)') - case ('nblktmodpo') - call parse_int_variable('nblktmodpo', nblktmodpo, 1, 16, & + case ('nblktmodpo') + call parse_int_variable('nblktmodpo', nblktmodpo, 1, 16, & 'No of o/b blanket modules in poloidal direction') - case ('nblktmodpi') - call parse_int_variable('nblktmodpi', nblktmodpi, 1, 16, & + case ('nblktmodpi') + call parse_int_variable('nblktmodpi', nblktmodpi, 1, 16, & 'No of i/b blanket modules in poloidal direction') - case ('nblktmodto') - call parse_int_variable('nblktmodto', nblktmodto, 8, 96, & + case ('nblktmodto') + call parse_int_variable('nblktmodto', nblktmodto, 8, 96, & 'No of o/b blanket modules in toroidal direction') - case ('nblktmodti') - call parse_int_variable('nblktmodti', nblktmodti, 8, 96, & + case ('nblktmodti') + call parse_int_variable('nblktmodti', nblktmodti, 8, 96, & 'No of i/b blanket modules in toroidal direction') - case ('tfwmatmax') - call parse_real_variable('tfwmatmax', tfwmatmax, 500.0D0, 2000.0D0, & + case ('tfwmatmax') + call parse_real_variable('tfwmatmax', tfwmatmax, 500.0D0, 2000.0D0, & 'Max temperature of first wall material (K)') - case ('fw_th_conductivity') - call parse_real_variable('fw_th_conductivity', fw_th_conductivity, 1.0D0, 100.0D0, & + case ('fw_th_conductivity') + call parse_real_variable('fw_th_conductivity', fw_th_conductivity, 1.0D0, 100.0D0, & 'thermal conductivity of first wall material at 293 K (W/m/K)') - case ('etaiso') - call parse_real_variable('etaiso', etaiso, 0.1D0, 1.0D0, & + case ('etaiso') + call parse_real_variable('etaiso', etaiso, 0.1D0, 1.0D0, & 'Isentropic efficiency of coolant pumps') - case ('blkttype') - call parse_int_variable('blkttype', blkttype, 1, 3, & + case ('blkttype') + call parse_int_variable('blkttype', blkttype, 1, 3, & 'Switch for blanket type') - case ('blktmodel') - call parse_int_variable('blktmodel', blktmodel, 0, 1, & + case ('blktmodel') + call parse_int_variable('blktmodel', blktmodel, 0, 1, & 'Switch for blanket neutronics calculations') - case ('breedmat') - call parse_int_variable('breedmat', breedmat, 1, 3, & + case ('breedmat') + call parse_int_variable('breedmat', breedmat, 1, 3, & 'Switch for blanket breeder material') - case ('declblkt') - call parse_real_variable('declblkt', declblkt, 0.01D0, 0.2D0, & + case ('declblkt') + call parse_real_variable('declblkt', declblkt, 0.01D0, 0.2D0, & 'Neutron decay length in blanket') - case ('declfw') - call parse_real_variable('declfw', declfw, 0.01D0, 0.2D0, & + case ('declfw') + call parse_real_variable('declfw', declfw, 0.01D0, 0.2D0, & 'Neutron decay length in first wall') - case ('declshld') - call parse_real_variable('declshld', declshld, 0.01D0, 0.2D0, & + case ('declshld') + call parse_real_variable('declshld', declshld, 0.01D0, 0.2D0, & 'Neutron decay length in blanket') - case ('denstl') - call parse_real_variable('denstl', denstl, 5.0D3, 1.0D4, & + case ('denstl') + call parse_real_variable('denstl', denstl, 5.0D3, 1.0D4, & 'Density of steel (kg/m3)') - case ('denw') - call parse_real_variable('denw', denw, 1.0D4, 5.0D4, & + case ('denw') + call parse_real_variable('denw', denw, 1.0D4, 5.0D4, & 'Density of tungsten (kg/m3)') - case ('emult') - call parse_real_variable('emult', emult, 1.0D0, 2.0D0, & + case ('emult') + call parse_real_variable('emult', emult, 1.0D0, 2.0D0, & 'Energy multip. in blanket and shield') - case ('fblbe') - call parse_real_variable('fblbe', fblbe, 0.0D0, 1.0D0, & + case ('fblbe') + call parse_real_variable('fblbe', fblbe, 0.0D0, 1.0D0, & 'Beryllium fraction of blanket') - case ('fblbreed') - call parse_real_variable('fblbreed', fblbreed, 0.0D0, 1.0D0, & + case ('fblbreed') + call parse_real_variable('fblbreed', fblbreed, 0.0D0, 1.0D0, & 'Breeder fraction of blanket breeding unit') - case ('fblhebmi') - call parse_real_variable('fblhebmi', fblhebmi, 0.0D0, 1.0D0, & + case ('fblhebmi') + call parse_real_variable('fblhebmi', fblhebmi, 0.0D0, 1.0D0, & 'Helium fraction of IB blanket box manifold') - case ('fblhebmo') - call parse_real_variable('fblhebmo', fblhebmo, 0.0D0, 1.0D0, & + case ('fblhebmo') + call parse_real_variable('fblhebmo', fblhebmo, 0.0D0, 1.0D0, & 'Helium fraction of OB blanket box manifold') - case ('fblhebpi') - call parse_real_variable('fblhebpi', fblhebpi, 0.0D0, 1.0D0, & + case ('fblhebpi') + call parse_real_variable('fblhebpi', fblhebpi, 0.0D0, 1.0D0, & 'Helium fraction of IB blanket back plate') - case ('fblhebpo') - call parse_real_variable('fblhebpo', fblhebpo, 0.0D0, 1.0D0, & + case ('fblhebpo') + call parse_real_variable('fblhebpo', fblhebpo, 0.0D0, 1.0D0, & 'Helium fraction of OB blanket back plate') - case ('fblli') - call parse_real_variable('fblli', fblli, 0.0D0, 1.0D0, & + case ('fblli') + call parse_real_variable('fblli', fblli, 0.0D0, 1.0D0, & 'Lithium fraction of blanket') - case ('fblli2o') - call parse_real_variable('fblli2o', fblli2o, 0.0D0, 1.0D0, & + case ('fblli2o') + call parse_real_variable('fblli2o', fblli2o, 0.0D0, 1.0D0, & 'Li2O fraction of blanket') - case ('fbllipb') - call parse_real_variable('fbllipb', fbllipb, 0.0D0, 1.0D0, & + case ('fbllipb') + call parse_real_variable('fbllipb', fbllipb, 0.0D0, 1.0D0, & 'Li-Pb fraction of blanket') - case ('fblss') - call parse_real_variable('fblss', fblss, 0.0D0, 1.0D0, & + case ('fblss') + call parse_real_variable('fblss', fblss, 0.0D0, 1.0D0, & 'Stainless steel fraction of blanket') - case ('fblvd') - call parse_real_variable('fblvd', fblvd, 0.0D0, 1.0D0, & + case ('fblvd') + call parse_real_variable('fblvd', fblvd, 0.0D0, 1.0D0, & 'Vanadium fraction of blanket') - case ('fdiv') - call parse_real_variable('fdiv', fdiv, 0.0D0, 1.0D0, & + case ('fdiv') + call parse_real_variable('fdiv', fdiv, 0.0D0, 1.0D0, & 'Divertor area fraction') - case ('fhcd') - call parse_real_variable('fhcd', fhcd, 0.0D0, 1.0D0, & + case ('fhcd') + call parse_real_variable('fhcd', fhcd, 0.0D0, 1.0D0, & 'HCD + diagnostics area fraction') - case ('fhole') - call parse_real_variable('fhole', fhole, 0.0D0, 1.0D0, & + case ('fhole') + call parse_real_variable('fhole', fhole, 0.0D0, 1.0D0, & 'Hole area fraction') - case ('fvolbi') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLBI is now obsolete - (use FHOLE)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvolbo') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLBO is now obsolete - (use FHOLE)' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvolcry') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'FVOLCRY is now obsolete -' - write(outfile,*) 'please remove it from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - case ('fvoldw') - call parse_real_variable('fvoldw', fvoldw, 0.0D0, 10.0D0, & + case ('fvolbi') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLBI is now obsolete - (use FHOLE)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvolbo') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLBO is now obsolete - (use FHOLE)' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvolcry') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'FVOLCRY is now obsolete -' + write(outfile,*) 'please remove it from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + case ('fvoldw') + call parse_real_variable('fvoldw', fvoldw, 0.0D0, 10.0D0, & 'Fudge factor for vacuum vessel volume') - !+PJK FVOLSI, FVOLSO should now be restricted to <= 1 - case ('fvolsi') - call parse_real_variable('fvolsi', fvolsi, 0.0D0, 10.0D0, & + !+PJK FVOLSI, FVOLSO should now be restricted to <= 1 + case ('fvolsi') + call parse_real_variable('fvolsi', fvolsi, 0.0D0, 10.0D0, & 'Fudge factor for inboard shield volume') - case ('fvolso') - call parse_real_variable('fvolso', fvolso, 0.0D0, 10.0D0, & + case ('fvolso') + call parse_real_variable('fvolso', fvolso, 0.0D0, 10.0D0, & 'Fudge factor for outboard shield volume') - !-PJK - case ('fwclfr') - call parse_real_variable('fwclfr', fwclfr, 0.0D0, 1.0D0, & + !-PJK + case ('fwclfr') + call parse_real_variable('fwclfr', fwclfr, 0.0D0, 1.0D0, & 'First wall coolant fraction') - case ('fwbsshape') - call parse_int_variable('fwbsshape', fwbsshape, 1, 2, & + case ('fwbsshape') + call parse_int_variable('fwbsshape', fwbsshape, 1, 2, & 'Switch for fw/blanket/shield/vv shape') - case ('fw_armour_thickness') - call parse_real_variable('fw_armour_thickness', fw_armour_thickness, 0.0D0, 1.0D0, & + case ('fw_armour_thickness') + call parse_real_variable('fw_armour_thickness', fw_armour_thickness, 0.0D0, 1.0D0, & 'First wall W coating thickness (m)') - case ('hcdportsize') - call parse_int_variable('hcdportsize', hcdportsize, 1, 2, & + case ('hcdportsize') + call parse_int_variable('hcdportsize', hcdportsize, 1, 2, & 'H/CD port size') - case ('iblanket') - call parse_int_variable('iblanket', iblanket, 1, 5, 'Switch for blanket model') - if ((iblanket == 2).or.(iblanket == 4)) then - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'iblanket = 2/4, KIT HCPB/HCLL model has been removed -' - write(outfile,*) 'please select a different blanket model.' - write(outfile,*) '**********' - write(outfile,*) ' ' - obsolete_var = .true. - endif - - if (iblanket == 3) then - fwith = 0.03D0 - fwoth = 0.03D0 - fw_armour_thickness = 0.003D0 - end if - case ('iblnkith') - call parse_int_variable('iblnkith', iblnkith, 0, 1, 'Switch for inboard blanket') - - case ('inuclear') - call parse_int_variable('inuclear', inuclear, 0, 1, & - 'switch for nuclear heating in the coils') - case ('qnuc') - call parse_real_variable('qnuc', qnuc, 0.0D0, 1.0D6, & + case ('iblanket') + call parse_int_variable('iblanket', iblanket, 1, 5, 'Switch for blanket model') + if ((iblanket == 2).or.(iblanket == 4)) then + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'iblanket = 2/4, KIT HCPB/HCLL model has been removed -' + write(outfile,*) 'please select a different blanket model.' + write(outfile,*) '**********' + write(outfile,*) ' ' + obsolete_var = .true. + endif + + if (iblanket == 3) then + fwith = 0.03D0 + fwoth = 0.03D0 + fw_armour_thickness = 0.003D0 + end if + case ('iblnkith') + call parse_int_variable('iblnkith', iblnkith, 0, 1, 'Switch for inboard blanket') + + case ('inuclear') + call parse_int_variable('inuclear', inuclear, 0, 1, & + 'switch for nuclear heating in the coils') + case ('qnuc') + call parse_real_variable('qnuc', qnuc, 0.0D0, 1.0D6, & 'nuclear heating in the coils (W)') - case ('li6enrich') - call parse_real_variable('li6enrich', li6enrich, 7.40D0, 100.0D0, & + case ('li6enrich') + call parse_real_variable('li6enrich', li6enrich, 7.40D0, 100.0D0, & 'Li-6 enrichment') - ! CCFE hcpb BB module (also includes the CP shielding for ST) - case ('breeder_f') - call parse_real_variable('breeder_f', breeder_f, 0.00D0, 1.0D0, & + ! CCFE hcpb BB module (also includes the CP shielding for ST) + case ('breeder_f') + call parse_real_variable('breeder_f', breeder_f, 0.00D0, 1.0D0, & 'Volume of Li4SiO4 / (Volume of Be12Ti + Li4SiO4)') - case ('breeder_multiplier') - call parse_real_variable('breeder_multiplier', breeder_multiplier, 0.0D0, 1.0D0, & + case ('breeder_multiplier') + call parse_real_variable('breeder_multiplier', breeder_multiplier, 0.0D0, 1.0D0, & 'combined breeder/multipler fraction of blanket by volume') - case ('vfcblkt') - call parse_real_variable('vfcblkt', vfcblkt, 0.0D0, 1.0D0, & + case ('vfcblkt') + call parse_real_variable('vfcblkt', vfcblkt, 0.0D0, 1.0D0, & 'He coolant fraction of blanket by volume') - case ('vfpblkt') - call parse_real_variable('vfpblkt', vfpblkt, 0.0D0, 1.0D0, & - 'He purge gas fraction of blanket by volume') - case ('f_neut_shield') - call parse_real_variable('f_neut_shield', f_neut_shield, 0.0D0, 1.0D0, & + case ('vfpblkt') + call parse_real_variable('vfpblkt', vfpblkt, 0.0D0, 1.0D0, & 'He purge gas fraction of blanket by volume') + case ('f_neut_shield') + call parse_real_variable('f_neut_shield', f_neut_shield, 0.0D0, 1.0D0, & + 'He purge gas fraction of blanket by volume') - case ('iblanket_thickness') - call parse_int_variable('iblanket_thickness', iblanket_thickness, 1, 3, & + case ('iblanket_thickness') + call parse_int_variable('iblanket_thickness', iblanket_thickness, 1, 3, & 'Blanket thickness switch') - if (iblanket_thickness == 1) then - blnkith = 0.53D0 - blnkoth = 0.91D0 - else if (iblanket_thickness == 2) then - blnkith = 0.64D0 - blnkoth = 1.11D0 - else if (iblanket_thickness == 3) then - blnkith = 0.75D0 - blnkoth = 1.30D0 - end if - case ('npdiv') - call parse_int_variable('npdiv', npdiv, 0, 4, & + if (iblanket_thickness == 1) then + blnkith = 0.53D0 + blnkoth = 0.91D0 + else if (iblanket_thickness == 2) then + blnkith = 0.64D0 + blnkoth = 1.11D0 + else if (iblanket_thickness == 3) then + blnkith = 0.75D0 + blnkoth = 1.30D0 + end if + case ('npdiv') + call parse_int_variable('npdiv', npdiv, 0, 4, & 'Number of divertor ports') - case ('nphcdin') - call parse_int_variable('nphcdin', nphcdin, 0, 4, & + case ('nphcdin') + call parse_int_variable('nphcdin', nphcdin, 0, 4, & 'Number of inboard H/CD ports') - case ('nphcdout') - call parse_int_variable('nphcdout', nphcdout, 0, 4, & + case ('nphcdout') + call parse_int_variable('nphcdout', nphcdout, 0, 4, & 'Number of outboard H/CD ports') - case ('vfblkt') - call parse_real_variable('vfblkt', vfblkt, 0.0D0, 1.0D0, & + case ('vfblkt') + call parse_real_variable('vfblkt', vfblkt, 0.0D0, 1.0D0, & 'Coolant void fraction in blanket') - case ('vfshld') - call parse_real_variable('vfshld', vfshld, 0.0D0, 1.0D0, & + case ('vfshld') + call parse_real_variable('vfshld', vfshld, 0.0D0, 1.0D0, & 'Coolant void fraction in shield') - case ('wallpf') - call parse_real_variable('wallpf', wallpf, 1.0D0, 2.0D0, & + case ('wallpf') + call parse_real_variable('wallpf', wallpf, 1.0D0, 2.0D0, & 'Neutron wall load peaking factor') - ! Heat transport / power settings + ! Heat transport / power settings - case ('baseel') - call parse_real_variable('baseel', baseel, 1.0D6, 1.0D10, & + case ('baseel') + call parse_real_variable('baseel', baseel, 1.0D6, 1.0D10, & 'Base plant electric load (W)') - case ('crypmw_max') - call parse_real_variable('crypmw_max', crypmw_max, 0.01D0, 200.0D0, & + case ('crypmw_max') + call parse_real_variable('crypmw_max', crypmw_max, 0.01D0, 200.0D0, & ' Maximum cryogenic plant power (MW)') - case ('f_crypmw') - call parse_real_variable('f_crypmw', f_crypmw, 0.0D0, 100.0D0, & - ' f-value for cryogenic plant power (icc = 87, c = 164)') - case ('etahtp') - call parse_real_variable('etahtp', etahtp, 0.1D0, 1.0D0, & + case ('f_crypmw') + call parse_real_variable('f_crypmw', f_crypmw, 0.0D0, 100.0D0, & + ' f-value for cryogenic plant power (icc = 87, c = 164)') + case ('etahtp') + call parse_real_variable('etahtp', etahtp, 0.1D0, 1.0D0, & 'Coolant pump electrical efficiency') - case ('etatf') - call parse_real_variable('etatf', etatf, 0.0D0, 1.0D0, & + case ('etatf') + call parse_real_variable('etatf', etatf, 0.0D0, 1.0D0, & 'AC to resistive power conversion for TF coils') - case ('etath') - call parse_real_variable('etath', etath, 0.0D0, 1.0D0, & + case ('etath') + call parse_real_variable('etath', etath, 0.0D0, 1.0D0, & 'Thermal-electric conversion efficiency') - case ('fmgdmw') - call parse_real_variable('fmgdmw', fmgdmw, 0.0D0, 100.0D0, & + case ('fmgdmw') + call parse_real_variable('fmgdmw', fmgdmw, 0.0D0, 100.0D0, & 'Power to MGF units (MW)') - case ('fpumpblkt') - call parse_real_variable('fpumpblkt', fpumpblkt, 0.0D0, 0.2D0, & + case ('fpumpblkt') + call parse_real_variable('fpumpblkt', fpumpblkt, 0.0D0, 0.2D0, & 'Blanket pumping/thermal power ratio') - case ('fpumpdiv') - call parse_real_variable('fpumpdiv', fpumpdiv, 0.0D0, 0.2D0, & + case ('fpumpdiv') + call parse_real_variable('fpumpdiv', fpumpdiv, 0.0D0, 0.2D0, & 'Divertor pumping/thermal power ratio') - case ('fpumpfw') - call parse_real_variable('fpumpfw', fpumpfw, 0.0D0, 0.2D0, & + case ('fpumpfw') + call parse_real_variable('fpumpfw', fpumpfw, 0.0D0, 0.2D0, & 'First wall pumping/thermal power ratio') - case ('fpumpshld') - call parse_real_variable('fpumpshld', fpumpshld, 0.0D0, 0.2D0, & + case ('fpumpshld') + call parse_real_variable('fpumpshld', fpumpshld, 0.0D0, 0.2D0, & 'Shield pumping/thermal power ratio') - case ('htpmw_min') - call parse_real_variable('htpmw_min', htpmw_min, 0.0D0, 500.0D0, & + case ('htpmw_min') + call parse_real_variable('htpmw_min', htpmw_min, 0.0D0, 500.0D0, & 'Minimum total electrical power for primary coolant pumps (MW)') - case ('ipowerflow') - call parse_int_variable('ipowerflow', ipowerflow, 0, 1, & + case ('ipowerflow') + call parse_int_variable('ipowerflow', ipowerflow, 0, 1, & 'Switch for power flow model') - case ('iprimnloss') - call parse_int_variable('iprimnloss', iprimnloss, 0, 1, & + case ('iprimnloss') + call parse_int_variable('iprimnloss', iprimnloss, 0, 1, & 'Switch for lost neutron power destiny') - case ('iprimshld') - call parse_int_variable('iprimshld', iprimshld, 0, 1, & + case ('iprimshld') + call parse_int_variable('iprimshld', iprimshld, 0, 1, & 'Switch for shield thermal power destiny') - case ('pwpm2') - call parse_real_variable('pwpm2', pwpm2, 0.0D0, 1.0D3, & + case ('pwpm2') + call parse_real_variable('pwpm2', pwpm2, 0.0D0, 1.0D3, & 'Base AC power requirement (W/m2)') - case ('pinjmax') - call parse_real_variable('pinjmax', pinjmax, 0.0D0, 1.0D3, & + case ('pinjmax') + call parse_real_variable('pinjmax', pinjmax, 0.0D0, 1.0D3, & 'Maximum injector wall plug power during pulse (MW)') - case ('trithtmw') - call parse_real_variable('trithtmw', trithtmw, 0.0D0, 100.0D0, & + case ('trithtmw') + call parse_real_variable('trithtmw', trithtmw, 0.0D0, 100.0D0, & 'Tritium process power (MW)') - case ('vachtmw') - call parse_real_variable('vachtmw', vachtmw, 0.0D0, 100.0D0, & + case ('vachtmw') + call parse_real_variable('vachtmw', vachtmw, 0.0D0, 100.0D0, & 'Vacuum pump power (MW)') - case ('t_in_bb') - call parse_real_variable('t_in_bb', t_in_bb, 200.0D0, 1000.0D0, & + case ('t_in_bb') + call parse_real_variable('t_in_bb', t_in_bb, 200.0D0, 1000.0D0, & 'Helium or Gas Inlet Temperature (K)') - case ('t_out_bb') - call parse_real_variable('t_out_bb', t_out_bb, 200.0D0, 1000.0D0, & - 'Helium or Gas Outlet Temperature (K)') - case ('dp_he') - call parse_real_variable('dp_he', dp_he, 0.0D0, 10.0D6, & - 'Helium Pressure drop or Gas Pressure drop (Pa)') - case ('p_he') - call parse_real_variable('p_he', p_he, 0.0D0, 100.0D6, & - 'Pressure in FW and blanket coolant at pump exit') + case ('t_out_bb') + call parse_real_variable('t_out_bb', t_out_bb, 200.0D0, 1000.0D0, & + 'Helium or Gas Outlet Temperature (K)') + case ('dp_he') + call parse_real_variable('dp_he', dp_he, 0.0D0, 10.0D6, & + 'Helium Pressure drop or Gas Pressure drop (Pa)') + case ('p_he') + call parse_real_variable('p_he', p_he, 0.0D0, 100.0D6, & + 'Pressure in FW and blanket coolant at pump exit') - case ('gamma_he') - call parse_real_variable('gamma_he', gamma_he, 1.0D0, 2.0D0, & - 'Ratio of specific heats for helium or for another Gas') + case ('gamma_he') + call parse_real_variable('gamma_he', gamma_he, 1.0D0, 2.0D0, & + 'Ratio of specific heats for helium or for another Gas') - ! Cost information settings + ! Cost information settings - case ('abktflnc') - call parse_real_variable('abktflnc', abktflnc, 0.1D0, 100.0D0, & + case ('abktflnc') + call parse_real_variable('abktflnc', abktflnc, 0.1D0, 100.0D0, & 'Allowable blanket fluence (MW-yr/m2)') - case ('adivflnc') - call parse_real_variable('adivflnc', adivflnc, 0.1D0, 100.0D0, & + case ('adivflnc') + call parse_real_variable('adivflnc', adivflnc, 0.1D0, 100.0D0, & 'Allowable divertor fluence (MW-yr/m2)') - case ('cfactr') - call parse_real_variable('cfactr', cfactr, 0.0D0, 1.0D0, & + case ('cfactr') + call parse_real_variable('cfactr', cfactr, 0.0D0, 1.0D0, & 'Plant capacity factor or availability') - case ('cfind') - call parse_real_array('cfind', cfind, isub1, 4, & + case ('cfind') + call parse_real_array('cfind', cfind, isub1, 4, & 'Indirect cost factor vs LSA', icode) - case ('cpstflnc') - call parse_real_variable('cpstflnc', cpstflnc, 0.01D0, 30.0D0, & + case ('cpstflnc') + call parse_real_variable('cpstflnc', cpstflnc, 0.01D0, 30.0D0, & 'Allowable centrepost neutron fluence (MW-yr/m2)') - case ('cplife_input') - call parse_real_variable('cplife_input', cplife_input, 0.001D0, 50.0D0, & - 'Full power centrepost lifetime (yr)') - case ('decomf') - call parse_real_variable('decomf', decomf, 0.0D0, 1.0D0, & + case ('cplife_input') + call parse_real_variable('cplife_input', cplife_input, 0.001D0, 50.0D0, & + 'Full power centrepost lifetime (yr)') + case ('decomf') + call parse_real_variable('decomf', decomf, 0.0D0, 1.0D0, & 'Decommissioning fund fraction') - case ('dintrt') - call parse_real_variable('dintrt', dintrt, 0.0D0, 0.1D0, & + case ('dintrt') + call parse_real_variable('dintrt', dintrt, 0.0D0, 0.1D0, & 'Borrowing - saving interest rate difference') - case ('dtlife') - call parse_real_variable('dtlife', dtlife, 0.0D0, 15.0D0, & + case ('dtlife') + call parse_real_variable('dtlife', dtlife, 0.0D0, 15.0D0, & 'Decommissioning time prior to end of plant') - case ('fcap0') - call parse_real_variable('fcap0', fcap0, 1.0D0, 1.5D0, & + case ('fcap0') + call parse_real_variable('fcap0', fcap0, 1.0D0, 1.5D0, & 'Ave cost of money for plant construction') - case ('fcap0cp') - call parse_real_variable('fcap0cp', fcap0cp, 1.0D0, 1.5D0, & + case ('fcap0cp') + call parse_real_variable('fcap0cp', fcap0cp, 1.0D0, 1.5D0, & 'Ave cost of money for replaceable components') - case ('fcdfuel') - call parse_real_variable('fcdfuel', fcdfuel, 0.0D0, 1.0D0, & + case ('fcdfuel') + call parse_real_variable('fcdfuel', fcdfuel, 0.0D0, 1.0D0, & 'Fraction of CD cost assumed fuel cost') - case ('fcr0') - call parse_real_variable('fcr0', fcr0, 0.0D0, 1.0D0, & + case ('fcr0') + call parse_real_variable('fcr0', fcr0, 0.0D0, 1.0D0, & 'Fixed charge rate during construction') - case ('fkind') - call parse_real_variable('fkind', fkind, 0.5D0, 1.0D0, & + case ('fkind') + call parse_real_variable('fkind', fkind, 0.5D0, 1.0D0, & 'Multiplier for Nth of a kind costs') - case ('i_cp_lifetime') - call parse_int_variable('i_cp_lifetime', i_cp_lifetime, 0, 3, & - 'Switch for ST centrepost lifetime contraint (10) setting') - case ('ifueltyp') - call parse_int_variable('ifueltyp', ifueltyp, 0, 2, & + case ('i_cp_lifetime') + call parse_int_variable('i_cp_lifetime', i_cp_lifetime, 0, 3, & + 'Switch for ST centrepost lifetime contraint (10) setting') + case ('ifueltyp') + call parse_int_variable('ifueltyp', ifueltyp, 0, 2, & 'Switch for costing of 1st wall etc.') - case ('ipnet') - call parse_int_variable('ipnet', ipnet, 0, 1, & + case ('ipnet') + call parse_int_variable('ipnet', ipnet, 0, 1, & 'Switch for net electric power calc.') - case ('ireactor') - call parse_int_variable('ireactor', ireactor, 0, 1, & + case ('ireactor') + call parse_int_variable('ireactor', ireactor, 0, 1, & 'Switch for MWe / C-o-E calculation') - case ('lsa') - call parse_int_variable('lsa', lsa, 1, 4, & + case ('lsa') + call parse_int_variable('lsa', lsa, 1, 4, & 'Level of safety assurance') - case ('output_costs') - call parse_int_variable('output_costs', output_costs, 0, 1, & + case ('output_costs') + call parse_int_variable('output_costs', output_costs, 0, 1, & 'Switch for writing costs to file') - case ('discount_rate') - call parse_real_variable('discount_rate', discount_rate, 0.0D0, 0.5D0, & + case ('discount_rate') + call parse_real_variable('discount_rate', discount_rate, 0.0D0, 0.5D0, & 'Effective cost of money') - case ('startupratio') - call parse_real_variable('startupratio', startupratio, 0.0D0, 10.0D0, & + case ('startupratio') + call parse_real_variable('startupratio', startupratio, 0.0D0, 10.0D0, & 'Ratio (additional HCD power for start-up) / (flat-top operational requirements)') - case ('tmain') - call parse_real_variable('tmain', tmain, 0.0D0, 100.0D0, & - 'Maintenance time for replacing CP (years) (iavail = 3)') - case ('u_unplanned') - call parse_real_variable('u_unplanned', u_unplanned, 0.0D0, 1.0D0, & - 'User-input CP unplanned unavailability (iavail = 3)') - ! Unit cost settings + ! Unit cost settings - case ('cconfix') - call parse_real_variable('cconfix', cconfix, 50.0D0, 200.0D0, & + case ('cconfix') + call parse_real_variable('cconfix', cconfix, 50.0D0, 200.0D0, & 'Fixed cost of superconducting cable ($/m)') - case ('cconshpf') - call parse_real_variable('cconshpf', cconshpf, 50.0D0, 200.0D0, & + case ('cconshpf') + call parse_real_variable('cconshpf', cconshpf, 50.0D0, 200.0D0, & 'PF coil steel conduit/sheath cost ($/m)') - case ('cconshtf') - call parse_real_variable('cconshtf', cconshtf, 50.0D0, 200.0D0, & + case ('cconshtf') + call parse_real_variable('cconshtf', cconshtf, 50.0D0, 200.0D0, & 'TF coil steel conduit/sheath cost ($/m)') - case ('cland') - call parse_real_variable('cland', cland, 10.0D0, 100.0D0, & + case ('cland') + call parse_real_variable('cland', cland, 10.0D0, 100.0D0, & 'Cost of land (M$)') - case ('costexp') - call parse_real_variable('costexp', costexp, 0.01D0, 5.0D0, & + case ('costexp') + call parse_real_variable('costexp', costexp, 0.01D0, 5.0D0, & 'Cost exponent for 2015 costs model') - case ('costexp_pebbles') - call parse_real_variable('costexp_pebbles', costexp_pebbles, 0.01D0, 5.0D0, & + case ('costexp_pebbles') + call parse_real_variable('costexp_pebbles', costexp_pebbles, 0.01D0, 5.0D0, & 'cost exponent for pebbles in 2015 costs model') - case ('cost_factor_buildings') - call parse_real_variable('cost_factor_buildings', cost_factor_buildings, 0.1D0, 10.0D0, & - 'Cost scaling factor for buildings (2015 costs model)') - case ('cost_factor_land') - call parse_real_variable('cost_factor_land', cost_factor_land, 0.1D0, 10.0D0, & - 'Cost scaling factor for land (2015 costs model)') - case ('cost_factor_tf_coils') - call parse_real_variable('cost_factor_tf_coils', cost_factor_tf_coils, 0.1D0, 10.0D0, & - 'Cost scaling factor for TF coils (2015 costs model)') - case ('cost_factor_fwbs') - call parse_real_variable('cost_factor_fwbs', cost_factor_fwbs, 0.1D0, 10.0D0, & - 'Cost scaling factor for fwbs (2015 costs model)') - case ('cost_factor_rh') - call parse_real_variable('cost_factor_rh', cost_factor_rh, 0.1D0, 10.0D0, & - 'Cost scaling factor for remote handling (2015 costs model)') - case ('cost_factor_vv') - call parse_real_variable('cost_factor_vv', cost_factor_vv, 0.1D0, 10.0D0, & - 'Cost scaling factor for vacuum vessel (2015 costs model)') - case ('cost_factor_bop') - call parse_real_variable('cost_factor_bop', cost_factor_bop, 0.1D0, 10.0D0, & - 'Cost scaling factor for energy conversion system (2015 costs model)') - case ('cost_factor_misc') - call parse_real_variable('cost_factor_misc', cost_factor_misc, 0.1D0, 10.0D0, & - 'Cost scaling factor for remaining subsystems (2015 costs model)') - case ('maintenance_fwbs') - call parse_real_variable('maintenance_fwbs', maintenance_fwbs, 0.0D0, 1.0D0, & - 'Maintenance cost factor: first wall, blanket, shield, divertor') - case ('maintenance_gen') - call parse_real_variable('maintenance_gen', maintenance_gen, 0.0D0, 1.0D0, & - 'Maintenance cost factor: All other components except coils, vacuum vessel, thermal shield, cryostat, land') - case ('amortization') - call parse_real_variable('amortization', amortization, 1.0D0, 50.0D0, & + case ('cost_factor_buildings') + call parse_real_variable('cost_factor_buildings', cost_factor_buildings, 0.1D0, 10.0D0, & + 'Cost scaling factor for buildings (2015 costs model)') + case ('cost_factor_land') + call parse_real_variable('cost_factor_land', cost_factor_land, 0.1D0, 10.0D0, & + 'Cost scaling factor for land (2015 costs model)') + case ('cost_factor_tf_coils') + call parse_real_variable('cost_factor_tf_coils', cost_factor_tf_coils, 0.1D0, 10.0D0, & + 'Cost scaling factor for TF coils (2015 costs model)') + case ('cost_factor_fwbs') + call parse_real_variable('cost_factor_fwbs', cost_factor_fwbs, 0.1D0, 10.0D0, & + 'Cost scaling factor for fwbs (2015 costs model)') + case ('cost_factor_rh') + call parse_real_variable('cost_factor_rh', cost_factor_rh, 0.1D0, 10.0D0, & + 'Cost scaling factor for remote handling (2015 costs model)') + case ('cost_factor_vv') + call parse_real_variable('cost_factor_vv', cost_factor_vv, 0.1D0, 10.0D0, & + 'Cost scaling factor for vacuum vessel (2015 costs model)') + case ('cost_factor_bop') + call parse_real_variable('cost_factor_bop', cost_factor_bop, 0.1D0, 10.0D0, & + 'Cost scaling factor for energy conversion system (2015 costs model)') + case ('cost_factor_misc') + call parse_real_variable('cost_factor_misc', cost_factor_misc, 0.1D0, 10.0D0, & + 'Cost scaling factor for remaining subsystems (2015 costs model)') + case ('maintenance_fwbs') + call parse_real_variable('maintenance_fwbs', maintenance_fwbs, 0.0D0, 1.0D0, & + 'Maintenance cost factor: first wall, blanket, shield, divertor') + case ('maintenance_gen') + call parse_real_variable('maintenance_gen', maintenance_gen, 0.0D0, 1.0D0, & + 'Maintenance cost factor: All other components except coils, vacuum vessel, thermal shield, cryostat, land') + case ('amortization') + call parse_real_variable('amortization', amortization, 1.0D0, 50.0D0, & 'amortization factor (fixed charge factor) "A" (years)') - case ('cost_model') - call parse_int_variable('cost_model', cost_model, 0, 2, & + case ('cost_model') + call parse_int_variable('cost_model', cost_model, 0, 2, & 'Switch for cost model') - case ('cowner') - call parse_real_variable('cowner', cowner, 0.0D0, 1.0D0, & + case ('cowner') + call parse_real_variable('cowner', cowner, 0.0D0, 1.0D0, & 'Owner cost factor') - case ('csi') - call parse_real_variable('csi', csi, 1.0D0, 100.0D0, & + case ('csi') + call parse_real_variable('csi', csi, 1.0D0, 100.0D0, & 'Allowance for site costs (M$)') - case ('cturbb') - call parse_real_variable('cturbb', cturbb, 100.0D0, 1000.0D0, & + case ('cturbb') + call parse_real_variable('cturbb', cturbb, 100.0D0, 1000.0D0, & 'Cost of turbine building (M$)') - case ('fcontng') - call parse_real_variable('fcontng', fcontng, 0.0D0, 1.0D0, & + case ('fcontng') + call parse_real_variable('fcontng', fcontng, 0.0D0, 1.0D0, & 'Project contingency factor') - case ('ucblbe') - call parse_real_variable('ucblbe', ucblbe, 1.0D0, 1.0D3, & + case ('ucblbe') + call parse_real_variable('ucblbe', ucblbe, 1.0D0, 1.0D3, & 'Unit cost for blanket Be ($/kg)') - case ('ucblbreed') - call parse_real_variable('ucblbreed', ucblbreed, 1.0D0, 1.0D3, & + case ('ucblbreed') + call parse_real_variable('ucblbreed', ucblbreed, 1.0D0, 1.0D3, & 'Unit cost for blanket breeder material ($/kg)') - case ('ucblli') - call parse_real_variable('ucblli', ucblli, 1.0D1, 1.0D4, & + case ('ucblli') + call parse_real_variable('ucblli', ucblli, 1.0D1, 1.0D4, & 'Unit cost for blanket Li ($/kg)') - case ('ucblli2o') - call parse_real_variable('ucblli2o', ucblli2o, 1.0D2, 1.0D4, & + case ('ucblli2o') + call parse_real_variable('ucblli2o', ucblli2o, 1.0D2, 1.0D4, & 'Unit cost for blanket Li2O ($/kg)') - case ('ucbllipb') - call parse_real_variable('ucbllipb', ucbllipb, 1.0D2, 1.0D4, & + case ('ucbllipb') + call parse_real_variable('ucbllipb', ucbllipb, 1.0D2, 1.0D4, & 'Unit cost for blanket Li-Pb ($/kg)') - case ('ucblss') - call parse_real_variable('ucblss', ucblss, 10.0D0, 1.0D3, & + case ('ucblss') + call parse_real_variable('ucblss', ucblss, 10.0D0, 1.0D3, & 'Unit cost for blanket st.steel ($/kg)') - case ('ucblvd') - call parse_real_variable('ucblvd', ucblvd, 100.0D0, 1.0D3, & + case ('ucblvd') + call parse_real_variable('ucblvd', ucblvd, 100.0D0, 1.0D3, & 'Unit cost for blanket Vd ($/kg)') - case ('ucbus') - call parse_real_variable('ucbus', ucbus, 0.01D0, 10.0D0, & + case ('ucbus') + call parse_real_variable('ucbus', ucbus, 0.01D0, 10.0D0, & 'Cost of Al bus for TF coil ($/A-m)') - case ('uccase') - call parse_real_variable('uccase', uccase, 1.0D0, 1.0D3, & + case ('uccase') + call parse_real_variable('uccase', uccase, 1.0D0, 1.0D3, & 'Cost of superconductor case ($/kg)') - case ('uccpcl1') - call parse_real_variable('uccpcl1', uccpcl1, 1.0D0, 1.0D3, & + case ('uccpcl1') + call parse_real_variable('uccpcl1', uccpcl1, 1.0D0, 1.0D3, & 'Cost of tapered copper ($/kg)') - case ('uccpclb') - call parse_real_variable('uccpclb', uccpclb, 1.0D0, 1.0D3, & + case ('uccpclb') + call parse_real_variable('uccpclb', uccpclb, 1.0D0, 1.0D3, & 'Cost TF outer leg plate coils ($/kg)') - case ('uccry') - call parse_real_variable('uccry', uccry, 1.0D4, 1.0D6, & + case ('uccry') + call parse_real_variable('uccry', uccry, 1.0D4, 1.0D6, & 'Heat transport cryoplant costs ($/W)') - case ('uccryo') - call parse_real_variable('uccryo', uccryo, 1.0D0, 1.0D3, & + case ('uccryo') + call parse_real_variable('uccryo', uccryo, 1.0D0, 1.0D3, & 'Unit cost for cryostat ($/kg)') - case ('uccu') - call parse_real_variable('uccu', uccu, 10.0D0, 1.0D2, & + case ('uccu') + call parse_real_variable('uccu', uccu, 10.0D0, 1.0D2, & 'Copper in SC cable cost ($/kg)') - case ('ucdiv') - call parse_real_variable('ucdiv', ucdiv, 1.0D3, 1.0D7, & + case ('ucdiv') + call parse_real_variable('ucdiv', ucdiv, 1.0D3, 1.0D7, & 'Cost of divertor blade ($)') - case ('ucech') - call parse_real_variable('ucech', ucech, 1.0D0, 10.0D0, & + case ('ucech') + call parse_real_variable('ucech', ucech, 1.0D0, 10.0D0, & 'ECH system cost ($/W)') - case ('ucf1') - call parse_real_variable('ucf1', ucf1, 1.0D6, 50.0D6, & + case ('ucf1') + call parse_real_variable('ucf1', ucf1, 1.0D6, 50.0D6, & 'Fuelling system cost ($)') - case ('ucfnc') - call parse_real_variable('ucfnc', ucfnc, 10.0D0, 100.0D0, & + case ('ucfnc') + call parse_real_variable('ucfnc', ucfnc, 10.0D0, 100.0D0, & 'Outer PF fence support cost ($/kg)') - case ('ucfuel') - call parse_real_variable('ucfuel', ucfuel, 1.0D0, 10.0D0, & + case ('ucfuel') + call parse_real_variable('ucfuel', ucfuel, 1.0D0, 10.0D0, & 'Cost of fuel (M$/yr)') - case ('uche3') - call parse_real_variable('uche3', uche3, 1.0D5, 1.0D7, & + case ('uche3') + call parse_real_variable('uche3', uche3, 1.0D5, 1.0D7, & 'Cost of He3 fuel ($/kg)') - case ('uchrs') - call parse_real_variable('uchrs', uchrs, 1.0D7, 5.0D8, & + case ('uchrs') + call parse_real_variable('uchrs', uchrs, 1.0D7, 5.0D8, & 'Cost of heat rejection system ($)') - case ('uchts') - call parse_real_array('uchts', uchts, isub1, 2, & + case ('uchts') + call parse_real_array('uchts', uchts, isub1, 2, & 'Cost of heat transp system equip per loop ($/W)', icode) - case ('uciac') - call parse_real_variable('uciac', uciac, 1.0D7, 1.0D9, & + case ('uciac') + call parse_real_variable('uciac', uciac, 1.0D7, 1.0D9, & 'Cost of instrum, control & diag.($)') - case ('ucich') - call parse_real_variable('ucich', ucich, 1.0D0, 10.0D0, & + case ('ucich') + call parse_real_variable('ucich', ucich, 1.0D0, 10.0D0, & 'Cost of ICH system ($/W)') - case ('uclh') - call parse_real_variable('uclh', uclh, 1.0D0, 10.0D0, & + case ('uclh') + call parse_real_variable('uclh', uclh, 1.0D0, 10.0D0, & 'LH system cost ($/W)') - case ('ucme') - call parse_real_variable('ucme', ucme, 1.0D7, 1.0D9, & + case ('ucme') + call parse_real_variable('ucme', ucme, 1.0D7, 1.0D9, & 'cost of maintenance equip. ($)') - case ('ucmisc') - call parse_real_variable('ucmisc', ucmisc, 1.0D7, 5.0D7, & + case ('ucmisc') + call parse_real_variable('ucmisc', ucmisc, 1.0D7, 5.0D7, & 'Miscellaneous plant allowance ($)') - case ('ucnbi') - call parse_real_variable('ucnbi', ucnbi, 1.0D0, 10.0D0, & + case ('ucnbi') + call parse_real_variable('ucnbi', ucnbi, 1.0D0, 10.0D0, & 'NBI system cost ($/W)') - case ('ucoam') - call parse_real_array('ucoam', ucoam, isub1, 4, & + case ('ucoam') + call parse_real_array('ucoam', ucoam, isub1, 4, & 'Annual cost of operation and maintenance', icode) - case ('ucpens') - call parse_real_variable('ucpens', ucpens, 1.0D0, 100.0D0, & + case ('ucpens') + call parse_real_variable('ucpens', ucpens, 1.0D0, 100.0D0, & 'Penetration shield cost ($/kg)') - case ('ucpfb') - call parse_real_variable('ucpfb', ucpfb, 1.0D0, 1.0D3, & + case ('ucpfb') + call parse_real_variable('ucpfb', ucpfb, 1.0D0, 1.0D3, & 'Cost of PF coil buses ($/kA-m)') - case ('ucpfbk') - call parse_real_variable('ucpfbk', ucpfbk, 1.0D3, 1.0D5, & + case ('ucpfbk') + call parse_real_variable('ucpfbk', ucpfbk, 1.0D3, 1.0D5, & 'Cost of PF coil DC breakers ($/MVA)') - case ('ucpfbs') - call parse_real_variable('ucpfbs', ucpfbs, 1.0D3, 1.0D4, & + case ('ucpfbs') + call parse_real_variable('ucpfbs', ucpfbs, 1.0D3, 1.0D4, & 'Cost of PF burn power supplies ($/kW**0.7)') - case ('ucpfcb') - call parse_real_variable('ucpfcb', ucpfcb, 1.0D3, 1.0D5, & + case ('ucpfcb') + call parse_real_variable('ucpfcb', ucpfcb, 1.0D3, 1.0D5, & 'Cost of PF coil AC breakers ($/circ)') - case ('ucpfdr1') - call parse_real_variable('ucpfdr1', ucpfdr1, 1.0D0, 1.0D3, & + case ('ucpfdr1') + call parse_real_variable('ucpfdr1', ucpfdr1, 1.0D0, 1.0D3, & 'Cost factor for dump resistors ($/MJ)') - case ('ucpfic') - call parse_real_variable('ucpfic', ucpfic, 1.0D3, 1.0D5, & + case ('ucpfic') + call parse_real_variable('ucpfic', ucpfic, 1.0D3, 1.0D5, & 'Cost of PF instrum & cont ($/channel)') - case ('ucpfps') - call parse_real_variable('ucpfps', ucpfps, 1.0D3, 1.0D5, & + case ('ucpfps') + call parse_real_variable('ucpfps', ucpfps, 1.0D3, 1.0D5, & 'Cost of PF coil pulsed P.S. ($/MVA)') - case ('ucrb') - call parse_real_variable('ucrb', ucrb, 1.0D2, 1.0D3, & + case ('ucrb') + call parse_real_variable('ucrb', ucrb, 1.0D2, 1.0D3, & 'Cost of reactor building ($/m3)') - case ('ucsc') - call parse_real_array('ucsc', ucsc, isub1, 9, & + case ('ucsc') + call parse_real_array('ucsc', ucsc, isub1, 9, & 'Cost of superconductor ($/kg)', icode) - case ('ucshld') - call parse_real_variable('ucshld', ucshld, 1.0D0, 100.0D0, & + case ('ucshld') + call parse_real_variable('ucshld', ucshld, 1.0D0, 100.0D0, & 'Cost of shield structural steel ($/kg)') - case ('uctfbr') - call parse_real_variable('uctfbr', uctfbr, 1.0D0, 10.0D0, & + case ('uctfbr') + call parse_real_variable('uctfbr', uctfbr, 1.0D0, 10.0D0, & 'Cost of TF coil breakers ($/W**0.7)') - case ('uctfbus') - call parse_real_variable('uctfbus', uctfbus, 1.0D0, 1.0D3, & + case ('uctfbus') + call parse_real_variable('uctfbus', uctfbus, 1.0D0, 1.0D3, & 'Cost of TF coil bus ($/kg)') - case ('uctfps') - call parse_real_variable('uctfps', uctfps, 1.0D0, 1.0D3, & + case ('uctfps') + call parse_real_variable('uctfps', uctfps, 1.0D0, 1.0D3, & 'Cost of TF power supplies ($/W**0.7)') - case ('uctfsw') - call parse_real_variable('uctfsw', uctfsw, 0.1D0, 10.0D0, & + case ('uctfsw') + call parse_real_variable('uctfsw', uctfsw, 0.1D0, 10.0D0, & 'Cost of TF slow dump switches ($/A)') - case ('ucturb') - call parse_real_array('ucturb', ucturb, isub1, 2, & + case ('ucturb') + call parse_real_array('ucturb', ucturb, isub1, 2, & 'Cost of turbine plant equipment ($)', icode) - case ('ucwindpf') - call parse_real_variable('ucwindpf', ucwindpf, 100.0D0, 1.0D3, & + case ('ucwindpf') + call parse_real_variable('ucwindpf', ucwindpf, 100.0D0, 1.0D3, & 'Cost of SCPF windings ($/m)') - case ('ucwindtf') - call parse_real_variable('ucwindtf', ucwindtf, 100.0D0, 1.0D3, & + case ('ucwindtf') + call parse_real_variable('ucwindtf', ucwindtf, 100.0D0, 1.0D3, & 'Cost of SCTF windings ($/m)') - case ('ucwst') - call parse_real_array('ucwst', ucwst, isub1, 4, & + case ('ucwst') + call parse_real_array('ucwst', ucwst, isub1, 4, & 'cost of waste disposal (M$/yr)', icode) - ! Availability settings + ! Availability settings - case ('iavail') - call parse_int_variable('iavail', iavail, 0, 3, & + case ('iavail') + call parse_int_variable('iavail', iavail, 0, 2, & 'Switch for plant availability model') - case ('ibkt_life') - call parse_int_variable('ibkt_life', ibkt_life, 0, 2, & + case ('ibkt_life') + call parse_int_variable('ibkt_life', ibkt_life, 0, 2, & 'Switch for DEMO fw/blanket lifetime calculation') - case ('life_dpa') - call parse_real_variable('life_dpa', life_dpa, 1.0D1, 1.0D2, & + case ('life_dpa') + call parse_real_variable('life_dpa', life_dpa, 1.0D1, 1.0D2, & 'Allowable DPA for DEMO fw/blanket lifetime calculation') - case ('avail_min') - call parse_real_variable('avail_min', avail_min, 0.0D0, 1.0D0, & + case ('avail_min') + call parse_real_variable('avail_min', avail_min, 0.0D0, 1.0D0, & 'Required minimum availability (constraint equation 61)') - case ('favail') - call parse_real_variable('favail', favail, 0.0D0, 1.0D0, & + case ('favail') + call parse_real_variable('favail', favail, 0.0D0, 1.0D0, & 'F-value for minimum availability (constraint equation 61)') - case ('num_rh_systems') - call parse_int_variable('num_rh_systems', num_rh_systems, 1, 10, & + case ('num_rh_systems') + call parse_int_variable('num_rh_systems', num_rh_systems, 1, 10, & 'Number of remote handling systems (from 1-10)') - case ('conf_mag') - call parse_real_variable('conf_mag', conf_mag, 0.9D0, 1.0D0, & + case ('conf_mag') + call parse_real_variable('conf_mag', conf_mag, 0.9D0, 1.0D0, & 'c parameter, which determines the temperature margin at which magnet lifetime starts to decline') - case ('div_prob_fail') - call parse_real_variable('div_prob_fail', div_prob_fail, 0.0D0, 1.0D0, & + case ('div_prob_fail') + call parse_real_variable('div_prob_fail', div_prob_fail, 0.0D0, 1.0D0, & 'Divertor probability of failure (per op day)') - case ('div_umain_time') - call parse_real_variable('div_umain_time', div_umain_time, 0.1D0, 2.0D0, & + case ('div_umain_time') + call parse_real_variable('div_umain_time', div_umain_time, 0.1D0, 2.0D0, & 'Divertor unplanned maintenance time (years)') - case ('div_nref') - call parse_real_variable('div_nref', div_nref, 1.0D3, 1.0D8, & + case ('div_nref') + call parse_real_variable('div_nref', div_nref, 1.0D3, 1.0D8, & 'Reference value for cycle life of divertor') - case ('div_nu') - call parse_real_variable('div_nu', div_nu, 1.0D3, 1.0D8, & + case ('div_nu') + call parse_real_variable('div_nu', div_nu, 1.0D3, 1.0D8, & 'The cycle when the divertor fails with 100% probability') - case ('fwbs_nref') - call parse_real_variable('fwbs_nref', fwbs_nref, 1.0D3, 1.0D8, & + case ('fwbs_nref') + call parse_real_variable('fwbs_nref', fwbs_nref, 1.0D3, 1.0D8, & 'Reference value for cycle life of blanket') - case ('fwbs_nu') - call parse_real_variable('fwbs_nu', fwbs_nu, 1.0D3, 1.0D8, & + case ('fwbs_nu') + call parse_real_variable('fwbs_nu', fwbs_nu, 1.0D3, 1.0D8, & 'The cycle when the blanket fails with 100% probability') - case ('fwbs_prob_fail') - call parse_real_variable('fwbs_prob_fail', fwbs_prob_fail, 0.0D0, 1.0D0, & + case ('fwbs_prob_fail') + call parse_real_variable('fwbs_prob_fail', fwbs_prob_fail, 0.0D0, 1.0D0, & 'Fwbs probability of failure (per op day)') - case ('fwbs_umain_time') - call parse_real_variable('fwbs_umain_time', fwbs_umain_time, 0.1D0, 2.0D0, & + case ('fwbs_umain_time') + call parse_real_variable('fwbs_umain_time', fwbs_umain_time, 0.1D0, 2.0D0, & 'Fwbs unplanned maintenace time (years)') - case ('redun_vacp') - call parse_real_variable('redun_vacp', redun_vacp, 0.0D0, 100.0D0, & + case ('redun_vacp') + call parse_real_variable('redun_vacp', redun_vacp, 0.0D0, 100.0D0, & 'Vacuum system pump redundancy level (%)') - case ('tbktrepl') - call parse_real_variable('tbktrepl', tbktrepl, 0.01D0, 2.0D0, & + case ('tbktrepl') + call parse_real_variable('tbktrepl', tbktrepl, 0.01D0, 2.0D0, & 'Time needed to replace blanket (yr)') - case ('tcomrepl') - call parse_real_variable('tcomrepl', tcomrepl, 0.01D0, 2.0D0, & + case ('tcomrepl') + call parse_real_variable('tcomrepl', tcomrepl, 0.01D0, 2.0D0, & 'Time needed to replace blanket+divertor (yr)') - case ('tdivrepl') - call parse_real_variable('tdivrepl', tdivrepl, 0.01D0, 2.0D0, & + case ('tdivrepl') + call parse_real_variable('tdivrepl', tdivrepl, 0.01D0, 2.0D0, & 'Time needed to replace divertor (yr)') - case ('tlife') - call parse_real_variable('tlife', tlife, 1.0D0, 100.0D0, & + case ('tlife') + call parse_real_variable('tlife', tlife, 1.0D0, 100.0D0, & 'Plant life (yr)') - case ('uubop') - call parse_real_variable('uubop', uubop, 0.005D0, 0.1D0, & + case ('uubop') + call parse_real_variable('uubop', uubop, 0.005D0, 0.1D0, & 'Unplanned unavailability for BOP') - case ('uucd') - call parse_real_variable('uucd', uucd, 0.005D0, 0.1D0, & + case ('uucd') + call parse_real_variable('uucd', uucd, 0.005D0, 0.1D0, & 'Unplanned unavailability for CD system') - case ('uudiv') - call parse_real_variable('uudiv', uudiv, 0.005D0, 0.1D0, & + case ('uudiv') + call parse_real_variable('uudiv', uudiv, 0.005D0, 0.1D0, & 'Unplanned unavailability for divertor') - case ('uufuel') - call parse_real_variable('uufuel', uufuel, 0.005D0, 0.1D0, & + case ('uufuel') + call parse_real_variable('uufuel', uufuel, 0.005D0, 0.1D0, & 'Unplanned unavailability for fuel system') - case ('uufw') - call parse_real_variable('uufw', uufw, 0.005D0, 0.1D0, & + case ('uufw') + call parse_real_variable('uufw', uufw, 0.005D0, 0.1D0, & 'Unplanned unavailability for first wall') - case ('uumag') - call parse_real_variable('uumag', uumag, 0.005D0, 0.1D0, & + case ('uumag') + call parse_real_variable('uumag', uumag, 0.005D0, 0.1D0, & 'Unplanned unavailability for magnets') - case ('uuves') - call parse_real_variable('uuves', uuves, 0.005D0, 0.1D0, & + case ('uuves') + call parse_real_variable('uuves', uuves, 0.005D0, 0.1D0, & 'Unplanned unavailability for vessel') - ! Sweep settings + ! Sweep settings - case ('isweep') - call parse_int_variable('isweep', isweep, 0, ipnscns, & + case ('isweep') + call parse_int_variable('isweep', isweep, 0, ipnscns, & 'Number of scans to perform') - case ('nsweep') - call parse_int_variable('nsweep', nsweep, 1, ipnscnv, & + case ('nsweep') + call parse_int_variable('nsweep', nsweep, 1, ipnscnv, & 'Variable used in scan') - case ('sweep') - call parse_real_array('sweep', sweep, isub1, ipnscns, & + case ('sweep') + call parse_real_array('sweep', sweep, isub1, ipnscns, & 'Actual values to use in scan', icode) - case ('scan_dim') - call parse_int_variable('scan_dim', scan_dim, 1, 2, & + case ('scan_dim') + call parse_int_variable('scan_dim', scan_dim, 1, 2, & 'Switch for 1-D or 2-D scan') - case ('isweep_2') - call parse_int_variable('isweep_2', isweep_2, 0, ipnscns, & + case ('isweep_2') + call parse_int_variable('isweep_2', isweep_2, 0, ipnscns, & 'Number of 2D scans to perform') - case ('nsweep_2') - call parse_int_variable('nsweep_2', nsweep_2, 1, ipnscnv, & + case ('nsweep_2') + call parse_int_variable('nsweep_2', nsweep_2, 1, ipnscnv, & 'Second variable used in 2D scan') - case ('sweep_2') - call parse_real_array('sweep_2', sweep_2, isub1, ipnscns, & + case ('sweep_2') + call parse_real_array('sweep_2', sweep_2, isub1, ipnscns, & 'Actual values to use in 2D scan', icode) - ! Buildings settings + ! Buildings settings - case('i_bldgs_size') - call parse_int_variable('i_bldgs_size', i_bldgs_size, 0, 1, & + case('i_bldgs_size') + call parse_int_variable('i_bldgs_size', i_bldgs_size, 0, 1, & 'Switch between routines estimating building sizes') - case('i_bldgs_v') - call parse_int_variable('i_bldgs_v', i_bldgs_v, 0, 1, & + case('i_bldgs_v') + call parse_int_variable('i_bldgs_v', i_bldgs_v, 0, 1, & 'Switch for verbose buildings output') - case ('admv') - call parse_real_variable('admv', admv, 1.0D4, 1.0D6, & + case ('admv') + call parse_real_variable('admv', admv, 1.0D4, 1.0D6, & 'Administration building volume (m3)') - case ('clh1') - call parse_real_variable('clh1', clh1, 0.0D0, 20.0D0, & + case ('clh1') + call parse_real_variable('clh1', clh1, 0.0D0, 20.0D0, & 'Clearance TF coil to cryostat top (m)') - case ('clh2') - call parse_real_variable('clh2', clh2, 0.0D0, 30.0D0, & + case ('clh2') + call parse_real_variable('clh2', clh2, 0.0D0, 30.0D0, & 'Clearance TF coil to foundation (m)') - case ('conv') - call parse_real_variable('conv', conv, 1.0D4, 1.0D6, & + case ('conv') + call parse_real_variable('conv', conv, 1.0D4, 1.0D6, & 'Control building volume (m3)') - case ('esbldgm3') - call parse_real_variable('esbldgm3', esbldgm3, 1.0D3, 1.0D6, & + case ('esbldgm3') + call parse_real_variable('esbldgm3', esbldgm3, 1.0D3, 1.0D6, & 'Energy storage building volume (m3)') - case ('fndt') - call parse_real_variable('fndt', fndt, 0.0D0, 10.0D0, & + case ('fndt') + call parse_real_variable('fndt', fndt, 0.0D0, 10.0D0, & 'Foundation thickness (m)') - case ('hccl') - call parse_real_variable('hccl', hccl, 0.0D0, 10.0D0, & + case ('hccl') + call parse_real_variable('hccl', hccl, 0.0D0, 10.0D0, & 'Clearance around components in hot cell (m)') - case ('hcwt') - call parse_real_variable('hcwt', hcwt, 0.0D0, 10.0D0, & + case ('hcwt') + call parse_real_variable('hcwt', hcwt, 0.0D0, 10.0D0, & 'Hot cell wall thickness (m)') - case ('mbvfac') - call parse_real_variable('mbvfac', mbvfac, 0.9D0, 3.0D0, & + case ('mbvfac') + call parse_real_variable('mbvfac', mbvfac, 0.9D0, 3.0D0, & 'Maintenance building volume multiplier') - case ('pfbldgm3') - call parse_real_variable('pfbldgm3', pfbldgm3, 1.0D4, 1.0D6, & + case ('pfbldgm3') + call parse_real_variable('pfbldgm3', pfbldgm3, 1.0D4, 1.0D6, & 'PF coil power conv. bldg volume (m3)') - case ('pibv') - call parse_real_variable('pibv', pibv, 1.0D3, 1.0D5, & + case ('pibv') + call parse_real_variable('pibv', pibv, 1.0D3, 1.0D5, & 'Power injection building volume (m3)') - case ('rbrt') - call parse_real_variable('rbrt', rbrt, 0.0D0, 10.0D0, & + case ('rbrt') + call parse_real_variable('rbrt', rbrt, 0.0D0, 10.0D0, & 'Reactor building roof thickness (m)') - case ('rbvfac') - call parse_real_variable('rbvfac', rbvfac, 0.9D0, 3.0D0, & + case ('rbvfac') + call parse_real_variable('rbvfac', rbvfac, 0.9D0, 3.0D0, & 'Reactor building volume multiplier') - case ('rbwt') - call parse_real_variable('rbwt', rbwt, 0.0D0, 10.0D0, & + case ('rbwt') + call parse_real_variable('rbwt', rbwt, 0.0D0, 10.0D0, & 'Reactor building wall thickness (m)') - case ('row') - call parse_real_variable('row', row, 0.0D0, 10.0D0, & + case ('row') + call parse_real_variable('row', row, 0.0D0, 10.0D0, & 'Wall clearance for cranes (m)') - case ('rxcl') - call parse_real_variable('rxcl', rxcl, 0.0D0, 10.0D0, & + case ('rxcl') + call parse_real_variable('rxcl', rxcl, 0.0D0, 10.0D0, & 'Clearance around reactor (m)') - case ('shmf') - call parse_real_variable('shmf', shmf, 0.0D0, 1.0D0, & + case ('shmf') + call parse_real_variable('shmf', shmf, 0.0D0, 1.0D0, & 'Fraction of TF shield mass per lift') - case ('shov') - call parse_real_variable('shov', shov, 1.0D3, 1.0D6, & + case ('shov') + call parse_real_variable('shov', shov, 1.0D3, 1.0D6, & 'Shops and warehouse volume (m3)') - case ('stcl') - call parse_real_variable('stcl', stcl, 0.0D0, 10.0D0, & + case ('stcl') + call parse_real_variable('stcl', stcl, 0.0D0, 10.0D0, & 'Clearance above crane to roof (m)') - case ('tfcbv') - call parse_real_variable('tfcbv', tfcbv, 1.0D4, 1.0D6, & + case ('tfcbv') + call parse_real_variable('tfcbv', tfcbv, 1.0D4, 1.0D6, & 'TF coil power conv. bldg volume (m3)') - case ('trcl') - call parse_real_variable('trcl', trcl, 0.0D0, 10.0D0, & + case ('trcl') + call parse_real_variable('trcl', trcl, 0.0D0, 10.0D0, & 'Transport clearance between comps (m)') - case ('triv') - call parse_real_variable('triv', triv, 1.0D4, 1.0D6, & + case ('triv') + call parse_real_variable('triv', triv, 1.0D4, 1.0D6, & 'Tritium building volume (m3)') - case ('wgt') - call parse_real_variable('wgt', wgt, 1.0D4, 1.0D6, & + case ('wgt') + call parse_real_variable('wgt', wgt, 1.0D4, 1.0D6, & 'Reactor building crane capacity (kg)') - case ('wgt2') - call parse_real_variable('wgt2', wgt2, 1.0D4, 1.0D6, & + case ('wgt2') + call parse_real_variable('wgt2', wgt2, 1.0D4, 1.0D6, & 'Hot cell crane capacity (kg)') - case ('wsvfac') - call parse_real_variable('wsvfac', wsvfac, 0.9D0, 3.0D0, & + case ('wsvfac') + call parse_real_variable('wsvfac', wsvfac, 0.9D0, 3.0D0, & 'Warm shop building volume multiplier') - case ('aux_build_l') - call parse_real_variable('aux_build_l', aux_build_l, 10.0D0, 1000.0D0, & + case ('aux_build_l') + call parse_real_variable('aux_build_l', aux_build_l, 10.0D0, 1000.0D0, & 'aux building supporting tokamak processes, length (m)') - case ('aux_build_w') - call parse_real_variable('aux_build_w', aux_build_w, 10.0D0, 1000.0D0, & + case ('aux_build_w') + call parse_real_variable('aux_build_w', aux_build_w, 10.0D0, 1000.0D0, & 'aux building supporting tokamak processes, width (m)') - case ('aux_build_h') - call parse_real_variable('aux_build_h', aux_build_h, 1.0D0, 100.0D0, & + case ('aux_build_h') + call parse_real_variable('aux_build_h', aux_build_h, 1.0D0, 100.0D0, & 'aux building supporting tokamak processes, height (m)') - case ('auxcool_l') - call parse_real_variable('auxcool_l', auxcool_l, 10.0D0, 1000.0D0, & + case ('auxcool_l') + call parse_real_variable('auxcool_l', auxcool_l, 10.0D0, 1000.0D0, & 'Site-Wide Auxiliary Cooling Water facility, length (m)') - case ('auxcool_w') - call parse_real_variable('auxcool_w', auxcool_w, 10.0D0, 1000.0D0, & + case ('auxcool_w') + call parse_real_variable('auxcool_w', auxcool_w, 10.0D0, 1000.0D0, & 'Site-Wide Auxiliary Cooling Water facility, width (m)') - case ('auxcool_h') - call parse_real_variable('auxcool_h', auxcool_h, 1.0D0, 100.0D0, & + case ('auxcool_h') + call parse_real_variable('auxcool_h', auxcool_h, 1.0D0, 100.0D0, & 'Site-Wide Auxiliary Cooling Water facility, height (m)') - case ('bioshld_thk') - call parse_real_variable('bioshld_thk', bioshld_thk, 0.25D0, 25.0D0, & + case ('bioshld_thk') + call parse_real_variable('bioshld_thk', bioshld_thk, 0.25D0, 25.0D0, & 'Radial thickness of bio-shield around reactor (m)') - case ('chemlab_l') - call parse_real_variable('chemlab_l', chemlab_l, 10.0D0, 1000.0D0, & + case ('chemlab_l') + call parse_real_variable('chemlab_l', chemlab_l, 10.0D0, 1000.0D0, & 'Chemistry labs and treatment buldings, length (m)') - case ('chemlab_w') - call parse_real_variable('chemlab_w', chemlab_w, 10.0D0, 1000.0D0, & + case ('chemlab_w') + call parse_real_variable('chemlab_w', chemlab_w, 10.0D0, 1000.0D0, & 'Chemistry labs and treatment buldings, width (m)') - case ('chemlab_h') - call parse_real_variable('chemlab_h', chemlab_h, 1.0D0, 100.0D0, & + case ('chemlab_h') + call parse_real_variable('chemlab_h', chemlab_h, 1.0D0, 100.0D0, & 'Chemistry labs and treatment buldings, height (m)') - case ('control_buildings_l') - call parse_real_variable('control_buildings_l', control_buildings_l, 10.0D0, 1000.0D0, & + case ('control_buildings_l') + call parse_real_variable('control_buildings_l', control_buildings_l, 10.0D0, 1000.0D0, & 'control building, length (m)') - case ('control_buildings_w') - call parse_real_variable('control_buildings_w', control_buildings_w, 10.0D0, 1000.0D0, & + case ('control_buildings_w') + call parse_real_variable('control_buildings_w', control_buildings_w, 10.0D0, 1000.0D0, & 'control building, width (m)') - case ('control_buildings_h') - call parse_real_variable('control_buildings_h', control_buildings_h, 1.0D0, 100.0D0, & + case ('control_buildings_h') + call parse_real_variable('control_buildings_h', control_buildings_h, 1.0D0, 100.0D0, & 'control building, height (m)') - case ('crane_arm_h') - call parse_real_variable('crane_arm_h', crane_arm_h, 1.0D0, 100.0D0, & + case ('crane_arm_h') + call parse_real_variable('crane_arm_h', crane_arm_h, 1.0D0, 100.0D0, & 'vertical dimension of crane arm, operating over reactor (m)') - case ('crane_clrnc_h') - call parse_real_variable('crane_clrnc_h', crane_clrnc_h, 0.0D0, 10.0D0, & + case ('crane_clrnc_h') + call parse_real_variable('crane_clrnc_h', crane_clrnc_h, 0.0D0, 10.0D0, & 'horizontal clearance to building wall for crane operation (m)') - case ('crane_clrnc_v') - call parse_real_variable('crane_clrnc_v', crane_clrnc_v, 0.0D0, 10.0D0, & + case ('crane_clrnc_v') + call parse_real_variable('crane_clrnc_v', crane_clrnc_v, 0.0D0, 10.0D0, & 'vertical clearance for crane operation (m)') - case ('cryomag_l') - call parse_real_variable('cryomag_l', cryomag_l, 10.0D0, 1000.0D0, & + case ('cryomag_l') + call parse_real_variable('cryomag_l', cryomag_l, 10.0D0, 1000.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, length (m)') - case ('cryomag_w') - call parse_real_variable('cryomag_w', cryomag_w, 10.0D0, 1000.0D0, & + case ('cryomag_w') + call parse_real_variable('cryomag_w', cryomag_w, 10.0D0, 1000.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, width (m)') - case ('cryomag_h') - call parse_real_variable('cryomag_h', cryomag_h, 1.0D0, 100.0D0, & + case ('cryomag_h') + call parse_real_variable('cryomag_h', cryomag_h, 1.0D0, 100.0D0, & 'Cryogenic Buildings for Magnet and Fuel Cycle, height (m)') - case ('cryostore_l') - call parse_real_variable('cryostore_l', cryostore_l, 10.0D0, 1000.0D0, & + case ('cryostore_l') + call parse_real_variable('cryostore_l', cryostore_l, 10.0D0, 1000.0D0, & 'Magnet Cryo Storage Tanks, length (m)') - case ('cryostore_w') - call parse_real_variable('cryostore_w', cryostore_w, 10.0D0, 1000.0D0, & + case ('cryostore_w') + call parse_real_variable('cryostore_w', cryostore_w, 10.0D0, 1000.0D0, & 'Magnet Cryo Storage Tanks, width (m)') - case ('cryostore_h') - call parse_real_variable('cryostore_h', cryostore_h, 1.0D0, 100.0D0, & + case ('cryostore_h') + call parse_real_variable('cryostore_h', cryostore_h, 1.0D0, 100.0D0, & 'Magnet Cryo Storage Tanks, height (m)') - case ('cryostat_clrnc') - call parse_real_variable('cryostat_clrnc', cryostat_clrnc, 0.0D0, 10.0D0, & + case ('cryostat_clrnc') + call parse_real_variable('cryostat_clrnc', cryostat_clrnc, 0.0D0, 10.0D0, & 'vertical clearance from TF coil to cryostat (m)') - case ('elecdist_l') - call parse_real_variable('elecdist_l', elecdist_l, 10.0D0, 1000.0D0, & + case ('elecdist_l') + call parse_real_variable('elecdist_l', elecdist_l, 10.0D0, 1000.0D0, & 'Transformers and electrical distribution facilities, length (m)') - case ('elecdist_w') - call parse_real_variable('elecdist_w', elecdist_w, 10.0D0, 1000.0D0, & + case ('elecdist_w') + call parse_real_variable('elecdist_w', elecdist_w, 10.0D0, 1000.0D0, & 'Transformers and electrical distribution facilities, width (m)') - case ('elecdist_h') - call parse_real_variable('elecdist_h', elecdist_h, 1.0D0, 100.0D0, & + case ('elecdist_h') + call parse_real_variable('elecdist_h', elecdist_h, 1.0D0, 100.0D0, & 'Transformers and electrical distribution facilities, height (m)') - case ('elecload_l') - call parse_real_variable('elecload_l', elecload_l, 10.0D0, 1000.0D0, & + case ('elecload_l') + call parse_real_variable('elecload_l', elecload_l, 10.0D0, 1000.0D0, & 'Electric (eesential and non-essential) load centres, length (m)') - case ('elecload_w') - call parse_real_variable('elecload_w', elecload_w, 10.0D0, 1000.0D0, & + case ('elecload_w') + call parse_real_variable('elecload_w', elecload_w, 10.0D0, 1000.0D0, & 'Electric (eesential and non-essential) load centres, width (m)') - case ('elecload_h') - call parse_real_variable('elecload_h', elecload_h, 1.0D0, 100.0D0, & + case ('elecload_h') + call parse_real_variable('elecload_h', elecload_h, 1.0D0, 100.0D0, & 'Electric (eesential and non-essential) load centres, height (m)') - case ('elecstore_l') - call parse_real_variable('elecstore_l', elecstore_l, 10.0D0, 1000.0D0, & + case ('elecstore_l') + call parse_real_variable('elecstore_l', elecstore_l, 10.0D0, 1000.0D0, & 'Energy Storage facilities, length (m)') - case ('elecstore_w') - call parse_real_variable('elecstore_w', elecstore_w, 10.0D0, 1000.0D0, & + case ('elecstore_w') + call parse_real_variable('elecstore_w', elecstore_w, 10.0D0, 1000.0D0, & 'Energy Storage facilities, width (m)') - case ('elecstore_h') - call parse_real_variable('elecstore_h', elecstore_h, 1.0D0, 100.0D0, & + case ('elecstore_h') + call parse_real_variable('elecstore_h', elecstore_h, 1.0D0, 100.0D0, & 'Energy Storage facilities, height (m)') - case ('fc_building_l') - call parse_real_variable('fc_building_l', fc_building_l, 10.0D0, 1000.0D0, & + case ('fc_building_l') + call parse_real_variable('fc_building_l', fc_building_l, 10.0D0, 1000.0D0, & 'Fuel Cycle facilities, length (m)') - case ('fc_building_w') - call parse_real_variable('fc_building_w', fc_building_w, 10.0D0, 1000.0D0, & + case ('fc_building_w') + call parse_real_variable('fc_building_w', fc_building_w, 10.0D0, 1000.0D0, & 'Fuel Cycle facilities, width (m)') - case ('gas_buildings_l') - call parse_real_variable('gas_buildings_l', gas_buildings_l, 10.0D0, 1000.0D0, & + case ('gas_buildings_l') + call parse_real_variable('gas_buildings_l', gas_buildings_l, 10.0D0, 1000.0D0, & 'air & gas supply (amalgamated) buildings, length (m)') - case ('gas_buildings_w') - call parse_real_variable('gas_buildings_w', gas_buildings_w, 10.0D0, 1000.0D0, & + case ('gas_buildings_w') + call parse_real_variable('gas_buildings_w', gas_buildings_w, 10.0D0, 1000.0D0, & 'air & gas supply (amalgamated) buildings, width (m)') - case ('gas_buildings_h') - call parse_real_variable('gas_buildings_h', gas_buildings_h, 1.0D0, 100.0D0, & + case ('gas_buildings_h') + call parse_real_variable('gas_buildings_h', gas_buildings_h, 1.0D0, 100.0D0, & 'air & gas supply (amalgamated) buildings, height (m)') - case ('ground_clrnc') - call parse_real_variable('ground_clrnc', ground_clrnc, 0.0D0, 10.0D0, & + case ('ground_clrnc') + call parse_real_variable('ground_clrnc', ground_clrnc, 0.0D0, 10.0D0, & 'clearance beneath TF coil (m)') - case ('hcd_building_l') - call parse_real_variable('hcd_building_l', hcd_building_l, 10.0D0, 1000.0D0, & + case ('hcd_building_l') + call parse_real_variable('hcd_building_l', hcd_building_l, 10.0D0, 1000.0D0, & 'HCD building, length (m)') - case ('hcd_building_w') - call parse_real_variable('hcd_building_w', hcd_building_w, 10.0D0, 1000.0D0, & + case ('hcd_building_w') + call parse_real_variable('hcd_building_w', hcd_building_w, 10.0D0, 1000.0D0, & 'HCD building, width (m)') - case ('hcd_building_h') - call parse_real_variable('hcd_building_h', hcd_building_h, 1.0D0, 100.0D0, & + case ('hcd_building_h') + call parse_real_variable('hcd_building_h', hcd_building_h, 1.0D0, 100.0D0, & 'HCD building, height (m)') - case ('hw_storage_l') - call parse_real_variable('hw_storage_l', hw_storage_l, 10.0D0, 1000.0D0, & + case ('hw_storage_l') + call parse_real_variable('hw_storage_l', hw_storage_l, 10.0D0, 1000.0D0, & 'hazardous waste storage building, length (m)') - case ('hw_storage_w') - call parse_real_variable('hw_storage_w', hw_storage_w, 10.0D0, 1000.0D0, & + case ('hw_storage_w') + call parse_real_variable('hw_storage_w', hw_storage_w, 10.0D0, 1000.0D0, & 'hazardous waste storage building, width (m)') - case ('hw_storage_h') - call parse_real_variable('hw_storage_h', hw_storage_h, 1.0D0, 100.0D0, & + case ('hw_storage_h') + call parse_real_variable('hw_storage_h', hw_storage_h, 1.0D0, 100.0D0, & 'hazardous waste storage building, height (m)') - case ('heat_sink_l') - call parse_real_variable('heat_sink_l', heat_sink_l, 10.0D0, 1000.0D0, & + case ('heat_sink_l') + call parse_real_variable('heat_sink_l', heat_sink_l, 10.0D0, 1000.0D0, & 'heat sinks, length (m)') - case ('heat_sink_w') - call parse_real_variable('heat_sink_w', heat_sink_w, 10.0D0, 1000.0D0, & + case ('heat_sink_w') + call parse_real_variable('heat_sink_w', heat_sink_w, 10.0D0, 1000.0D0, & 'heat sinks, width (m)') - case ('heat_sink_h') - call parse_real_variable('heat_sink_h', heat_sink_h, 1.0D0, 100.0D0, & + case ('heat_sink_h') + call parse_real_variable('heat_sink_h', heat_sink_h, 1.0D0, 100.0D0, & 'heat sinks, height (m)') - case ('hot_sepdist') - call parse_real_variable('hot_sepdist', hot_sepdist, 0.0D0, 10.0D0, & + case ('hot_sepdist') + call parse_real_variable('hot_sepdist', hot_sepdist, 0.0D0, 10.0D0, & '') - case ('hotcell_h') - call parse_real_variable('hotcell_h', hotcell_h, 1.0D0, 100.0D0, & + case ('hotcell_h') + call parse_real_variable('hotcell_h', hotcell_h, 1.0D0, 100.0D0, & 'hot cell storage component separation distance (m)') - case ('ilw_smelter_l') - call parse_real_variable('ilw_smelter_l', ilw_smelter_l, 10.0D0, 1000.0D0, & + case ('ilw_smelter_l') + call parse_real_variable('ilw_smelter_l', ilw_smelter_l, 10.0D0, 1000.0D0, & 'radioactive waste smelting facility, length (m)') - case ('ilw_smelter_w') - call parse_real_variable('ilw_smelter_w', ilw_smelter_w, 10.0D0, 1000.0D0, & + case ('ilw_smelter_w') + call parse_real_variable('ilw_smelter_w', ilw_smelter_w, 10.0D0, 1000.0D0, & 'radioactive waste smelting facility, width (m)') - case ('ilw_smelter_h') - call parse_real_variable('ilw_smelter_h', ilw_smelter_h, 1.0D0, 100.0D0, & + case ('ilw_smelter_h') + call parse_real_variable('ilw_smelter_h', ilw_smelter_h, 1.0D0, 100.0D0, & 'radioactive waste smelting facility, height (m)') - case ('ilw_storage_l') - call parse_real_variable('ilw_storage_l', ilw_storage_l, 10.0D0, 1000.0D0, & + case ('ilw_storage_l') + call parse_real_variable('ilw_storage_l', ilw_storage_l, 10.0D0, 1000.0D0, & 'ILW waste storage building, length (m)') - case ('ilw_storage_w') - call parse_real_variable('ilw_storage_w', ilw_storage_w, 10.0D0, 1000.0D0, & + case ('ilw_storage_w') + call parse_real_variable('ilw_storage_w', ilw_storage_w, 10.0D0, 1000.0D0, & 'ILW waste storage building, width (m)') - case ('ilw_storage_h') - call parse_real_variable('ilw_storage_h', ilw_storage_h, 1.0D0, 100.0D0, & + case ('ilw_storage_h') + call parse_real_variable('ilw_storage_h', ilw_storage_h, 1.0D0, 100.0D0, & 'ILW waste storage building, height (m)') - case ('llw_storage_l') - call parse_real_variable('llw_storage_l', llw_storage_l, 10.0D0, 1000.0D0, & + case ('llw_storage_l') + call parse_real_variable('llw_storage_l', llw_storage_l, 10.0D0, 1000.0D0, & 'LLW waste storage building, length (m)') - case ('llw_storage_w') - call parse_real_variable('llw_storage_w', llw_storage_w, 10.0D0, 1000.0D0, & + case ('llw_storage_w') + call parse_real_variable('llw_storage_w', llw_storage_w, 10.0D0, 1000.0D0, & 'LLW waste storage building, width (m)') - case ('llw_storage_h') - call parse_real_variable('llw_storage_h', llw_storage_h, 1.0D0, 100.0D0, & + case ('llw_storage_h') + call parse_real_variable('llw_storage_h', llw_storage_h, 1.0D0, 100.0D0, & 'LLW waste storage building, height (m)') - case ('magnet_pulse_l') - call parse_real_variable('magnet_pulse_l', magnet_pulse_l, 10.0D0, 1000.0D0, & + case ('magnet_pulse_l') + call parse_real_variable('magnet_pulse_l', magnet_pulse_l, 10.0D0, 1000.0D0, & 'pulsed magnet power building, length (m)') - case ('magnet_pulse_w') - call parse_real_variable('magnet_pulse_w', magnet_pulse_w, 10.0D0, 1000.0D0, & + case ('magnet_pulse_w') + call parse_real_variable('magnet_pulse_w', magnet_pulse_w, 10.0D0, 1000.0D0, & 'pulsed magnet power building, width (m)') - case ('magnet_pulse_h') - call parse_real_variable('magnet_pulse_h', magnet_pulse_h, 1.0D0, 100.0D0, & + case ('magnet_pulse_h') + call parse_real_variable('magnet_pulse_h', magnet_pulse_h, 1.0D0, 100.0D0, & 'pulsed magnet power building, height (m)') - case ('magnet_trains_l') - call parse_real_variable('magnet_trains_l', magnet_trains_l, 10.0D0, 1000.0D0, & + case ('magnet_trains_l') + call parse_real_variable('magnet_trains_l', magnet_trains_l, 10.0D0, 1000.0D0, & 'steady state magnet power trains building, length (m)') - case ('magnet_trains_w') - call parse_real_variable('magnet_trains_w', magnet_trains_w, 10.0D0, 1000.0D0, & + case ('magnet_trains_w') + call parse_real_variable('magnet_trains_w', magnet_trains_w, 10.0D0, 1000.0D0, & 'steady state magnet power trains building, width (m)') - case ('magnet_trains_h') - call parse_real_variable('magnet_trains_h', magnet_trains_h, 1.0D0, 100.0D0, & + case ('magnet_trains_h') + call parse_real_variable('magnet_trains_h', magnet_trains_h, 1.0D0, 100.0D0, & 'steady state magnet power trains building, height (m)') - case ('maint_cont_l') - call parse_real_variable('maint_cont_l', maint_cont_l, 10.0D0, 1000.0D0, & + case ('maint_cont_l') + call parse_real_variable('maint_cont_l', maint_cont_l, 10.0D0, 1000.0D0, & 'maintenance control building, length (m)') - case ('maint_cont_w') - call parse_real_variable('maint_cont_w', maint_cont_w, 10.0D0, 1000.0D0, & + case ('maint_cont_w') + call parse_real_variable('maint_cont_w', maint_cont_w, 10.0D0, 1000.0D0, & 'maintenance control building, width (m)') - case ('maint_cont_h') - call parse_real_variable('maint_cont_h', maint_cont_h, 1.0D0, 100.0D0, & + case ('maint_cont_h') + call parse_real_variable('maint_cont_h', maint_cont_h, 1.0D0, 100.0D0, & 'maintenance control building, height (m)') - case ('nbi_sys_l') - call parse_real_variable('nbi_sys_l', nbi_sys_l, 10.0D0, 1000.0D0, & + case ('nbi_sys_l') + call parse_real_variable('nbi_sys_l', nbi_sys_l, 10.0D0, 1000.0D0, & 'NBI system length (m)') - case ('nbi_sys_w') - call parse_real_variable('nbi_sys_w', nbi_sys_w, 10.0D0, 1000.0D0, & + case ('nbi_sys_w') + call parse_real_variable('nbi_sys_w', nbi_sys_w, 10.0D0, 1000.0D0, & 'NBI system width (m)') - case ('qnty_sfty_fac') - call parse_real_variable('qnty_sfty_fac', qnty_sfty_fac, 0.0D0, 10.0D0, & + case ('qnty_sfty_fac') + call parse_real_variable('qnty_sfty_fac', qnty_sfty_fac, 0.0D0, 10.0D0, & 'quantity safety factor for component use during plant lifetime') - case ('reactor_clrnc') - call parse_real_variable('reactor_clrnc', reactor_clrnc, 0.0D0, 10.0D0, & + case ('reactor_clrnc') + call parse_real_variable('reactor_clrnc', reactor_clrnc, 0.0D0, 10.0D0, & 'clearance around reactor (m)') - case ('reactor_fndtn_thk') - call parse_real_variable('reactor_fndtn_thk', reactor_fndtn_thk, 0.25D0, 25.0D0, & + case ('reactor_fndtn_thk') + call parse_real_variable('reactor_fndtn_thk', reactor_fndtn_thk, 0.25D0, 25.0D0, & 'reactor building foundation thickness (m)') - case ('reactor_hall_l') - call parse_real_variable('reactor_hall_l', reactor_hall_l, 10.0D0, 1000.0D0, & + case ('reactor_hall_l') + call parse_real_variable('reactor_hall_l', reactor_hall_l, 10.0D0, 1000.0D0, & 'reactor building, length (m)') - case ('reactor_hall_w') - call parse_real_variable('reactor_hall_w', reactor_hall_w, 10.0D0, 1000.0D0, & + case ('reactor_hall_w') + call parse_real_variable('reactor_hall_w', reactor_hall_w, 10.0D0, 1000.0D0, & 'reactor building, width (m)') - case ('reactor_hall_h') - call parse_real_variable('reactor_hall_h', reactor_hall_h, 1.0D0, 100.0D0, & + case ('reactor_hall_h') + call parse_real_variable('reactor_hall_h', reactor_hall_h, 1.0D0, 100.0D0, & 'reactor building, height (m)') - case ('reactor_roof_thk') - call parse_real_variable('reactor_roof_thk', reactor_roof_thk, 0.25D0, 25.0D0, & + case ('reactor_roof_thk') + call parse_real_variable('reactor_roof_thk', reactor_roof_thk, 0.25D0, 25.0D0, & 'reactor building roof thickness (m)') - case ('reactor_wall_thk') - call parse_real_variable('reactor_wall_thk', reactor_wall_thk, 0.25D0, 25.0D0, & + case ('reactor_wall_thk') + call parse_real_variable('reactor_wall_thk', reactor_wall_thk, 0.25D0, 25.0D0, & 'reactor building wall thickness (m)') - case ('robotics_l') - call parse_real_variable('robotics_l', robotics_l, 10.0D0, 1000.0D0, & + case ('robotics_l') + call parse_real_variable('robotics_l', robotics_l, 10.0D0, 1000.0D0, & 'robotics buildings, length (m)') - case ('robotics_w') - call parse_real_variable('robotics_w', robotics_w, 10.0D0, 1000.0D0, & + case ('robotics_w') + call parse_real_variable('robotics_w', robotics_w, 10.0D0, 1000.0D0, & 'robotics buildings, width (m)') - case ('robotics_h') - call parse_real_variable('robotics_h', robotics_h, 1.0D0, 100.0D0, & + case ('robotics_h') + call parse_real_variable('robotics_h', robotics_h, 1.0D0, 100.0D0, & 'robotics buildings, height (m)') - case ('sec_buildings_l') - call parse_real_variable('sec_buildings_l', sec_buildings_l, 10.0D0, 1000.0D0, & + case ('sec_buildings_l') + call parse_real_variable('sec_buildings_l', sec_buildings_l, 10.0D0, 1000.0D0, & 'security & safety buildings, length (m)') - case ('sec_buildings_w') - call parse_real_variable('sec_buildings_w', sec_buildings_w, 10.0D0, 1000.0D0, & + case ('sec_buildings_w') + call parse_real_variable('sec_buildings_w', sec_buildings_w, 10.0D0, 1000.0D0, & 'security & safety buildings, width (m)') - case ('sec_buildings_h') - call parse_real_variable('sec_buildings_h', sec_buildings_h, 1.0D0, 100.0D0, & + case ('sec_buildings_h') + call parse_real_variable('sec_buildings_h', sec_buildings_h, 1.0D0, 100.0D0, & 'security & safety buildings, height (m)') - case ('staff_buildings_h') - call parse_real_variable('staff_buildings_h', staff_buildings_h, 1.0D0, 100.0D0, & + case ('staff_buildings_h') + call parse_real_variable('staff_buildings_h', staff_buildings_h, 1.0D0, 100.0D0, & 'staff buildings height (m)') - case ('staff_buildings_area') - call parse_real_variable('staff_buildings_area', staff_buildings_area, 1.0D4, 1.0D6, & + case ('staff_buildings_area') + call parse_real_variable('staff_buildings_area', staff_buildings_area, 1.0D4, 1.0D6, & 'footprint of staff buildings (m2)') - case ('transp_clrnc') - call parse_real_variable('transp_clrnc', transp_clrnc, 0.0D0, 10.0D0, & + case ('transp_clrnc') + call parse_real_variable('transp_clrnc', transp_clrnc, 0.0D0, 10.0D0, & 'transportation clearance between components (m)') - case ('turbine_hall_l') - call parse_real_variable('turbine_hall_l', turbine_hall_l, 10.0D0, 1000.0D0, & + case ('turbine_hall_l') + call parse_real_variable('turbine_hall_l', turbine_hall_l, 10.0D0, 1000.0D0, & 'turbine hall, length (m)') - case ('turbine_hall_w') - call parse_real_variable('turbine_hall_w', turbine_hall_w, 10.0D0, 1000.0D0, & + case ('turbine_hall_w') + call parse_real_variable('turbine_hall_w', turbine_hall_w, 10.0D0, 1000.0D0, & 'turbine hall, width (m)') - case ('turbine_hall_h') - call parse_real_variable('turbine_hall_h', turbine_hall_h, 1.0D0, 100.0D0, & + case ('turbine_hall_h') + call parse_real_variable('turbine_hall_h', turbine_hall_h, 1.0D0, 100.0D0, & 'turbine hall, height (m)') - case ('tw_storage_l') - call parse_real_variable('tw_storage_l', tw_storage_l, 10.0D0, 1000.0D0, & + case ('tw_storage_l') + call parse_real_variable('tw_storage_l', tw_storage_l, 10.0D0, 1000.0D0, & 'tritiated waste storage building, length (m)') - case ('tw_storage_w') - call parse_real_variable('tw_storage_w', tw_storage_w, 10.0D0, 1000.0D0, & + case ('tw_storage_w') + call parse_real_variable('tw_storage_w', tw_storage_w, 10.0D0, 1000.0D0, & 'tritiated waste storage building, width (m)') - case ('tw_storage_h') - call parse_real_variable('tw_storage_h', tw_storage_h, 1.0D0, 100.0D0, & + case ('tw_storage_h') + call parse_real_variable('tw_storage_h', tw_storage_h, 1.0D0, 100.0D0, & 'tritiated waste storage building, height (m)') - case ('warm_shop_l') - call parse_real_variable('warm_shop_l', warm_shop_l, 10.0D0, 1000.0D0, & + case ('warm_shop_l') + call parse_real_variable('warm_shop_l', warm_shop_l, 10.0D0, 1000.0D0, & 'warm shop, length (m)') - case ('warm_shop_w') - call parse_real_variable('warm_shop_w', warm_shop_w, 10.0D0, 1000.0D0, & + case ('warm_shop_w') + call parse_real_variable('warm_shop_w', warm_shop_w, 10.0D0, 1000.0D0, & 'warm shop, width (m)') - case ('warm_shop_h') - call parse_real_variable('warm_shop_h', warm_shop_h, 1.0D0, 100.0D0, & + case ('warm_shop_h') + call parse_real_variable('warm_shop_h', warm_shop_h, 1.0D0, 100.0D0, & 'warm shop, height (m)') - case ('water_buildings_l') - call parse_real_variable('water_buildings_l', water_buildings_l, 10.0D0, 1000.0D0, & + case ('water_buildings_l') + call parse_real_variable('water_buildings_l', water_buildings_l, 10.0D0, 1000.0D0, & 'water, laundry & drainage buildings, length (m)') - case ('water_buildings_w') - call parse_real_variable('water_buildings_w', water_buildings_w, 10.0D0, 1000.0D0, & + case ('water_buildings_w') + call parse_real_variable('water_buildings_w', water_buildings_w, 10.0D0, 1000.0D0, & 'water, laundry & drainage buildings, width (m)') - case ('water_buildings_h') - call parse_real_variable('water_buildings_h', water_buildings_h, 1.0D0, 100.0D0, & + case ('water_buildings_h') + call parse_real_variable('water_buildings_h', water_buildings_h, 1.0D0, 100.0D0, & 'water, laundry & drainage buildings, height (m)') - case ('workshop_l') - call parse_real_variable('workshop_l', workshop_l, 10.0D0, 1000.0D0, & + case ('workshop_l') + call parse_real_variable('workshop_l', workshop_l, 10.0D0, 1000.0D0, & 'workshop buildings, length (m)') - case ('workshop_w') - call parse_real_variable('workshop_w', workshop_w, 10.0D0, 1000.0D0, & + case ('workshop_w') + call parse_real_variable('workshop_w', workshop_w, 10.0D0, 1000.0D0, & 'workshop buildings, width (m)') - case ('workshop_h') - call parse_real_variable('workshop_h', workshop_h, 1.0D0, 100.0D0, & + case ('workshop_h') + call parse_real_variable('workshop_h', workshop_h, 1.0D0, 100.0D0, & 'workshop buildings, height (m)') - ! Energy storage settings + ! Energy storage settings - case ('iscenr') - call parse_int_variable('iscenr', iscenr, 1, 3, & + case ('iscenr') + call parse_int_variable('iscenr', iscenr, 1, 3, & 'Switch for energy storage option') - case ('maxpoloidalpower') - call parse_real_variable('maxpoloidalpower', maxpoloidalpower, 0.0D0, 2.0D3, & + case ('maxpoloidalpower') + call parse_real_variable('maxpoloidalpower', maxpoloidalpower, 0.0D0, 2.0D3, & 'Maximum permitted absolute rate of change of stored energy in poloidal field (MW)') - ! Output file options settings + ! Output file options settings - case ('sect01', 'sect02', 'sect03', 'sect04', 'sect05', & - 'sect06', 'sect07', 'sect08', 'sect09', 'sect10', & - 'sect11', 'sect12', 'sect13', 'sect14', 'sect15', & - 'sect16', 'sect17', 'sect18', 'sect19', 'sect20', & - 'sect21') - write(outfile,*) ' ' - write(outfile,*) '**********' - write(outfile,*) 'SECT flags are now ignored -' - write(outfile,*) 'please remove them from the input file' - write(outfile,*) '**********' - write(outfile,*) ' ' + case ('sect01', 'sect02', 'sect03', 'sect04', 'sect05', & + 'sect06', 'sect07', 'sect08', 'sect09', 'sect10', & + 'sect11', 'sect12', 'sect13', 'sect14', 'sect15', & + 'sect16', 'sect17', 'sect18', 'sect19', 'sect20', & + 'sect21') + write(outfile,*) ' ' + write(outfile,*) '**********' + write(outfile,*) 'SECT flags are now ignored -' + write(outfile,*) 'please remove them from the input file' + write(outfile,*) '**********' + write(outfile,*) ' ' - ! Vacuum system settings + ! Vacuum system settings - case ('vacuum_model') - call parse_string_variable('vacuum_model', vacuum_model, 'vacuum_model') + case ('vacuum_model') + call parse_string_variable('vacuum_model', vacuum_model, 'vacuum_model') - case ('ntype') - call parse_int_variable('ntype', ntype, 0, 1, & + case ('ntype') + call parse_int_variable('ntype', ntype, 0, 1, & 'Pump type') - case ('pbase') - call parse_real_variable('pbase', pbase, 1.0D-8, 1.0D-3, & + case ('pbase') + call parse_real_variable('pbase', pbase, 1.0D-8, 1.0D-3, & 'Base pressure (Pa)') - case ('prdiv') - call parse_real_variable('prdiv', prdiv, 0.0D0, 10.0D0, & + case ('prdiv') + call parse_real_variable('prdiv', prdiv, 0.0D0, 10.0D0, & 'Divertor chamber pressure in burn (Pa)') - case ('pumptp') - call parse_real_variable('pumptp', pumptp, 0.0D0, 1.0D30, & + case ('pumptp') + call parse_real_variable('pumptp', pumptp, 0.0D0, 1.0D30, & 'Pump throughput (molecules/s) (default is ITER value)') - case ('rat') - call parse_real_variable('rat', rat, 1.0D-10, 1.0D-6, & + case ('rat') + call parse_real_variable('rat', rat, 1.0D-10, 1.0D-6, & 'Plas chamber wall outgas rate (Pa-m/s)') - case ('tn') - call parse_real_variable('tn', tn, 1.0D0, 1.0D3, & + case ('tn') + call parse_real_variable('tn', tn, 1.0D0, 1.0D3, & 'Neutral gas temp in chamber (K)') - case ('dwell_pump') - call parse_int_variable('dwell_pump', dwell_pump, 0, 2, & + case ('dwell_pump') + call parse_int_variable('dwell_pump', dwell_pump, 0, 2, & 'switch for dwell pumping options') - case ('pumpareafraction') - call parse_real_variable('pumpareafraction', pumpareafraction, 1.0D-6, 1.0D0, & + case ('pumpareafraction') + call parse_real_variable('pumpareafraction', pumpareafraction, 1.0D-6, 1.0D0, & 'Area of one pumping port as a fraction of plasma surface area') - case ('pumpspeedmax') - call parse_real_variable('pumpspeedmax', pumpspeedmax, 1.0D-6, 1.0D3, & + case ('pumpspeedmax') + call parse_real_variable('pumpspeedmax', pumpspeedmax, 1.0D-6, 1.0D3, & 'Maximum pumping speed per unit area for deuterium & tritium, molecular flow') - case ('pumpspeedfactor') - call parse_real_variable('pumpspeedfactor', pumpspeedfactor, 1.0D-6, 1.0D0, & + case ('pumpspeedfactor') + call parse_real_variable('pumpspeedfactor', pumpspeedfactor, 1.0D-6, 1.0D0, & 'Effective pumping speed reduction factor due to duct impedance') - case ('initialpressure') - call parse_real_variable('initialpressure', initialpressure, 1.0D-6, 1.0D4, & + case ('initialpressure') + call parse_real_variable('initialpressure', initialpressure, 1.0D-6, 1.0D4, & 'initial neutral pressure at the beginning of the dwell phase (Pa)') - case ('outgasindex') - call parse_real_variable('outgasindex', outgasindex, 1.0D-6, 1.0D3, & + case ('outgasindex') + call parse_real_variable('outgasindex', outgasindex, 1.0D-6, 1.0D3, & 'outgassing decay index') - case ('outgasfactor') - call parse_real_variable('outgasfactor', outgasfactor, 1.0D-6, 1.0D3, & + case ('outgasfactor') + call parse_real_variable('outgasfactor', outgasfactor, 1.0D-6, 1.0D3, & 'outgassing prefactor kw: outgassing rate at 1 s per unit area (Pa m s-1)') - ! Reinke criterion - case ('lhat') - call parse_real_variable('lhat', lhat, 1.0D0, 1.5D1, & + ! Reinke criterion + case ('lhat') + call parse_real_variable('lhat', lhat, 1.0D0, 1.5D1, & 'connection length factor') - case ('reinke_mode') - call parse_int_variable('reinke_mode', reinke_mode, 0, 1, & + case ('reinke_mode') + call parse_int_variable('reinke_mode', reinke_mode, 0, 1, & 'Switch for Reinke Criterion mode (0=H, 1=I)') - case ('impvardiv') - call parse_int_variable('impvardiv', impvardiv, 3, nimp, & + case ('impvardiv') + call parse_int_variable('impvardiv', impvardiv, 3, nimp, & 'Index of impurity to be iterated for Reike criterion') - ! Stellarator settings + ! Stellarator settings - case ('istell') - call parse_int_variable('istell', istell, 0, 6, & + case ('istell') + call parse_int_variable('istell', istell, 0, 6, & 'Stellarator machine specification (1=Helias5, 2=Helias4, 3=Helias3, 4=W7X50, 5=W7X30, 6=jsoninput)') - case ('bmn') - call parse_real_variable('bmn', bmn, 1.0D-4, 1.0D-2, & + case ('bmn') + call parse_real_variable('bmn', bmn, 1.0D-4, 1.0D-2, & 'Relative radial field perturbation') - case ('max_gyrotron_frequency') - call parse_real_variable('max_gyrotron_frequency', max_gyrotron_frequency, 1.0d9, 1.0d14, & - 'Maximum avail. gyrotron frequency') - case ('te0_ecrh_achievable') - call parse_real_variable('te0_ecrh_achievable', te0_ecrh_achievable, 1.0d0, 1.0d3, & - 'Maximum achievable ecrh temperature (peak value)') - case ('f_asym') - call parse_real_variable('f_asym', f_asym, 0.9D0, 2.0D0, & + case ('max_gyrotron_frequency') + call parse_real_variable('max_gyrotron_frequency', max_gyrotron_frequency, 1.0d9, 1.0d14, & + 'Maximum avail. gyrotron frequency') + case ('te0_ecrh_achievable') + call parse_real_variable('te0_ecrh_achievable', te0_ecrh_achievable, 1.0d0, 1.0d3, & + 'Maximum achievable ecrh temperature (peak value)') + case ('f_asym') + call parse_real_variable('f_asym', f_asym, 0.9D0, 2.0D0, & 'Heat load peaking factor') - case ('f_rad') - call parse_real_variable('f_rad', f_rad, 0.0D0, 1.0D0, & + case ('f_rad') + call parse_real_variable('f_rad', f_rad, 0.0D0, 1.0D0, & 'Radiated power fraction in SOL') - case ('f_w') - call parse_real_variable('f_w', f_w, 0.1D0, 1.0D0, & + case ('f_w') + call parse_real_variable('f_w', f_w, 0.1D0, 1.0D0, & 'Island size fraction factor') - case ('fdivwet') - call parse_real_variable('fdivwet', fdivwet, 0.01D0, 1.0D0, & + case ('fdivwet') + call parse_real_variable('fdivwet', fdivwet, 0.01D0, 1.0D0, & 'Wetted area fraction of divertor plates') - case ('flpitch') - call parse_real_variable('flpitch', flpitch, 1.0D-4, 1.0D-2, & + case ('flpitch') + call parse_real_variable('flpitch', flpitch, 1.0D-4, 1.0D-2, & 'Field line pitch (rad)') - case ('iotabar') - call parse_real_variable('iotabar', iotabar, 0.1D0, 10.0D0, & + case ('iotabar') + call parse_real_variable('iotabar', iotabar, 0.1D0, 10.0D0, & 'Stellarator rotational transform (at s=2/3)') - case ('isthtr') - call parse_int_variable('isthtr', isthtr, 1, 3, & + case ('isthtr') + call parse_int_variable('isthtr', isthtr, 1, 3, & 'Stellarator method of auxiliary heating') - case ('m_res') - call parse_int_variable('m_res', m_res, 1, 10, & + case ('m_res') + call parse_int_variable('m_res', m_res, 1, 10, & 'Poloidal resonance number') - case ('n_res') - call parse_int_variable('n_res', n_res, 3, 6, & + case ('n_res') + call parse_int_variable('n_res', n_res, 3, 6, & 'Toroidal resonance number') - case ('shear') - call parse_real_variable('shear', shear, 0.1D0, 10.0D0, & + case ('shear') + call parse_real_variable('shear', shear, 0.1D0, 10.0D0, & 'Magnetic shear') - ! Inertial Fusion Energy plant settings - - case ('ife') - call parse_int_variable('ife', ife, 0, 1, & - 'Switch for Inertial Fusion Energy model') - case ('bldr') - call parse_real_variable('bldr', bldr, 0.0D0, 10.0D0, & - 'IFE blanket radial thickness (m)') - case ('bldrc') - call parse_real_variable('bldrc', bldrc, 0.0D0, 10.0D0, & - 'IFE curtain radial thickness (m)') - case ('bldzl') - call parse_real_variable('bldzl', bldzl, 0.0D0, 10.0D0, & - 'IFE blanket bottom part thickness (m)') - case ('bldzu') - call parse_real_variable('bldzu', bldzu, 0.0D0, 10.0D0, & - 'IFE blanket top part thickness (m)') - case ('blmatf') ! N.B. actually a 2-D array - call parse_real_array('blmatf', blmatf, isub1, 3*(maxmat+1), & - 'IFE blanket material fraction', icode) - case ('cdriv0') - call parse_real_variable('cdriv0', cdriv0, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('cdriv1') - call parse_real_variable('cdriv1', cdriv1, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('cdriv2') - call parse_real_variable('cdriv2', cdriv2, 50.0D0, 500.0D0, & - 'IFE driver cost offset (M$)') - case ('chdzl') - call parse_real_variable('chdzl', chdzl, 0.0D0, 10.0D0, & - 'IFE chamber bottom part thickness (m)') - case ('chdzu') - call parse_real_variable('chdzu', chdzu, 0.0D0, 10.0D0, & - 'IFE chamber top part thickness (m)') - case ('chmatf') - call parse_real_array('chmatf', chmatf, isub1, maxmat+1, & - 'IFE chamber material fraction', icode) - case ('chrad') - call parse_real_variable('chrad', chrad, 0.1D0, 20.0D0, & - 'IFE chamber radial thickness (m)') - case ('dcdrv0') - call parse_real_variable('dcdrv0', dcdrv0, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('dcdrv1') - call parse_real_variable('dcdrv1', dcdrv1, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('dcdrv2') - call parse_real_variable('dcdrv2', dcdrv2, 0.0D0, 200.0D0, & - 'IFE driver cost gradient (M$/MJ)') - case ('drveff') - call parse_real_variable('drveff', drveff, 0.01D0, 1.0D0, & - 'IFE driver efficiency') - case ('edrive') - call parse_real_variable('edrive', edrive, 1.0D5, 50.0D8, & - 'IFE driver energy (J)') - case ('etali') - call parse_real_variable('etali', etali, 0.0D0, 1.0D0, & - 'IFE lithium pump wall plug efficiency') - case ('etave') - call parse_real_array('etave', etave, isub1, 10, & - 'IFE driver efficiency vs driver energy', icode) - case ('fauxbop') - call parse_real_variable('fauxbop', fauxbop, 0.0D0, 1.0D0, & - 'Frac. of gross electric power to BOP (IFE)') - case ('fbreed') - call parse_real_variable('fbreed', fbreed, 0.0D0, 0.999D0, & - 'Fraction of breeder outside core') - case ('fburn') - call parse_real_variable('fburn', fburn, 0.01D0, 1.0D0, & - 'IFE burn fraction') - case ('flirad') - call parse_real_variable('flirad', flirad, 0.0D0, 10.0D0, & - 'Radius of FLiBe inlet (HYLIFE) (m)') - case ('frrmax') - call parse_real_variable('frrmax', frrmax, 1.0D-6, 1.0D0, & - 'F-value for IFE repetition rate') - case ('fwdr') - call parse_real_variable('fwdr', fwdr, 0.0D0, 10.0D0, & - 'IFE first wall radial thickness (m)') - case ('fwdzl') - call parse_real_variable('fwdzl', fwdzl, 0.0D0, 10.0D0, & - 'IFE first wall bottom part thickness (m)') - case ('fwdzu') - call parse_real_variable('fwdzu', fwdzu, 0.0D0, 10.0D0, & - 'IFE first wall top part thickness (m)') - case ('fwmatf') ! N.B. actually a 2-D array - call parse_real_array('fwmatf', fwmatf, isub1, 3*(maxmat+1), & - 'IFE first wall material fraction', icode) - case ('gainve') - call parse_real_array('gainve', gainve, isub1, 10, & - 'IFE target gain vs driver energy', icode) - case ('htpmw_ife') - call parse_real_variable('htpmw_ife', htpmw_ife, 0.0D0, 1.0D3, & - 'IFE heat transport system electrical pump power (MW)') - case ('ifedrv') - call parse_int_variable('ifedrv', ifedrv, -1, 3, & - 'IFE driver type') - case ('ifetyp') - call parse_int_variable('ifetyp', ifetyp, 0, 4, & - 'IFE device build type') - case ('mcdriv') - call parse_real_variable('mcdriv', mcdriv, 0.1D0, 10.0D0, & - 'IFE driver cost multiplier') - case ('pdrive') - call parse_real_variable('pdrive', pdrive, 1.0D6, 200.0D6, & - 'IFE driver power to target (W)') - case ('pfusife') - call parse_real_variable('pfusife', pfusife, 0.0D0, 1.0D4, & - 'IFE input fusion power (MW) (ifedrv=3 only)') - case ('pifecr') - call parse_real_variable('pifecr', pifecr, 0.0D0, 100.0D0, & - 'IFE cryogenic power (MW)') - case ('ptargf') - call parse_real_variable('ptargf', ptargf, 0.1D0, 100.0D0, & - 'IFE target factory power at 6Hz (MW)') - case ('rrin') - call parse_real_variable('rrin', rrin, 0.1D0, 50.0D0, & - 'Input IFE repetition rate (Hz) (ifedrv=3 only)') - case ('rrmax') - call parse_real_variable('rrmax', rrmax, 1.0D0, 50.0D0, & - 'Maximum IFE repetition rate (Hz)') - case ('shdr') - call parse_real_variable('shdr', shdr, 0.0D0, 10.0D0, & - 'IFE shield radial thickness (m)') - case ('shdzl') - call parse_real_variable('shdzl', shdzl, 0.0D0, 10.0D0, & - 'IFE shield bottom part thickness (m)') - case ('shdzu') - call parse_real_variable('shdzu', shdzu, 0.0D0, 10.0D0, & - 'IFE shield top part thickness (m)') - case ('shmatf') ! N.B. actually a 2-D array - call parse_real_array('shmatf', shmatf, isub1, 3*(maxmat+1), & - 'IFE shield material fraction', icode) - case ('sombdr') - call parse_real_variable('sombdr', sombdr, 0.0D0, 10.0D0, & - 'Radius of SOMBRERO blanket bottom (m)') - case ('somtdr') - call parse_real_variable('somtdr', somtdr, 0.0D0, 10.0D0, & - 'Radius of SOMBRERO blanket top (m)') - case ('tgain') - call parse_real_variable('tgain', tgain, 1.0D0, 500.0D0, & - 'IFE target gain') - case ('uccarb') - call parse_real_variable('uccarb', uccarb, 10.0D0, 1.0D3, & - 'Cost of carbon cloth ($/kg)') - case ('ucconc') - call parse_real_variable('ucconc', ucconc, 0.1D0, 1.0D3, & - 'Cost of concrete ($/kg)') - case ('ucflib') - call parse_real_variable('ucflib', ucflib, 10.0D0, 1.0D3, & - 'Cost of FLiBe ($/kg)') - case ('uctarg') - call parse_real_variable('uctarg', uctarg, 0.1D0, 1.0D3, & - 'Cost per IFE target ($/target)') - case ('v1dr') - call parse_real_variable('v1dr', v1dr, 0.0D0, 10.0D0, & - 'IFE void 1 radial thickness (m)') - case ('v1dzl') - call parse_real_variable('v1dzl', v1dzl, 0.0D0, 10.0D0, & - 'IFE void 1 bottom part thickness (m)') - case ('v1dzu') - call parse_real_variable('v1dzu', v1dzu, 0.0D0, 10.0D0, & - 'IFE void 1 top part thickness (m)') - case ('v1matf') ! N.B. actually a 2-D array - call parse_real_array('v1matf', v1matf, isub1, 3*(maxmat+1), & - 'IFE void 1 material fraction', icode) - case ('v2dr') - call parse_real_variable('v2dr', v2dr, 0.0D0, 10.0D0, & - 'IFE void 2 radial thickness (m)') - case ('v2dzl') - call parse_real_variable('v2dzl', v2dzl, 0.0D0, 10.0D0, & - 'IFE void 2 bottom part thickness (m)') - case ('v2dzu') - call parse_real_variable('v2dzu', v2dzu, 0.0D0, 10.0D0, & - 'IFE void 2 top part thickness (m)') - case ('v2matf') ! N.B. actually a 2-D array - call parse_real_array('v2matf', v2matf, isub1, 3*(maxmat+1), & - 'IFE void 2 material fraction', icode) - case ('v3dr') - call parse_real_variable('v3dr', v3dr, 0.0D0, 50.0D0, & - 'IFE void 3 radial thickness (m)') - case ('v3dzl') - call parse_real_variable('v3dzl', v3dzl, 0.0D0, 30.0D0, & - 'IFE void 3 bottom part thickness (m)') - case ('v3dzu') - call parse_real_variable('v3dzu', v3dzu, 0.0D0, 30.0D0, & - 'IFE void 3 top part thickness (m)') - case ('v3matf') ! N.B. actually a 2-D array - call parse_real_array('v3matf', v3matf, isub1, 3*(maxmat+1), & - 'IFE void 3 material fraction', icode) - - ! Water usage settings - - case ('airtemp') - call parse_real_variable('airtemp', airtemp, -15.0D0, 40.0D0, & + ! Inertial Fusion Energy plant settings + + case ('ife') + call parse_int_variable('ife', ife, 0, 1, & + 'Switch for Inertial Fusion Energy model') + case ('bldr') + call parse_real_variable('bldr', bldr, 0.0D0, 10.0D0, & + 'IFE blanket radial thickness (m)') + case ('bldrc') + call parse_real_variable('bldrc', bldrc, 0.0D0, 10.0D0, & + 'IFE curtain radial thickness (m)') + case ('bldzl') + call parse_real_variable('bldzl', bldzl, 0.0D0, 10.0D0, & + 'IFE blanket bottom part thickness (m)') + case ('bldzu') + call parse_real_variable('bldzu', bldzu, 0.0D0, 10.0D0, & + 'IFE blanket top part thickness (m)') + case ('blmatf') ! N.B. actually a 2-D array + call parse_real_array('blmatf', blmatf, isub1, 3*(maxmat+1), & + 'IFE blanket material fraction', icode) + case ('cdriv0') + call parse_real_variable('cdriv0', cdriv0, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('cdriv1') + call parse_real_variable('cdriv1', cdriv1, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('cdriv2') + call parse_real_variable('cdriv2', cdriv2, 50.0D0, 500.0D0, & + 'IFE driver cost offset (M$)') + case ('chdzl') + call parse_real_variable('chdzl', chdzl, 0.0D0, 10.0D0, & + 'IFE chamber bottom part thickness (m)') + case ('chdzu') + call parse_real_variable('chdzu', chdzu, 0.0D0, 10.0D0, & + 'IFE chamber top part thickness (m)') + case ('chmatf') + call parse_real_array('chmatf', chmatf, isub1, maxmat+1, & + 'IFE chamber material fraction', icode) + case ('chrad') + call parse_real_variable('chrad', chrad, 0.1D0, 20.0D0, & + 'IFE chamber radial thickness (m)') + case ('dcdrv0') + call parse_real_variable('dcdrv0', dcdrv0, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('dcdrv1') + call parse_real_variable('dcdrv1', dcdrv1, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('dcdrv2') + call parse_real_variable('dcdrv2', dcdrv2, 0.0D0, 200.0D0, & + 'IFE driver cost gradient (M$/MJ)') + case ('drveff') + call parse_real_variable('drveff', drveff, 0.01D0, 1.0D0, & + 'IFE driver efficiency') + case ('edrive') + call parse_real_variable('edrive', edrive, 1.0D5, 50.0D8, & + 'IFE driver energy (J)') + case ('etali') + call parse_real_variable('etali', etali, 0.0D0, 1.0D0, & + 'IFE lithium pump wall plug efficiency') + case ('etave') + call parse_real_array('etave', etave, isub1, 10, & + 'IFE driver efficiency vs driver energy', icode) + case ('fauxbop') + call parse_real_variable('fauxbop', fauxbop, 0.0D0, 1.0D0, & + 'Frac. of gross electric power to BOP (IFE)') + case ('fbreed') + call parse_real_variable('fbreed', fbreed, 0.0D0, 0.999D0, & + 'Fraction of breeder outside core') + case ('fburn') + call parse_real_variable('fburn', fburn, 0.01D0, 1.0D0, & + 'IFE burn fraction') + case ('flirad') + call parse_real_variable('flirad', flirad, 0.0D0, 10.0D0, & + 'Radius of FLiBe inlet (HYLIFE) (m)') + case ('frrmax') + call parse_real_variable('frrmax', frrmax, 1.0D-6, 1.0D0, & + 'F-value for IFE repetition rate') + case ('fwdr') + call parse_real_variable('fwdr', fwdr, 0.0D0, 10.0D0, & + 'IFE first wall radial thickness (m)') + case ('fwdzl') + call parse_real_variable('fwdzl', fwdzl, 0.0D0, 10.0D0, & + 'IFE first wall bottom part thickness (m)') + case ('fwdzu') + call parse_real_variable('fwdzu', fwdzu, 0.0D0, 10.0D0, & + 'IFE first wall top part thickness (m)') + case ('fwmatf') ! N.B. actually a 2-D array + call parse_real_array('fwmatf', fwmatf, isub1, 3*(maxmat+1), & + 'IFE first wall material fraction', icode) + case ('gainve') + call parse_real_array('gainve', gainve, isub1, 10, & + 'IFE target gain vs driver energy', icode) + case ('htpmw_ife') + call parse_real_variable('htpmw_ife', htpmw_ife, 0.0D0, 1.0D3, & + 'IFE heat transport system electrical pump power (MW)') + case ('ifedrv') + call parse_int_variable('ifedrv', ifedrv, -1, 3, & + 'IFE driver type') + case ('ifetyp') + call parse_int_variable('ifetyp', ifetyp, 0, 4, & + 'IFE device build type') + case ('mcdriv') + call parse_real_variable('mcdriv', mcdriv, 0.1D0, 10.0D0, & + 'IFE driver cost multiplier') + case ('pdrive') + call parse_real_variable('pdrive', pdrive, 1.0D6, 200.0D6, & + 'IFE driver power to target (W)') + case ('pfusife') + call parse_real_variable('pfusife', pfusife, 0.0D0, 1.0D4, & + 'IFE input fusion power (MW) (ifedrv=3 only)') + case ('pifecr') + call parse_real_variable('pifecr', pifecr, 0.0D0, 100.0D0, & + 'IFE cryogenic power (MW)') + case ('ptargf') + call parse_real_variable('ptargf', ptargf, 0.1D0, 100.0D0, & + 'IFE target factory power at 6Hz (MW)') + case ('rrin') + call parse_real_variable('rrin', rrin, 0.1D0, 50.0D0, & + 'Input IFE repetition rate (Hz) (ifedrv=3 only)') + case ('rrmax') + call parse_real_variable('rrmax', rrmax, 1.0D0, 50.0D0, & + 'Maximum IFE repetition rate (Hz)') + case ('shdr') + call parse_real_variable('shdr', shdr, 0.0D0, 10.0D0, & + 'IFE shield radial thickness (m)') + case ('shdzl') + call parse_real_variable('shdzl', shdzl, 0.0D0, 10.0D0, & + 'IFE shield bottom part thickness (m)') + case ('shdzu') + call parse_real_variable('shdzu', shdzu, 0.0D0, 10.0D0, & + 'IFE shield top part thickness (m)') + case ('shmatf') ! N.B. actually a 2-D array + call parse_real_array('shmatf', shmatf, isub1, 3*(maxmat+1), & + 'IFE shield material fraction', icode) + case ('sombdr') + call parse_real_variable('sombdr', sombdr, 0.0D0, 10.0D0, & + 'Radius of SOMBRERO blanket bottom (m)') + case ('somtdr') + call parse_real_variable('somtdr', somtdr, 0.0D0, 10.0D0, & + 'Radius of SOMBRERO blanket top (m)') + case ('tgain') + call parse_real_variable('tgain', tgain, 1.0D0, 500.0D0, & + 'IFE target gain') + case ('uccarb') + call parse_real_variable('uccarb', uccarb, 10.0D0, 1.0D3, & + 'Cost of carbon cloth ($/kg)') + case ('ucconc') + call parse_real_variable('ucconc', ucconc, 0.1D0, 1.0D3, & + 'Cost of concrete ($/kg)') + case ('ucflib') + call parse_real_variable('ucflib', ucflib, 10.0D0, 1.0D3, & + 'Cost of FLiBe ($/kg)') + case ('uctarg') + call parse_real_variable('uctarg', uctarg, 0.1D0, 1.0D3, & + 'Cost per IFE target ($/target)') + case ('v1dr') + call parse_real_variable('v1dr', v1dr, 0.0D0, 10.0D0, & + 'IFE void 1 radial thickness (m)') + case ('v1dzl') + call parse_real_variable('v1dzl', v1dzl, 0.0D0, 10.0D0, & + 'IFE void 1 bottom part thickness (m)') + case ('v1dzu') + call parse_real_variable('v1dzu', v1dzu, 0.0D0, 10.0D0, & + 'IFE void 1 top part thickness (m)') + case ('v1matf') ! N.B. actually a 2-D array + call parse_real_array('v1matf', v1matf, isub1, 3*(maxmat+1), & + 'IFE void 1 material fraction', icode) + case ('v2dr') + call parse_real_variable('v2dr', v2dr, 0.0D0, 10.0D0, & + 'IFE void 2 radial thickness (m)') + case ('v2dzl') + call parse_real_variable('v2dzl', v2dzl, 0.0D0, 10.0D0, & + 'IFE void 2 bottom part thickness (m)') + case ('v2dzu') + call parse_real_variable('v2dzu', v2dzu, 0.0D0, 10.0D0, & + 'IFE void 2 top part thickness (m)') + case ('v2matf') ! N.B. actually a 2-D array + call parse_real_array('v2matf', v2matf, isub1, 3*(maxmat+1), & + 'IFE void 2 material fraction', icode) + case ('v3dr') + call parse_real_variable('v3dr', v3dr, 0.0D0, 50.0D0, & + 'IFE void 3 radial thickness (m)') + case ('v3dzl') + call parse_real_variable('v3dzl', v3dzl, 0.0D0, 30.0D0, & + 'IFE void 3 bottom part thickness (m)') + case ('v3dzu') + call parse_real_variable('v3dzu', v3dzu, 0.0D0, 30.0D0, & + 'IFE void 3 top part thickness (m)') + case ('v3matf') ! N.B. actually a 2-D array + call parse_real_array('v3matf', v3matf, isub1, 3*(maxmat+1), & + 'IFE void 3 material fraction', icode) + + ! Water usage settings + + case ('airtemp') + call parse_real_variable('airtemp', airtemp, -15.0D0, 40.0D0, & 'ambient air temperature (degrees C)') - case ('watertemp') - call parse_real_variable('watertemp', watertemp, 0.0D0, 25.0D0, & + case ('watertemp') + call parse_real_variable('watertemp', watertemp, 0.0D0, 25.0D0, & 'water temperature (degrees C)') - case ('windspeed') - call parse_real_variable('windspeed', windspeed, 0.0D0, 10.0D0, & + case ('windspeed') + call parse_real_variable('windspeed', windspeed, 0.0D0, 10.0D0, & 'wind speed (m/s)') - ! CS fatigue settings + ! CS fatigue settings - case('residual_sig_hoop') - call parse_real_variable('residual_sig_hoop',residual_sig_hoop, 0.0D0, 1.0D9, & + case('residual_sig_hoop') + call parse_real_variable('residual_sig_hoop',residual_sig_hoop, 0.0D0, 1.0D9, & 'residual hoop stress in strucutal material (Pa) ') - case('n_cycle_min') - call parse_real_variable('n_cycle_min',n_cycle_min, 0.0D0, 1.0D8, & + case('n_cycle_min') + call parse_real_variable('n_cycle_min',n_cycle_min, 0.0D0, 1.0D8, & 'Minimum required cycles for CS') - case('t_crack_radial') - call parse_real_variable('t_crack_radial',t_crack_radial, 1.0D-5, 1.0D0, & + case('t_crack_radial') + call parse_real_variable('t_crack_radial',t_crack_radial, 1.0D-5, 1.0D0, & 'Inital radial crack size (m)') - case('t_crack_vertical') - call parse_real_variable('t_crack_vertical',t_crack_vertical, 1.0D-5, 1.0D0, & + case('t_crack_vertical') + call parse_real_variable('t_crack_vertical',t_crack_vertical, 1.0D-5, 1.0D0, & 'Inital vertical crack size (m)') - case('t_structural_radial') - call parse_real_variable('t_structural_radial',t_structural_radial, 1.0D-3, 1.0D0, & - 'CS structural radial thickness (m)') - case('t_structural_vertical') - call parse_real_variable('t_structural_vertical',t_structural_vertical, 1.0D-3, 1.0D0, & - 'CS structural vertical thickness (m)') - case('ld_ratio_cst') + case('t_structural_radial') + call parse_real_variable('t_structural_radial',t_structural_radial, 1.0D-3, 1.0D0, & + 'CS structural radial thickness (m)') + case('t_structural_vertical') + call parse_real_variable('t_structural_vertical',t_structural_vertical, 1.0D-3, 1.0D0, & + 'CS structural vertical thickness (m)') + case('ld_ratio_cst') call parse_real_variable('ld_ratio_cst',ld_ratio_cst, 0.0D0, 5.0D0, & 'CS coil turn conduit length to depth ratio') - case('bkt_life_csf') + case('bkt_life_csf') call parse_real_variable('bkt_life_csf',bkt_life_csf, 0.0D0, 1.0D0, & 'Switch for bkt_life -> n_cycle_min') - case('sf_vertical_crack') + case('sf_vertical_crack') call parse_real_variable('sf_vertical_crack',sf_vertical_crack, 1.0D0, 1.0D1, & 'Safety factor for vertical crack size (-)') - case('sf_radial_crack') + case('sf_radial_crack') call parse_real_variable('sf_radial_crack',sf_radial_crack, 1.0D0, 1.0D1, & 'Safety factor for radial crack size (-)') - case('sf_fast_fracture') + case('sf_fast_fracture') call parse_real_variable('sf_fast_fracture',sf_fast_fracture, 1.0D0, 1.0D1, & 'safety factor for stress intensity factor (-)') - case('paris_coefficient') + case('paris_coefficient') call parse_real_variable('paris_coefficient',paris_coefficient, 1.0D-20, 1.0D1, & 'Paris equation material coefficient (-)') - case('paris_power_law') + case('paris_power_law') call parse_real_variable('paris_power_law',paris_power_law, 1.0D0, 1.0D1, & 'Paris equation material power law (-)') - case('walker_coefficient') + case('walker_coefficient') call parse_real_variable('walker_coefficient',walker_coefficient, 1.0D-1, 1.0D1, & 'walker coefficient (-)') - case('fracture_toughness') + case('fracture_toughness') call parse_real_variable('fracture_toughness',fracture_toughness, 1.0D-1, 1.0D8, & 'fracture toughness (MPa m^1/2)') - case default - error_message = 'Unknown variable in input file: '//varnam(1:varlen) - write(*,*) error_message - write(*,*) 'Error occurred at this line in the IN.DAT file:', lineno - write(*,*) line - error = .True. + case default + error_message = 'Unknown variable in input file: '//varnam(1:varlen) + write(*,*) error_message + write(*,*) 'Error occurred at this line in the IN.DAT file:', lineno + write(*,*) line + error = .True. - end select variable + end select variable - ! Uncomment the following to abort the code if an obsolete variable name - ! has been found in the input file + ! Uncomment the following to abort the code if an obsolete variable name + ! has been found in the input file - if (obsolete_var) then - error_message = 'Obsolete variable specified' - write(*,*) error_message - write(*,*) 'Error occurred at this line in the IN.DAT file: ', lineno - write(*,*) line - error = .True. - end if + if (obsolete_var) then + error_message = 'Obsolete variable specified' + write(*,*) error_message + write(*,*) 'Error occurred at this line in the IN.DAT file: ', lineno + write(*,*) line + error = .True. + end if - ! If we have just read in an array, a different loop-back is needed + ! If we have just read in an array, a different loop-back is needed - if (icode == -1) goto 20 + if (icode == -1) goto 20 - cycle + cycle - end do loop_over_lines + end do loop_over_lines - if(neqns == 0) then - ! The value of neqns has not been set in the input file. Default = 0. - neqns = no_constraints - nineqns - else - ! The value of neqns has been set in the input file. - nineqns = no_constraints - neqns - end if + if(neqns == 0) then + ! The value of neqns has not been set in the input file. Default = 0. + neqns = no_constraints - nineqns + else + ! The value of neqns has been set in the input file. + nineqns = no_constraints - neqns + end if - nvar = no_iteration + nvar = no_iteration - if (error .eqv. .True.) stop 1 + if (error .eqv. .True.) stop 1 - ! MDK Try allocating here - if (allocated(name_xc)) deallocate(name_xc) - allocate(name_xc(nvar)) - ! Ensure array is initialised - name_xc = "" + ! MDK Try allocating here + if (allocated(name_xc)) deallocate(name_xc) + allocate(name_xc(nvar)) + ! Ensure array is initialised + name_xc = "" - end subroutine parse_input_file + end subroutine parse_input_file - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_real_variable(varnam,varval,vmin,vmax,description) + subroutine parse_real_variable(varnam,varval,vmin,vmax,description) - !! Routine that obtains the value of a real variable from the input - !! file and checks that it lies within the expected range - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output real : value of the variable - !! vmin : input real : minimum allowed value for the variable - !! vmax : input real : maximum allowed value for the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for a real variable, extracting the value from the line - !! and checking whether it lies between user-defined lower and - !! upper limits. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of a real variable from the input + !! file and checks that it lies within the expected range + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output real : value of the variable + !! vmin : input real : minimum allowed value for the variable + !! vmax : input real : maximum allowed value for the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for a real variable, extracting the value from the line + !! and checking whether it lies between user-defined lower and + !! upper limits. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - real(dp), intent(inout) :: varval - real(dp), intent(in) :: vmin, vmax + character(len=*), intent(in) :: varnam, description + real(dp), intent(inout) :: varval + real(dp), intent(in) :: vmin, vmax - ! Local variables + ! Local variables - real(dp) :: oldval + real(dp) :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found at line ', lineno - write(*,*) 'Variable name and description:' - write(*,*) varnam, ', ', description - error = .True. - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found at line ', lineno + write(*,*) 'Variable name and description:' + write(*,*) varnam, ', ', description + error = .True. + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval + oldval = varval - call get_value_real(varval,icode) + call get_value_real(varval,icode) - if (icode /= 0) then - write(*,*) 'Error whilst reading input file. Variable name and description:' - write(*,*) varnam, ', ', description - write(*,*) 'Comments should be indicated by an asterisk' - error = .True. - end if + if (icode /= 0) then + write(*,*) 'Error whilst reading input file. Variable name and description:' + write(*,*) varnam, ', ', description + write(*,*) 'Comments should be indicated by an asterisk' + error = .True. + end if - ! Check variable lies within range + ! Check variable lies within range - call check_range_real(varnam,varval,vmin,vmax) + call check_range_real(varnam,varval,vmin,vmax) - if ((report_changes == 1).and.(varval /= oldval)) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(varval /= oldval)) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_real_variable + end subroutine parse_real_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_int_variable(varnam,varval,vmin,vmax,description) + subroutine parse_int_variable(varnam,varval,vmin,vmax,description) - !! Routine that obtains the value of an integer variable from the - !! input file and checks that it lies within the expected range - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output integer : value of the variable - !! vmin : input integer : minimum allowed value for the variable - !! vmax : input integer : maximum allowed value for the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for an integer variable, extracting the value from the line - !! and checking whether it lies between user-defined lower and - !! upper limits. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of an integer variable from the + !! input file and checks that it lies within the expected range + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output integer : value of the variable + !! vmin : input integer : minimum allowed value for the variable + !! vmax : input integer : maximum allowed value for the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for an integer variable, extracting the value from the line + !! and checking whether it lies between user-defined lower and + !! upper limits. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use constants, only: nout - implicit none + use constants, only: nout + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: varval - integer, intent(in) :: vmin, vmax + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: varval + integer, intent(in) :: vmin, vmax - ! Local variables + ! Local variables - integer :: oldval + integer :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno - write(*,*) 'Name and description of variable: ' - write(*,*) varnam, description - error = .True. - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno + write(*,*) 'Name and description of variable: ' + write(*,*) varnam, description + error = .True. + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval - call get_value_int(varval,icode) - if (icode /= 0) then - write(*,*) 'Error found in input file, check line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + oldval = varval + call get_value_int(varval,icode) + if (icode /= 0) then + write(*,*) 'Error found in input file, check line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - ! Check variable lies within range + ! Check variable lies within range - call check_range_int(varnam,varval,vmin,vmax) + call check_range_int(varnam,varval,vmin,vmax) - if ((report_changes == 1).and.(varval /= oldval)) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(varval /= oldval)) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_int_variable + end subroutine parse_int_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_string_variable(varnam,varval,description) + subroutine parse_string_variable(varnam,varval,description) - !! Routine that obtains the value of a string variable from the - !! input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval : input/output string : value of the variable - !! description : input string : brief description of the variable - !! This routine parses a line containing a 'name = value' pair - !! for a string variable, extracting the value from the line. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the value of a string variable from the + !! input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval : input/output string : value of the variable + !! description : input string : brief description of the variable + !! This routine parses a line containing a 'name = value' pair + !! for a string variable, extracting the value from the line. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - character(len=*), intent(inout) :: varval + character(len=*), intent(in) :: varnam, description + character(len=*), intent(inout) :: varval - ! Local variables + ! Local variables - character(len=maxlen) :: oldval + character(len=maxlen) :: oldval - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - ! and stop if this is the case + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! and stop if this is the case - if (subscript_present) then - write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno - write(*,*) 'Name and description of variable: ' - write(*,*) varnam, description - error = .True. - !stop 1 - end if + if (subscript_present) then + write(*,*) 'Unexpected subscript found in IN.DAT at line number: ', lineno + write(*,*) 'Name and description of variable: ' + write(*,*) varnam, description + error = .True. + !stop 1 + end if - ! Obtain the new value for the variable + ! Obtain the new value for the variable - oldval = varval - call get_substring(varval,icode) - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + oldval = varval + call get_substring(varval,icode) + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - if ((report_changes == 1).and.(trim(varval) /= trim(oldval))) then - write(outfile,*) trim(description),', ',trim(varnam),' = ',varval - end if + if ((report_changes == 1).and.(trim(varval) /= trim(oldval))) then + write(outfile,*) trim(description),', ',trim(varnam),' = ',varval + end if - end subroutine parse_string_variable + end subroutine parse_string_variable - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine parse_real_array(varnam,varval,isub1,n,description,icode) + subroutine parse_real_array(varnam,varval,isub1,n,description,icode) - !! Routine that obtains the values of a real array from the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval(n) : input/output real array : value of the variable - !! isub1 : input integer : array element pointer - !! n : input integer : size of varval array - !! icode : output integer : diagnostic flag - !! description : input string : brief description of the variable - !! This routine parses a line in one of the two following forms: - !!

-      !! name = v1[, v2, ...]
-      !! name(element) = v
-      !! 
- !! to read in and extract one or more values for a real 1-D array. - !!

N.B. No array bounds or value range checking is performed. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that obtains the values of a real array from the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval(n) : input/output real array : value of the variable + !! isub1 : input integer : array element pointer + !! n : input integer : size of varval array + !! icode : output integer : diagnostic flag + !! description : input string : brief description of the variable + !! This routine parses a line in one of the two following forms: + !!

+    !! name = v1[, v2, ...]
+    !! name(element) = v
+    !! 
+ !! to read in and extract one or more values for a real 1-D array. + !!

N.B. No array bounds or value range checking is performed. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: isub1 - integer, intent(in) :: n - integer, intent(out) :: icode - real(dp), dimension(n), intent(inout) :: varval + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: isub1 + integer, intent(in) :: n + integer, intent(out) :: icode + real(dp), dimension(n), intent(inout) :: varval - ! Local variables + ! Local variables - real(dp) :: oldval, val + real(dp) :: oldval, val - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - if (subscript_present) then + if (subscript_present) then - oldval = varval(isub1) - call get_value_real(val,icode) + oldval = varval(isub1) + call get_value_real(val,icode) - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - - else - - isub1 = 1 - do - call get_value_real(val,icode) - ! icode == 1 denotes an error - ! icode == -1 denotes end of line, so the next line needs to be read in - ! (hence the 'goto 20' in the calling routine) - if (icode /= 0) return - - oldval = varval(isub1) - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + + else + + isub1 = 1 + do + call get_value_real(val,icode) + ! icode == 1 denotes an error + ! icode == -1 denotes end of line, so the next line needs to be read in + ! (hence the 'goto 20' in the calling routine) + if (icode /= 0) return + + oldval = varval(isub1) + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - isub1 = isub1 + 1 - end do - end if - -10 format(a,a,a,a1,i3,a,e14.6e2) - - end subroutine parse_real_array - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine parse_int_array(varnam,varval,isub1,n,description,icode,startindex) - - !! Routine that obtains the values of an integer array - !! from the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : input string : name of the variable - !! varval(n) : input/output integer array : value of the variable - !! isub1 : input integer : array element pointer - !! n : input integer : size of varval array - !! icode : output integer : diagnostic flag - !! description : input string : brief description of the variable - !! This routine parses a line in one of the two following forms: - !!

-      !! name = v1[, v2, ...]
-      !! name(element) = v
-      !! 
- !! to read in and extract one or more values for an integer 1-D array. - !!

N.B. No array bounds or value range checking is performed. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - implicit none - - ! Arguments - character(len=*), intent(in) :: varnam, description - integer, intent(inout) :: isub1 - integer, intent(in) :: n - integer, intent(out) :: icode - integer, dimension(n), intent(inout) :: varval - integer, intent(in), optional :: startindex - - ! Local variables - integer :: oldval, val - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME - - if (subscript_present) then - - oldval = varval(isub1) - call get_value_int(val,icode) - - if (icode /= 0) then - write(*,*) 'Error in IN.DAT found at line ',lineno - write(*,*) 'Variable name, description:' - write(*,*) varnam, ', ', description - error = .True. - end if - - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + isub1 = isub1 + 1 + end do + end if + +10 format(a,a,a,a1,i3,a,e14.6e2) + + end subroutine parse_real_array + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine parse_int_array(varnam,varval,isub1,n,description,icode,startindex) + + !! Routine that obtains the values of an integer array + !! from the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : input string : name of the variable + !! varval(n) : input/output integer array : value of the variable + !! isub1 : input integer : array element pointer + !! n : input integer : size of varval array + !! icode : output integer : diagnostic flag + !! description : input string : brief description of the variable + !! This routine parses a line in one of the two following forms: + !!

+    !! name = v1[, v2, ...]
+    !! name(element) = v
+    !! 
+ !! to read in and extract one or more values for an integer 1-D array. + !!

N.B. No array bounds or value range checking is performed. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + implicit none + + ! Arguments + character(len=*), intent(in) :: varnam, description + integer, intent(inout) :: isub1 + integer, intent(in) :: n + integer, intent(out) :: icode + integer, dimension(n), intent(inout) :: varval + integer, intent(in), optional :: startindex + + ! Local variables + integer :: oldval, val + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ! Check whether a subscript was found by the preceding call to GET_VARIABLE_NAME + + if (subscript_present) then + + oldval = varval(isub1) + call get_value_int(val,icode) + + if (icode /= 0) then + write(*,*) 'Error in IN.DAT found at line ',lineno + write(*,*) 'Variable name, description:' + write(*,*) varnam, ', ', description + error = .True. + end if + + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - - else ! subscript is not present - - isub1 = 1 - if(present(startindex))isub1 = startindex - do - call get_value_int(val,icode) - - ! icode == 1 denotes an error - ! icode == -1 denotes end of line - if (icode /= 0) then - ! Make sure isub1 = the last array index - isub1 = isub1 - 1 - return - end if - - oldval = varval(isub1) - varval(isub1) = val - if ((report_changes == 1).and.(varval(isub1) /= oldval)) then - write(outfile,10) trim(description),', ', & + end if + + else ! subscript is not present + + isub1 = 1 + if(present(startindex))isub1 = startindex + do + call get_value_int(val,icode) + + ! icode == 1 denotes an error + ! icode == -1 denotes end of line + if (icode /= 0) then + ! Make sure isub1 = the last array index + isub1 = isub1 - 1 + return + end if + + oldval = varval(isub1) + varval(isub1) = val + if ((report_changes == 1).and.(varval(isub1) /= oldval)) then + write(outfile,10) trim(description),', ', & trim(varnam),'(',isub1,') = ',varval(isub1) - end if - isub1 = isub1 + 1 - end do - - end if - -10 format(a,a,a,a1,i3,a,i12) - - end subroutine parse_int_array - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine string_to_int(string,length,ivar,icode) - - !! Routine that converts the ASCII digits in a string to - !! an integer - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : contains digits of the number - !! length : input integer : useful length of character string - !! ivar : output integer : value stored in the string - !! icode : output integer : diagnostic flag - !! This routine converts the ASCII digits in string(1:length) - !! to the integer ivar. It is equivalent to doing - !! 'READ(STRING(1:LENGTH),I) IVAR' but this routine conforms - !! to the ANSI standard. - !! Each digit is parsed in turn, the current total is multiplied - !! by ten and the new digit is added. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - implicit none - - ! Arguments - - character(len=*), intent(in) :: string - integer, intent(in) :: length - integer, intent(out) :: ivar, icode - - ! Local variables - - character(len=maxlen) :: xstr - integer :: iptr,izero,xlen - logical :: negate - - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - ivar = 0 - icode = 0 - - if (length <= 0) goto 1000 - - negate = .false. - izero = ichar('0') - iptr = 1 - xstr = string(1:length) - - ! *** Ignore trailing spaces - - xlen = len_trim(xstr) - if (xlen <= 0) goto 1000 - - ! *** Ignore leading spaces - -10 continue - if (xstr(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - goto 10 - end if - - ! *** Check for leading + or - - - if (xstr(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - else if (xstr(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - else - continue - end if - - ! *** Ignore leading zeros + end if + isub1 = isub1 + 1 + end do + + end if + +10 format(a,a,a,a1,i3,a,i12) + + end subroutine parse_int_array + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine string_to_int(string,length,ivar,icode) + + !! Routine that converts the ASCII digits in a string to + !! an integer + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : contains digits of the number + !! length : input integer : useful length of character string + !! ivar : output integer : value stored in the string + !! icode : output integer : diagnostic flag + !! This routine converts the ASCII digits in string(1:length) + !! to the integer ivar. It is equivalent to doing + !! 'READ(STRING(1:LENGTH),I) IVAR' but this routine conforms + !! to the ANSI standard. + !! Each digit is parsed in turn, the current total is multiplied + !! by ten and the new digit is added. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + implicit none + + ! Arguments + + character(len=*), intent(in) :: string + integer, intent(in) :: length + integer, intent(out) :: ivar, icode + + ! Local variables + + character(len=maxlen) :: xstr + integer :: iptr,izero,xlen + logical :: negate + + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + ivar = 0 + icode = 0 + + if (length <= 0) goto 1000 + + negate = .false. + izero = ichar('0') + iptr = 1 + xstr = string(1:length) + + ! *** Ignore trailing spaces + + xlen = len_trim(xstr) + if (xlen <= 0) goto 1000 + + ! *** Ignore leading spaces + +10 continue + if (xstr(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + goto 10 + end if + + ! *** Check for leading + or - + + if (xstr(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + else if (xstr(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + else + continue + end if + + ! *** Ignore leading zeros + +20 continue + if (xstr(iptr:iptr) == '0') then + iptr = iptr + 1 + if (iptr > xlen) goto 1000 + goto 20 + end if + + ! *** Check for number too large + + if ((xlen-iptr+1) > 10) then + if (negate) then + ivar = -1234567890 + else + ivar = 1234567890 + write(*,*) '1 Problem with IN file, please check line' + write(*,*) xstr + error = .True. + end if + icode = 1 + goto 1000 + else if ((xlen-iptr+1) == 10) then + if (xstr(iptr:xlen) > '2147483647') then + if (negate) then + ivar = -1234567890 + else + ivar = 1234567890 + end if + icode = 1 + goto 1000 + end if + else + continue + end if -20 continue - if (xstr(iptr:iptr) == '0') then - iptr = iptr + 1 - if (iptr > xlen) goto 1000 - goto 20 - end if + ! *** Parse the digits - ! *** Check for number too large +30 continue + if ((xstr(iptr:iptr) >= '0').and.(xstr(iptr:iptr) <= '9')) then + ivar = (ivar * 10) + (ichar(xstr(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr <= xlen) goto 30 - if ((xlen-iptr+1) > 10) then - if (negate) then - ivar = -1234567890 - else - ivar = 1234567890 - write(*,*) '1 Problem with IN file, please check line' - write(*,*) xstr - error = .True. - end if - icode = 1 - goto 1000 - else if ((xlen-iptr+1) == 10) then - if (xstr(iptr:xlen) > '2147483647') then - if (negate) then - ivar = -1234567890 - else - ivar = 1234567890 - end if - icode = 1 - goto 1000 - end if - else - continue - end if - - ! *** Parse the digits - -30 continue - if ((xstr(iptr:iptr) >= '0').and.(xstr(iptr:iptr) <= '9')) then - ivar = (ivar * 10) + (ichar(xstr(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr <= xlen) goto 30 - - ! *** This is the normal exit path... - - if (negate) ivar = -ivar + ! *** This is the normal exit path... - else - if(ivar /= 0) then - write(*,*) 'Problem with IN file, please check line' - write(*,*) xstr - write(*,*) 'Comments should be indicated by an asterisk (*)' - error = .True. - end if - icode = 1 - end if + if (negate) ivar = -ivar -1000 continue + else + if(ivar /= 0) then + write(*,*) 'Problem with IN file, please check line' + write(*,*) xstr + write(*,*) 'Comments should be indicated by an asterisk (*)' + error = .True. + end if + icode = 1 + end if - end subroutine string_to_int +1000 continue - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end subroutine string_to_int - subroutine string_to_real(string,length,rval,icode) + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that converts the ASCII digits in a string to - !! a real value - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : contains digits of the number - !! length : input integer : useful length of character string - !! rvar : output real : value stored in the string - !! icode : output integer : diagnostic flag - !! This routine converts the ASCII digits in string(1:length) - !! to the real variable rvar. - !! The string is parsed one character at a time, from the left, - !! handling the mantissa, and all other components of the real - !! number separately, combining them at the end. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine string_to_real(string,length,rval,icode) - implicit none + !! Routine that converts the ASCII digits in a string to + !! a real value + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : contains digits of the number + !! length : input integer : useful length of character string + !! rvar : output real : value stored in the string + !! icode : output integer : diagnostic flag + !! This routine converts the ASCII digits in string(1:length) + !! to the real variable rvar. + !! The string is parsed one character at a time, from the left, + !! handling the mantissa, and all other components of the real + !! number separately, combining them at the end. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + implicit none + + ! Arguments - ! Arguments + character(len=*), intent(in) :: string + integer, intent(in) :: length + real(dp), intent(out) :: rval + integer, intent(out) :: icode + + ! Local variables + + real(dp) :: valbdp,valadp,xfact + integer :: iptr,izero,iexpon + logical :: negatm,negate - character(len=*), intent(in) :: string - integer, intent(in) :: length - real(dp), intent(out) :: rval - integer, intent(out) :: icode + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Local variables + iptr = 1 - real(dp) :: valbdp,valadp,xfact - integer :: iptr,izero,iexpon - logical :: negatm,negate + ! *** Ignore leading spaces - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +10 continue + if (string(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= length) goto 10 + end if - iptr = 1 + ! *** Initialise real value - ! *** Ignore leading spaces + rval = 0.0D0 -10 continue - if (string(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= length) goto 10 - end if + ! *** ASCII '0' - ! *** Initialise real value + izero = ichar('0') - rval = 0.0D0 + ! *** If negative mantissa - ! *** ASCII '0' + negatm = .false. - izero = ichar('0') + ! *** If negative exponent - ! *** If negative mantissa + negate = .false. - negatm = .false. + ! *** Value before decimal point - ! *** If negative exponent + valbdp = 0.0D0 - negate = .false. + ! *** Value after decimal point - ! *** Value before decimal point + valadp = 0.0D0 - valbdp = 0.0D0 + ! *** Exponent - ! *** Value after decimal point + iexpon = 0 - valadp = 0.0D0 + ! *** First character can be +, -, ., or - ! *** Exponent + if (string(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > length) goto 50 + else if (string(iptr:iptr) == '-') then + iptr = iptr + 1 + if (iptr > length) goto 50 + negatm = .true. + else + continue + end if - iexpon = 0 + ! *** Parse the mantissa - before the decimal point - ! *** First character can be +, -, ., or + valbdp = 0.0D0 + xfact = 0.1D0 +20 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + valbdp = (valbdp * 10.0D0) + dble(ichar(string(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr > length) goto 50 + goto 20 + end if - if (string(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > length) goto 50 - else if (string(iptr:iptr) == '-') then - iptr = iptr + 1 - if (iptr > length) goto 50 - negatm = .true. - else - continue - end if + ! *** After the mantissa, we expect '.' or 'd' or 'e' - ! *** Parse the mantissa - before the decimal point + if (string(iptr:iptr) == '.') then + iptr = iptr + 1 + if (iptr > length) goto 50 + end if - valbdp = 0.0D0 - xfact = 0.1D0 -20 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - valbdp = (valbdp * 10.0D0) + dble(ichar(string(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr > length) goto 50 - goto 20 - end if + ! *** Parse the mantissa - after the decimal point - ! *** After the mantissa, we expect '.' or 'd' or 'e' + valadp = 0.0D0 +30 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + valadp = valadp + (dble(ichar(string(iptr:iptr))-izero)*xfact) + xfact = xfact * 0.1D0 + iptr = iptr + 1 + if (iptr > length) goto 50 + goto 30 + end if - if (string(iptr:iptr) == '.') then - iptr = iptr + 1 - if (iptr > length) goto 50 - end if + ! *** Now we expect the exponent - ! *** Parse the mantissa - after the decimal point - - valadp = 0.0D0 -30 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - valadp = valadp + (dble(ichar(string(iptr:iptr))-izero)*xfact) - xfact = xfact * 0.1D0 - iptr = iptr + 1 - if (iptr > length) goto 50 - goto 30 - end if - - ! *** Now we expect the exponent - - if ( (string(iptr:iptr) == 'D').or. & + if ( (string(iptr:iptr) == 'D').or. & (string(iptr:iptr) == 'E').or. & (string(iptr:iptr) == 'd').or. & (string(iptr:iptr) == 'e')) then - iptr = iptr + 1 - if (iptr > length) goto 50 - - ! *** First character can be +, -, ., or - - if (string(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > length) goto 50 - else if (string(iptr:iptr) == '-') then - iptr = iptr + 1 - if (iptr > length) goto 50 - negate = .true. - else - continue - end if + iptr = iptr + 1 + if (iptr > length) goto 50 - ! *** Parse the exponent + ! *** First character can be +, -, ., or -40 continue - if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then - iexpon = (iexpon * 10) + (ichar(string(iptr:iptr))-izero) - iptr = iptr + 1 - if (iptr <= length) goto 40 - else - goto 60 - end if - else - goto 60 - end if + if (string(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > length) goto 50 + else if (string(iptr:iptr) == '-') then + iptr = iptr + 1 + if (iptr > length) goto 50 + negate = .true. + else + continue + end if + + ! *** Parse the exponent -50 continue +40 continue + if ((string(iptr:iptr) >= '0').and.(string(iptr:iptr) <= '9')) then + iexpon = (iexpon * 10) + (ichar(string(iptr:iptr))-izero) + iptr = iptr + 1 + if (iptr <= length) goto 40 + else + goto 60 + end if + else + goto 60 + end if - ! *** Negative exponent? +50 continue - if (negate) iexpon = -iexpon + ! *** Negative exponent? - ! *** Build the number at last + if (negate) iexpon = -iexpon - if (iexpon == 0) then - rval = (valbdp + valadp) - else - rval = (valbdp + valadp) * (10.0D0 ** iexpon) - end if + ! *** Build the number at last - ! *** Negative mantissa? + if (iexpon == 0) then + rval = (valbdp + valadp) + else + rval = (valbdp + valadp) * (10.0D0 ** iexpon) + end if - if (negatm) rval = -rval + ! *** Negative mantissa? - ! *** All OK + if (negatm) rval = -rval - icode = 0 - goto 1000 + ! *** All OK - ! *** Errors + icode = 0 + goto 1000 -60 continue + ! *** Errors - write(*,*) 'Problem with IN file, please check line' - write(*,*) string - write(*,*) 'Comments should be indicated by an asterisk (*)' - error = .True. +60 continue - icode = 1 + write(*,*) 'Problem with IN file, please check line' + write(*,*) string + write(*,*) 'Comments should be indicated by an asterisk (*)' + error = .True. -1000 continue + icode = 1 - end subroutine string_to_real +1000 continue - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + end subroutine string_to_real - subroutine get_value_int(ival,icode) + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! Routine that extracts an integer value from a line of the - !! input file - !! author: P J Knight, CCFE, Culham Science Centre - !! ival : output integer : extracted integer value - !! icode : output integer : diagnostic flag - !! This routine extracts an integer value from the current line of - !! the input file, i.e. the value of an integer variable as - !! specified by the user. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine get_value_int(ival,icode) - implicit none + !! Routine that extracts an integer value from a line of the + !! input file + !! author: P J Knight, CCFE, Culham Science Centre + !! ival : output integer : extracted integer value + !! icode : output integer : diagnostic flag + !! This routine extracts an integer value from the current line of + !! the input file, i.e. the value of an integer variable as + !! specified by the user. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Arguments + implicit none - integer, intent(out) :: ival, icode + ! Arguments - ! Local variables + integer, intent(out) :: ival, icode - character(len=maxlen) :: varval - integer :: varlen - integer :: foundComma, foundAst, foundPoint + ! Local variables - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + character(len=maxlen) :: varval + integer :: varlen + integer :: foundComma, foundAst, foundPoint - ! *** Ignore leading spaces + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if + ! *** Ignore leading spaces - if (iptr > linelen) goto 60 +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if + + if (iptr > linelen) goto 60 ! 40 continue !KE I guess I can remove this too - ! *** Put rest of line into varval (makes it easier to parse) + ! *** Put rest of line into varval (makes it easier to parse) - varval = line(iptr:) + varval = line(iptr:) - ! *** Exclude any input after * or , - these denote an input comment + ! *** Exclude any input after * or , - these denote an input comment - varlen = len_trim(varval) - foundComma = varlen - foundAst = varlen - foundPoint = 0 + varlen = len_trim(varval) + foundComma = varlen + foundAst = varlen + foundPoint = 0 - if (index(varval,',') > 0) then - foundComma = index(varval,',') - 1 - end if - if (index(varval,'*') > 0) then - foundAst = index(varval,'*') - 1 - end if - varlen = min(varlen, foundComma, foundAst) + if (index(varval,',') > 0) then + foundComma = index(varval,',') - 1 + end if + if (index(varval,'*') > 0) then + foundAst = index(varval,'*') - 1 + end if + varlen = min(varlen, foundComma, foundAst) - if (varlen <= 0) varlen = index(varval,' ') - 1 - if (varlen <= 0) varlen = iptr + if (varlen <= 0) varlen = index(varval,' ') - 1 + if (varlen <= 0) varlen = iptr - varval = varval(:varlen) + varval = varval(:varlen) - varlen = len_trim(varval) + varlen = len_trim(varval) - foundPoint = index(varval,'.') - 1 - if (foundPoint > 0) then - varlen = foundPoint - write(*,*) 'Integer value expected in following input line...' - write(*,*) ' ',line(1:50),'...' - error = .True. - end if + foundPoint = index(varval,'.') - 1 + if (foundPoint > 0) then + varlen = foundPoint + write(*,*) 'Integer value expected in following input line...' + write(*,*) ' ',line(1:50),'...' + error = .True. + end if - ! *** Update pointer + ! *** Update pointer - iptr = iptr + varlen + iptr = iptr + varlen - ! *** Ignore trailing spaces + ! *** Ignore trailing spaces -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - ! *** Ignore comma, if present + ! *** Ignore comma, if present - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - ! *** Convert the ASCII text into an integer value + ! *** Convert the ASCII text into an integer value - call string_to_int(varval,varlen,ival,icode) + call string_to_int(varval,varlen,ival,icode) - goto 1000 + goto 1000 -60 continue - icode = 1 +60 continue + icode = 1 -1000 continue +1000 continue - end subroutine get_value_int + end subroutine get_value_int - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_value_real(rval,icode) + subroutine get_value_real(rval,icode) - !! Routine that extracts a real value from a line of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! rval : output real : extracted real value - !! icode : output integer : diagnostic flag - !! This routine extracts a real value from the current line of - !! the input file, i.e. the value of a real variable as specified - !! by the user. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts a real value from a line of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! rval : output real : extracted real value + !! icode : output integer : diagnostic flag + !! This routine extracts a real value from the current line of + !! the input file, i.e. the value of a real variable as specified + !! by the user. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: icode - real(dp), intent(out) :: rval + integer, intent(out) :: icode + real(dp), intent(out) :: rval - ! Local variables + ! Local variables - character(len=maxlen) :: varval - integer :: varlen - integer :: foundComma, foundAst + character(len=maxlen) :: varval + integer :: varlen + integer :: foundComma, foundAst - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Ignore leading spaces + ! *** Ignore leading spaces -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if - if (iptr > linelen) goto 60 +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if + if (iptr > linelen) goto 60 - ! *** Put rest of line into varval (makes it easier to parse) + ! *** Put rest of line into varval (makes it easier to parse) - varval = line(iptr:) + varval = line(iptr:) - ! *** Exclude any input after * or , - these denote an input comment + ! *** Exclude any input after * or , - these denote an input comment - varlen = len_trim(varval) - foundComma = varlen - foundAst = varlen + varlen = len_trim(varval) + foundComma = varlen + foundAst = varlen - if (index(varval,',') > 0) then - foundComma = index(varval,',') - 1 - end if - if (index(varval,'*') > 0) then - foundAst = index(varval,'*') - 1 - end if - varlen = min(varlen, foundComma, foundAst) + if (index(varval,',') > 0) then + foundComma = index(varval,',') - 1 + end if + if (index(varval,'*') > 0) then + foundAst = index(varval,'*') - 1 + end if + varlen = min(varlen, foundComma, foundAst) - if (varlen <= 0) varlen = index(varval,' ') - 1 - if (varlen <= 0) varlen = iptr + if (varlen <= 0) varlen = index(varval,' ') - 1 + if (varlen <= 0) varlen = iptr - varval = varval(:varlen) + varval = varval(:varlen) - varlen = len_trim(varval) + varlen = len_trim(varval) - ! *** Update pointer + ! *** Update pointer - iptr = iptr + varlen + iptr = iptr + varlen - ! *** Ignore trailing spaces + ! *** Ignore trailing spaces -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - ! *** Ignore comma, if present + ! *** Ignore comma, if present - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - ! *** Convert the ASCII text into a real value + ! *** Convert the ASCII text into a real value - call string_to_real(varval,varlen,rval,icode) + call string_to_real(varval,varlen,rval,icode) - goto 1000 + goto 1000 -60 continue - icode = 1 +60 continue + icode = 1 -1000 continue +1000 continue - end subroutine get_value_real + end subroutine get_value_real - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_substring(string,icode) + subroutine get_substring(string,icode) - !! Routine that extracts a substring from a line of the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! string : output string : extracted string - !! icode : output integer : diagnostic flag - !! This routine extracts a string from the current line of - !! the input file, i.e. the value of a string variable as specified - !! by the user. Unlike routine - !! get_substring_trim, - !! this routine does not truncate the string found at its first - !! non-leading blank. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts a substring from a line of the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! string : output string : extracted string + !! icode : output integer : diagnostic flag + !! This routine extracts a string from the current line of + !! the input file, i.e. the value of a string variable as specified + !! by the user. Unlike routine + !! get_substring_trim, + !! this routine does not truncate the string found at its first + !! non-leading blank. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: icode - character(len=*), intent(out) :: string + integer, intent(out) :: icode + character(len=*), intent(out) :: string - ! Local variables + ! Local variables - character(len=maxlen) :: varval - integer :: varlen + character(len=maxlen) :: varval + integer :: varlen - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Ignore leading spaces + ! *** Ignore leading spaces -10 continue - if (iptr <= linelen) then - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - goto 10 - end if - end if - if (iptr > linelen) goto 60 +10 continue + if (iptr <= linelen) then + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + goto 10 + end if + end if + if (iptr > linelen) goto 60 - ! *** Put rest of line into varval (makes it easier to parse) + ! *** Put rest of line into varval (makes it easier to parse) - varval = line(iptr:) - varlen = len_trim(varval) + varval = line(iptr:) + varlen = len_trim(varval) - if (varlen <= 0) varlen = iptr + if (varlen <= 0) varlen = iptr - ! *** Update pointer + ! *** Update pointer - iptr = iptr + varlen + iptr = iptr + varlen - ! *** Ignore trailing spaces + ! *** Ignore trailing spaces -50 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 50 - end if +50 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 50 + end if - ! *** Ignore comma, if present + ! *** Ignore comma, if present - if (iptr <= linelen) then - if (line(iptr:iptr) == ',') iptr = iptr + 1 - end if + if (iptr <= linelen) then + if (line(iptr:iptr) == ',') iptr = iptr + 1 + end if - ! *** Write the text into the variable + ! *** Write the text into the variable - string = varval + string = varval - goto 1000 + goto 1000 -60 continue - icode = 1 +60 continue + icode = 1 -1000 continue +1000 continue - end subroutine get_substring + end subroutine get_substring - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_subscript(isub1,isub2,icode) + subroutine get_subscript(isub1,isub2,icode) - !! Routine that extracts any subscripts present in a line of - !! the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! isub1 : output integer : first subscript found - !! isub2 : output integer : second subscript found - !! icode : output integer : diagnostic flag - !! This routine extracts any subscripts from the current line of - !! the input file, i.e. if any array elements are specified - !! by the user. It looks at the next non-space character in the - !! line, and if it is a left bracket, it assumes that at - !! least one subscript is to follow and extracts it/them. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts any subscripts present in a line of + !! the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! isub1 : output integer : first subscript found + !! isub2 : output integer : second subscript found + !! icode : output integer : diagnostic flag + !! This routine extracts any subscripts from the current line of + !! the input file, i.e. if any array elements are specified + !! by the user. It looks at the next non-space character in the + !! line, and if it is a left bracket, it assumes that at + !! least one subscript is to follow and extracts it/them. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: isub1, isub2, icode + integer, intent(out) :: isub1, isub2, icode - ! Local variables + ! Local variables - integer :: izero - logical :: negate + integer :: izero + logical :: negate - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Initial values + ! *** Initial values - isub1 = 0 - isub2 = 0 + isub1 = 0 + isub2 = 0 - ! *** First character should be '(' + ! *** First character should be '(' - if (line(iptr:iptr) /= '(') goto 70 - iptr = iptr + 1 - if (iptr > linelen) goto 80 + if (line(iptr:iptr) /= '(') goto 70 + iptr = iptr + 1 + if (iptr > linelen) goto 80 - ! *** Parse the first subscript - ! *** Ignore leading spaces + ! *** Parse the first subscript + ! *** Ignore leading spaces -10 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 10 - end if +10 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 10 + end if - izero = ichar('0') - negate = .false. + izero = ichar('0') + negate = .false. - ! *** Extract and evaluate the first subscript - ! *** Subscript may be prefaced by '+' or '-' + ! *** Extract and evaluate the first subscript + ! *** Subscript may be prefaced by '+' or '-' - if (line(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else if (line(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else - continue - end if + if (line(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else if (line(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else + continue + end if -20 continue +20 continue - if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then - isub1 = isub1 * 10 + ichar(line(iptr:iptr)) - izero - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 20 - end if - if (negate) isub1 = -isub1 + if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then + isub1 = isub1 * 10 + ichar(line(iptr:iptr)) - izero + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 20 + end if + if (negate) isub1 = -isub1 - ! *** Ignore trailing spaces of first subscript + ! *** Ignore trailing spaces of first subscript -30 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 70 - goto 30 - end if +30 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 70 + goto 30 + end if - ! *** Is there a second subscript? + ! *** Is there a second subscript? - if (line(iptr:iptr) == ',') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 + if (line(iptr:iptr) == ',') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 - ! *** Ignore leading spaces of second subscript + ! *** Ignore leading spaces of second subscript -40 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 40 - end if +40 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 40 + end if - ! *** Extract and evaluate the second subscript - - negate = .false. + ! *** Extract and evaluate the second subscript - ! *** Subscript may be prefaced by '+' or '-' + negate = .false. - if (line(iptr:iptr) == '+') then - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else if (line(iptr:iptr) == '-') then - negate = .true. - iptr = iptr + 1 - if (iptr > linelen) goto 80 - else - continue - end if -50 continue - if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then - isub2 = isub2 * 10 + ichar(line(iptr:iptr)) - izero - iptr = iptr + 1 - if (iptr > linelen) goto 80 - goto 50 - end if + ! *** Subscript may be prefaced by '+' or '-' + + if (line(iptr:iptr) == '+') then + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else if (line(iptr:iptr) == '-') then + negate = .true. + iptr = iptr + 1 + if (iptr > linelen) goto 80 + else + continue + end if +50 continue + if ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) then + isub2 = isub2 * 10 + ichar(line(iptr:iptr)) - izero + iptr = iptr + 1 + if (iptr > linelen) goto 80 + goto 50 + end if - ! *** Is it a negative subscript? + ! *** Is it a negative subscript? - if (negate) isub2 = -isub2 + if (negate) isub2 = -isub2 - ! *** Ignore trailing spaces of second subscript + ! *** Ignore trailing spaces of second subscript -60 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 60 - end if +60 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 60 + end if - end if + end if - ! *** Must end with ')' + ! *** Must end with ')' - if (line(iptr:iptr) /= ')') goto 80 - iptr = iptr + 1 + if (line(iptr:iptr) /= ')') goto 80 + iptr = iptr + 1 -70 continue - icode = 0 - goto 1000 +70 continue + icode = 0 + goto 1000 -80 continue - icode = 1 +80 continue + icode = 1 -1000 continue +1000 continue - end subroutine get_subscript + end subroutine get_subscript - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine get_variable_name(varnam,varlen,isub1,isub2) + subroutine get_variable_name(varnam,varlen,isub1,isub2) - !! Routine that extracts a variable name from a line of - !! the input file - !! author: P J Knight, CCFE, Culham Science Centre - !! varnam : output string : extracted variable name - !! varlen : output integer : length of variable name - !! isub1 : output integer : first subscript found - !! isub2 : output integer : second subscript found - !! This routine extracts a variable name from the current line of - !! the input file. It also extracts any subscripts present. - !! On exit, the counter iptr points to the first - !! character of the value to be assigned to the variable. - !! If the routine finds an error a value of 0 is returned in - !! variable varlen. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that extracts a variable name from a line of + !! the input file + !! author: P J Knight, CCFE, Culham Science Centre + !! varnam : output string : extracted variable name + !! varlen : output integer : length of variable name + !! isub1 : output integer : first subscript found + !! isub2 : output integer : second subscript found + !! This routine extracts a variable name from the current line of + !! the input file. It also extracts any subscripts present. + !! On exit, the counter iptr points to the first + !! character of the value to be assigned to the variable. + !! If the routine finds an error a value of 0 is returned in + !! variable varlen. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - integer, intent(out) :: varlen, isub1, isub2 - character(len=*), intent(out) :: varnam + integer, intent(out) :: varlen, isub1, isub2 + character(len=*), intent(out) :: varnam - ! Local variables + ! Local variables - character(len=maxlen) :: line1 - integer :: ifrom,ito,icode + character(len=maxlen) :: line1 + integer :: ifrom,ito,icode - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! *** Store LINE in local variable + ! *** Store LINE in local variable - line1 = line + line1 = line - ! *** Convert string to lower case + ! *** Convert string to lower case - call lower_case(line) + call lower_case(line) - varlen = 0 - ifrom = iptr + varlen = 0 + ifrom = iptr - ! *** First character must be alphabetic + ! *** First character must be alphabetic - if ((line(iptr:iptr) < 'a').or.(line(iptr:iptr) > 'z')) goto 1000 - iptr = iptr + 1 - if (iptr > linelen) goto 1000 + if ((line(iptr:iptr) < 'a').or.(line(iptr:iptr) > 'z')) goto 1000 + iptr = iptr + 1 + if (iptr > linelen) goto 1000 - ! *** Now parse the rest of the letters (must be alphanumeric or _ ) + ! *** Now parse the rest of the letters (must be alphanumeric or _ ) -10 continue - if ( ((line(iptr:iptr) >= 'a').and.(line(iptr:iptr) <= 'z')).or. & +10 continue + if ( ((line(iptr:iptr) >= 'a').and.(line(iptr:iptr) <= 'z')).or. & ((line(iptr:iptr) == '_')).or. & ((line(iptr:iptr) >= '0').and.(line(iptr:iptr) <= '9')) ) then - iptr = iptr + 1 - if (iptr <= linelen) goto 10 - end if + iptr = iptr + 1 + if (iptr <= linelen) goto 10 + end if - ! *** Extract variable name + ! *** Extract variable name - ito = iptr - 1 - varlen = ito - ifrom + 1 - if (varlen > 0) varnam = line(ifrom:ito) + ito = iptr - 1 + varlen = ito - ifrom + 1 + if (varlen > 0) varnam = line(ifrom:ito) - ! *** Ignore intervening spaces + ! *** Ignore intervening spaces -20 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 20 - end if +20 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 20 + end if - ! *** Now extract any subscript + ! *** Now extract any subscript - call get_subscript(isub1,isub2,icode) - if (icode /= 0) then - varlen = 0 - goto 1000 - end if + call get_subscript(isub1,isub2,icode) + if (icode /= 0) then + varlen = 0 + goto 1000 + end if - ! *** Ignore intervening spaces + ! *** Ignore intervening spaces -30 continue - if (line(iptr:iptr) == ' ') then - iptr = iptr + 1 - if (iptr <= linelen) goto 30 - end if +30 continue + if (line(iptr:iptr) == ' ') then + iptr = iptr + 1 + if (iptr <= linelen) goto 30 + end if - ! *** We now expect '=' + ! *** We now expect '=' - if (line(iptr:iptr) == '=') then - iptr = iptr + 1 + if (line(iptr:iptr) == '=') then + iptr = iptr + 1 - ! *** Restore original string's upper/lower case after '=' sign + ! *** Restore original string's upper/lower case after '=' sign - line(iptr:linelen) = line1(iptr:linelen) + line(iptr:linelen) = line1(iptr:linelen) - else - varlen = 0 - end if + else + varlen = 0 + end if -1000 continue +1000 continue - end subroutine get_variable_name + end subroutine get_variable_name - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine check_range_int(cvar,varval,min_value,max_value) + subroutine check_range_int(cvar,varval,min_value,max_value) - !! Routine that checks whether an integer variable lies within - !! the desired range - !! author: P J Knight, CCFE, Culham Science Centre - !! outfile : input integer : Fortran output unit identifier - !! cvar : input string : name of variable - !! varval : input integer : value of variable - !! min_value : input integer : minimum allowed value of variable - !! max_value : input integer : maximum allowed value of variable - !! This routine checks whether an integer variable lies within - !! the range predetermined by the user, and reports an error - !! and stops if it doesn't. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that checks whether an integer variable lies within + !! the desired range + !! author: P J Knight, CCFE, Culham Science Centre + !! outfile : input integer : Fortran output unit identifier + !! cvar : input string : name of variable + !! varval : input integer : value of variable + !! min_value : input integer : minimum allowed value of variable + !! max_value : input integer : maximum allowed value of variable + !! This routine checks whether an integer variable lies within + !! the range predetermined by the user, and reports an error + !! and stops if it doesn't. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: cvar - integer, intent(in) :: varval,min_value,max_value + character(len=*), intent(in) :: cvar + integer, intent(in) :: varval,min_value,max_value - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (min_value > max_value) then - write(outfile,*) 'Illegal relative values of min_value and max_value' - write(outfile,*) 'for variable ',cvar + if (min_value > max_value) then + write(outfile,*) 'Illegal relative values of min_value and max_value' + write(outfile,*) 'for variable ',cvar - write(*,*) 'Illegal relative values of min_value and max_value' - write(*,*) 'for variable ',cvar - error = .True. - end if + write(*,*) 'Illegal relative values of min_value and max_value' + write(*,*) 'for variable ',cvar + error = .True. + end if - if ((varval < min_value).or.(varval > max_value)) then - write(outfile,*) cvar,' lies outside its allowed range :' - write(outfile,*) 'Minimum value = ',min_value - write(outfile,*) 'Maximum value = ',max_value - write(outfile,*) ' Actual value = ',varval + if ((varval < min_value).or.(varval > max_value)) then + write(outfile,*) cvar,' lies outside its allowed range :' + write(outfile,*) 'Minimum value = ',min_value + write(outfile,*) 'Maximum value = ',max_value + write(outfile,*) ' Actual value = ',varval - write(*,*) cvar,' lies outside its allowed range :' - write(*,*) 'Minimum value = ',min_value - write(*,*) 'Maximum value = ',max_value - write(*,*) ' Actual value = ',varval - error = .True. - end if + write(*,*) cvar,' lies outside its allowed range :' + write(*,*) 'Minimum value = ',min_value + write(*,*) 'Maximum value = ',max_value + write(*,*) ' Actual value = ',varval + error = .True. + end if - end subroutine check_range_int + end subroutine check_range_int - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - subroutine check_range_real(cvar,varval,min_value,max_value) + subroutine check_range_real(cvar,varval,min_value,max_value) - !! Routine that checks whether a real variable lies within - !! the desired range - !! author: P J Knight, CCFE, Culham Science Centre - !! cvar : input string : name of variable - !! varval : input real : value of variable - !! min_value : input real : minimum allowed value of variable - !! max_value : input real : maximum allowed value of variable - !! This routine checks whether a real variable lies within - !! the range predetermined by the user, and reports an error - !! and stops if it doesn't. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! Routine that checks whether a real variable lies within + !! the desired range + !! author: P J Knight, CCFE, Culham Science Centre + !! cvar : input string : name of variable + !! varval : input real : value of variable + !! min_value : input real : minimum allowed value of variable + !! max_value : input real : maximum allowed value of variable + !! This routine checks whether a real variable lies within + !! the range predetermined by the user, and reports an error + !! and stops if it doesn't. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - implicit none + implicit none - ! Arguments + ! Arguments - character(len=*), intent(in) :: cvar - real(dp), intent(in) :: varval,min_value,max_value + character(len=*), intent(in) :: cvar + real(dp), intent(in) :: varval,min_value,max_value - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (min_value > max_value) then - write(outfile,*) 'Illegal relative values of min_value and max_value' - write(outfile,*) 'for variable ',cvar + if (min_value > max_value) then + write(outfile,*) 'Illegal relative values of min_value and max_value' + write(outfile,*) 'for variable ',cvar - write(*,*) 'Illegal relative values of min_value and max_value' - write(*,*) 'for variable ',cvar - error = .True. - end if + write(*,*) 'Illegal relative values of min_value and max_value' + write(*,*) 'for variable ',cvar + error = .True. + end if - if ((varval < min_value).or.(varval > max_value)) then - write(outfile,*) cvar,' lies outside its allowed range :' - write(outfile,*) 'Minimum value = ',min_value - write(outfile,*) 'Maximum value = ',max_value - write(outfile,*) ' Actual value = ',varval + if ((varval < min_value).or.(varval > max_value)) then + write(outfile,*) cvar,' lies outside its allowed range :' + write(outfile,*) 'Minimum value = ',min_value + write(outfile,*) 'Maximum value = ',max_value + write(outfile,*) ' Actual value = ',varval - write(*,*) cvar,' lies outside its allowed range :' - write(*,*) 'Minimum value = ',min_value - write(*,*) 'Maximum value = ',max_value - write(*,*) ' Actual value = ',varval - error = .True. - end if - - end subroutine check_range_real + write(*,*) cvar,' lies outside its allowed range :' + write(*,*) 'Minimum value = ',min_value + write(*,*) 'Maximum value = ',max_value + write(*,*) ' Actual value = ',varval + error = .True. + end if + end subroutine check_range_real - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - subroutine lower_case(string,start,finish) - !! Routine that converts a (sub-)string to lowercase - !! author: P J Knight, CCFE, Culham Science Centre - !! string : input string : character string of interest - !! start : optional input integer : starting character for conversion - !! finish : optional input integer : final character for conversion - !! This routine converts the specified section of a string - !! to lowercase. By default, the whole string will be converted. - !! None - ! - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + subroutine lower_case(string,start,finish) - implicit none - - ! Arguments + !! Routine that converts a (sub-)string to lowercase + !! author: P J Knight, CCFE, Culham Science Centre + !! string : input string : character string of interest + !! start : optional input integer : starting character for conversion + !! finish : optional input integer : final character for conversion + !! This routine converts the specified section of a string + !! to lowercase. By default, the whole string will be converted. + !! None + ! + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - character(len=*), intent(inout) :: string - integer, optional, intent(in) :: start,finish + implicit none - ! Local variables + ! Arguments - character(len=1) :: letter - character(len=27), parameter :: lowtab = 'abcdefghijklmnopqrstuvwxyz_' - integer :: loop, i + character(len=*), intent(inout) :: string + integer, optional, intent(in) :: start,finish - integer :: first, last + ! Local variables - ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + character(len=1) :: letter + character(len=27), parameter :: lowtab = 'abcdefghijklmnopqrstuvwxyz_' + integer :: loop, i - if (present(start)) then - first = start - else - first = 1 - end if + integer :: first, last - if (present(finish)) then - last = finish - else - last = len(string) - end if + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (first <= last) then - do loop = first,last - letter = string(loop:loop) - i = index('ABCDEFGHIJKLMNOPQRSTUVWXYZ_',letter) - if (i > 0) string(loop:loop) = lowtab(i:i) - end do - end if + if (present(start)) then + first = start + else + first = 1 + end if + + if (present(finish)) then + last = finish + else + last = len(string) + end if + + if (first <= last) then + do loop = first,last + letter = string(loop:loop) + i = index('ABCDEFGHIJKLMNOPQRSTUVWXYZ_',letter) + if (i > 0) string(loop:loop) = lowtab(i:i) + end do + end if - end subroutine lower_case + end subroutine lower_case end module process_input #ifdef unit_test program test - use process_input - implicit none + use process_input + implicit none - open(unit=1,file='IN.DAT',status='old') - call parse_input_file(1,6,1) - close(unit=1) + open(unit=1,file='IN.DAT',status='old') + call parse_input_file(1,6,1) + close(unit=1) end program test #endif From 7bd7f31ac8b435f3ab05679e73e02e8261b57485 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 30 Jan 2024 14:10:35 +0000 Subject: [PATCH 07/15] Readded new variables for ST availability model --- source/fortran/cost_variables.f90 | 7 +++++++ source/fortran/input.f90 | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/fortran/cost_variables.f90 b/source/fortran/cost_variables.f90 index 1eeadd9b9f..7d04be7920 100644 --- a/source/fortran/cost_variables.f90 +++ b/source/fortran/cost_variables.f90 @@ -198,6 +198,7 @@ module cost_variables !! - =0 use input value for cfactr !! - =1 calculate cfactr using Taylor and Ward 1999 model !! - =2 calculate cfactr using new (2015) model + !! - =3 calculate cfactr using ST model integer :: ibkt_life !! Switch for fw/blanket lifetime calculation in availability module: @@ -342,6 +343,12 @@ module cost_variables real(dp) :: tlife !! Full power year plant lifetime (years) + real(dp) :: tmain + !! Maintenance time for replacing CP (years) (iavail = 3) + + real(dp) :: u_unplanned + !! User-input CP unplanned unavailability (iavail = 3) + real(dp), parameter :: ucad = 180.0D0 !! unit cost for administration buildings (M$/m3) diff --git a/source/fortran/input.f90 b/source/fortran/input.f90 index 05d8221a74..7ca2a2bdee 100644 --- a/source/fortran/input.f90 +++ b/source/fortran/input.f90 @@ -256,7 +256,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ucblli, ucpfcb, tlife, ipnet, fcdfuel, ucbus, ucpfb, uchts, & maintenance_fwbs, fwbs_prob_fail, uclh, ucblss, ucblvd, ucsc, ucturb, & ucpens, cland, ucwindpf, i_cp_lifetime, cplife_input, & - startupratio + startupratio, tmain, u_unplanned use current_drive_variables, only: pinjfixmw, etaech, pinjalw, etanbi, & ftritbm, gamma_ecrh, pheat, rho_ecrh, beamwd, enbeam, pheatfix, bscfmax, & forbitloss, nbshield, tbeamin, feffcd, iefrf, iefrffix, irfcd, cboot, & @@ -2616,6 +2616,12 @@ subroutine parse_input_file(in_file,out_file,show_changes) case ('startupratio') call parse_real_variable('startupratio', startupratio, 0.0D0, 10.0D0, & 'Ratio (additional HCD power for start-up) / (flat-top operational requirements)') + case ('tmain') + call parse_real_variable('tmain', tmain, 0.0D0, 100.0D0, & + 'Maintenance time for replacing CP (years) (iavail = 3)') + case ('u_unplanned') + call parse_real_variable('u_unplanned', u_unplanned, 0.0D0, 1.0D0, & + 'User-input CP unplanned unavailability (iavail = 3)') ! Unit cost settings @@ -2834,7 +2840,7 @@ subroutine parse_input_file(in_file,out_file,show_changes) ! Availability settings case ('iavail') - call parse_int_variable('iavail', iavail, 0, 2, & + call parse_int_variable('iavail', iavail, 0, 3, & 'Switch for plant availability model') case ('ibkt_life') call parse_int_variable('ibkt_life', ibkt_life, 0, 2, & From 86d8ea2bfac4dcda2a2d2746178c093877f998f4 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 30 Jan 2024 14:15:57 +0000 Subject: [PATCH 08/15] Flake8 fixes --- source/fortran/cost_variables.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/fortran/cost_variables.f90 b/source/fortran/cost_variables.f90 index 7d04be7920..f677f61b9b 100644 --- a/source/fortran/cost_variables.f90 +++ b/source/fortran/cost_variables.f90 @@ -198,7 +198,7 @@ module cost_variables !! - =0 use input value for cfactr !! - =1 calculate cfactr using Taylor and Ward 1999 model !! - =2 calculate cfactr using new (2015) model - !! - =3 calculate cfactr using ST model + !! - =3 calculate cfactr using ST model integer :: ibkt_life !! Switch for fw/blanket lifetime calculation in availability module: From f509bf511ba56eb78cf792c09e34046ffaecc587 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Tue, 30 Jan 2024 16:43:02 +0000 Subject: [PATCH 09/15] Updated docstrings --- process/availability.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/process/availability.py b/process/availability.py index c2d609b711..78e5ceefb1 100644 --- a/process/availability.py +++ b/process/availability.py @@ -980,7 +980,8 @@ def calc_u_unplanned_vacuum(self, output: bool) -> float: return u_unplanned_vacuum def avail_st(self, output: bool): - """Routine to calculate availability for plant with an ST + """Routine to calculate availability for plant with a Spherical Tokamak + :param output: indicate whether output should be written to the output file, or not :type output: boolean """ @@ -1113,9 +1114,10 @@ def avail_st(self, output: bool): ) def cp_lifetime(self): - """Calculates Centrepost Lifetime + """Calculate Centrepost Lifetime - This routine calculates the lifetime of the centrepost, either for superconducting or aluminium/resistive magnets. + This routine calculates the lifetime of the centrepost, + either for superconducting or aluminium/resistive magnets. :returns: CP lifetime :rtype: float From 3db1f1050d8fb28b831aaf85b5b3d864f0c46674 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 14:29:18 +0000 Subject: [PATCH 10/15] Renamed plant.md to plant-availability.md --- .../proc-pages/eng-models/{plant.md => plant-availability.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename documentation/proc-pages/eng-models/{plant.md => plant-availability.md} (100%) diff --git a/documentation/proc-pages/eng-models/plant.md b/documentation/proc-pages/eng-models/plant-availability.md similarity index 100% rename from documentation/proc-pages/eng-models/plant.md rename to documentation/proc-pages/eng-models/plant-availability.md From bc618a34174f6e55bc70aa560ba82f56f55bffb3 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 14:30:17 +0000 Subject: [PATCH 11/15] Added docs for ST availability model and CP lifetime calculation --- .../eng-models/plant-availability.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/documentation/proc-pages/eng-models/plant-availability.md b/documentation/proc-pages/eng-models/plant-availability.md index 6a529a05a5..5891586ab5 100644 --- a/documentation/proc-pages/eng-models/plant-availability.md +++ b/documentation/proc-pages/eng-models/plant-availability.md @@ -33,6 +33,57 @@ The unplanned downtime for the blanket is based on the number of cycles it exper It is assumed that the vacuum system can be maintained in parallel with blanket replacement, so it does not contribute to the planned downtime. The unplanned downtime is baed on an assumed failure rate for a cryo-pump, and a specified total number pumps, with some of them being redundant. The resulting downtime can be reduced to a negligible level if there are several redundant pumps, but in addition, there is a fixed unavailability to allow for common mode failures affecting several pumps. +If `iavail = 3`, the availability model for Spherical Tokamaks (ST) is implemented. + +!!! Warning "Warning" + Currently, this model only uses the centrepost to calculate the availability of a ST plant. Other systems/components will be added in the future. + +This model takes the user-specified time to replace a centrepost `tmain` and the centrepost lifetime `cplife` (calculated, see below) and calculates the number of maintenance cycles + +$$ t_{main} + t_{CP,life} = t_{maint\text{ }cycle}. $$ + +The number of maintenance cycles over the lifetime of the plant is calculated and then the ceiling of this value is taken as the number of centreposts required over the lifetime of the plant + +$$ n_{cycles} = t_{life} / t_{maint\text{ }cycle}, $$ + +$$ n_{CP} = \lceil n_{cycles} \rceil. $$ + +The planned unavailability is then what percent of a maintenance cycle is taken up by the user-specified maintenance time + +$$ U_{planned} = t_{main} / t_{maint\text{ }cycle} $$ + +and the total operational time is given by + +$$ t_{op} = t_{life} (1 - U_{planned}). $$ + +The total availability of the plant is then given by + +$$ A_{tot} = 1 - (U_{planned} + U_{unplanned} + U_{planned}U_{unplanned}) $$ + +where $U_{unplanned}$ is unplanned unavailability which is provided by the user i.e. how often do you expect the centrepost to break over its lifetime. The cross term takes account of overlap between planned and unplanned unavailability. + +Finally, the capcity factor is given by + +$$ C = A_{tot} (t_{burn} / t_{cycle}) $$ + +where $t_burn$ is the burn time and $t_{cycle}$ is the full cycle time. + +## Centrepost Lifetime + +All availability models in PROCESS require the calculation of the centerpost lifetime, which is detailed here. + +For superconducting magnets (`i_tf_sup = 1`), the centrepost lifetime is calculated as + +$$ t_{CP,life} = min(f_{TF,max}/(\phi_{CP,max}t_{year}),t_{life}) $$ + +where $f_{TF,max}$ is the max fast neutron fluence on the TF coil ($m^{-2}$ s), $\phi_{CP,max}$ is the centrepost TF fast neutron flux ($m^{-2}$ $s^{-1}$) and $t_{year}$ is the number of seconds in a year. + +For copper or cryogenic aluminium magnets (`i_tf_sup = 0 or 2`), the centrepost lifetime is + +$$ t_{CP,life} = min(f_{CP, allowable}/P_{wall}, t_{life}) $$ + +where $f_{CP, allowable}$ is the allowable centrepost neutron fluence and $P_{wall}$ is the average neutron wall load (MW $m^{-2}$). + [^1]: P. J. Knight, *"PROCESS 3020: Plant Availability Model"*, Work File Note F/PL/PJK/PROCESS/CODE/
[^2]: M. Kovari, F. Fox, C. Harrington, R. Kembleton, P. Knight, H. Lux, J. Morris *"PROCESS: a systems code for fusion power plants - Part 2: Engineering"*, Fus. Eng. & Des. 104, 9-20 (2016) \ No newline at end of file From 6f66bfe4a6ea85d2cb55f21df4cc705e3ef547d5 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 14:35:16 +0000 Subject: [PATCH 12/15] Updated yaml so docs generate correctly --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 9ec196ad7e..a8312f71d1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,7 +56,7 @@ nav: - Heat transport: eng-models/power-conversion-and-heat-dissipation-systems.md - Auxiliary Power Systems: eng-models/heating-and-current-drive.md - Cryostat and vacuum system: eng-models/cryostat-and-vacuum-system.md - - Plant Availability: eng-models/plant.md + - Plant Availability: eng-models/plant-availability.md - Power Requirements: eng-models/power-requirements.md - Unique Models: - Water Use: unique-models/water_use.md From fb4b7b854f85a9e73444f489c705852c90f9e9a4 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 14:35:57 +0000 Subject: [PATCH 13/15] Fixed table in plant availability docs --- documentation/proc-pages/eng-models/plant-availability.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/proc-pages/eng-models/plant-availability.md b/documentation/proc-pages/eng-models/plant-availability.md index 5891586ab5..b3b076ab43 100644 --- a/documentation/proc-pages/eng-models/plant-availability.md +++ b/documentation/proc-pages/eng-models/plant-availability.md @@ -6,8 +6,8 @@ If `iavail = 0`, the input value of `cfactr` is used. If `iavail = 1`, a model by N. Taylor and D. Ward[^1] is used instead, in which `cfactr` is calculated taking into account the time taken to replace certain components of the fusion power core, and various unplanned unavailability fractions which may be set by the user, as summerised in Table 1. -| Input parameter | description | -| --- | --- | --- | +| Input parameter | Description | +| :-: | - | | `tbktrepl` | time needed to replace blanket (years) | | `tdivrepl` | time needed to replace divertor (years) | | `tcomrepl` | time needed to replace both blanket and divertor (years) | From 89134256212406a638a2cee8e6303a2673dfac93 Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 15:45:28 +0000 Subject: [PATCH 14/15] Minor changes to docs --- .../eng-models/plant-availability.md | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/documentation/proc-pages/eng-models/plant-availability.md b/documentation/proc-pages/eng-models/plant-availability.md index b3b076ab43..e231b40f23 100644 --- a/documentation/proc-pages/eng-models/plant-availability.md +++ b/documentation/proc-pages/eng-models/plant-availability.md @@ -40,49 +40,52 @@ If `iavail = 3`, the availability model for Spherical Tokamaks (ST) is implement This model takes the user-specified time to replace a centrepost `tmain` and the centrepost lifetime `cplife` (calculated, see below) and calculates the number of maintenance cycles -$$ t_{main} + t_{CP,life} = t_{maint\text{ }cycle}. $$ +$$ t_{\text{main}} + t_{\text{CP,life}} = t_{\text{maint cycle}}. $$ The number of maintenance cycles over the lifetime of the plant is calculated and then the ceiling of this value is taken as the number of centreposts required over the lifetime of the plant -$$ n_{cycles} = t_{life} / t_{maint\text{ }cycle}, $$ +$$ n_{\text{cycles}} = t_{\text{life}} / t_{\text{maint cycle}}, $$ -$$ n_{CP} = \lceil n_{cycles} \rceil. $$ +$$ n_{\text{CP}} = \lceil n_{\text{cycles}} \rceil. $$ The planned unavailability is then what percent of a maintenance cycle is taken up by the user-specified maintenance time -$$ U_{planned} = t_{main} / t_{maint\text{ }cycle} $$ +$$ U_{\text{planned}} = t_{\text{main}} / t_{\text{maint cycle}} $$ and the total operational time is given by -$$ t_{op} = t_{life} (1 - U_{planned}). $$ +$$ t_{\text{op}} = t_{\text{life}} (1 - U_{\text{planned}}). $$ The total availability of the plant is then given by -$$ A_{tot} = 1 - (U_{planned} + U_{unplanned} + U_{planned}U_{unplanned}) $$ +$$ A_{\text{tot}} = 1 - (U_{\text{planned}} + U_{\text{unplanned}} + U_{\text{planned}}U_{\text{unplanned}}) $$ where $U_{unplanned}$ is unplanned unavailability which is provided by the user i.e. how often do you expect the centrepost to break over its lifetime. The cross term takes account of overlap between planned and unplanned unavailability. Finally, the capcity factor is given by -$$ C = A_{tot} (t_{burn} / t_{cycle}) $$ +$$ C = A_{\text{tot}} (t_{\text{burn}} / t_{\text{cycle}}) $$ -where $t_burn$ is the burn time and $t_{cycle}$ is the full cycle time. +where $t_{\text{burn}}$ is the burn time and $t_{\text{cycle}}$ is the full cycle time. ## Centrepost Lifetime All availability models in PROCESS require the calculation of the centerpost lifetime, which is detailed here. +!!! Note ""Note" + The centrepost lifetime is calculated in full-power years (FPY). + For superconducting magnets (`i_tf_sup = 1`), the centrepost lifetime is calculated as -$$ t_{CP,life} = min(f_{TF,max}/(\phi_{CP,max}t_{year}),t_{life}) $$ +$$ t_{\text{CP,life}} = min(f_{\text{TF,max}}/(\phi_{\text{CP,max}}t_{\text{year}}),t_{\text{life}}) $$ -where $f_{TF,max}$ is the max fast neutron fluence on the TF coil ($m^{-2}$ s), $\phi_{CP,max}$ is the centrepost TF fast neutron flux ($m^{-2}$ $s^{-1}$) and $t_{year}$ is the number of seconds in a year. +where $f_{\text{TF,max}}$ is the max fast neutron fluence on the TF coil ($m^{-2}$ s), $\phi_{\text{CP,max}}$ is the centrepost TF fast neutron flux ($m^{-2}$ $s^{-1}$) and $t_{\text{year}}$ is the number of seconds in a year. For copper or cryogenic aluminium magnets (`i_tf_sup = 0 or 2`), the centrepost lifetime is -$$ t_{CP,life} = min(f_{CP, allowable}/P_{wall}, t_{life}) $$ +$$ t_{\text{CP,life}} = min(f_{\text{CP, allowable}}/P_{\text{wall}}, t_{\text{life}}) $$ -where $f_{CP, allowable}$ is the allowable centrepost neutron fluence and $P_{wall}$ is the average neutron wall load (MW $m^{-2}$). +where $f_{\text{CP, allowable}}$ is the allowable centrepost neutron fluence and $P_{\text{wall}}$ is the average neutron wall load (MW $m^{-2}$). [^1]: P. J. Knight, *"PROCESS 3020: Plant Availability Model"*, Work File Note F/PL/PJK/PROCESS/CODE/
From 419c9e5e46e597260b9e1e817a62a0b74ae43f4d Mon Sep 17 00:00:00 2001 From: Jack Foster Date: Wed, 31 Jan 2024 15:58:11 +0000 Subject: [PATCH 15/15] Minor changes to docs --- documentation/proc-pages/eng-models/plant-availability.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/proc-pages/eng-models/plant-availability.md b/documentation/proc-pages/eng-models/plant-availability.md index e231b40f23..c07da428d3 100644 --- a/documentation/proc-pages/eng-models/plant-availability.md +++ b/documentation/proc-pages/eng-models/plant-availability.md @@ -36,7 +36,7 @@ It is assumed that the vacuum system can be maintained in parallel with blanket If `iavail = 3`, the availability model for Spherical Tokamaks (ST) is implemented. !!! Warning "Warning" - Currently, this model only uses the centrepost to calculate the availability of a ST plant. Other systems/components will be added in the future. + Currently, this model only uses the centrepost to calculate the availability of an ST plant. Other systems/components will be added in the future. This model takes the user-specified time to replace a centrepost `tmain` and the centrepost lifetime `cplife` (calculated, see below) and calculates the number of maintenance cycles @@ -72,20 +72,20 @@ where $t_{\text{burn}}$ is the burn time and $t_{\text{cycle}}$ is the full cycl All availability models in PROCESS require the calculation of the centerpost lifetime, which is detailed here. -!!! Note ""Note" +!!! Note "Note" The centrepost lifetime is calculated in full-power years (FPY). For superconducting magnets (`i_tf_sup = 1`), the centrepost lifetime is calculated as $$ t_{\text{CP,life}} = min(f_{\text{TF,max}}/(\phi_{\text{CP,max}}t_{\text{year}}),t_{\text{life}}) $$ -where $f_{\text{TF,max}}$ is the max fast neutron fluence on the TF coil ($m^{-2}$ s), $\phi_{\text{CP,max}}$ is the centrepost TF fast neutron flux ($m^{-2}$ $s^{-1}$) and $t_{\text{year}}$ is the number of seconds in a year. +where $f_{\text{TF,max}}$ is the max fast neutron fluence on the TF coil ($\mathrm{m}^{-2} \mathrm{s}$), $\phi_{\text{CP,max}}$ is the centrepost TF fast neutron flux ($\mathrm{m}^{-2}$ $\mathrm{s}^{-1}$) and $t_{\text{year}}$ is the number of seconds in a year. For copper or cryogenic aluminium magnets (`i_tf_sup = 0 or 2`), the centrepost lifetime is $$ t_{\text{CP,life}} = min(f_{\text{CP, allowable}}/P_{\text{wall}}, t_{\text{life}}) $$ -where $f_{\text{CP, allowable}}$ is the allowable centrepost neutron fluence and $P_{\text{wall}}$ is the average neutron wall load (MW $m^{-2}$). +where $f_{\text{CP, allowable}}$ is the allowable centrepost neutron fluence and $P_{\text{wall}}$ is the average neutron wall load ($\mathrm{MW} \mathrm{m}^{-2}$). [^1]: P. J. Knight, *"PROCESS 3020: Plant Availability Model"*, Work File Note F/PL/PJK/PROCESS/CODE/