source: Roms_tools/Forecast_tools/get_GFS_fname.m @ 1

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

import Roms_Agrif

File size: 2.0 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://nomad3.ncep.noaa.gov:9090';
37url='http://nomad1.ncep.noaa.gov:9090';
38if gfstype==0
39  gfsname='gdas/rotating/gdas';
40  gfsname1='gdas';
41else
42  gfsname='gfs_master/gfs';
43  gfsname1='gfs_master';
44end
45%
46% Get the date
47%
48[y,m,d,h,mi,s]=datevec(time);
49stry=num2str(y);
50if m<10
51  strm=['0',num2str(m)];
52else
53  strm=num2str(m);
54end
55if d<10
56  strd=['0',num2str(d)];
57else
58  strd=num2str(d);
59end
60%
61gfsdir=[url,'/dods/',gfsname,stry,strm,strd,'/'];
62gdasdir=[url,'/dods/',gfsname,stry,strm,strd];
63%
64% Get the grid
65%
66if gfs_run_time < 10
67  if gfstype==0
68    fname=[gdasdir,'0',num2str(gfs_run_time)];
69  else
70    fname=[gfsdir,gfsname1,'_0',num2str(gfs_run_time),'z'];
71  end
72else
73  if gfstype==0
74    fname=[gdasdir,num2str(gfs_run_time)];
75  else
76    fname=[gfsdir,gfsname1,'_',num2str(gfs_run_time),'z'];
77  end
78end
Note: See TracBrowser for help on using the repository browser.