PhreeqcUsers Discussion Forum

USER_PUNCH/USER_GRAPH => BASIC functions => Topic started by: khwee on September 28, 2021, 02:17:29 PM

Title: Distribution of alkalinity
Post by: khwee on September 28, 2021, 02:17:29 PM
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!
Title: Re: Distribution of alkalinity
Post by: dlparkhurst on September 28, 2021, 06:28:47 PM
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.
Title: Re: Distribution of alkalinity
Post by: khwee on September 29, 2021, 09:53:45 AM
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.