[ncl-talk] Reading str_split_csv function

Karin Meier-Fleischer meier-fleischer at dkrz.de
Fri Jan 30 03:06:07 MST 2015


Hi Amadou,

the error message is telling you exactly what is wrong:
line 80: you try to do a calculation using variables of type string.

You have to convert the variables to type integer using the NCL
built-in function toint:

   dir_2100       = *to**int*(str_get_cols(split_lines,78,81))
   spd_2100       = *to**int*(str_get_cols(split_lines,82,84))

Bye,
Karin

Am 30.01.15 um 10:39 schrieb Amadou Coulibaly:
> Dear NCL Users,
>
> I have a problem using str_split_csv function to read my data. If I 
> used this to calculate Zonal and Meridional components of winds, it 
> will show me an error message such as:
>
> fatal:Neg: operation not supported on type (string)
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 80 in 
> file split.ncl
>
> Can someone tell me how to solve this issue? Please find attached my 
> data and script.
>
> -- 
> *COULIBALY AMADOU *
> PhD Student  on  West  African  Climate  System (WACS)
> FUTA- Federal University  of Technology of Akure, Nigeria
>
> /Visiting Student - ///University of Cologne, Germany/
> //Institute of Geophysics and Meteorology/
> Pohligstr. 3 / Office 3.102
> D-50969 Köln
> /
> /
> _Project_: WASCAL(West African Science Service Centre on Climate 
> Change and Adapted Land Use)
> Phone:(+234) 810 795 2836 /(+223) 65 67 27 57 /(+226) 64 57 37 27 /+49 
> 15218352574
> E-mail: mpapin24 at gmail.com <mailto:mpapin24 at gmail.com>/ 
> coulibalya68 at yahoo.com <mailto:coulibalya68 at yahoo.com>
>
> "/The time is always right to do right": *Nelson Mandela*/
>
> /"Character is like a tree and reputation like a shadow.  The shadow 
> is what we think of it; the tree is the real thing" : *Abraham Lincoln*/
>
> /"Do what you can, with what you have, where you are" *Theodore 
> Roosevelt*/
>
> *//*
>
> **
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   meier-fleischer at dkrz.de
URL:      www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150130/49cda2da/attachment.html 


More information about the ncl-talk mailing list