READ FROM SPECIFIC NETCDF FILE: general data and "boundary" group ======= HEADER OF THE NETCDF FILE VERSION 3.1 =================================================================================== === FILE DESCRIPTION: * axis, normal and binormal of the frame are given in cartesian coordinates along the curve parameter zeta [0,2pi]. * The curve is allowed to have a field periodicity NFP, but the curve must be provided on a full turn. * The data is given in REAL SPACE, sampled along equidistant zeta point positions: zeta(i)=(i+0.5)/nzeta * (2pi/NFP), i=0,...,nzeta-1 always shifted by (2pi/NFP) for the next field period. Thus the number of points along the axis for a full turn is NFP*nzeta * definition of the axis-following frame in cartesian coordinates ( boundary surface at rho=1):
{x,y,z}(rho,theta,zeta)={x,y,z}(zeta) + X(rho,theta,zeta)*N_{x,y,z}(zeta)+Y(rho,theta,zeta)*B_{x,y,z}(zeta)
=== DATA DESCRIPTION - general data * NFP: number of field periods * VERSION: version number as integer: V3.0 => 300 - axis/ data group: * 'axis/n_max' : maximum mode number in zeta (in one field period) * 'axis/nzeta' : number of points along the axis, in one field period (>=2n_max+1) * 'axis/zeta(:)' : zeta positions, 1D array of size 'axis/nzeta', for one field period. zeta[i]=zeta[1] + (i-1)/nzeta(2pi/nfp), i=1,..nzeta, zeta[1] is arbitrary * 'axis/xyz(::)' : cartesian positions along the axis for ONE FULL TURN, 2D array of size (3,NFP nzeta ), sampled at zeta positions, must exclude the endpoint xyz[:,j+fpnzeta]=axis(zeta[j]+fp2pi/NFP), for j=0,..nzeta-1 and fp=0,...,NFP-1 * 'axis/Nxyz(::)': cartesian components of the normal vector of the axis frame, 2D array of size (3, NFP nzeta), evaluated analogously to the axis * 'axis/Bxyz(::)': cartesian components of the bi-normal vector of the axis frame, 2D array of size (3, NFPnzeta), evaluated analogously to the axis - boundary data group: * 'boundary/m_max' : maximum mode number in theta * 'boundary/n_max' : maximum mode number in zeta (in one field period) * 'boundary/lasym' : asymmetry, logical. if lasym=0, boundary surface position X,Y in the N-B plane of the axis frame can be represented only with X(theta,zeta)=sum X_mncos(mtheta-nNFPzeta), with {m=0,n=0...n_max},{m=1...m_max,n=-n_max...n_max} Y(theta,zeta)=sum Y_mnsin(mtheta-nNFPzeta), with {m=0,n=1...n_max},{m=1...m_max,n=-n_max...n_max} if lasym=1, full fourier series is taken for X,Y * 'boundary/ntheta' : number of points in theta (>=2m_max+1) * 'boundary/nzeta' : number of points in zeta (>=2n_max+1), can be different to 'axis/nzeta' * 'boundary/theta(:)' : theta positions, 1D array of size 'boundary_ntheta', on half grid! theta(i)=(i+0.5)/ntheta(2pi), i=0,...ntheta-1 * 'boundary/zeta(:)' : zeta positions, 1D array of size 'boundary/nzeta', for one field period! zeta[i]=zeta[1] + (i-1)/nzeta*(2pi/nfp), i=1,..nzeta, zeta[1] is arbitrary * 'boundary/X(::)', 'boundary/Y(::)' : boundary position X,Y in the N-B plane of the axis frame, in one field period, 2D array of size(ntheta, nzeta), with X[i, j]=X(theta[i],zeta[j]) Y[i, j]=Y(theta[i],zeta[j]), i=0...ntheta-1,j=0...nzeta-1
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_boundaryFromFile), | intent(inout) | :: | sf |
self |
SUBROUTINE ReadNETCDF(sf) USE MODgvec_io_netcdf IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT/OUTPUT VARIABLES !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES CLASS(t_boundaryFromFile), INTENT(INOUT) :: sf !! self !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES !=================================================================================================================================== CALL sf%nc%get_scalar("NFP",intout=sf%nfp) CALL sf%nc%get_scalar("boundary/lasym",intout=sf%lasym) CALL sf%nc%get_scalar("boundary/ntheta",intout=sf%ntheta) CALL sf%nc%get_scalar("boundary/nzeta",intout=sf%nzeta) IF(sf%nc%var_exists("boundary/m_max"))THEN CALL sf%nc%get_scalar("boundary/m_max",intout=sf%m_max) sf%m_max=MIN(sf%m_max,(sf%ntheta-1)/2) !maximum mode number based on number of interpolation points ntheta>=2*m_max+1 ELSE sf%m_max=(sf%ntheta-1)/2 !maximum mode number based on number of interpolation points ntheta>=2*m_max+1 WRITE(UNIT_stdOut,'(6X,A,I8)')'"boundary/m_max" not found, set to: ',sf%m_max END IF IF(sf%nc%var_exists("boundary/n_max"))THEN CALL sf%nc%get_scalar("boundary/n_max",intout=sf%n_max) sf%n_max = MIN(sf%n_max,(sf%nzeta-1)/2) !maximum mode number based on number of interpolation points nzeta>=2*n_max+1 ELSE sf%n_max=(sf%nzeta-1)/2 !maximum mode number based on number of interpolation points nzeta>=2*n_max+1 END IF WRITE(UNIT_stdOut,'(6X,A,2I4)')'" boundary (m_max,n_max)" is set to: ',sf%m_max,sf%n_max ALLOCATE(sf%theta(sf%ntheta)) CALL sf%nc%get_array("boundary/theta(:)",realout_1d=sf%theta) ALLOCATE(sf%zeta(sf%nzeta)) CALL sf%nc%get_array("boundary/zeta(:)",realout_1d=sf%zeta) ALLOCATE(sf%X(sf%ntheta,sf%nzeta)) CALL sf%nc%get_array("boundary/X(::)",realout_2d=sf%X) ALLOCATE(sf%Y(sf%ntheta,sf%nzeta)) CALL sf%nc%get_array("boundary/Y(::)",realout_2d=sf%Y) CALL sf%nc%closefile() END SUBROUTINE READNETCDF