function sphcolorcontdouble(field1a,field1b,field2a,field2b,lat,lon,num)

cont_color='w'; %contour color
cfs=16; %contour label font size
%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




%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; %width of continent lines
CL2='k'; %continent color
LW3=2; %contour width
CLG='m'; %grid color;
lats=30:10:60;


mnlat=21;
mxlat=68
LAT=lat;
load coast
figure(num); clf; subplot(2,1,1)


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

framem; plotm(lat,long, CL2, 'LineWidth', LW2);
Lat=lat;
lat=LAT; clear LAT



[LON,LAT]=meshgrid(lon,lat);
hold on;
colormap('jet');
caxis([0 max(max(abs([field1a field2a])))])

pcolorm(LAT, LON, field1a)
%colorbar;
hold on
[c,h]=contourm(LAT, LON, field1b, cont_color, 'LineWidth', LW3);
ht = clabelm(c,h, 'FontSize', cfs); set(ht,'color',cont_color)
hidem(gca)

hold on;framem; plotm(Lat,long, CL2, 'LineWidth', LW2);
tightmap

%legend('LGM')
%title('LGM')
gridm('on')
setm(gca, 'GColor', CLG,'FontColor', CLG, 'GLineStyle', '--', 'GLineWidth', 1.8, 'MLineLocation', 20, 'PLineLocation', lats, 'FontSize', 17, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 19, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -120,'MLineLimit', [22 68])

colorbar('horizontal', 'FontSize', 20)



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


axesm('robinson','MapLatLimit',[min(lat) max(lat)],'MapLonLimit',[min(lon) max(lon)], 'Origin', 0, 'FLatLimit',[min(lat)-5 max(lat)+5], 'FLonLimit',[min(lon) max(lon)],'ScaleFactor',1.5)

framem; plotm(Lat,long, CL2, 'LineWidth', LW2);



[LON,LAT]=meshgrid(lon,lat);
hold on;
colormap('jet');
caxis([0 max(max(abs([field1a field2a])))])
pcolorm(LAT, LON, field2a)
%colorbar;
hold on
[c,h]=contourm(LAT, LON, field2b, cont_color, 'LineWidth', LW3 );
ht = clabelm(c,h, 'FontSize', cfs); set(ht,'color',cont_color)
hidem(gca)

hold on;framem; plotm(Lat,long, CL2, 'LineWidth', LW2);
tightmap

%legend('MODERN');



gridm('on')
setm(gca, 'GColor', CLG,'FontColor', CLG, 'GLineStyle', '--', 'GLineWidth', 1.8, 'MLineLocation', 20, 'PLineLocation', 10, 'FontSize', 17, 'MeridianLabel', 'on','MLabelLocation', 20, 'MLabelParallel', 18, 'ParallelLabel', 'on', 'PLabelLocation', 10, 'PLabelMeridian', -120)


% figure(num); hold on; subplot(3,1,3)
% 
% 
% axesm('robinson','MapLatLimit',[min(lat) max(lat)],'MapLonLimit',[min(lon) max(lon)], 'Origin', 0, 'FLatLimit',[min(lat)-5 max(lat)+5], 'FLonLimit',[min(lon) max(lon)],'ScaleFactor',1.5)
% 
% framem; plotm(Lat,long, 'k');
% 
% 
% 
% [LON,LAT]=meshgrid(lon,lat);
% hold on;
% color_trans; colormap(cmap);
% caxis([-max(max(abs([field1a field2a]))) max(max(abs([field1a field2a])))])
% pcolorm(LAT, LON, field1a-field2a)
% %colorbar;
% hold on
% [c,h]=contourm(LAT, LON, field2b, 'r');
% ht = clabelm(c,h); set(ht,'color','r')
% hidem(gca)
% 
% hold on;framem; plotm(Lat,long, 'k');
% tightmap
% 
% legend('LGM-MODERN')



