function [t,T,R]=seasonality6(plotit)
% [t,T,R]=SEASONALITY6(plotit)
%
% INPUT:
%
% plotit   0 loads and checks the data
%          1 also plots the data
%
% OUTPUT:
%
% t        times
% T        temperatures
% R        precipitation
%
% EXAMPLES:
%
% seasonality6(0);
% seasonality6(1);
% [t,T,R]=seasonality6(0);
%
% Last modified by fjsimons-at-alum.mit.edu, 11/12/2024

% The filename in question
fnam='a3b62fd94be32d6df0f608b1d9304888.nc';

% Do as we did multiple times before for two of the variables
rome=[41.905 12.474];
% Temperature (daily)
[T,t,c1]=readVariableFromNetCDF(fnam,'var167',rome);
% Total precipitation (daily)
[R,t2,c2]=readVariableFromNetCDF(fnam,'var228',rome);
% Check that the times are identical
if sum(t~=t2); error('Times are not identical'); end
% Check that the times are daily
if sum(hours(unique(diff(t)))~=24); error('Times are not daily'); end

if plotit==1
    % Make a quick plot of temperature and total precipitation
    figure(1)
    clf
    s1=subplot(211);
    p1=plot(t,T); axis tight; ylabel('temperature')
    s2=subplot(212);
    p2=plot(t,R); axis tight; ylabel('precipitation')
end

