Matlab script for downloading from NCI.
close all
clear all
% extracting 2D and 3D (layer ll) variables from monthly files.
ll = 44;
for tt = datenum(2015,6,30):datenum(2015,6,30)
yy = datestr(tt,'yyyy');
mm = datestr(tt,'mm');
dd = str2num(datestr(tt,'dd'));
filepath = 'http://dapds00.nci.org.au/thredds/dodsC/fx3/gbr4_bgc_GBR4_H2p0_B2p0_Chyd_Dcrt/';
file = [filepath,'gbr4_bgc_simple_',num2str(yy),'-',num2str(mm),'.nc'];
xx = ncread(file,'longitude');
yy = ncread(file,'latitude');
zz = ncread(file,'zc',ll,1,1);
sim = ncreadatt(file,'/','title');
varstr = {'Chl_a_sum','Kd_490','EpiPAR_sg','DIN'};climmax = [2 0.1 12 2];
for vv = 1:length(varstr)
figure
units = ncreadatt(file,char(varstr(vv)),'units');
try
var = squeeze(ncread(file,char(varstr(vv)),[1 1 ll dd],[inf inf 1 1],[1 1 1 1]));
catch
var = squeeze(ncread(file,char(varstr(vv)),[1 1 dd],[inf inf 1],[1 1 1]));
end
time = ncread(file,'time',dd,1,1) + datenum(1990,1,1);
contourf(xx,yy,var(:,:),[0:climmax(vv)/10:climmax(vv)]);
cc = colorbar;axis equal;set(gca,'clim',[0 climmax(vv)]);colormap(jet(10));
title([sim,': ',char(varstr(vv)),' [',units,'], ',datestr(time,'HH:MM dd-mm-yy'),' depth = ',num2str(-zz), ' m'],'Interpreter','none');
end
end