PrincetonUniversity / SPEC

The Stepped-Pressure Equilibrium Code, an advanced MRxMHD equilibrium solver.
https://princetonuniversity.github.io/SPEC/
GNU General Public License v3.0
24 stars 4 forks source link

Add options to generate a template input file #173

Closed zhucaoxiang closed 2 years ago

zhucaoxiang commented 2 years ago

I have implemented the feasibility to write a template input file, as well as new help information.

Now users can use xspec -h to print help info and use xspec -i to generate a template input file which will be always synced to the namelists.

The only drawback is that it writes the maximum length of all arrays. So one probably need to revise the dimensionality.

The help information

rdcmdl :            : Usage: <mpiexec> xspec input_file <arguments>
rdcmdl :            : Other options:
rdcmdl :            :     -h / --help :  print help information.
rdcmdl :            :     -i / --init :  generate a template input file.
rdcmdl :            : Additional arguments:
rdcmdl :            :     -readin : print debugging information during reading inputs

Part of the example.sp:

 OITA= 257*0.0000000000000000       ,
 MUPFTOL=  1.0000000000000000E-014,
 MUPFITS=8          ,
 RPOL=  1.0000000000000000     ,
 RTOR=  1.0000000000000000     ,
 LREFLECT=0          ,
 RAC= 129*0.0000000000000000       ,
 ZAS= 129*0.0000000000000000       ,
 RAS= 129*0.0000000000000000       ,
 ZAC= 129*0.0000000000000000       ,
 RBC= 66049*0.0000000000000000       ,
 ZBS= 66049*0.0000000000000000       ,
 RBS= 66049*0.0000000000000000       ,
 ZBC= 66049*0.0000000000000000       ,
zhucaoxiang commented 2 years ago

@jonathanschilling Yes, if we want to write that information, we need to manually write down those lines.