//usage: ncap2 -O -S ~/nco/data/nco_gsl.nco ~/nco/data/nco_gsl.nc out.nc 
//case 1; vx,vy   double arrays with no fill value and dim=N
//case 2; fx,fy   double arrays one fill value in fy and dim=N
//case 3; vxr,vyr double arrays with no fill value and dim=N-1, index a fill value case 2 removed
//case 2 and case 3 must return the same values for: &c0,&c1,&cov00,&cov01,&cov11,&sumsq
nco_gsl_fit_linear(vx,1,vy,1,$dim.size,&c0,&c1,&cov00,&cov01,&cov11,&sumsq);
print("Values for vx,vy:\n");
print(c0);
print(c1);
print(cov00);
print(cov01);
print(cov11);
print(sumsq);
nco_gsl_fit_linear(fx,1,fy,1,$dim.size,&c0,&c1,&cov00,&cov01,&cov11,&sumsq);
print("Values for fx,fy:\n");
print(c0);
print(c1);
print(cov00);
print(cov01);
print(cov11);
print(sumsq);
nco_gsl_fit_linear(vxr,1,vyr,1,$dimr.size,&c0,&c1,&cov00,&cov01,&cov11,&sumsq);
print("Values for vxr,vyr:\n");
print(c0);
print(c1);
print(cov00);
print(cov01);
print(cov11);
print(sumsq);



