function sphcolorcontjet2(field1,field2,field1a, field2a,lat,lon, num)

%sphcolorcont(variable1,variable2,lat,lon)
%sphcolorcont(variable1,variable2,lat,lon, num)
%sphcolorcont(variable1,variable2,lat,lon, num, 'atl')



figure(num); clf;



%plots spherical data on a robinson projection with continents

if max(lon)<=4
    %error('input longitude should be in degrees')
end

if max(abs(lat))>90
    error('input order is wrong - input latitude vector before longitude vector')
end

field1=squeeze(field1);
field1a=squeeze(field1a);
a=size(field1);
NN=a(1,1); N=a(1,2);

if length(lat)<NN | length(lat)>NN
    error('field1 size and latitude input must be same size')
end

if length(lon)<N | length(lon)>N
    error(' field1 size and longitude input must be same size')
end

field2=squeeze(field2);
field2a=squeeze(field2a);
a=size(field2);
NN=a(1,1); N=a(1,2);

if length(lat)<NN | length(lat)>NN
    error('field2 size and latitude input must be same size')
end

if length(lon)<N | length(lon)>N
    error(' field2 size and longitude input must be same size')
end



LAT=lat;
load coast
figure(num); clf; subplot(2,1,1)


axesm('robinson','MapLatLimit',[min(LAT) max(LAT)],'MapLonLimit',[min(lon)-10 max(lon)+10], 'Origin', 0, 'FLatLimit',[min(LAT)-5 max(LAT)+5], 'FLonLimit',[min(lon)-10 max(lon)+10],'ScaleFactor',1.5) %Atlantic?

framem; plotm(lat,long, 'k');
Lat=lat;
lat=LAT; clear LAT

[LON,LAT]=meshgrid(lon,lat);
hold on;
%color_trans; colormap(cmap);
colormap('jet')
caxis([min(min([field1;field1a])) max(max([field1;field1a]))]);

pcolorm(LAT, LON, field1)
colorbar;
hold on
[c,h]=contourm(LAT, LON, field2, 'r');
ht = clabelm(c,h); set(ht,'color','r')
hidem(gca)

hold on;framem; plotm(Lat,long, 'k');
tightmap


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LAT=lat;
load coast

figure(num); hold on; subplot(2,1,2)


axesm('robinson','MapLatLimit',[min(LAT) max(LAT)],'MapLonLimit',[min(lon)-10 max(lon)+10], 'Origin', 0, 'FLatLimit',[min(LAT)-5 max(LAT)+5], 'FLonLimit',[min(lon)-10 max(lon)+10],'ScaleFactor',1.5) %Atlantic?

framem; plotm(lat,long, 'k');
Lat=lat;
lat=LAT; clear LAT

[LON,LAT]=meshgrid(lon,lat);
hold on;
%color_trans; colormap(cmap);
colormap('jet')
caxis([min(min([field1;field1a])) max(max([field1;field1a]))]);

pcolorm(LAT, LON, field1a)
colorbar;
hold on

[c,h]=contourm(LAT, LON, field2a, vals);
ht = clabelm(c,h); set(ht,'color','r')
hidem(gca)

hold on;framem; plotm(Lat,long, 'k');
tightmap
