Closed briochemc closed 2 years ago
Good suggestions @briochemc, thanks! Have separated the repo now here: https://github.com/mvdh7/CO2System.jl The modification to the main function sounds like a good idea, but Julia is not my focus right now, and it will be quite some time before I can look at this - would be happy to incorporate it if someone else has time! Perhaps you could add it as an issue to the new repo.
I could not submit an issue on @mvdh7's CO2System.jl repository likely because it is a fork of this repository. Would it make sense to split the Julia version completely and cut the umbilical cord tying it to this MATLAB version?
FWIW, for the Julia version, I wanted to suggest converting the main function, which takes scalars or arrays as input, into a function that takes only scalars as inputs. I think a scalar function, called e.g.,
co2sys(args...)
, would have many advantages over the current version (in Julia). Note that a scalar function would be easy to broadcast to arrays with Julia's dot syntax, e.g., for a simple example:Another potential gain is that the code would be simpler (e.g., less lines of code because no need for all the array treatment, the allocations, and so on). Furthermore, it might be computationally more efficient because, e.g., no need to reallocate the boolean indices array
F
dozens of times. (Although efficiency would need to be benchmarked against the current vectorized version I guess.)Don't hesitate to close if these are stupid ideas! 😅