Skip to contents

Get the variables that are both in the observation and model output

Usage

get_mod_obs_vars(aeme, model, ens_n = 1)

Arguments

aeme

aeme; object.

model

vector; of models to be used. Can be `dy_cd`, `glm_aed`, `gotm_wet`.

ens_n

numeric; ensemble number to allocate to model output which is loaded. Defaults to 1.

Value

A character vector of variables that are in both the observation and model output

Examples

aeme_file <- system.file("extdata/aeme.rds", package = "AEME")
aeme <- readRDS(aeme_file)
path <- tempdir()
model_controls <- get_model_controls(use_bgc = TRUE)
model <- c("glm_aed", "gotm_wet")
aeme <- build_aeme(path = path, aeme = aeme, model = model,
                   model_controls = model_controls,
                   ext_elev = 5, use_bgc = TRUE)
#> Building simulation for Wainamu [2024-11-18 05:19:01]
#> Missing state variables in inflows: PHY_crypt
#> Added default values for missing variables.
#> Using observed water level
#> Missing values in observed water level
#> Using constant water level
#> Correcting water balance using estimated outflows (method = 2).
#> Calculating lake level using lake depth and a sinisoidal function.
#> Building GLM3-AED2 model for lake wainamu
#> Copied in GLM nml file
#> Copied in AED nml file
#>    oxy_initial   = 625 replaced with 312.5
#>    frp_initial = 0.3229 replaced with 0.3229
#>      dop_initial  = 0.3229 replaced with 0.3229
#>      pop_initial  = 0.3229 replaced with 0.3229
#>    amm_initial = 1.4279 replaced with 1.4279
#>    nit_initial = 1.0709 replaced with 1.0709
#>      don_initial  = 21.4183 replaced with 21.4183
#>      pon_initial  = 7.1394 replaced with 7.1394
#>      doc_initial  = 41.6285 replaced with 41.6285
#>      poc_initial  = 16.6514 replaced with 16.6514
#>    rsi_initial = 1 replaced with 1
#> PHY_cyano 0.24022 replaced with 0.24022
#> PHY_green 0.300275 replaced with 0.300275
#> PHY_crypt  replaced with 
#> PHY_diatom 0.300275 replaced with 0.300275
#>     ss_initial   = 3,3 replaced with 3,
#> Building GOTM-WET for lake wainamu
#> Copied all GOTM configuration files
#> instances/abiotic_water/initialization/sO2W 13 replaced with 10
#> instances/abiotic_water/initialization/sPO4W 0.1 replaced with 0.01
#> instances/abiotic_water/initialization/sPDOMW 0.001 replaced with 0.01
#> instances/abiotic_water/initialization/sPPOMW 0.001 replaced with 0.01
#> instances/abiotic_water/initialization/sNH4W 0.05 replaced with 0.02
#> instances/abiotic_water/initialization/sNO3W 0.5 replaced with 0.015
#> instances/abiotic_water/initialization/sNDOMW 0.01 replaced with 0.3
#> instances/abiotic_water/initialization/sNPOMW 0.01 replaced with 0.1
#> instances/abiotic_water/initialization/sDDOMW 2.5 replaced with 0.5
#> instances/abiotic_water/initialization/sDPOMW 0.1 replaced with 0.2
#> instances/abiotic_water/initialization/sSiO2W 3.5 replaced with 1
#> instances/cyanobacteria/initialization/sDW 0.1 replaced with 0.2
#> instances/cyanobacteria/initialization/sNW 0.03 replaced with 0.03
#> instances/cyanobacteria/initialization/sPW 0.003 replaced with 0.0019
#> instances/greens/initialization/sDW 0.1 replaced with 0.1
#> instances/greens/initialization/sNW 0.05 replaced with 0.015
#> instances/greens/initialization/sPW 0.001 replaced with 0.00094
#> instances/diatoms/initialization/sDW 0.2 replaced with 0.25
#> instances/diatoms/initialization/sNW 0.05 replaced with 0.038
#> instances/diatoms/initialization/sPW 0.005 replaced with 0.0024
#> instances/abiotic_water/initialization/sDIMW 4 replaced with 3
# Run models
aeme <- run_aeme(aeme = aeme, model = model, verbose = FALSE,
path = path, model_controls = model_controls,
parallel = TRUE, ncores = 2L)
#> Running models in parallel... [2024-11-18 05:19:05]
#> Model run complete![2024-11-18 05:19:10]
#> Reading models in parallel... [2024-11-18 05:19:10]
#> Model reading complete![2024-11-18 05:19:12]
get_mod_obs_vars(aeme = aeme, model = model)
#>              Cyanobacteria           Dissolved oxygen 
#>                "PHY_cyano"                  "CHM_oxy" 
#>                   Salinity          Water temperature 
#>                 "CHM_salt"                 "HYD_temp" 
#>        Total chlorophyll a   Dissolved organic carbon 
#>                "PHY_tchla"                  "CAR_doc" 
#>                  Phosphate        Ammoniacal nitrogen 
#>                  "PHS_frp"                  "NIT_amm" 
#>                    Nitrate             Total nitrogen 
#>                  "NIT_nit"                   "NIT_tn" 
#>           Total phosphorus          Thermocline depth 
#>                   "PHS_tp"               "HYD_thmcln" 
#>         Centre of buoyancy           Epilimnion depth 
#>               "HYD_ctrbuy"               "HYD_epidep" 
#>          Hypolimnion depth          Schmidt stability 
#>               "HYD_hypdep"               "HYD_schstb" 
#>             Oxycline depth         Epilimnetic oxygen 
#>               "CHM_oxycln"               "CHM_oxyepi" 
#>         Metalimnetic oygen Metalimnetic oxygen minima 
#>               "CHM_oxymet"               "CHM_oxymom" 
#>    Number of anoxic layers      Trophic Level Index 3 
#>               "CHM_oxynal"                 "LKE_tli3" 
#>      Trophic Level Index 4                Water level 
#>                 "LKE_tli4"               "LKE_lvlwtr"