Re: converting SYNOP meteorological code into readable observations

From: Andrew Dawson <dawson_at_nyahnyahspammersnyahnyah>
Date: Tue Nov 01 2011 - 07:17:31 MDT

Hi Chris,

When you use str_index_of_substr to set pres_test you have opt set to 0,
which means you get an array of the indexes of all matches. If there is
more than one match then pres_test will not be a scalar. This means that
the following if statement is invalid because it is expecting a scalar. You
need to refine your test for substrings I think, perhaps through
appropriate use of the any or all functions, or if you are only interested
in the first match then change the setting of opt (the last argument to
str_index_substr).

Anyway, hope that helps,

Andrew

On 1 November 2011 12:43, Christopher Steele
<christopher.steele@uea.ac.uk>wrote:

> Hi everyone
>
> I've been attempting to write a script to sort out some meteorological
> observations from their original synop form into something usable in the
> MET tools software. Unfortunately I keep coming across this error message:
>
> fatal:Conditional statements (if and do while) require SCALAR logical
> values, see all and any functions
> fatal:Execute: Error occurred at or near line 122 in file read_synop.ncl
>
>
> SYNOP code is a bit of a mess to interpret. Attached you will find a
> sample of the code and my ncl file to decode it.
>
> Hope someone can help
>
> cheers
>
> Chris
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Dr Andrew Dawson
Atmospheric, Oceanic & Planetary Physics
Clarendon Laboratory
Parks Road
Oxford OX1 3PU, UK
Tel: +44 (0)1865 282438
Email: dawson@atm.ox.ac.uk
Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 1 07:17:45 2011

This archive was generated by hypermail 2.1.8 : Tue Nov 01 2011 - 13:43:04 MDT