% Template to create netCDF file in EPIC format
% from evenly spaced time series data

%1.  File Name
cdf_name= 'androscoggin.cdf';   
 
%2.  Variable names, data and units
var_names=['androscoggin'];
load androscoggin.dat
var(:,1)=androscoggin(:,5)*4.381264e-02;   % convert mgd to m3/s
units='m3/s';

%3.  Lat,Lon vectors for variables 
lat=  44.07222;
lon= -70.208611;

%4.  Start time and time interval
start= [1928 11 8 12 0 0];     %[yyyy mm dd hr mi sc]
dt= 3600*24;    % delta t in seconds

%5.  Water Depth and Instrument Depth
wdepth=0.;   % water depth
idepth=0.;   % instrument depth

%6.  Comment
cmt='Created from the data Harry gave me';

create_epic(cdf_name,var,var_names,lat,lon,start,dt,wdepth,idepth,units,cmt);
