From de677af5eaa5a49a55555b6c6175a7dc0ffc25ef Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 20 Jan 2021 15:40:30 -0700 Subject: [PATCH 1/9] new neon station stream --- datm/cime_config/stream_definition_datm.xml | 49 +++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index 7608c1072c..7672e621dc 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -18,10 +18,10 @@ %ym => year-month from the range yearfirst to yearlast with all 12 months %ymd => year-month-day from the range yearfirst to yearlast with all 12 months - ****** + ****** NOTE: any entry that has %y, %ym or %ymd MUST have first_year and last_year syntax - ****** + ****** Each mode below, except for presaero, has a set of streams associated with it The presaero stream, is associated with all modes @@ -194,6 +194,49 @@ BC.QIAN.Precip --> + + + + + + + + + + /glade/work/jedwards/sandboxes/NEON/inputdata/single_point/datmdata_NEON/$NEONSITE/%ym.nc + + + PRECTmms precn + FSDS swdn + ZBOT z + TBOT tbot + WIND wind + RH rh + PSRF pbot + FLDS lwdn + + null + + bilinear + nn + + null + 2018 + 2018 + 2019 + 0 + + coszen + + + cycle + + + 1.5 + + single + + @@ -209,7 +252,7 @@ FSDS Faxa_swdn null - + bilinear null From 8c52dd7d7bc6ccfcda5fd8895d00d44d1bb87036 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 1 Feb 2021 09:00:55 -0700 Subject: [PATCH 2/9] neon datm development --- cime_config/stream_cdeps.py | 22 +++++++++---------- datm/cime_config/buildnml | 2 ++ datm/cime_config/config_component.xml | 8 +++++-- datm/cime_config/namelist_definition_datm.xml | 22 +++++++------------ datm/cime_config/stream_definition_datm.xml | 7 +++--- 5 files changed, 29 insertions(+), 32 deletions(-) diff --git a/cime_config/stream_cdeps.py b/cime_config/stream_cdeps.py index 3cbb2aa0b8..51b8035090 100644 --- a/cime_config/stream_cdeps.py +++ b/cime_config/stream_cdeps.py @@ -42,7 +42,7 @@ """ - + class StreamCDEPS(GenericXML): def __init__(self, infile, schema): @@ -65,7 +65,7 @@ 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: - self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : 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 @@ -99,10 +99,10 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file stream_datafiles = child.xml_element.text stream_datafiles = self._resolve_values(case, stream_datafiles) if 'first_year' in child.xml_element.attrib and 'last_year' in child.xml_element.attrib: - value = child.xml_element.get('first_year') + 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') + 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) @@ -110,15 +110,15 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file stream_datafiles = self._sub_paths(stream_datafiles, year_first, year_last) stream_datafiles = stream_datafiles.strip() #endif - if stream_vars[node_name]: + if stream_vars[node_name]: 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") elif ( node_name == 'stream_meshfile' - or node_name == 'stream_mapalgo' - or node_name == 'stream_tintalgo' - or node_name == 'stream_taxmode' + or node_name == 'stream_mapalgo' + or node_name == 'stream_tintalgo' + or node_name == 'stream_taxmode' or node_name == 'stream_dtlimit'): attributes['model_grid'] = case.get_value("GRID") attributes['compset'] = case.get_value("COMPSET") @@ -130,7 +130,7 @@ 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) - + # append to stream xml file stream_file_text = _stream_nuopc_file_template.format(**stream_vars) with open(streams_xml_file, 'a') as stream_file: @@ -193,7 +193,7 @@ def _get_input_file_hash(self, data_list_file): 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 + Get the first best match for multiple tags in child_name based on the attributes input @@ -396,5 +396,3 @@ def _add_xml_delimiter(list_to_deliminate, delimiter): #endif #endfor return "\n ".join(list_to_deliminate) - - diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index d0f75e00e8..710f1be0ce 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -111,6 +111,8 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path anomaly_forcing = nmlgen.get_value("anomaly_forcing") if anomaly_forcing[0] is not None: streamlist += anomaly_forcing + if '$' in streamlist: + print("streamlist is {}".format(streamlist) # Generate datm.streams.xml stream_file = os.path.join(_CDEPS_CONFIG,os.pardir, "datm","cime_config","stream_definition_datm.xml") diff --git a/datm/cime_config/config_component.xml b/datm/cime_config/config_component.xml index d5639c3fbe..892bc6c481 100644 --- a/datm/cime_config/config_component.xml +++ b/datm/cime_config/config_component.xml @@ -10,7 +10,7 @@ This file may have atm desc entries. --> - Data driven ATM + Data driven ATM QIAN data set QIAN with water isotopes CRUNCEP data set @@ -24,6 +24,7 @@ interannual JRA55 forcing interannual JRA55 forcing, v1.4, through 2018 ERA5 interannual forcing + NEON project tower site (1PT) @@ -37,7 +38,7 @@ char - CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018,ERA5 + CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018,ERA5,NEON CORE2_NYF run_component_datm env_run.xml @@ -58,6 +59,7 @@ 1PT CPLHIST ERA5 + 1PT @@ -237,6 +239,7 @@ 1980 2005 2002 + 2018 run_component_datm env_run.xml @@ -279,6 +282,7 @@ 2018 2014 2003 + 2019 run_component_datm env_run.xml diff --git a/datm/cime_config/namelist_definition_datm.xml b/datm/cime_config/namelist_definition_datm.xml index 320a3b1e7e..4964ab7416 100644 --- a/datm/cime_config/namelist_definition_datm.xml +++ b/datm/cime_config/namelist_definition_datm.xml @@ -37,6 +37,9 @@ 1PT.urbanc_alpha + + NEON.$NEONSITE + CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP @@ -99,6 +102,9 @@ active-land-only simulations. ----datamode = "ERA5"---- Fifth generation ECMWF atmospheric reanalysis of the global climate + ----datamode = "CPLHIST" ---- + ----datamode = "NEON" ---- + NEON project tower site data @@ -107,20 +113,8 @@ CLMNCEP - - CORE2_NYF - - - CORE2_IAF - - - CORE_IAF_JRA - - - ERA5 - - - CPLHIST + + $DATM_MODE diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index 7672e621dc..d6394eb62c 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -195,12 +195,12 @@ --> - + - + none /glade/work/jedwards/sandboxes/NEON/inputdata/single_point/datmdata_NEON/$NEONSITE/%ym.nc @@ -217,8 +217,7 @@ null - bilinear - nn + none null 2018 From 8098e8af8514384ef6c57dd3af37a2b1314511bb Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 8 Feb 2021 16:54:02 -0700 Subject: [PATCH 3/9] updates for neon --- cime_config/stream_cdeps.py | 6 +++++- datm/cime_config/buildnml | 2 +- datm/cime_config/stream_definition_datm.xml | 22 ++++++++++----------- datm/datm_datamode_clmncep_mod.F90 | 3 +++ streams/dshr_strdata_mod.F90 | 1 - 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/cime_config/stream_cdeps.py b/cime_config/stream_cdeps.py index 51b8035090..d26c6722c9 100644 --- a/cime_config/stream_cdeps.py +++ b/cime_config/stream_cdeps.py @@ -64,7 +64,11 @@ def create_stream_xml(self, stream_names, case, streams_xml_file, data_list_file stream_file.write('\n') # write contents of stream file for stream_name in stream_names: - if stream_name: + if stream_name.startswith("NEON."): + 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: self.stream_nodes = super(StreamCDEPS,self).get_child("stream_entry", {"name" : stream_name}, err_msg="No stream_entry {} found".format(stream_name)) diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index 710f1be0ce..2f79467049 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -112,7 +112,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path if anomaly_forcing[0] is not None: streamlist += anomaly_forcing if '$' in streamlist: - print("streamlist is {}".format(streamlist) + print("streamlist is {}".format(streamlist)) # Generate datm.streams.xml stream_file = os.path.join(_CDEPS_CONFIG,os.pardir, "datm","cime_config","stream_definition_datm.xml") diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index d6394eb62c..32ae405d8c 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -206,14 +206,14 @@ /glade/work/jedwards/sandboxes/NEON/inputdata/single_point/datmdata_NEON/$NEONSITE/%ym.nc - PRECTmms precn - FSDS swdn - ZBOT z - TBOT tbot - WIND wind - RH rh - PSRF pbot - FLDS lwdn + PRECTmms Faxa_precn + FSDS Faxa_swdn + ZBOT Sa_z + TBOT Sa_tbot + WIND Sa_wind + RH Sa_rh + PSRF Sa_pbot + FLDS Faxa_lwdn null @@ -225,13 +225,13 @@ 2019 0 - coszen + linear - cycle + extend - 1.5 + 1e30 single diff --git a/datm/datm_datamode_clmncep_mod.F90 b/datm/datm_datamode_clmncep_mod.F90 index 45b5661495..3db1165c91 100644 --- a/datm/datm_datamode_clmncep_mod.F90 +++ b/datm/datm_datamode_clmncep_mod.F90 @@ -349,6 +349,9 @@ subroutine datm_datamode_clmncep_advance(masterproc, logunit, mpicom, rc) rtmp = maxval(Sa_tbot(:)) call shr_mpi_max(rtmp, tbotmax, mpicom, 'datm_tbot', all=.true.) write(logunit,*) trim(subname),' tbotmax = ',tbotmax + if(tbotmax <= 0) then + call shr_sys_abort(subname//'ERROR: bad value in tbotmax') + endif ! determine anidrmax (see below for use) if (atm_prognostic) then diff --git a/streams/dshr_strdata_mod.F90 b/streams/dshr_strdata_mod.F90 index 078d010134..d87d6844df 100644 --- a/streams/dshr_strdata_mod.F90 +++ b/streams/dshr_strdata_mod.F90 @@ -940,7 +940,6 @@ subroutine shr_strdata_advance(sdat, ymd, tod, logunit, istr, timers, rc) ! --------------------------------------------------------- do ns = 1,nstreams - if (trim(sdat%stream(ns)%tinterpalgo) == 'coszen') then ! Determine stream lower bound index From 62b75ba6f9e457c26a3993de0a42f70362d84c6b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 9 Feb 2021 08:24:52 -0700 Subject: [PATCH 4/9] remove debug print --- datm/cime_config/buildnml | 2 -- 1 file changed, 2 deletions(-) diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index 2f79467049..d0f75e00e8 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -111,8 +111,6 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path anomaly_forcing = nmlgen.get_value("anomaly_forcing") if anomaly_forcing[0] is not None: streamlist += anomaly_forcing - if '$' in streamlist: - print("streamlist is {}".format(streamlist)) # Generate datm.streams.xml stream_file = os.path.join(_CDEPS_CONFIG,os.pardir, "datm","cime_config","stream_definition_datm.xml") From d0ce173c65b33e3e58d16a35c5bc874f2cf05525 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 9 Feb 2021 08:35:47 -0700 Subject: [PATCH 5/9] add tag action --- .github/workflows/tagprs.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/tagprs.yaml diff --git a/.github/workflows/tagprs.yaml b/.github/workflows/tagprs.yaml new file mode 100644 index 0000000000..9e83702656 --- /dev/null +++ b/.github/workflows/tagprs.yaml @@ -0,0 +1,17 @@ +name: Bump version +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Bump version and push tag + uses: anothrNick/github-tag-action@1.26.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true From 1b7b86510b437fd4aeb7e2431e9e789f3f55a4cf Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 19 Feb 2021 15:08:17 -0700 Subject: [PATCH 6/9] rework NEON streams --- datm/cime_config/buildnml | 9 ++++++++- datm/cime_config/config_component.xml | 8 ++------ datm/cime_config/namelist_definition_datm.xml | 6 ++---- datm/cime_config/stream_definition_datm.xml | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index d0f75e00e8..1a212256be 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -69,7 +69,13 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path # Initialize namelist defaults config = {} - config['model_grid'] = model_grid + if 'CLM_USRDAT' in model_grid: + config['model_grid'] = 'CLM_USRDAT' + if case.get_value("NEONSITE"): + config['neon'] = "True" + else: + config['model_grid'] = model_grid + config['datm_mode'] = datm_mode config['datm_co2_tseries'] = datm_co2_tseries config['datm_presaero'] = datm_presaero @@ -88,6 +94,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path else: config['single_column'] = 'false' + print("Config is {}".format(config)) nmlgen.init_defaults(infile, config) # Generate datm_in diff --git a/datm/cime_config/config_component.xml b/datm/cime_config/config_component.xml index 892bc6c481..d5639c3fbe 100644 --- a/datm/cime_config/config_component.xml +++ b/datm/cime_config/config_component.xml @@ -10,7 +10,7 @@ This file may have atm desc entries. --> - Data driven ATM + Data driven ATM QIAN data set QIAN with water isotopes CRUNCEP data set @@ -24,7 +24,6 @@ interannual JRA55 forcing interannual JRA55 forcing, v1.4, through 2018 ERA5 interannual forcing - NEON project tower site (1PT) @@ -38,7 +37,7 @@ char - CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018,ERA5,NEON + CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018,ERA5 CORE2_NYF run_component_datm env_run.xml @@ -59,7 +58,6 @@ 1PT CPLHIST ERA5 - 1PT @@ -239,7 +237,6 @@ 1980 2005 2002 - 2018 run_component_datm env_run.xml @@ -282,7 +279,6 @@ 2018 2014 2003 - 2019 run_component_datm env_run.xml diff --git a/datm/cime_config/namelist_definition_datm.xml b/datm/cime_config/namelist_definition_datm.xml index 4964ab7416..02a78c579b 100644 --- a/datm/cime_config/namelist_definition_datm.xml +++ b/datm/cime_config/namelist_definition_datm.xml @@ -37,7 +37,7 @@ 1PT.urbanc_alpha - + NEON.$NEONSITE @@ -68,7 +68,7 @@ char datm datm_nml - CLMNCEP,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA,ERA5,CPLHIST + CLMNCEP,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA,ERA5,CPLHIST,1PT general method that operates on the data. ----datamode = "CPLHIST"---- @@ -103,8 +103,6 @@ ----datamode = "ERA5"---- Fifth generation ECMWF atmospheric reanalysis of the global climate ----datamode = "CPLHIST" ---- - ----datamode = "NEON" ---- - NEON project tower site data diff --git a/datm/cime_config/stream_definition_datm.xml b/datm/cime_config/stream_definition_datm.xml index 32ae405d8c..b42425bbcc 100644 --- a/datm/cime_config/stream_definition_datm.xml +++ b/datm/cime_config/stream_definition_datm.xml @@ -203,7 +203,7 @@ none - /glade/work/jedwards/sandboxes/NEON/inputdata/single_point/datmdata_NEON/$NEONSITE/%ym.nc + $DIN_LOC_ROOT/atm/cdeps/v1/$NEONSITE/%ym.nc PRECTmms Faxa_precn From 2046a0adc57e78acff869547ef7ccb658509ab28 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 12 Apr 2021 09:16:06 -0600 Subject: [PATCH 7/9] superceeded workflow --- .github/workflows/tagprs.yaml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/tagprs.yaml diff --git a/.github/workflows/tagprs.yaml b/.github/workflows/tagprs.yaml deleted file mode 100644 index 9e83702656..0000000000 --- a/.github/workflows/tagprs.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Bump version -on: - push: - branches: - - master -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.26.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true From 06f47e0199b595a95574570886b41fb0c2f3df7b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 16 Apr 2021 09:55:51 -0600 Subject: [PATCH 8/9] remove debug print statement --- datm/cime_config/buildnml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datm/cime_config/buildnml b/datm/cime_config/buildnml index 1a212256be..573655af0b 100755 --- a/datm/cime_config/buildnml +++ b/datm/cime_config/buildnml @@ -82,7 +82,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path if case.get_value('PTS_LON'): scol_lon = float(case.get_value('PTS_LON')) - else: + else: scol_lon = -999. if case.get_value('PTS_LAT'): scol_lat = float(case.get_value('PTS_LAT')) @@ -94,7 +94,6 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path else: config['single_column'] = 'false' - print("Config is {}".format(config)) nmlgen.init_defaults(infile, config) # Generate datm_in From 6dc9e767ea1868d3f47dd42672cf8f2c7ae2f317 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 23 Apr 2021 10:08:26 -0600 Subject: [PATCH 9/9] fix issue with double quotes --- datm/cime_config/namelist_definition_datm.xml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/datm/cime_config/namelist_definition_datm.xml b/datm/cime_config/namelist_definition_datm.xml index 02a78c579b..cfff5744b0 100644 --- a/datm/cime_config/namelist_definition_datm.xml +++ b/datm/cime_config/namelist_definition_datm.xml @@ -111,6 +111,18 @@ CLMNCEP + + CORE2_IAF + + + CORE_IAF_JRA + + + ERA5 + + + CPLHIST + $DATM_MODE @@ -127,7 +139,7 @@ $ATM_DOMAIN_MESH - null + null @@ -141,7 +153,7 @@ $ATM_DOMAIN_MESH - null + null @@ -154,7 +166,7 @@ $ATM_NX - 1 + 1 @@ -167,7 +179,7 @@ $ATM_NY - 1 + 1