From 1ca35a55ebd1db1547b6b4fd56086b36cd867d0b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 May 2023 15:07:36 -0600 Subject: [PATCH 01/20] black reformat these python files --- cime_config/buildlib | 4 +- cime_config/buildlib_comps | 22 ++- cime_config/stream_cdeps.py | 377 +++++++++++++++++++++++------------- 3 files changed, 262 insertions(+), 141 deletions(-) diff --git a/cime_config/buildlib b/cime_config/buildlib index 965836cf..2fc2b3ff 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -77,9 +77,7 @@ def buildlib(bldroot, libroot, case): logger.info("Running cmake for CDEPS") srcpath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) - cmake_flags = get_standard_cmake_args( - case, os.path.join(sharedpath, "cdeps") - ) + cmake_flags = get_standard_cmake_args(case, os.path.join(sharedpath, "cdeps")) # base path of install to be completed by setting DESTDIR in make install cmake_flags += " -DCMAKE_INSTALL_PREFIX:PATH=/" cmake_flags += " -DLIBROOT={} ".format(libroot) diff --git a/cime_config/buildlib_comps b/cime_config/buildlib_comps index 1eba5bee..281f0d4e 100755 --- a/cime_config/buildlib_comps +++ b/cime_config/buildlib_comps @@ -11,7 +11,7 @@ if _CIMEROOT is None: raise SystemExit("ERROR: must set CIMEROOT environment variable") sys.path.append(os.path.join(_CIMEROOT, "CIME", "Tools")) -_LIBDIR = os.path.join(_CIMEROOT, "scripts", "lib") +_LIBDIR = os.path.join(_CIMEROOT, "CIME") sys.path.append(_LIBDIR) from standard_script_setup import * @@ -19,28 +19,36 @@ from CIME.buildlib import parse_input from CIME.case import Case from CIME.utils import run_cmd, symlink_force, expect +# pragma pylint: disable=unused-argument,undefined-variable + logger = logging.getLogger(__name__) + def buildlib(bldroot, libroot, case, compname=None): if not compname: - expect(bldroot.endswith("obj"), - "It appears that buildlib_comps is being called for the main CDEPS build\n" - "(the main CDEPS build should use buildlib, not buildlib_comps)") - compname = os.path.basename(os.path.abspath(os.path.join(bldroot,os.pardir))) + expect( + bldroot.endswith("obj"), + "It appears that buildlib_comps is being called for the main CDEPS build\n" + "(the main CDEPS build should use buildlib, not buildlib_comps)", + ) + compname = os.path.basename(os.path.abspath(os.path.join(bldroot, os.pardir))) _, o, e = run_cmd("make d{}".format(compname), from_dir=bldroot, verbose=True) libname = "lib{}.a".format(compname) dlibname = "libd{}.a".format(compname) dlibpath = os.path.join(bldroot, dlibname) if os.path.exists(dlibpath): - symlink_force(os.path.join(bldroot,dlibname), os.path.join(libroot,libname)) + symlink_force(os.path.join(bldroot, dlibname), os.path.join(libroot, libname)) else: - expect(False, "ERROR in {} build {} {}".format(compname,o,e)) + expect(False, "ERROR in {} build {} {}".format(compname, o, e)) + logger.info(f"build successful for comp={compname}") + def _main_func(args): caseroot, libroot, bldroot = parse_input(args) with Case(caseroot) as case: buildlib(bldroot, libroot, case) + if __name__ == "__main__": _main_func(sys.argv) diff --git a/cime_config/stream_cdeps.py b/cime_config/stream_cdeps.py index ead74bbf..1f702a13 100644 --- a/cime_config/stream_cdeps.py +++ b/cime_config/stream_cdeps.py @@ -7,12 +7,11 @@ import re import hashlib -from standard_script_setup import * from CIME.XML.standard_module_setup import * from CIME.XML.generic_xml import GenericXML -from CIME.XML.files import Files from CIME.utils import expect +# pragma pylint: disable=undefined-variable logger = logging.getLogger(__name__) _var_ref_re = re.compile(r"\$(\{)?(?P\w+)(?(1)\})") @@ -44,25 +43,40 @@ """ valid_values = {} -valid_values["mapalgo"] = ["bilinear", "nn", "redist", "mapconsd", "mapconf", "none"] +valid_values["mapalgo"] = ["bilinear", "nn", "redist", "mapconsd", "mapconf", "none"] valid_values["tintalgo"] = ["lower", "upper", "nearest", "linear", "coszen"] -valid_values["taxmode"] = ["cycle", "extend", "limit"] +valid_values["taxmode"] = ["cycle", "extend", "limit"] -xml_scalar_names = ["stream_meshfile", "stream_mapalgo", "stream_tintalgo", "stream_taxmode", "stream_dtlimit"] +xml_scalar_names = [ + "stream_meshfile", + "stream_mapalgo", + "stream_tintalgo", + "stream_taxmode", + "stream_dtlimit", +] -class StreamCDEPS(GenericXML): +class StreamCDEPS(GenericXML): def __init__(self, infile, schema): """ Initialize a CDEPS stream object """ logger.debug("Verifying using schema {}".format(schema)) GenericXML.__init__(self, infile, schema) + self.stream_nodes = None + if os.path.exists(infile): GenericXML.read(self, infile, schema) - def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file, user_mods_file, - available_neon_data=None): + def create_stream_xml( + self, + stream_names, + case, + streams_xml_file, + data_list_file, + user_mods_file, + available_neon_data=None, + ): """ Create the stream xml file and append the required stream input data to the input data list file available_neon_data is an optional list of NEON tower data available for the given case, if provided @@ -71,98 +85,134 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file # determine if there are user mods lines_input = [] - expect (os.path.isfile(user_mods_file), - "No file {} found in case directory".format(user_mods_file)) - with open(user_mods_file, "r", encoding='utf-8') as stream_mods_file: + expect( + os.path.isfile(user_mods_file), + "No file {} found in case directory".format(user_mods_file), + ) + with open(user_mods_file, "r", encoding="utf-8") as stream_mods_file: lines_input = stream_mods_file.readlines() stream_mod_dict = {} n = len(lines_input) index = 0 lines_input_new = [] - while index < len(lines_input): + while index < n: line = lines_input[index].strip() - if line.startswith('!') or (not line): + if line.startswith("!") or (not line): index = index + 1 continue - while line[-1] == '\\': + while line[-1] == "\\": index += 1 - if index < len(lines_input): - line = line[:-1].strip() + ' ' + lines_input[index].strip() + if index < n: + line = line[:-1].strip() + " " + lines_input[index].strip() else: - line = line.replace('\\', '').strip() + line = line.replace("\\", "").strip() break # endif # end while index += 1 line = case.get_resolved_value(line) lines_input_new.append(line) - #end while + # end while for line in lines_input_new: # read in a single line in user_nl_xxx_streams and parse it if it is not a comment - stream_mods = [x.strip() for x in line.strip().split(":",maxsplit=1) if x] - expect(len(stream_mods) == 2, - "input stream mod can only be of the form streamname:var=value(s)") - stream,varmod = stream_mods - expect (stream in stream_names, - "{} contains a streamname \'{}\' that is not part of valid streamnames {}". - format(user_mods_file,stream,stream_names)) - if stream not in stream_mod_dict: + stream_mods = [x.strip() for x in line.strip().split(":", maxsplit=1) if x] + expect( + len(stream_mods) == 2, + "input stream mod can only be of the form streamname:var=value(s)", + ) + stream, varmod = stream_mods + expect( + stream in stream_names, + "{} contains a streamname '{}' that is not part of valid streamnames {}".format( + user_mods_file, stream, stream_names + ), + ) + if stream not in stream_mod_dict: stream_mod_dict[stream] = {} # var=value and check the validity varmod_args = [x.strip() for x in varmod.split("=") if x] - expect(len(varmod_args) == 2, - "input stream mod can only be of the form streamname:var=value(s)") + expect( + len(varmod_args) == 2, + "input stream mod can only be of the form streamname:var=value(s)", + ) # allow multiple entries for varmod_args, most recent wins - varname,varval = varmod_args + varname, varval = varmod_args if varname in stream_mod_dict[stream]: - logger.warning("varname {} is already in stream mod dictionary".format(varname)) + logger.warning( + "varname {} is already in stream mod dictionary".format(varname) + ) if varname == "datavars" or varname == "datafiles": if varname == "datavars": - varvals = ["{}".format(x.strip()) for x in varval.split(",") if x] + varvals = [ + "{}".format(x.strip()) + for x in varval.split(",") + if x + ] if varname == "datafiles": - varvals = ["{}".format(x.strip()) for x in varval.split(",") if x] + varvals = [ + "{}".format(x.strip()) + for x in varval.split(",") + if x + ] varval = " " + "\n ".join(varvals) varval = varval.strip() stream_mod_dict[stream][varname] = varval # write header of stream file - with open(streams_xml_file, 'w', encoding='utf-8') as stream_file: + with open(streams_xml_file, "w", encoding="utf-8") as stream_file: stream_file.write('\n') stream_file.write('\n') # write contents of stream file for stream_name in stream_names: # include NEON.$NEONSITE non-precipitation data streams whether use PRISM or NEON precip - if stream_name.startswith("NEON.") and ('PRECIP' not in stream_name): - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : "NEON.$NEONSITE"}, - err_msg="No stream_entry {} found".format(stream_name)) + if stream_name.startswith("NEON.") and ("PRECIP" not in stream_name): + self.stream_nodes = super(StreamCDEPS, self).get_child( + "stream_entry", + {"name": "NEON.$NEONSITE"}, + err_msg="No stream_entry {} found".format(stream_name), + ) elif stream_name.startswith("NEON.PRISM_PRECIP"): - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : "NEON.PRISM_PRECIP.$NEONSITE"}, - err_msg="No stream_entry {} found".format(stream_name)) + self.stream_nodes = super(StreamCDEPS, self).get_child( + "stream_entry", + {"name": "NEON.PRISM_PRECIP.$NEONSITE"}, + err_msg="No stream_entry {} found".format(stream_name), + ) elif stream_name.startswith("NEON.NEON_PRECIP"): - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : "NEON.NEON_PRECIP.$NEONSITE"}, - err_msg="No stream_entry {} found".format(stream_name)) + self.stream_nodes = super(StreamCDEPS, self).get_child( + "stream_entry", + {"name": "NEON.NEON_PRECIP.$NEONSITE"}, + err_msg="No stream_entry {} found".format(stream_name), + ) elif stream_name.startswith("CLM_USRDAT."): - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : "CLM_USRDAT.$CLM_USRDAT_NAME"}, - err_msg="No stream_entry {} found".format(stream_name)) + self.stream_nodes = super(StreamCDEPS, self).get_child( + "stream_entry", + {"name": "CLM_USRDAT.$CLM_USRDAT_NAME"}, + err_msg="No stream_entry {} found".format(stream_name), + ) elif stream_name: - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : stream_name}, - err_msg="No stream_entry {} found".format(stream_name)) + self.stream_nodes = super(StreamCDEPS, self).get_child( + "stream_entry", + {"name": stream_name}, + err_msg="No stream_entry {} found".format(stream_name), + ) # determine stream_year_first and stream_year_list - data_year_first,data_year_last = self._get_stream_first_and_last_dates(self.stream_nodes, case) + data_year_first, data_year_last = self._get_stream_first_and_last_dates( + self.stream_nodes, case + ) # now write the data model streams xml file stream_vars = {} - stream_vars['streamname'] = stream_name + stream_vars["streamname"] = stream_name attributes = {} for node in self.get_children(root=self.stream_nodes): node_name = node.xml_element.tag.strip() - if node_name == 'stream_datavars': + if node_name == "stream_datavars": # Get the resolved stream data variables stream_vars[node_name] = None for child in self.get_children(root=node): @@ -171,52 +221,79 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file datavars = self._sub_glc_fields(datavars, case) datavars = self._add_xml_delimiter(datavars.split("\n"), "var") if stream_vars[node_name]: - stream_vars[node_name] = stream_vars[node_name] + "\n " + datavars.strip() + stream_vars[node_name] = ( + stream_vars[node_name] + "\n " + datavars.strip() + ) else: stream_vars[node_name] = datavars.strip() # endif - elif node_name == 'stream_datafiles': + elif node_name == "stream_datafiles": # Get the resolved stream data files stream_vars[node_name] = "" stream_datafiles = "" for child in self.get_children(root=node): - if available_neon_data and stream_name.startswith("NEON") and ('PRISM' not in stream_name): + if ( + available_neon_data + and stream_name.startswith("NEON") + and ("PRISM" not in stream_name) + ): rundir = case.get_value("RUNDIR") for neon in available_neon_data: - stream_datafiles += os.path.join(rundir,"inputdata","atm",neon) + "\n" + stream_datafiles += ( + os.path.join(rundir, "inputdata", "atm", neon) + + "\n" + ) else: stream_datafiles = child.xml_element.text - stream_datafiles = self._resolve_values(case, stream_datafiles) - #endif neon - if 'first_year' in child.xml_element.attrib and 'last_year' in child.xml_element.attrib: - value = child.xml_element.get('first_year') + stream_datafiles = self._resolve_values( + case, stream_datafiles + ) + # endif neon + if ( + "first_year" in child.xml_element.attrib + and "last_year" in child.xml_element.attrib + ): + value = child.xml_element.get("first_year") value = self._resolve_values(case, value) - stream_year_first= int(value) - value = child.xml_element.get('last_year') + stream_year_first = int(value) + value = child.xml_element.get("last_year") value = self._resolve_values(case, value) stream_year_last = int(value) year_first = max(stream_year_first, data_year_first) year_last = min(stream_year_last, data_year_last) - if 'filename_advance_days' in child.xml_element.attrib: - filename_advance_days = int(child.xml_element.get('filename_advance_days')) + if "filename_advance_days" in child.xml_element.attrib: + filename_advance_days = int( + child.xml_element.get("filename_advance_days") + ) else: filename_advance_days = 0 - stream_datafiles = self._sub_paths(stream_name, - stream_datafiles, - year_first, year_last, - filename_advance_days) + stream_datafiles = self._sub_paths( + stream_name, + stream_datafiles, + year_first, + year_last, + filename_advance_days, + ) stream_datafiles = stream_datafiles.strip() - #endif + # endif if stream_vars[node_name]: - stream_vars[node_name] += "\n " + self._add_xml_delimiter(stream_datafiles.split("\n"), "file") + stream_vars[ + node_name + ] += "\n " + self._add_xml_delimiter( + stream_datafiles.split("\n"), "file" + ) else: - stream_vars[node_name] = self._add_xml_delimiter(stream_datafiles.split("\n"), "file") - #endif - elif (node_name in xml_scalar_names): - attributes['model_grid'] = case.get_value("GRID") - attributes['compset'] = case.get_value("COMPSET") - value = self._get_value_match(node, node_name[7:], attributes=attributes) + stream_vars[node_name] = self._add_xml_delimiter( + stream_datafiles.split("\n"), "file" + ) + # endif + elif node_name in xml_scalar_names: + attributes["model_grid"] = case.get_value("GRID") + attributes["compset"] = case.get_value("COMPSET") + value = self._get_value_match( + node, node_name[7:], attributes=attributes + ) if value: value = self._resolve_values(case, value) value = value.strip() @@ -224,36 +301,50 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file elif node_name.strip(): # Get the other dependencies - stream_dict = self._add_value_to_dict(stream_vars, case, node) + self._add_value_to_dict(stream_vars, case, node) # substitute user_mods in generated stream file (i.e. stream_vars) mod_dict = {} - if stream_vars['streamname'] in stream_mod_dict: - mod_dict = stream_mod_dict[stream_vars['streamname']] + if stream_vars["streamname"] in stream_mod_dict: + mod_dict = stream_mod_dict[stream_vars["streamname"]] for var_key in mod_dict: - expect( 'stream_' + var_key in stream_vars, - "stream mod {} is not a valid name in {}".format(var_key,user_mods_file)) + expect( + "stream_" + var_key in stream_vars, + "stream mod {} is not a valid name in {}".format( + var_key, user_mods_file + ), + ) if var_key in valid_values: - expect(mod_dict[var_key] in valid_values[var_key], - "{} can only have values of {} for stream {} in file {}". - format(var_key, valid_values[var_key], stream_name, user_mods_file)) - stream_vars['stream_' + var_key] = mod_dict[var_key] - if var_key == 'datafiles': + expect( + mod_dict[var_key] in valid_values[var_key], + "{} can only have values of {} for stream {} in file {}".format( + var_key, + valid_values[var_key], + stream_name, + user_mods_file, + ), + ) + stream_vars["stream_" + var_key] = mod_dict[var_key] + if var_key == "datafiles": stream_datafiles = mod_dict[var_key] - stream_datafiles = stream_datafiles.replace('','').replace('','') + stream_datafiles = stream_datafiles.replace( + "", "" + ).replace("", "") # append to stream xml file stream_file_text = _stream_file_template.format(**stream_vars) - with open(streams_xml_file, 'a', encoding='utf-8') as stream_file: + with open(streams_xml_file, "a", encoding="utf-8") as stream_file: stream_file.write(case.get_resolved_value(stream_file_text)) # append to input_data_list - if stream_vars['stream_meshfile']: - stream_meshfile = stream_vars['stream_meshfile'].strip() - self._add_entries_to_inputdata_list(stream_meshfile, stream_datafiles.split("\n"), data_list_file) + if stream_vars["stream_meshfile"]: + stream_meshfile = stream_vars["stream_meshfile"].strip() + self._add_entries_to_inputdata_list( + stream_meshfile, stream_datafiles.split("\n"), data_list_file + ) # write close of stream xml file - with open(streams_xml_file, 'a', encoding='utf-8') as stream_file: + with open(streams_xml_file, "a", encoding="utf-8") as stream_file: stream_file.write("\n") def _get_stream_first_and_last_dates(self, stream, case): @@ -261,32 +352,34 @@ def _get_stream_first_and_last_dates(self, stream, case): Get first and last dates for data for the stream file """ for node in self.get_children(root=stream): - if node.xml_element.tag == 'stream_year_first': + if node.xml_element.tag == "stream_year_first": data_year_first = node.xml_element.text.strip() data_year_first = int(self._resolve_values(case, data_year_first)) - if node.xml_element.tag == 'stream_year_last': + if node.xml_element.tag == "stream_year_last": data_year_last = node.xml_element.text.strip() data_year_last = int(self._resolve_values(case, data_year_last)) return data_year_first, data_year_last - def _add_entries_to_inputdata_list(self, stream_meshfile, stream_datafiles, data_list_file): + def _add_entries_to_inputdata_list( + self, stream_meshfile, stream_datafiles, data_list_file + ): """ Appends input data information entries to input data list file and writes out the new file """ lines_hash = self._get_input_file_hash(data_list_file) - with open(data_list_file, 'a', encoding='utf-8') as input_data_list: + with open(data_list_file, "a", encoding="utf-8") as input_data_list: # write out the mesh file separately string = "mesh = {}\n".format(stream_meshfile) - hashValue = hashlib.md5(string.rstrip().encode('utf-8')).hexdigest() + hashValue = hashlib.md5(string.rstrip().encode("utf-8")).hexdigest() if hashValue not in lines_hash: input_data_list.write(string) # now append the stream_datafile entries for i, filename in enumerate(stream_datafiles): - if filename.strip() == '': + if filename.strip() == "": continue - string = "file{:d} = {}\n".format(i+1, filename.strip()) - hashValue = hashlib.md5(string.rstrip().encode('utf-8')).hexdigest() + string = "file{:d} = {}\n".format(i + 1, filename.strip()) + hashValue = hashlib.md5(string.rstrip().encode("utf-8")).hexdigest() if hashValue not in lines_hash: input_data_list.write(string) @@ -296,15 +389,15 @@ def _get_input_file_hash(self, data_list_file): """ lines_hash = set() if os.path.isfile(data_list_file): - with open(data_list_file, "r", encoding='utf-8') as input_data_list: + with open(data_list_file, "r", encoding="utf-8") as input_data_list: for line in input_data_list: - hashValue = hashlib.md5(line.rstrip().encode('utf-8')).hexdigest() - logger.debug( "Found line {} with hash {}".format(line,hashValue)) + hashValue = hashlib.md5(line.rstrip().encode("utf-8")).hexdigest() + logger.debug("Found line {} with hash {}".format(line, hashValue)) lines_hash.add(hashValue) return lines_hash def _get_value_match(self, node, child_name, attributes=None, exact_match=False): - ''' + """ Get the first best match for multiple tags in child_name based on the attributes input @@ -314,7 +407,7 @@ def _get_value_match(self, node, child_name, attributes=None, exact_match=False) Z - ''' + """ # Store nodes that match the attributes and their scores. matches = [] nodes = self.get_children(child_name, root=node) @@ -328,13 +421,15 @@ def _get_value_match(self, node, child_name, attributes=None, exact_match=False) # If some attribute is specified that we don't know about, # or the values don't match, it's not a match we want. if exact_match: - if attribute not in attributes or \ - attributes[attribute] != self.get(vnode, attribute): + if attribute not in attributes or attributes[ + attribute + ] != self.get(vnode, attribute): score = -1 break else: - if attribute not in attributes or not \ - re.search(self.get(vnode, attribute),attributes[attribute]): + if attribute not in attributes or not re.search( + self.get(vnode, attribute), attributes[attribute] + ): score = -1 break @@ -348,7 +443,7 @@ def _get_value_match(self, node, child_name, attributes=None, exact_match=False) # Get maximum score using either a "last" or "first" match in case of a tie max_score = -1 mnode = None - for score,node in matches: + for score, node in matches: # take the *first* best match if score > max_score: max_score = score @@ -374,10 +469,13 @@ def _resolve_values(self, case, value): """ match = _var_ref_re.search(value) while match: - env_val = case.get_value(match.group('name')) - expect(env_val is not None, - "Namelist default for variable {} refers to unknown XML variable {}.". - format(value, match.group('name'))) + env_val = case.get_value(match.group("name")) + expect( + env_val is not None, + "Namelist default for variable {} refers to unknown XML variable {}.".format( + value, match.group("name") + ), + ) value = value.replace(match.group(0), str(env_val), 1) match = _var_ref_re.search(value) return value @@ -413,10 +511,10 @@ def _sub_glc_fields(self, datavars, case): if not line: continue if "%glc" in line: - if case.get_value('GLC_NEC') == 0: + if case.get_value("GLC_NEC") == 0: glc_nec_indices = [] else: - glc_nec_indices = range(case.get_value('GLC_NEC')+1) + glc_nec_indices = range(case.get_value("GLC_NEC") + 1) for i in glc_nec_indices: new_lines.append(line.replace("%glc", "{:02d}".format(i))) else: @@ -432,7 +530,7 @@ def _days_in_month(month, year=1): """ month_start = datetime.date(year, month, 1) if month == 12: - next_year = year+1 + next_year = year + 1 next_month = 1 else: next_year = year @@ -466,7 +564,9 @@ def _add_day(cls, year, month, day): adjusted_year = adjusted_year + 1 return (adjusted_year, adjusted_month, adjusted_day) - def _sub_paths(self, stream_name, filenames, year_start, year_end, filename_advance_days): + def _sub_paths( + self, stream_name, filenames, year_start, year_end, filename_advance_days + ): """Substitute indicators with given values in a list of filenames. Replace any instance of the following substring indicators with the @@ -500,9 +600,12 @@ def _sub_paths(self, stream_name, filenames, year_start, year_end, filename_adva Returns a string (filenames separated by newlines). """ - expect(filename_advance_days == 0 or filename_advance_days == 1, - "Bad filename_advance_days attribute ({}) for {}: must be 0 or 1".format( - filename_advance_days, stream_name)) + expect( + filename_advance_days == 0 or filename_advance_days == 1, + "Bad filename_advance_days attribute ({}) for {}: must be 0 or 1".format( + filename_advance_days, stream_name + ), + ) lines = [line for line in filenames.split("\n") if line] new_lines = [] @@ -511,23 +614,33 @@ def _sub_paths(self, stream_name, filenames, year_start, year_end, filename_adva if match is None: new_lines.append(line) continue - if match.group('digits'): - year_format = "{:0"+match.group('digits')+"d}" + if match.group("digits"): + year_format = "{:0" + match.group("digits") + "d}" else: year_format = "{:04d}" - for year in range(year_start, year_end+1): - if match.group('day'): + for year in range(year_start, year_end + 1): + if match.group("day"): for month in range(1, 13): days = self._days_in_month(month) - for day in range(1, days+1): + for day in range(1, days + 1): if filename_advance_days == 1: - (adjusted_year, adjusted_month, adjusted_day) = self._add_day(year, month, day) + ( + adjusted_year, + adjusted_month, + adjusted_day, + ) = self._add_day(year, month, day) else: - (adjusted_year, adjusted_month, adjusted_day) = (year, month, day) - date_string = (year_format + "-{:02d}-{:02d}").format(adjusted_year, adjusted_month, adjusted_day) + (adjusted_year, adjusted_month, adjusted_day) = ( + year, + month, + day, + ) + date_string = (year_format + "-{:02d}-{:02d}").format( + adjusted_year, adjusted_month, adjusted_day + ) new_line = line.replace(match.group(0), date_string) new_lines.append(new_line) - elif match.group('month'): + elif match.group("month"): for month in range(1, 13): date_string = (year_format + "-{:02d}").format(year, month) new_line = line.replace(match.group(0), date_string) @@ -543,22 +656,24 @@ def _add_xml_delimiter(list_to_deliminate, delimiter): expect(delimiter and not " " in delimiter, "Missing or badly formed delimiter") pred = "<{}>".format(delimiter) postd = "".format(delimiter) - for n,item in enumerate(list_to_deliminate): + for n, item in enumerate(list_to_deliminate): if item.strip(): list_to_deliminate[n] = pred + item.strip() + postd - #endif - #endfor + # endif + # endfor return "\n ".join(list_to_deliminate) def update_input_data_list(self, data_list_file): - ''' From the stream object parse out and list required input files ''' + """From the stream object parse out and list required input files""" sinodes = self.scan_children("stream_info") for node in sinodes: meshnode = self.scan_child("stream_mesh_file", root=node) stream_meshfile = self.text(meshnode) data_file_node = self.scan_child("stream_data_files", root=node) - filenodes = self.scan_children("file",root=data_file_node) + filenodes = self.scan_children("file", root=data_file_node) stream_datafiles = [] for fnode in filenodes: stream_datafiles.append(self.text(fnode)) - self._add_entries_to_inputdata_list(stream_meshfile, stream_datafiles, data_list_file) + self._add_entries_to_inputdata_list( + stream_meshfile, stream_datafiles, data_list_file + ) From 380f6fed4b19b385a5eaf47e1f4b40fe34f02def Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 May 2023 09:55:20 -0600 Subject: [PATCH 02/20] update github to make cdeps ext build an action --- .github/actions/buildcdeps/action.yaml | 41 ++++++++++++++++++++++++++ .github/workflows/extbuild.yml | 15 ++++------ 2 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 .github/actions/buildcdeps/action.yaml diff --git a/.github/actions/buildcdeps/action.yaml b/.github/actions/buildcdeps/action.yaml new file mode 100644 index 00000000..b02be9af --- /dev/null +++ b/.github/actions/buildcdeps/action.yaml @@ -0,0 +1,41 @@ +name: CDEPS build and cache +description: 'Build the CDEPS library' +inputs: + cdeps_version: + description: 'Tag in the CDEPS repository to use' + default: main + required: False + type: string + pio_path: + description: 'Path to the installed parallelio code root' + default: $HOME/pio + required: False + type: string + esmfmkfile: + description: 'Path to the installed ESMF library mkfile' + default: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk + required: False + type: string + src_root: + description: 'Path to cdeps source' + default: $GITHUB_WORKSPACE + required: False + type: string + install_prefix: + description: 'Install path of cdeps' + default: $HOME/cdeps + required: False + type: string +runs: + using: composite + steps: + - id : Build-CDEPS + shell: bash + run: | + mkdir build-cdeps + pushd build-cdeps + export ESMFMKFILE=${{ inputs.esmfmkfile }} + export PIO=${{ inputs.pio_path }} + cmake -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-DCPRGNU -g -Wall -ffree-form -ffree-line-length-none -fallow-argument-mismatch " -DWERROR=ON ${{ inputs.src_root }} + make VERBOSE=1 + popd diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index c3a54360..08a92812 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -93,12 +93,9 @@ jobs: pnetcdf_path: /usr parallelio_path: $HOME/pio - name: Build CDEPS - run: | - export ESMFMKFILE=$HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk - export PIO=$HOME/pio - export SRC_ROOT= - mkdir build-cdeps - pushd build-cdeps - cmake -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-DCPRGNU -g -Wall -ffree-form -ffree-line-length-none -fallow-argument-mismatch " -DWERROR=ON ../ - make VERBOSE=1 - popd + uses: ESCOMP/CDEPS/.github/actions/buildcdeps + with: + esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk + pio_path: $HOME/pio + src_root: $GITHUB_WORKSPACE + From 895f31bed41c7b7714d308facc2d7a5335410769 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 May 2023 10:28:57 -0600 Subject: [PATCH 03/20] debug action --- .github/actions/buildcdeps/action.yaml | 8 ++++++-- .github/workflows/extbuild.yml | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/actions/buildcdeps/action.yaml b/.github/actions/buildcdeps/action.yaml index b02be9af..23799212 100644 --- a/.github/actions/buildcdeps/action.yaml +++ b/.github/actions/buildcdeps/action.yaml @@ -21,6 +21,11 @@ inputs: default: $GITHUB_WORKSPACE required: False type: string + cmake_flags: + description: 'Extra flags for cmake command' + default: -Wno-dev + required: False + type: string install_prefix: description: 'Install path of cdeps' default: $HOME/cdeps @@ -36,6 +41,5 @@ runs: pushd build-cdeps export ESMFMKFILE=${{ inputs.esmfmkfile }} export PIO=${{ inputs.pio_path }} - cmake -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_Fortran_FLAGS="-DCPRGNU -g -Wall -ffree-form -ffree-line-length-none -fallow-argument-mismatch " -DWERROR=ON ${{ inputs.src_root }} - make VERBOSE=1 + cmake ${{ inputs.cmake_flags }} ${{ inputs.src_root }} popd diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 08a92812..e75c7a73 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -98,4 +98,9 @@ jobs: esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk pio_path: $HOME/pio src_root: $GITHUB_WORKSPACE - + cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ + -ffree-form -ffree-line-length-none -fallow-argument-mismatch \"" + - name: Test CDEPS + run: + cd build-cdeps + make VERBOSE=1 From cae6d80329b9e7562722c3b760c0ddd6176edeb5 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 May 2023 11:04:38 -0600 Subject: [PATCH 04/20] try again --- .github/workflows/extbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index e75c7a73..cc945c99 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -93,7 +93,7 @@ jobs: pnetcdf_path: /usr parallelio_path: $HOME/pio - name: Build CDEPS - uses: ESCOMP/CDEPS/.github/actions/buildcdeps + uses: ./.github/actions/buildcdeps with: esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk pio_path: $HOME/pio From 169c2801e2fc2e6789dd61f2e6f0c254377b7374 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 May 2023 11:28:22 -0600 Subject: [PATCH 05/20] fix run statement format --- .github/workflows/extbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index cc945c99..b2127bdc 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -101,6 +101,6 @@ jobs: cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ -ffree-form -ffree-line-length-none -fallow-argument-mismatch \"" - name: Test CDEPS - run: + run: | cd build-cdeps make VERBOSE=1 From 4a1f889add5392378f0a2722e487b108795ea1d1 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 May 2023 15:11:01 -0600 Subject: [PATCH 06/20] need to build in action to make it useable by other repos --- .github/actions/buildcdeps/action.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/buildcdeps/action.yaml b/.github/actions/buildcdeps/action.yaml index 23799212..9d775dd1 100644 --- a/.github/actions/buildcdeps/action.yaml +++ b/.github/actions/buildcdeps/action.yaml @@ -42,4 +42,5 @@ runs: export ESMFMKFILE=${{ inputs.esmfmkfile }} export PIO=${{ inputs.pio_path }} cmake ${{ inputs.cmake_flags }} ${{ inputs.src_root }} + make VERBOSE=1 popd From 9a1d6f96a038219a7d1c02cf02ba7bea54396e66 Mon Sep 17 00:00:00 2001 From: Francis Vitt Date: Mon, 5 Jun 2023 11:32:49 -0600 Subject: [PATCH 07/20] update SST files for historical configurations --- docn/cime_config/config_component.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docn/cime_config/config_component.xml b/docn/cime_config/config_component.xml index a06201aa..0e03abf2 100644 --- a/docn/cime_config/config_component.xml +++ b/docn/cime_config/config_component.xml @@ -155,12 +155,12 @@ $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_clim_c040926.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_clim_c061106.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_clim_c110526.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_1850_2012_c130411.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2012_c130411.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2012_c130411.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2012_c130411.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2012_c130411.nc - $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_1850_2012_c130411.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_1850_2021_c120422.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_1850_2021_c120422.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_1850_2021_c120422.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.9x1.25_1850_2021_c120422.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.47x0.63_1850_2021_c120422.nc + $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_0.23x0.31_1850_2021_c120422.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_clim_pi_c101029.nc $DIN_LOC_ROOT/ocn/docn7/SSTDATA/sst_ice_CMIP6_DECK_E3SM_1x1_1850_clim_c20190125.nc $DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_48x96_clim_pi_c101028.nc @@ -240,7 +240,7 @@ 0 - 2012 + 2021 run_component_cam_sstice env_run.xml From f5ad1193fc5e2fc3d6ac9efe3099f070bb1a82ec Mon Sep 17 00:00:00 2001 From: Keith Lindsay Date: Tue, 27 Jun 2023 11:13:03 -0600 Subject: [PATCH 08/20] correct docs link in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e46df19a..00da8d28 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Community Data Models for Earth Prediction Systems For documentation see -https://escomp.github.io/CDEPS/html/index.html +https://escomp.github.io/CDEPS/versions/master/html/index.html ## A note on github tag action From bb232d875611639b10b9bfeb6a82910341a14d25 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 3 Jul 2023 15:10:14 -0600 Subject: [PATCH 09/20] enable DISABLE_FoX for standalone build --- CMakeLists.txt | 56 ++++++++++++++++++++++++++---------------- datm/CMakeLists.txt | 4 ++- dice/CMakeLists.txt | 4 ++- dlnd/CMakeLists.txt | 4 ++- docn/CMakeLists.txt | 4 ++- drof/CMakeLists.txt | 2 ++ dwav/CMakeLists.txt | 2 ++ streams/CMakeLists.txt | 8 +++--- 8 files changed, 56 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d88135b..28fb2a26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.10) include(ExternalProject) include(FetchContent) +set(DISABLE_FoX OFF CACHE BOOL "Disable FoX library to process XML files.") +message("DISABLE_FoX = ${DISABLE_FoX}") +if(DISABLE_FoX) + add_definitions(-DDISABLE_FoX) +endif() + if (DEFINED CIMEROOT) message("Using CIME in ${CIMEROOT} with compiler ${COMPILER}") include(${CASEROOT}/Macros.cmake) @@ -23,7 +29,9 @@ else() set(BLD_STANDALONE TRUE) project(NUOPC_DATA_MODELS LANGUAGES Fortran VERSION 0.1) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) - set(FOX_ROOT ${CMAKE_SOURCE_DIR}/fox) + if(NOT DISABLE_FoX) + set(FOX_ROOT ${CMAKE_SOURCE_DIR}/fox) + endif() endif() message("CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}, CMAKE_Fortran_COMPILER is ${CMAKE_Fortran_COMPILER}") enable_language(Fortran) @@ -62,29 +70,32 @@ endif() add_subdirectory(streams) add_subdirectory(dshr) -if(IS_DIRECTORY "${FOX_ROOT}") - message(STATUS "FoX library is already checked out!") - message(STATUS "FoX source dir: ${FOX_ROOT}") -else() - FetchContent_Declare(fox - GIT_REPOSITORY https://github.com/ESMCI/fox.git - GIT_TAG 4.1.2.1 - SOURCE_DIR ${FOX_ROOT} - BINARY_DIR ${FOX_ROOT}/.. - ) - FetchContent_GetProperties(fox) - if(NOT fox_POPULATED) - FetchContent_Populate(fox) - message(STATUS "FoX source dir: ${fox_SOURCE_DIR}") - message(STATUS "FoX binary dir: ${fox_BINARY_DIR}") +if(NOT DISABLE_FoX) + if(IS_DIRECTORY "${FOX_ROOT}") + message(STATUS "FoX library is already checked out!") + message(STATUS "FoX source dir: ${FOX_ROOT}") + else() + FetchContent_Declare(fox + GIT_REPOSITORY https://github.com/ESMCI/fox.git + GIT_TAG 4.1.2.1 + SOURCE_DIR ${FOX_ROOT} + BINARY_DIR ${FOX_ROOT}/.. + ) + FetchContent_GetProperties(fox) + if(NOT fox_POPULATED) + FetchContent_Populate(fox) + message(STATUS "FoX source dir: ${fox_SOURCE_DIR}") + message(STATUS "FoX binary dir: ${fox_BINARY_DIR}") + endif() endif() + add_subdirectory(fox) + + target_include_directories(streams PUBLIC $ + $) + target_include_directories(dshr PUBLIC $ + $) endif() -add_subdirectory(fox) -target_include_directories(streams PUBLIC $ - $) -target_include_directories(dshr PUBLIC $ - $) target_include_directories(dshr PUBLIC $ $) @@ -112,6 +123,9 @@ foreach(COMP datm dice dlnd docn drof dwav) endforeach(COMP) foreach(DEPS streams dshr cdeps_share FoX_dom FoX_wxml FoX_sax FoX_common FoX_utils FoX_fsys) + if(DISABLE_FoX AND ${DEPS} MATCHES "^FoX") + continue() + endif() if(NOT BLD_STANDALONE AND ${DEPS} STREQUAL "cdeps_share") continue() endif() diff --git a/datm/CMakeLists.txt b/datm/CMakeLists.txt index b9413c0b..0226ba73 100644 --- a/datm/CMakeLists.txt +++ b/datm/CMakeLists.txt @@ -25,4 +25,6 @@ add_dependencies(datm dshr streams) target_include_directories (datm PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (datm PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories (datm PRIVATE ${PIO_Fortran_INCLUDE_DIR}) -target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +if(NOT DISABLE_FoX) + target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/dice/CMakeLists.txt b/dice/CMakeLists.txt index 02b48d36..accd2c65 100644 --- a/dice/CMakeLists.txt +++ b/dice/CMakeLists.txt @@ -19,4 +19,6 @@ add_dependencies(dice dshr streams) target_include_directories (dice PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (dice PRIVATE "${CMAKE_SOURCE_DIR}") target_include_directories (dice PRIVATE "${PIO_Fortran_INCLUDE_DIR}") -target_include_directories (dice PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +if(NOT DISABLE_FoX) + target_include_directories (dice PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/dlnd/CMakeLists.txt b/dlnd/CMakeLists.txt index 38d6a416..642bf63a 100644 --- a/dlnd/CMakeLists.txt +++ b/dlnd/CMakeLists.txt @@ -17,4 +17,6 @@ add_dependencies(dlnd dshr streams) target_include_directories (dlnd PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (dlnd PRIVATE "${CMAKE_SOURCE_DIR}") target_include_directories (dlnd PRIVATE "${PIO_Fortran_INCLUDE_DIR}") -target_include_directories (dlnd PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +if(NOT DISABLE_FoX) + target_include_directories (dlnd PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/docn/CMakeLists.txt b/docn/CMakeLists.txt index b8a2b44e..0e085ba1 100644 --- a/docn/CMakeLists.txt +++ b/docn/CMakeLists.txt @@ -23,4 +23,6 @@ add_dependencies(docn dshr streams) target_include_directories (docn PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (docn PRIVATE ${CMAKE_SOURCE_DIR}) target_include_directories (docn PRIVATE ${PIO_Fortran_INCLUDE_DIR}) -target_include_directories (docn PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +if(NOT DISABLE_FoX) + target_include_directories (docn PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/drof/CMakeLists.txt b/drof/CMakeLists.txt index 6cfc9116..e29dab04 100644 --- a/drof/CMakeLists.txt +++ b/drof/CMakeLists.txt @@ -17,4 +17,6 @@ add_dependencies(drof dshr streams) target_include_directories (drof PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (drof PRIVATE "${CMAKE_SOURCE_DIR}") target_include_directories (drof PRIVATE "${PIO_Fortran_INCLUDE_DIR}") +if(NOT DISABLE_FoX) target_include_directories (drof PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/dwav/CMakeLists.txt b/dwav/CMakeLists.txt index 676b3004..6e338db2 100644 --- a/dwav/CMakeLists.txt +++ b/dwav/CMakeLists.txt @@ -17,4 +17,6 @@ add_dependencies(dwav dshr streams) target_include_directories (dwav PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (dwav PRIVATE "${CMAKE_SOURCE_DIR}") target_include_directories (dwav PRIVATE "${PIO_Fortran_INCLUDE_DIR}") +if(NOT DISABLE_FoX) target_include_directories (dwav PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() diff --git a/streams/CMakeLists.txt b/streams/CMakeLists.txt index 99066e80..ab4b534b 100644 --- a/streams/CMakeLists.txt +++ b/streams/CMakeLists.txt @@ -18,14 +18,16 @@ message("Stream srcfiles are ${SRCFILES}") add_library(streams ${SRCFILES}) -add_dependencies(streams FoX_dom) +if(NOT DISABLE_FoX) + add_dependencies(streams FoX_dom) + target_include_directories (streams PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) +endif() + if(BLD_STANDALONE) add_dependencies(streams cdeps_share) target_include_directories (streams PRIVATE ${CMAKE_BINARY_DIR}/share) endif() - -target_include_directories (streams PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) target_include_directories (streams PRIVATE ${ESMF_F90COMPILEPATHS}) target_include_directories (streams PRIVATE ${PIO_Fortran_INCLUDE_DIR}) From f3a837b9d94aa147f95855452f5ac57b1847f8c4 Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 3 Jul 2023 23:28:10 -0600 Subject: [PATCH 10/20] install data component specific module files --- datm/CMakeLists.txt | 11 +++++++++++ dice/CMakeLists.txt | 11 +++++++++++ dlnd/CMakeLists.txt | 11 +++++++++++ docn/CMakeLists.txt | 11 +++++++++++ drof/CMakeLists.txt | 11 +++++++++++ dwav/CMakeLists.txt | 11 +++++++++++ 6 files changed, 66 insertions(+) diff --git a/datm/CMakeLists.txt b/datm/CMakeLists.txt index 0226ba73..1676125d 100644 --- a/datm/CMakeLists.txt +++ b/datm/CMakeLists.txt @@ -28,3 +28,14 @@ target_include_directories (datm PRIVATE ${PIO_Fortran_INCLUDE_DIR}) if(NOT DISABLE_FoX) target_include_directories (datm PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL atm_comp_nuopc.mod) + set(MOD cdeps_datm_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() diff --git a/dice/CMakeLists.txt b/dice/CMakeLists.txt index accd2c65..acfc26d4 100644 --- a/dice/CMakeLists.txt +++ b/dice/CMakeLists.txt @@ -22,3 +22,14 @@ target_include_directories (dice PRIVATE "${PIO_Fortran_INCLUDE_DIR}") if(NOT DISABLE_FoX) target_include_directories (dice PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL ice_comp_nuopc.mod) + set(MOD cdeps_dice_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() diff --git a/dlnd/CMakeLists.txt b/dlnd/CMakeLists.txt index 642bf63a..865f31e6 100644 --- a/dlnd/CMakeLists.txt +++ b/dlnd/CMakeLists.txt @@ -20,3 +20,14 @@ target_include_directories (dlnd PRIVATE "${PIO_Fortran_INCLUDE_DIR}") if(NOT DISABLE_FoX) target_include_directories (dlnd PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL lnd_comp_nuopc.mod) + set(MOD cdeps_dlnd_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() diff --git a/docn/CMakeLists.txt b/docn/CMakeLists.txt index 0e085ba1..007d595c 100644 --- a/docn/CMakeLists.txt +++ b/docn/CMakeLists.txt @@ -26,3 +26,14 @@ target_include_directories (docn PRIVATE ${PIO_Fortran_INCLUDE_DIR}) if(NOT DISABLE_FoX) target_include_directories (docn PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL ocn_comp_nuopc.mod) + set(MOD cdeps_docn_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() diff --git a/drof/CMakeLists.txt b/drof/CMakeLists.txt index e29dab04..444c855e 100644 --- a/drof/CMakeLists.txt +++ b/drof/CMakeLists.txt @@ -20,3 +20,14 @@ target_include_directories (drof PRIVATE "${PIO_Fortran_INCLUDE_DIR}") if(NOT DISABLE_FoX) target_include_directories (drof PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL rof_comp_nuopc.mod) + set(MOD cdeps_drof_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() diff --git a/dwav/CMakeLists.txt b/dwav/CMakeLists.txt index 6e338db2..2d96bf3a 100644 --- a/dwav/CMakeLists.txt +++ b/dwav/CMakeLists.txt @@ -20,3 +20,14 @@ target_include_directories (dwav PRIVATE "${PIO_Fortran_INCLUDE_DIR}") if(NOT DISABLE_FoX) target_include_directories (dwav PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../fox/include) endif() + +if(BLD_STANDALONE) + # ESMX requires mod files + foreach (SRC ${SRCFILES}) + string(REGEX REPLACE "[.]F90$" ".mod" MOD ${SRC}) + if (NOT DEFINED CIMEROOT AND MOD STREQUAL wav_comp_nuopc.mod) + set(MOD cdeps_dwav_comp.mod) + endif() + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MOD}" DESTINATION include) + endforeach () +endif() From 2521e4e2e5788e2c69f2a6e7dea52c51da49fc5a Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Thu, 30 Jun 2022 22:00:58 +0000 Subject: [PATCH 11/20] introduce export_all option --- datm/atm_comp_nuopc.F90 | 17 +++++++++++------ dice/ice_comp_nuopc.F90 | 14 +++++++++----- dlnd/lnd_comp_nuopc.F90 | 17 ++++++++++++----- docn/ocn_comp_nuopc.F90 | 12 ++++++++---- drof/rof_comp_nuopc.F90 | 14 +++++++++----- dshr/dshr_fldlist_mod.F90 | 11 +++++++++-- dwav/wav_comp_nuopc.F90 | 18 ++++++++++++------ 7 files changed, 70 insertions(+), 33 deletions(-) diff --git a/datm/atm_comp_nuopc.F90 b/datm/atm_comp_nuopc.F90 index c84e10f7..5e504a0f 100644 --- a/datm/atm_comp_nuopc.F90 +++ b/datm/atm_comp_nuopc.F90 @@ -136,6 +136,7 @@ module cdeps_datm_comp integer :: nx_global ! global nx integer :: ny_global ! global ny logical :: skip_restart_read = .false. ! true => skip restart read in continuation run + logical :: export_all = .false. ! true => export all fields, do not check connected or not ! linked lists type(fldList_type) , pointer :: fldsImport => null() @@ -222,7 +223,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) ! local variables integer :: nu ! unit number integer :: ierr ! error code - integer :: bcasttmp(9) + integer :: bcasttmp(10) type(ESMF_VM) :: vm character(len=*),parameter :: subname=trim(modName) // ':(InitializeAdvertise) ' character(*) ,parameter :: F00 = "('(" // trim(modName) // ") ',8a)" @@ -247,7 +248,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) anomaly_forcing, & skip_restart_read, & flds_presndep, & - flds_preso3 + flds_preso3, & + export_all rc = ESMF_SUCCESS @@ -284,7 +286,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if(flds_co2) bcasttmp(7) = 1 if(flds_wiso) bcasttmp(8) = 1 if(skip_restart_read) bcasttmp(9) = 1 - + if(export_all) bcasttmp(10) = 1 end if call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -305,7 +307,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call ESMF_VMBroadcast(vm, restfilm, CL, main_task, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_VMBroadcast(vm, bcasttmp, 9, main_task, rc=rc) + call ESMF_VMBroadcast(vm, bcasttmp, 10, main_task, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return nx_global = bcasttmp(1) ny_global = bcasttmp(2) @@ -316,6 +318,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) flds_co2 = (bcasttmp(7) == 1) flds_wiso = (bcasttmp(8) == 1) skip_restart_read = (bcasttmp(9) == 1) + export_all = (bcasttmp(10) == 1) ! write namelist input to standard out if (my_task == main_task) then @@ -335,6 +338,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) write(logunit,F02)' flds_co2 = ',flds_co2 write(logunit,F02)' flds_wiso = ',flds_wiso write(logunit,F02)' skip_restart_read = ',skip_restart_read + write(logunit,F02)' export_all = ',export_all end if ! Validate sdat datamode @@ -433,10 +437,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! NUOPC_Realize "realizes" a previously advertised field in the importState and exportState ! by replacing the advertised fields with the newly created fields of the same name. call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':datmExport', rc=rc) + subname//':datmExport', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call dshr_fldlist_realize( importState, fldsImport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':datmImport', rc=rc) + subname//':datmImport', .false., rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Get the time to interpolate the stream data to @@ -770,6 +774,7 @@ subroutine datm_init_dfields(rc) call ESMF_StateGet(exportState, itemNameList=lfieldnames, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return do n = 1, fieldCount + call ESMF_LogWrite(trim(subname)//': field name = '//trim(lfieldnames(n)), ESMF_LOGMSG_INFO) call ESMF_StateGet(exportState, itemName=trim(lfieldnames(n)), field=lfield, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return call ESMF_FieldGet(lfield, rank=rank, rc=rc) diff --git a/dice/ice_comp_nuopc.F90 b/dice/ice_comp_nuopc.F90 index 266d8649..ba368983 100644 --- a/dice/ice_comp_nuopc.F90 +++ b/dice/ice_comp_nuopc.F90 @@ -85,6 +85,7 @@ module cdeps_dice_comp character(CL) :: restfilm = nullstr ! model restart file namelist integer :: nx_global integer :: ny_global + logical :: export_all = .false. ! true => export all fields, do not check connected or not ! linked lists type(fldList_type) , pointer :: fldsImport => null() @@ -183,7 +184,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) namelist / dice_nml / datamode, & model_meshfile, model_maskfile, & - restfilm, nx_global, ny_global, flux_swpf, flux_Qmin, flux_Qacc, flux_Qacc0 + restfilm, nx_global, ny_global, & + flux_swpf, flux_Qmin, flux_Qacc, flux_Qacc0, export_all rc = ESMF_SUCCESS @@ -212,7 +214,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) end if ! write namelist input to standard out - write(logunit,F00)' datamode = ',trim(datamode) + write(logunit,F00)' datamode = ',trim(datamode) write(logunit,F00)' model_meshfile = ',trim(model_meshfile) write(logunit,F00)' model_maskfile = ',trim(model_maskfile) write(logunit,F01)' nx_global = ',nx_global @@ -222,10 +224,12 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) write(logunit,F02)' flux_Qacc = ',flux_Qacc write(logunit,F03)' flux_Qacc0 = ',flux_Qacc0 write(logunit,F00)' restfilm = ',trim(restfilm) + write(logunit,F02)' export_all = ',export_all bcasttmp = 0 bcasttmp(1) = nx_global bcasttmp(2) = ny_global if(flux_Qacc) bcasttmp(3) = 1 + if(export_all) bcasttmp(4) = 1 rbcasttmp(1) = flux_swpf rbcasttmp(2) = flux_Qmin rbcasttmp(3) = flux_Qacc0 @@ -251,12 +255,12 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) nx_global = bcasttmp(1) ny_global = bcasttmp(2) flux_Qacc = (bcasttmp(3) == 1) + export_all= (bcasttmp(4) == 1) flux_swpf = rbcasttmp(1) flux_Qmin = rbcasttmp(2) flux_Qacc0 = rbcasttmp(3) - ! Validate datamode if ( trim(datamode) == 'ssmi' .or. trim(datamode) == 'ssmi_iaf') then if (my_task == main_task) write(logunit,*) ' dice datamode = ',trim(datamode) @@ -327,10 +331,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! NUOPC_Realize "realizes" a previously advertised field in the importState and exportState ! by replacing the advertised fields with the newly created fields of the same name. call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':diceExport', rc=rc) + subname//':diceExport', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call dshr_fldlist_realize( importState, fldsImport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':diceImport', rc=rc) + subname//':diceImport', .false., rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! for single column, the target point might not be a point where the ice/ocn mask is > 0 diff --git a/dlnd/lnd_comp_nuopc.F90 b/dlnd/lnd_comp_nuopc.F90 index 32054058..df901dd0 100644 --- a/dlnd/lnd_comp_nuopc.F90 +++ b/dlnd/lnd_comp_nuopc.F90 @@ -81,6 +81,8 @@ module cdeps_dlnd_comp integer :: nx_global ! global nx dimension of model mesh integer :: ny_global ! global ny dimension of model mesh logical :: skip_restart_read = .false. ! true => skip restart read in continuation + logical :: export_all = .false. ! true => export all fields, do not check connected or not + ! linked lists type(fldList_type) , pointer :: fldsExport => null() type(dfield_type) , pointer :: dfields => null() @@ -166,7 +168,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) type(ESMF_VM) :: vm character(CL) :: cvalue integer :: nu ! unit number - integer :: bcasttmp(3) + integer :: bcasttmp(4) integer :: ierr ! error code character(len=*) , parameter :: subname=trim(modName)//':(InitializeAdvertise) ' character(*) , parameter :: F00 = "('(" // trim(modName) // ") ',8a)" @@ -175,7 +177,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) !------------------------------------------------------------------------------- namelist / dlnd_nml / datamode, model_meshfile, model_maskfile, & - nx_global, ny_global, restfilm, skip_restart_read + nx_global, ny_global, restfilm, skip_restart_read, export_all rc = ESMF_SUCCESS @@ -206,7 +208,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) bcasttmp(1) = nx_global bcasttmp(2) = ny_global if(skip_restart_read) bcasttmp(3) = 1 + if(export_all) bcasttmp(4) = 1 end if + call ESMF_GridCompGet(gcomp, vm=vm, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -223,6 +227,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) nx_global = bcasttmp(1) ny_global = bcasttmp(2) skip_restart_read = (bcasttmp(3) == 1) + export_all = (bcasttmp(4) == 1) ! write namelist input to standard out if (my_task == main_task) then @@ -233,6 +238,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) write(logunit,F01)' ny_global = ',ny_global write(logunit,F00)' restfilm = ',trim(restfilm) write(logunit,F02)' skip_restart_read = ',skip_restart_read + write(logunit,F02)' export_all = ',export_all endif ! Validate sdat datamode @@ -289,7 +295,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Realize the actively coupled fields, now that a mesh is established and ! initialize dfields data type (to map streams to export state fields) - call dlnd_comp_realize(importState, exportState, rc=rc) + call dlnd_comp_realize(importState, exportState, export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Read restart if necessary @@ -459,11 +465,12 @@ subroutine dlnd_comp_advertise(importState, exportState, rc) end subroutine dlnd_comp_advertise !=============================================================================== - subroutine dlnd_comp_realize(importState, exportState, rc) + subroutine dlnd_comp_realize(importState, exportState, export_all, rc) ! input/output variables type(ESMF_State) , intent(inout) :: importState type(ESMF_State) , intent(inout) :: exportState + logical , intent(in) :: export_all integer , intent(out) :: rc ! local variables @@ -478,7 +485,7 @@ subroutine dlnd_comp_realize(importState, exportState, rc) ! ------------------------------------- call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':dlndExport', rc=rc) + subname//':dlndExport', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return end subroutine dlnd_comp_realize diff --git a/docn/ocn_comp_nuopc.F90 b/docn/ocn_comp_nuopc.F90 index d885b248..e61474cb 100644 --- a/docn/ocn_comp_nuopc.F90 +++ b/docn/ocn_comp_nuopc.F90 @@ -103,6 +103,7 @@ module cdeps_docn_comp integer :: nx_global integer :: ny_global logical :: skip_restart_read = .false. ! true => skip restart read in continuation run + logical :: export_all = .false. ! true => export all fields, do not check connected or not ! linked lists type(fldList_type) , pointer :: fldsImport => null() @@ -189,7 +190,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) integer :: nu ! unit number integer :: ierr ! error code character(len=CL) :: import_data_fields ! colon deliminted strings of input data fields - integer :: bcasttmp(3) + integer :: bcasttmp(4) real(r8) :: rtmp(1) type(ESMF_VM) :: vm character(len=*),parameter :: subname=trim(module_name)//':(InitializeAdvertise) ' @@ -202,7 +203,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) namelist / docn_nml / datamode, & model_meshfile, model_maskfile, & restfilm, nx_global, ny_global, sst_constant_value, skip_restart_read, & - import_data_fields + import_data_fields, export_all rc = ESMF_SUCCESS @@ -241,11 +242,13 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) write(logunit,F02)' skip_restart_read = ',skip_restart_read write(logunit,F00)' import_data_fields = ',trim(import_data_fields) write(logunit,*) ' sst_constant_value = ',sst_constant_value + write(logunit,F02)' export_all = ', export_all bcasttmp = 0 bcasttmp(1) = nx_global bcasttmp(2) = ny_global if(skip_restart_read) bcasttmp(3) = 1 + if(export_all) bcasttmp(4) = 1 rtmp(1) = sst_constant_value endif @@ -273,6 +276,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) nx_global = bcasttmp(1) ny_global = bcasttmp(2) skip_restart_read = (bcasttmp(3) == 1) + export_all = (bcasttmp(4) == 1) sst_constant_value = rtmp(1) ! Special logic for prescribed aquaplanet @@ -390,10 +394,10 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! NUOPC_Realize "realizes" a previously advertised field in the importState and exportState ! by replacing the advertised fields with the newly created fields of the same name. call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//trim(modelname)//':Export', rc=rc) + subname//trim(modelname)//':Export', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call dshr_fldlist_realize( importState, fldsImport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//trim(modelname)//':Import', rc=rc) + subname//trim(modelname)//':Import', .false., rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! for single column, the target point might not be a valid ocn point diff --git a/drof/rof_comp_nuopc.F90 b/drof/rof_comp_nuopc.F90 index 2dbe97d3..f2172e7c 100644 --- a/drof/rof_comp_nuopc.F90 +++ b/drof/rof_comp_nuopc.F90 @@ -76,6 +76,8 @@ module cdeps_drof_comp integer :: nx_global integer :: ny_global logical :: skip_restart_read = .false. ! true => skip restart read + logical :: export_all = .false. ! true => export all fields, do not check connected or not + logical :: diagnose_data = .true. integer , parameter :: main_task=0 ! task number of main task character(*) , parameter :: rpfile = 'rpointer.rof' @@ -164,7 +166,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) integer :: ierr ! error code type(fldlist_type), pointer :: fldList type(ESMF_VM) :: vm - integer :: bcasttmp(3) + integer :: bcasttmp(4) character(len=*),parameter :: subname=trim(modName)//':(InitializeAdvertise) ' character(*) ,parameter :: F00 = "('(" // trim(modName) // ") ',8a)" character(*) ,parameter :: F01 = "('(" // trim(modName) // ") ',a,2x,i8)" @@ -172,7 +174,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) !------------------------------------------------------------------------------- namelist / drof_nml / datamode, model_meshfile, model_maskfile, & - restfilm, nx_global, ny_global, skip_restart_read + restfilm, nx_global, ny_global, skip_restart_read, export_all rc = ESMF_SUCCESS @@ -201,17 +203,19 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) end if ! write namelist input to standard out - write(logunit,F00)' datamode = ',trim(datamode) + write(logunit,F00)' datamode = ',trim(datamode) write(logunit,F00)' model_meshfile = ',trim(model_meshfile) write(logunit,F00)' model_maskfile = ',trim(model_maskfile) write(logunit,F01)' nx_global = ',nx_global write(logunit,F01)' ny_global = ',ny_global write(logunit,F00)' restfilm = ',trim(restfilm) write(logunit,F02)' skip_restart_read = ',skip_restart_read + write(logunit,F02)' export_all = ', export_all bcasttmp = 0 bcasttmp(1) = nx_global bcasttmp(2) = ny_global if(skip_restart_read) bcasttmp(3) = 1 + if(export_all) bcasttmp(4) = 1 end if ! broadcast namelist input @@ -231,7 +235,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) nx_global = bcasttmp(1) ny_global = bcasttmp(2) skip_restart_read = (bcasttmp(3) == 1) - + export_all = (bcasttmp(4) == 1) ! Validate datamode if (trim(datamode) == 'copyall') then @@ -294,7 +298,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! NUOPC_Realize "realizes" a previously advertised field in the importState and exportState ! by replacing the advertised fields with the newly created fields of the same name. call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':drofExport', rc=rc) + subname//':drofExport', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Get the time to interpolate the stream data to diff --git a/dshr/dshr_fldlist_mod.F90 b/dshr/dshr_fldlist_mod.F90 index 11b0ab5e..398e1ce6 100644 --- a/dshr/dshr_fldlist_mod.F90 +++ b/dshr/dshr_fldlist_mod.F90 @@ -53,7 +53,7 @@ end subroutine dshr_fldlist_add !=============================================================================== - subroutine dshr_fldlist_realize(state, fldLists, flds_scalar_name, flds_scalar_num, mesh, tag, rc) + subroutine dshr_fldlist_realize(state, fldLists, flds_scalar_name, flds_scalar_num, mesh, tag, export_all, rc) ! input/output variables type(ESMF_State) , intent(inout) :: state @@ -62,6 +62,7 @@ subroutine dshr_fldlist_realize(state, fldLists, flds_scalar_name, flds_scalar_n integer , intent(in) :: flds_scalar_num type(ESMF_Mesh) , intent(in) :: mesh character(len=*) , intent(in) :: tag + logical , intent(in) :: export_all integer , intent(inout) :: rc ! local variables @@ -77,7 +78,13 @@ subroutine dshr_fldlist_realize(state, fldLists, flds_scalar_name, flds_scalar_n do while (associated(fldList)) stdname = fldList%stdname - if (NUOPC_IsConnected(state, fieldName=stdname)) then + if (NUOPC_IsConnected(state, fieldName=stdname) .or. export_all) then + ! Check field name since linked list might have empty string + if (trim(stdname) == '') then + fldList => fldList%next + cycle + end if + if (stdname == trim(flds_scalar_name)) then call ESMF_LogWrite(trim(subname)//trim(tag)//" Field = "//trim(stdname)//" is connected on root pe", & ESMF_LOGMSG_INFO) diff --git a/dwav/wav_comp_nuopc.F90 b/dwav/wav_comp_nuopc.F90 index abf1a029..665aeb8d 100644 --- a/dwav/wav_comp_nuopc.F90 +++ b/dwav/wav_comp_nuopc.F90 @@ -77,6 +77,8 @@ module cdeps_dwav_comp integer :: nx_global integer :: ny_global logical :: skip_restart_read = .false. ! true => skip restart read + logical :: export_all = .false. ! true => export all fields, do not check connected or not + ! constants logical :: diagnose_data = .true. integer , parameter :: main_task=0 ! task number of main task @@ -161,7 +163,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) integer :: nu ! unit number integer :: ierr ! error code type(ESMF_VM) :: vm - integer :: bcasttmp(3) + integer :: bcasttmp(4) character(len=*),parameter :: subname=trim(modName)//':(InitializeAdvertise) ' character(*) ,parameter :: F00 = "('(" // trim(modName) // ") ',8a)" character(*) ,parameter :: F01 = "('(" // trim(modName) // ") ',a,2x,i8)" @@ -169,7 +171,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) !------------------------------------------------------------------------------- namelist / dwav_nml / datamode, model_meshfile, model_maskfile, & - restfilm, nx_global, ny_global, skip_restart_read + restfilm, nx_global, ny_global, skip_restart_read, export_all rc = ESMF_SUCCESS @@ -198,17 +200,19 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) end if ! write namelist input to standard out - write(logunit,F00)' datamode = ',trim(datamode) + write(logunit,F00)' datamode = ',trim(datamode) write(logunit,F00)' model_meshfile = ',trim(model_meshfile) write(logunit,F00)' model_maskfile = ',trim(model_maskfile) write(logunit,F01)' nx_global = ',nx_global write(logunit,F01)' ny_global = ',ny_global write(logunit,F00)' restfilm = ',trim(restfilm) write(logunit,F02)' skip_restart_read = ',skip_restart_read + write(logunit,F02)' export_all = ', export_all bcasttmp = 0 bcasttmp(1) = nx_global bcasttmp(2) = ny_global if(skip_restart_read) bcasttmp(3) = 1 + if(export_all) bcasttmp(4) = 1 endif ! broadcast namelist input @@ -228,6 +232,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) nx_global = bcasttmp(1) ny_global = bcasttmp(2) skip_restart_read = (bcasttmp(3) == 1) + export_all = (bcasttmp(4) == 1) ! Call advertise phase if (trim(datamode) == 'copyall') then @@ -278,7 +283,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Realize the actively coupled fields, now that a mesh is established and ! initialize dfields data type (to map streams to export state fields) - call dwav_comp_realize(importState, exportState, rc=rc) + call dwav_comp_realize(importState, exportState, export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Read restart if necessary @@ -427,11 +432,12 @@ subroutine dwav_comp_advertise(importState, exportState, rc) end subroutine dwav_comp_advertise !=============================================================================== - subroutine dwav_comp_realize(importState, exportState, rc) + subroutine dwav_comp_realize(importState, exportState, export_all, rc) ! input/output variables type(ESMF_State) , intent(inout) :: importState type(ESMF_State) , intent(inout) :: exportState + logical , intent(in) :: export_all integer , intent(out) :: rc ! local variables @@ -446,7 +452,7 @@ subroutine dwav_comp_realize(importState, exportState, rc) ! ------------------------------------- call dshr_fldlist_realize( exportState, fldsExport, flds_scalar_name, flds_scalar_num, model_mesh, & - subname//':dwavExport', rc=rc) + subname//':dwavExport', export_all, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Create stream-> export state mapping From 707b505020670e9552cae757c400807755e4cd31 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Thu, 13 Jul 2023 11:51:20 -0600 Subject: [PATCH 12/20] fix for docn --- docn/ocn_comp_nuopc.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docn/ocn_comp_nuopc.F90 b/docn/ocn_comp_nuopc.F90 index e61474cb..14b2b6d3 100644 --- a/docn/ocn_comp_nuopc.F90 +++ b/docn/ocn_comp_nuopc.F90 @@ -267,7 +267,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call ESMF_VMBroadcast(vm, import_data_fields, CL, main_task, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_VMBroadcast(vm, bcasttmp, 3, main_task, rc=rc) + call ESMF_VMBroadcast(vm, bcasttmp, 4, main_task, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return call ESMF_VMBroadcast(vm, rtmp, 1, main_task, rc=rc) From 4750a27a3f68f2cbc6526873290f834d85e960a3 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 11:25:21 -0600 Subject: [PATCH 13/20] update esmf bld to use official esmf action --- .github/workflows/extbuild.yml | 37 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index b2127bdc..f95b1dd3 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -80,18 +80,31 @@ jobs: with: path: ~/ESMF key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF2 - - name: Build ESMF - if: steps.cache-esmf.outputs.cache-hit != 'true' - uses: ./.github/actions/buildesmf - with: - esmf_version: ${{ env.ESMF_VERSION }} - esmf_bopt: g - esmf_comm: openmpi - install_prefix: $HOME/ESMF - netcdf_c_path: /usr - netcdf_fortran_path: /usr - pnetcdf_path: /usr - parallelio_path: $HOME/pio + # - name: Build ESMF + # if: steps.cache-esmf.outputs.cache-hit != 'true' + # uses: ./.github/actions/buildesmf + # with: + # esmf_version: ${{ env.ESMF_VERSION }} + # esmf_bopt: g + # esmf_comm: openmpi + # install_prefix: $HOME/ESMF + # netcdf_c_path: /usr + # netcdf_fortran_path: /usr + # pnetcdf_path: /usr + # parallelio_path: $HOME/pio + - name: Install ESMF + uses: esmf-org/install-esmf-action@v1 + env: + ESMF_COMPILER: gfortran + ESMF_BOPT: g + ESMF_COMM: openmpi + ESMF_NETCDF: nc-config + ESMF_INSTALL_PREFIX: $HOME/ESMF + with: + version: ${{ env.ESMF_VERSION }} + esmpy: false + cache: false + - name: Build CDEPS uses: ./.github/actions/buildcdeps with: From bb60bdcd6a7e70a3af54b68f9104304a116be17b Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 11:30:13 -0600 Subject: [PATCH 14/20] update esmf bld to use official esmf action --- .github/workflows/extbuild.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index f95b1dd3..03ddaeb6 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -19,10 +19,10 @@ jobs: CPPFLAGS: "-I/usr/include -I/usr/local/include " LDFLAGS: "-L/usr/lib/x86_64-linux-gnu " # Versions of all dependencies can be updated here - these match tag names in the github repo - ESMF_VERSION: v8.4.0 + ESMF_VERSION: v8.5.0 #PNETCDF_VERSION: checkpoint.1.12.3 #NETCDF_FORTRAN_VERSION: v4.6.0 - ParallelIO_VERSION: pio2_5_10 + ParallelIO_VERSION: pio2_6_0 steps: - id: checkout-CDEPS uses: actions/checkout@v3 @@ -100,10 +100,10 @@ jobs: ESMF_COMM: openmpi ESMF_NETCDF: nc-config ESMF_INSTALL_PREFIX: $HOME/ESMF - with: - version: ${{ env.ESMF_VERSION }} - esmpy: false - cache: false + with: + version: ${{ env.ESMF_VERSION }} + esmpy: false + cache: false - name: Build CDEPS uses: ./.github/actions/buildcdeps From aab9411b89b58e6a99f655e02befe8d02daf22f7 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 12:35:21 -0600 Subject: [PATCH 15/20] add pio as external to esmf build --- .github/workflows/extbuild.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 03ddaeb6..ecadab3d 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -100,6 +100,9 @@ jobs: ESMF_COMM: openmpi ESMF_NETCDF: nc-config ESMF_INSTALL_PREFIX: $HOME/ESMF + ESMF_PIO: external + ESMF_PIO_INCLUDE: $HOME/pio/include + ESMF_PIO_LIBPATH: $HOME/pio/lib with: version: ${{ env.ESMF_VERSION }} esmpy: false @@ -108,7 +111,7 @@ jobs: - name: Build CDEPS uses: ./.github/actions/buildcdeps with: - esmfmkfile: $HOME/ESMF/lib/libg/Linux.gfortran.64.openmpi.default/esmf.mk + esmfmkfile: $HOME/ESMF/lib/esmf.mk pio_path: $HOME/pio src_root: $GITHUB_WORKSPACE cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ From 2e1b9f8a59b5259da7f1ea461abaeb574cac9c67 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 12:50:51 -0600 Subject: [PATCH 16/20] add pio as external to esmf build --- .github/workflows/extbuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index ecadab3d..f5bf9da8 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -99,10 +99,10 @@ jobs: ESMF_BOPT: g ESMF_COMM: openmpi ESMF_NETCDF: nc-config - ESMF_INSTALL_PREFIX: $HOME/ESMF + ESMF_INSTALL_PREFIX: /home/runner/ESMF ESMF_PIO: external - ESMF_PIO_INCLUDE: $HOME/pio/include - ESMF_PIO_LIBPATH: $HOME/pio/lib + ESMF_PIO_INCLUDE: /home/runner/pio/include + ESMF_PIO_LIBPATH: /home/runner/pio/lib with: version: ${{ env.ESMF_VERSION }} esmpy: false From 57ef5ec5302794087350a53ae67dd1aca1599851 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 13:27:37 -0600 Subject: [PATCH 17/20] add pnetcdf-config --- .github/workflows/extbuild.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index f5bf9da8..ba4e9ada 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -74,12 +74,12 @@ jobs: parallelio_version: ${{ env.ParallelIO_VERSION }} enable_fortran: True install_prefix: $HOME/pio - - name: Cache ESMF - id: cache-esmf - uses: actions/cache@v3 - with: - path: ~/ESMF - key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF2 + # - name: Cache ESMF + # id: cache-esmf + # uses: actions/cache@v3 + # with: + # path: ~/ESMF + # key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF2 # - name: Build ESMF # if: steps.cache-esmf.outputs.cache-hit != 'true' # uses: ./.github/actions/buildesmf @@ -99,6 +99,7 @@ jobs: ESMF_BOPT: g ESMF_COMM: openmpi ESMF_NETCDF: nc-config + ESMF_PNETCDF: pnetcdf-config ESMF_INSTALL_PREFIX: /home/runner/ESMF ESMF_PIO: external ESMF_PIO_INCLUDE: /home/runner/pio/include From 6dce40229847d9e67da4972c1806e860d8306912 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 13:59:48 -0600 Subject: [PATCH 18/20] cleanup github workflow script --- .github/workflows/extbuild.yml | 46 +--------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index ba4e9ada..8f063952 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -20,8 +20,6 @@ jobs: LDFLAGS: "-L/usr/lib/x86_64-linux-gnu " # Versions of all dependencies can be updated here - these match tag names in the github repo ESMF_VERSION: v8.5.0 - #PNETCDF_VERSION: checkpoint.1.12.3 - #NETCDF_FORTRAN_VERSION: v4.6.0 ParallelIO_VERSION: pio2_6_0 steps: - id: checkout-CDEPS @@ -37,30 +35,6 @@ jobs: sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev sudo apt-get install pnetcdf-bin libpnetcdf-dev sudo apt-get install autotools-dev autoconf - # - id: cache-pnetcdf - # uses: actions/cache@v3 - # with: - # path: ~/pnetcdf - # key: ${{ runner.os }}-${{ env.PNETCDF_VERSION}}-pnetcdf1 - # - name: Build PNetCDF - # if: steps.cache-pnetcdf.outputs.cache-hit != 'true' - # uses: ./.github/actions/buildpnetcdf - # with: - # pnetcdf_version: ${{ env.PNETCDF_VERSION }} - # install_prefix: $HOME/pnetcdf - # - name: Cache netcdf-fortran - # id: cache-netcdf-fortran - # uses: actions/cache@v3 - # with: - # path: ~/netcdf-fortran - # key: ${{ runner.os }}-${{ env.NETCDF_FORTRAN_VERSION }}-netcdf-fortran1 - # - name: Build NetCDF Fortran - # if: steps.cache-netcdf-fortran.outputs.cache-hit != 'true' - # uses: ./.github/actions/buildnetcdff - # with: - # netcdf_fortran_version: ${{ env.NETCDF_FORTRAN_VERSION }} - # install_prefix: $HOME/netcdf-fortran - # netcdf_c_path: /usr - name: Cache PARALLELIO id: cache-PARALLELIO uses: actions/cache@v3 @@ -74,24 +48,6 @@ jobs: parallelio_version: ${{ env.ParallelIO_VERSION }} enable_fortran: True install_prefix: $HOME/pio - # - name: Cache ESMF - # id: cache-esmf - # uses: actions/cache@v3 - # with: - # path: ~/ESMF - # key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF2 - # - name: Build ESMF - # if: steps.cache-esmf.outputs.cache-hit != 'true' - # uses: ./.github/actions/buildesmf - # with: - # esmf_version: ${{ env.ESMF_VERSION }} - # esmf_bopt: g - # esmf_comm: openmpi - # install_prefix: $HOME/ESMF - # netcdf_c_path: /usr - # netcdf_fortran_path: /usr - # pnetcdf_path: /usr - # parallelio_path: $HOME/pio - name: Install ESMF uses: esmf-org/install-esmf-action@v1 env: @@ -107,7 +63,7 @@ jobs: with: version: ${{ env.ESMF_VERSION }} esmpy: false - cache: false + cache: true - name: Build CDEPS uses: ./.github/actions/buildcdeps From 8276318340c99a933e3b72210814c9bd9c071258 Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 15:46:47 -0600 Subject: [PATCH 19/20] response to review --- .github/workflows/extbuild.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 8f063952..6e4aa00c 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -39,7 +39,7 @@ jobs: id: cache-PARALLELIO uses: actions/cache@v3 with: - path: ~/pio + path: $GITHUB_WORKSPACE/pio key: ${{ runner.os }}-${{ env.ParallelIO_VERSION }}-parallelio2 - name: Build ParallelIO if: steps.cache-PARALLELIO.outputs.cache-hit != 'true' @@ -47,7 +47,7 @@ jobs: with: parallelio_version: ${{ env.ParallelIO_VERSION }} enable_fortran: True - install_prefix: $HOME/pio + install_prefix: $GITHUB_WORKSPACE/pio - name: Install ESMF uses: esmf-org/install-esmf-action@v1 env: @@ -56,10 +56,10 @@ jobs: ESMF_COMM: openmpi ESMF_NETCDF: nc-config ESMF_PNETCDF: pnetcdf-config - ESMF_INSTALL_PREFIX: /home/runner/ESMF + ESMF_INSTALL_PREFIX: $GITHUB_WORKSPACE/ESMF ESMF_PIO: external - ESMF_PIO_INCLUDE: /home/runner/pio/include - ESMF_PIO_LIBPATH: /home/runner/pio/lib + ESMF_PIO_INCLUDE: $GITHUB_WORKSPACE/pio/include + ESMF_PIO_LIBPATH: $GITHUB_WORKSPACE/pio/lib with: version: ${{ env.ESMF_VERSION }} esmpy: false @@ -68,8 +68,8 @@ jobs: - name: Build CDEPS uses: ./.github/actions/buildcdeps with: - esmfmkfile: $HOME/ESMF/lib/esmf.mk - pio_path: $HOME/pio + esmfmkfile: $ESMFMKFILE + pio_path: $GITHUB_WORKSPACE/pio src_root: $GITHUB_WORKSPACE cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ -ffree-form -ffree-line-length-none -fallow-argument-mismatch \"" From f415e668e5bd8e029b8c2756bc21df4a102be58e Mon Sep 17 00:00:00 2001 From: James Edwards Date: Wed, 16 Aug 2023 15:56:05 -0600 Subject: [PATCH 20/20] response to review --- .github/workflows/extbuild.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml index 6e4aa00c..52afb7b8 100644 --- a/.github/workflows/extbuild.yml +++ b/.github/workflows/extbuild.yml @@ -39,7 +39,7 @@ jobs: id: cache-PARALLELIO uses: actions/cache@v3 with: - path: $GITHUB_WORKSPACE/pio + path: ${GITHUB_WORKSPACE}/pio key: ${{ runner.os }}-${{ env.ParallelIO_VERSION }}-parallelio2 - name: Build ParallelIO if: steps.cache-PARALLELIO.outputs.cache-hit != 'true' @@ -47,7 +47,7 @@ jobs: with: parallelio_version: ${{ env.ParallelIO_VERSION }} enable_fortran: True - install_prefix: $GITHUB_WORKSPACE/pio + install_prefix: ${GITHUB_WORKSPACE}/pio - name: Install ESMF uses: esmf-org/install-esmf-action@v1 env: @@ -56,10 +56,10 @@ jobs: ESMF_COMM: openmpi ESMF_NETCDF: nc-config ESMF_PNETCDF: pnetcdf-config - ESMF_INSTALL_PREFIX: $GITHUB_WORKSPACE/ESMF + ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF ESMF_PIO: external - ESMF_PIO_INCLUDE: $GITHUB_WORKSPACE/pio/include - ESMF_PIO_LIBPATH: $GITHUB_WORKSPACE/pio/lib + ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include + ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib with: version: ${{ env.ESMF_VERSION }} esmpy: false @@ -69,8 +69,8 @@ jobs: uses: ./.github/actions/buildcdeps with: esmfmkfile: $ESMFMKFILE - pio_path: $GITHUB_WORKSPACE/pio - src_root: $GITHUB_WORKSPACE + pio_path: ${GITHUB_WORKSPACE}/pio + src_root: ${GITHUB_WORKSPACE} cmake_flags: " -Wno-dev -DCMAKE_BUILD_TYPE=DEBUG -DWERROR=ON -DCMAKE_Fortran_FLAGS=\"-DCPRGNU -g -Wall \ -ffree-form -ffree-line-length-none -fallow-argument-mismatch \"" - name: Test CDEPS