-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6834b5d
commit b9a8cdd
Showing
15 changed files
with
68 additions
and
42 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
|
||
@kwdef mutable struct Climate1Dstep{F <: AbstractFloat} | ||
@kwdef mutable struct Climate1Dstep{F <: AbstractFloat} | ||
temp::Vector{F} | ||
PDD::Vector{F} | ||
snow::Vector{F} | ||
rain::Vector{F} | ||
gradient::Ref{F} | ||
avg_gradient::Ref{F} | ||
gradient::F | ||
avg_gradient::F | ||
x::Vector{F} | ||
y::Vector{F} | ||
ref_hgt::Ref{F} | ||
ref_hgt::F | ||
end | ||
|
||
@kwdef mutable struct Climate1D{F <: AbstractFloat} | ||
Base.:(==)(a::Climate1Dstep, b::Climate1Dstep) = a.temp == b.temp && a.PDD == b.PDD && | ||
a.snow == b.snow && a.rain == b.rain && | ||
a.gradient == b.gradient && a.avg_gradient == b.avg_gradient && | ||
a.x == b.x && a.y == b.y && a.ref_hgt == b.ref_hgt | ||
|
||
@kwdef mutable struct Climate1D{F <: AbstractFloat} | ||
raw_climate::RasterStack # Raw climate dataset for the whole simulation | ||
# Buffers to avoid memory allocations | ||
climate_raw_step::Ref{RasterStack} # Raw climate trimmed for the current step | ||
climate_step::Ref{RasterStack} # Climate data for the current step | ||
climate_raw_step::RasterStack # Raw climate trimmed for the current step | ||
climate_step::Dict # Climate data for the current step | ||
climate_2D_step::Climate2Dstep # 2D climate data for the current step to feed to the MB model | ||
longterm_temps::Vector{F} # Longterm temperatures for the ice rheology | ||
avg_temps::Ref{RasterStack} # Intermediate buffer for computing average temperatures | ||
avg_gradients::Ref{RasterStack} # Intermediate buffer for computing average gradients | ||
avg_temps::F # Intermediate buffer for computing average temperatures | ||
avg_gradients::F # Intermediate buffer for computing average gradients | ||
end | ||
|
||
Base.:(==)(a::Climate1D, b::Climate1D) = a.raw_climate == b.raw_climate && a.climate_raw_step == b.climate_raw_step && | ||
a.climate_step == b.climate_step && a.climate_2D_step == b.climate_2D_step && | ||
a.longterm_temps == b.longterm_temps && a.avg_temps == b.avg_temps && | ||
a.avg_gradients == b.avg_gradients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
|
||
export Climate2Dstep, Climate2D | ||
|
||
@kwdef mutable struct Climate2Dstep{F <: AbstractFloat} | ||
@kwdef mutable struct Climate2Dstep{F <: AbstractFloat} | ||
temp::Matrix{F} | ||
PDD::Matrix{F} | ||
snow::Matrix{F} | ||
rain::Matrix{F} | ||
gradient::Ref{F} | ||
avg_gradient::Ref{F} | ||
gradient::F | ||
avg_gradient::F | ||
x::Vector{F} | ||
y::Vector{F} | ||
ref_hgt::Ref{F} | ||
ref_hgt::F | ||
end | ||
|
||
@kwdef mutable struct Climate2D{F <: AbstractFloat} | ||
Base.:(==)(a::Climate2Dstep, b::Climate2Dstep) = a.temp == b.temp && a.PDD == b.PDD && | ||
a.snow == b.snow && a.rain == b.rain && | ||
a.gradient == b.gradient && a.avg_gradient == b.avg_gradient && | ||
a.x == b.x && a.y == b.y && a.ref_hgt == b.ref_hgt | ||
|
||
@kwdef mutable struct Climate2D{F <: AbstractFloat} | ||
raw_climate::RasterStack # Raw climate dataset for the whole simulation | ||
# Buffers to avoid memory allocations | ||
climate_raw_step::Ref{RasterStack} # Raw climate trimmed for the current step | ||
climate_step::Ref{RasterStack} # Climate data for the current step | ||
climate_raw_step::RasterStack # Raw climate trimmed for the current step | ||
climate_step::Dict # Climate data for the current step | ||
climate_2D_step::Climate2Dstep # 2D climate data for the current step to feed to the MB model | ||
longterm_temps::Vector{F} # Longterm temperatures for the ice rheology | ||
avg_temps::Ref{RasterStack} # Intermediate buffer for computing average temperatures | ||
avg_gradients::Ref{RasterStack} # Intermediate buffer for computing average gradients | ||
avg_temps::F # Intermediate buffer for computing average temperatures | ||
avg_gradients::F # Intermediate buffer for computing average gradients | ||
end | ||
|
||
Base.:(==)(a::Climate2D, b::Climate2D) = a.raw_climate == b.raw_climate && a.climate_raw_step == b.climate_raw_step && | ||
a.climate_step == b.climate_step && a.climate_2D_step == b.climate_2D_step && | ||
a.longterm_temps == b.longterm_temps && a.avg_temps == b.avg_temps && | ||
a.avg_gradients == b.avg_gradients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters