function sphcolorcontdoubledouble2(field1a,field1b,field1c,field2a,field2b,field2c,lat,lon,num)

%compares two color and contour spherical plots
%is written with the Atlantic domain in mind

%field1a-subplot 1 color
%field1b- subplot 1 contour





%set default figure n

[LON, LAT]=meshgrid(lon,lat);



%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

field1a=squeeze(field1a);
[NN,N]=size(field1a);



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

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

field1b=squeeze(field1b);
[NN,N]=size(field1b);

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

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

field2a=squeeze(field2a);
[NN,N]=size(field2a);



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

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

field2b=squeeze(field2b);
[NN,N]=size(field2b);

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

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

%convert longitudes to be continous
for n=1:N
    if lon(n) >= 180
        lon(n)=lon(n)-360;
    else
        lon(n)=lon(n);
    end
end


LW2=2.0; %for continents
CW=2.0; %contour widht
CFS=16; %contour font size
v=[0:10:60];

mnlat=min(lat);
mxlat=max(lat);
mnlon=-110;
mxlon=60;

load coast
figure(num); clf; %subplot(2,2,1)


axesm('robinson','MapLatLimit',[mnlat mxlat],'MapLonLimit',[mnlon mxlon], 'Origin', 0, 'FLatLimit',[mnlat-5 mxlat+5], 'FLonLimit',[mnlon mxlon],'ScaleFactor',1.5)

%framem;
plotm(lat,long, 'k', 'LineWidth',LW2);

hold on;
cmap = [ ...
    1.0000    1.0000    1.0000
    0.6667    1.0000    0.6667
    0.3333    1.0000    0.3333
         0    0.9192         0
    1.0000    1.0000         0
    1.0000    0.5000         0
    0.8000         0         0
];
colormap(cmap);
caxis([0 max(max(abs([field1a field2a])))])
pcolorm(LAT, LON, field1a); shading interp;
%colorbar;
hold on
[c,h]=contourm(LAT, LON, field1b, 'm', 'LineWidth', CW);
ht = clabelm(c,h,v); set(ht,'color','m', 'FontSize', CFS)
hidem(gca)

hold on; %framem; 
plotm(lat,long, 'k', 'LineWidth', LW2);
tightmap

gridm('on');
setm(gca, 'GColor', 'b','FontColor', 'b', 'GLineStyle', '--', 'GLineWidth', 1.5, 'MLineLocation', 20, 'PLineLocation', 10, 'FontSize', 16, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 18, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -110)

colorbar('horizontal', 'Fontsize', 22)
%framem;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(num+1); clf; %subplot(2,2,3)


axesm('robinson','MapLatLimit',[mnlat mxlat],'MapLonLimit',[mnlon mxlon], 'Origin', 0, 'FLatLimit',[mnlat-5 mxlat+5], 'FLonLimit',[mnlon mxlon],'ScaleFactor',1.5)


%framem; 
plotm(lat,long, 'k');

hold on;
colormap(cmap);
caxis([0 max(max(abs([field1a field2a])))])
pcolorm(LAT, LON, field2a); shading interp;
hold on
[c,h]=contourm(LAT, LON, field2b, 'm', 'LineWidth', CW);
ht = clabelm(c,h,v); set(ht,'color','m', 'FontSize', CFS)
hidem(gca)

hold on; %framem;
plotm(lat,long, 'k', 'LineWidth', LW2);
tightmap

gridm('on');
setm(gca, 'GColor', 'b','FontColor', 'b', 'GLineStyle', '--', 'GLineWidth', 1.5, 'MLineLocation', 20, 'PLineLocation', 10, 'FontSize', 16, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 18, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -120)


colorbar('horizontal', 'Fontsize', 22)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(22); clf; %subplot(2,2,2)


axesm('robinson','MapLatLimit',[mnlat mxlat],'MapLonLimit',[mnlon mxlon], 'Origin', 0, 'FLatLimit',[mnlat-5 mxlat+5], 'FLonLimit',[mnlon mxlon],'ScaleFactor',1.5)


hold on;
colormap(cmap);
caxis([0 max(max(abs([field1c field2c])))])
pcolorm(LAT, LON, field1c); shading interp;
%colorbar;
hold on
[c,h]=contourm(LAT, LON, field1b, 'm', 'LineWidth', CW);
ht = clabelm(c,h); set(ht,'color','m', 'FontSize', CFS)
hidem(gca)
hold on;%framem; 
plotm(lat,long, 'k', 'LineWidth', LW2);
tightmap

gridm('on');
setm(gca, 'GColor', 'b','FontColor', 'b', 'GLineStyle', '--', 'GLineWidth', 1.5, 'MLineLocation', 20, 'PLineLocation', 10, 'FontSize', 16, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 18, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -120)


colorbar('horizontal', 'Fontsize', 22)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(23); clf; %subplot(2,2,4)

axesm('robinson','MapLatLimit',[mnlat mxlat],'MapLonLimit',[mnlon mxlon], 'Origin', 0, 'FLatLimit',[mnlat-5 mxlat+5], 'FLonLimit',[mnlon mxlon],'ScaleFactor',1.5)


hold on;
colormap(cmap);
caxis([0 max(max(abs([field1c field2c])))])
pcolorm(LAT, LON, field2c); shading interp;
%colorbar;
hold on
[c,h]=contourm(LAT, LON, field2b, 'm', 'LineWidth', CW);
ht = clabelm(c,h); set(ht,'color','m', 'FontSize', CFS)
hidem(gca)
hold on;%framem; 
plotm(lat,long, 'k', 'LineWidth', LW2);
tightmap

gridm('on');
setm(gca, 'GColor', 'b','FontColor', 'b', 'GLineStyle', '--', 'GLineWidth', 1.5, 'MLineLocation', 20, 'PLineLocation', 10, 'FontSize', 16, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 18, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -120)


colorbar('horizontal', 'Fontsize', 22)


return




