12 real(
dp),
dimension(:),
ALLOCATABLE ::
raxis
13 real(
dp),
dimension(:),
ALLOCATABLE ::
zaxis
14 real(
dp),
dimension(:),
ALLOCATABLE ::
xm
15 real(
dp),
dimension(:),
ALLOCATABLE ::
xn
16 real(
dp),
dimension(:),
ALLOCATABLE ::
rmnc
17 real(
dp),
dimension(:),
ALLOCATABLE ::
zmns
18 real(
dp),
dimension(:),
ALLOCATABLE ::
rmns
19 real(
dp),
dimension(:),
ALLOCATABLE ::
zmnc
20 real(
dp),
dimension(:),
ALLOCATABLE ::
wint
45 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
mn1dim = (/
'mn_mode'/)
46 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
mnpotdim = (/
'mn_mode_pot'/)
47 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
nzntdim = (/
'nznt'/)
48 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
nzetadim = (/
'nzeta'/)
49 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
nextcurim = (/
'nextcur'/)
50 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
bvecsavdim =(/
'mnpd2'/)
51 CHARACTER(LEN=*),
PARAMETER,
DIMENSION(1) ::
amatsavdim =(/
'mnpd2_times_mnpd2'/)
53 CHARACTER(LEN=*),
DIMENSION(2),
PARAMETER ::
r2dim = (/
'mn_mode',
'radius '/)
55 character(len=*),
parameter :: &
83 character(len=*),
parameter :: &
98 character(len=*),
parameter :: &
177 character(len=*),
intent(in) :: vac_file
179 integer :: istat_vac, nvac, ierror
180 INTEGER,
DIMENSION(3) :: dimlens, mgrid_name_lens
183 CALL cdf_open(nvac, trim(vac_file),
'r', istat_vac)
184 IF (istat_vac .ne. 0) stop
'Error reading input file of NESTOR'
188 CALL cdf_inquire(nvac,
vn_mgrid, mgrid_name_lens)
211 CALL cdf_inquire(nvac,
vn_extcur, dimlens)
212 ALLOCATE (
extcur(dimlens(1)), stat = ierror)
215 ALLOCATE (
raxis(dimlens(1)), stat = ierror)
217 ALLOCATE (
zaxis(dimlens(1)), stat = ierror)
219 CALL cdf_inquire(nvac,
vn_pmod, dimlens)
220 ALLOCATE (
xm(dimlens(1)), stat = ierror)
221 CALL cdf_inquire(nvac,
vn_tmod, dimlens)
222 ALLOCATE (
xn(dimlens(1)), stat = ierror)
224 CALL cdf_inquire(nvac,
vn_rmnc, dimlens)
225 ALLOCATE (
rmnc(dimlens(1)), stat = ierror)
226 CALL cdf_inquire(nvac,
vn_zmns, dimlens)
227 ALLOCATE (
zmns(dimlens(1)), stat = ierror)
229 CALL cdf_inquire(nvac,
vn_wint, dimlens)
230 ALLOCATE (
wint(dimlens(1)), stat = ierror)
242 CALL cdf_inquire(nvac,
vn_rmns, dimlens)
243 ALLOCATE (
rmns(dimlens(1)), stat = ierror)
244 CALL cdf_inquire(nvac,
vn_zmnc, dimlens)
245 ALLOCATE (
zmnc(dimlens(1)), stat = ierror)
257 print *,
"dimension mismatch in amatsav: shall be mnpd2*mnpd2=", &
264 print *,
"dimension mismatch in bvecsav: shall be mnpd2=", &
276 if (ierror .ne. 0)
then
277 stop
"problem reading NESTOR input file"
282 if (ierror .ne. 0)
then
283 stop
"could not read mgrid file"
297 character(len=*),
intent(in) :: vac_file
298 logical,
intent(in) :: lasym
300 integer,
intent(in) :: ivac, ier_flag
302 integer :: istat_vac, nvac
305 CALL cdf_open(nvac, trim(vac_file),
'w', istat_vac)
306 IF (istat_vac .ne. 0) stop
'Error writing output file of NESTOR'
308 call cdf_define(nvac,
vn_ivac, ivac)
311 call cdf_define(nvac,
vn_mnpd , mnpd )
312 call cdf_define(nvac,
vn_mnpd2 , mnpd2 )
313 call cdf_define(nvac,
vn_xmpot , xmpot )
314 call cdf_define(nvac,
vn_xnpot , xnpot )
351 call cdf_define(nvac,
vn_bz ,
bz )
382 call cdf_define(nvac,
vn_tanu, tanu)
383 call cdf_define(nvac,
vn_tanv, tanv)
387 call cdf_define(nvac,
vn_imirr, imirr)
398 call cdf_write(nvac,
vn_ivac, ivac)
401 call cdf_write(nvac,
vn_mnpd , mnpd )
402 call cdf_write(nvac,
vn_mnpd2 , mnpd2 )
403 call cdf_write(nvac,
vn_xmpot , xmpot )
404 call cdf_write(nvac,
vn_xnpot , xnpot )
440 call cdf_write(nvac,
vn_bz ,
bz )
471 call cdf_write(nvac,
vn_tanu, tanu)
472 call cdf_write(nvac,
vn_tanv, tanv)
476 call cdf_write(nvac,
vn_imirr, imirr)
498 vacuum_calls, ier_flag, mgrid_file, input_extension, &
499 ivacskip, ivac, nfp, ntor, mpol, nzeta, ntheta, &
500 mnmax, xm, xn, rmnc, zmns, rmns, zmnc, &
501 rbtor, ctor, lasym, signgs, extcur_nestor, &
502 raxis_nestor, zaxis_nestor, wint, nznt, amatsav, bvecsav, mnpd2, &
542 character(len=*),
intent(in) :: vac_file, mgrid_file, input_extension
543 integer,
intent(in) :: &
544 vacuum_calls, ier_flag, ivacskip, ivac, nfp, ntor, mpol, nzeta, ntheta, mnmax, nznt, &
546 REAL(dp),
intent(in) :: rbtor, ctor, signgs
547 REAL(dp),
DIMENSION(mnmax),
INTENT(in) :: xm, xn, rmnc, rmns, zmns, zmnc
548 LOGICAL,
intent(in) :: lasym
549 real(dp),
dimension(nextcur),
intent(in) :: extcur_nestor
550 REAL(dp),
DIMENSION(nzeta),
INTENT(in) :: raxis_nestor, zaxis_nestor
551 REAL(dp),
DIMENSION(nznt),
INTENT(in) :: wint
552 real(dp),
dimension(mnpd2),
intent(in) :: bvecsav
553 real(dp),
dimension(mnpd2*mnpd2),
intent(in) :: amatsav
554 real(dp),
intent(in) :: bsubvvac
556 integer :: istat_vac, nvac
559 CALL cdf_open(nvac, trim(vac_file),
'w', istat_vac)
560 IF (istat_vac .ne. 0) stop
'Error writing input file for NESTOR'
565 CALL cdf_define(nvac,
vn_mgrid, trim(mgrid_file))
566 CALL cdf_define(nvac,
vn_inputext, trim(input_extension))
568 CALL cdf_define(nvac,
vn_ivac, ivac)
569 CALL cdf_define(nvac,
vn_nfp, nfp)
570 CALL cdf_define(nvac,
vn_ntor, ntor)
571 CALL cdf_define(nvac,
vn_mpol, mpol)
572 CALL cdf_define(nvac,
vn_nzeta, nzeta)
574 CALL cdf_define(nvac,
vn_mnmax, mnmax)
583 CALL cdf_define(nvac,
vn_rbtor, rbtor)
584 CALL cdf_define(nvac,
vn_ctor, ctor)
585 CALL cdf_define(nvac,
vn_lasym, lasym)
593 CALL cdf_define(nvac,
vn_mnpd2, mnpd2)
599 CALL cdf_write(nvac,
vn_mgrid, trim(mgrid_file))
600 CALL cdf_write(nvac,
vn_inputext, trim(input_extension))
602 CALL cdf_write(nvac,
vn_ivac, ivac)
603 CALL cdf_write(nvac,
vn_nfp, nfp)
604 CALL cdf_write(nvac,
vn_ntor, ntor)
605 CALL cdf_write(nvac,
vn_mpol, mpol)
606 CALL cdf_write(nvac,
vn_nzeta, nzeta)
608 CALL cdf_write(nvac,
vn_mnmax, mnmax)
609 CALL cdf_write(nvac,
vn_pmod, xm)
610 CALL cdf_write(nvac,
vn_tmod, xn)
611 CALL cdf_write(nvac,
vn_rmnc, rmnc)
612 CALL cdf_write(nvac,
vn_zmns, zmns)
614 CALL cdf_write(nvac,
vn_rmns, rmns)
615 CALL cdf_write(nvac,
vn_zmnc, zmnc)
617 CALL cdf_write(nvac,
vn_rbtor, rbtor)
618 CALL cdf_write(nvac,
vn_ctor, ctor)
619 CALL cdf_write(nvac,
vn_lasym, lasym)
621 CALL cdf_write(nvac,
vn_extcur, extcur_nestor)
624 CALL cdf_write(nvac,
vn_wint, wint)
627 CALL cdf_write(nvac,
vn_mnpd2, mnpd2)
636 use vacmod,
only:
brv,
bphiv,
bzv,
bsqvac, mnpd, xmpot, xnpot,
potvac, mnpd2,
bsubvvac, &
654 character(len=*),
intent(in) :: vac_file
655 integer,
intent(out) :: ier_flag
656 integer,
intent(out) :: ivac
658 integer :: istat_vac, nvac
661 CALL cdf_open(nvac, trim(vac_file),
'r', istat_vac)
662 IF (istat_vac .ne. 0) stop
'Error writing output file of NESTOR'
665 call cdf_read(nvac,
vn_ivac, ivac)
668 call cdf_read(nvac,
vn_mnpd , mnpd )
669 call cdf_read(nvac,
vn_mnpd2 , mnpd2 )
670 call cdf_read(nvac,
vn_xmpot , xmpot )
671 call cdf_read(nvac,
vn_xnpot , xnpot )
subroutine read_mgrid(mgrid_file, extcur, nv, nfp, lscreen, ier_flag)
character(len= *), parameter vn_nfp
Input and Output for stand-alone NESTOR.
character(len= *), parameter vn_ntor
character(len= *), parameter vn_rsinuv
character(len= *), parameter vn_ivacskip
character(len= *), parameter vn_snr
character(len= *), parameter vn_auv
character(len= *), parameter vn_m_map
character(len= *), parameter vn_amatrix
character(len= *), parameter vn_xmpot
character(len= *), parameter vn_zvb
character(len= *), parameter vn_inputext
character(len= *), parameter vn_mgrid
real(dp), dimension(:), allocatable rmnc
character(len= *), parameter vn_sqrtc
character(len= *), parameter vn_guu_b
character(len= *), parameter vn_adp
character(len= *), parameter vn_r1b
character(len= *), parameter vn_zmns
character(len= *), dimension(1), parameter nextcurim
character(len= *), parameter vn_mnpd2
subroutine write_nestor_outputs(vac_file, lasym, ivac, ier_flag)
character(len= *), parameter vn_zuu
real(dp), dimension(:), allocatable extcur
character(len= *), parameter vn_ra1m
real(dp), dimension(:), allocatable rmns
character(len= *), parameter vn_bexu
character(len= *), parameter vn_avv
character(len= *), parameter vn_amatsav
character(len= *), parameter vn_greenp
character(len= *), parameter vn_rvv
character(len= *), parameter vn_rzb2
character(len= *), parameter vn_tmod
character(len= *), parameter vn_ier_flag
character(len= *), parameter vn_ruu
character(len= *), parameter vn_tanu
character(len= *), dimension(1), parameter bvecsavdim
character(len= *), parameter vn_rub
character(len= *), parameter vn_bphiv
character(len= *), parameter vn_all_tlm
character(len= *), parameter vn_mnmax
character(len= *), dimension(1), parameter amatsavdim
character(len= *), parameter vn_ctor
character(len= *), parameter vn_imirr
character(len= *), parameter vn_lasym
character(len= *), parameter vn_bzv
character(len= *), parameter vn_sqad2u
character(len=255) input_extension
character(len= *), parameter vn_grpmn
character(len= *), parameter vn_adm
character(len= *), parameter vn_nfp
character(len= *), parameter vn_bsubvvac
real(dp), dimension(:), allocatable wint
character(len= *), parameter vn_zvv
real(dp), dimension(:), allocatable zaxis
real(dp), dimension(:), allocatable zmns
character(len= *), parameter vn_delt1u
character(len= *), parameter vn_nzeta
character(len= *), parameter vn_bexv
character(len= *), dimension(1), parameter nzetadim
character(len= *), parameter vn_sqad1u
character(len= *), parameter vn_snz
subroutine read_nestor_inputs(vac_file)
character(len= *), parameter vn_guv_b
character(len= *), parameter vn_sqrta
character(len= *), parameter vn_bphi
character(len= *), parameter vn_brv
character(len= *), parameter vn_rmns
character(len= *), dimension(2), parameter r2dim
real(dp), dimension(:), allocatable raxis
character(len= *), parameter vn_rbtor
character(len= *), parameter vn_r0m
character(len= *), parameter vn_gvv_b
character(len= *), dimension(1), parameter nzntdim
character(len= *), parameter vn_bsubv
character(len= *), parameter vn_brad
character(len= *), dimension(1), parameter mn1dim
character(len= *), parameter vn_r1p
character(len= *), parameter vn_cma
character(len= *), parameter vn_tanv
character(len= *), parameter vn_azm1u
character(len= *), parameter vn_ntheta
character(len= *), parameter vn_potv
character(len= *), parameter vn_xnpot
character(len= *), parameter vn_ivac
character(len= *), parameter vn_bexn
character(len= *), parameter vn_bvecsav
character(len= *), parameter vn_azp1u
character(len= *), parameter vn_ra1p
character(len= *), dimension(1), parameter mnpotdim
character(len= *), parameter vn_bexni
character(len= *), parameter vn_cma11u
character(len= *), parameter vn_potu
character(len= *), parameter vn_vacuum_calls
character(len= *), parameter vn_rmnc
character(len= *), parameter vn_r0p
character(len= *), parameter vn_raxis_nestor
character(len= *), parameter vn_signgs
character(len= *), parameter vn_auu
character(len= *), parameter vn_drv
character(len= *), parameter vn_all_slp
character(len= *), parameter vn_rcosuv
character(len= *), parameter vn_snv
character(len= *), parameter vn_potvac
character(len= *), parameter vn_all_slm
real(dp), dimension(:), allocatable zmnc
character(len= *), parameter vn_bsubu
character(len= *), parameter vn_zmnc
real(dp), dimension(:), allocatable xn
character(len= *), parameter vn_pmod
real(dp), dimension(:), allocatable xm
character(len= *), parameter vn_bz
character(len= *), parameter vn_grpmn_m_map
character(len= *), parameter vn_n_map
character(len= *), parameter vn_extcur
character(len= *), parameter vn_zaxis_nestor
character(len= *), parameter vn_mnpd
character(len= *), parameter vn_wint
character(len= *), parameter vn_ruv
character(len= *), parameter vn_zuv
character(len=255) mgrid_file
real(dp), dimension(:), allocatable bvecsav_nestor
character(len= *), parameter vn_z1b
character(len= *), parameter vn_mpol
character(len= *), parameter vn_bsqvac
character(len= *), parameter vn_zub
character(len= *), parameter vn_r1m
character(len= *), parameter vn_gstore
character(len= *), parameter vn_rvb
character(len= *), parameter vn_grpmn_n_map
character(len= *), parameter vn_all_tlp
character(len= *), parameter vn_green
real(dp), dimension(:), allocatable amatsav_nestor
real(rprec), dimension(:), allocatable bsubv
real(rprec), dimension(:,:), allocatable all_slp
real(rprec), dimension(:), allocatable bsqvac
real(rprec), dimension(:,:), allocatable all_tlp
real(rprec), dimension(:), allocatable auu
real(rprec), dimension(:), allocatable zuu
real(rprec), dimension(:), allocatable cma
real(rprec), dimension(:), allocatable zvb
real(rprec), dimension(:), allocatable r1b
real(rprec), dimension(:), allocatable r0m
real(rprec), dimension(:), allocatable bvecsav
real(rprec), dimension(:), allocatable ruv
real(rprec), dimension(:), allocatable sqad1u
real(rprec), dimension(:), allocatable zub
real(rprec), dimension(:), allocatable bphi
real(rprec), dimension(:,:), allocatable greenp
real(rprec), dimension(:), allocatable grpmn_m_map_wrt
real(rprec), dimension(:), allocatable z1b
real(rprec), dimension(:), allocatable r1p
real(rprec), dimension(:), allocatable zvv
real(rprec), dimension(:), allocatable bexni
real(rprec), dimension(:), allocatable bzv
real(rprec), dimension(:), allocatable amatsav
real(rprec), dimension(:), allocatable azp1u
real(rprec), dimension(:), allocatable snz
real(rprec), dimension(:), allocatable snr
real(rprec), dimension(:), allocatable grpmn
real(rprec), dimension(:), allocatable ra1m
real(rprec), dimension(:), allocatable, target potvac
real(rprec), dimension(:), allocatable sqad2u
real(rprec), dimension(:), allocatable adm
real(rprec), dimension(:,:), allocatable all_tlm
real(rprec), dimension(:), allocatable sqrtc
real(rprec), dimension(:), allocatable r1m
real(rprec), dimension(:), allocatable cma11u
real(rprec), dimension(:), allocatable ruu
real(rprec), dimension(:), allocatable brv
real(rprec), dimension(:), allocatable rzb2
real(rprec), dimension(:), allocatable rub
real(rprec), dimension(:), allocatable gstore
real(rprec), dimension(:), allocatable grpmn_n_map_wrt
real(rprec), dimension(:), allocatable rsinuv
real(rprec), dimension(:), allocatable rvb
real(rprec), dimension(:), allocatable sqrta
real(rprec), dimension(:), allocatable azm1u
real(rprec), dimension(:), allocatable snv
real(rprec), dimension(:), allocatable rvv
real(rprec), dimension(:), allocatable guu_b
real(rprec), dimension(:,:), allocatable all_slm
real(rprec), dimension(:), allocatable adp
real(rprec), dimension(:), allocatable bphiv
real(rprec), dimension(:), allocatable auv
real(rprec), dimension(:), allocatable avv
real(rprec), dimension(:,:), allocatable green
real(rprec), dimension(:), allocatable gvv_b
real(rprec), dimension(:), allocatable delt1u
real(rprec), dimension(:), allocatable bexv
real(rprec), dimension(:), allocatable guv_b
real(rprec), dimension(:), allocatable bsubu
real(rprec), dimension(:), allocatable r0p
real(rprec), dimension(:), allocatable n_map_wrt
real(rprec), dimension(:), allocatable m_map_wrt
real(rprec), dimension(:), allocatable bz
real(rprec), dimension(:), allocatable zuv
real(rprec), dimension(:), allocatable ra1p
real(rprec), dimension(:), allocatable amatrix
real(rprec), dimension(:), allocatable brad
real(rprec), dimension(:), allocatable potv
real(rprec), dimension(:), allocatable bexu
real(rprec), dimension(:), allocatable rcosuv
real(rprec), dimension(:), allocatable potu
real(rprec), dimension(:), allocatable bexn
real(rprec), dimension(:), allocatable drv
subroutine read_nestor_outputs(vac_file, ier_flag, ivac)
subroutine write_nestor_inputs(vac_file, vacuum_calls, ier_flag, mgrid_file, input_extension, ivacskip, ivac, nfp, ntor, mpol, nzeta, ntheta, mnmax, xm, xn, rmnc, zmns, rmns, zmnc, rbtor, ctor, lasym, signgs, extcur_nestor, raxis_nestor, zaxis_nestor, wint, nznt, amatsav, bvecsav, mnpd2, bsubvvac)