Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Aug 5, 2024
1 parent 0e97074 commit 2046e89
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 7 additions & 1 deletion docs/src/diagnostics/make_diagnostic_table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ for d in values(CL.Diagnostics.ALL_DIAGNOSTICS)
push!(standard_names, d.standard_name)
end
i = sortperm(short_names) # indices of short_names sorted alphabetically
data = hcat(short_names[i], long_names[i], units[i], comments[i], standard_names[i])
data = hcat(
short_names[i],
long_names[i],
units[i],
comments[i],
standard_names[i],
)
pretty_table(
data;
autowrap = true,
Expand Down
6 changes: 3 additions & 3 deletions src/diagnostics/define_diagnostics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function define_diagnostics!(land_model)
short_name = "infil",
long_name = "Infiltration",
standard_name = "infiltration",
units = "m s^-1",
units = "m s^-1",
comments = "The flux of liquid water into the soil.",
compute! = (out, Y, p, t) ->
compute_infiltration!(out, Y, p, t, land_model),
Expand All @@ -221,7 +221,7 @@ function define_diagnostics!(land_model)
short_name = "scms",
long_name = "Soil CO2 Microbial Source",
standard_name = "soil_co2_microbial_source",
units = "kg CO2 m^-2 s^-1",
units = "kg CO2 m^-2 s^-1",
comments = "The production of CO2 by microbes in the soil. Vary by layers of soil depth.",
compute! = (out, Y, p, t) ->
compute_soilco2_source_microbe!(out, Y, p, t, land_model),
Expand Down Expand Up @@ -254,7 +254,7 @@ function define_diagnostics!(land_model)
short_name = "trans",
long_name = "Canopy Transpiration",
standard_name = "canopy_transpiration",
units = "m s^-1",
units = "m s^-1",
comments = "The water evaporated from the canopy due to leaf transpiration.",
compute! = (out, Y, p, t) ->
compute_canopy_transpiration!(out, Y, p, t, land_model),
Expand Down
9 changes: 5 additions & 4 deletions src/diagnostics/land_compute_methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ end

### BucketModel ###

# variables stored in p
# variables stored in p (diagnostics variables stored in the cache)
@land_compute "aerodynamic_resistance" BucketModel p.bucket.turbulent_fluxes.r_ae
@land_compute "albedo" BucketModel p.bucket.α_sfc
@land_compute "latent_heat_flux" BucketModel p.bucket.turbulent_fluxes.lhf
Expand All @@ -49,15 +49,15 @@ end
@land_compute "surface_temperature" BucketModel p.bucket.T_sfc
@land_compute "vapor_flux" BucketModel p.bucket.turbulent_fluxes.vapor_flux

# variables stored in Y
# variables stored in Y (prognostic or state variables)
@land_compute "snow_water_equivalent" BucketModel Y.bucket.σS
@land_compute "soil_temperature" BucketModel Y.bucket.T
@land_compute "subsurface_water_storage" BucketModel Y.bucket.W
@land_compute "surface_water_content" BucketModel Y.bucket.Ws

### SoilCanopyModel ###

# variables stored in p
# variables stored in p (diagnostics variables stored in the cache)

## Canopy Module ##

Expand Down Expand Up @@ -139,7 +139,8 @@ end
@land_compute "soilco2_diffusivity" SoilCanopyModel p.soilco2.D
@land_compute "soilco2_source_microbe" SoilCanopyModel p.soilco2.Sm

# variables stored in Y
# variables stored in Y (prognostic or state variables)

@land_compute "canopy_temperature" SoilCanopyModel Y.canopy.energy.T
@land_compute "soil_ice" SoilCanopyModel top_center_to_surface(Y.soil.θ_i)
@land_compute "soilco2" SoilCanopyModel Y.soilco2.C

0 comments on commit 2046e89

Please sign in to comment.