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