Coder Social home page Coder Social logo

rivm-syso / ops Goto Github PK

View Code? Open in Web Editor NEW
15.0 13.0 7.0 891 KB

Operationele Prioritaire Stoffen model

Home Page: https://www.rivm.nl/operationele-prioritaire-stoffen-model

License: GNU General Public License v3.0

Fortran 98.92% CMake 0.88% Shell 0.20%
air-quality deposition air-pollution chemical-transport-model

ops's People

Contributors

rivm-ops avatar stikstofje avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ops's Issues

Consider use of improved double precision to reduce cumulative errors

The code modules all use REAL*4 currently, which is (when I am correct) a single precision 32-bit floating decimal number.

For instance in ops-convec.f90:

  • REAL*4 z0
  • REAL*4 zi

I consider OPS a weather-related calculation model. As far as I know most of these nowadays use 64-bit double precision numbers for calculations. Especially during a large number of calculation steps, precision may get lost or unacceptable cumulative errors may be introduced.

From the historical perspective on 1989, I can imagine that an array with 100K numbers might have been hard to fit into memory of a HP/DEC workstation or time sharing solution, but nowadays a double precision no longer has to incur extra memory costs.
Back then, a FPU (when present) might have similated double precision using multiple single precision calculations or the main processor might have similated them. Nowadays, double precision is seen more often than single precision both in hardware as software from where I stand.

A related issue is created regarding estimating cumulative errors and to assess whether they do not influence the accuracy of the model as documented on the RIVM website.

Unnecessary personal details

The current release contains change notes with the names of persons no longer involved in developing and/or maintaining the code base.

These are quite hard to remove completely thanks to git but maybe a good start would be to remove them from next release.

Document estimated rounding errors

Related to #4.

The current code uses single precision numbers. But even with arbitrary precision numbers, cumulative errors can be introduced when executing many calculation steps and using the output of previous steps as input to next steps. Programmers typically need to take care that numeric errors do lead to outcomes with an accuracy outside of the pre-established required accuracy.

The current code does not ground-up document the rounding errors in terms of precision lost during the process; it may be documented elsewhere.

Also, it seems that during the evolution from the historical code into the current version the scope has been extended to a finer matrix resolution. Maybe the original code was checked for rounding errors, but such a scope change may require additional checks. These might also have been done outside of the code.

A little overly dramatic sample of the past when still studying at EUT was the Patriot software issue as documented on https://hownot2code.com/2016/11/09/r-17-vs-patriot-a-rounding-issue-bugs-in-a-missile-defense-system/.

Suggestion is to extend each method by some documentation assessing the precision loss, allowing top level determination of the accuracy boundaries of the model and whether they fall within the acceptable range.

Toevoegen achtergrond publiek maken model

Voor beter begrip van de context zou het openbaar maken van het openbaarmaken van Aerius en OPS helpen.

Mogelijk is de oorzaak beschreven in https://uitspraken.rechtspraak.nl/inziendocument?id=ECLI:NL:RBDHA:2019:13779, maar mogelijk eerdere of latere besluiten, binnen RIVM, ministeries of rechter, hebben hiertoe geleid. Als buitenstaander is best lastig om de historie te bepalen op basis van nieuwsartikelen zoals https://www.omropfryslan.nl/nl/nieuws/927198/rechter-rivm-moet-rekenmodel-voor-stikstof-vrijgeven.

Daarnaast is er gezien het NRC-artikel https://www.nrc.nl/nieuws/2022/06/11/de-man-achter-het-model-waarmee-den-haag-stikstofberekeningen-doet-a4133158 blijkbaar enige verwarring over de rollen van Aerius en OPS in het berekeningsproces. Mogelijk is het handig om relatie met Aerius beter te belichten in de readme, zoals bijvoorbeeld beschreven in https://nl.wikipedia.org/wiki/AERIUS.

Lack of a MAKEFILE

It's needlessly frustrating and against the principles of OpenSource to not include a Makefile.

Considering the RIVM is aware of the lack of makefile (hence the request to email them in the readme), It seems clear this frustration is on purpose.

Please just include the makefile.

Suggestion to use Fortran 90 syntax or newer where available

Code contains constructs like in ops_cals_stats.f90:
if (somcpri .gt. 0.0) then
Starting with Fortran 90 when I am correct (correct me if wrong), this can be replaced by:

if (somcpri = 0.0) then
which is easier to understand by coders recently graduating. Replacing some other traditional Fortran constructs by more modern constructs might also help adoption.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.