From ae1a2d0ca76e4314dffe12e8842883ee74bd5b8d Mon Sep 17 00:00:00 2001 From: lisarennels Date: Tue, 23 Apr 2024 15:24:19 -0700 Subject: [PATCH] Correct the get ag damage function name util --- src/utils/utils.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/utils.jl b/src/utils/utils.jl index 08cb401..3243fd6 100644 --- a/src/utils/utils.jl +++ b/src/utils/utils.jl @@ -13,5 +13,11 @@ Return the name of the Moore agriculture GTAP damage function specification in model `m`. This is a small helper function useful for internals like the mcs. """ function _get_mooreag_gtap(m::Model) - return m.md.namespace[:Agriculture].namespace[:gtap_label] + + # model may not have been run yet, so need to get model parameter name to look + # up the value + model_param_name = Mimi.get_model_param_name(m, :Agriculture, :gtap_name) + Agriculture_gtap = Mimi.model_param(m, model_param_name).value + + return Agriculture_gtap end