Talk:Compact format

From Cybis Wiki
Jump to navigation Jump to search

I find the usage of this Fortran-related format " -2(26F3.0)~" a bit puzzling...

Found this through a Google-search: It is related to Fortran format specification:

where w is the width of the variable and d is the number of decimal places to the right of the (implied) decimal point. 
For example, F4.0 would read a four digit number with no implied decimal places. (When there are no implied decimal places, 
as in the case of F4.0, the format description can be simplified to F4 alone.) 
If, however, the data are written with an implied decimal, the user can specify a decimal point to the left of the last d digits. 
Thus F4.2 would read `6743' as `67.43' while F4.1 would read `6743' as `674.3'. 
Any decimal actually coded in the data overrides the format specification. 

With the format 26(F3.0) of the compact format specification and a 78 characters long data line like this


I had expected that the first value "280" should be decoded as the integer value 280. With the specification F3.1 I had expected the value to be decoded as 28.0 and with F3.2 as 2.80

Now we have "F3.0". To make "280" into a reasonable ring width value I have to divide it with 100.

Then if we have the format specification F4.0 how should then the string "2802" be understood as a ring width value? As 2.802 or as 28.02 If the correct version is 2.802, then it is correct to state that values >= 10 cannot be written in Compact format.

Is there a program to test that can write Compact format with different format specifications but using the same data so we can be sure about how the Compact format works? /Lars-Ake

Here is probably an answer to my question, an example with "F4.0". See

As I understand it the example "2802" using "F4.0" should be understood as the ring width value 2.802

Also meaning that we cannot store ring widths >= 10 in Compact format. --Lars-Ake 15:17, 2 January 2010 (UTC)

Noted that in the last example the format string is "-3(20F4.0)~" Then what does that "-3" specify? The actual number of decimals??? If so it should be carefully decoded.

Yes, it is possibly a scaling factor! I.e. 10**(-3) = 0.001 times each of the following 20 "four-characters wide" integers. --Lars-Ake 16:05, 2 January 2010 (UTC)