Skip to content

Commit

Permalink
generalize_drivers, organic carbon driver
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Jul 15, 2024
1 parent 2c7efd9 commit 9cb3c6d
Show file tree
Hide file tree
Showing 44 changed files with 230 additions and 176 deletions.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ ClimaLand.jl Release Notes

main
--------
- PR[#690] Use the soil parameters in creating the biogeochemistry SoilMet driver for consistency.
- Use the soil parameters in creating the biogeochemistry SoilMet driver for consistency.
PR[#690](https://github.com/CliMA/ClimaLand.jl/pull/690)
- ![][badge-💥breaking] Generalize our forcing ``drivers" to include prescribed soil organic carbon
PR[#692](https://github.com/CliMA/ClimaLand.jl/pull/692)
- Add a long run with diagnostics
PR[#688](https://github.com/CliMA/ClimaLand.jl/pull/688)

v0.13.0
--------
- NOTE: the breaking PR below was merged by accident in v0.12.5
Expand Down
1 change: 0 additions & 1 deletion docs/src/APIs/SoilBiogeochemistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ClimaLand.Soil.Biogeochemistry.AtmosCO2StateBC
ClimaLand.Soil.Biogeochemistry.AbstractSoilDriver
ClimaLand.Soil.Biogeochemistry.SoilDrivers
ClimaLand.Soil.Biogeochemistry.PrescribedMet
ClimaLand.Soil.Biogeochemistry.PrescribedSOC
```

## Functions of State
Expand Down
1 change: 1 addition & 0 deletions docs/src/APIs/shared_utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ ClimaLand.get_drivers
ClimaLand.PrescribedAtmosphere
ClimaLand.PrescribedPrecipitation
ClimaLand.PrescribedRadiativeFluxes
ClimaLand.PrescribedSoilOrganicCarbon
ClimaLand.CoupledAtmosphere
ClimaLand.CoupledRadiativeFluxes
ClimaLand.AbstractAtmosphericDrivers
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/integrated/soil_canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}
soilco2_ps = SoilCO2ModelParameters(FT);

# soil microbes args
Csom = (z, t) -> eltype(z)(5); # kg C m⁻³, this is a guess, not measured at the site
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
soilco2_bot_bc = Soil.Biogeochemistry.SoilCO2StateBC((p, t) -> 0.0);
Expand Down Expand Up @@ -390,7 +390,8 @@ sv = (;
saveval = Array{NamedTuple}(undef, length(saveat)),
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
updateat = Array(t0:1800:tf)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/standalone/Bucket/bucket_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ saved_values = (;
);
saving_cb = ClimaLand.NonInterpSavingCallback(saved_values, saveat);
updateat = copy(saveat)
updatefunc = ClimaLand.make_update_drivers(bucket_atmos, bucket_rad)
model_drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/standalone/Canopy/canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat);
# Create the callback function which updates the forcing variables,
# or drivers.
updateat = Array(t0:1800:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(canopy)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/standalone/Soil/evaporation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(soil)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
6 changes: 4 additions & 2 deletions docs/tutorials/standalone/Soil/evaporation_gilat_loess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(soil)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)
sol = SciMLBase.solve(prob, ode_algo; dt = dt, callback = cb, saveat = saveat)
Expand Down Expand Up @@ -315,7 +316,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(soil)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)
sol_no_drainage =
Expand Down
3 changes: 2 additions & 1 deletion docs/tutorials/standalone/Soil/sublimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(soil)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
3 changes: 2 additions & 1 deletion experiments/benchmarks/bucket.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ function setup_prob(t0, tf, Δt; nelements = (100, 10))
p,
)
updateat = collect(t0:(3Δt):tf)
updatefunc = ClimaLand.make_update_drivers(bucket_atmos, bucket_rad)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb)

Expand Down
5 changes: 3 additions & 2 deletions experiments/benchmarks/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -591,7 +591,8 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
)

updateat = Array(t0:(3600 * 3):tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
return prob, cb
end
Expand Down
3 changes: 2 additions & 1 deletion experiments/benchmarks/richards.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ function setup_prob(t0, tf, Δt; nelements = (101, 15))
p,
)
updateat = Array(t0:(2Δt):tf)
updatefunc = ClimaLand.make_update_drivers(atmos, nothing)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb)

Expand Down
6 changes: 3 additions & 3 deletions experiments/integrated/fluxnet/ozark_pft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}

soilco2_ps = SoilCO2ModelParameters(FT)

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -298,7 +297,8 @@ saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
## How often we want to update the drivers. Note that this uses the defined `t0` and `tf`
## defined in the simulatons file
updateat = Array(t0:DATA_DT:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
6 changes: 3 additions & 3 deletions experiments/integrated/fluxnet/run_fluxnet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}

soilco2_ps = SoilCO2ModelParameters(FT)

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -254,7 +253,8 @@ saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
## How often we want to update the drivers. Note that this uses the defined `t0` and `tf`
## defined in the simulatons file
updateat = Array(t0:DATA_DT:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
model_drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(model_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
5 changes: 3 additions & 2 deletions experiments/integrated/global/global_soil_canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ soil_model_type = Soil.EnergyHydrology{FT}
soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -368,7 +368,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = Array(t0:(3600 * 3):tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)
@time sol = SciMLBase.solve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ for float_type in (Float32, Float64)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)

updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
prob = SciMLBase.ODEProblem(
CTS.ClimaODEFunction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}
soilco2_ps = SoilCO2ModelParameters(FT)

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down
11 changes: 7 additions & 4 deletions experiments/integrated/performance/profile_allocations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}
soilco2_ps = SoilCO2ModelParameters(FT)

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -339,7 +339,8 @@ ode_algo = CTS.IMEXAlgorithm(
),
);

updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
# Set initial conditions
Y, p = set_initial_conditions(land, t0)
Expand Down Expand Up @@ -370,7 +371,8 @@ if PROFILING
# Now that we compiled, solve again but collect profiling information
Y, p = set_initial_conditions(land, t0)
updateat = Array(t0:dt:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
prob = SciMLBase.ODEProblem(
CTS.ClimaODEFunction(
Expand All @@ -394,7 +396,8 @@ if PROFILING
@info "Save compute flame to flame_file"
Y, p = set_initial_conditions(land, t0)
updateat = Array(t0:dt:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
prob = SciMLBase.ODEProblem(
CTS.ClimaODEFunction(
Expand Down
5 changes: 3 additions & 2 deletions experiments/long_runs/land.jl
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
soilco2_type = Soil.Biogeochemistry.SoilCO2Model{FT}

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

# Set the soil CO2 BC to being atmospheric CO2
soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
Expand Down Expand Up @@ -590,7 +590,8 @@ function setup_prob(t0, tf, Δt; outdir = outdir, nelements = (101, 15))
)

updateat = Array(t0:(3600 * 3):tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(drivers)

# ClimaDiagnostics

Expand Down
5 changes: 3 additions & 2 deletions experiments/standalone/Biogeochemistry/experiment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ for (FT, tf) in ((Float32, 2 * dt), (Float64, tf))
)

# Make biogeochemistry model args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

co2_parameters = Soil.Biogeochemistry.SoilCO2ModelParameters(FT)
C = FT(100)
Expand Down Expand Up @@ -165,7 +165,8 @@ for (FT, tf) in ((Float32, 2 * dt), (Float64, tf))
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = deepcopy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, nothing)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Bucket/global_bucket_staticmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ saved_values = (;
);
saving_cb = ClimaLand.NonInterpSavingCallback(saved_values, saveat);
updateat = copy(saveat)
updatefunc = ClimaLand.make_update_drivers(bucket_atmos, bucket_rad)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Bucket/global_bucket_temporalmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ function setup_prob(t0, tf, Δt)
)
saving_cb = ClimaLand.NonInterpSavingCallback(saved_values, saveat)
updateat = copy(saveat)
updatefunc = ClimaLand.make_update_drivers(bucket_atmos, bucket_rad)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Snow/snow_cdp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ sv = (;
);
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat);
updateat = copy(saveat)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Soil/richards_runoff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ sv = (;
)
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat)
updateat = Array(t0:dt:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, nothing)
drivers = ClimaLand.get_drivers(model)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)
sol = @time SciMLBase.solve(prob, ode_algo; dt = dt, saveat = dt, callback = cb)
Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Vegetation/no_vegetation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ sv = (;
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat);

updateat = Array(t0:1800:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(canopy)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Vegetation/varying_lai.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ sv = (;
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat);

updateat = Array(t0:1800:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(canopy)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
3 changes: 2 additions & 1 deletion experiments/standalone/Vegetation/varying_lai_with_stem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ sv = (;
saving_cb = ClimaLand.NonInterpSavingCallback(sv, saveat);

updateat = Array(t0:1800:tf)
updatefunc = ClimaLand.make_update_drivers(atmos, radiation)
drivers = ClimaLand.get_drivers(canopy)
updatefunc = ClimaLand.make_update_drivers(drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb);

Expand Down
5 changes: 3 additions & 2 deletions lib/ClimaLandSimulations/src/Fluxnet/run_fluxnet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function run_fluxnet(
)

# soil microbes args
Csom = (z, t) -> eltype(z)(5.0)
Csom = ClimaLand.PrescribedSoilOrganicCarbon{FT}(TimeVaryingInput((t) -> 5))

soilco2_top_bc = Soil.Biogeochemistry.AtmosCO2StateBC()
soilco2_bot_bc = Soil.Biogeochemistry.SoilCO2FluxBC((p, t) -> 0.0) # no flux
Expand Down Expand Up @@ -286,7 +286,8 @@ function run_fluxnet(
## How often we want to update the drivers. Note that this uses the defined `t0` and `tf`
## defined in the simulatons file
updateat = Array((setup.t0):(drivers.DATA_DT):(timestepper.tf))
updatefunc = ClimaLand.make_update_drivers(drivers.atmos, drivers.radiation)
land_drivers = ClimaLand.get_drivers(land)
updatefunc = ClimaLand.make_update_drivers(land_drivers)
driver_cb = ClimaLand.DriverUpdateCallback(updateat, updatefunc)
cb = SciMLBase.CallbackSet(driver_cb, saving_cb)

Expand Down
Loading

0 comments on commit 9cb3c6d

Please sign in to comment.