You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the Socrates files has some unusual (at least to me) array syntax involving symbols from other modules, and fparser is failing to handle it correctly.
fparser call and errors:
>>> from fparser.two.parser import ParserFactory
>>> from fparser.common.readfortran import FortranFileReader
>>> parser = ParserFactory().create(std="f2008")
>>> reader = FortranFileReader("aerosol_model_pcf.f90", include_dirs=".")
>>> parser(reader)
Traceback (most recent call last):
File "/home/achalk/LFRIC/LFRIC_env/lib64/python3.6/site-packages/fparser/two/Fortran2003.py", line 266, in __new__
return Base.__new__(cls, string)
File "/home/achalk/LFRIC/LFRIC_env/lib64/python3.6/site-packages/fparser/two/utils.py", line 487, in __new__
raise NoMatchError(errmsg)
fparser.two.utils.NoMatchError: at line 68
>>> (/ NPD_aerosol_component, NPD_aerosol_model /) )
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/achalk/LFRIC/LFRIC_env/lib64/python3.6/site-packages/fparser/two/Fortran2003.py", line 270, in __new__
raise FortranSyntaxError(string, "")
fparser.two.utils.FortranSyntaxError: at line 68
>>> (/ NPD_aerosol_component, NPD_aerosol_model /) )
NPD_aerosol_model is a parameter declared in this file (6), realK is defined in realtype_rd and NPD_aerosol_complonent is a parameter defined in rad_pcf - both readltype_rd and rad_pcf are USEd by this fortran file. The sceond argument to reshape is an array which is defined here inline - perhaps causing the failure?
The text was updated successfully, but these errors were encountered:
LonelyCat124
changed the title
fparser failing to handle unusual array declaration syntax involving symbols from other modules
fparser failing to handle inline array declaration in reshape (maybe?)
Jun 27, 2023
One of the Socrates files has some unusual (at least to me) array syntax involving symbols from other modules, and fparser is failing to handle it correctly.
fparser call and errors:
Source file declaration:
NPD_aerosol_model
is a parameter declared in this file (6), realK is defined inrealtype_rd
andNPD_aerosol_complonent
is a parameter defined inrad_pcf
- bothreadltype_rd
andrad_pcf
areUSE
d by this fortran file. The sceond argument to reshape is an array which is defined here inline - perhaps causing the failure?The text was updated successfully, but these errors were encountered: