Skip to content

date mismatch in latest cwatm  #151

Description

@abbylute

I'm encountering an error when trying to run the latest version of cwatm with future climate data. Please see the output below:

image

For reference, the time parameters of my run are:

image

I'm happy to share the full settings file if helpful.

I did not have a problem running this with a previous version of CWatM. I am also able to run the latest CWatM with a similar settings file using W5E5v2.0 data (for a historical period). The climate data I am using is CMIP6 data that has been downscaled by my team. The files are available for the full run period and are without issue. After investigating, I believe the issue is caused by the fact that the timestamp in the CMIP6 files is 12:00:00. The timestamp in the W5E5v2.0 files in contrast is 00:00:00. In the multinetdf() function in data_handling.py, there is rounding applied to some of the date values, which I believe may be contributing to the issue. This rounding was not applied in the previous version of cwatm that I have (and that runs). I don't know the exact best way to fix this, but I've made a couple of observations that might be helpful:

  1. if I start my simulation one day later, the error goes away and the code runs.
  2. if I remove the rounding from the line: datestartint = int(round(nctime[0].data.tolist(),0)) // datediv, the error goes away and my code runs.
  3. the value of datestart reported by data_handling.py is one day later than the start day of my simulation. If I also remove the rounding from this line: datestart = num2date(int((nctime[:][0])), units=nctime.units,calendar=nctime.calendar)
    then the datestart value is the same as the start date of my simulation.

From what I can see so far it appears that the timestamps may need to be handled differently in data_handling.py. Alternatively, if there is some mistake I am making or if you would recommend instead modifying the timestamps of my climate data files please let me know.

Thanks to the dev team for all your work on CWatM, it is very useful!
-Abby

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions