Added units for resonant flux/current overlaps in gpec_control_nn.nc#185
Added units for resonant flux/current overlaps in gpec_control_nn.nc#185matt-pharr wants to merge 2 commits intodevelopfrom
Conversation
|
Thanks @matt-pharr - I appreciate the initiative here. It's nice to feel like I have co-developers!! Island widths are in normalized poloidal flux. So technically unitless, but you can put psi_n or something if you wish. Do whatever you think new users will find most helpful. Penetrated flux is hopefully Tesla? Worth double checking for factors of area or half area though. I can't be 100% sure off the top of my head. I'll happily merge once you give the green light. |
| 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") ) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Is this closed? I am still not following this...
|
What is the status of this @matt-pharr? |
|
@logan-nc I think you are right about the units of |
Code ReviewThis PR adds units to the flux and current overlap variables in NetCDF output files. The changes appear correct based on the code analysis: Positive Points
Issues Found1. Pre-existing typo in surrounding code (not introduced by this PR): The file contains 12 instances of untiless (missing e) instead of unitless on lines:
These should be fixed separately or as part of this PR. 2. Fortran fixed-format line length: This file is .f format with a 72-character limit. Line length check shows all modified lines are within limits, so no issues there. 3. Outstanding questions from PR description: The PR author asks about units for:
RecommendationThe core changes (Tesla and Amps) are correct. Consider either:
|
Smalll tweak. I noticed when doing SPARC calculations that these overlaps were not normalized, so I added units for clarity. Let me know if you know what the units should be for "Full width of saturated island overlap," or "Penetrated flux overlap," should be off the top of your head @logan-nc or otherwise I will trace through the code tomorrow afternoon.