Skip to content

Commit

Permalink
Updates build and fniycbo options
Browse files Browse the repository at this point in the history
- fniycbo options via isfniycbozero
  - Makes fniycbo-switch index-dependent
  - Fixes switch for double-null geometries
- Hardens checkver to allow code execution without connection to PyPi
- Implemements build and install using pyproject.toml
- Updates Workflows to ensure compatibility of Forhton with numpy>2.0
  • Loading branch information
holm10 committed Jul 13, 2024
2 parents 3050ab3 + 6e3461d commit 93b7faa
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ uedge.egg-info
*.c
*.f
pyscripts/__version__.py
/dist
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include *
recursive-include pyscripts *
recursive-include pytests *
recursive-include jupyter *
#recursive-include pytests *
#recursive-include jupyter *
recursive-include buildscripts *
recursive-include aph *
recursive-include api *
recursive-include bbb *
Expand All @@ -10,6 +11,7 @@ recursive-include flx *
recursive-include grd *
recursive-include svr *
recursive-include wdf *
recursive-include ncl *
#recursive-include dst *
#recursive-include idf *
#recursive-include psi *
Expand Down
14 changes: 0 additions & 14 deletions PKG-INFO

This file was deleted.

2 changes: 1 addition & 1 deletion bbb/bbb.v
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ isnicore(nispmx) integer /1,30*0/ +input #switch for ion-density core B.
#=4, use impur. source terms (impur only)
#=5, set d(ni)/dy=-ni/lynicore at midp &
# ni constant poloidally
isfniycbozero real /0./ +input # Switch for divergence-free fluxes on core boundary
isfniycbozero(nispmx) real /nispmx*0./ +input # Switch for divergence-free fluxes on core boundary
#=0, allows divergence-free fluxes to modify net core flux
#=1, redistributes fluxes due to divergence-free term
# without affecting the net core boundary flux
Expand Down
34 changes: 23 additions & 11 deletions bbb/oderhs.m
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ subroutine pandf (xc, yc, neq, time, yl, yldot)
. zeffave, noavex, noavey, tiavey, tgavey, psordisold,
. nucxiold(nigmx), nueliold(nigmx), nuelgold(nigmx), rrfac, visxtmp,
. vttn, vttp, neavex, pwrebkgold, pwribkgold, feexflr, feixflr,
. naavex,naavey,nuelmolx,nuelmoly,fniycboave
. naavex,naavey,nuelmolx,nuelmoly,fniycboave, corecells, sycore
real fqpo, fqpom, friceo, friceom, upeo, upeom, fricio(100),
. friciom(100), upio(100), upiom(100), uupo(100), uupom(100)
real nevol, ngvol, kionz, krecz, kcxrz, kionm, krecm, kcxrm, nzbg,
Expand Down Expand Up @@ -3348,24 +3348,36 @@ ccc iysptrx is the last closed flux surface (see S.R. nphygeo)
enddo

c ... Normalize core flux to zero to avoid introducing artifical core source/sink
if (isfniycbozero .gt. 0) then
fniycboave = 0
do ifld = 1, nfsp
do ifld = 1, nfsp
if (isfniycbozero(ifld) .gt. 0) then
fniycboave = 0
sycore = 0
do ix = ixpt1(1)+1, ixpt2(1)
fniycboave = fniycboave + fniycbo(ix, ifld)
end do
fniycboave = fniycboave / (ixpt2(1) - ixpt1(1))
corecells = (ixpt2(1) - ixpt1(1))
if (geometry == 'dnull') then
do ix = ixpt1(2)+1, ixpt2(2)
fniycboave = fniycboave + fniycbo(ix, ifld)
end do
corecells = corecells + (ixpt2(2) - ixpt1(2))
end if
c ... TODO: Add double-null fix here (now only does one half-mesh...)
fniycboave = fniycboave / corecells
do ix = ixpt1(1)+1, ixpt2(1)
fniycbo(ix, ifld) = fniycbo(ix, ifld) - isfniycbozero*fniycboave
fniycbo(ix, ifld) = fniycbo(ix, ifld) - isfniycbozero(ifld)*fniycboave
end do
end do
else if (isfniycbozero .lt. 0) then
do ifld = 1, nfsp
else if (isfniycbozero(ifld) .lt. 0) then
do ix = ixpt1(1)+1, ixpt2(1)
fniycbo(ix, ifld) = 0
end do
end do
end if
if (geometry == 'dnull') then
do ix = ixpt1(2)+1, ixpt2(2)
fniycbo(ix, ifld) = 0
end do
end if
end if
end do



Expand Down

0 comments on commit 93b7faa

Please sign in to comment.