-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WeatherSampler does not work when Weather is enabled #9338
Comments
From my limited understanding of WeatherSampler it's main usage is related to Simulation spin up. |
I am studying it for the first time as we're thinking of building a new weather-related model. I added it next to Weather and expected to see different results each time I run the sims, but it didn't happen as Weather data was always used instead. Perhaps I'm using it wrongly. |
@BrianCollinss - WeatherSampler is instead of Weather not as well as. So this is expected behaviour - although it might be better if it threw a fatal error if both were in the simulation. |
Thanks @sno036 but when I remove weather, it throws as Maize, for example, calls it. |
The problem is that lots of models in APSIM look for a model called 'Weather'. They shouldn't, but they do. The workaround might be to remove Weather and rename WeatherSampler to weather in the GUI. On this PR (#9326) I talk about wanting to refactor the messy weather components. One day... |
Thanks @hol353. What do you recommend models do if they need access to daily weather data? |
They should [Link] to IWeather, rather than [Weather]. This way, it doesn't matter what the name or type of the weather model is, just that it implements an IWeather interface. A lot of models already do this, but as you've discovered, not all. |
I also noticed that WeatherSampler does not have all the outputs that Weather has (this may add to the errors you're having). I will try finishing that pull request ensuring that both models have the same variables (and defaults). Refactoring might need a bit more time/focus. |
What happened?
Unable to evaluate linear interpolation function .Simulation.Field.Maize.Leaf.FrostFraction --> Error while locating variable '[Weather].MinT' in variable reference '.Simulation.Field.Maize.Leaf.FrostFraction.XValue' --> Unable to find any model with name or type Weather in scope of XValue
What Operating System are you on?
Windows
The text was updated successfully, but these errors were encountered: