Re: Possible Bug in numAsciiRow() of NCL4.2.0.a034

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 7 Dec 2006 12:50:36 -0700 (MST)

Hello

THX

[1] Yes, the space in numAsciiRow is a known bug. See
    http://www.ncl.ucar.edu/future_release.shtml
    
    Last entry in bug fixes.
    
[2] THX for the new "ncol" ... It will be used
    in the next release.
    
Regards
Dennis Shea
    
>
>I am using NCL Version 4.2.0.a034 64-bit on AIX.
>
>(1)
>I found the following problem with the function numAsciiRow():
> * There was no space after the "-l" option (thus wc was interpreting
> fNam as an option).
> * wc does not need the single quotes around it, but it doesn't hurt.
>
>Here is my update to the routine:
>
> function numAsciiRow (fNam:string)
> ;;; nrow_s = systemfunc("'wc' -l" + fNam +" | awk '{print }'" )
> nrow_s = systemfunc("wc -l " + fNam +" | awk '{print }'" )
>
>(2)
>Given the assumptions that the function numAsciiCol() makes, it could be
>simplified (and sped up ?) by using the following one-line command in
>place
>of its code which reads the entire file (via asciiread()):
>
> ncol = stringtointeger( systemfunc("head -1 "+fNam+" | wc -w") )
>
>VERSUS
>
> function numAsciiCol (fNam:string)
> tokens = stringtointeger( systemfunc("wc -w "+fNam) )
> filString = asciiread ( fNam, -1, "string")
> nrow = dimsizes(filString)
> ncol = tokens/nrow
>
>
>Thanks, Bruce
>
>P.S. The function numAsciiRow() uses a different logic in NCL
> version 4.2.0.a030, which is more like that of the current
> logic in numAsciiCol() (and works without error).
>
>
>=====
>Bruce Lunde
>Bruce.Lunde_at_navy.mil
>228-688-5843
>Code NP1
>Naval Oceanographic Office
>Stennis Space Center, MS
>=====
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk_at_ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 07 2006 - 12:50:36 MST

This archive was generated by hypermail 2.2.0 : Thu Dec 07 2006 - 16:52:37 MST