%      test the conversion to lat lon from x,y
global SECS COSROT SINROT ONCE
global UTMXOFF UTMYOFF XOFF YOFF ROTANGLE IZONE ISPHERE
global AXIS BXIS AK0 RADSEC

%
x = [000 000 250 250 250 500 500 500];
y = [200 100 200 100 000 200 100 000];

%    correct values for given points
clat = [-69.5361 -70.1376 -67.8527 -68.4087 -68.9430 -66.0773 -66.5928 -67.0865];
clon = [-77.0093 -75.0914 -72.9592 -71.0765 -69.1004 -69.4729 -67.6475 -65.7458 ];

[lat,lon]=grid2ll(x,y);

for i=1:8

   disp(['grid: ' num2str(x(i)) '.' num2str(y(i)) ' is (' num2str(lat(i)) ...
    ', ' num2str(lon(i)) ')' ]);
   disp(['      correct is (' num2str(clat(i)) ', ' num2str(clon(i))]);
   disp('    ');

end



