Reads in the theta_grid_parameters namelist and populates the member variables
theta_grid_parameters_config_type
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_parameters_config_type), | intent(inout) | :: | self |
subroutine read_theta_grid_parameters_config(self)
use file_utils, only: input_unit_exist, get_indexed_namelist_unit
use mp, only: proc0
implicit none
class(theta_grid_parameters_config_type), intent(in out) :: self
logical :: exist
integer :: in_file
! Note: When this routine is in the module where these variables live
! we shadow the module level variables here. This is intentional to provide
! isolation and ensure we can move this routine to another module easily.
integer :: geotype, mmode, nmode, nperiod, ntheta
real :: akappa, akappri, alpmhd, asurf, btor_slab, delta2, delta3, deltam, deltampri, deltan, deltanpri, eps, epsl, kp, pk, qinp, r_geo, raxis, rhoc, rmaj, shat, shift, shiftvert, theta2
real :: theta3, thetad, thetak, thetam, thetan, tri, tripri, zaxis
namelist /theta_grid_parameters/ akappa, akappri, alpmhd, asurf, btor_slab, delta2, delta3, deltam, deltampri, deltan, deltanpri, eps, epsl, geotype, kp, mmode, nmode, nperiod, ntheta, pk, qinp, r_geo, raxis, rhoc, &
rmaj, shat, shift, shiftvert, theta2, theta3, thetad, thetak, thetam, thetan, tri, tripri, zaxis
! Only proc0 reads from file
if (.not. proc0) return
! First set local variables from current values
akappa = self%akappa
akappri = self%akappri
alpmhd = self%alpmhd
asurf = self%asurf
btor_slab = self%btor_slab
delta2 = self%delta2
delta3 = self%delta3
deltam = self%deltam
deltampri = self%deltampri
deltan = self%deltan
deltanpri = self%deltanpri
eps = self%eps
epsl = self%epsl
geotype = self%geotype
kp = self%kp
mmode = self%mmode
nmode = self%nmode
nperiod = self%nperiod
ntheta = self%ntheta
pk = self%pk
qinp = self%qinp
r_geo = self%r_geo
raxis = self%raxis
rhoc = self%rhoc
rmaj = self%rmaj
shat = self%shat
shift = self%shift
shiftvert = self%shiftvert
theta2 = self%theta2
theta3 = self%theta3
thetad = self%thetad
thetak = self%thetak
thetam = self%thetam
thetan = self%thetan
tri = self%tri
tripri = self%tripri
zaxis = self%zaxis
! Now read in the main namelist
in_file = input_unit_exist(self%get_name(), exist)
if (exist) read(in_file, nml = theta_grid_parameters)
! Now copy from local variables into type members
self%akappa = akappa
self%akappri = akappri
self%alpmhd = alpmhd
self%asurf = asurf
self%btor_slab = btor_slab
self%delta2 = delta2
self%delta3 = delta3
self%deltam = deltam
self%deltampri = deltampri
self%deltan = deltan
self%deltanpri = deltanpri
self%eps = eps
self%epsl = epsl
self%geotype = geotype
self%kp = kp
self%mmode = mmode
self%nmode = nmode
self%nperiod = nperiod
self%ntheta = ntheta
self%pk = pk
self%qinp = qinp
self%r_geo = r_geo
self%raxis = raxis
self%rhoc = rhoc
self%rmaj = rmaj
self%shat = shat
self%shift = shift
self%shiftvert = shiftvert
self%theta2 = theta2
self%theta3 = theta3
self%thetad = thetad
self%thetak = thetak
self%thetam = thetam
self%thetan = thetan
self%tri = tri
self%tripri = tripri
self%zaxis = zaxis
self%exist = exist
end subroutine read_theta_grid_parameters_config