From 7daec21af5764aef6a9cd888f7b712f53e78d8ec Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 22 Jan 2020 11:52:23 -0700 Subject: [PATCH 1/2] scripts/mkcap.py: change the log message to match the logic for automated unit conversions in ccpp_prebuild.py --- scripts/mkcap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mkcap.py b/scripts/mkcap.py index 70a13420..1820cc04 100755 --- a/scripts/mkcap.py +++ b/scripts/mkcap.py @@ -185,7 +185,7 @@ def convert_to(self, units): function_name = '{0}__to__{1}'.format(string_to_python_identifier(self.units), string_to_python_identifier(units)) try: function = getattr(unit_conversion, function_name) - logging.info('Automatic unit conversion from {0} to {1} for {2} before entering {3}'.format(self.units, units, self.standard_name, self.container)) + logging.info('Automatic unit conversion from {0} to {1} for {2} after returning from {3}'.format(self.units, units, self.standard_name, self.container)) except AttributeError: raise Exception('Error, automatic unit conversion from {0} to {1} for {2} in {3} not implemented'.format(self.units, units, self.standard_name, self.container)) conversion = function() @@ -196,7 +196,7 @@ def convert_from(self, units): function_name = '{1}__to__{0}'.format(string_to_python_identifier(self.units), string_to_python_identifier(units)) try: function = getattr(unit_conversion, function_name) - logging.info('Automatic unit conversion from {0} to {1} for {2} after returning from {3}'.format(self.units, units, self.standard_name, self.container)) + logging.info('Automatic unit conversion from {0} to {1} for {2} before entering {3}'.format(self.units, units, self.standard_name, self.container)) except AttributeError: raise Exception('Error, automatic unit conversion from {1} to {0} for {2} in {3} not implemented'.format(self.units, units, self.standard_name, self.container)) conversion = function() From 745c1132c028d9f13edcc2333e8a1e3c1cf7a6dc Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 23 Jan 2020 15:22:02 -0700 Subject: [PATCH 2/2] scripts/metadata_parser.py: bugfix for converting optional attribute from new to old metadata --- scripts/metadata_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/metadata_parser.py b/scripts/metadata_parser.py index 3b6eafc4..eb64fa2b 100755 --- a/scripts/metadata_parser.py +++ b/scripts/metadata_parser.py @@ -158,7 +158,7 @@ def read_new_metadata(filename, module_name, table_name, scheme_name = None, sub container = container, kind = new_var.get_prop_value('kind'), intent = new_var.get_prop_value('intent'), - optional = new_var.get_prop_value('optional'), + optional = 'T' if new_var.get_prop_value('optional') else 'F', ) # Set rank using integer-setter method var.rank = rank