Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Dany Dumont
gotm_ismer
Commits
1e8e1d39
Commit
1e8e1d39
authored
Oct 23, 2014
by
Dany Dumont
Browse files
Ajout du script ecmwf2gotm.m
parent
9995008e
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/matlab/ecmwf2gotm.m
View file @
1e8e1d39
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
...
...
@@ -22,14 +23,29 @@ function ecmwf2gotm(region,file,lon,lat,year)
% lon longitude in degrees_east (0-360)
% 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
no
t 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
...
...
@@ -93,4 +109,4 @@ array = cat(2,timevec,u10,v10,msl,t2m,d2m,tcc);
fid
=
fopen
([
'ecmwf_'
,
file
,
'_meteo_'
,
yrstr
,
'.dat'
],
'w'
);
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'
,
...
array
'
);
fclose
(
fid
);
fclose
(
fid
);
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment