From 70d2c8dfd7d99e7f6d85343340290147b97264d0 Mon Sep 17 00:00:00 2001 From: umansky Date: Tue, 4 Nov 2025 13:13:57 -0800 Subject: [PATCH 01/14] Adding a test file --- github_test.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 github_test.txt diff --git a/github_test.txt b/github_test.txt new file mode 100644 index 00000000..7379ce25 --- /dev/null +++ b/github_test.txt @@ -0,0 +1,2 @@ +blah + From 0f25f1f2484163207106404d66baacd17efe6c29 Mon Sep 17 00:00:00 2001 From: umansky Date: Wed, 5 Nov 2025 11:12:41 -0800 Subject: [PATCH 02/14] Adding the coding for extra SF configurations --- grd/grdread.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grd/grdread.m b/grd/grdread.m index c5944a76..dcffa8a4 100755 --- a/grd/grdread.m +++ b/grd/grdread.m @@ -170,6 +170,8 @@ call xerrab("**** requested grid data file not found") if (geometry=="dnull" .or. geometry=="snowflake15" .or. . geometry=="snowflake45" .or. geometry=="snowflake75" .or. + . geometry=="snowflake105" .or. geometry=="snowflake135" .or. + . geometry=="snowflake165" .or. . geometry=="dnXtarget" .or. geometry=="isoleg") then read(nuno,1999) nxm,nym read(nuno,1999) iysptrx1(1),iysptrx2(1) @@ -224,6 +226,8 @@ call xerrab("**** requested grid data file not found") if (geometry=="dnull" .or. geometry=="snowflake15" .or. . geometry=="snowflake45" .or. geometry=="snowflake75" .or. + . geometry=="snowflake105" .or. geometry=="snowflake135" .or. + . geometry=="snowflake165" .or. . geometry=="dnXtarget" .or. geometry=="isoleg") then read(nuno,1999) nxm,nym read(nuno,1999) iysptrx1(1),iysptrx2(1) From 12dfe9aa372f7f4e67d78f55ea16f56a5e1678de Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Wed, 12 Nov 2025 18:35:21 -0500 Subject: [PATCH 03/14] Fixed SF135 isixcore bug --- bbb/geometry.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bbb/geometry.m b/bbb/geometry.m index e136b025..33973a15 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1131,7 +1131,13 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) c... Setup the isixcore(ix) array: =1 if ix on iy=0 core bdry; =0 if not do ix = 0, nx+1 - if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") + if (geometry(1:9)=="snowflake" .and. geometry(10:12)=="135") then + if( ix > ixpt2(1) .and. ix <= ixpt1(2)) then + isixcore(ix) = 1 + else + isixcore(ix) = 0 + endif + else if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") & .or. geometry=="dnXtarget") then if( ix > ixpt1(1) .and. ix <= ixpt2(1)) then isixcore(ix) = 1 From 4cc4fb38bffa5dcc0afccf685fd21d441ab5a07b Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Thu, 13 Nov 2025 17:14:26 -0500 Subject: [PATCH 04/14] Fixed calculation of ixmp for SF135 --- bbb/geometry.m | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/bbb/geometry.m b/bbb/geometry.m index 33973a15..5efb0632 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1328,12 +1328,21 @@ ccc gradby(ix,iy) = 0. * -- define y on density faces -- at outboard midplane (?) if (ixpt2(1) > 0 .and. (isudsym.ne.1) .and.isddcon==0) then rmmax = rm(nxleg(1,1)+nxcore(1,1)+1,ny,0) - do ix = nxleg(1,1)+nxcore(1,1)+1, ixpt2(1) - if (rm(ix,ny,0) >= rmmax) then - rmmax = rm(ix,ny,0) - ixmp = ix - endif - enddo + if (geometry=='snowflake135') then + do ix = nxleg(1,1)+nxcore(1,1)+1, ixpt1(2) + if (rm(ix,ny,0) >= rmmax) then + rmmax = rm(ix,ny,0) + ixmp = ix + endif + enddo + else + do ix = nxleg(1,1)+nxcore(1,1)+1, ixpt2(1) + if (rm(ix,ny,0) >= rmmax) then + rmmax = rm(ix,ny,0) + ixmp = ix + endif + enddo + end if endif if (geometry.eq.'dnbot') ixmp = nxc+1 if (geometry.eq.'dnull' .or. geometry=='snowflake15' .or. From b5a2d1ffc4be0707825ae166774b483c232f97b6 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Thu, 13 Nov 2025 17:14:41 -0500 Subject: [PATCH 05/14] Fixed core BC calculation for SF135 --- bbb/boundary.m | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/bbb/boundary.m b/bbb/boundary.m index b46b8d88..3c965d80 100755 --- a/bbb/boundary.m +++ b/bbb/boundary.m @@ -105,8 +105,15 @@ c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in c... do the iy = 0 boundary c... if extrapolation b.c. on p.f. region, isextrpf=1, otherwise isextrpf=0 if (iymnbcl .eq. 0) goto 1100 # interior domain boundary; no bdry eqn - ixc1 = max(0, ixpt1(1)+1) # 1st core cell;used for core flux BC - if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") + + if (geometry=='snowflake135') then + ixc1 = max(0, ixpt2(1)+1) # 1st core cell;used for core flux BC + else + ixc1 = max(0, ixpt1(1)+1) # 1st core cell;used for core flux BC + end if + if (geometry=='snowflake135') then + ix_fl_bc = min(ixpt1(2), nx) + else if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") & .or. geometry=="dnXtarget") then ix_fl_bc = min(ixpt2(1), nx) else @@ -412,7 +419,7 @@ c Force corner cells (0,0) and (nx+1,0) to relax to an average of yldot(iv1) = nurlxn*( ni(ix,0,iimp) - . ni(ixp1(ix,0),0,iimp) ) / n0(iimp) if (ix.eq.ix_fl_bc) then - ii=max(0,ixpt1(1)+1) + ii=ixc1 fniytotc=fniy(ii,0,iimp)-fniycbo(ii,iimp) do ii=ixp1(ii,0) @@ -487,7 +494,7 @@ c Force corner cells (0,0) and (nx+1,0) to relax to an average of feiytotc = 0. do ix = i4+1-ixmnbcl, i8-1+ixmxbcl if (iymnbcl==1 .and. isixcore(ix)==1) then # domain part of core bdry - ii = max(0, ixpt1(1)+1) + ii = ixc1 feeytotc = feey(ii,0)-feeycbo(ii) feiytotc = feiy(ii,0)-feiycbo(ii) do # loop over ii as changed by ii=ixp1 statement @@ -529,7 +536,7 @@ c_mpi call mpi_allreduce(feiytotc, sfeiytotc, 1, yldot(iv1) = -nurlxe*(te(ix,0)-te(ixp1(ix,0),0))*n0(1)/ennorm if (ix.eq.ix_fl_bc) then # not all Jac elems included # sum core power: - ii = max(0, ixpt1(1)+1) + ii = ixc1 feeytotc = feey(ii,0)-feeycbo(ii) do # loop over ii as changed by ii=ixp1 statement ii = ixp1(ii,0) @@ -577,7 +584,7 @@ c_mpi call mpi_allreduce(feiytotc, sfeiytotc, 1, . n0(1) /ennorm if (ix.eq.ix_fl_bc) then # not all Jac elems included # sum core power: - ii = max(0, ixpt1(1)+1) + ii = ixc1 feiytotc = feiy(ii,0)-feiycbo(ii) do ii = ixp1(ii,0) From 4c3f096d5b9a50c0e24855aa30000e4dc87a87b5 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Thu, 20 Nov 2025 09:09:05 -0800 Subject: [PATCH 06/14] Fixes for SF165 --- bbb/boundary.m | 8 ++++---- bbb/geometry.m | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bbb/boundary.m b/bbb/boundary.m index 3c965d80..d58f6383 100755 --- a/bbb/boundary.m +++ b/bbb/boundary.m @@ -115,7 +115,7 @@ c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in ix_fl_bc = min(ixpt1(2), nx) else if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") & .or. geometry=="dnXtarget") then - ix_fl_bc = min(ixpt2(1), nx) + ix_fl_bc = min(ixpt2(1), nx) # last core cell;use for flux BC else ix_fl_bc = min(ixpt2(nxpt), nx) # last core cell;use for flux BC endif @@ -233,7 +233,7 @@ cc if (fng_chem .ne. 0.) yldot(iv1) = -nurlxg*( yldot(iv1) = -nurlxn*( ni(ix,0,ifld) - . ni(ixp1(ix,0),0,ifld) ) / n0(ifld) if (ix.eq.ix_fl_bc) then - ii=max(0,ixpt1(1)+1) + ii=ixc fniytotc=fniy(ii,0,ifld)-fniycbo(ii,ifld) fngytotc = fngy(ii,0,1) # needs generalization do @@ -339,7 +339,7 @@ call xerrab ('** isnicore value not valid option **') . (rm(ixp1(ix,0),0,2)*ni(ix,0,ifld)) )/vpnorm if (ix.eq.ix_fl_bc) then # not all Jac elems included # sum core parallel momentum flux: - ii = max(0, ixpt1(1)+1) + ii = ixc fmiytotc = rm(ii,0,0)*fmiy(ii,0,ifld) sytotc = sy(ii,0) uztotc = uz(ii,0,ifld)/gxf(ii,0) @@ -996,7 +996,7 @@ call xerrab("***Input error: invalid istgpfc ***") c... If isnewpot=1, phi boundary involves two eqns at iy=0 and 1 c... Note: j3 is local range index for iy passed from pandf in oderhs.m if (isnewpot*isphion.eq.1 .and. j3.le.3) then - do ix = min(i4+1-ixmnbcl,ixpt1(1)+1), max(i8-1+ixmxbcl,ixpt2(nxpt)) + do ix = min(i4+1-ixmnbcl,ixc1), max(i8-1+ixmxbcl,ix_fl_bc) if(isphionxy(ix,0)*isphionxy(ix,1)==1) then iv = idxphi(ix,0) iv1 = idxphi(ix,1) diff --git a/bbb/geometry.m b/bbb/geometry.m index 5efb0632..306eb554 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1114,7 +1114,7 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) c... Calculate a normalization constant for the iy=0 cells c... of the core boundary region - if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") + if ((geometry(1:9)=="snowflake" .and. ((geometry(10:11).ne."15") .and. (geometry(10:12).ne."165"))) & .or. geometry=="dnXtarget") then ix_last_core_cell = ixpt2(1) else @@ -1137,7 +1137,7 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) else isixcore(ix) = 0 endif - else if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") + else if ((geometry(1:9)=="snowflake" .and. ((geometry(10:11).ne."15") .and. (geometry(10:12).ne."165"))) & .or. geometry=="dnXtarget") then if( ix > ixpt1(1) .and. ix <= ixpt2(1)) then isixcore(ix) = 1 From 441b8694efc77beb70be78360f9d55a6cbe2e127 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Wed, 26 Nov 2025 09:39:46 -0500 Subject: [PATCH 07/14] Added todo to geometry.m --- bbb/geometry.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bbb/geometry.m b/bbb/geometry.m index 306eb554..36f23a02 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1124,8 +1124,9 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) ix = min(ix, nx+ixmxbcl) sygytotc = sy(ix,0)*gyf(ix,0) do ix = ixpt1(1)+1, ix_last_core_cell + !TODO: Should this block move below definition of isixcore below, and then this loop should only be over cells where isixcore(ix) == 1? if ( .not. (isudsym==1 .and. ((ix==nxc) .or. (ix==nxc+1))) ) then - sygytotc = sygytotc + sy(ix,0)*gyf(ix,0) + sygytotc = sygytotc + sy(ix,0)*gyf(ix,0) endif enddo @@ -1155,7 +1156,6 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) endif endif enddo - *---------------------------------------------------------------------- * -- Calculate geometrical factors needed for curvature and grad_B drifts From e95cd3b08e8acd2250e61e9942266091d7b86358 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Thu, 8 Jan 2026 18:02:33 -0500 Subject: [PATCH 08/14] SF105 bug fix --- bbb/boundary.m | 6 ++++-- bbb/geometry.m | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bbb/boundary.m b/bbb/boundary.m index d58f6383..610afc6a 100755 --- a/bbb/boundary.m +++ b/bbb/boundary.m @@ -106,12 +106,12 @@ c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in c... if extrapolation b.c. on p.f. region, isextrpf=1, otherwise isextrpf=0 if (iymnbcl .eq. 0) goto 1100 # interior domain boundary; no bdry eqn - if (geometry=='snowflake135') then + if (geometry=='snowflake135' .or. geometry=='snowflake105') then ixc1 = max(0, ixpt2(1)+1) # 1st core cell;used for core flux BC else ixc1 = max(0, ixpt1(1)+1) # 1st core cell;used for core flux BC end if - if (geometry=='snowflake135') then + if (geometry=='snowflake135' .or. geometry=='snowflake105') then ix_fl_bc = min(ixpt1(2), nx) else if ((geometry(1:9)=="snowflake" .and. geometry(10:11).ne."15") & .or. geometry=="dnXtarget") then @@ -120,6 +120,8 @@ c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in ix_fl_bc = min(ixpt2(nxpt), nx) # last core cell;use for flux BC endif + ! write(*,*) ix_fl_bc + c Note: j3 is local range index for iy passed from pandf in oderhs.m if (j3 .le. isextrnpf .or. j3 .le. isextrtpf .or. . j3 .le. isextrngc) then diff --git a/bbb/geometry.m b/bbb/geometry.m index 36f23a02..adc326a9 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1132,7 +1132,7 @@ ccc sx(ix,iy) = xgbx*sx(ix,iy) c... Setup the isixcore(ix) array: =1 if ix on iy=0 core bdry; =0 if not do ix = 0, nx+1 - if (geometry(1:9)=="snowflake" .and. geometry(10:12)=="135") then + if (geometry(1:9)=="snowflake" .and. (geometry(10:12)=="135" .or. geometry(10:12)=="105")) then if( ix > ixpt2(1) .and. ix <= ixpt1(2)) then isixcore(ix) = 1 else From 7649f2b9798271f23f8623ea634d7ecea4dabd56 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Mon, 12 Jan 2026 17:40:21 -0500 Subject: [PATCH 09/14] Added SF>90 grid read functionality when com.isgriduehdf5 = 1 --- src/uedge/gridue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uedge/gridue.py b/src/uedge/gridue.py index 85cfe2d3..bf6c86eb 100644 --- a/src/uedge/gridue.py +++ b/src/uedge/gridue.py @@ -6,7 +6,7 @@ def read_gridpars(fname=None): from uedge import bbb, com, grd - dblxpts = ['dnull', 'snowflake15', 'snowflake45', 'snowflake75', + dblxpts = ['dnull', 'snowflake15', 'snowflake45', 'snowflake75', 'snowflake105', 'snowflake135', 'snowflake165', 'dnXtarget', 'isoleg'] geometry = com.geometry[0].decode('UTF-8').strip() if fname is None: From 17cbc99b8fc0bfe198f01d20fb2b148132a3b75f Mon Sep 17 00:00:00 2001 From: Andreas Holm <60451789+holm10@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:01:34 -0800 Subject: [PATCH 10/14] Remove obsolete file --- github_test.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 github_test.txt diff --git a/github_test.txt b/github_test.txt deleted file mode 100644 index 7379ce25..00000000 --- a/github_test.txt +++ /dev/null @@ -1,2 +0,0 @@ -blah - From e86827f491d640e7024a7449e887cb78ba57f86f Mon Sep 17 00:00:00 2001 From: Andreas Holm <60451789+holm10@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:53:59 -0800 Subject: [PATCH 11/14] Shorthands snowflake definitions in gridue.py [no ci] --- src/uedge/gridue.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uedge/gridue.py b/src/uedge/gridue.py index bf6c86eb..e4450572 100644 --- a/src/uedge/gridue.py +++ b/src/uedge/gridue.py @@ -6,8 +6,9 @@ def read_gridpars(fname=None): from uedge import bbb, com, grd - dblxpts = ['dnull', 'snowflake15', 'snowflake45', 'snowflake75', 'snowflake105', 'snowflake135', 'snowflake165', - 'dnXtarget', 'isoleg'] + dblxpts = ['dnull', 'dnXtarget', 'isoleg'] + \ + [f'snowflake{15+i*30}' for i in range(6)] + geometry = com.geometry[0].decode('UTF-8').strip() if fname is None: fname = bbb.GridFileName[0].decode('UTF-8').strip() From 4e41ffea687169f5adbf4771f408acdbb53c8ae6 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Wed, 14 Jan 2026 15:52:55 -0500 Subject: [PATCH 12/14] ixc bugfix --- bbb/boundary.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbb/boundary.m b/bbb/boundary.m index 610afc6a..e24c7116 100755 --- a/bbb/boundary.m +++ b/bbb/boundary.m @@ -235,7 +235,7 @@ cc if (fng_chem .ne. 0.) yldot(iv1) = -nurlxg*( yldot(iv1) = -nurlxn*( ni(ix,0,ifld) - . ni(ixp1(ix,0),0,ifld) ) / n0(ifld) if (ix.eq.ix_fl_bc) then - ii=ixc + ii=ixc1 fniytotc=fniy(ii,0,ifld)-fniycbo(ii,ifld) fngytotc = fngy(ii,0,1) # needs generalization do From f98f94fed6ca2c78f4af3f7d73f602082e5c6c49 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Wed, 14 Jan 2026 16:09:27 -0500 Subject: [PATCH 13/14] Fixed another ixc typo --- bbb/boundary.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbb/boundary.m b/bbb/boundary.m index e24c7116..8deb7d3a 100755 --- a/bbb/boundary.m +++ b/bbb/boundary.m @@ -341,7 +341,7 @@ call xerrab ('** isnicore value not valid option **') . (rm(ixp1(ix,0),0,2)*ni(ix,0,ifld)) )/vpnorm if (ix.eq.ix_fl_bc) then # not all Jac elems included # sum core parallel momentum flux: - ii = ixc + ii = ixc1 fmiytotc = rm(ii,0,0)*fmiy(ii,0,ifld) sytotc = sy(ii,0) uztotc = uz(ii,0,ifld)/gxf(ii,0) From e85b63e83ef76e2ad305d60666cbd35d69e9fae7 Mon Sep 17 00:00:00 2001 From: Dominic Power Date: Fri, 16 Jan 2026 15:58:38 -0500 Subject: [PATCH 14/14] Fixes to ixmp calculation for snowflakes --- bbb/geometry.m | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/bbb/geometry.m b/bbb/geometry.m index adc326a9..a10f97e1 100755 --- a/bbb/geometry.m +++ b/bbb/geometry.m @@ -1328,8 +1328,22 @@ ccc gradby(ix,iy) = 0. * -- define y on density faces -- at outboard midplane (?) if (ixpt2(1) > 0 .and. (isudsym.ne.1) .and.isddcon==0) then rmmax = rm(nxleg(1,1)+nxcore(1,1)+1,ny,0) - if (geometry=='snowflake135') then - do ix = nxleg(1,1)+nxcore(1,1)+1, ixpt1(2) + if (geometry=='snowflake105' .or. geometry=='snowflake135') then + do ix = max(0, ixpt2(1)+1), min(ixpt1(2), nx) + if (rm(ix,ny,0) >= rmmax) then + rmmax = rm(ix,ny,0) + ixmp = ix + endif + enddo + else if (geometry=='snowflake15') then + do ix = max(0, ixpt1(1)+1) , min(ixpt2(2), nx) + if (rm(ix,ny,0) >= rmmax) then + rmmax = rm(ix,ny,0) + ixmp = ix + endif + enddo + else if (geometry(1:9)=="snowflake") then + do ix = max(0, ixpt1(1)+1) , min(ixpt2(1), nx) if (rm(ix,ny,0) >= rmmax) then rmmax = rm(ix,ny,0) ixmp = ix @@ -1345,10 +1359,8 @@ ccc gradby(ix,iy) = 0. end if endif if (geometry.eq.'dnbot') ixmp = nxc+1 - if (geometry.eq.'dnull' .or. geometry=='snowflake15' .or. - . geometry=='snowflake45' .or. geometry=='snowflake75' .or. + if (geometry.eq.'dnull' .or. . geometry=='dnXtarget' .or. geometry=='isoleg') ixmp = ixmdp(2) - * -- redefine ixmp if it is outside ix=0,nx domain if(ixmp.lt.0 .or. ixmp.gt.nx) then #search for max rm rmmax = rm(nxomit,0,0) @@ -1359,7 +1371,6 @@ ccc gradby(ix,iy) = 0. endif enddo endif - c MER NOTE: c The general case has multiple separatrices so yyf=0 is not c uniquely defined; below we choose the innermost separatrix.