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

Current PPPL xvmec2000 produces output with errors #110

Closed
mdjcole opened this issue Mar 23, 2021 · 10 comments
Closed

Current PPPL xvmec2000 produces output with errors #110

mdjcole opened this issue Mar 23, 2021 · 10 comments
Assignees

Comments

@mdjcole
Copy link
Collaborator

mdjcole commented Mar 23, 2021

Current PPPL standard xvmec2000 executable runs to seemingly correct completion and generates output.

However, this output gives errors in Newton method when searching for geometric quantities in the .nc files. Equivalent .nc files produced with earlier versions do not seem to give these errors, verified with two separate cases.

Since PPPL seems not to support older versions of STELLOPT, I haven't tested for exactly where this bug first appears.

@lazersos
Copy link
Collaborator

@mdjcole Can you upload the input file and wout file?

@zhucaoxiang
Copy link
Collaborator

@mdjcole There is an old version STELLOPT (version 2.51, with many affiliated codes commented) available on the cluster. You can do

module load mod_stellopt
module load sellopt/outdated/2.5.1_fixed

It can be run, but I haven't done any regression test (we literally don't have a standard test).

@mdjcole
Copy link
Collaborator Author

mdjcole commented Mar 23, 2021

@lazersos attached

@zhucaoxiang Thanks. When I run VMEC2000 with that 2.5.1 executable, my meshing tool (which was giving errors) executes correctly. The meshing tool was still using the current supported version.

vmec_files_to_sam.zip

@zhucaoxiang
Copy link
Collaborator

@mdjcole Does your meshing tool only read the geometry information? RBC & ZBS? In the latest version, there is an important update that causes many troubles in the API. See #42

@mdjcole
Copy link
Collaborator Author

mdjcole commented Mar 23, 2021

@zhucaoxiang It also needs B field information. This issue is saying that information will be wrong unless VMEC was run with LNYQIST=.true.?

@zhucaoxiang
Copy link
Collaborator

@mdjcole No, (@lazersos can correct me), in previous versions, the default value for LNYQUIST is false. Turning on LNYQUIST will improve the accuracy of VMEC calculations (as discussed in that issue). So it was now always turned on. However, LNYQUIST=.true. requires all the codes that read VMEC output to be modified. That is the problem.

@lazersos
Copy link
Collaborator

@mdjcole So there's nothing wrong with the file. The issue is probably as @zhucaoxiang stated. The read_wout_mod.f90 and vmec_utils.f handle the LNYQUIST issue. Specifically, when LNYQUIST=.TRUE. only the RMNC,ZMNS,LMNS (and RMNS,ZMNC,LMNC) arrays are sized NS by MN. The other arrays are now sized NS by MNNYQ sized. If you've built your own tool, you just need to handle this.

If this is an issue with XVMEC2XGC then the fix is easy and I can implement it pretty quickly.

@mdjcole
Copy link
Collaborator Author

mdjcole commented Mar 24, 2021

We added some new routines to vmec_utils.f. I can initiate a pull request, but probably the routines should be made more concise first. Let me know if you want us to do this now. Otherwise, I can proceed with what I have for now.

@lazersos
Copy link
Collaborator

@mdjcole Which branch? I'll take a look and see if I can figure out what changes would need to be made.

@mdjcole
Copy link
Collaborator Author

mdjcole commented Mar 24, 2021

@lazersos

mdjcole@1216690

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