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

STICS C2ML generated Fortran source code with invalid access to array indexes #20

Open
fabiooliveira72 opened this issue Sep 29, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@fabiooliveira72
Copy link
Collaborator

The code translated by Crop2ML in file layer_temp.f90 at layer_thickness2depth subroutine, produced an invalid statement for the layer_depth indexes. The index in Fortran should start in 1 and the math done creates always an index of 0.

Note that the Loop always starts count at 1 for z. See the code below.

layer_depth(z - 1+1) = sum(layer_thick(1 - 1:z))
New code:
layer_depth(z - 1+1) = sum(layer_thick(1:z))

@fabiooliveira72 fabiooliveira72 added the bug Something isn't working label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant