Skip to content

Commit

Permalink
add to the argument list for the init phase group cap rather than set…
Browse files Browse the repository at this point in the history
… the entire intialized array
  • Loading branch information
grantfirl committed Oct 12, 2023
1 parent 16402ad commit 10fd091
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/mkstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,14 @@ def write(self, metadata_request, metadata_define, arguments, debug):
if subcycle_body:
body += subcycle_body_prefix + subcycle_body + subcycle_body_suffix

#For the init stage, for the case when the suite doesn't have any schemes with init phases,
#we still need to add the host-supplied ccpp_t variable to the init group caps so that it is
#available for setting the initialized flag for the particular instance being called. Otherwise,
#the initialized_set_block for the init phase tries to reference the unavailable ccpp_t variable.
if (ccpp_stage == 'init' and not self.parents[ccpp_stage]):
ccpp_var.intent = 'in'
self.parents[ccpp_stage].update({ccpp_var.local_name:ccpp_var})

# Get list of arguments, module use statement and variable definitions for this subroutine (=stage for the group)
(self.arguments[ccpp_stage], sub_module_use, sub_var_defs) = create_arguments_module_use_var_defs(
self.parents[ccpp_stage], metadata_define, tmpvars.values())
Expand All @@ -1631,14 +1639,13 @@ def write(self, metadata_request, metadata_define, arguments, debug):
target_name_flag=ccpp_error_code_target_name,
target_name_msg=ccpp_error_msg_target_name,
name=self._name)
initialized_set_block = Group.initialized_set_blocks[ccpp_stage].format(
ccpp_var_name = ccpp_var.local_name,
target_name_flag=ccpp_error_code_target_name,
target_name_msg=ccpp_error_msg_target_name,
name=self._name)
else:
initialized_test_block = ''
initialized_set_block = 'initialized(:) = .true.'
initialized_set_block = Group.initialized_set_blocks[ccpp_stage].format(
ccpp_var_name = ccpp_var.local_name,
target_name_flag=ccpp_error_code_target_name,
target_name_msg=ccpp_error_msg_target_name,
name=self._name)


# Create subroutine
Expand Down

0 comments on commit 10fd091

Please sign in to comment.