In write_matrix, I would like to suppress the decimal point on some
of the numbers printed. Is there a trick with the Fortran-style
format string that would do this?
I am trying to simulate a mix of integers and reals to display a
mask array like this:
fmtf = "f6.1, 2x, 12f2"
write_matrix (index_plus_mask, fmtf, option)
12.0 1 1 1 0 0 0 0 0 0 0 0 0
11.5 1 1 1 1 1 0 0 0 0 0 0 0
11.0 0 1 1 1 1 1 0 0 0 0 0 0
10.5 0 0 1 1 1 1 1 0 0 0 0 0
10.0 0 0 0 1 1 1 1 1 0 0 0 0
9.5 0 0 0 0 1 1 1 1 1 0 0 0
9.0 0 0 0 0 0 1 1 1 1 1 0 0
But this is what I actually get, because the format "f2" or "f2.0"
always inserts a decimal point:
12.0 1.1.1.1.1.0.0.0.0.0.0.0.
11.5 0.1.1.1.1.1.0.0.0.0.0.0.
"i2" format does not work; it is illegal use with my floating point
numeric array.
I can get the display I want with a more complicated string
algorithm. I am just wondering whether there is a simple formatting
trick for this in write_matrix. Thanks for any insights.
Dave Allured
CU/CIRES Climate Diagnostics Center (CDC)
http://cires.colorado.edu/science/centers/cdc/
NOAA/ESRL/PSD, Climate Analysis Branch (CAB)
http://www.cdc.noaa.gov/
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 03 2008 - 13:16:35 MDT
This archive was generated by hypermail 2.2.0 : Fri Apr 04 2008 - 08:43:08 MDT