Giter VIP home page Giter VIP logo

Comments (5)

trotsiuk avatar trotsiuk commented on August 29, 2024

Hi @twest820

Thank you for finding this interesting issue. Indeed the manual of the 3-PG is declaring the number of days per month.

However, if you look at the code itself (also of 3-PGpjs which can be downloaded here https://3pg.forestry.ubc.ca/software/) it will be recognised that the same formula as in r3PG or 3PGmix is used for the frost days, see below:

'calculate frost modifier
 fFrost = 1 - kF * (FrostDays / 30)

Since we were translating the code and aimed to test compatibility it was done the same way as in the original model.

I fully support your suggestions for improvements. Please feel free to create a new branch an make a push request to incorporate the changes.

Unfortunately from my side there is very little time to allocate for it.

3PGpjs27.zip

from r3pg.

twest820 avatar twest820 commented on August 29, 2024

Yeah, I know how that goes. Thanks Volodymyr, I'll address this in my branch but, as I'm not coding in Fortran, a pull request is unlikely to materialize. A daysInMonth(month) lookup, as done elsewhere in the existing code, would address this. Modulo the leap year issue I'm about to capture, anyways.

from r3pg.

trotsiuk avatar trotsiuk commented on August 29, 2024

I'll address this in my branch but, as I'm not coding in Fortran

So is your intension to write model fully in R or other language? Would be great if you implement all your detailed comments and suggestions into the code!

from r3pg.

twest820 avatar twest820 commented on August 29, 2024

I think it's most accurate to say I'm looking into an experimental version for evaluating certain possibilities. Definitely not funded for anything like an R package though it's possible that, if things go well, the code might eventually become of wider interest. If that happens I'll follow up with you (most likely in email) but I anticipate it will be at least several months to find out, possibly well into next year.

from r3pg.

trotsiuk avatar trotsiuk commented on August 29, 2024

I have now implemented the number of days per month to calculate the f_frost

f_frost(:,i) = 1.d0 - kF(i) * ( frost_days(:) / daysInMonth(month_vector(:)) )

Additionally add the check to the prepare_climate function to limit the frost_day to the maximum possible

climate$frost_days <- pmin( climate$frost_days, daysInMonth[climate$month])

@DavidForrester this slightly however impacted the output of the model. Particularly it has deviated the biomass outputs by third digit for the stem biomass. The general pattern remain unchanged.

from r3pg.

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.