diff --git a/cime_config/stream_cdeps.py b/cime_config/stream_cdeps.py index 94302de29..ead74bbf2 100644 --- a/cime_config/stream_cdeps.py +++ b/cime_config/stream_cdeps.py @@ -95,6 +95,7 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file # endif # end while index += 1 + line = case.get_resolved_value(line) lines_input_new.append(line) #end while @@ -134,14 +135,19 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file # write contents of stream file for stream_name in stream_names: - if stream_name.startswith("NEON."): + # 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)) - + 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)) + 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)) 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)) - 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)) @@ -175,7 +181,7 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file stream_vars[node_name] = "" stream_datafiles = "" for child in self.get_children(root=node): - if available_neon_data and stream_name.startswith("NEON"): + 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" diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index 575949b10..c3d59375a 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -58,12 +58,16 @@ def _get_neon_data_availability(case, neonsite): neonatm = None dataversion = case.get_value("NEONVERSION") if dataversion == "latest": - dataversions = ["v2", "v1"] + dataversions = ["v3", "v2", "v1"] else: dataversions = [dataversion] for version in dataversions: - if not newestdate: + # Once a date range for a version has been determined for any version, the loop is complete. + # Eg, if data is available for v3, the loop will not continue to v2; + # however, if data is not available for v3, it will check for v2. + # Thus, it is important for dataversions to be listed from newest to oldest. + if not newestdate: with open(fullpath, "r") as fd: for line in fd.readlines(): fpath, fname = os.path.split(line) @@ -106,6 +110,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path datm_presaero = case.get_value("DATM_PRESAERO") datm_presndep = case.get_value("DATM_PRESNDEP") datm_preso3 = case.get_value("DATM_PRESO3") + clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") datm_co2_tseries = case.get_value("DATM_CO2_TSERIES") atm_grid = case.get_value("ATM_GRID") model_grid = case.get_value("GRID") @@ -129,6 +134,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path logger.debug("DATM presndep mode is {}".format(datm_presndep)) logger.debug("DATM preso3 mode is {}".format(datm_preso3)) logger.debug("DATM topo mode is {}".format(datm_topo)) + logger.debug("CLM_USRDAT_NAME is {}".format(clm_usrdat_name)) # Initialize namelist defaults config = {} @@ -148,6 +154,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path config['datm_presaero'] = datm_presaero config['datm_presndep'] = datm_presndep config['datm_preso3'] = datm_preso3 + config['clm_usrdat_name'] = clm_usrdat_name if case.get_value('PTS_LON'): scol_lon = float(case.get_value('PTS_LON')) @@ -173,7 +180,6 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path streamlist = nmlgen.get_streams() if type(streamlist) == type(str()): streamlist = [] - if datm_presaero != "none": streamlist.append("presaero.{}".format(datm_presaero)) if datm_presndep != "none": @@ -184,6 +190,10 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path streamlist.append("topo.{}".format(datm_topo)) if datm_co2_tseries != "none": streamlist.append("co2tseries.{}".format(datm_co2_tseries)) + if clm_usrdat_name == 'NEON.PRISM': + streamlist.append(clm_usrdat_name+"_PRECIP."+neonsite) + if clm_usrdat_name == 'NEON': + streamlist.append(clm_usrdat_name+".NEON_PRECIP."+neonsite) bias_correct = nmlgen.get_value("bias_correct") if bias_correct is not None: diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index c29decdca..4da427f2d 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -233,10 +233,10 @@ none + $DIN_LOC_ROOT/atm/cdeps/v1/$NEONSITE/%ym.nc - PRECTmms Faxa_precn FSDS Faxa_swdn ZBOT Sa_z TBOT Sa_tbot @@ -267,6 +267,79 @@ single + + + + + + + none + + + $DIN_LOC_ROOT/atm/cdeps/PRISM/${NEONSITE}_%y.nc + + + PRECIP Faxa_precn + + null + + none + + null + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END + 0 + + linear + + + cycle + limit + + + 1.5 + + single + + + + + + + + + none + + + + $DIN_LOC_ROOT/atm/cdeps/v1/$NEONSITE/%ym.nc + + + PRECTmms Faxa_precn + + null + + none + + null + $DATM_YR_ALIGN + $DATM_YR_START + $DATM_YR_END + 0 + + linear + + + cycle + limit + + + 1.5 + + single + +