Skip to content

Add a _is_new_day() check to global.cpp #148

@djmallum

Description

@djmallum

Is your feature request related to a problem? Please describe.
Certain models must be enforced to daily time-steps, due to the lack of resolution on these time scales. For example, will need to track snowmelt from day N and apply it to day N+1, uniformly, over the day. The infiltration model cannot resolve snowmelt infiltration into frozen soils on hourly timesteps.

Describe the solution you'd like
A function that I can call to check if the current instance of run() in my module is a new day compared with the previous time-step.

Describe alternatives you've considered
I currently use the following function:

bool my_module::is_new_day(my_module::data& d) {

    int current_day = global_param->day();

    if (current_day == d.last_day)
        return false;
    else
            return true;
};

But as we discussed, this is the type of thing that should be cached elsewhere then in a module. Future modules may be added which could make use of this as well.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions