Skip to content

Possible non-closing of a file #251

@andrew-platt

Description

@andrew-platt

When using the ROSCO controller with OpenFAST in AMR-Wind, we ran into an issue where ROSCO ran out of unit numbers when checkpoint files were written at every timestep. This was noticed by @shenpai35

Details:

  • OpenFAST 3.5.0
  • ROSCO 2.8.0
  • Model: IEA15
  • Unsure of AMR-Wind version

observations

  • When ROSCO's GetNewUnit() subroutine has a limit of 99, the GetNewUnit returns an error when trying to write checkpoint file 89.
  • When ROSCO's GetNewUnit() subroutine has a limit of 1024, the GetNewUnit returns an error when trying to write checkpoint file 1014.
  • If we switch models so that ROSCO is not used, we don't run into this issue. The NREL 5MW model runs with the above combination of OpenFAST, ROSCO, and AMR-Wind, without issue with writing the checkpoint files throughout the entire simulation (4k+ checkpoint files from the 5MW controller and OpenFAST).

Error:

ROSCO:PitchControl:PitchSaturation:interp1d:interp1d:interp1d:interp1d:interp1d:VariableSpeedControl:WindSpeedEstimator:AeroDynTorque:interp1d:interp1d:interp1d:GetNewUnit() was unable to find an open file unit specifier between 10 and 99.

conclusion
Considering the above observations, I find it most likely that ROSCO is not closing some file.

  1. Maybe ROSCO isn't closing a checkpoint file (this was our first guess). I really don't understand how that could be given the code here: https://github.com/NREL/ROSCO/blob/v2.8.0/ROSCO/src/ROSCO_IO.f90#L31C1-L37. The only thing I can conclude is that somehow it returns before hitting the close on line 275. This might be possible if the OPEN command returns non-zero for ErrStat, but actually opens the file. However that would result in nothing getting written to the file, but it appears most files have something in them. This might be a red herring.
  2. Given the error above, there is another file getting opened every timestep, but not getting closed. Maybe something in Interp1D? I lean towards this possibility, but have not really looked into it (I'll take a quick look and see if anything is obvious and report if I find anything).

Also one minor thing: the ErrMsg from line 35 of ROSCO_IO.f90 never gets returned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions