Git Product home page Git Product logo

Comments (5)

jmaerz avatar jmaerz commented on September 15, 2024 1

Hi @JorgSchwinger an @TomasTorsvik , ok, yes, I see what you mean. Being explicit about it wouldn't harm, though. I guess, in this case, I will add the change simply to my nitrogen cycle branch which will enter the beyone-CMIP6 branch at some point (or the master, if is has been merged).

from blom.

TomasTorsvik avatar TomasTorsvik commented on September 15, 2024

Hi @jmaerz , I agree that this looks suspicious. Looking at the code history:

https://github.com/NorESMhub/BLOM/blame/master/hamocc/sedshi.F90

most of the sedshi.F90 code has not been changed for a long time, except l. 143 that was included in PR #189.

As it happens, k should take the value ks in this case, since the previous loop terminates at ks-1, but I don't think there is any good reason to rely on this implied behavior.

See discussion in https://stackoverflow.com/questions/62229922/value-of-index-variable-after-loop-exit-in-fortran
and example:

  program main
  implicit none
  integer :: i, n
  n = 10

  do i = 1, n - 1
     print *, "inside: ", i
  enddo

  print *, "after exit: ", i   !! guaranteed to be n?
  end

from blom.

TomasTorsvik avatar TomasTorsvik commented on September 15, 2024

Also, it would be a good idea to update beyond-CMIP6 from master before including the fix.

from blom.

JorgSchwinger avatar JorgSchwinger commented on September 15, 2024

Hi @jmaerz and @TomasTorsvik

It looks like k=ks at this point of the code, right?

In this case, I don't think this classifies as a bug (since it relies on behavior that is part of the Fortran standard). But it is definitely not nice and I agree k should be changed to ks here. There should be no effect on the results (hopefully).

from blom.

TomasTorsvik avatar TomasTorsvik commented on September 15, 2024

Hi @JorgSchwinger an @TomasTorsvik , ok, yes, I see what you mean. Being explicit about it wouldn't harm, though. I guess, in this case, I will add the change simply to my nitrogen cycle branch which will enter the beyone-CMIP6 branch at some point (or the master, if is has been merged).

Seem like a good plan to me :)

from blom.

Related Issues (20)

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.