source: Roms_tools/Forecast_tools/get_GFS_fname.m @ 8

Last change on this file since 8 was 8, checked in by cholod, 13 years ago

patch_romstools_15_04_2011.tar : UPDATES of Nesting_tools, Diagnostics_tools, Oforc_OGCM, Preprocessing_tools and Forecast_tools

File size: 2.1 KB
Line 
1function fname=get_GFS_fname(time,gfs_run_time,gfstype)
2%
3%  fname=get_GFS_fname(time,gfs_run_time)
4%
5%  Give the GFS url for a given date.
6%
7%  Further Information: 
8%  http://www.brest.ird.fr/Roms_tools/
9
10%  This file is part of ROMSTOOLS
11%
12%  ROMSTOOLS is free software; you can redistribute it and/or modify
13%  it under the terms of the GNU General Public License as published
14%  by the Free Software Foundation; either version 2 of the License,
15%  or (at your option) any later version.
16%
17%  ROMSTOOLS is distributed in the hope that it will be useful, but
18%  WITHOUT ANY WARRANTY; without even the implied warranty of
19%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20%  GNU General Public License for more details.
21%
22%  You should have received a copy of the GNU General Public License
23%  along with this program; if not, write to the Free Software
24%  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25%  MA  02111-1307  USA
26%
27%  Copyright (c) 2006 by Pierrick Penven
28%  e-mail:Pierrick.Penven@ird.fr 
29%
30%  Updated    9-Sep-2006 by Pierrick Penven
31%  Updated    20-Aug-2008 by Matthieu Caillaud & P. Marchesiello
32%
33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34%
35%url='http://nomads6.ncdc.noaa.gov:9090';
36%url='http://nomad5.ncep.noaa.gov:9090';
37url='http://nomad1.ncep.noaa.gov:9090';
38if gfstype==0
39  gfsname='gdas/rotating/gdas';
40  gfsname1='gdas';
41else
42  %========nomad1===========
43  gfsname='gfs_master/gfs';
44  gfsname1='gfs_master';
45 %========nomad5===========
46 % gfsname='gfs/gfs';
47 % gfsname1='gfs';
48end
49%
50% Get the date
51%
52[y,m,d,h,mi,s]=datevec(time);
53stry=num2str(y);
54if m<10
55  strm=['0',num2str(m)];
56else
57  strm=num2str(m);
58end
59if d<10
60  strd=['0',num2str(d)];
61else
62  strd=num2str(d);
63end
64%
65gfsdir=[url,'/dods/',gfsname,stry,strm,strd,'/'];
66gdasdir=[url,'/dods/',gfsname,stry,strm,strd];
67%
68% Get the grid
69%
70if gfs_run_time < 10
71  if gfstype==0
72    fname=[gdasdir,'0',num2str(gfs_run_time)];
73  else
74    fname=[gfsdir,gfsname1,'_0',num2str(gfs_run_time),'z'];
75  end
76else
77  if gfstype==0
78    fname=[gdasdir,num2str(gfs_run_time)];
79  else
80    fname=[gfsdir,gfsname1,'_',num2str(gfs_run_time),'z'];
81  end
82end
Note: See TracBrowser for help on using the repository browser.