Skip to content

Commit

Permalink
Merge pull request #46 from holm10/variable_tags
Browse files Browse the repository at this point in the history
Implements tags for UEDGE variables, that can be used to track changes
  • Loading branch information
holm10 authored Sep 19, 2023
2 parents f19d5d9 + 6a3c71c commit 328a4f1
Show file tree
Hide file tree
Showing 11 changed files with 1,228 additions and 1,188 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: bug
assignees: ''

---
Expand Down
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/code-enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Code enhancement
about: Suggest an improvement for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ uedge.egg-info/
dist/uedge-8.0.0-py3.7-macosx-10.9-x86_64.egg
uedge.egg-info
*.c
*.f

*.f
2 changes: 1 addition & 1 deletion aph/aph.v
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ aphdir character*120 # name of directory containing data files
data_directory character*120 # another dirname containing data files. This is to be be passed in

***** Ionization_energy:
erad real [eV] /25./ # tot elec engy loss/ioniz (rad+binding) if istabon=0
erad real [eV] /25./ +input # tot elec engy loss/ioniz (rad+binding) if istabon=0

***** Rtdata:
# hydrogenic rate table data from ADPAK via Braams' rate code
Expand Down
2 changes: 1 addition & 1 deletion api/api.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ getprad(nx,ny,ngsp,te,ne:real,ng:real,afrac,atau,
***** Impurity_transport:
# variable specifying radial transport rate of impurities
dnimp real /1./ [m**2/s]
methimp integer /33/ # specifies interp. for finite diff. for (y,x)
methimp integer /33/ +input # specifies interp. for finite diff. for (y,x)
# 66 is log interp., 77 inverse interp.,
# otherwise linear interp.
csexpn real /0./ # exponent for reducing impurity || vel from
Expand Down
1,939 changes: 987 additions & 952 deletions bbb/bbb.v

Large diffs are not rendered by default.

18 changes: 2 additions & 16 deletions bbb/odesetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ cc Use(Rccoef)
* -- local variables
integer lda, lenk, ngspon, nispon, nuspon, ntgspon, ifld, isor, id
character*60 runid
integer iprt_tfcx_warn
data iprt_tfcx_warn/1/
#Former Aux module variables
integer igsp

Expand Down Expand Up @@ -204,13 +202,6 @@ call xerrab("")
endif
enddo

c ... Check attempt to use deprecated variables fchemywi and fchemywo
if (fchemywi .ne. 1. .or. fchemywo .ne. 1.) then
call remark('**Input error: change fchemywi --> fchemygwi(igsp)
. and fchemywo --> fchemygwo(igsp)')
call xerrab("")
endif

c ... Check consistency of cngmom; should be zero if inertial neutrals
if (isupgon(1).eq. 1 .and. cngmom(1).ne.0) then
call remark('*** WARNING, likely Error: cngmom=1, isupgon=1')
Expand Down Expand Up @@ -264,11 +255,6 @@ call remark('*** ERROR: use cgengpl, not cgpl for neut eng loss')
call remark('*** Warning: yinc=2 recommended when isphion=1')
endif

c ... Check if tfcx or tfcy set in input file
if ((tfcx>1.e-10 .or. tfcy>1.e-10) .and. iprt_tfcx_warn==1) then
call remark('*** WARNING: tfcx,y not active; see tgas instead')
iprt_tfcx_warn = 0
endif
c ... Check if isnfmiy=1 when geometry is snowflake > SF15
if (geometry=="snowflake45" .or. geometry=="snowflake75" .or.
. geometry=="snowflake105" .or. geometry=="snowflake135" .or.
Expand Down Expand Up @@ -6552,7 +6538,7 @@ c_mpi call MPI_BARRIER(uedgeComm, myfoo)

* -- For the continuation mode (icntnunk=1), be sure a Jacobian was
* -- calculated on the previous step, i.e., ijac > 0
if (icntnunk==1 .and. ijactot<1 .and. svrpkg=='nksol') then
if (icntnunk==1 .and. ijactot<=1 .and. svrpkg=='nksol') then
call xerrab('**Error: need initial Jacobian-pair for icntnunk=1')
endif

Expand Down Expand Up @@ -6596,7 +6582,7 @@ call gchange("Interp",0)
call comp_vertex_vals # gen plasma/neut values at rm,zm(,,4)
endif
endif
if (iprint .ge. 1) write(6,*) "Interpolants created; mype =", mype
write(6,*) "Interpolants created; mype =", mype
endif

100 continue
Expand Down
150 changes: 75 additions & 75 deletions com/com.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ glbwrlog(ioun) function

***** Dim:
# Variables that contain widely-used dimensions
nx integer /8/ # number of cells in x (poloidal) direc. (see also nxm)
ny integer /4/ # number of cells in y (radial) direction
nx integer /8/ +griddata # number of cells in x (poloidal) direc. (see also nxm)
ny integer /4/ +griddata # number of cells in y (radial) direction
nxm integer /8/ # total number of cells in x direc.; nxm = nx+|nxomit|
nym integer /4/ # total number of cells in y direc.; nym = ny+nyomitmx
nxpt integer /1/ # number of x-points in (R,Z) simulation domain
nhsp integer /1/ # number of hydrogenic species
nzsp(1:ngspmx-1) integer /5*0/ # number of impurity species per gas species
nhsp integer /1/ +input # number of hydrogenic species
nzsp(1:ngspmx-1) integer /5*0/ +input # number of impurity species per gas species
nzspt integer /1/ # total number of impurity species
nzspmx integer /10/ # maximum of nzsp(igsp) used for storage allocation
nisp integer /1/ # number of ion species
nusp integer # number of parallel momentum equations
nfsp integer # number of cont. eqns or flux species (calc internal)
ngsp integer /1/ +restart +regrid # number of gas species
nhgsp integer /1/ # number of hydrogen gas species (prepare for tritium)
nisp integer /1/ +input # number of ion species
nusp integer +input # number of parallel momentum equations
nfsp integer +input # number of cont. eqns or flux species (calc internal)
ngsp integer /1/ +input +regrid # number of gas species
nhgsp integer /1/ +input # number of hydrogen gas species (prepare for tritium)
imx integer /50/ # size in x of Zagorski arrays
imy integer /40/ # size in y of Zagorski arrays
lnst integer /43/ # size of impurity species(?) for Zagorski
Expand Down Expand Up @@ -60,25 +60,25 @@ bcentr real [Tesla]
# reference toroidal field
rcentr real [m]
# major radius where vacuum toroidal field is bcentr
rmagx real [m]
rmagx real [m] +griddata
# major radius of magnetic axis
zmagx real [m]
zmagx real [m] +griddata
# vertical position of magnetic axis
simagx real [volt-sec/radian]
simagx real [volt-sec/radian] +griddata
# poloidal magnetic flux at the magnetic axis
sibdry real [volt-sec/radian]
sibdry real [volt-sec/radian] +griddata
# poloidal magnetic flux at primary x-point
sibdry1 real [volt-sec/radian]
sibdry1 real [volt-sec/radian] +griddata
# poloidal magnetic flux at the lower x-point
sibdry2 real [volt-sec/radian]
sibdry2 real [volt-sec/radian] +griddata
# poloidal magnetic flux at the upper x-point
xdim real [m]
# horizontal (radial) extent of EFIT computational grid
zdim real [m]
# vertical extent of EFIT computational grid
zmid real [m]
zmid real [m] +griddata
# vertical height of midplane above bottom of EFIT mesh
zshift real [m]
zshift real [m] +griddata
# vertical shift of EFIT data to put z=0 at the bottom
workk(nxefit) _real
# dummy array for neqdsk output
Expand All @@ -96,9 +96,9 @@ rbdry(nbdry) _real [m]
# radial coordinates of last closed flux surface from EFIT
zbdry(nbdry) _real [m]
# vertical coordinates of last closed flux surface from EFIT
xlim(nlim) _real [m]
xlim(nlim) _real [m] +griddata
# radial coordinates of limiter/vessel boundary from EFIT
ylim(nlim) _real [m]
ylim(nlim) _real [m] +griddata
# vertical coordinates of limiter/vessel boundary from EFIT
bscoef(nxefit,nyefit) _real
# 2-d spline coefficients
Expand Down Expand Up @@ -150,25 +150,25 @@ eshot integer
# shot number from EFIT
etime real [msec]
# time slice from EFIT
rseps real [m]
rseps real [m] +griddata
# major radius of lower x-point
zseps real [m]
zseps real [m] +griddata
# vertical position of lower x-point
rseps1 real [m]
rseps1 real [m] +griddata
# major radius of lower x-point
zseps1 real [m]
zseps1 real [m] +griddata
# vertical position of lower x-point
rseps2 real [m]
rseps2 real [m] +griddata
# major radius of upper x-point
zseps2 real [m]
zseps2 real [m] +griddata
# vertical position of upper x-point
rvsin real [m]
rvsin real [m] +griddata
# major radius of inboard strike point
zvsin real [m]
zvsin real [m] +griddata
# vertical position of inboard strike point
rvsout real [m]
rvsout real [m] +griddata
# major radius of outboard strike point
zvsout real [m]
zvsout real [m] +griddata
# vertical position of outboard strike point
mco2v integer /3/
# number of vertical co2 chords
Expand Down Expand Up @@ -203,18 +203,18 @@ aeqdskfname character*128 /'aeqdsk'/

***** RZ_grid_info:
# RZ grid location data and magnetic-field info at those locations
rm(0:nxm+1,0:nym+1,0:4) _real [m] # radial cell position, 0 is center
zm(0:nxm+1,0:nym+1,0:4) _real [m] # vertical cell position, 0 is center
rmt(0:nxm+1,0:nym+1,0:4) _real [m] # temp rad cell position, 0 is center
zmt(0:nxm+1,0:nym+1,0:4) _real [m] # temp vert cell position, 0 is center
rm(0:nxm+1,0:nym+1,0:4) _real [m] +griddata # radial cell position, 0 is center
zm(0:nxm+1,0:nym+1,0:4) _real [m] +griddata # vertical cell position, 0 is center
rmt(0:nxm+1,0:nym+1,0:4) _real [m] +griddata # temp rad cell position, 0 is center
zmt(0:nxm+1,0:nym+1,0:4) _real [m] +griddata # temp vert cell position, 0 is center
rv(0:nxm+2,-1:nym+1) _real [m] # rad position velocity cell corner
zv(0:nxm+2,-1:nym+1) _real [m] # vert position velocity cell corner
psi(0:nxm+1,0:nym+1,0:4) _real [Tm^2] # polodial magnetic flux
br(0:nxm+1,0:nym+1,0:4) _real [T] # radial magnetic field, 0 is center
bz(0:nxm+1,0:nym+1,0:4) _real [T] # vert magnetic field, 0 is center
bpol(0:nxm+1,0:nym+1,0:4) _real [T] # pol. magnetic field, 0 is center
bphi(0:nxm+1,0:nym+1,0:4) _real [T] # tor.l magnetic field, 0 is center
b(0:nxm+1,0:nym+1,0:4) _real [T] # total magnetic field, 0 is center
psi(0:nxm+1,0:nym+1,0:4) _real [Tm^2] +griddata # polodial magnetic flux
br(0:nxm+1,0:nym+1,0:4) _real [T] +griddata # radial magnetic field, 0 is center
bz(0:nxm+1,0:nym+1,0:4) _real [T] +griddata # vert magnetic field, 0 is center
bpol(0:nxm+1,0:nym+1,0:4) _real [T] +griddata # pol. magnetic field, 0 is center
bphi(0:nxm+1,0:nym+1,0:4) _real [T] +griddata # tor.l magnetic field, 0 is center
b(0:nxm+1,0:nym+1,0:4) _real [T] +griddata # total magnetic field, 0 is center
bsqr(0:nxm+1,0:nym+1) _real [T] # B**2 at density-cell center
b12(0:nxm+1,0:nym+1) _real [T] # B**0.5 at vel-cell center/dens face
b12ctr(0:nxm+1,0:nym+1) _real [T] # B**0.5 at density-cell center
Expand All @@ -233,26 +233,26 @@ bg(0:nxm+1,0:nym+1,0:4) _real [T] # global total B field, 0 is center

***** Share:
# Variables used by more than one package
nycore(30) integer /30*0/ +regrid
nycore(30) integer /30*0/ +regrid +gridgen
# number of radial zones in the core region of the edge plasma
nysol(30) integer /30*2/ +regrid
nysol(30) integer /30*2/ +regrid +gridgen
# number of radial zones in the open flux surface region of the edge plasma
nyout(30) integer /30*0/ +regrid
nyout(30) integer /30*0/ +regrid +gridgen
# number of radial zones beyond second separatrix of full double-null
nxleg(30,2) integer /0, 59*2/ +regrid
nxleg(30,2) integer /0, 59*2/ +regrid +gridgen
# number of cells along divertor legs: (,1) inside, (,2) outside
nxcore(30,2) integer /0, 59*4/ +regrid
nxcore(30,2) integer /0, 59*4/ +regrid +gridgen
# number of cells along core boundary: (,1) inside, (,2) outside
nxomit integer /0/
nxomit integer /0/ +gridgen
# number of x-cells to omit from ix=0; if <0, omit from ix=nx for fluid eqns
# done typically for isfixlb=1,2 cases with reflection b.c. at left boundary
nxxpt
nxxpt +gridgen
# number of extra poloidal cells at x-point (per quadrant)
nyomitmx integer /0/
nyomitmx integer /0/ +gridgen
# number of y-cells to omit from iy=ny; used to do core only for fluid eqns
igrid integer /1/ # loop index for which grid; e.g., nysol(igrid)
isgriduehdf5 integer /0/
geometry character*16 /"snull"/
geometry character*16 /"snull"/ +input
# specifies magnetic configuration, e.g.,
# ='snull' for lower single null
# ='uppersn' for upper single null
Expand All @@ -268,18 +268,18 @@ geometry character*16 /"snull"/
nxc integer /4/ # center index of x-grid, normally nx/2,
# OR
# guard cell index for 'dnbot' symmetry b.c.
simagxs real # "shared" value of simagx from flx package
sibdrys real # "shared" value of sibdry from flx package
simagxs real +griddata # "shared" value of simagx from flx package
sibdrys real +griddata # "shared" value of sibdry from flx package
nxpt2msh integer /0/ # number of 1D cells above ixpt2 reset/no-cross
nxpt2psh integer /0/ # number of 1D cells below ixpt2 reset/no-cross
zxpt2msh real /0.01/ [m] # spacing iy=1 1D vertices reset above ixpt2
rxpt2msh real /0.0/ [m] # spacing iy=1 1D vertices reset above ixpt2
zxpt2psh real /0.01/ [m] # spacing iy=1 1D vertices reset below ixpt2
rxpt2psh real /0.0/ [m] # spacing iy=1 1D vertices reset below ixpt2
ismpsym integer /0/ # =1 re-constructs "guard" cells at midplane
ismpsym integer /0/ +gridgen # =1 re-constructs "guard" cells at midplane
# of "dnbot" via up/down symmetry
isudsym integer /0/ #=1 up-down symmetric setup (only down part is modeled)
islimon integer /0/
isudsym integer /0/ +input #=1 up-down symmetric setup (only down part is modeled)
islimon integer /0/ +input
# option switch to apply b.c.'s at ix_lim and ix_lim+1
# =1 turns on limiter/continuity b.c.'s
ix_lim integer
Expand All @@ -288,33 +288,33 @@ iy_lims integer /9999/
# radial index of 1st flux surface where limiter b.c.'s apply
theta_split real /1.570796326794896/
# (computed) poloidal angle where in/outboard regions of the mesh meet
isnonog integer /0/ # is 9-point (non-orthog) differencing on
ismmon integer /0/
isnonog integer /0/ +input # is 9-point (non-orthog) differencing on
ismmon integer /0/ +gridgen
# flag that controls mesh modification
# = 0 strictly orthogonal mesh and divertor plates
# = 1 non-orthogonal mesh, compressed distrib'n on each surface
# = 2 non-orthogonal mesh, standard distrib'n on all surfaces
# = 3 combination of options 1 and 2 using weight factor
# wtmesh1
isoldgrid integer /0/ # =1 returns to pre-1/25/96 nonorthog grid
isgrdsym integer /0/ # =1 makes symmetric grid for mhdgeo.ne.1,
isgrdsym integer /0/ +gridgen # =1 makes symmetric grid for mhdgeo.ne.1,
# requires nxm,ixpt2 even
cutlo real /1.e-300/ #rough range of a small number(avoids R1MACH(2))
#CAUTION; this could be machine dependent
#1.e-300 is generally conservative for 64-bit
#words; on SUN double-p (e-330); C-90 (e-2500)
epslon real /1e-6/ #scale factor for relative guard-cell size
spheromak integer /0/ # =0 for tokamak, use vacuum toroidal field
spheromak integer /0/ +input # =0 for tokamak, use vacuum toroidal field
# =1 for spheromak, use bphi=fpoloidal(psi)/rm
isfrc integer /0/ # =1 for field-reversed-configuration mesh options
ishalfm integer /0/ # =1 for doing outboard half-mesh only
isbphicon integer /0/ # =0 gives bphi=bcentrg*rcentrg/rm; =1 gives bphi=bcentrg
isfrc integer /0/ +gridgen # =1 for field-reversed-configuration mesh options
ishalfm integer /0/ +gridgen # =1 for doing outboard half-mesh only
isbphicon integer /0/ +gridgen # =0 gives bphi=bcentrg*rcentrg/rm; =1 gives bphi=bcentrg
nhdf integer /1/ # number of hydrogenic b2frates-format data files
hdfilename(1:12) Filename /12*'b2frates'/ # names of hydrogenic data files
nzdf integer /1/ # number of impurity b2frates-format data files
mcfilename(1:12) Filename /12*'b2frates'/ # names of impurity data files
coronalimpfname character*120 /'mist.dat'/ # name coronal impurity rate file
istabon integer /7/ +restart
mcfilename(1:12) Filename /12*'b2frates'/ +input # names of impurity data files
coronalimpfname character*120 /'mist.dat'/ +input # name coronal impurity rate file
istabon integer /7/ +input
#turns on look-up table for hydrogenic rate coefficients
# = 0 simple analytic rates and constant energy loss per ionization
# = 1 table look-up from ADPAK; rates.adpak
Expand Down Expand Up @@ -342,14 +342,14 @@ reset_core_og integer /0/

***** Xpoint_indices:
# target plate, x-point and separatrix indices
ixlb(1:nxpt) _integer # ix index of left boundary
ixpt1(1:nxpt) _integer # ix index of first x-point
ixmdp(1:nxpt) _integer # ix index of midplane
ixpt2(1:nxpt) _integer # ix index of second x-point
ixrb(1:nxpt) _integer # ix index of right boundary
iysptrx1(1:nxpt) _integer # iy index of first x-point
iysptrx2(1:nxpt) _integer # iy index of second x-point
iysptrx integer # iy index of last closed flux surface
ixlb(1:nxpt) _integer +griddata # ix index of left boundary
ixpt1(1:nxpt) _integer +griddata # ix index of first x-point
ixmdp(1:nxpt) _integer +griddata # ix index of midplane
ixpt2(1:nxpt) _integer +griddata # ix index of second x-point
ixrb(1:nxpt) _integer +griddata # ix index of right boundary
iysptrx1(1:nxpt) _integer +griddata # iy index of first x-point
iysptrx2(1:nxpt) _integer +griddata # iy index of second x-point
iysptrx integer +griddata # iy index of last closed flux surface

***** Cut_indices:
# Indices for cut location (in x) and length (in y)
Expand Down Expand Up @@ -621,18 +621,18 @@ rtlqa(0:rtnt,0:rtnn,0:rtnsd-1) _real
# ln(rtqa) where rtqa[eV*m**3/s] is 'b2frates' data for elec energy loss
rtlcx(0:rtnt,0:rtnn,0:rtnsd-1) _real
# ln(rtcx); rtcx[m**3/s] is 'b2frates' data for c-x on neutral hydrogen
iscxfit real /1./ # flag for C ion c-x on neutral H
iscxfit real /1./ +input # flag for C ion c-x on neutral H
#=0 use analytic forms in Braams' rate package
#=1 use polynomial fit to C.F. Maggi curves (1997)
#=2 same as =1, except Z=1 has lower rate from Pigarov
isrtndep integer /1/ # flag for turning on ne-dep atomic rates when
isrtndep integer /1/ +input # flag for turning on ne-dep atomic rates when
# ismctab=2 (impurities) and/or istabon=16 (hydrogen)
mcfformat(1:12) integer /12*0/ # flag read from mcfilename rate files to distingu
# pre-2012 format (0) from 2012 format (1) for rates;
# assoc. with how ebindz is used.
chgstate_format(0:rtnsd-1) _integer # flag denoting data format used for
chgstate_format(0:rtnsd-1) _integer +input # flag denoting data format used for
# each charge state; see mcfformat
ispradextrap integer /0/ #=1 extrapolated neutral prad below table min
ispradextrap integer /0/ +input #=1 extrapolated neutral prad below table min

***** Fitdata:
# Arrays and variables for the tanh and b-spline fits to DIII-D radial profiles
Expand Down
Loading

0 comments on commit 328a4f1

Please sign in to comment.