Skip to content

Array bounds issue in Morrion.f90 #296

Description

@andrew-platt

Bug description

There is an array bounds issue in the Morrison.f90 code at line 4561 (dev branch).

To Reproduce

Steps to reproduce the behavior:

  1. Compile with gfortran (9) with bounds checking turned on, release mode.
    Add compile flags: -fcheck=all -pedantic -fbacktrace -fbounds-check -Wuninitialized

  2. Run test case Revert Cavitation-related pull request #19 (5MW_OC3Trpd_DLL_WSt_WavesReg)

  3. Error shows up as:

19: At line 4561 of file /Users/aplatt/software-development/GitHub/openfast/modules/hydrodyn/src/Morison.f90
19: Fortran runtime error: Array bound mismatch for dimension 1 of array 'm' (6/3)
19:
19: Error termination. Backtrace:
19: #0  0x11182839d
19: #1  0x111828f85
19: #2  0x111829416
19: #3  0x1102b38ef
19: #4  0x1102633a9
19: #5  0x10f4c8066
19: #6  0x10f4da69b
19: #7  0x10f4e95e9
19: #8  0x10f366482
19: #9  0x10f366e2e
19: #10  0x10f2ff70c
19: #11  0x1107e431e

This was compiled on a mac using gfortran 9 and the dev branch, hash 2d9230d (2d9230d)

My suspicion is that the array m%D_F_AM_M(:,J) should be specified as m%D_F_AM_M(1:3,J) or m%D_F_AM_M(4:6,J), but I don't know the code well enough to know what it is doing there. The RHS of that line is a matrix multiply of a 3x3 and a vector size 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions