Commit 1e8e1d39ddc7b5d43fe5993a345993a070cadbb8

Authored by Dany Dumont
1 parent 9995008e
Exists in master and in 1 other branch snow

Ajout du script ecmwf2gotm.m

Showing 1 changed file with 28 additions and 12 deletions   Show diff stats
scripts/matlab/ecmwf2gotm.m
1 1 function ecmwf2gotm(region,file,lon,lat,year)
2   -% Format meteorological variables from ECMWF for GOTM.
3   -%
4   -% Variables:
  2 +% ECMWF2GOTM - Format meteorological variables from ECMWF for GOTM. It uses
  3 +% data archived on brandypot.uqar.ca. Variables are:
5 4 %
6 5 % T2M 2 meter temperature (degK)
7 6 % U10 10 meter zonal wind component (m/s)
... ... @@ -10,7 +9,9 @@ function ecmwf2gotm(region,file,lon,lat,year)
10 9 % MSL Mean sea level pressure (Pa)
11 10 % TCC Total cloud cover (0-1)
12 11 %
13   -% Function arguments
  12 +% Syntax: ecmwf2gotm(region,file,lon,lat,year)
  13 +%
  14 +% Inputs:
14 15 %
15 16 % region 'pc' - Potter Cove
16 17 % 'ap' - Antarctic Peninsula and Weddell Sea
... ... @@ -22,14 +23,29 @@ function ecmwf2gotm(region,file,lon,lat,year)
22 23 % lon longitude in degrees_east (0-360)
23 24 % lat latitude in degrees_north (-90-90)
24 25 % year year to be extracted
25   -%
  26 +%
  27 +% Outputs:
  28 +%
  29 +% output1 - Description
  30 +% output2 - Description
  31 +%
  32 +% Example:
  33 +% ecmwf2gotm('gsl',
  34 +%
  35 +% Other m-files required: Netcdf Toolbox
  36 +% Subfunctions: none
  37 +% MAT-files required: none
  38 +%
  39 +% See also: NARR2GOTM, NCEP2GOTM, ICEC2GOTM
  40 +%
26 41 % cf. data-portal.ecmwf.int/data/d/interim_daily/
27 42 % cf. GOTM
28 43 % Uses the netcdf toolbox
29 44  
30   -% Dany DUMONT
31   -% 14/05/2011: Creation
32   -% 24/01/2013: Standardized and adapted to the data file organization
  45 +% Author: Dany Dumont
  46 +% email: dany_dumont@uqar.ca
  47 +% Website: http://www.ismer.ca/dumont-dany
  48 +% May 2011; Last revision: 15-October-2014
33 49 % ______________________________________________________________________
34 50  
35 51 yrstr = num2str(year);
... ... @@ -51,7 +67,7 @@ time = (init_date:6/24:init_date+nod-6/24)';
51 67 timevec = datevec(time);
52 68 %tlength = length(time);
53 69  
54   -datadir = ['/sas/usagers/dumoda01/shared/data/ecmwf/',region,'/6hourly/'];
  70 +datadir = ['/sas/usagers/share_lasso/data/ecmwf/',region,'/6hourly/'];
55 71  
56 72 ncfile = [datadir,'ecmwf_',region,'_meteo_',yrstr,'.nc'];
57 73 hlon = double(nc_varget(ncfile,'longitude'));
... ... @@ -73,9 +89,9 @@ tol = 0.8;
73 89 i = find(hlon < lon + tol & hlon > lon - tol,1);
74 90 j = find(hlat < lat + tol & hlat > lat - tol,1);
75 91 if isempty(i) || isempty(j)
76   - disp('** Error : Can not find the specified lat/lon location.' )
  92 + disp('** Error : Can''t find the specified lat/lon location. ')
77 93 disp('** Verify that you have specified the longitude in the')
78   - disp('** [0-360] degree interval (e.g. 296 instead of -64)' )
  94 + disp('** [0-360] degree interval (e.g. 296 instead of -64). ')
79 95 return
80 96 end
81 97  
... ... @@ -93,4 +109,4 @@ array = cat(2,timevec,u10,v10,msl,t2m,d2m,tcc);
93 109 fid = fopen(['ecmwf_',file,'_meteo_',yrstr,'.dat'], 'w');
94 110 fprintf(fid, '%4.0f-%02.0f-%02.0f %02.0f:%02.0f:%02.0f\t%3.2f\t%3.2f\t%4.1f\t%3.2f\t%3.2f\t%1.2f\n', ...
95 111 array');
96 112 -fclose(fid);
  113 +fclose(fid);
97 114 \ No newline at end of file
... ...