File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
glue-codes/openfast-cpp/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -90,8 +90,15 @@ void fast::OpenFAST::findRestartFile(int iTurbLoc) {
9090 check_nc_error (ierr, " nc_get_vara_double - getting latest time" );
9191 tStart = latest_time;
9292
93- char tmpOutFileRoot[INTERFACE_STRING_LENGTH];
93+ char *tmpOutFileRoot;
94+ size_t len;
95+ ierr = nc_inq_attlen (ncid, NC_GLOBAL, " out_file_root" , &len);
96+ check_nc_error (ierr, " nc_inq_attlen - getting out_file_root length" );
97+
98+ tmpOutFileRoot = (char *) malloc (len + 1 );
9499 ierr = nc_get_att_text (ncid, NC_GLOBAL, " out_file_root" , tmpOutFileRoot);
100+ check_nc_error (ierr, " nc_get_att_text - getting out_file_root" );
101+ tmpOutFileRoot[len] = ' \0 ' ;
95102 turbineData[iTurbLoc].outFileRoot .assign (tmpOutFileRoot);
96103
97104 ierr = nc_get_att_double (ncid, NC_GLOBAL, " dt_fast" , &dtFAST);
You can’t perform that action at this time.
0 commit comments