From b54f81d8debd6dd8f34e72e70cb7aad8a59468c8 Mon Sep 17 00:00:00 2001 From: Darian Boggs Date: Fri, 28 Feb 2025 12:40:09 -0500 Subject: [PATCH 1/4] Add alias Option to ACGv3 --- Apps/MAPL_GridCompSpecs_ACGv3.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Apps/MAPL_GridCompSpecs_ACGv3.py b/Apps/MAPL_GridCompSpecs_ACGv3.py index 59fb0f10a171..b6edcbf6a37b 100755 --- a/Apps/MAPL_GridCompSpecs_ACGv3.py +++ b/Apps/MAPL_GridCompSpecs_ACGv3.py @@ -191,6 +191,7 @@ def get_mandatory_options(cls): 'VLOCATION': ('vlocation', VLOCATION_EMIT), 'VLOC': ('vlocation', VLOCATION_EMIT), # these are Options that are not output but used to write + 'ALIAS': {'writer': identity_writer, 'mandatory': False, 'output': False}, 'CONDITION': ('condition', identity_writer, False, False), 'COND': ('condition', identity_writer, False, False), 'ALLOC': ('alloc', identity_writer, False, False), @@ -460,6 +461,7 @@ def digest(specs, args): for spec in specs[state_intent]: # spec from list dims = None ungridded = None + alias = None option_values = dict() # dict of option values for column in spec: # for spec writer value column_value = spec[column] @@ -477,6 +479,10 @@ def digest(specs, args): dims = option_value elif option == Option.UNGRIDDED: ungridded = option_value + elif option == Option.ALIAS: + alias = option_value + if alias: + option_values[Option.INTERNAL_NAME] = alias # MANDATORY for option in mandatory_options: if option not in option_values: From b2d8b0cbfad96821daed958836866d61ea0c3b57 Mon Sep 17 00:00:00 2001 From: Darian Boggs Date: Fri, 28 Feb 2025 17:06:50 -0500 Subject: [PATCH 2/4] Make new main function for __main__ section --- Apps/MAPL_GridCompSpecs_ACGv3.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Apps/MAPL_GridCompSpecs_ACGv3.py b/Apps/MAPL_GridCompSpecs_ACGv3.py index b6edcbf6a37b..75a44d857c63 100755 --- a/Apps/MAPL_GridCompSpecs_ACGv3.py +++ b/Apps/MAPL_GridCompSpecs_ACGv3.py @@ -551,12 +551,8 @@ def emit_values(specs, args): if f_get_pointers: f_get_pointers.close() - -############################################# -# MAIN program begins here -############################################# - -if __name__ == "__main__": +# Main Procedure (Added to facilitate testing.) +def main(): # Process command line arguments args = get_args() @@ -573,5 +569,12 @@ def emit_values(specs, args): # Emit values emit_values(specs, args) +############################################# +# MAIN program begins here +############################################# + +if __name__ == "__main__": + main() # FIN sys.exit(SUCCESS) + From 91c34426b7bf8a06a76f3f2810356c38a779f098 Mon Sep 17 00:00:00 2001 From: Darian Boggs Date: Mon, 3 Mar 2025 13:26:13 -0500 Subject: [PATCH 3/4] Add alias column and main() function --- Apps/MAPL_GridCompSpecs_ACGv3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apps/MAPL_GridCompSpecs_ACGv3.py b/Apps/MAPL_GridCompSpecs_ACGv3.py index 75a44d857c63..62f516964de8 100755 --- a/Apps/MAPL_GridCompSpecs_ACGv3.py +++ b/Apps/MAPL_GridCompSpecs_ACGv3.py @@ -191,7 +191,7 @@ def get_mandatory_options(cls): 'VLOCATION': ('vlocation', VLOCATION_EMIT), 'VLOC': ('vlocation', VLOCATION_EMIT), # these are Options that are not output but used to write - 'ALIAS': {'writer': identity_writer, 'mandatory': False, 'output': False}, + 'ALIAS': ('alias', identity_writer, False, False), 'CONDITION': ('condition', identity_writer, False, False), 'COND': ('condition', identity_writer, False, False), 'ALLOC': ('alloc', identity_writer, False, False), From 716238c7f89c9e98a5c2bbd8f33e906a5da48402 Mon Sep 17 00:00:00 2001 From: Darian Boggs Date: Tue, 4 Mar 2025 13:31:24 -0500 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b25327c62bb..017d1174c862 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change `run_dt` to `timestep` - Add checks for compatibility between `timestep` and `reference_time` for OuterMetaComponent and user component. - Changed `refTime` (`reference_time`) to `offset` and runTime = refTime + offset +- Add ALIAS column for ACG for MAPL3 ### Changed