Skip to content

Code tidying - Remove unused variables, subroutines, dummy variables, etc. #845

@sbryngelson

Description

@sbryngelson

The CI runs on every PR a track of compiler warnings like unused dummy variables and such: https://github.com/MFlowCode/MFC/blob/master/.github/workflows/cleanliness.yml

and the output can be seen, e.g., here: https://github.com/MFlowCode/MFC/actions/runs/15242429158/job/42864167950

Warning: Unused variable ‘k_falloff’ declared at (1) [-Wunused-variable]
Warning: Unused PRIVATE module variable ‘col’ declared at (1) [-Wunused-value]
Warning: Unused PRIVATE module variable ‘tempname’ declared at (1) [-Wunused-value]
Warning: Unused variable ‘event’ declared at (1) [-Wunused-variable]
Warning: Unused dummy argument ‘id’ at (1) [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘name’ at (1) [-Wunused-dummy-argument]
Warning: Unused variable ‘k_falloff’ declared at (1) [-Wunused-variable]
Warning: Possible change of value in conversion from REAL([8](https://github.com/MFlowCode/MFC/actions/runs/15242429158/job/42864167950#step:11:9)) to INTEGER(4) at (1) [-Wconversion]
Warning: Unused dummy argument ‘fd_number_in’ at (1) [-Wunused-dummy-argument]
Warning: Possible change of value in conversion from COMPLEX(8) to REAL(8) at (1) [-Wconversion]
Warning: Unused PRIVATE module variable ‘err_code’ declared at (1) [-Wunused-value]
Warning: Unused dummy argument ‘mv’ at (1) [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘pb’ at (1) [-Wunused-dummy-argument]
Warning: Unused variable ‘q’ declared at (1) [-Wunused-variable]
Warning: Dummy argument ‘ccfl_max_glb’ at (1) was declared INTENT(OUT) but was not set [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘ccfl_max_loc’ at (1) [-Wunused-dummy-argument]
Warning: Dummy argument ‘icfl_max_glb’ at (1) was declared INTENT(OUT) but was not set [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘icfl_max_loc’ at (1) [-Wunused-dummy-argument]
Warning: Dummy argument ‘rc_min_glb’ at (1) was declared INTENT(OUT) but was not set [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘rc_min_loc’ at (1) [-Wunused-dummy-argument]
Warning: Dummy argument ‘vcfl_max_glb’ at (1) was declared INTENT(OUT) but was not set [-Wunused-dummy-argument]
Warning: Unused dummy argument ‘vcfl_max_loc’ at (1) [-Wunused-dummy-argument]
Warning: ‘p_send’ may be used uninitialized [-Wmaybe-uninitialized]
Warning: ‘p_recv’ may be used uninitialized [-Wmaybe-uninitialized]

This issue concerns removing unused variables, dummy variables, and other things that don't make sense in the code.

A warning to who works on this: Some of these will seem to persist because there are different compilation units, marked by #ifdef. For example

#ifdef MFC_PREPROCESS
...
#endif

others are MFC_SIMULATION, MFC_POSTPROCESS.

And some only happen if OpenACC GPU offloading is enabled (MFC_OPENACC) or MPI is enabled (MFC_MPI).

Most of these can be worked around by enclosing the offending variables with corresponding #ifdef and #endif tags

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions