Perple_X Tab File Format In the 6.6.6 version of Perple_X, most output files written by WERAMI, and property tables generated by FRENDLY and FLUIDS, are written as 1- or 2-dimensional tables. These tables have the general format described below and are indicated by the file type suffix ".tab". 2d Tables In 2d tables, the columns correspond to properties tabulated as a function of two independent variables at regular intervals (e.g., mineral composition as a function of pressure and temperature). The columns of a 2d table can be contoured or viewed as a 3d surface as a function of its independent variables with PSTABLE (Perple_X), PYWERAMI (petrol.natur.cuni.cz/~ondro/pywerami:home), or Perple_X_plot (MatLab, perplex.ethz.ch/perplex/ibm_and_mac_archives/... MatLab_scripts_6.6.6.zip). Alternatively, if the header section of the tab file is deleted, the data can be imported into spreadsheet programs (e.g., Excel). Note that if you intend to import a table into a spreadsheet program it is essential that you set the keyword spreadsheet = T in perplex_option.dat. This option instructs WERAMI to write the independent variables in the first columns of the table. The MatLab script pt_2_vs changes the independent variables of 2d tables, e.g., if a table has been computed as a function of pressure and temperature, pt_2_vs can be used to convert the table to a table as a function of volume and entropy. 1d Tables In 1d tables, the columns correspond to properties tabulated as a function of one independent variable (e.g., mineral composition as a function of pressure and temperature along a geotherm). In contrast to 2d tables, the independent variable need not vary by a regular increment. All Perple_X programs and scripts assume irregular spacing of the independent variable and therefore output a column(s) containing the independent variable(s) of the calculation as well as the dependent properties. In this case the header information is largely superfluous and the number of variables is the number of columns and the number of rows in the table is the number or records in the file less the number of records in the header (see format details below). Any two columns of a 1d table can be plotted against each other with PSTABLE (Perple_X) or Perple_X_plot (MatLab, perplex.ethz.ch/perplex/ibm_and_mac_archives/... MatLab_scripts_6.6.6.zip). Alternatively, if the header section of the tab file is deleted, the data can be imported into spreadsheet programs (e.g., Excel). Tab Format Details Line 1 - the tag "|6.6.6", included in case of future format changes Line 2 - title Line 3 - n - number of independent variables For independent variable j = 1 -> n Line 4 + (j-1)*4 - name of jth independent variable Line 5 + (j-1)*4 - v0(i) - minimum value of jth independent variable Line 6 + (j-1)*4 - dv(i) - increment for jth independent variable Line 7 + (j-1)*4 - inc(i) - 1 + number of increments for jth independent variable Line 8 + 4n - m - number of dependent properties Line 9 + 4n - names of the m dependent properties For i=1,inc(n), j=1,inc(n-1), ..., l=1,inc(1) (inner index changing fastest) lines consisting of the m dependent properties at v(1) = v0(1) + (i-1)*dv(1), v(2) = v0(2) + (j-1)*dv(2),..., v(n) = v0(n) + (l-1)*dv(n) This format implies 5n+1 header lines and inc(1)*inc(2)...*inc(n) data records, each data record consisting of m entries. Reading Tab Files in Matlab The MatLab function script get_perple_x_file reads Perple_X tab files into Matlab.