nx, ny: number of grid points in x and y directions