Skip to content

Commit

Permalink
Clean up based on self-review
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed Nov 8, 2023
1 parent b1b215d commit adeef17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
11 changes: 5 additions & 6 deletions scripts/suite_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,6 @@ def add_var_debug_check(self, var, new_dims):
# to the list of variables to check. Record which dummy to use.
subst_dict = {'dimensions':new_dims}
clone = var.clone(subst_dict)
if var.get_prop_value('local_name') == 'cld_liq_array':
print(f"adding var debug check for {var} with dimensions old/new {var.get_dimensions()} / {new_dims}, run phase? {self.run_phase()}")
self.__var_debug_checks.append([clone, dummy])

def write_var_debug_check(self, var, dummy, cldicts, outfile, errcode, errmsg, indent):
Expand All @@ -1293,11 +1291,9 @@ def write_var_debug_check(self, var, dummy, cldicts, outfile, errcode, errmsg, i
active = var.get_prop_value('active')
pointer = var.get_prop_value('pointer')
allocatable = var.get_prop_value('allocatable')
# DH* TEST
# The order is important to get the correct local name - DH* not sure ...
#var_dicts = [ self.__group.call_list ] + self.__group.suite_dicts()
var_dicts = cldicts
# *DH

# Need the local name as it comes from the group call list
# or from the suite, not how it is called in the scheme (var)
Expand Down Expand Up @@ -1360,7 +1356,10 @@ def write_var_debug_check(self, var, dummy, cldicts, outfile, errcode, errmsg, i
else:
# I don't know how to do this better. Schemes can rely on the host cap
# passing arrays such that the horizontal dimension of the variable
# seen by the scheme runs from 1:ncol (horizontal_loop_extent)
# seen by the scheme runs from 1:ncol (horizontal_loop_extent). But
# module variables for this group are passed to the schemes with the
# horizontal dimensions in the call dimstring. And it all depends
# on the phase, too.
if is_horizontal_dimension(dim):
if self.run_phase():
if self.find_variable(standard_name="horizontal_loop_extent"):
Expand Down Expand Up @@ -1393,7 +1392,7 @@ def write_var_debug_check(self, var, dummy, cldicts, outfile, errcode, errmsg, i
# Assemble dimensions and bounds for size checking
dim_length = f'{udim_lname}-{ldim_lname}+1'
if is_horizontal_dimension(dim):
# Is var in the call list or a module variable of this group?
# See comment above on call list variables vs module variables
if not var_in_call_list:
dim_strings.append(f"{ldim_lname}:{udim_lname}")
lbound_strings.append(ldim_lname)
Expand Down
Empty file modified test/advection_test/test_reports.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion test/capgen_test/test_host_data.meta
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
kind = kind_phys
units = kg kg-1
dimensions = (horizontal_dimension, vertical_layer_dimension)
active = (index_of_water_vapor_specific_humidity > 0)
active = (index_of_water_vapor_specific_humidity > 0)
5 changes: 0 additions & 5 deletions test/capgen_test/test_reports.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -174,23 +174,18 @@ def check_datatable(database, report_type, check_list,
value="ddt_suite"),
_OUTPUT_VARS_DDT)
print("\nChecking variables for temp suite from python")
print("HERE 0")
NUM_ERRORS += check_datatable(_DATABASE, DatatableReport("required_variables",
value="temp_suite"),
_REQUIRED_VARS_TEMP + _PROT_VARS_TEMP)
print("HERE A")
NUM_ERRORS += check_datatable(_DATABASE, DatatableReport("required_variables",
value="temp_suite"),
_REQUIRED_VARS_TEMP, excl_prot=True)
print("HERE B")
NUM_ERRORS += check_datatable(_DATABASE, DatatableReport("input_variables",
value="temp_suite"),
_INPUT_VARS_TEMP + _PROT_VARS_TEMP)
print("HERE C")
NUM_ERRORS += check_datatable(_DATABASE, DatatableReport("input_variables",
value="temp_suite"),
_INPUT_VARS_TEMP, excl_prot=True)
print("HERE Z")
NUM_ERRORS += check_datatable(_DATABASE, DatatableReport("output_variables",
value="temp_suite"),
_OUTPUT_VARS_TEMP)
Expand Down

0 comments on commit adeef17

Please sign in to comment.