[gradsusr] Bat file

Becker, Bernd bernd.becker at metoffice.gov.uk
Tue Jul 21 05:07:11 EDT 2015


switch to Linux or run grads under Cygwin.

-----Original Message-----
From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Chorley Weather
Sent: 20 July 2015 19:05
To: gradsusr at gradsusr.org
Subject: [gradsusr] Bat file


Hi guys,

Complete stab in the dark here but I've hit a brick wall. I'm trying to run my bat file using the script below, but it is returning an error (see attached image). My gs script runs fine when i input the date manually, for example 20150720 06, but as you can see from the image, the bat file is not pulling the date correctly. Any help would be greatly appreciated.


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

if /i %FileTime% gtr 00 (
set T=12
set /a FD=%FileDate% - 1
)
if /i %FileTime% gtr 01 (
set T=18
set /a FD=%FileDate% - 1
)
if /i %FileTime% gtr 05 (
set T=00
set FD=%FileDate%
)
if /i %FileTime% gtr 11 (set T=06)
if /i %FileTime% gtr 17 (set T=12)
@echo Year = %FD%
@echo Time = %FileTime%
echo %T%

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


Best regards,

Stuart Markham
--
Chief Forecaster & Owner



More information about the gradsusr mailing list