USER_PUNCH/USER_GRAPH > BASIC functions

Distribution of alkalinity

(1/1)

khwee:
Dear all,

The keyword PRINT gives an option to show the list of species that contributes to alkalinity, but is there a way to punch the list to a file via USER_PUNCH instead?  If there is no such an option, then is there a Basic function similar to SYS("aq"), that could be used to query and output the list into an array, along with their molarity and Alk/Mol?

Thanks so much for your help!

dlparkhurst:
Sorry, there is no function to get the alkalinity of a species.

All I could come up with is to make a lookup table between species name and alkalinity in USER_PRINT or USER_PUNCH. The following program uses brute force to allow you to calculate the alkalinity contribution of each species for the phreeqc.dat database.

The code includes a list of all elements in the periodic table as a means of finding all of the species in the database. I ran the code with the phreeqc.dat database and then edited the Alkalinity Distribution output data block to get the names and alkalinities for all alkalinity species. I  then wrote the USER_PRINT data block using a DATA statement in Basic. Not pretty (or efficient), but it will work if you really need the distribution of alkalinity.

khwee:
Thanks so much for your help dlparkhurst!

Yes, it is not as elegant as a Basic function, but it certainly will work for my use case.  Really appreciate your help putting this together so quickly.

swhit:
Hello, I get a 404 error when I try to dowload this attachment.  Would it be possible to post a reply with the text of the code?

Thanks!

dlparkhurst:
Sorry, but no. All of the attachments seem to be lost in this forum.

All I can suggest is to use the -alk option of the PRINT data block to get the alkalinity contribution of each species in your system. You can also write the total alkalinity to a selected output file with a SELECTED_OUTPUT option or the Basic function ALK in USER_PUNCH.

Navigation

[0] Message Index

Go to full version