Skip to content

Inconsistent usage turbine indexing with CPP interfacing to OpenFAST library #2096

@andrew-platt

Description

@andrew-platt

Bug description
Within the FAST_AllocateTurbines routine, the Turbine data structure is allocated using the c/c++ convention of index 0 start (Turbine(0:NumTurbines-1). However, elsewhere in the OpenFAST library code, the indexing to this array of derived types is assumed to start at 1 (Turbine(1:NumTurbines)). This has caused issues with checkpoint files not getting closed when called from AMR-Wind (see Exawind/amr-wind#984).

I propose we remedy this by:

  1. Changing the name of ExternInitData%TurbineID to ExternInitData%TurbIDforNameto properly reflect the usage of this variable. This variable is only ever used to set the name of the output file (_i.e._SimName.T0.out`). This variable may be allowed to be 0 or larger.
  2. All data storage for turbine data within OpenFAST will use the Fortran indexing starting at index 1.
  3. Arguments passed from c/c++ for a turbine ID will be incremented by 1 to match the internal indexing used by OpenFAST.
  4. Update any documentation about this indexing

Since the name is generated from ExternInitData%TurbIDforName, it is completely independent of the internal data storage array indexing method.

This should correct the issue with closing checkpoint files from AMR-Wind.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions