@@ -163,7 +163,7 @@ def call_string(self, cldicts=None, is_func_call=False, subname=None, sub_lname_
163
163
# If so, change Var's local_name need to local dummy array containing
164
164
# transformed argument, var_trans_local.
165
165
if sub_lname_list :
166
- for (sname , var_trans_local ) in sub_lname_list :
166
+ for (var_trans_local , var_lname , sname , rindices , lindices , compat_obj , __ ) in sub_lname_list :
167
167
if (sname == stdname ):
168
168
lname = var_trans_local
169
169
# end if
@@ -1115,8 +1115,6 @@ def __init__(self, scheme_xml, context, parent, run_env):
1115
1115
self .__var_debug_checks = list ()
1116
1116
self .__forward_transforms = list ()
1117
1117
self .__reverse_transforms = list ()
1118
- self .__forward_sub_lname_list = list ()
1119
- self .__reverse_sub_lname_list = list ()
1120
1118
self ._has_run_phase = True
1121
1119
self .__optional_vars = list ()
1122
1120
super ().__init__ (name , context , parent , run_env , active_call_list = True )
@@ -1675,10 +1673,9 @@ def add_var_transform(self, var, compat_obj, vert_dim):
1675
1673
compat_obj .v1_stdname ))
1676
1674
self .__reverse_transforms .append ([local_trans_var .get_prop_value ('local_name' ),
1677
1675
var .get_prop_value ('local_name' ),
1676
+ var .get_prop_value ('standard_name' ),
1678
1677
rindices , lindices , compat_obj ,
1679
1678
var .get_prop_value ('standard_name' )])
1680
- self .__reverse_sub_lname_list .append ([var .get_prop_value ('standard_name' ),
1681
- local_trans_var .get_prop_value ('local_name' )])
1682
1679
# end if
1683
1680
# Register any forward (post-Scheme) transforms.
1684
1681
if (var .get_prop_value ('intent' ) != 'in' ):
@@ -1688,10 +1685,9 @@ def add_var_transform(self, var, compat_obj, vert_dim):
1688
1685
compat_obj .v1_stdname ,
1689
1686
compat_obj .v2_stdname ))
1690
1687
self .__forward_transforms .append ([var .get_prop_value ('local_name' ),
1688
+ var .get_prop_value ('standard_name' ),
1691
1689
local_trans_var .get_prop_value ('local_name' ),
1692
1690
lindices , rindices , compat_obj ])
1693
- self .__forward_sub_lname_list .append ([var .get_prop_value ('standard_name' ),
1694
- local_trans_var .get_prop_value ('local_name' )])
1695
1691
# end if
1696
1692
def write_var_transform (self , var , dummy , rindices , lindices , compat_obj ,
1697
1693
outfile , indent , forward ):
@@ -1735,7 +1731,7 @@ def write(self, outfile, errcode, errmsg, indent):
1735
1731
my_args = self .call_list .call_string (cldicts = cldicts ,
1736
1732
is_func_call = True ,
1737
1733
subname = self .subroutine_name ,
1738
- sub_lname_list = self .__reverse_sub_lname_list )
1734
+ sub_lname_list = self .__reverse_transforms )
1739
1735
#
1740
1736
outfile .write ('' , indent )
1741
1737
outfile .write ('if ({} == 0) then' .format (errcode ), indent )
@@ -1763,14 +1759,13 @@ def write(self, outfile, errcode, errmsg, indent):
1763
1759
if len (self .__reverse_transforms ) > 0 :
1764
1760
outfile .comment ('Compute reverse (pre-scheme) transforms' , indent + 1 )
1765
1761
# end if
1766
- for rcnt , (dummy , var , rindices , lindices , compat_obj , __ ) in enumerate (self .__reverse_transforms ):
1762
+ for rcnt , (dummy , var_lname , var_sname , rindices , lindices , compat_obj , __ ) in enumerate (self .__reverse_transforms ):
1767
1763
# Any transform(s) were added during the Group's analyze phase, but
1768
1764
# the local_name(s) of the <var> assoicated with the transform(s)
1769
1765
# may have since changed. Here we need to use the standard_name
1770
1766
# from <var> and replace its local_name with the local_name from the
1771
1767
# Group's call_list.
1772
- lname = self .__reverse_sub_lname_list [rcnt ][0 ]
1773
- lvar = self .__group .call_list .find_variable (standard_name = lname )
1768
+ lvar = self .__group .call_list .find_variable (standard_name = var_sname )
1774
1769
lvar_lname = lvar .get_prop_value ('local_name' )
1775
1770
tstmt = self .write_var_transform (lvar_lname , dummy , rindices , lindices , compat_obj , outfile , indent + 1 , False )
1776
1771
# end for
@@ -1812,16 +1807,15 @@ def write(self, outfile, errcode, errmsg, indent):
1812
1807
if len (self .__forward_transforms ) > 0 :
1813
1808
outfile .comment ('Compute forward (post-scheme) transforms' , indent + 1 )
1814
1809
# end if
1815
- for fcnt , (var , dummy , lindices , rindices , compat_obj ) in enumerate (self .__forward_transforms ):
1810
+ for fcnt , (var_lname , var_sname , dummy , lindices , rindices , compat_obj ) in enumerate (self .__forward_transforms ):
1816
1811
# Any transform(s) were added during the Group's analyze phase, but
1817
1812
# the local_name(s) of the <var> assoicated with the transform(s)
1818
1813
# may have since changed. Here we need to use the standard_name
1819
1814
# from <var> and replace its local_name with the local_name from the
1820
1815
# Group's call_list.
1821
- lname = self .__forward_sub_lname_list [fcnt ][0 ]
1822
- lvar = self .__group .call_list .find_variable (standard_name = lname )
1816
+ lvar = self .__group .call_list .find_variable (standard_name = var_sname )
1823
1817
lvar_lname = lvar .get_prop_value ('local_name' )
1824
- tstmt = self .write_var_transform (var , dummy , rindices , lindices , compat_obj , outfile , indent + 1 , True )
1818
+ tstmt = self .write_var_transform (lvar_lname , dummy , rindices , lindices , compat_obj , outfile , indent + 1 , True )
1825
1819
# end for
1826
1820
outfile .write ('' , indent )
1827
1821
outfile .write ('end if' , indent )
0 commit comments