camrinbraun / HMMoce

hidden markov model for psat data v.1.1
Other
6 stars 7 forks source link

Explicitly close any NetCDFs that are opened #67

Open camrinbraun opened 2 years ago

camrinbraun commented 2 years ago

From Dr. Itoh:

In functions like calc.sst (or calc.sst.par, calc.hycom) which open “nc” data, it is better to close them by RNetCDF::close.nc(nc) for example below the “dat <- RNetCDF::var.get.nc(nc, nameidx)”. Once the nc file was still open when the program stopped with an error, R crashed when I ran the program again.