geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 48 forks source link

nconst=10 and nfunc=14 hard-coded into class equation_coefficients #491

Open illorenzo7 opened 9 months ago

illorenzo7 commented 9 months ago

This issue concerns the file "reference_tools.py" in the post_processing folder. It hard-codes number of constants and functions in the PDE set to 10 and 14 (the most common) but doesn't allow the possibility that (currently only the constants) these could be different, if the user specifies scalar diffusions.

I think this could be handled going forward by assuming all previously generated equation_coefficients files had nconst=10, nfunc=14 and keep the current logic if version=1. Then change the version to 2 in Fortran, and have the new equation_coefficients files also include the nconst and nfunc integers explicitly, directly after the version number is written, and before the "cset" and "fset" are written. Finally, change the equation_coefficients.py file to have the appropriate reading contingency based on version number 2.