Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions glue-codes/openfast-cpp/src/OpenFAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,15 @@ void fast::OpenFAST::findRestartFile(int iTurbLoc) {
check_nc_error(ierr, "nc_get_vara_double - getting latest time");
tStart = latest_time;

char tmpOutFileRoot[INTERFACE_STRING_LENGTH];
char *tmpOutFileRoot;
size_t len;
ierr = nc_inq_attlen(ncid, NC_GLOBAL, "out_file_root", &len);
check_nc_error(ierr, "nc_inq_attlen - getting out_file_root length");

tmpOutFileRoot = (char*) malloc(len + 1);
ierr = nc_get_att_text(ncid, NC_GLOBAL, "out_file_root", tmpOutFileRoot);
check_nc_error(ierr, "nc_get_att_text - getting out_file_root");
tmpOutFileRoot[len] = '\0';
turbineData[iTurbLoc].outFileRoot.assign(tmpOutFileRoot);

ierr = nc_get_att_double(ncid, NC_GLOBAL, "dt_fast", &dtFAST);
Expand All @@ -119,7 +126,7 @@ void fast::OpenFAST::findRestartFile(int iTurbLoc) {
std::cout << "Restarting from time " << latest_time << " at time step " << tstep << " from file name " << turbineData[iTurbLoc].FASTRestartFileName << std::endl ;

nc_close(ncid);

free(tmpOutFileRoot);
}

void fast::OpenFAST::prepareRestartFile(int iTurbLoc) {
Expand Down
Loading