Skip to content

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

@fabiooliveira72

Description

@fabiooliveira72

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions