speciesvsph.inc

PRINT
  -reset false

SELECTED_OUTPUT
  -high_precision       true
  -reset                false

# Used to generate data for a %species vs pH plot.
# The 'mainSpecies' keyword in the input file is used to set the main species (sets the "<mainspecies>" tag).
# Writes successive 'species names-value' pairs to the 'out' file.
# These are plotted with a custom plot.
# The species always starts with the x-axis variable (here pH) then all the other main component
# species in descending abundance order returning relative amounts (% of total) for each species.
# line 50 filters out H and O species.
#
# The input file
# 
# "<mainspecies>" must be set to the 'element' of interest, or "elements" for counting at the 'elements' level. # 'customXcolumn' must be set to the column where the pH is written, as here in column 2 # USER_PUNCH -start 10 main$ = "<mainspecies>" 20 PUNCH "pH", -LA("H+") 30 totel = SYS(main$, n, n$, t$, c) 40 FOR i = 1 TO n 50 IF(MID$(n$(i), 1, 2) = "H(" OR MID$(n$(i), 1, 2) = "O(" OR n$(i) = "O" OR n$(i) = "H") THEN 100 60 IF(t$(i) = "equi") THEN 70 ELSE 90 70 IF (instr(n$(i),"(g)")=0) THEN PUNCH n$(i)+"(s)", 100*c(i)/totel ELSE PUNCH n$(i), 100*c(i)/totel 80 GOTO 100 90 PUNCH n$(i), 100*c(i)/totel 100 NEXT i -end