From 219f2e9c88b7b774becac2bd1453696e105af1c4 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 23 Oct 2023 16:40:11 -0400 Subject: [PATCH] Bug fix for initialized_set_block (#503) --- scripts/mkstatic.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/mkstatic.py b/scripts/mkstatic.py index 576abdf8..f86f738f 100755 --- a/scripts/mkstatic.py +++ b/scripts/mkstatic.py @@ -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())