Skip to content
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

fix for NCDatasets 0.12.3 #211

Merged
merged 2 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Wflow"
uuid = "d48b7d99-76e7-47ae-b1d5-ff0c1cf9a818"
authors = ["Deltares and contributors"]
version = "0.6.0"
version = "0.6.1"

[deps]
BasicModelInterface = "59605e27-edc0-445a-b93d-c09a3a50b330"
Expand Down Expand Up @@ -30,7 +30,7 @@ FieldMetadata = "0.3"
Glob = "1.3"
Graphs = "1.4"
LoggingExtras = "0.4.6"
NCDatasets = "0.11.7, 0.12"
NCDatasets = "0.12.3"
NetCDF_jll = "=400.702.400"
Parameters = "0.12"
ProgressLogging = "0.1"
Expand Down
26 changes: 15 additions & 11 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## v0.6.1 - 2022-04-24

### Fixed
- Fixed an error with the log file, when writing to a folder that does not (yet) exists.
Now, the folder is created prior to writing the log file.
- Fixed a MethodError for `read_dims`, thrown when reading netCDF data with NCDatasets.jl
0.12.3 or higher.

## v0.6.0 - 2022-04-14
## v0.6.0 - 2022-04-14

### Added
- The [FLEXTopo](@ref config_flextopo) model.
Expand All @@ -27,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Re-organized the documentation: moved explanation of different model concepts to a model
documentation section, added a user guide to explain setting up the model, added new
documentation section, added a user guide to explain setting up the model, added new
figures to the description of wflow\_sbm.
- The unit of lateral subsurface flow `ssf` of `LateralSSF` is now ``m^3 d^{-1}``. The unit
was ``m^3 t^{-1}``, where ``t`` is the model timestep. Other flow variables are already
Expand All @@ -51,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
should have covered the river domain, resulting in incorrect river widths and thus
incorrect effective flow widths for river cells.

## v0.5.2 - 2022-02-03
## v0.5.2 - 2022-02-03

### Changed
- Model types `sbm_gwf` and `hbv` use the same approach for the calculation of the drain
Expand Down Expand Up @@ -110,7 +114,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Scaling of potential capillary rise is replaced by a common approach found in literature,
based on the water table depth `zi`, a maximum water depth `cap_hmax` beyond which
capillary rise ceases, and a coefficient `cap_n`. See also [Capillary rise](@ref).
capillary rise ceases, and a coefficient `cap_n`. See also [Capillary rise](@ref).
Multiplying the scaling factor with the ratio of model time step and
`basetimestep` in the original approach resulted in (much) smaller capillary fluxes at
sub-daily model time steps compared to daily model time steps, and is not used in the new
Expand All @@ -128,7 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The ``\alpha`` parameter of the kinematic wave has a fixed value now and is not updated
because of changes in water height (this could result in large water balance errors). See
also [Surface routing](@ref).
- Cyclic input for other structs than vertical are also now supported (for example cyclic
- Cyclic input for other structs than vertical are also now supported (for example cyclic
inflow to the river).
- Moved `update_forcing!` and `update_cyclic!` functions to the `run` function. It is now
easier to implement a custom `run` function with custom loading of input data (forcing and
Expand Down Expand Up @@ -190,9 +194,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(Vector) for struct `ConstantHead`.
- Fixed return max(0, boundary.flux[index]) to return max(0, flux) the flux should be returned
when cell is dry, no negative value allowed.
- Fixed path to initialize lake to: dirname(static_path)
- Fixed path to initialize lake to: dirname(static_path)
- Fixed outflow = 0, when lake level is below lake threshold. Before a negative value
could enter the log function and model would fail.
could enter the log function and model would fail.
- Fixed the lake storage initialization. For continuation runs (`reinit = false`), this
caused the lake to be reset to the initial conditions instead of the saved state.

Expand All @@ -204,14 +208,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## v0.3.0 - 2021-05-10

### Changed
- New deposition process for coarse sediment in the reservoirs with a new parameter
- New deposition process for coarse sediment in the reservoirs with a new parameter
`restrapefficiency` in the sediment model.
- New variables added to the `LandSediment` and `RiverSediment` structs in order to save
- New variables added to the `LandSediment` and `RiverSediment` structs in order to save
more output from the sediment model.
- Added variables `volume` and `inwater` to `SurfaceFlow` struct, this is convenient for the
coupling with the water quality model Delwaq.
- River water level (`h`) and discharge (`q`) forced directly into the `RiverSediment`
struct (instead of using the `OverlandFlowSediment` struct first).
struct (instead of using the `OverlandFlowSediment` struct first).
- Require Julia 1.6 or later.

### Added
Expand All @@ -225,7 +229,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Corrected a bug in sediment deposition in the river (case when incoming sediment load is
more than the river transport capacity).
- Fixed update of `snow` and `glacierstore` fields of HBV and SBM concepts by the
`glacier_hbv` module.
`glacier_hbv` module.

## v0.2.0 - 2021-03-26

Expand Down
4 changes: 2 additions & 2 deletions src/Wflow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ using TerminalLoggers
using CFTime
using Base.Threads
using Glob
using NCDatasets: MFDataset

@metadata get_units "mm Δt-1"

const BMI = BasicModelInterface
const Float = Float64
const CFDataset = Union{NCDataset,MFDataset}
const CFDataset = Union{NCDataset,NCDatasets.MFDataset}
const CFVariable_MF = Union{NCDatasets.CFVariable,NCDatasets.MFCFVariable}
const version =
VersionNumber(TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])

Expand Down
4 changes: 2 additions & 2 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1414,15 +1414,15 @@ function internal_dim_name(name::Symbol)
end

"""
read_dims(A::NCDatasets.CFVariable, dim_sel)
read_dims(A::CFVariable_MF, dim_sel)

Return the data of a NetCDF data variable as an Array. Only dimensions in `dim_sel`, a
NamedTuple like (x=:, y=:, time=1). Other dimensions that may be present need to be size 1,
otherwise an error is thrown.

`dim_sel` keys should be the internal dimension names; :x, :y, :time, :`extra_dim.name`.
"""
function read_dims(A::NCDatasets.CFVariable, dim_sel::NamedTuple)
function read_dims(A::CFVariable_MF, dim_sel::NamedTuple)
dimsizes = dimsize(A)
indexer = []
data_dim_order = Symbol[]
Expand Down