diff --git a/src/diagnostics/bucket_compute_methods.jl b/src/diagnostics/bucket_compute_methods.jl deleted file mode 100644 index 9ab65958f6..0000000000 --- a/src/diagnostics/bucket_compute_methods.jl +++ /dev/null @@ -1,119 +0,0 @@ -# stored in p - -function compute_albedo!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.α_sfc) - else - out .= p.bucket.α_sfc - end -end - -function compute_net_radiation!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.R_n) - else - out .= p.bucket.R_n - end -end - -function compute_surface_temperature!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.T_sfc) - else - out .= p.bucket.T_sfc - end -end - -function compute_surface_specific_humidity!( - out, - Y, - p, - t, - land_model::BucketModel, -) - if isnothing(out) - return copy(p.bucket.q_sfc) - else - out .= p.bucket.q_sfc - end -end - -function compute_latent_heat_flux!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.turbulent_fluxes.lhf) - else - out .= p.bucket.turbulent_fluxes.lhf - end -end - -function compute_aerodynamic_resistance!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.turbulent_fluxes.r_ae) - else - out .= p.bucket.turbulent_fluxes.r_ae - end -end - -function compute_sensible_heat_flux!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.turbulent_fluxes.shf) - else - out .= p.bucket.turbulent_fluxes.shf - end -end - -function compute_vapor_flux!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.turbulent_fluxes.vapor_flux) - else - out .= p.bucket.turbulent_fluxes.vapor_flux - end -end - -function compute_surface_air_density!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(p.bucket.ρ_sfc) - else - out .= p.bucket.ρ_sfc - end -end - -# stored in Y - -function compute_soil_temperature!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(Y.bucket.T) - else - out .= Y.bucket.T - end -end - -function compute_subsurface_water_storage!( - out, - Y, - p, - t, - land_model::BucketModel, -) - if isnothing(out) - return copy(Y.bucket.W) - else - out .= Y.bucket.W - end -end - -function compute_surface_water_content!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(Y.bucket.Ws) - else - out .= Y.bucket.Ws - end -end - -function compute_snow_water_equivalent!(out, Y, p, t, land_model::BucketModel) - if isnothing(out) - return copy(Y.bucket.σS) - else - out .= Y.bucket.σS - end -end diff --git a/src/diagnostics/define_diagnostics.jl b/src/diagnostics/define_diagnostics.jl index b4f24380c2..be87a56edb 100644 --- a/src/diagnostics/define_diagnostics.jl +++ b/src/diagnostics/define_diagnostics.jl @@ -31,7 +31,9 @@ compute function for `land_model`. """ function define_diagnostics!(land_model) - # Stored in p + ### BucketModel ### + + ## Stored in p ## # Albedo add_diagnostic_variable!( @@ -131,7 +133,7 @@ function define_diagnostics!(land_model) compute_surface_air_density!(out, Y, p, t, land_model), ) - # Stored in Y + ## Stored in Y ## # Soil temperature (3D) at depth add_diagnostic_variable!( @@ -179,6 +181,9 @@ function define_diagnostics!(land_model) ###### SoilCanopyModel ###### + ## stored in p ## + + # Soil liquid water add_diagnostic_variable!( short_name = "slw", long_name = "Soil Liquid Water", @@ -189,6 +194,7 @@ function define_diagnostics!(land_model) compute_soil_water_liquid!(out, Y, p, t, land_model), ) + # Infiltration add_diagnostic_variable!( short_name = "infil", long_name = "Infiltration", @@ -199,6 +205,7 @@ function define_diagnostics!(land_model) compute_infiltration!(out, Y, p, t, land_model), ) + # Soil CO2 diffusivity add_diagnostic_variable!( short_name = "scd", long_name = "Soil CO2 Diffusivity", @@ -209,6 +216,7 @@ function define_diagnostics!(land_model) compute_soilco2_diffusivity!(out, Y, p, t, land_model), ) + # Soil CO2 microbial source add_diagnostic_variable!( short_name = "scms", long_name = "Soil CO2 Microbial Source", @@ -219,6 +227,7 @@ function define_diagnostics!(land_model) compute_soilco2_source_microbe!(out, Y, p, t, land_model), ) + # Stomatal conductance add_diagnostic_variable!( short_name = "gs", long_name = "Stomatal Conductance", @@ -229,6 +238,7 @@ function define_diagnostics!(land_model) compute_stomatal_conductance!(out, Y, p, t, land_model), ) + # Medlyn term add_diagnostic_variable!( short_name = "mt", long_name = "Medlyn Term", @@ -239,6 +249,7 @@ function define_diagnostics!(land_model) compute_medlyn_term!(out, Y, p, t, land_model), ) + # Canopy transpiration add_diagnostic_variable!( short_name = "trans", long_name = "Canopy Transpiration", @@ -249,7 +260,8 @@ function define_diagnostics!(land_model) compute_canopy_transpiration!(out, Y, p, t, land_model), ) - add_diagnostic_variable!( # not actually computed, but read from input or atmosphere model, and stored in p... + # Rainfall + add_diagnostic_variable!( short_name = "rain", long_name = "Rainfall", standard_name = "rainfall", @@ -259,6 +271,7 @@ function define_diagnostics!(land_model) compute_rainfall!(out, Y, p, t, land_model), ) + # Leaf net photosynthesis add_diagnostic_variable!( short_name = "an", long_name = "Leaf Net Photosynthesis", @@ -269,6 +282,7 @@ function define_diagnostics!(land_model) compute_photosynthesis_net_leaf!(out, Y, p, t, land_model), ) + # GPP - Gross Primary Productivity add_diagnostic_variable!( short_name = "gpp", long_name = "Gross Primary Productivity", @@ -279,6 +293,7 @@ function define_diagnostics!(land_model) compute_photosynthesis_net_canopy!(out, Y, p, t, land_model), ) + # Leaf respiration add_diagnostic_variable!( short_name = "rd", long_name = "Leaf Respiration", @@ -289,6 +304,7 @@ function define_diagnostics!(land_model) compute_respiration_leaf!(out, Y, p, t, land_model), ) + # Vcmax25 add_diagnostic_variable!( short_name = "vcmax25", long_name = "Vcmax25", @@ -298,6 +314,7 @@ function define_diagnostics!(land_model) compute! = (out, Y, p, t) -> compute_vcmax25!(out, Y, p, t, land_model), ) + # PAR - photosynthetically active radiation add_diagnostic_variable!( short_name = "par", long_name = "Photosynthetically Active Radiation", @@ -314,6 +331,7 @@ function define_diagnostics!(land_model) ), ) + # APAR - absorbed photosynthetically active radiation add_diagnostic_variable!( short_name = "apar", long_name = "Absorbed Photosynthetically Active Radiation", @@ -330,6 +348,7 @@ function define_diagnostics!(land_model) ), ) + # RPAR - reflected photosynthetically active radiation add_diagnostic_variable!( short_name = "rpar", long_name = "Reflected Photosynthetically Active Radiation", @@ -346,6 +365,7 @@ function define_diagnostics!(land_model) ), ) + # TPAR - transmitted photosynthetically active radiation add_diagnostic_variable!( short_name = "tpar", long_name = "Transmitted Photosynthetically Active Radiation", @@ -362,6 +382,7 @@ function define_diagnostics!(land_model) ), ) + # NIR - near infrared radiaton add_diagnostic_variable!( short_name = "nir", long_name = "Near Infrared Radiation", @@ -372,6 +393,7 @@ function define_diagnostics!(land_model) compute_near_infrared_radiation!(out, Y, p, t, land_model), ) + # ANIR - absorbed near infrared radiation add_diagnostic_variable!( short_name = "anir", long_name = "Absorbed Near Infrared Radiation", @@ -382,6 +404,7 @@ function define_diagnostics!(land_model) compute_near_infrared_radiation_absorbed!(out, Y, p, t, land_model), ) + # RNIR - reflected near infrared radiation add_diagnostic_variable!( short_name = "rnir", long_name = "Reflected Near Infrared Radiation", @@ -397,7 +420,8 @@ function define_diagnostics!(land_model) land_model, ), ) - + + # TNIR - transmitted near infrared radiation add_diagnostic_variable!( short_name = "tnir", long_name = "Transmitted Near Infrared Radiation", @@ -414,6 +438,7 @@ function define_diagnostics!(land_model) ), ) + # Net shortwave radiation add_diagnostic_variable!( short_name = "swn", long_name = "Net Shortwave Radiation", @@ -424,6 +449,7 @@ function define_diagnostics!(land_model) compute_radiation_shortwave_net!(out, Y, p, t, land_model), ) + # Net longwave radiation add_diagnostic_variable!( short_name = "lwn", long_name = "Net Longwave Radiation", @@ -434,6 +460,7 @@ function define_diagnostics!(land_model) compute_radiation_longwave_net!(out, Y, p, t, land_model), ) + # Autotrophic respiration add_diagnostic_variable!( short_name = "ra", long_name = "Autotrophic Respiration", @@ -444,6 +471,7 @@ function define_diagnostics!(land_model) compute_autotrophic_respiration!(out, Y, p, t, land_model), ) + # Soil CO2 concentration add_diagnostic_variable!( short_name = "soilco2", long_name = "Soil CO2 concentration", @@ -453,6 +481,7 @@ function define_diagnostics!(land_model) compute! = (out, Y, p, t) -> compute_soilco2!(out, Y, p, t, land_model), ) + # Soil net radiation add_diagnostic_variable!( short_name = "soilrn", long_name = "Soil Net Radiation", @@ -463,6 +492,7 @@ function define_diagnostics!(land_model) compute_soil_net_radiation!(out, Y, p, t, land_model), ) + # Soil latent heat flux add_diagnostic_variable!( short_name = "soillhf", long_name = "Soil Latent Heat Flux", @@ -473,6 +503,7 @@ function define_diagnostics!(land_model) compute_soil_latent_heat_flux!(out, Y, p, t, land_model), ) + # Soil sensible heat flux add_diagnostic_variable!( short_name = "soilshf", long_name = "Soil Sensible Heat Flux", @@ -483,6 +514,7 @@ function define_diagnostics!(land_model) compute_soil_sensible_heat_flux!(out, Y, p, t, land_model), ) + # Soil aerodynamic resistance add_diagnostic_variable!( short_name = "soilrae", long_name = "Soil Aerodynamic Resistance", @@ -493,6 +525,7 @@ function define_diagnostics!(land_model) compute_soil_aerodynamic_resistance!(out, Y, p, t, land_model), ) + # Heterotrophic respiration add_diagnostic_variable!( short_name = "hr", long_name = "Heterotrophic Respiration", @@ -503,6 +536,7 @@ function define_diagnostics!(land_model) compute_heterotrophic_respiration!(out, Y, p, t, land_model), ) + # Soil hydraulic conductivity add_diagnostic_variable!( short_name = "shc", long_name = "Soil Hydraulic Conductivity", @@ -513,6 +547,7 @@ function define_diagnostics!(land_model) compute_soil_hydraulic_conductivity!(out, Y, p, t, land_model), ) + # Soil thermal conductivity add_diagnostic_variable!( short_name = "stc", long_name = "Soil Thermal Conductivity", @@ -523,6 +558,7 @@ function define_diagnostics!(land_model) compute_soil_thermal_conductivity!(out, Y, p, t, land_model), ) + # Soil Water Potential add_diagnostic_variable!( short_name = "swp", long_name = "Soil Water Potential", @@ -533,6 +569,7 @@ function define_diagnostics!(land_model) compute_soil_water_potential!(out, Y, p, t, land_model), ) + # Solar zenith angle add_diagnostic_variable!( short_name = "sza", long_name = "Solar Zenith Angle", @@ -543,6 +580,7 @@ function define_diagnostics!(land_model) compute_solar_zenith_angle!(out, Y, p, t, land_model), ) + # Moisture stress factor add_diagnostic_variable!( short_name = "msf", long_name = "Moisture Stress Factor", @@ -553,6 +591,7 @@ function define_diagnostics!(land_model) compute_moisture_stress_factor!(out, Y, p, t, land_model), ) + # Canopy water potential add_diagnostic_variable!( short_name = "cwp", long_name = "Canopy Water Potential", @@ -563,6 +602,7 @@ function define_diagnostics!(land_model) compute_canopy_water_potential!(out, Y, p, t, land_model), ) + # Cross section add_diagnostic_variable!( short_name = "fa", long_name = "Cross Section", @@ -573,6 +613,7 @@ function define_diagnostics!(land_model) compute_cross_section!(out, Y, p, t, land_model), ) + # Root cross section add_diagnostic_variable!( short_name = "far", long_name = "Root Cross Section", @@ -583,6 +624,7 @@ function define_diagnostics!(land_model) compute_cross_section_roots!(out, Y, p, t, land_model), ) + # Area index add_diagnostic_variable!( short_name = "ai", long_name = "Area Index", @@ -593,6 +635,7 @@ function define_diagnostics!(land_model) compute_area_index!(out, Y, p, t, land_model), ) + # Canopy latent heat flux add_diagnostic_variable!( short_name = "clhf", long_name = "Canopy Latent Heat Flux", @@ -603,6 +646,7 @@ function define_diagnostics!(land_model) compute_canopy_latent_heat_flux!(out, Y, p, t, land_model), ) + # Canopy sensible heat flux add_diagnostic_variable!( short_name = "cshf", long_name = "Canopy Sensible Heat Flux", @@ -613,6 +657,7 @@ function define_diagnostics!(land_model) compute_canopy_sensible_heat_flux!(out, Y, p, t, land_model), ) + # Canopy aerodynamic resistance add_diagnostic_variable!( short_name = "crae", long_name = "Canopy Aerodynamic Resistance", @@ -623,6 +668,7 @@ function define_diagnostics!(land_model) compute_canopy_aerodynamic_resistance!(out, Y, p, t, land_model), ) + # Canopy temperature add_diagnostic_variable!( short_name = "ct", long_name = "Canopy Temperature", @@ -633,6 +679,7 @@ function define_diagnostics!(land_model) compute_canopy_temperature!(out, Y, p, t, land_model), ) + # Soil ice add_diagnostic_variable!( short_name = "si", long_name = "Soil Ice", @@ -642,4 +689,16 @@ function define_diagnostics!(land_model) compute! = (out, Y, p, t) -> compute_soil_ice!(out, Y, p, t, land_model), ) + + # Solar Induced Fluorescence + add_diagnostic_variable!( + short_name = "sif", + long_name = "Solar Induced Fluorescence", + standard_name = "solar_induced_fluorescence", + units = "", + comments = "", + compute! = (out, Y, p, t) -> + compute_solar_induced_fluorescence!(out, Y, p, t, land_model), + ) + end