Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akima_spline & akima_spline_ip not correctly handled in vmec runs during stellopt runs #15

Closed
jcschmitt opened this issue Aug 27, 2019 · 6 comments
Assignees

Comments

@jcschmitt
Copy link
Collaborator

Input file at: https://w3.pppl.gov/~jschmitt/input.spline_bug

If I run xvmec2000 with the input file, the pressure and current splines are correctly interpreted and the (wout) output file looks correct.

If I run xstellopt with the input file, the input.*.00000 file looks correct, but the profiles in the (wout) output file are incorrect. Both the pressure and current splines are incorrect in the wout file.

The splines were generated in a previous step with the vboot/bootsj option.

I'm guessing there is a problem in the stellopt startup/init stages that isn't handling the akima_spline and akima_spline_ip types correctly.

@jcschmitt
Copy link
Collaborator Author

portions from the ncdump from the 'stellopt run':
am_aux_s = 0, 0.0204081628471613, 0.0408163256943226, 0.061224490404129,
0.0816326513886452, 0.102040819823742, 0.122448980808258,
0.142857149243355, 0.16326530277729, 0.183673471212387,
0.204081639647484, 0.224489793181419, 0.244897961616516,
0.265306115150452, 0.28571429848671, 0.306122452020645,
0.326530605554581, 0.346938788890839, 0.367346942424774,
0.38775509595871, 0.408163279294968, 0.428571432828903,
0.448979586362839, 0.469387769699097, 0.489795923233032,
0.510204076766968, 0.530612230300903, 0.551020383834839,
0.571428596973419, 0.591836750507355, 0.61224490404129,
0.632653057575226, 0.653061211109161, 0.673469364643097,
0.693877577781677, 0.714285731315613, 0.734693884849548,
0.755102038383484, 0.775510191917419, 0.795918345451355,
0.816326558589935, 0.836734712123871, 0.857142865657806,
0.877551019191742, 0.897959172725677, 0.918367326259613,
0.938775539398193, 0.959183692932129, 0.979591846466064, 1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ;

am_aux_f = 67291.413203979, 65918.1188517377, 64544.8176543021,
63171.4763785305, 61798.0127039085, 60424.2737573617, 59050.0226616886,
57674.9219389118, 56298.5286929621, 54920.2827484124, 53539.5108477753,
52155.4248117523, 50767.1231662074, 49373.6063920044, 47973.7794554431,
46566.4792129849, 45150.4798053707, 43724.5209020384, 42287.3396748645,
40837.6874766959, 39374.3686767735, 37896.2833239203, 36402.4539985129,
34892.0752914345, 33364.5671958694, 31819.6120469418, 30257.2169912516,
28677.7689663021, 27082.0906907722, 25471.523528653, 23847.9671952692,
22213.9695291912, 20572.7965297188, 18928.5105319327, 17286.0470932766,
15651.319356934, 14031.2779202723, 12434.022222972, 10868.891421646,
9346.56356714521, 7879.15408960804, 6480.33896889891, 5165.43863893755,
3951.54851339096, 2857.65129264145, 1904.73714334459, 1115.92533832467,
516.600189793583, 134.527796227915, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;

ai_aux_s = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ;

ai_aux_f = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0 ;

ac_aux_s = 0, 0.0204081628471613, 0.0408163256943226, 0.061224490404129,
0.0816326513886452, 0.102040819823742, 0.122448980808258,
0.142857149243355, 0.16326530277729, 0.183673471212387,
0.204081639647484, 0.224489793181419, 0.244897961616516,
0.265306115150452, 0.28571429848671, 0.306122452020645,
0.326530605554581, 0.346938788890839, 0.367346942424774,
0.38775509595871, 0.408163279294968, 0.428571432828903,
0.448979586362839, 0.469387769699097, 0.489795923233032,
0.510204076766968, 0.530612230300903, 0.551020383834839,
0.571428596973419, 0.591836750507355, 0.61224490404129,
0.632653057575226, 0.653061211109161, 0.673469364643097,
0.693877577781677, 0.714285731315613, 0.734693884849548,
0.755102038383484, 0.775510191917419, 0.795918345451355,
0.816326558589935, 0.836734712123871, 0.857142865657806,
0.877551019191742, 0.897959172725677, 0.918367326259613,
0.938775539398193, 0.959183692932129, 0.979591846466064, 1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ;

ac_aux_f = 1e-10, 1.02083333289758e-10, 1.04255319058038e-10,
1.06521739199448e-10, 1.08888888690575e-10, 1.11363636797356e-10,
1.1395348853005e-10, 1.16666667535898e-10, 1.19512194644126e-10,
1.22500000273603e-10, 1.25641026744004e-10, 1.28947367960604e-10,
1.32432432836943e-10, 1.36111109676962e-10, 1.40000002227312e-10,
1.4411764683333e-10, 1.48484844529711e-10, 1.53124996390686e-10,
1.58064499660479e-10, 1.63333289053297e-10, 1.68965420972037e-10,
1.74999774625756e-10, 1.81480984846554e-10, 1.88460497165788e-10,
1.95997851570803e-10, 2.04162360486194e-10, 2.13035059537571e-10,
2.22711174364076e-10, 2.33303191615472e-10, 2.44944496201249e-10,
2.5779422253755e-10, 2.7204292238235e-10, 2.87919775730077e-10,
3.05701497325947e-10, 3.25723437176332e-10, 3.48393006843925e-10,
3.74206926095708e-10, 4.03771856241856e-10, 4.37830158972981e-10,
4.77291506509935e-10, 5.23271817053814e-10, 5.77140193526953e-10,
6.40577735806789e-10, 7.15647714505792e-10, 8.04881612948847e-10,
9.11383291906935e-10, 1.03895536129723e-09, 1.19224956681962e-09,
1.37695179413737e-09, 1.6e-09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;

The matching part of the input file:
PMASS_TYPE = 'akima_spline'
AM = 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00
AM_AUX_S = 0.000000000000E+000 2.040816284716E-002 4.081632569432E-002 6.122449040413E-002
8.163265138865E-002 1.020408198237E-001 1.224489808083E-001 1.428571492434E-001
1.632653027773E-001 1.836734712124E-001 2.040816396475E-001 2.244897931814E-001
2.448979616165E-001 2.653061151505E-001 2.857142984867E-001 3.061224520206E-001
3.265306055546E-001 3.469387888908E-001 3.673469424248E-001 3.877550959587E-001
4.081632792950E-001 4.285714328289E-001 4.489795863628E-001 4.693877696991E-001
4.897959232330E-001 5.102040767670E-001 5.306122303009E-001 5.510203838348E-001
5.714285969734E-001 5.918367505074E-001 6.122449040413E-001 6.326530575752E-001
6.530612111092E-001 6.734693646431E-001 6.938775777817E-001 7.142857313156E-001
7.346938848495E-001 7.551020383835E-001 7.755101919174E-001 7.959183454514E-001
8.163265585899E-001 8.367347121239E-001 8.571428656578E-001 8.775510191917E-001
8.979591727257E-001 9.183673262596E-001 9.387755393982E-001 9.591836929321E-001
9.795918464661E-001 1.000000000000E+000
AM_AUX_F = 8.972188427197E+004 8.789082513565E+004 8.605975687240E+004 8.422863517137E+004
8.239735027188E+004 8.056569834315E+004 7.873336354892E+004 7.689989591855E+004
7.506470492395E+004 7.322704366455E+004 7.138601446370E+004 6.954056641567E+004
6.768949755494E+004 6.583147518934E+004 6.396503927392E+004 6.208863895065E+004
6.020063974049E+004 5.829936120272E+004 5.638311956649E+004 5.445024996893E+004
5.249915823570E+004 5.052837776523E+004 4.853660533135E+004 4.652276705525E+004
4.448608959449E+004 4.242614939592E+004 4.034295598834E+004 3.823702528840E+004
3.610945425436E+004 3.396203137154E+004 3.179728959369E+004 2.961862603892E+004
2.743039537296E+004 2.523801404258E+004 2.304806279104E+004 2.086842580925E+004
1.870837056036E+004 1.657869629730E+004 1.449185522886E+004 1.246208475619E+004
1.050553878614E+004 8.640451958532E+003 6.887251518583E+003 5.268731351188E+003
3.810201723522E+003 2.539649524459E+003 1.487900451100E+003 6.888002530581E+002
1.793703949706E+002 0.000000000000E+000

!----- Current/Iota Parameters -----
CURTOR = 4.864797147973E+004
NCURR = 1
PIOTA_TYPE = 'power_series'
AI = 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00 0.00000000000000E+00
0.00000000000000E+00
PCURR_TYPE = 'akima_spline_ip'
AC = 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000
0.000000000000E+000 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000
0.000000000000E+000 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000
0.000000000000E+000 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000
0.000000000000E+000 0.000000000000E+000 0.000000000000E+000 0.000000000000E+000
0.000000000000E+000
AC_AUX_S = 0.000000000000E+000 2.040816284716E-002 4.081632569432E-002 6.122449040413E-002
8.163265138865E-002 1.020408198237E-001 1.224489808083E-001 1.428571492434E-001
1.632653027773E-001 1.836734712124E-001 2.040816396475E-001 2.244897931814E-001
2.448979616165E-001 2.653061151505E-001 2.857142984867E-001 3.061224520206E-001
3.265306055546E-001 3.469387888908E-001 3.673469424248E-001 3.877550959587E-001
4.081632792950E-001 4.285714328289E-001 4.489795863628E-001 4.693877696991E-001
4.897959232330E-001 5.102040767670E-001 5.306122303009E-001 5.510203838348E-001
5.714285969734E-001 5.918367505074E-001 6.122449040413E-001 6.326530575752E-001
6.530612111092E-001 6.734693646431E-001 6.938775777817E-001 7.142857313156E-001
7.346938848495E-001 7.551020383835E-001 7.755101919174E-001 7.959183454514E-001
8.163265585899E-001 8.367347121239E-001 8.571428656578E-001 8.775510191917E-001
8.979591727257E-001 9.183673262596E-001 9.387755393982E-001 9.591836929321E-001
9.795918464661E-001 1.000000000000E+000
AC_AUX_F = -7.530491455415E+003 1.031168414151E+004 1.625628481975E+004 1.972863671208E+004
2.282250519318E+004 2.558143350116E+004 2.787388982880E+004 2.978753563468E+004
3.152766044097E+004 3.325684502251E+004 3.501911309252E+004 3.675462390898E+004
3.836303271419E+004 3.977114807810E+004 4.097630331712E+004 4.205550358350E+004
4.314488821113E+004 4.440175120412E+004 4.596314554623E+004 4.791259689053E+004
5.026179490964E+004 5.294925105112E+004 5.585394929882E+004 5.881939727542E+004
6.168257635409E+004 6.430249593621E+004 6.658379444781E+004 6.849206502752E+004
7.005850295921E+004 7.137235022592E+004 7.256063050874E+004 7.375583109953E+004
7.505438448635E+004 7.647159097669E+004 7.790213781024E+004 7.909858346466E+004
7.968184685530E+004 7.919555306898E+004 7.720847512293E+004 7.345414669688E+004
6.797442520830E+004 6.120779621750E+004 5.394209410003E+004 4.705452706456E+004
4.101853181436E+004 3.531842573830E+004 2.825223273201E+004 1.822842359349E+004
8.722805437907E+003 2.076346094924E+004

@jcschmitt
Copy link
Collaborator Author

Are there 'recent' updates to master that addresses this issue? This was encountered while I was running on a UW branch

@jcschmitt
Copy link
Collaborator Author

jcschmitt commented Aug 29, 2019

I can confirm this problem still exists even when I pulled in master (and regcoil updates from uw_regcoil_2019a).
The pressure profile may be okay (at least it worked on a recent test), but the current profile is still wrong. It almost looks like it is being interpreted as a power series?
Also, I found this using with equil_type = VMEC2000_ONEEQ and with VMEC2000.

@zhucaoxiang
Copy link
Collaborator

@jcschmitt I will find a time to test on my end and will let you know my results.

@jcschmitt
Copy link
Collaborator Author

Update: If I remove all of the namelist entries for bootstrap, (vboot, sfincs or bootj stuff) then the behavior (by eye) looks correct. This may be a confusion in namelist entries and how their existence/presence is being used to infer code behavior. I'll continue to track this down and see if I can print out info/warning messages in the appropriate location(s).

@jcschmitt
Copy link
Collaborator Author

Closed by #16 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants