@@ -1175,3 +1175,32 @@ def do_cime_vars_on_yaml_output_files(case, caseroot):
1175
1175
################################################################
1176
1176
""" )
1177
1177
ordered_dump (scream_input , fd )
1178
+
1179
+ ###############################################################################
1180
+ def archive_case_docs (case ,caseroot ):
1181
+ ###############################################################################
1182
+ # Copy ALL eamxx input yaml/nml files to CaseDocs, for provenance
1183
+ with SharedArea ():
1184
+ # We for sure have scream_input.yaml and namelist.nl
1185
+ files = ['scream_input.yaml' , 'namelist.nl' ]
1186
+
1187
+ # Get the XML configs, and find all output yaml files
1188
+ rundir = case .get_value ("RUNDIR" )
1189
+ eamxx_xml_file = os .path .join (caseroot , "namelist_scream.xml" )
1190
+
1191
+ with open (eamxx_xml_file , "r" ) as fd :
1192
+ eamxx_xml = ET .parse (fd ).getroot ()
1193
+
1194
+ scorpio = get_child (eamxx_xml ,'scorpio' )
1195
+ out_files_xml = get_child (scorpio ,"output_yaml_files" ,must_exist = False )
1196
+ out_files = out_files_xml .text .split ("," ) if (out_files_xml is not None and out_files_xml .text is not None ) else []
1197
+
1198
+ for fn in out_files :
1199
+ # Get full name
1200
+ src_yaml = os .path .expanduser (os .path .join (fn .strip ()))
1201
+ files .append (os .path .basename (src_yaml ))
1202
+
1203
+ for f in files :
1204
+ src = os .path .join (caseroot ,f'run/data/{ f } ' )
1205
+ dst = os .path .join (caseroot ,f'CaseDocs/{ f } ' )
1206
+ safe_copy (src ,dst )
0 commit comments