Skip to content

Commit

Permalink
add bucket initial condition
Browse files Browse the repository at this point in the history
  • Loading branch information
szy21 committed Dec 16, 2024
1 parent a1c1dc7 commit acf8b9b
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions experiments/ClimaEarth/components/land/climaland_bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,49 @@ function bucket_init(
Y.bucket.Ws .= 0.0
Y.bucket.σS .= 0.0

# overwrite initial conditions
file_path = "/Users/zshen/Work/clima_repo/artifacts/bucket_ic_august.nc"
surface_space = domain.space.surface
subsurface_space = domain.space.subsurface
regridder_type = :InterpolationsRegridder
extrapolation_bc = (
Interpolations.Periodic(),
Interpolations.Flat(),
Interpolations.Flat(),
)
W = SpaceVaryingInput(
file_path,
"W",
surface_space;
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
Ws = SpaceVaryingInput(
file_path,
"Ws",
surface_space;
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
T = SpaceVaryingInput(
file_path,
"T",
subsurface_space;
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
σS = SpaceVaryingInput(
file_path,
"S",
surface_space;
regridder_type,
regridder_kwargs = (; extrapolation_bc,),
)
Y.bucket.W .= W
Y.bucket.σS .= σS
Y.bucket.T .= T
Y.bucket.Ws .= Ws

# Set initial aux variable values
set_initial_cache! = CL.make_set_initial_cache(model)
set_initial_cache!(p, Y, tspan[1])
Expand Down

0 comments on commit acf8b9b

Please sign in to comment.