function result = read()

%READ read TROPFLUX file

%+
%
% .. _read.m:
%
% ======
% read.m
% ======
%
% DESCRIPTION
% ===========
% 
% read TROPFLUX file ${TROPFLUX_D}/TropFlux_19890101_20091231.nc
%
% plot ++
%
% EXAMPLES
% ========
%
% ::
%
%  octave> clear all
%  octave> tropflux_startup
%  octave> more off
%  octave> read
%
% SEE ALSO
% ========
%
% :ref:`tropflux_startup.m`
%
% TODO
% ====
%
% make it usable for real end-user
%
% not yet ok using TropFlux_19890101_20091231.nc (20110105)::
%
%   octave-3.2.3(26478) malloc: *** mmap(size=1288560640) failed (error code=12)
%   *** error: can't allocate region
%   *** set a breakpoint in malloc_error_break to debug
%   error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt
%
% same problem with TropFlux_q2m19890101_20091231.nc (20110105)::
%
%   iii : ouverture de /Users/fplod/Downloads/TropFlux_q2m_19890101_20091231.nc
%   octave-3.2.3(26675) malloc: *** mmap(size=1288560640) failed (error code=12)
%   *** error: can't allocate region
%   *** set a breakpoint in malloc_error_break to debug
%
% EVOLUTIONS
% ==========
%
% - fplod 20110105T163640Z aedon.locean-ipsl.upmc.fr (Darwin)
%
%   * creation to prevent Netcdf problem on TROPFLUX dataset
%     draft
%
%-
%
global application;
global application_version;

global TROPFLUX_ID;
global TROPFLUX_OD;
%
yyyymmdd_b=double(19890101);
yyyymmdd_e=double(20091231);
%++fullfilename=([TROPFLUX_ID  '/' 'TropFlux_' num2str(yyyymmdd_b,'%8.8d') '_' num2str(yyyymmdd_e,'%8.8d') '.nc']);
% ++ Pb memoire fullfilename=([ '/Users/fplod/Downloads'  '/'  'TropFlux_' num2str(yyyymmdd_b,'%8.8d') '_' num2str(yyyymmdd_e,'%8.8d') '.nc' ]);
fullfilename=([ '/Users/fplod/Downloads'  '/'  'TropFlux_' 'q2m' '_' num2str(yyyymmdd_b,'%8.8d') '_' num2str(yyyymmdd_e,'%8.8d') '.nc' ]);
file=netcdf(fullfilename,'nowrite');
disp(['iii : ouverture de ', fullfilename]);
clear fullfilename;

% read data
lon=file{'longitude'}(:);
lat=file{'latitude'}(:);
time=file{'time'}(:);
%++swr=file{'swr'}(:);
q2m=file{'q2m'}(:);
%
% close NetCDF file
ncclose(file);
clear file;

