Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

real loop indexes used in mbpf #757

Open
dkokron opened this issue Jun 18, 2024 · 2 comments · May be fixed by #760
Open

real loop indexes used in mbpf #757

dkokron opened this issue Jun 18, 2024 · 2 comments · May be fixed by #760

Comments

@dkokron
Copy link

dkokron commented Jun 18, 2024

GDIT is testing a static analysis tool called Codee (https://www.codee.com/). Codee flagged some issues with mgbf.

codee: error: failed to analyze '/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90'

error: Semantic errors in /lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90
/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90:67:12: error: Must have INTEGER type, but is REAL(4)
V(n,m)=ampl*(mgimax0+ng)
^
/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90:67:14: error: Must have INTEGER type, but is REAL(4)
V(n,m)=ampl
(mgimax0+ng)
^
/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90:145:12: error: Must have INTEGER type, but is REAL(4)
V(l,n,m)=ampl
(mgimax0+ng) +(l-1)incrm
^
/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90:145:14: error: Must have INTEGER type, but is REAL(4)
V(l,n,m)=ampl
(mg
imax0+ng) +(l-1)incrm
^
/lfs/h1/hpc/support/USER/Projects/GSI/develop/src/mgbf/mg_input.f90:145:16: error: Must have INTEGER type, but is REAL(4)
V(l,n,m)=ampl
(mg*imax0+ng) +(l-1)*incrm

The l,n,m variables are loop indexes but they are declared.
real(i_kind):: ng,mg,L,m,n

@TingLei-NOAA
Copy link
Contributor

@dkokron Thanks for this validation effort. The apparent fix is to use " integer(i_kind)" to replace "real(i_kind)".
I think you can direct make a PR for this or I can do it if you prefer.
Please let me know how you want to proceed. Thanks.
BTW: it is mgbf rather than "mbpf".

@dkokron
Copy link
Author

dkokron commented Jun 21, 2024

@TingLei-NOAA Please submit the PR for this issue.

TingLei-daprediction pushed a commit to TingLei-daprediction/GSI that referenced this issue Jun 23, 2024
…ich was identified by D. Kokron. NOAA-EMC#757 .    Co-author : D. Kokron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants