FMS icon indicating copy to clipboard operation
FMS copied to clipboard

"year", "month", "day" locally scoped in time_interp.F90, overriding global value

Open underwoo opened this issue 2 years ago • 0 comments

Describe the bug While not really a bug, the time_interp.F90 file uses bad practice of using locally scoped variables that have the same name as global variables.

A linter I am testing gives the following messages:

Variable "year" masks variable in parent scope [Ln 290, Co 23]
time_interp.F90[Ln 237,Col 1]: First declaration

This message is repeated for the "month", "day" variables as well. Each of the three variables are locally masked in multiple locations.

Since the global variable is an enumeration, and public to other modules, the local variables should use different names.

Additional context The linter is the fortran-language-server run in VS Code.

underwoo avatar Oct 06 '22 17:10 underwoo