Skip to content

Commit

Permalink
Merge pull request #23 from holm10/hdf5grid
Browse files Browse the repository at this point in the history
Implementing HDF5 grid files for UEDGE
  • Loading branch information
holm10 authored Jul 20, 2023
2 parents 3d91a8e + 4f289f9 commit a08ade5
Show file tree
Hide file tree
Showing 23 changed files with 1,025 additions and 100 deletions.
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ build/
.idea/
.DS_Store
*~
pyscripts/__src__.py
*.swp
a.out
PyUEDGE_tutorial/*
*.swo
*.egg
pyscripts/__src__.py
uedge.egg-info/
dist/uedge-8.0.0-py3.7-macosx-10.9-x86_64.egg
uedge.egg-info
pyscripts/__src__.py
*.egg
*.swp
*.c
*.f

2 changes: 1 addition & 1 deletion aph/Package
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ POINTER = cray

VDF = aph.v

NVDF = ../com/com.v
NVDF = ../com/com_basis.v

SM = aphrates.m aphread.m
2 changes: 1 addition & 1 deletion api/Package
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ POINTER = cray

VDF = api_basis.v

NVDF = ../com/com.v
NVDF = ../com/com_basis.v ../bbb/bbb_basis.v

SM = apifcn.m apip93.m apisorc.m fimp.m inelrates.m fmombal.m sputt.m

10 changes: 8 additions & 2 deletions api/fimp.m
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ subroutine readmc(nzdf,mcfilename)
character*256 mcfilename(*)
character*256 fname
Use(Multicharge)
Use(Math_problem_size) # neqmx
Use(Lsode) # iprint
Use(Impdata) #apidir
c ... Function:
Expand Down Expand Up @@ -308,11 +310,15 @@ call xerrab("")
* un*formatted read for header data
read (nget,'(2a8,i12,4x,a32)') idcod, idtyp, n, id1
if (n .lt. 0 .and. iprt_imp_file == 1) then
write(*,*) '***Impurity file using new 2012 format is ',mcfilename(i)
if (iprint .ne. 0) then
write(*,*) '***Impurity file using new 2012 format is ',mcfilename(i)
endif
mcfformat(i) = 1
iprt_imp_file = 0
elseif (iprt_imp_file == 1) then
write(*,*) '***Impurity file using pre-2012 format is ',mcfilename(i)
if (iprint .ne. 0) then
write(*,*) '***Impurity file using pre-2012 format is ',mcfilename(i)
endif
mcfformat(i) = 0
iprt_imp_file = 0
endif
Expand Down
8 changes: 6 additions & 2 deletions api/sputt.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ SUBROUTINE SYLD96(MATT,MATP,CION,CIZB,CRMB)
cdtr include 'cyield'

Use(Cyield) # ceth,cetf,cq,ntars,cidata
Use(Math_problem_size) # neqmx
Use(Lsode) # iprint

real ETH(7,12), ETF(7,12), Q(7,12), EBD(12)
LOGICAL IDATA(7,12)
Expand Down Expand Up @@ -199,9 +201,11 @@ ctdr IF (CEBD.EQ.0.0 .AND. MATT.LE.12) CEBD = EBD(MATT)
IF (CIZB.EQ.6) MATP = 5
IF (CIZB.EQ.8) MATP = 7
cdtr IF (CNEUTD.EQ.1) MATP = CBOMBF
WRITE (*,*) 'TARGET MATERIAL IS ' , TARMAT(MATT)
WRITE (*,*) 'BOMBARDING IONS ARE ' , PLAMAT(MATP)
if (iprint .ne. 0) then
WRITE (*,*) 'TARGET MATERIAL IS ' , TARMAT(MATT)
WRITE (*,*) 'BOMBARDING IONS ARE ' , PLAMAT(MATP)
cdtr IF (CNEUTD.EQ.1) CALL PRI (' WITH ZIMP', CBOMBZ)
endif
RETURN
END
C
Expand Down
2 changes: 1 addition & 1 deletion bbb/Package
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ POINTER = cray

VDF = bbb_basis.v

NVDF = ../com/com.v
NVDF = ../com/com_basis.v

SM = boundary.m convert.m geometry.m griddubl.m \
oderhs.m odesetup.m odesolve.m potencur.m turbulence.m \
Expand Down
23 changes: 13 additions & 10 deletions bbb/geometry.m
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ logical function tstguardc (ix, iy)

implicit none
Use(Dim) # nx,ny
Use(Math_problem_size) # neqmx
Use(Share) # nxomit,nxc,nxleg,nxcore,geometry,ismpsym
Use(Xpoint_indices) # ixpt1,ixpt2,iysptrx1,iysptrx2,iysptrx
Use(RZ_grid_info) # rm,zm,psi,br,bz,bpol,bphi,b
Expand All @@ -456,6 +457,7 @@ logical function tstguardc (ix, iy)
Use(UEpar) # thetar
Use(Phyvar) # pi
Use(Bfield) # b0old
Use(Lsode) # iprint
Use(Npes_mpi) # mype
Use(Comgeo) # area_core
* -- local scalars --
Expand Down Expand Up @@ -487,7 +489,7 @@ c write(6,*) "Calling flxrun in globalmesh."
else
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
write(*,*)
endif
elseif (mhdgeo .eq. 2) then
Expand All @@ -497,23 +499,23 @@ call readgrid(fname, runid)
else
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
write(*,*)
endif
elseif (mhdgeo .eq. 0) then
call idealgrd
write(*,*) '**** mhdgeo=0: cylindrical grid generated *****'
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) '**** mhdgeo=0: cylindrical grid generated *****'
elseif (mhdgeo .eq. -1) then
call idealgrd
write(*,*) '**** mhdgeo=-1: cartesian grid generated *****'
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) '**** mhdgeo=-1: cartesian grid generated *****'
elseif (mhdgeo .eq. -2) then
call mirrorgrd
write(*,*) '**** mhdgeo=-2: mag mirror grid generated *****'
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) '**** mhdgeo=-2: mag mirror grid generated *****'
else
write(*,*) '**** mhdgeo < -1: reading grid from file *****'
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) '**** mhdgeo < -1: reading grid from file *****'
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
write(*,*)
endif

Expand Down Expand Up @@ -635,6 +637,7 @@ call s2copy (nx+2,ny+2,psi(0,0,ij),1,nx+2,psig(0,0,ij),1,nx+2)
Use(Indices_domain_dcl) # ixmnbcl,ixmxbcl
Use(Math_problem_size) # neqmx
Use(Npes_mpi) # mype
Use(Lsode) # iprint

* -- local scalars --
integer nj, iu, ik, ij, jx, iysi, iyso, iyp1, ix_last_core_cell,
Expand Down Expand Up @@ -680,7 +683,7 @@ call remark('*** WARNING: ismmon.ne.0 BUT isnonog=0 ****')
else
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
c ... now that the grid is read in, we can manipulate dnull for nxomit>0
if (geometry=="dnull" .and. nxpt==2) then
if (nxomit >= ixlb(2)) then
Expand All @@ -702,7 +705,7 @@ call remark("*** nxomit>0: do outer quad as single-null")
else
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
write(*,*)
endif
elseif (mhdgeo .eq. 0) then
Expand All @@ -718,7 +721,7 @@ call readgrid(fname, runid)
write(*,*) '**** mhdgeo < -1: reading grid from file *****'
fname = trim(GridFileName)
call readgrid(fname, runid)
write(*,*) 'Read file "', fname, '" with runid: ', runid
if (iprint*(1-isgriduehdf5) .ne. 0) write(*,*) 'Read file "', fname, '" with runid: ', runid
write(*,*)
endif

Expand Down
2 changes: 1 addition & 1 deletion bbb/odesetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -6596,7 +6596,7 @@ call gchange("Interp",0)
call comp_vertex_vals # gen plasma/neut values at rm,zm(,,4)
endif
endif
write(6,*) "Interpolants created; mype =", mype
if (iprint .ge. 1) write(6,*) "Interpolants created; mype =", mype
endif

100 continue
Expand Down
1 change: 1 addition & 0 deletions bbb/odesolve.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Use(Compla) # ni,up,vy,te,ti,phi,zeff,nil,upl,tel,til,ngl,phil
Use(Grid) # ngrid,ig,imeth,ijac,iyld,yldmax
Use(Stat)
Use(Ident_vars) # exmain_evals
Use(Ynorm) # suscal,sfscal
Use(Ident_vars) # exmain_evals
Use(Oldpla)
Expand Down
2 changes: 1 addition & 1 deletion com/Package
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ LANGUAGE = C
PKG = com
POINTER = cray

VDF = com.v
VDF = com_basis.v

NVDF = ../aph/aph.v ../api/api_basis.v ../bbb/bbb_basis.v ../grd/grd_basis.v\
../flx/flx_basis.v ../wdf/wdf.v
Expand Down
1 change: 1 addition & 0 deletions com/com.v
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ nxxpt
nyomitmx integer /0/
# 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"/
# specifies magnetic configuration, e.g.,
# ='snull' for lower single null
Expand Down
Loading

0 comments on commit a08ade5

Please sign in to comment.