From 6722130e5c7015da7ac15721f9141736de6d7009 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Thu, 8 Aug 2024 17:47:48 -0400 Subject: [PATCH 1/5] changed everything to be discrete form --- src/Walrus.jl | 13 +---------- src/get_value.jl | 35 +++++++++++++++++++++++++++++ src/surface_heating.jl | 20 +++++++++++------ src/wall_model.jl | 1 + src/wind_driven_stokes.jl | 3 ++- src/wind_stress.jl | 42 +++++++++++++++++++++-------------- test/runtests.jl | 1 + test/test_get_value.jl | 46 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 125 insertions(+), 36 deletions(-) create mode 100644 src/get_value.jl create mode 100644 test/test_get_value.jl diff --git a/src/Walrus.jl b/src/Walrus.jl index c45389d..8a7b3e6 100644 --- a/src/Walrus.jl +++ b/src/Walrus.jl @@ -18,18 +18,7 @@ using Adapt: adapt import Adapt: adapt_structure -# This is how we will standarise function vs values, I will have to think of a way to deal with discrete vs continuous at some point -struct ReturnValue{FT} - value :: FT -end - -adapt_structure(to, rv::ReturnValue) = ReturnValue(adapt(to, rv.value)) - -@inline (return_value::ReturnValue)(args...) = return_value.value - -display_input(return_value::ReturnValue) = return_value.value -display_input(::Function) = "Function" - +include("get_value.jl") include("interpolations.jl") include("wall_model.jl") include("radiative_transfer/radiative_transfer.jl") diff --git a/src/get_value.jl b/src/get_value.jl new file mode 100644 index 0000000..c57056c --- /dev/null +++ b/src/get_value.jl @@ -0,0 +1,35 @@ +using Oceananigans.Fields: AbstractField, Center +using Oceananigans.Grids: xnode, ynode + +# fallback +@inline get_value(f, args...) = f + +struct ContinuousSurfaceFunction{F} + func :: F +end + +@inline function get_value(f::ContinuousSurfaceFunction, i, j, grid, clock, args...) + t = clock.time + + x = xnode(i, j, grid.Nz, grid, Center(), Center(), Center()) + y = ynode(i, j, grid.Nz, grid, Center(), Center(), Center()) + + return f.func(x, y, t, args...) +end + +@inline get_value(f::ContinuousSurfaceFunction, ::Nothing, ::Nothing, t, args...) = f(0, 0, t) + +struct DiscreteSurfaceFuncton{F} + func :: F +end + +@inline get_value(f::DiscreteSurfaceFuncton, i, j, grid, clock, args...) = f.func(i, j, grid, clock, args...) + +# GPU compatible, mainly for fields +@inline get_value(f::AbstractArray{<:Any, 2}, i, j, grid, clock, args...) = @inbounds f[i, j] +@inline get_value(f::AbstractArray{<:Any, 3}, i, j, grid, clock, args...) = @inbounds f[i, j, grid.Nz] + +# fallback +normalise_surface_function(f; kwargs...) = f + +normalise_surface_function(f::Function; discrete_form = false) = discrete_form ? DiscreteSurfaceFuncton(f) : ContinuousSurfaceFunction(f) \ No newline at end of file diff --git a/src/surface_heating.jl b/src/surface_heating.jl index 1acdea6..b124e45 100644 --- a/src/surface_heating.jl +++ b/src/surface_heating.jl @@ -8,7 +8,7 @@ using Adapt: adapt using Oceananigans.BoundaryConditions: FluxBoundaryCondition -using Walrus: ReturnValue, display_input +using Walrus: get_value, normalise_surface_function using Walrus.WindStressModel: WindStress, LogarithmicNeutralWind, find_velocity_roughness_length @@ -208,7 +208,7 @@ function SurfaceHeatExchangeBoundaryCondition(; wind_stress, air_water_mixing_ratio = 0.001, # kg / kg stephan_boltzman_constant = 5.670374419e-8) # W / K⁴ - isa(air_temperature, Function) || (air_temperature = ReturnValue(air_temperature)) + air_temperature = normalise_surface_function(air_temperature) surface_heat_exchange = SurfaceHeatExchange(wind_stress, air_temperature, latent_heat_vaporisation, vapour_pressure, @@ -216,7 +216,7 @@ function SurfaceHeatExchangeBoundaryCondition(; wind_stress, air_specific_heat_capacity, air_density, air_water_mixing_ratio, stephan_boltzman_constant) - return FluxBoundaryCondition(surface_heat_exchange, field_dependencies = (:T, :u, :v)) + return FluxBoundaryCondition(surface_heat_exchange, discrete_form=true) end @inline function Cʰ(drag_coefficient::LogarithmicNeutralWind, wind_speed) @@ -268,7 +268,7 @@ end ##### Cʰ parameterisations ##### -@inline function (interface::SurfaceHeatExchange)(x, y, t, T, u, v) +@inline function (interface::SurfaceHeatExchange)(i, j, grid, clock, model_fields) σ = interface.stephan_boltzman_constant ρᵃ = interface.air_density cₚᵃ = interface.air_specific_heat_capacity @@ -277,10 +277,16 @@ end ρʷ = interface.water_density cₚʷ = interface.water_specific_heat_capacity - air_temperature = interface.air_temperature(x, y, t) + t = clock.time + + u = @inbounds model_fields.u[i, j, grid.Nz] + v = @inbounds model_fields.v[i, j, grid.Nz] + T = @inbounds model_fields.T[i, j, grid.Nz] + + air_temperature = get_value(interface.air_temperature, i, j, grid, clock) - wind_speed = interface.wind_stress.reference_wind_speed(x, y, t) - wind_direction = interface.wind_stress.reference_wind_direction(x, y, t) + wind_speed = get_value(interface.wind_stress.reference_wind_speed, i, j, grid, clock) + wind_direction = get_value(interface.wind_stress.reference_wind_direction, i, j, grid, clock) uʷ = - wind_speed * sind(wind_direction) vʷ = - wind_speed * cosd(wind_direction) diff --git a/src/wall_model.jl b/src/wall_model.jl index 5ee5b3b..c047c94 100644 --- a/src/wall_model.jl +++ b/src/wall_model.jl @@ -19,6 +19,7 @@ using Oceananigans.Grids: znode using Oceananigans.Architectures: on_architecture, CPU, architecture +using Walrus: get_value, normalise_surface_function using Walrus.Interpolations: SimpleInterpolation import Adapt: adapt_structure diff --git a/src/wind_driven_stokes.jl b/src/wind_driven_stokes.jl index c661732..c258127 100644 --- a/src/wind_driven_stokes.jl +++ b/src/wind_driven_stokes.jl @@ -40,6 +40,7 @@ using Oceananigans.Architectures: on_architecture, CPU, architecture using Oceananigans.BuoyancyModels: g_Earth using Oceananigans.StokesDrifts: UniformStokesDrift +using Walrus: get_value using Walrus.Interpolations: SimpleInterpolation import Adapt: adapt_structure @@ -107,7 +108,7 @@ end @inline function surface_drift_velocity(z, t, params) wind = params.wind - uʷ = abs(wind.reference_wind_speed(0, 0, t)) + uʷ = abs(get_value(wind.reference_wind_speed, nothing, nothing, nothing, t)) dc = wind.drag_coefficient diff --git a/src/wind_stress.jl b/src/wind_stress.jl index eaae4c1..fb534cd 100644 --- a/src/wind_stress.jl +++ b/src/wind_stress.jl @@ -10,7 +10,7 @@ using Oceananigans.Architectures: on_architecture, CPU using Oceananigans.BoundaryConditions: FluxBoundaryCondition using Oceananigans.BuoyancyModels: g_Earth -using Walrus: ReturnValue, display_input +using Walrus: get_value, normalise_surface_function using Walrus.Interpolations: SimpleInterpolation import Adapt: adapt_structure @@ -102,9 +102,8 @@ function WindStress(; reference_wind_speed, air_density = 1.225, water_density = 1026.) - isa(reference_wind_speed, Function) || (reference_wind_speed = ReturnValue(reference_wind_speed)) - - isa(reference_wind_direction, Function) || (reference_wind_direction = ReturnValue(reference_wind_direction)) + reference_wind_speed = normalise_surface_function(reference_wind_speed) + reference_wind_direction = normalise_surface_function(reference_wind_direction) return WindStress(reference_wind_speed, reference_wind_direction, drag_coefficient, air_density, water_density) @@ -166,22 +165,28 @@ function WindStressBoundaryConditions(; reference_wind_speed, air_density = 1.225, water_density = 1026.) - wind_stress = WindStress(; reference_wind_speed, reference_wind_direction, + wind_stress = WindStress(; reference_wind_speed, + reference_wind_direction, drag_coefficient, air_density, water_density) - u = FluxBoundaryCondition(wind_stress, parameters = Val(:x), field_dependencies = (:u, :v)) + u = FluxBoundaryCondition(wind_stress, parameters = Val(:x), discrete_form=true) - v = FluxBoundaryCondition(wind_stress, parameters = Val(:y), field_dependencies = (:u, :v)) + v = FluxBoundaryCondition(wind_stress, parameters = Val(:y), discrete_form=true) return (; u, v) end -@inline function (wind_stress::WindStress)(x, y, t, u, v, ::Val{:x}) +@inline function (wind_stress::WindStress)(i, j, grid, clock, model_fields, ::Val{:x}) ρₐ = wind_stress.air_density ρₒ = wind_stress.water_density - wind_speed = wind_stress.reference_wind_speed(x, y, t) - wind_direction = wind_stress.reference_wind_direction(x, y, t) + t = clock.time + + u = @inbounds model_fields.u[i, j, grid.Nz] + v = @inbounds model_fields.v[i, j, grid.Nz] + + wind_speed = get_value(wind_stress.reference_wind_speed, i, j, grid, clock) + wind_direction = get_value(wind_stress.reference_wind_direction, i, j, grid, clock) uʷ = - wind_speed * sind(wind_direction) vʷ = - wind_speed * cosd(wind_direction) @@ -193,12 +198,17 @@ end return - stress_velocity * (uʷ - u) end -@inline function (wind_stress::WindStress)(x, y, t, u, v, ::Val{:y}) +@inline function (wind_stress::WindStress)(i, j, grid, clock, model_fields, ::Val{:y}) ρₐ = wind_stress.air_density ρₒ = wind_stress.water_density - wind_speed = wind_stress.reference_wind_speed(x, y, t) - wind_direction = wind_stress.reference_wind_direction(x, y, t) + t = clock.time + + u = @inbounds model_fields.u[i, j, grid.Nz] + v = @inbounds model_fields.v[i, j, grid.Nz] + + wind_speed = get_value(wind_stress.reference_wind_speed, i, j, grid, clock) + wind_direction = get_value(wind_stress.reference_wind_direction, i, j, grid, clock) uʷ = - wind_speed * sind(wind_direction) vʷ = - wind_speed * cosd(wind_direction) @@ -212,8 +222,8 @@ end summary(::WindStress) = string("Wind stress model") show(io::IO, wind::WindStress) = println(io, summary(wind), " with:\n", - " Wind speed: ", display_input(wind.reference_wind_speed), "\n", - " Wind direction: ", display_input(wind.reference_wind_direction), "\n", + " Wind speed: ", summary(wind.reference_wind_speed), "\n", + " Wind direction: ", summary(wind.reference_wind_direction), "\n", " Drag coefficient: ", summary(wind.drag_coefficient), "\n", " Air density: ", wind.air_density, " kg/m³\n", " Water density: ", wind.water_density, " kg/m³") @@ -322,7 +332,7 @@ coefficient model. This will sometimes fail as the function is not well behaved at either low reference heights (it has been tuned for 10m wind), or high (⪆ 20 m/s). """ -@inline function find_velocity_roughness_length(dc::LogarithmicNeutralWind{<:Any, Nothing}, wind_speed, reference_height, params) +@inline function find_velocity_roughness_length(::LogarithmicNeutralWind{<:Any, Nothing}, wind_speed, reference_height, params) z₀ = reference_height upper_bounds_guess = ifelse(wind_speed < 0.05, 0.95 * reference_height, ifelse(wind_speed < 14, 0.5 * reference_height, 0.2 * reference_height)) diff --git a/test/runtests.jl b/test/runtests.jl index 18e49c5..ad9605a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,6 +5,7 @@ arch = CPU() @info "Testing on $arch" include("test_interpolation.jl") +include("test_get_value.jl") include("test_wind_model.jl") include("test_wall_model.jl") include("test_heating.jl") diff --git a/test/test_get_value.jl b/test/test_get_value.jl new file mode 100644 index 0000000..ef6f8cd --- /dev/null +++ b/test/test_get_value.jl @@ -0,0 +1,46 @@ +using Oceananigans.Grids: xnode, ynode + +using Walrus: get_value, normalise_surface_function + +number_val = 100 + +continuous_val(x, y, t) = x * y * t +continuous_val(::Nothing, y, t) = y * t + +two_d_field_val(x, y) = continuous_val(x, y, 100) +two_d_field_val(y) = continuous_val(1, y, 100) + +three_d_field_val(x, y, z) = continuous_val(x, y, 100) +three_d_field_val(x, y) = continuous_val(1, y, 100) +three_d_field_val(y) = continuous_val(1, y, 100) + +function discrete_val(i, j, grid, clock) + + x = xnode(i, grid, Center()) + y = ynode(j, grid, Center()) + + t = clock.time + + return continuous_val(x, y, t) +end + +@testset "Get value" begin + for grid in [RectilinearGrid(size = (1, 1, 1), extent = (2, 2, 2)), + RectilinearGrid(topology = (Periodic, Periodic, Flat), size = (1, 1), extent = (2, 2)), + RectilinearGrid(topology = (Flat, Periodic, Flat), size = (1, ), extent = (2))] + + two_d_field = Field{Center, Center, Nothing}(grid; indices = (:, :, 1)) + three_d_field = Field{Center, Center, Center}(grid) + + set!(two_d_field, two_d_field_val) + set!(three_d_field, three_d_field_val) + + clock = Clock(; time = eltype(grid)(100)) + + possible_values = [normalise_surface_function.([number_val, continuous_val, two_d_field, three_d_field])..., normalise_surface_function(discrete_val, discrete_form = true)] + + for value in possible_values + @test get_value(value, 1, 1, grid, clock) == 100 + end + end +end \ No newline at end of file From 54243eca93d88defdbf12ff9e06eae53acc9f5af Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Thu, 8 Aug 2024 17:48:24 -0400 Subject: [PATCH 2/5] bumped compats --- Manifest.toml | 233 +++++++++++--------------------------------------- Project.toml | 4 +- 2 files changed, 52 insertions(+), 185 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index d1321ac..70f3ef4 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.10.2" manifest_format = "2.0" -project_hash = "246e49b53ed630e3a6858ffe9698bd0f659f48a8" +project_hash = "acc6dd5077921f9cacb46eb572b93736282df7cc" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] @@ -17,9 +17,9 @@ weakdeps = ["ChainRulesCore", "Test"] [[deps.Accessors]] deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] -git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" +git-tree-sha1 = "f61b15be1d76846c0ce31d3fcfac5380ae53db6a" uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" -version = "0.1.36" +version = "0.1.37" [deps.Accessors.extensions] AccessorsAxisKeysExt = "AxisKeys" @@ -50,28 +50,6 @@ weakdeps = ["StaticArrays"] uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" version = "1.1.1" -[[deps.ArrayInterface]] -deps = ["Adapt", "LinearAlgebra", "Requires", "SparseArrays", "SuiteSparse"] -git-tree-sha1 = "c5aeb516a84459e0318a02507d2261edad97eb75" -uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" -version = "7.7.1" - - [deps.ArrayInterface.extensions] - ArrayInterfaceBandedMatricesExt = "BandedMatrices" - ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" - ArrayInterfaceCUDAExt = "CUDA" - ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" - ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" - ArrayInterfaceTrackerExt = "Tracker" - - [deps.ArrayInterface.weakdeps] - BandedMatrices = "aae01518-5342-5314-be14-df237901396f" - BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" - CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -175,16 +153,11 @@ git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" version = "0.2.4" -[[deps.CommonWorldInvalidations]] -git-tree-sha1 = "ae52d1c52048455e85a387fbee9be553ec2b68d0" -uuid = "f70d9fcc-98c5-4d4a-abd7-e4cdeebd8ca8" -version = "1.0.0" - [[deps.Compat]] deps = ["TOML", "UUIDs"] -git-tree-sha1 = "b1c55339b7c6c350ee89f2c1604299660525b248" +git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215" uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" -version = "4.15.0" +version = "4.16.0" weakdeps = ["Dates", "LinearAlgebra"] [deps.Compat.extensions] @@ -206,9 +179,9 @@ weakdeps = ["InverseFunctions"] [[deps.ConstructionBase]] deps = ["LinearAlgebra"] -git-tree-sha1 = "260fd2400ed2dab602a7c15cf10c1933c59930a2" +git-tree-sha1 = "d8a9c0b6ac2d9081bf76324b39c78ca3ce4f0c98" uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" -version = "1.5.5" +version = "1.5.6" [deps.ConstructionBase.extensions] ConstructionBaseIntervalSetsExt = "IntervalSets" @@ -370,14 +343,9 @@ version = "1.14.2+1" [[deps.Hwloc_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "1d334207121865ac8c1c97eb7f42d0339e4635bf" +git-tree-sha1 = "5e19e1e4fa3e71b774ce746274364aef0234634e" uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8" -version = "2.11.0+0" - -[[deps.IfElse]] -git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" -uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" -version = "0.1.1" +version = "2.11.1+0" [[deps.IncompleteLU]] deps = ["LinearAlgebra", "SparseArrays"] @@ -386,22 +354,23 @@ uuid = "40713840-3770-5561-ab4c-a76e7d0d7895" version = "0.2.1" [[deps.InlineStrings]] -deps = ["Parsers"] -git-tree-sha1 = "86356004f30f8e737eff143d57d41bd580e437aa" +git-tree-sha1 = "45521d31238e87ee9f9732561bfee12d4eebd52d" uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" -version = "1.4.1" +version = "1.4.2" [deps.InlineStrings.extensions] ArrowTypesExt = "ArrowTypes" + ParsersExt = "Parsers" [deps.InlineStrings.weakdeps] ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" + Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" [[deps.IntelOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "be50fe8df3acbffa0274a744f1a99d29c45a57f4" +git-tree-sha1 = "14eb2b542e748570b56446f4c50fbfb2306ebc45" uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" -version = "2024.1.0+0" +version = "2024.2.0+0" [[deps.InteractiveUtils]] deps = ["Markdown"] @@ -409,9 +378,9 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[deps.InverseFunctions]] deps = ["Test"] -git-tree-sha1 = "e7cbed5032c4c397a6ac23d1493f3289e01231c4" +git-tree-sha1 = "18c59411ece4838b18cd7f537e56cf5e41ce5bfd" uuid = "3587e190-3f89-42d0-90ee-14403ec27112" -version = "0.1.14" +version = "0.1.15" weakdeps = ["Dates"] [deps.InverseFunctions.extensions] @@ -439,10 +408,10 @@ uuid = "82899510-4779-5014-852e-03e436cf321d" version = "1.0.0" [[deps.JLD2]] -deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"] -git-tree-sha1 = "bdbe8222d2f5703ad6a7019277d149ec6d78c301" +deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "PrecompileTools", "Reexport", "Requires", "TranscodingStreams", "UUIDs", "Unicode"] +git-tree-sha1 = "67d4690d32c22e28818a434b293a374cc78473d3" uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -version = "0.4.48" +version = "0.4.51" [[deps.JLLWrappers]] deps = ["Artifacts", "Preferences"] @@ -450,18 +419,6 @@ git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" version = "1.5.0" -[[deps.JSON3]] -deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] -git-tree-sha1 = "eb3edce0ed4fa32f75a0a11217433c31d56bd48b" -uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" -version = "1.14.0" - - [deps.JSON3.extensions] - JSON3ArrowExt = ["ArrowTypes"] - - [deps.JSON3.weakdeps] - ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd" - [[deps.JuliaNVTXCallbacks_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "af433a10f3942e882d3c671aacb203e006a5808f" @@ -470,9 +427,9 @@ version = "0.2.1+0" [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "LinearAlgebra", "MacroTools", "PrecompileTools", "Requires", "SparseArrays", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] -git-tree-sha1 = "d0448cebd5919e06ca5edc7a264631790de810ec" +git-tree-sha1 = "0fac59881e91c7233a9b0d47f4b7d9432e534f0f" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" -version = "0.9.22" +version = "0.9.23" [deps.KernelAbstractions.extensions] EnzymeExt = "EnzymeCore" @@ -583,15 +540,15 @@ uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" [[deps.Lz4_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "6c26c5e8a4203d43b5497be3ec5d4e0c3cde240a" +git-tree-sha1 = "7f26c8fc5229e68484e0b3447312c98e16207d11" uuid = "5ced341a-0733-55b8-9ab6-a4889d929147" -version = "1.9.4+0" +version = "1.10.0+0" [[deps.MKL_jll]] deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "oneTBB_jll"] -git-tree-sha1 = "80b2833b56d466b3858d565adcd16a4a05f2089b" +git-tree-sha1 = "f046ccd0c6db2832a9f639e2c669c6fe867e5f4f" uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" -version = "2024.1.0+0" +version = "2024.2.0+0" [[deps.MPI]] deps = ["Distributed", "DocStringExtensions", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "PkgVersion", "PrecompileTools", "Requires", "Serialization", "Sockets"] @@ -609,9 +566,9 @@ version = "0.20.16" [[deps.MPICH_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML"] -git-tree-sha1 = "4099bb6809ac109bfc17d521dad33763bcf026b7" +git-tree-sha1 = "19d4bd098928a3263693991500d05d74dbdc2004" uuid = "7cb0a576-ebde-5e09-9194-50597f1243b4" -version = "4.2.1+1" +version = "4.2.2+0" [[deps.MPIPreferences]] deps = ["Libdl", "Preferences"] @@ -695,26 +652,28 @@ version = "1.2.0" [[deps.OceanBioME]] deps = ["Adapt", "CUDA", "JLD2", "KernelAbstractions", "Oceananigans", "Roots", "StructArrays"] -git-tree-sha1 = "ace4adb0ee38e65c15460a1d29ad0e61929dfbf4" +git-tree-sha1 = "b6a607fa123252f29c2edfc2694ca2418a1a6e43" uuid = "a49af516-9db8-4be4-be45-1dad61c5a376" -version = "0.10.3" +version = "0.10.5" [[deps.Oceananigans]] -deps = ["Adapt", "CUDA", "Crayons", "CubedSphere", "Dates", "Distances", "DocStringExtensions", "FFTW", "Glob", "IncompleteLU", "InteractiveUtils", "IterativeSolvers", "JLD2", "KernelAbstractions", "LinearAlgebra", "Logging", "MPI", "NCDatasets", "OffsetArrays", "OrderedCollections", "PencilArrays", "PencilFFTs", "Pkg", "Printf", "Random", "Rotations", "SeawaterPolynomials", "SparseArrays", "Statistics", "StructArrays"] -git-tree-sha1 = "745b1c19221e09886cae331450a2a4ea73708a38" +deps = ["Adapt", "CUDA", "Crayons", "CubedSphere", "Dates", "Distances", "DocStringExtensions", "FFTW", "Glob", "IncompleteLU", "InteractiveUtils", "IterativeSolvers", "JLD2", "KernelAbstractions", "LinearAlgebra", "Logging", "MPI", "NCDatasets", "OffsetArrays", "OrderedCollections", "Pkg", "Printf", "Random", "Rotations", "SeawaterPolynomials", "SparseArrays", "Statistics", "StructArrays"] +git-tree-sha1 = "88607bd363d8a9b7e002b78a42abcbe39f6adf07" uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09" -version = "0.91.3" +version = "0.91.7" [deps.Oceananigans.extensions] OceananigansEnzymeExt = "Enzyme" + OceananigansMakieExt = "MakieCore" [deps.Oceananigans.weakdeps] Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b" [[deps.OffsetArrays]] -git-tree-sha1 = "e64b4f5ea6b7389f6f046d13d4896a8f9c1ba71e" +git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.14.0" +version = "1.14.1" weakdeps = ["Adapt"] [deps.OffsetArrays.extensions] @@ -732,9 +691,9 @@ version = "0.8.1+2" [[deps.OpenMPI_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML", "Zlib_jll"] -git-tree-sha1 = "a9de2f1fc98b92f8856c640bf4aec1ac9b2a0d86" +git-tree-sha1 = "bfce6d523861a6c562721b262c0d1aaeead2647f" uuid = "fe0851c0-eecd-5654-98d4-656369965a5c" -version = "5.0.3+0" +version = "5.0.5+0" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -759,40 +718,6 @@ git-tree-sha1 = "2cd396108e178f3ae8dedbd8e938a18726ab2fbf" uuid = "c2071276-7c44-58a7-b746-946036e04d0a" version = "0.24.1+0" -[[deps.PackageExtensionCompat]] -git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518" -uuid = "65ce6f38-6b18-4e1d-a461-8949797d7930" -version = "1.0.2" -weakdeps = ["Requires", "TOML"] - -[[deps.Parsers]] -deps = ["Dates", "PrecompileTools", "UUIDs"] -git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821" -uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "2.8.1" - -[[deps.PencilArrays]] -deps = ["Adapt", "JSON3", "LinearAlgebra", "MPI", "OffsetArrays", "Random", "Reexport", "StaticArrayInterface", "StaticArrays", "StaticPermutations", "Strided", "TimerOutputs", "VersionParsing"] -git-tree-sha1 = "fa85ac32172d96cfdb91dbc53e8e57007e5a2b5a" -uuid = "0e08944d-e94e-41b1-9406-dcf66b6a9d2e" -version = "0.19.5" - - [deps.PencilArrays.extensions] - PencilArraysAMDGPUExt = ["AMDGPU"] - PencilArraysDiffEqExt = ["DiffEqBase"] - PencilArraysHDF5Ext = ["HDF5"] - - [deps.PencilArrays.weakdeps] - AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" - DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" - HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" - -[[deps.PencilFFTs]] -deps = ["AbstractFFTs", "FFTW", "LinearAlgebra", "MPI", "PencilArrays", "Reexport", "TimerOutputs"] -git-tree-sha1 = "bd69f3f0ee248cfb4241800aefb705b5ded592ff" -uuid = "4a48f351-57a6-4416-9ec4-c37015456aae" -version = "0.15.1" - [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" @@ -889,9 +814,9 @@ version = "1.3.0" [[deps.Roots]] deps = ["Accessors", "ChainRulesCore", "CommonSolve", "Printf"] -git-tree-sha1 = "1ab580704784260ee5f45bffac810b152922747b" +git-tree-sha1 = "3484138c9fa4296a0cf46a74ca3f97b59d12b1d0" uuid = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" -version = "2.1.5" +version = "2.1.6" [deps.Roots.extensions] RootsForwardDiffExt = "ForwardDiff" @@ -932,9 +857,9 @@ version = "0.3.4" [[deps.SentinelArrays]] deps = ["Dates", "Random"] -git-tree-sha1 = "90b4f68892337554d31cdcdbe19e48989f26c7e6" +git-tree-sha1 = "ff11acffdb082493657550959d4feb4b6149e73a" uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" -version = "1.4.3" +version = "1.4.5" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" @@ -963,28 +888,11 @@ weakdeps = ["ChainRulesCore"] [deps.SpecialFunctions.extensions] SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" -[[deps.Static]] -deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] -git-tree-sha1 = "0bbff21027dd8a107551847528127b62a35f7594" -uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" -version = "1.1.0" - -[[deps.StaticArrayInterface]] -deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] -git-tree-sha1 = "8963e5a083c837531298fc41599182a759a87a6d" -uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" -version = "1.5.1" -weakdeps = ["OffsetArrays", "StaticArrays"] - - [deps.StaticArrayInterface.extensions] - StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" - StaticArrayInterfaceStaticArraysExt = "StaticArrays" - [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "20833c5b7f7edf0e5026f23db7f268e4f23ec577" +git-tree-sha1 = "eeafab08ae20c62c44c8399ccb9354a04b80db50" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.6" +version = "1.9.7" weakdeps = ["ChainRulesCore", "Statistics"] [deps.StaticArrays.extensions] @@ -996,11 +904,6 @@ git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" version = "1.4.3" -[[deps.StaticPermutations]] -git-tree-sha1 = "193c3daa18ff3e55c1dae66acb6a762c4a3bdb0b" -uuid = "15972242-4b8f-49a0-b8a1-9ac0e7a1a45d" -version = "0.3.0" - [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" @@ -1012,22 +915,6 @@ git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" version = "1.7.0" -[[deps.Strided]] -deps = ["LinearAlgebra", "StridedViews", "TupleTools"] -git-tree-sha1 = "bd9bd1c70cfc115cc3a30213fc725125a6b43652" -uuid = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" -version = "2.1.0" - -[[deps.StridedViews]] -deps = ["LinearAlgebra", "PackageExtensionCompat"] -git-tree-sha1 = "2917996ce0fa6b8a3a85240a5e9ff930e2aeaa43" -uuid = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143" -version = "0.3.1" -weakdeps = ["CUDA"] - - [deps.StridedViews.extensions] - StridedViewsCUDAExt = "CUDA" - [[deps.StringManipulation]] deps = ["PrecompileTools"] git-tree-sha1 = "a04cabe79c5f01f4d723cc6704070ada0b9d46d5" @@ -1047,16 +934,6 @@ weakdeps = ["Adapt", "GPUArraysCore", "SparseArrays", "StaticArrays"] StructArraysSparseArraysExt = "SparseArrays" StructArraysStaticArraysExt = "StaticArrays" -[[deps.StructTypes]] -deps = ["Dates", "UUIDs"] -git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" -uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" -version = "1.10.0" - -[[deps.SuiteSparse]] -deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] -uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" - [[deps.SuiteSparse_jll]] deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" @@ -1074,10 +951,10 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" version = "1.0.1" [[deps.Tables]] -deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] -git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297" uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" -version = "1.11.1" +version = "1.12.0" [[deps.Tar]] deps = ["ArgTools", "SHA"] @@ -1107,19 +984,14 @@ uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" version = "0.5.24" [[deps.TranscodingStreams]] -git-tree-sha1 = "d73336d81cafdc277ff45558bb7eaa2b04a8e472" +git-tree-sha1 = "96612ac5365777520c3c5396314c8cf7408f436a" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.10" +version = "0.11.1" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] TestExt = ["Test", "Random"] -[[deps.TupleTools]] -git-tree-sha1 = "41d61b1c545b06279871ef1a4b5fcb2cac2191cd" -uuid = "9d95972d-f1c8-5527-a6e0-b4b365fa01f6" -version = "1.5.0" - [[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" @@ -1138,11 +1010,6 @@ git-tree-sha1 = "bf2c553f25e954a9b38c9c0593a59bb13113f9e5" uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249" version = "0.1.5" -[[deps.VersionParsing]] -git-tree-sha1 = "58d6e80b4ee071f5efd07fda82cb9fbe17200868" -uuid = "81def892-9a0e-5fdd-b105-ffc91e053289" -version = "1.3.0" - [[deps.XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] git-tree-sha1 = "d9717ce3518dc68a99e6b96300813760d887a01d" diff --git a/Project.toml b/Project.toml index 3034125..530d1e9 100644 --- a/Project.toml +++ b/Project.toml @@ -14,8 +14,8 @@ Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665" Adapt = "3.7" CUDA = "5" KernelAbstractions = "0.9.22" -OceanBioME = "0.10.3" -Oceananigans = "0.91.3" +OceanBioME = "0.10.5" +Oceananigans = "0.91.7" Roots = "2" Test = "1.10" julia = "1.10" From 24fbd5e675446a423bd894155500c1b07b62510d Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Thu, 8 Aug 2024 17:49:45 -0400 Subject: [PATCH 3/5] bumped patch --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 530d1e9..5eef3da 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Walrus" uuid = "bec5164f-1c7a-4c32-8768-be9354254d6a" authors = ["Jago Stong-Wright "] -version = "0.5.2" +version = "0.5.3" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" From 36d4bc543654141aef02b267f57db552006b0f1e Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Fri, 9 Aug 2024 12:21:57 -0400 Subject: [PATCH 4/5] fixed erronious `ReturnValues` --- src/radiative_transfer/radiative_transfer.jl | 3 ++- src/surface_heating.jl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/radiative_transfer/radiative_transfer.jl b/src/radiative_transfer/radiative_transfer.jl index 3003bf4..24dbcac 100644 --- a/src/radiative_transfer/radiative_transfer.jl +++ b/src/radiative_transfer/radiative_transfer.jl @@ -8,7 +8,6 @@ module RadiativeTransfer export HomogeneousBodyHeating, PARModelHeating using KernelAbstractions -using Walrus: ReturnValue using Adapt: adapt using Oceananigans.Architectures: architecture @@ -20,6 +19,8 @@ using Oceananigans.Utils: launch! using KernelAbstractions.Extras: @unroll +using Walrus: normalise_surface_function + import Oceananigans.Biogeochemistry: update_biogeochemical_state!, update_tendencies!, AbstractBiogeochemistry import Adapt: adapt_structure diff --git a/src/surface_heating.jl b/src/surface_heating.jl index b124e45..d58ea32 100644 --- a/src/surface_heating.jl +++ b/src/surface_heating.jl @@ -147,7 +147,7 @@ function SurfaceHeatExchange(; wind_stress, air_water_mixing_ratio = 0.001, # kg / kgs stephan_boltzman_constant = 5.670374419e-8) # W / K⁴ - isa(air_temperature, Function) || (air_temperature = ReturnValue(air_temperature)) + air_temperature = normalise_surface_function(air_temperature) return SurfaceHeatExchange(wind_stress, air_temperature, latent_heat_vaporisation, vapour_pressure, From e89f2716c4b386ab59ad2149a36e9d023e76d315 Mon Sep 17 00:00:00 2001 From: Jago Strong-Wright Date: Fri, 9 Aug 2024 12:29:07 -0400 Subject: [PATCH 5/5] fixed docstrings --- src/surface_heating.jl | 10 +++++----- src/wind_stress.jl | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/surface_heating.jl b/src/surface_heating.jl index d58ea32..86e8d59 100644 --- a/src/surface_heating.jl +++ b/src/surface_heating.jl @@ -119,10 +119,10 @@ julia> using Walrus julia> using Oceananigans julia> wind_stress = WindStress(; reference_wind_speed = 0., reference_wind_direction = 90.) -(::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) +(::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) julia> surface_heat_exchange = SurfaceHeatExchange(; wind_stress) -(::SurfaceHeatExchange{WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Walrus.ReturnValue{Int64}, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) (generic function with 1 method) +(::SurfaceHeatExchange{WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Int64, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) (generic function with 1 method) julia> boundary_conditions = (; T = FieldBoundaryConditions(top = FluxBoundaryCondition(surface_heat_exchange, field_dependencies = (:T, :u, :v)))) (T = Oceananigans.FieldBoundaryConditions, with boundary conditions @@ -131,7 +131,7 @@ julia> boundary_conditions = (; T = FieldBoundaryConditions(top = FluxBoundaryCo ├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── bottom: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) -├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::SurfaceHeatExchange{WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Walrus.ReturnValue{Int64}, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) at (Nothing, Nothing, Nothing) +├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::SurfaceHeatExchange{WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Int64, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) at (Nothing, Nothing, Nothing) └── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing),) ``` @@ -190,10 +190,10 @@ Example julia> using Walrus julia> wind_stress = WindStress(; reference_wind_speed = 0., reference_wind_direction = 90.) -(::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) +(::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) julia> surface_heat_exchange = SurfaceHeatExchangeBoundaryCondition(; wind_stress) -FluxBoundaryCondition: ContinuousBoundaryFunction (::SurfaceHeatExchange{WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Walrus.ReturnValue{Int64}, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) at (Nothing, Nothing, Nothing) +FluxBoundaryCondition: DiscreteBoundaryFunction with (::SurfaceHeatExchange{WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}, Int64, Walrus.SurfaceHeatingModel.EmpiricalLatentHeatVaporisation{Float64}, Walrus.SurfaceHeatingModel.AugustRocheMagnusVapourPressure{Float64}, Float64}) ``` """ diff --git a/src/wind_stress.jl b/src/wind_stress.jl index fb534cd..f440d8c 100644 --- a/src/wind_stress.jl +++ b/src/wind_stress.jl @@ -74,7 +74,7 @@ julia> reference_wind_direction = 0. 0.0 julia> wind_stress = WindStress(; reference_wind_speed, reference_wind_direction) -(::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) +(::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) (generic function with 2 methods) julia> boundary_conditions = (u = FieldBoundaryConditions(top = FluxBoundaryCondition(wind_stress, parameters = Val(:x))), v = FieldBoundaryConditions(top = FluxBoundaryCondition(wind_stress, parameters = Val(:y)))) @@ -84,14 +84,14 @@ julia> boundary_conditions = (u = FieldBoundaryConditions(top = FluxBoundaryCond ├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── bottom: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) -├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) +├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) └── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing), v = Oceananigans.FieldBoundaryConditions, with boundary conditions ├── west: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── east: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── bottom: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) -├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) +├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) └── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)) ``` @@ -137,7 +137,7 @@ julia> using Walrus: WindStressBoundaryConditions julia> using Oceananigans julia> wind_stress_boundary_conditions = WindStressBoundaryConditions(; reference_wind_speed = 0.1, reference_wind_direction = 90.) -(u = FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing), v = FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing)) +(u = FluxBoundaryCondition: DiscreteBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) with parameters Val{:x}, v = FluxBoundaryCondition: DiscreteBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) with parameters Val{:y}) julia> boundary_conditions = (u = FieldBoundaryConditions(top = wind_stress_boundary_conditions.u), v = FieldBoundaryConditions(top = wind_stress_boundary_conditions.v)) @@ -147,14 +147,14 @@ julia> boundary_conditions = (u = FieldBoundaryConditions(top = wind_stress_boun ├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── bottom: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) -├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) +├── top: FluxBoundaryCondition: DiscreteBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) with parameters Val{:x} └── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing), v = Oceananigans.FieldBoundaryConditions, with boundary conditions ├── west: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── east: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── south: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── north: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) ├── bottom: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing) -├── top: FluxBoundaryCondition: ContinuousBoundaryFunction (::WindStress{Walrus.ReturnValue{Float64}, Walrus.ReturnValue{Float64}, LogarithmicNeutralWind{Float64, Nothing}, Float64}) at (Nothing, Nothing, Nothing) +├── top: FluxBoundaryCondition: DiscreteBoundaryFunction (::WindStress{Float64, Float64, LogarithmicNeutralWind{Float64, Nothing}, Float64}) with parameters Val{:y} └── immersed: DefaultBoundaryCondition (FluxBoundaryCondition: Nothing)) ```