Appendix 2: Example matlab script for current meter data

A matlab macro to read the netCDF file 'rcm01037.cdf' found in the WOCE CD ROM 2. This file is the equivalent of the Fortran code listed in Appendix 1. Note that this macro routine can be easily generalised to read all of the current meter data records on this CD set.

%

% A simple Matlab script to read the RCM netcdf file.

%

% Author: Nathan Bindoff

% Date: 28 March 2000

% The script uses Jim Mansbridge's netcdf routines for matlab.

%

% Documetation and description of these routines can be found at

% http://www.marine.csiro.au/sw/matlab-netcdf.html.

%

%

% Read the current meter data

%

inqnc('rcm01037')

%

%

file='rcm01037'

%

%

date=getcdf(file,'time');

time=getcdf(file,'time');

speed=getcdf(file,'speed');

direction=getcdf(file,'direction');

u=getcdf(file,'u');

v=getcdf(file,'v');

temperature=getcdf(file,'temperature');

pressure=getcdf(file,'pressure');

%

% Example of contents of inqnc('rcm01037')

%

%

% --- Global attributes ---

%experiment_name: Deep Currents (PCM6)

%mooring_name: WHOI 947

%pi_name: B.Owens/B.Warren

%instrument_type: VACM

%latitude: 40.6000

%longitude: 147.3492

%instrument_depth: 1999.0 m

%seafloor_depth: 5280 m

%sampling_interval: 30 min

%earliest_start_time: 12-jun-1993 12:15:00

%latest_stop_time: 01-jul-1995 12:45:00

%null_value: -999.9

%

%The 1 dimensions are 1) time = 35954.

%time is unlimited in length

%

%----- Get further information about the following variables -----

%

% -1) None of them (no further information)

% 0) All of the variables

% 1) date 2) time 3) speed

% 4) direction 5) u 6) v

% 7) temperature 8) pressure