FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(theta_grid_parameters_config_type), | intent(in), | optional | :: | theta_grid_parameters_config_in |
subroutine read_parameters(theta_grid_parameters_config_in)
use file_utils, only: input_unit, input_unit_exist
use unit_tests, only: debug_message
implicit none
type(theta_grid_parameters_config_type), intent(in), optional :: theta_grid_parameters_config_in
integer, parameter :: verb=3
call debug_message(verb, "theta_grid_params::read_parameters start")
if (present(theta_grid_parameters_config_in)) theta_grid_parameters_config = theta_grid_parameters_config_in
call theta_grid_parameters_config%init(name = 'theta_grid_parameters', requires_index = .false.)
! Copy out internal values into module level parameters
akappa = theta_grid_parameters_config%akappa
akappri = theta_grid_parameters_config%akappri
alpmhd = theta_grid_parameters_config%alpmhd
asurf = theta_grid_parameters_config%asurf
btor_slab = theta_grid_parameters_config%btor_slab
delta2 = theta_grid_parameters_config%delta2
delta3 = theta_grid_parameters_config%delta3
deltam = theta_grid_parameters_config%deltam
deltampri = theta_grid_parameters_config%deltampri
deltan = theta_grid_parameters_config%deltan
deltanpri = theta_grid_parameters_config%deltanpri
eps = theta_grid_parameters_config%eps
epsl = theta_grid_parameters_config%epsl
geotype = theta_grid_parameters_config%geotype
kp = theta_grid_parameters_config%kp
mmode = theta_grid_parameters_config%mmode
nmode = theta_grid_parameters_config%nmode
nperiod = theta_grid_parameters_config%nperiod
ntheta = theta_grid_parameters_config%ntheta
pk = theta_grid_parameters_config%pk
qinp = theta_grid_parameters_config%qinp
r_geo = theta_grid_parameters_config%r_geo
raxis = theta_grid_parameters_config%raxis
rhoc = theta_grid_parameters_config%rhoc
rmaj = theta_grid_parameters_config%rmaj
shat = theta_grid_parameters_config%shat
shift = theta_grid_parameters_config%shift
shiftvert = theta_grid_parameters_config%shiftvert
theta2 = theta_grid_parameters_config%theta2
theta3 = theta_grid_parameters_config%theta3
thetad = theta_grid_parameters_config%thetad
thetak = theta_grid_parameters_config%thetak
thetam = theta_grid_parameters_config%thetam
thetan = theta_grid_parameters_config%thetan
tri = theta_grid_parameters_config%tri
tripri = theta_grid_parameters_config%tripri
zaxis = theta_grid_parameters_config%zaxis
exist = theta_grid_parameters_config%exist
if (kp > 0.) pk = 2.*kp
! Print warning if the user has specified non-default values for the
! geometrical input parameters of other geometry types ! JRB
select case (geoType)
case (0)
if (mMode/=2) write (*,*) "WARNING: ignoring value of mMode, value not needed"
if (nMode/=3) write (*,*) "WARNING: ignoring value of nMode, value not needed"
if (deltam/=1.0) write (*,*) "WARNING: ignoring value of deltam, did you mean akappa?"
if (deltan/=1.0) write (*,*) "WARNING: ignoring value of deltan, did you mean tri?"
if (delta2/=1.0) write (*,*) "WARNING: ignoring value of delta2, did you mean akappa?"
if (delta3/=1.0) write (*,*) "WARNING: ignoring value of delta3, did you mean tri?"
if (deltampri/=0.0) write (*,*) "WARNING: ignoring value of deltampri, did you mean akappri?"
if (deltanpri/=0.0) write (*,*) "WARNING: ignoring value of deltanpri, did you mean tripri?"
if (thetam/=0.0) write (*,*) "WARNING: ignoring value of thetam, did you mean thetak?"
if (thetan/=0.0) write (*,*) "WARNING: ignoring value of thetan, did you mean thetad?"
if (theta2/=0.0) write (*,*) "WARNING: ignoring value of theta2, did you mean thetak?"
if (theta3/=0.0) write (*,*) "WARNING: ignoring value of theta3, did you mean thetad?"
if (aSurf/=1.0) write (*,*) "WARNING: ignoring value of aSurf, value not needed"
if (raxis/=3.0) write (*,*) "WARNING: ignoring value of raxis, did you mean shift?"
if (zaxis/=0.0) write (*,*) "WARNING: ignoring value of zaxis, did you mean shiftVert?"
deltam = akappa
deltan = tri
deltampri = akappri
deltanpri = tripri
thetam = thetak
thetan = thetad
case (1)
if (mMode/=2) write (*,*) "WARNING: ignoring value of mMode, value not needed"
if (nMode/=3) write (*,*) "WARNING: ignoring value of nMode, value not needed"
if (deltam/=1.0) write (*,*) "WARNING: ignoring value of deltam, did you mean delta2?"
if (deltan/=1.0) write (*,*) "WARNING: ignoring value of deltan, did you mean delta3?"
if (akappa/=1.0) write (*,*) "WARNING: ignoring value of akappa, did you mean delta2?"
if (tri/=0.0) write (*,*) "WARNING: ignoring value of tri, did you mean delta3?"
if (deltampri/=0.0) write (*,*) "WARNING: ignoring value of deltampri, value not needed"
if (deltanpri/=0.0) write (*,*) "WARNING: ignoring value of deltanpri, value not needed"
if (akappri/=0.0) write (*,*) "WARNING: ignoring value of akappri, value not needed"
if (tripri/=0.0) write (*,*) "WARNING: ignoring value of tripri, value not needed"
if (thetam/=0.0) write (*,*) "WARNING: ignoring value of thetam, did you mean theta2?"
if (thetan/=0.0) write (*,*) "WARNING: ignoring value of thetan, did you mean theta3?"
if (thetak/=0.0) write (*,*) "WARNING: ignoring value of thetak, did you mean theta2?"
if (thetad/=0.0) write (*,*) "WARNING: ignoring value of thetad, did you mean theta3?"
if (shift/=0.0) write (*,*) "WARNING: ignoring value of shift, did you mean Raxis?"
if (shiftVert/=0.0) write (*,*) "WARNING: ignoring value of shiftVert, did you mean Zaxis?"
if (raxis>=Rmaj+aSurf) write (*,*) "WARNING: Raxis>=Rmag+aSurf, may specify non-nested flux surfaces"
if (raxis<=Rmaj-aSurf) write (*,*) "WARNING: Raxis<=Rmag-aSurf, may specify non-nested flux surfaces"
if (zaxis>=aSurf) write (*,*) "WARNING: Zaxis>=aSurf, may specify non-nested flux surfaces"
if (zaxis<=-aSurf) write (*,*) "WARNING: Zaxis<=-aSurf, may specify non-nested flux surfaces"
shift = raxis
shiftVert = zaxis
deltam = delta2
deltan = delta3
thetam = theta2
thetan = theta3
case (2)
if (delta2/=1.0) write (*,*) "WARNING: ignoring value of delta2, did you mean deltam?"
if (delta3/=1.0) write (*,*) "WARNING: ignoring value of delta3, did you mean deltan?"
if (akappa/=1.0) write (*,*) "WARNING: ignoring value of akappa, did you mean deltam?"
if (tri/=0.0) write (*,*) "WARNING: ignoring value of tri, did you mean deltan?"
if (akappri/=0.0) write (*,*) "WARNING: ignoring value of akappri, did you mean deltampri?"
if (tripri/=0.0) write (*,*) "WARNING: ignoring value of tripri, did you mean deltanpri?"
if (theta2/=0.0) write (*,*) "WARNING: ignoring value of theta2, did you mean thetam?"
if (theta3/=0.0) write (*,*) "WARNING: ignoring value of theta3, did you mean thetan?"
if (thetak/=0.0) write (*,*) "WARNING: ignoring value of thetak, did you mean thetam?"
if (thetad/=0.0) write (*,*) "WARNING: ignoring value of thetad, did you mean thetan?"
if (aSurf/=1.0) write (*,*) "WARNING: ignoring value of aSurf, value not needed"
if (raxis/=3.0) write (*,*) "WARNING: ignoring value of raxis, did you mean shift?"
if (zaxis/=0.0) write (*,*) "WARNING: ignoring value of zaxis, did you mean shiftVert?"
case (3)
if (delta2/=1.0) write (*,*) "WARNING: ignoring value of delta2, did you mean deltam?"
if (delta3/=1.0) write (*,*) "WARNING: ignoring value of delta3, did you mean deltan?"
if (akappa/=1.0) write (*,*) "WARNING: ignoring value of akappa, did you mean deltam?"
if (tri/=0.0) write (*,*) "WARNING: ignoring value of tri, did you mean deltan?"
if (akappri/=0.0) write (*,*) "WARNING: ignoring value of akappri, did you mean deltampri?"
if (tripri/=0.0) write (*,*) "WARNING: ignoring value of tripri, did you mean deltanpri?"
if (theta2/=0.0) write (*,*) "WARNING: ignoring value of theta2, did you mean thetam?"
if (theta3/=0.0) write (*,*) "WARNING: ignoring value of theta3, did you mean thetan?"
if (thetak/=0.0) write (*,*) "WARNING: ignoring value of thetak, did you mean thetam?"
if (thetad/=0.0) write (*,*) "WARNING: ignoring value of thetad, did you mean thetan?"
if (aSurf/=1.0) write (*,*) "WARNING: ignoring value of aSurf, value not needed"
if (raxis/=3.0) write (*,*) "WARNING: ignoring value of raxis, did you mean shift?"
if (zaxis/=0.0) write (*,*) "WARNING: ignoring value of zaxis, did you mean shiftVert?"
case default ! We should abort here, but we don't know if local_eq is true so maybe this is fine.
write (*,*) "ERROR: invalid analytic geometry specification"
end select
end subroutine read_parameters