[ncl-talk] Changing forecast time iteration for GFS
tschonholz
tschonholz at smn.gov.ar
Mon Feb 18 13:15:22 MST 2019
Hi Everybody, i have been looking for help but couldn´t find.
My gfs grib2 have forecast every 6 hs, so the name of the files are (for
example): gep19.t00z.pgrb2f384.grb2 in which 384 is the time of forecast
which comes by 6 hs.
I have this part of my lib_ensambleGFS.ncl:
function get_filelist_forecast(BASEDIR[1]:string, \
nens:numeric, \
y:numeric, \
m:numeric, \
d:numeric, \
h:numeric, \
hf:numeric)
local files,path_in,fname_in,dd,fdate, \
y_start,m_start,d_start,h_start, \
y_end,m_end,d_end,h_end
begin
hf at units = sprinti("hours since %0.4i-", y) + \
sprinti("%0.2i-", m) + \
sprinti("%0.2i ", d) + \
sprinti("%0.2i:00:00", h)
dd = ispan(1,nens,1)
if(hf.lt.0) then
;---Guess Case
hf = -1
fdate = ut_calendar(hf, 0)
y_start = tointeger(fdate(:,0))
m_start = tointeger(fdate(:,1))
d_start = tointeger(fdate(:,2))
h_start = tointeger(fdate(:,3))
y_end = y
m_end = m
d_end = d
h_end = h
else
;---Forecast Case
y_start = y
m_start = m
d_start = d
h_start = h
fdate = ut_calendar(hf, 0)
y_end = tointeger(fdate(:,0))
m_end = tointeger(fdate(:,1))
d_end = tointeger(fdate(:,2))
h_end = tointeger(fdate(:,3))
end if
path_in = sprinti("%0.4i", y_start) + \
sprinti("%0.2i", m_start) + \
sprinti("%0.2i", d_start) + \
sprinti("%0.2i/", h_start)
fname_in = "gep" + \
sprinti("%0.2i.t00z.pgrb2f", dd) + \
sprinti("%0.2i.grb2",h_end )
files = BASEDIR + "/gfs/" + \
path_in + \
fname_in
return files
end
-------------
Can anyone please help me to change the way it reads? I have
f06,12,18..and so on.
Thanks a lot! I am new to the program and want to improve.
Tamara.-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190218/04d70f9a/attachment.html>
More information about the ncl-talk
mailing list