Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions gpec/gpout.f
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ SUBROUTINE gpout_singcoup(spot,nspot,rout,bpout,bout,rcout,tout)
c agregate coupling matrices
c-----------------------------------------------------------------------
ALLOCATE(singcoup(nsingcoup,msing,mpert)) ! coupling field to external field b_x
singcoup(1,:,:) = singbnoflxs ! effective resonant area-normalized flux (Phi_r/A) shielded by current
singcoup(1,:,:) = singbnoflxs ! effective resonant area-normalized flux (Phi_r/A) shielded by current (Tesla)
singcoup(2,:,:) = singcurs*twopi*nn ! resonant current (amps)
singcoup(3,:,:) = islandhwids ! square of the penetrated island half-width in normalized poloidal flux
singcoup(4,:,:) = singbwp ! interpolated (penetrated) resonant field
Expand Down Expand Up @@ -1943,7 +1943,7 @@ SUBROUTINE gpout_singfld(egnum,xspmn,spot,nspot,
CALL check( nf90_redef(mncid))
CALL check( nf90_def_var(mncid, "Phi_overlap", nf90_double,
$ (/m_id,i_id/), p_id) )
CALL check( nf90_put_att(mncid, p_id, "units", "unitless") )
CALL check( nf90_put_att(mncid, p_id, "units", "Tesla") )
CALL check( nf90_put_att(mncid, p_id, "long_name",
$ "Pitch resonant flux overlap") )
CALL check( nf90_def_var(mncid, "Phi_overlap_norm",
Expand All @@ -1953,7 +1953,7 @@ SUBROUTINE gpout_singfld(egnum,xspmn,spot,nspot,
$ "Pitch resonant flux overlap percentage") )
CALL check( nf90_def_var(mncid, "I_overlap", nf90_double,
$ (/m_id,i_id/), c_id) )
CALL check( nf90_put_att(mncid, c_id, "units", "unitless") )
CALL check( nf90_put_att(mncid, c_id, "units", "Amps") )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't all the overlaps be the same @matt-pharr? The un-normalized overlap is Phi_1 (unitless, unit vector) dot Phi_x (energy normalized flux). So I guess it is T m? The singular value s_1 carries the units that convert from Phi_x to whatever the target is (so unitless for Phi, A/Tm for current, etc.) I never thought about it before, but now that I write this... does this mean that the Bt normalization leaves the units as m? So we should actually be normalizing by sqrt(A)Bt? hmmm. Thoughts @parkjk?

@matt-pharr matt-pharr Feb 2, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean here, I think you are right. Per Logan et al 2021 the units are easy to follow -- regardless of the units of $\mathcal{C}_{xe}$ (or $\mathcal{D}_c$ in the aforementioned reference) its right singular vector $\Phi_1$ is unitless, and since
$$\displaystyle \Phi_{xe}\cdot\Phi_{xe} = \oint da \left(\vec{B} \cdot \hat n\right)^2 \sim T^2m^2,$$
$\Phi_{xe}$ and the right-singular pitch-resonant flux overlap $\delta=\Phi_1 \cdot\Phi_{xe} / B_T$ should have units of Tm and m respectively. I wonder the effect using $\sqrt A B_T$ to normalize would have on the tightness of the uncertainty interval in the scaling law exponents?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this closed? I am still not following this... $\Phi_{xe}$ is sbno_mn in gpout.f, and is normalized by sqrt(jarea) to have the units of Tesla. At least for gpec_singfld_n#.out, I don't see a way that makes $\Phi_{xe}$ being the units of Tesla-meter.

CALL check( nf90_put_att(mncid, c_id, "long_name",
$ "Pitch resonant current overlap") )
CALL check( nf90_def_var(mncid, "I_overlap_norm",
Expand Down Expand Up @@ -1985,12 +1985,12 @@ SUBROUTINE gpout_singfld(egnum,xspmn,spot,nspot,
$ (/m_id, i_id/), d_id) )
CALL check( nf90_put_att(mncid, d_id, "units", "untiless") )
CALL check( nf90_put_att(mncid, d_id, "long_name",
$ "Extrenal Delta prime overlap") )
$ "External Delta prime overlap") )
CALL check( nf90_def_var(mncid, "Delta_overlap_norm",
$ nf90_double,(/m_id/), dp_id) )
CALL check( nf90_put_att(mncid, dp_id, "units", "untiless"))
CALL check( nf90_put_att(mncid, dp_id, "long_name",
$ "Extrenal Delta prime overlap percentage") )
$ "External Delta prime overlap percentage") )
CALL check( nf90_enddef(mncid) )
CALL check( nf90_put_var(mncid, p_id, RESHAPE((/
$ REAL(olap(1,:)),AIMAG(olap(1,:))/), (/msing,2/))) )
Expand Down Expand Up @@ -2053,7 +2053,7 @@ SUBROUTINE gpout_singfld(egnum,xspmn,spot,nspot,
CALL check( nf90_redef(mncid))
CALL check( nf90_def_var(mncid, "Phi_local_overlap",
$ nf90_double,(/m_id,i_id/), p_id) )
CALL check( nf90_put_att(mncid, p_id,"units","unitless"))
CALL check( nf90_put_att(mncid, p_id,"units","Tesla"))
CALL check( nf90_put_att(mncid, p_id, "long_name",
$ "Local pitch resonant flux overlap") )
CALL check( nf90_def_var(mncid, "Phi_local_overlap_norm",
Expand All @@ -2063,7 +2063,7 @@ SUBROUTINE gpout_singfld(egnum,xspmn,spot,nspot,
$ "Local pitch resonant flux overlap percentage") )
CALL check( nf90_def_var(mncid, "I_local_overlap",
$ nf90_double,(/m_id,i_id/), c_id) )
CALL check( nf90_put_att(mncid, c_id,"units","unitless"))
CALL check( nf90_put_att(mncid, c_id,"units","Amps"))
CALL check( nf90_put_att(mncid, c_id, "long_name",
$ "Local pitch resonant current overlap") )
CALL check( nf90_def_var(mncid, "I_local_overlap_norm",
Expand Down