Georgia Tech Ocean and Climate Data Server

 
MATLAB OpenDAP Client Toolbox
The following toolboxs are needed to use Matlab as a client:
[ POBEX | SNCTOOLS ]
Example of code:
% MATLAB example to load data from the GaTech OpenDAP server (E. Di Lorenzo, 3/10/2010)
 
% Browse data archive to find relevant output at:
% http://data.eas.gatech.edu
 
% ----------------------------------------------------------------
% STEP 1: Load grid (need to do this only once)
% ----------------------------------------------------------------
 
grd=gridload('http://nas.o3d.org:8080/thredds/dodsC/nepd/nepd_forc_full_monthly_avg.nc');
% Compute depths of terrain following coordinate
[zr,zw,hz]=setdepth(0,grd);
 
% Assign file containing variable of interest -- browse
file='http://nas.o3d.org:8080/thredds/dodsC/nepd/nepd_forc_full_monthly_avg.nc';
 
% ----------------------------------------------------------------
% STEP 2: Load time records
% ----------------------------------------------------------------
 
% Load the available times (year 2006, 2007)
time=nc_varget(file, 'ocean_time');
% Create MATLAB datnum array
refyear=1950;
mydatenum=datenum(refyear,0, 0)+time/(60*60*24);
% Convert MATLAB datenum in years, months, days
year=str2num( datestr(mydatenum,10) );
month=str2num( datestr(mydatenum,5) );
day=str2num( datestr(mydatenum,7) );
 
% ----------------------------------------------------------------
% STEP 3: Select space/time locations where to extract profile
% ----------------------------------------------------------------
 
x=-140; y=35; % Example 1 (x=lon; y=lat)
% Find the closest model point to the selected location
dist = (grd.lonr - x).^2 + (grd.latr - y).^2;
[I,J]=find( dist == min(dist(:)));
% Select the Months of Feb/Mar
itimes=find(month == 2 | month ==3);
% Assign depths for location I, J
depths=squeeze(zr(I,J,:));
 
% ----------------------------------------------------------------
% STEP 4: Extract profile and plot
% ----------------------------------------------------------------
 
% Open a figure
figure('menubar','none','toolbar','none')
set(gcf,'PaperPositionMode','auto');
% Make a quick animation loop on the profiles for Feb/Mar
for tstep=itimes(1);
T=nc_varget(file, 'temp', [tstep-1 0 J-1 I-1], [1 -1 1 1]) ;
S=nc_varget(file, 'salt', [tstep-1 0 J-1 I-1], [1 -1 1 1]) ;
clf;
plot(T, depths)
title(datestr(mydatenum(tstep)));
disp('Press return to continue, CTRL-C to stop - ');
end
 
% ----------------------------------------------------------------
% STEP 5: Extract and plot ssh
% ----------------------------------------------------------------
 
zeta=nc_varget(file, 'zeta', [tstep-1 0 0], [1 -1 -1]) ;
pcolorjw(grd.lonr, grd.latr, zeta'.*grd.maskr); colorbar

 
Maintained by E. Di Lorenzo, C.S. Young, and V. Combes
School of Earth and Atmospheric Sciences
©2010 Georgia Institute of Technology :: Atlanta, Georgia 30332