Commit 1e8e1d39 authored by Dany Dumont's avatar Dany Dumont

Ajout du script ecmwf2gotm.m

parent 9995008e
function ecmwf2gotm(region,file,lon,lat,year)
% Format meteorological variables from ECMWF for GOTM.
%
% Variables:
% ECMWF2GOTM - Format meteorological variables from ECMWF for GOTM. It uses
% data archived on brandypot.uqar.ca. Variables are:
%
% T2M 2 meter temperature (degK)
% U10 10 meter zonal wind component (m/s)
......@@ -10,7 +9,9 @@ function ecmwf2gotm(region,file,lon,lat,year)
% MSL Mean sea level pressure (Pa)
% TCC Total cloud cover (0-1)
%
% Function arguments
% Syntax: ecmwf2gotm(region,file,lon,lat,year)
%
% Inputs:
%
% region 'pc' - Potter Cove
% 'ap' - Antarctic Peninsula and Weddell Sea
......@@ -23,13 +24,28 @@ function ecmwf2gotm(region,file,lon,lat,year)
% lat latitude in degrees_north (-90-90)
% year year to be extracted
%
% Outputs:
%
% output1 - Description
% output2 - Description
%
% Example:
% ecmwf2gotm('gsl',
%
% Other m-files required: Netcdf Toolbox
% Subfunctions: none
% MAT-files required: none
%
% See also: NARR2GOTM, NCEP2GOTM, ICEC2GOTM
%
% cf. data-portal.ecmwf.int/data/d/interim_daily/
% cf. GOTM
% Uses the netcdf toolbox
% Dany DUMONT
% 14/05/2011: Creation
% 24/01/2013: Standardized and adapted to the data file organization
% Author: Dany Dumont
% email: dany_dumont@uqar.ca
% Website: http://www.ismer.ca/dumont-dany
% May 2011; Last revision: 15-October-2014
% ______________________________________________________________________
yrstr = num2str(year);
......@@ -51,7 +67,7 @@ time = (init_date:6/24:init_date+nod-6/24)';
timevec = datevec(time);
%tlength = length(time);
datadir = ['/sas/usagers/dumoda01/shared/data/ecmwf/',region,'/6hourly/'];
datadir = ['/sas/usagers/share_lasso/data/ecmwf/',region,'/6hourly/'];
ncfile = [datadir,'ecmwf_',region,'_meteo_',yrstr,'.nc'];
hlon = double(nc_varget(ncfile,'longitude'));
......@@ -73,9 +89,9 @@ tol = 0.8;
i = find(hlon < lon + tol & hlon > lon - tol,1);
j = find(hlat < lat + tol & hlat > lat - tol,1);
if isempty(i) || isempty(j)
disp('** Error : Can not find the specified lat/lon location.' )
disp('** Error : Can''t find the specified lat/lon location. ')
disp('** Verify that you have specified the longitude in the')
disp('** [0-360] degree interval (e.g. 296 instead of -64)' )
disp('** [0-360] degree interval (e.g. 296 instead of -64). ')
return
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment