VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
mgrid_mod Module Reference

Functions/Subroutines

subroutine read_mgrid (mgrid_file, extcur, nv, nfp, lscreen, ier_flag)
 
subroutine sum_bfield (bfield, bf_add, cur, n1)
 
subroutine assign_bptrs (bptr)
 
subroutine free_mgrid (istat)
 

Variables

logical lnverror =.true.
 
integer, parameter nlimset = 2
 
character(len= *), parameter vn_br0 = 'br'
 
character(len= *), parameter vn_bp0 = 'bp'
 
character(len= *), parameter vn_bz0 = 'bz'
 
character(len= *), parameter vn_ir = 'ir'
 
character(len= *), parameter vn_jz = 'jz'
 
character(len= *), parameter vn_kp = 'kp'
 
character(len= *), parameter vn_nfp = 'nfp'
 
character(len= *), parameter vn_rmin ='rmin'
 
character(len= *), parameter vn_rmax ='rmax'
 
character(len= *), parameter vn_zmin ='zmin'
 
character(len= *), parameter vn_zmax ='zmax'
 
character(len= *), parameter vn_coilgrp ='coil_group'
 
character(len= *), parameter vn_nextcur = 'nextcur'
 
character(len= *), parameter vn_mgmode ='mgrid_mode'
 
character(len= *), parameter vn_coilcur = 'raw_coil_cur'
 
character(len= *), parameter vn_flp = 'nobser'
 
character(len= *), parameter vn_nobd = 'nobd'
 
character(len= *), parameter vn_nbset = 'nbsets'
 
character(len= *), parameter vn_nbfld = 'nbfld'
 
character(len= *), parameter ln_flp = 'flux loops'
 
character(len= *), parameter ln_nobd = 'Connected flux loops'
 
character(len= *), parameter ln_nbset = 'B-coil loops'
 
character(len= *), parameter ln_next = 'External currents'
 
character(len= *), parameter ln_nbfld = 'B-coil measurements'
 
integer nr0b
 
integer np0b
 
integer nfper0
 
integer nz0b
 
integer nobd
 
integer nobser
 
integer nextcur
 
integer nbfldn
 
integer nbsets
 
integer nbcoilsn
 
integer nbvac
 
integer nbcoil_max
 
integer nlim
 
integer nlim_max
 
integer nsets
 
integer nrgrid
 
integer nzgrid
 
integer, dimension(:), allocatable needflx
 
integer, dimension(:), allocatable nbcoils
 
integer, dimension(:), allocatable limitr
 
integer, dimension(:), allocatable nsetsn
 
integer, dimension(:,:), allocatable iconnect
 
integer, dimension(:,:), allocatable needbfld
 
real(rprecrminb
 
real(rpreczminb
 
real(rprecrmaxb
 
real(rpreczmaxb
 
real(rprecdelrb
 
real(rprecdelzb
 
real(rprecrx1
 
real(rprecrx2
 
real(rpreczy1
 
real(rpreczy2
 
real(rpreccondif
 
real(rprec), dimension(:,:), allocatable, target bvac
 
real(rprec), dimension(:,:,:), pointer brvac
 
real(rprec), dimension(:,:,:), pointer bzvac
 
real(rprec), dimension(:,:,:), pointer bpvac
 
real(rprec), dimension(:,:), allocatable unpsiext
 
real(rprec), dimension(:,:), allocatable plbfld
 
real(rprec), dimension(:,:), allocatable rbcoil
 
real(rprec), dimension(:,:), allocatable zbcoil
 
real(rprec), dimension(:,:), allocatable abcoil
 
real(rprec), dimension(:,:), allocatable bcoil
 
real(rprec), dimension(:,:), allocatable rbcoilsqr
 
real(rprec), dimension(:), allocatable raw_coil_current
 
real(rprec), dimension(:), allocatable xobser
 
real(rprec), dimension(:), allocatable zobser
 
real(rprec), dimension(:), allocatable xobsqr
 
real(rprec), dimension(:), allocatable dsiext
 
real(rprec), dimension(:), allocatable psiext
 
real(rprec), dimension(:), allocatable plflux
 
real(rprec), dimension(:), allocatable b_chi
 
character(len=300) mgrid_path
 
character(len=300) mgrid_path_old = " "
 
character(len=30), dimension(:), allocatable curlabel
 
character(len=15), dimension(:), allocatable dsilabel
 
character(len=15), dimension(:), allocatable bloopnames
 
character(len=30) tokid
 
real(rprec), dimension(:,:,:), allocatable dbcoil
 
real(rprec), dimension(:,:,:), allocatable pfcspec
 
real(rprec), dimension(:,:), allocatable rlim
 
real(rprec), dimension(:,:), allocatable zlim
 
real(rprec), dimension(:,:), allocatable reslim
 
real(rprec), dimension(:,:), allocatable seplim
 
character(len=1) mgrid_mode
 

Function/Subroutine Documentation

◆ assign_bptrs()

subroutine mgrid_mod::assign_bptrs ( real(rprec), dimension(nr0b,nz0b,np0b,3), intent(in), target bptr)

Definition at line 700 of file mgrid_mod.f.

References bpvac, brvac, and bzvac.

◆ free_mgrid()

subroutine mgrid_mod::free_mgrid ( integer istat)

Definition at line 710 of file mgrid_mod.f.

References abcoil, b_chi, bcoil, bloopnames, bvac, curlabel, dbcoil, dsiext, dsilabel, iconnect, mgrid_path_old, nbcoils, needbfld, needflx, pfcspec, plbfld, plflux, psiext, raw_coil_current, rbcoil, rbcoilsqr, reslim, rlim, seplim, unpsiext, xobser, xobsqr, zbcoil, zlim, and zobser.

Referenced by vmec().

Here is the caller graph for this function:

◆ read_mgrid()

subroutine mgrid_mod::read_mgrid ( character(len=*), intent(in) mgrid_file,
real(rprec), dimension(:), intent(in) extcur,
integer, intent(in) nv,
integer, intent(in) nfp,
logical, intent(in) lscreen,
integer, intent(out) ier_flag )

Definition at line 112 of file mgrid_mod.f.

References bcoil, bvac, curlabel, dbcoil, delrb, delzb, vmec_input::lfreeb, lnverror, mgrid_mode, mgrid_path, mgrid_path_old, nbcoil_max, nbcoils, nbsets, nbvac, nextcur, nfper0, nobd, nobser, np0b, nr0b, nz0b, psiext, raw_coil_current, rmaxb, rminb, safe_open_mod::safe_open(), sum_bfield(), unpsiext, vn_bp0, vn_br0, vn_bz0, vn_coilcur, vn_coilgrp, vn_ir, vn_jz, vn_kp, vn_mgmode, vn_nextcur, vn_nfp, vn_rmax, vn_rmin, vn_zmax, vn_zmin, zmaxb, and zminb.

Referenced by nestor_io::read_nestor_inputs(), and readin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sum_bfield()

subroutine mgrid_mod::sum_bfield ( real(rprec), dimension(n1), intent(inout) bfield,
real(rprec), dimension(n1), intent(in) bf_add,
real(rprec) cur,
integer n1 )

Definition at line 690 of file mgrid_mod.f.

Referenced by read_mgrid().

Here is the caller graph for this function:

Variable Documentation

◆ abcoil

real(rprec), dimension(:,:), allocatable mgrid_mod::abcoil

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ b_chi

real(rprec), dimension(:), allocatable mgrid_mod::b_chi

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ bcoil

real(rprec), dimension(:,:), allocatable mgrid_mod::bcoil

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ bloopnames

character(len=15), dimension(:), allocatable mgrid_mod::bloopnames

Definition at line 96 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ bpvac

real(rprec), dimension(:,:,:), pointer mgrid_mod::bpvac

Definition at line 87 of file mgrid_mod.f.

Referenced by assign_bptrs().

◆ brvac

real(rprec), dimension(:,:,:), pointer mgrid_mod::brvac

Definition at line 87 of file mgrid_mod.f.

Referenced by assign_bptrs().

◆ bvac

real(rprec), dimension(:,:), allocatable, target mgrid_mod::bvac

Definition at line 86 of file mgrid_mod.f.

Referenced by bextern(), free_mgrid(), and read_mgrid().

◆ bzvac

real(rprec), dimension(:,:,:), pointer mgrid_mod::bzvac

Definition at line 87 of file mgrid_mod.f.

Referenced by assign_bptrs().

◆ condif

real(rprec) mgrid_mod::condif

Definition at line 85 of file mgrid_mod.f.

◆ curlabel

character(len=30), dimension(:), allocatable mgrid_mod::curlabel

◆ dbcoil

real(rprec), dimension(:,:,:), allocatable mgrid_mod::dbcoil

Definition at line 99 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ delrb

real(rprec) mgrid_mod::delrb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), and read_mgrid().

◆ delzb

real(rprec) mgrid_mod::delzb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), and read_mgrid().

◆ dsiext

real(rprec), dimension(:), allocatable mgrid_mod::dsiext

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ dsilabel

character(len=15), dimension(:), allocatable mgrid_mod::dsilabel

Definition at line 96 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ iconnect

integer, dimension(:,:), allocatable mgrid_mod::iconnect

Definition at line 83 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ limitr

integer, dimension(:), allocatable mgrid_mod::limitr

Definition at line 82 of file mgrid_mod.f.

◆ ln_flp

character(len=*), parameter mgrid_mod::ln_flp = 'flux loops'

Definition at line 16 of file mgrid_mod.f.

◆ ln_nbfld

character(len=*), parameter mgrid_mod::ln_nbfld = 'B-coil measurements'

Definition at line 16 of file mgrid_mod.f.

◆ ln_nbset

character(len=*), parameter mgrid_mod::ln_nbset = 'B-coil loops'

Definition at line 16 of file mgrid_mod.f.

◆ ln_next

character(len=*), parameter mgrid_mod::ln_next = 'External currents'

Definition at line 16 of file mgrid_mod.f.

◆ ln_nobd

character(len=*), parameter mgrid_mod::ln_nobd = 'Connected flux loops'

Definition at line 16 of file mgrid_mod.f.

◆ lnverror

logical mgrid_mod::lnverror =.true.

Definition at line 8 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ mgrid_mode

character(len=1) mgrid_mod::mgrid_mode

◆ mgrid_path

character(len=300) mgrid_mod::mgrid_path

Definition at line 93 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ mgrid_path_old

character(len=300) mgrid_mod::mgrid_path_old = " "

Definition at line 94 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ nbcoil_max

integer mgrid_mod::nbcoil_max

Definition at line 79 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ nbcoils

integer, dimension(:), allocatable mgrid_mod::nbcoils

Definition at line 81 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ nbcoilsn

integer mgrid_mod::nbcoilsn

Definition at line 78 of file mgrid_mod.f.

◆ nbfldn

integer mgrid_mod::nbfldn

Definition at line 78 of file mgrid_mod.f.

◆ nbsets

integer mgrid_mod::nbsets

Definition at line 78 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ nbvac

integer mgrid_mod::nbvac

Definition at line 79 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ needbfld

integer, dimension(:,:), allocatable mgrid_mod::needbfld

Definition at line 83 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ needflx

integer, dimension(:), allocatable mgrid_mod::needflx

Definition at line 81 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ nextcur

integer mgrid_mod::nextcur

◆ nfper0

integer mgrid_mod::nfper0

Definition at line 77 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ nlim

integer mgrid_mod::nlim

Definition at line 79 of file mgrid_mod.f.

◆ nlim_max

integer mgrid_mod::nlim_max

Definition at line 79 of file mgrid_mod.f.

◆ nlimset

integer, parameter mgrid_mod::nlimset = 2

Definition at line 9 of file mgrid_mod.f.

◆ nobd

integer mgrid_mod::nobd

Definition at line 78 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ nobser

integer mgrid_mod::nobser

Definition at line 78 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ np0b

integer mgrid_mod::np0b

Definition at line 77 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ nr0b

integer mgrid_mod::nr0b

Definition at line 77 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ nrgrid

integer mgrid_mod::nrgrid

Definition at line 79 of file mgrid_mod.f.

◆ nsets

integer mgrid_mod::nsets

Definition at line 79 of file mgrid_mod.f.

◆ nsetsn

integer, dimension(:), allocatable mgrid_mod::nsetsn

Definition at line 82 of file mgrid_mod.f.

◆ nz0b

integer mgrid_mod::nz0b

Definition at line 77 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ nzgrid

integer mgrid_mod::nzgrid

Definition at line 79 of file mgrid_mod.f.

◆ pfcspec

real(rprec), dimension(:,:,:), allocatable mgrid_mod::pfcspec

Definition at line 99 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ plbfld

real(rprec), dimension(:,:), allocatable mgrid_mod::plbfld

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ plflux

real(rprec), dimension(:), allocatable mgrid_mod::plflux

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ psiext

real(rprec), dimension(:), allocatable mgrid_mod::psiext

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ raw_coil_current

real(rprec), dimension(:), allocatable mgrid_mod::raw_coil_current

Definition at line 90 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ rbcoil

real(rprec), dimension(:,:), allocatable mgrid_mod::rbcoil

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ rbcoilsqr

real(rprec), dimension(:,:), allocatable mgrid_mod::rbcoilsqr

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ reslim

real(rprec), dimension(:,:), allocatable mgrid_mod::reslim

Definition at line 100 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ rlim

real(rprec), dimension(:,:), allocatable mgrid_mod::rlim

Definition at line 100 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ rmaxb

real(rprec) mgrid_mod::rmaxb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ rminb

real(rprec) mgrid_mod::rminb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ rx1

real(rprec) mgrid_mod::rx1

Definition at line 85 of file mgrid_mod.f.

◆ rx2

real(rprec) mgrid_mod::rx2

Definition at line 85 of file mgrid_mod.f.

◆ seplim

real(rprec), dimension(:,:), allocatable mgrid_mod::seplim

Definition at line 100 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ tokid

character(len=30) mgrid_mod::tokid

Definition at line 98 of file mgrid_mod.f.

◆ unpsiext

real(rprec), dimension(:,:), allocatable mgrid_mod::unpsiext

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid(), and read_mgrid().

◆ vn_bp0

character(len=*), parameter mgrid_mod::vn_bp0 = 'bp'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_br0

character(len=*), parameter mgrid_mod::vn_br0 = 'br'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_bz0

character(len=*), parameter mgrid_mod::vn_bz0 = 'bz'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_coilcur

character(len=*), parameter mgrid_mod::vn_coilcur = 'raw_coil_cur'

Definition at line 16 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_coilgrp

character(len=*), parameter mgrid_mod::vn_coilgrp ='coil_group'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_flp

character(len=*), parameter mgrid_mod::vn_flp = 'nobser'

Definition at line 16 of file mgrid_mod.f.

◆ vn_ir

character(len=*), parameter mgrid_mod::vn_ir = 'ir'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_jz

character(len=*), parameter mgrid_mod::vn_jz = 'jz'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_kp

character(len=*), parameter mgrid_mod::vn_kp = 'kp'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_mgmode

character(len=*), parameter mgrid_mod::vn_mgmode ='mgrid_mode'

Definition at line 16 of file mgrid_mod.f.

Referenced by read_mgrid(), read_wout_mod::read_wout_file::readw_and_open(), and wrout().

◆ vn_nbfld

character(len=*), parameter mgrid_mod::vn_nbfld = 'nbfld'

Definition at line 16 of file mgrid_mod.f.

◆ vn_nbset

character(len=*), parameter mgrid_mod::vn_nbset = 'nbsets'

Definition at line 16 of file mgrid_mod.f.

◆ vn_nextcur

character(len=*), parameter mgrid_mod::vn_nextcur = 'nextcur'

Definition at line 16 of file mgrid_mod.f.

Referenced by read_mgrid(), read_wout_mod::read_wout_file::readw_and_open(), and wrout().

◆ vn_nfp

character(len=*), parameter mgrid_mod::vn_nfp = 'nfp'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid(), nestor_io::read_nestor_inputs(), and write_nestor_inputs().

◆ vn_nobd

character(len=*), parameter mgrid_mod::vn_nobd = 'nobd'

Definition at line 16 of file mgrid_mod.f.

◆ vn_rmax

character(len=*), parameter mgrid_mod::vn_rmax ='rmax'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_rmin

character(len=*), parameter mgrid_mod::vn_rmin ='rmin'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_zmax

character(len=*), parameter mgrid_mod::vn_zmax ='zmax'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ vn_zmin

character(len=*), parameter mgrid_mod::vn_zmin ='zmin'

Definition at line 10 of file mgrid_mod.f.

Referenced by read_mgrid().

◆ xobser

real(rprec), dimension(:), allocatable mgrid_mod::xobser

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ xobsqr

real(rprec), dimension(:), allocatable mgrid_mod::xobsqr

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ zbcoil

real(rprec), dimension(:,:), allocatable mgrid_mod::zbcoil

Definition at line 88 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ zlim

real(rprec), dimension(:,:), allocatable mgrid_mod::zlim

Definition at line 100 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ zmaxb

real(rprec) mgrid_mod::zmaxb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ zminb

real(rprec) mgrid_mod::zminb

Definition at line 84 of file mgrid_mod.f.

Referenced by becoil(), read_mgrid(), and readin().

◆ zobser

real(rprec), dimension(:), allocatable mgrid_mod::zobser

Definition at line 91 of file mgrid_mod.f.

Referenced by free_mgrid().

◆ zy1

real(rprec) mgrid_mod::zy1

Definition at line 85 of file mgrid_mod.f.

◆ zy2

real(rprec) mgrid_mod::zy2

Definition at line 85 of file mgrid_mod.f.