Step 15: Convert geologic-offset-rate table to NeoKinema input (f*.nki) format

The geologic-offset-rate table that we built in the last 4 Steps is essentially complete.
However, it is still in the proprietary format of a spreadsheet program (e.g., .docx for Microsoft Excel).
In this step we will convert it to a plain-ASCII, flat-file program that NeoKinema can read.

Inside your spreadsheet program (e.g., Microsoft Excel, or Apache OpenOffice Calc):

·       Change the header in cell B1 from “Sense” to “V” (because we are about to shrink the width of this column).

·       Click on any cell, then type Ctrl + A to select all the cells.

·       Right-click in that highlighted area and: Format / Cells / Font{tab} / Courier New, Bold, size 9 points.  (Note: If your spreadsheet does not offer Courier New font, then choose another “monospaced” font that is available; Wikipedia has a page called “List of monospaced typefaces” which may help you.)

·       Right-click on each Column label, and then set Column Width to an appropriate INTEGER value.  I suggest: Column A = 5, B = 2, C = 50; F = 2; the remainder should be set wide enough so that all your numbers are visible.

·       Save your spreadsheet (as usual) in the applications proprietary file format.

·       File / Save As… / Formatted Text (Space-delimited) (*.prn) / Save.

·       Close your spreadsheet program without saving again.  (No need.)

Now, open the new .prn file in a plain-ASCII text editor (such as NotePad or EditPad Pro).  {If you find that this file is marked Read-Only, that is because your spreadsheet application is still open.  Close it.}

Check that columns and their headers are aligned, and that numbers are not truncated. 
(To fix any big problems, return to your spreadsheet application, and reload the previous .docx version of the table file, and after fixing things, recreate the .prn.) 

Now, insert a new line at the top of the file.
In this line, create a Fortran FORMAT that will instruct NeoKinema how to read data-filled lines (rows) #3~last.
As a model for the FORMAT, consider this sample from the top of one of my f*. nki files:

(A6, 1X, A50, F12.3, F12.3, L2, F6.1, F6.1, F6.3, F6.3)
F0000V Descriptive text (50 bytes)....................... Offset-rate Sigma(mm/a)C? ULxKm LLxKm Floor Ceili
F0236N Abert Rim fault, OR                                      0.532       0.114 F   0.0  15.0 0.342 0.691
F0267N Acala fault, TX                                          0.042       0.123 F   0.0  15.0 0.019 0.332
F0151N Alamogordo fault, NM                                     0.023       0.458 F   0.0  15.0 0.011 0.153
F0277N Algodones fault zone, AZ                                 0.171       0.124 F   0.0  15.0 0.037 0.368

A Fortran FORMAT list is always enclosed in single parentheses ( … ).
It describes how to segment, and then interpret, a single line (row) of an ASCII input file.
You will notice that I have combined the former spreadsheet columns A & B into a single alphanumeric column containing “F0000V” which is now 6 characters wide (“A6”).
Also, I have followed this with a skipped space (“1X”) for readability.
The remaining FORMAT entries are either “A” for Alphanumeric/text (followed by the number of character), or
“L” for Logical (followed by the number of characters), or
“F” for Floating-point (followed by the total width in characters, a dot, and then the number of characters that should be considered to be to the right of the decimal point IF THE DECIMAL POINT IS MISSING).
Regarding that last confusing comment: Providing for the input of floating-point numbers that lack decimal points is an archaic feature of Fortran.  It has not actually been used since the days of IBM punch-cards.  You should not rely on it!  Be sure that all your floating-point numbers actually include a decimal point, and then your decimal points will override the “.m” part of any “Fn.m”-type FORMAT specifier.

Before you close this file, actually count the number of characters in each column, and confirm that it is equal to the width stated in the Fortran FORMAT.  Mismatches are a common cause of subtle, frustrating errors!

Now, Save the file (as simple ASCII text) with a name like f*.nki.  (Replace the “*” with any text that is meaningful to you.)

Lastly, use the same plain-ASCII text-editor application (e.g., NotePad or EditPad Pro) to open your NeoKinema-parameter file (first discussed in Step 8; an example was give as parameters_for_NeoKinema.nki.txt).
In line #12, replace “f_test01.nki” with the actual full name of the geologic-offset-rate table in f*.nki format which you just created!
Save the parameter file.