c This program reads data output from grid_ctd.x or grid_sd2.x c and output either a decimated grid or interpolation to c user-specified latitude or longitude coordinates from the c original distance coordinates. c Salim Odero 9/96 c c c program grid_interp parameter (ngx=1000,ngy=700) c matrix program integer nx,ny real xres,yres,xleft,xright,ytop,ybot real grid(ngy,ngx), grerror(ngy,ngx) c initialize variables data nx, ny/2*0/ data xres,yres,xleft,xright,ytop,ybot/6*0.0/ c c call the main subroutines of the program c call read_matrix(grid,grerror,nx,ny,xres,yres,xleft,xright,ytop,ybot) c c the following decimates the grid vertically c it replaces the old grid and grerror with the decimated values c and resets ny, yres and ybot call decimate_matrix(grid,grerror,nx,ny,xres,yres,xleft, 1 xright,ytop,ybot) c c the following interpolates matrix to degrees lat or long call interpolate_matrix(grid,grerror,nx,ny,xres,yres,xleft, 1 xright,ytop,ybot) c c write matrix in binary, ascii or netcdf format call save_matrix(grid,grerror,nx,ny,xres,yres,xleft, 1 xright,ytop,ybot) c stop end