[gradsusr] ECMWF Data Issues

AMS EmsiWx Bytča emsiwx at pocasie-bytca.sk
Fri Mar 25 12:43:02 EDT 2016


Oh, I missed, this is the way I download under Win:

@ECHO OFF
set FileDate=%date:~9,4%%date:~6,2%%date:~3,2%
set FileTime=%time:~0,2%

for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do 
set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%"
set "Min=%dt:~10,2%"
set "Sec=%dt:~12,2%"

set FileDate=%YYYY%%MM%%DD%
set timestamp=%HH%%Min%%Sec%
set FileTime=%HH%
set fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%

set FD=%FileDate%
if /i %FileTime% gtr 06 (set T=00)
if /i %FileTime% gtr 18 (set T=12)
@echo Year = %FD%
@echo Time = %FileTime%
echo %T%

wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000_an_msl_global_0p5deg_grib2.bin
rename *%FD%%T%0000_an_msl_global_0p5deg_grib2.bin 
%FD%%T%00000000_C_ECMF_%FD%%T%0000_0h_msl_global_0p5deg_grib2.bin
wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000*h_msl_global_0p5deg_grib2.bin
rename *%FD%%T%0000*h_msl_global_0p5deg_grib2.bin 
%FD%%T%0000*h_msl_global_0p5deg_grib2.bin
cat %FD%%T%0000*h_msl_global_0p5deg_grib2.bin > mslp.bin

perl g2ctl.pl -verf mslp.bin > mslp.ctl
gribmap -i mslp.ctl -e

opengrads -lbxc 'ecmwf_tlak.gs %FD% %T%'


wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000_an_t_850hPa_global_0p5deg_grib2.bin
rename *%FD%%T%0000_an_t_850hPa_global_0p5deg_grib2.bin 
%FD%%T%00000000_C_ECMF_%FD%%T%0000_0h_t_850hPa_global_0p5deg_grib2.bin
wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000*h_t_850hPa_global_0p5deg_grib2.bin
rename *%FD%%T%0000*h_t_850hPa_global_0p5deg_grib2.bin 
%FD%%T%0000*h_t_850hPa_global_0p5deg_grib2.bin
cat %FD%%T%0000*h_t_850hPa_global_0p5deg_grib2.bin > t850.bin

perl g2ctl.pl -verf t850.bin > t850.ctl
gribmap -i t850.ctl -e

opengrads -lbxc 'ecmwf_t850.gs %FD% %T%'


wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000_an_gh_500hPa_global_0p5deg_grib2.bin
rename *%FD%%T%0000_an_gh_500hPa_global_0p5deg_grib2.bin 
%FD%%T%00000000_C_ECMF_%FD%%T%0000_0h_gh_500hPa_global_0p5deg_grib2.bin
wget --ftp-user=wmo --ftp-password=essential 
ftp://data-portal.ecmwf.int/%FD%%T%0000/*%FD%%T%0000*h_gh_500hPa_global_0p5deg_grib2.bin
rename *%FD%%T%0000*h_gh_500hPa_global_0p5deg_grib2.bin 
%FD%%T%0000*h_gh_500hPa_global_0p5deg_grib2.bin
cat %FD%%T%0000*h_gh_500hPa_global_0p5deg_grib2.bin > geopot500.bin

perl g2ctl.pl -verf geopot500.bin > geopot500.ctl
gribmap -i geopot500.ctl -e

opengrads -lbxc 'ecmwf_geopot.gs %FD% %T%'

del 20*.bin


M.

Dňa 25. 3. 2016 o 17:01 stuart markham napísal(a):
>
> Thanks Marian,
>
>
> Adjusting the pres did the trick thanks. Out of interest i am 
> downloading via this link ftp://data-portal.ecmwf.int/ but using an 
> script you designed to download the gfs with, example below. Would you 
> have an easier way of downloading data daily? Ive only come across 
> this today. Many thanks
>
>
>
>
> :024
> wget -O ecmwf_24.grb 
> ftp://wmo:essential@data-portal.ecmwf.int/20160325000000/A_HHXE50ECMF250000_C_ECMF_20160325000000_24h_gh_500hPa_global_0p5deg_grib2.bin 
> ftp://wmo:essential@data-portal.ecmwf.int/20160325000000/A_HPXE89ECMF250000_C_ECMF_20160325000000_24h_msl_global_0p5deg_grib2.bin
> IF %ERRORLEVEL% NEQ 0 @ECHO Waiting for file... & TIMEOUT /T 180 & 
> GOTO 024
>
>
>
> ------------------------------------------------------------------------
> *From:* gradsusr-bounces at gradsusr.org <gradsusr-bounces at gradsusr.org> 
> on behalf of AMS EmsiWx Bytča <emsiwx at pocasie-bytca.sk>
> *Sent:* 25 March 2016 14:06
> *To:* GrADS Users Forum
> *Subject:* Re: [gradsusr] ECMWF Data Issues
> Stuart,
>
> This one does not seem correct to me:
>
> 'define PRESmsl = PRESmsl*0.01'
>
> replace with e.g.
>
> 'define PRES = PRESmsl*0.01'
>
> I am not sure if that helps you to get all time steps, but for sure on 
> t=2 you would not get correct pressure contours.
>
> Let me know how it goes, and please show me how you get the ecmwf grib.
>
> M.
>
> Dňa 25. 3. 2016 o 13:33 stuart markham napísal(a):
>>
>> Hi Marian,
>>
>>
>> I've attached the full script for you, many thanks for your help.
>>
>>
>> regards,
>>
>>
>> Stuart.
>>
>>
>>
>> ------------------------------------------------------------------------
>> *From:* gradsusr-bounces at gradsusr.org <gradsusr-bounces at gradsusr.org> 
>> on behalf of AMS EmsiWx Bytča <emsiwx at pocasie-bytca.sk>
>> *Sent:* 25 March 2016 11:56
>> *To:* GrADS Users Forum
>> *Subject:* Re: [gradsusr] ECMWF Data Issues
>> Hi Stuart,
>>
>> in your script you are opening a GFS control file... Replace with (I 
>> suppose) ecmwf_grib.ctl . And I can't see where you change the t 
>> (time), Can you please show me the rest of your script?
>>
>> Regards,
>>
>> Marian
>>
>>
>> Dňa 25. 3. 2016 o 12:11 stuart markham napísal(a):
>>>
>>> Hi all,
>>>
>>>
>>> I'm currently developing charts using ecmwf free data  but I'm 
>>> having an issue with the time steps. The first image is fine but the 
>>> rest of the time steps use the same data as the first one. The 
>>> charts are not running in sequence. Can anybody advise where my 
>>> issues are. I've attached parts of my control file and script to 
>>> assist.
>>>
>>>
>>>
>>> dset ^ecmwf_grib.grib2
>>> index ^ecmwf_grib.grib2.idx
>>> undef 9.999E+20
>>> title ecmwf_grib.grib2
>>> * produced by g2ctl v0.0.8.8
>>> * command line options: -verf ecmwf_grib.grib2
>>> * griddef=1:0:(720 x 361):grid_template=0:winds(N/S): lat-lon 
>>> grid:(720 x 361) units 1e-06 input WE:NS output WE:SN res 48 lat 
>>> 90.000000 to -90.000000 by 0.500000 lon 0.000000 to 359.500000 by 
>>> 0.500000 #points=259920:winds(N/S)
>>>
>>> dtype grib2
>>> ydef 361 linear -90.000000 0.5
>>> xdef 720 linear 0.000000 0.500000
>>> tdef 11 linear 00Z25mar2016 1dy
>>> zdef 1 linear 1 1
>>> vars 2
>>> HGT500mb   0,100,50000   0,3,5 ** 500 mb Geopotential Height [gpm]
>>> PRESmsl  0,101   0,3,0 ** mean sea level Pressure [Pa]
>>> ENDVARS
>>>
>>>
>>> ---------------------------------------------------------------------------------------------------------------------------------------------------------------- 
>>>
>>>
>>>
>>>
>>>
>>> 'reinit'
>>> 'open gfs_grib.ctl'
>>>
>>> * Get info from the descriptor file
>>> 'q ctlinfo'
>>> _ctl = result
>>> _undef = getctl(undef)
>>> _tdef = getctl(tdef)
>>> _zdef = getctl(zdef)
>>>
>>> maps = 25
>>>
>>> * Get the Time axis info
>>> tsize = subwrd(_tdef,2)
>>> _t1 = 1       ;* 2nd half of timeseries
>>> _t2 = 45
>>> tsize = _t2 - _t1 + 1
>>> 'set t '_t1' '_t2
>>> 'q dims'
>>> times  = sublin(result,5)
>>> _time1 = subwrd(times,6)
>>> _time2 = subwrd(times,8)
>>> _tdim = _time1' '_time2
>>>
>>> tincr = subwrd(_tdef,5)
>>> _tdef = 'tdef 'tsize' linear '_time1' 'tincr
>>>
>>> huh = subwrd(_tdef,4)
>>>
>>> Best regards,
>>>
>>> Stuart.
>>>
>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160325/b8221aed/attachment.html 


More information about the gradsusr mailing list