DESC
DESC copied to clipboard
Handle VMEC Input Files Better
Apparently in VMEC the boundary modes can be given with the following logic, which we currently do not support converting in DESC. Also, this could be useful to add as an input option in our own input files
rbc(-22:22,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.9752041013880218, -0.693363161259351, 0.3158097406419154,
-0.1336173987189171, 0.04250319143001195, -0.0017939240980503425,
-0.011073301883956194, 0.010402231681464624, -0.005115714919129545,
0.0001348021675985992, 0.002564506738780156, -0.0028903931958533633,
0.0018064368511084795, -0.00023521761858271873, -0.0007086499231920249,
0.0011111467874450785, -0.0005442993972098523, -1.2982368610783194e-05,
0.0007834476816723562, 2.2221180650775065e-06, -4.416136866781143e-05,
8.239232451572815e-05, -0.00010136354765774249
A possible generalized solution would be to use a fortran namelist reader like https://f90nml.readthedocs.io/en/latest/ for all the vmec reading/writing stuff (and spec too)
@MothVine the f90 namelist reader we mentioned ^
#431 improves this a bit but we should just use f90nml as it takes a lot of logic to deal with the flexibility that the namelists allow.
improvements that need to be made that could be resolved with f90nml:
- [x] handling duplicate inputs that are on the same line (i.e. RBC(0,0) = 1. , ZBS(1,1) = 1. RBC(1,1) = 1. , ZBS(1,1) = 1. currently DESC will not realize the 2nd line has a duplicate)
Also, make sure that we can handle VMEC input files with INDATA and END with different cases, since they are not always upper case
@dpanici I did this sometime, dig up the code for it