pyaerocom icon indicating copy to clipboard operation
pyaerocom copied to clipboard

Wet deposition variables in EMEP config fail due to units

Open thorbjoernl opened this issue 7 months ago • 0 comments

Describe the bug Please provide a clear and concise description of what the bug is.

  • Pyaerocom version: v0.31.dev0
  • Computing platform: NA
  • Configuration file (if applicable):
import os
import pyaerocom as pya
from pyaerocom import const
from pyaerocom.aeroval import EvalSetup, ExperimentProcessor

from pyaerocom.aeroval.config.emep.reporting_base import get_CFG

#exec(open("../utils.py").read())

# Setup for models used in analysis
apx = "_FFmod"
CFG = get_CFG(
    reportyear=2024,
    year=2022,
    model_dir=f"/lustre/storeB/project/fou/kl/emep/ModelRuns/2024_REPORTING/EMEP01_rv5.3_year2022_Status_Rep2024_FFmod",
)

# Comparison of several models
# MODEL = CFG["model_cfg"]["EMEP"]
# for apx in ("FFmod", "FFmodvrs", "FFavg", "PBAP"):
#     CFG["model_cfg"][apx] = MODEL.copy()
#     CFG["model_cfg"][apx]["model_data_dir"] += f"_{apx}"
#     CFG["model_cfg"][apx]["model_id"] = apx
# CFG["model_cfg"]["PBAP"][
#     "model_data_dir"
# ] = "/lustre/storeB/users/gunnarfl/emep/fine/2022_fine_new_PM10/"
# del CFG["model_cfg"]["EMEP"]

# change some config settings, usually not needed
CFG.update(
    dict(
        json_basedir=os.path.abspath("./data"),
        coldata_basedir=os.path.abspath("../../aeroval/coldata"),
        proj_id="emep2024-test",
        exp_id="emep2024-20250508",
        raise_exceptions=False,
        exp_descr=f"Test run of 2024 EMEP reporting for station types branch.",
        exp_pi="[email protected]",
        # exp_name="Evaluation of EMEP runs for 2023 EMEP reporting",
        #exp_descr=(
        #    f"Evaluation of EMEP runs for 2024 EMEP reporting. /lustre/storeB/project/fou/kl/emep/ModelRuns/2024_REPORTING/EMEP01_rv5.3_year2022_Status_Rep2024_*/, is compared against observations from EEA and EBAS."
        #),
        # exp_pi="S. Tsyro, H. Klein",
        add_model_maps=False,
    )
)

#for obs in list(CFG["obs_cfg"].keys()):
#    if obs.startswith("EEA"):
#        del CFG["obs_cfg"][obs]
#        print(f"removed {obs}")

del CFG["var_scale_colmap_file"]
# remove EEA
for obs in list(CFG["obs_cfg"].keys()):
    #if obs.startswith("EEA"):
    if obs not in ["EBAS-d-wet", "EBAS-m-wet"]:
        del CFG["obs_cfg"][obs]
        print(f"removed {obs}")


CFG["add_model_maps"] = False
# remove "concCocpm10", not in model-output # now it is there
# for obs in CFG["obs_cfg"]:
#     if "concCocpm10" in CFG["obs_cfg"][obs]["obs_vars"]:
#         CFG["obs_cfg"][obs]["obs_vars"].remove("concCocpm10")

# remove "no, pm10, pm25" from EBAS-hourly
#CFG["obs_cfg"]["EBAS-h-diurnal"]["obs_vars"].remove("concNno")
#CFG["obs_cfg"]["EBAS-h-diurnal"]["obs_vars"].remove("concpm10")
#CFG["obs_cfg"]["EBAS-h-diurnal"]["obs_vars"].remove("concpm25")

#for k, ocfg in CFG["obs_cfg"].items():
#     for var in ocfg["obs_vars"]:
#          CFG["obs_cfg"][k]["obs_vars"] = [v for v in CFG["obs_cfg"][k]["obs_vars"] if v.startswith("conc")]
#          #if var.startswith("conc"):
#          #     print(f"{var} removed from ocfg")
#          #     CFG["obs_cfg"][k]["obs_vars"].remove(var)

# try to run anything, but don't fail on error
# CFG["raise_exceptions"] = False


stp = EvalSetup(**CFG)

cdir = "./cache"
os.makedirs(cdir, exist_ok=True)
const.CACHEDIR = cdir

ana = ExperimentProcessor(stp)
ana.update_interface()

# run everything
res = ana.run()


# examples for running only some parts

# for var in [
#     "concpm10",
#     "concpm25",
#     "concSso2",
#     "concNno2",
#     "vmro3max",
# ]:

#     res = ana.run(obs_name="EEA-d-rural", var_list=[var], model_name="EMEP")

# for var in ["vmro3", "concNno2"]:
#     res = ana.run(obs_name="EEA-h-diurnal-rural", var_list=[var], model_name="EMEP")

# res = ana.run(obs_name="EEA-h-ox-rural-diu", model_name="EMEP")

# res = ana.run(obs_name="EEA-d-rural-no", var_list=["concNno"], model_name="EMEP")
# res = ana.run(obs_name="EEA-d-ox-rural", model_name="EMEP")

# res = ana.run(obs_name="EBAS-d-*", model_name="status-2023")
# res = ana.run(obs_name="EBAS-m-*", model_name="EMEP")

# res = ana.run(obs_name="AERONET", model_name="EMEP")

# res = ana.run(
#     obs_name="EBAS-d-tc-ecoc",
#     var_list=["concCecpm25"],
#     model_name="EMEP-EC",
# )

# res = ana.run(
#     obs_name="EBAS-m-tc-ecoc",
#     var_list=["concCecpm25"],
#     model_name="EMEP",
# )

  • Error message (if applicable):
2025-05-08 15:17:31:pyaerocom.colocation.colocator:272/277M:WARNING:Failed to load model data: EMEP (wetoxs). Reason [UT_UNKNOWN] Fail
ed to parse unit "mgS/m2"
2025-05-08 15:17:31:pyaerocom.colocation.colocator:272/277M:WARNING:Failed to load model data: EMEP (wetoxn). Reason [UT_UNKNOWN] Fail
ed to parse unit "mgN/m2"
2025-05-08 15:17:31:pyaerocom.colocation.colocator:272/277M:WARNING:Failed to load model data: EMEP (wetrdn). Reason [UT_UNKNOWN] Fail
ed to parse unit "mgN/m2"

To Reproduce Steps to reproduce the behavior:

  1. Run the config.
  2. Notice the error messages in log and no output for variables.

Expected behavior No error message and output on aeroval.

Screenshots NA

Additional context NA

thorbjoernl avatar May 08 '25 15:05 thorbjoernl