strings questions

From: Kate Hedstrom <kate_at_nyahnyahspammersnyahnyah>
Date: Wed, 20 Sep 2006 10:45:28 -0800

I have an NCL program to convert a grid created by gridgen
( into a format that ROMS can use.
There are a few nagging things about string handling that I'm not
100% happy with. First of all, we want to have:

        char spherical ;
              spherical:long_name = "Grid type logical switch" ;

and instead I have:

        ncl10 = 2 ;

        char spherical(ncl10) ;
              spherical:long_name = "Grid type logical switch" ;

Is there any way to have a scalar character?

Second, I was hoping to have a string (or character array) that is
dimensioned (/ bath, stringlen /) with bath being an unlimited
dimension. I'm using the unlimited dimension to contain working
bathymetries and would like a description of each one. Here is what
did and didn't work:

    filedimdef(ncid, "bath", -1, True)
; delete(dims)
; filedimdef(ncid, "stringlen", 80, False)
; dims = (/ "bath", "stringlen" /)
; filevardef(ncid, "bath_history", "character", dims)
; str = new((/ 80 /), "character")
; str = stringtochar("Flat bottom")
; ncid->bath_history(0,:) = str
    fileAtt = True
    fileAtt_at_bath_history_0 = "Flat bottom"
    fileattdef(ncid, fileAtt)

The commented out code complained about a mismatch in array lengths.

Third, the next step is an inverse map projection. NCAR graphics
provides access to mapinv but I'm not finding anything similar in
NCL. I was hoping to avoid using WRAPIT and requiring extra packages
if at all possible, plus I want the double precision of NCL.


Kate Hedstr´┐Żm       Arctic Region Supercomputing Center       University of Alaska, Fairbanks
Phone: 907-450-8678
ncl-talk mailing list
Received on Wed Sep 20 2006 - 12:45:28 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 25 2006 - 11:45:07 MDT