AquaticEcoDynamics / Lake-Erie

Main Repo for the Lake Erie simulation and processing scripts
1 stars 1 forks source link

small polygon crashes plots #12

Open matthipsey opened 2 years ago

matthipsey commented 2 years ago

Still getting a crash on site 1274 (small polygon)

plottfv_polygon Erie_WQ_v11_b_linux

plottfv_polygon: START
SHP sites:
    33     1     2     3     4     5     6     7     8     9    10    15    16    29    34    35    36    37

Loading Model 1
Loading Model 2
Loading Model 3
 >>> var1=WQ_OGM_POP; site=**33**: Sta 1274
Error using matlab.internal.math.interp1
Interpolation requires at least two sample points for each grid dimension.

Error in interp1 (line 188)
        VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);

Error in plims (line 13)
y = interp1(sort(x(~isnan(x))),(n-1)*p+1);

Error in tfv_getmodeldatapolygon_faster (line 156)
        data.pred_lim_ts(:,inc) = plims(xd,pred_lims);

Error in plottfv_polygon (line 595)
                [data(mod),c_units,isConv] = tfv_getmodeldatapolygon_faster(raw(mod).data,ncfile(mod).name,all_cells(mod).X,all_cells(mod).Y,shp(site).X,shp(site).Y,{loadname},d_data(mod).D,depth_range,d_data(mod).layerface,d_data(mod).NL,surface_offset);clear functions
brendan-busch commented 2 years ago

Crash is due to the HUGE grid cells in V10. There are no cell centres of the V10 grid in the now much smaller polygon. I have kicked off a v11 only plot (_bb).

The matlab "killed" issue is due to insufficient memory to handle multiple simulations on the same plot. As a "quick Fix" I have added a flag to plottfv_polygon called single_precision. When set to 1 in a configuration it converts the netcdf imported data from double to single precision. This saves a huge amount of memory, allowing for more complex plots. Testing is continuing to see if any changes to the plotted data.