Hi all,I have tried to plot the centers and vertices of a spectral element ne4np4 grid (attached). Turns out the grid is "almost quadrilateral":blue crosses are the centers of quadrilateral elementsred crosses are the centers of triangular elementsgreen crosses are centers of elements with five sides (for some two corners are very close togehter and can't be distinguised in the plot)Now my question: Is that correct?Background for the question: I want to use the coordinates of the corners for scrip regridding in the CESM1/MESSy code (doi:10.5194/gmdd-8-6523-2015).Thanks! Andreas For reference, here's the matlab script for plotting the grid: ncid=netcdf.open('SCRIPgrid_ne4np4_nomask_c110808.nc');
grid_corner_lat_id=netcdf.inqVarID(ncid,'grid_corner_lat');
grid_corner_lat=netcdf.getVar(ncid,grid_corner_lat_id);
grid_corner_lon_id=netcdf.inqVarID(ncid,'grid_corner_lon');
grid_corner_lon=netcdf.getVar(ncid,grid_corner_lon_id);
grid_center_lat_id=netcdf.inqVarID(ncid,'grid_center_lat');
grid_center_lat=netcdf.getVar(ncid,grid_center_lat_id);
grid_center_lon_id=netcdf.inqVarID(ncid,'grid_center_lon');
grid_center_lon=netcdf.getVar(ncid,grid_center_lon_id);
netcdf.close(ncid)
for i=1:size(grid_corner_lat,2)
numdoublecorners(i)=0;
for k=1:5
for j=((k+1):5)
if ((grid_corner_lat(k,i)==grid_corner_lat(j,i)) && (grid_corner_lon(k,i)==grid_corner_lon(j,i)))
numdoublecorners(i)=numdoublecorners(i)+1;
end
end
end
numcorners(i)=5-numdoublecorners(i);
end
figure
plot(grid_center_lon,grid_center_lat,'x')
hold on
plot(grid_center_lon(find(numcorners==3)),grid_center_lat(find(numcorners==3)),'rx')
plot(grid_center_lon(find(numcorners==5)),grid_center_lat(find(numcorners==5)),'gx')
plot(grid_center_lon(find(numcorners==2)),grid_center_lat(find(numcorners==2)),'rx')
for k=1:5
plot(grid_corner_lon(k,:),grid_corner_lat(k,:),'k.')
end
for i=1:size(grid_corner_lat,2)
if (any(grid_corner_lon(:,i)>350) && any(grid_corner_lon(:,i)
grid_corner_lat_id=netcdf.inqVarID(ncid,'grid_corner_lat');
grid_corner_lat=netcdf.getVar(ncid,grid_corner_lat_id);
grid_corner_lon_id=netcdf.inqVarID(ncid,'grid_corner_lon');
grid_corner_lon=netcdf.getVar(ncid,grid_corner_lon_id);
grid_center_lat_id=netcdf.inqVarID(ncid,'grid_center_lat');
grid_center_lat=netcdf.getVar(ncid,grid_center_lat_id);
grid_center_lon_id=netcdf.inqVarID(ncid,'grid_center_lon');
grid_center_lon=netcdf.getVar(ncid,grid_center_lon_id);
netcdf.close(ncid)
for i=1:size(grid_corner_lat,2)
numdoublecorners(i)=0;
for k=1:5
for j=((k+1):5)
if ((grid_corner_lat(k,i)==grid_corner_lat(j,i)) && (grid_corner_lon(k,i)==grid_corner_lon(j,i)))
numdoublecorners(i)=numdoublecorners(i)+1;
end
end
end
numcorners(i)=5-numdoublecorners(i);
end
figure
plot(grid_center_lon,grid_center_lat,'x')
hold on
plot(grid_center_lon(find(numcorners==3)),grid_center_lat(find(numcorners==3)),'rx')
plot(grid_center_lon(find(numcorners==5)),grid_center_lat(find(numcorners==5)),'gx')
plot(grid_center_lon(find(numcorners==2)),grid_center_lat(find(numcorners==2)),'rx')
for k=1:5
plot(grid_corner_lon(k,:),grid_corner_lat(k,:),'k.')
end
for i=1:size(grid_corner_lat,2)
if (any(grid_corner_lon(:,i)>350) && any(grid_corner_lon(:,i)