NOAA-EMC / gridgen

Package for generating grids for WAVEWATCH III
16 stars 26 forks source link

Suspected incorrect fix "For very fine grids" in generate_grid.m #4

Open dpzimmer opened 5 years ago

dpzimmer commented 5 years ago

Hi folks,

Regarding the following code in generate_grid.m

% [lon_prev,~] = min(abs(lon_base-x(k,j))); % For very fine grids [lon_prev,tmp] = min(abs(lon_base-x(k,j))); if ( round(lon_prev) == 0 ) lon_prev = tmp-1; end; %

I believe that the following code is what is required:

[~,lon_prev] = min(abs(lon_base-x(k,j)));

and similarly for latitude further down.