[Thread Prev][Thread Next][Index]

Re: [ferret_users] format of numeric labels: 2.0 x 10^5 and xfor/yfor ?



Hi -
To answer your last question, yes, Ferret writes the number internally, using the Format you've given it (or an automatic format) resulting in the string "0.1E+05", and then that is translated to "0.1x10^5" for the axis labeling. This code also does other "beautification", adding a leading 0 if the string starts with just a . and adding labels for longitude or latitude and so on.

It'd be better if the internal write would just return **** for the format E8.0. For the Ferret version we have that runs on a PC, it does. But with the Linux compiler we're using, writing 100000 with the format (E8.0) gives back
" 0.1+0.1" .

I've thought sometimes we should have a bit more documentation about this formatting issue, as lots of people don't know Fortran these days. The PlotPlus graphics which Ferret adopted quite a while ago was written when Fortran was much more common!

Ansley

Ryo Furue wrote:
Hi Ansley,

Thank you for your message.

| It seems that (E8.0) is not a valid Fortran format description.
|
You must be right!  Although I'm not 100% sure that E8.0 is illegal
according the F77 standard, I can see that E8.0 doesn't make sense: If
such a thing were allowed, we'd end up with an output of "0.E5" from
any numbers like 0.1e5, 0.2e5, 0.3e5, . . .

| Ferret passes the format on to the Fortran WRITE statement [. . .]
|
So, does that mean that if Ferret obtains a character string like
"0.1E+05" from the WRITE, it converts it to "0.1x10^5" ?

Also, I guess the default format is 1PG8.1 or something like that
because we get labels like "2.0x10^5" by default (when the values are
large.)

Cheers,
Ryo


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement