Skip to content

Commit

Permalink
CTSM5.3 updates to the mksurfdata_esmf namelist
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Jul 24, 2024
1 parent 1a0dc60 commit 7303c61
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 43 deletions.
39 changes: 20 additions & 19 deletions python/ctsm/toolchain/gen_mksurfdata_namelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,16 @@ def check_ssp_years(start_year, end_year):
"""
Check years associated with SSP period
"""
if int(start_year) > 2015:
if int(start_year) > 2022:
error_msg = (
"ERROR: if start-year > 2015 must add an --ssp_rcp "
"ERROR: if start-year > 2022 must add an --ssp_rcp "
"argument that is not none: valid opts for ssp-rcp "
f"are {valid_opts}"
)
sys.exit(error_msg)
elif int(end_year) > 2015:
elif int(end_year) > 2022:
error_msg = (
"ERROR: if end-year > 2015 must add an --ssp-rcp "
"ERROR: if end-year > 2022 must add an --ssp-rcp "
"argument that is not none: valid opts for ssp-rcp "
f"are {valid_opts}"
)
Expand Down Expand Up @@ -537,6 +537,8 @@ def determine_pft_years(start_year, end_year, potveg):
pft_years_ssp = "-999"
if potveg:
pft_years = "PtVg"
elif int(start_year) == 1700 and int(end_year) == 1700:
pft_years = "1700"
elif int(start_year) == 1850 and int(end_year) == 1850:
pft_years = "1850"
elif int(start_year) == 2000 and int(end_year) == 2000:
Expand All @@ -545,21 +547,21 @@ def determine_pft_years(start_year, end_year, potveg):
pft_years = "2005"
elif int(start_year) >= 850 and int(end_year) <= 1849:
pft_years = "0850-1849"
elif int(start_year) >= 1850 and int(start_year) <= 2100 and int(end_year) <= 2015:
pft_years = "1850-2015"
elif int(start_year) >= 1850 and int(start_year) <= 2100 and int(end_year) <= 2100:
pft_years = "1850-2015"
pft_years_ssp = "2016-2100"
elif int(start_year) >= 2016 and int(start_year) <= 2100 and int(end_year) <= 2100:
elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2022:
pft_years = "1700-2022"
elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2100:
pft_years = "1700-2022"
pft_years_ssp = "2023-2100"
elif int(start_year) >= 2023 and int(start_year) <= 2100 and int(end_year) <= 2100:
pft_years = "-999"
pft_years_ssp = "2016-2100"
pft_years_ssp = "2023-2100"
else:
error_msg = (
f"ERROR: start_year is {start_year} and end_year is "
f"{end_year}; expected start/end-year options are: "
"- 1850, 2000, 2005 for time-slice options "
"- 1700, 1850, 2000, 2005 for time-slice options "
"- in the range from 850 to 1849 "
"- in the range from 1850 to 2100 "
"- in the range from 1700 to 2100 "
"- TODO in the range from 2101 to 2300 "
"- OR user must set the potveg_flag "
)
Expand Down Expand Up @@ -645,7 +647,7 @@ def write_nml_rawinput(
# write everything else
nlfile.write(f" {key} = '{value}' \n")

if start_year <= 2015:
if start_year <= 2022:
mksrf_fvegtyp = rawdata_files["mksrf_fvegtyp"]
mksrf_fvegtyp_mesh = rawdata_files["mksrf_fvegtyp_mesh"]
mksrf_fhrvtyp = rawdata_files["mksrf_fvegtyp"]
Expand Down Expand Up @@ -714,7 +716,7 @@ def handle_transient_run(
with open(landuse_fname, "w", encoding="utf-8") as landuse_file:
for year in range(start_year, end_year + 1):
year_str = str(year)
if year <= 2015:
if year <= 2022:
file1 = rawdata_files["mksrf_fvegtyp"]
file2 = rawdata_files["mksrf_fvegtyp_urban"]
file3 = rawdata_files["mksrf_fvegtyp_lake"]
Expand Down Expand Up @@ -832,16 +834,15 @@ def determine_input_rawdata(start_year, input_path, attribute_list):
max_match_child = child2

if max_match_child is None:
# TODO slevis: Are these if-statements backwards?
# For years greater than 2015 - mksrf_fvegtyp_ssp must have a match
if start_year <= 2015:
# For years greater than 2022 - mksrf_fvegtyp_ssp must have a match
if start_year > 2022:
if "mksrf_fvegtyp_ssp" not in child1.tag:
error_msg = f"ERROR: {child1.tag} has no matches"
sys.exit(error_msg)
else:
continue
else:
# For years less than 2015 - mksrf_fvegtyp must have a match
# For years less than 2023 - mksrf_fvegtyp must have a match
if "mksrf_fvegtyp" not in child1.tag:
error_msg = f"ERROR: {child1.tag} has no matches"
sys.exit(error_msg)
Expand Down
57 changes: 33 additions & 24 deletions tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<mksrf_flai>
<entry>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histMKSRFDeg025_231228/mksrf_landuse_ctsm52_pftlai_CLIM.c231228.nc</data_filename>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_pftlai_CLIM.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
</entry>
<entry pft_years="2005" hires_pft='on'>
Expand All @@ -25,7 +25,7 @@

<mksrf_fsoicol>
<entry>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histMKSRFDeg025_231228/mksrf_landuse_ctsm52_soilcolor_CLIM.c231228.nc</data_filename>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_soilcolor_CLIM.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
</entry>
<entry pft_years="2005" hires_pft='on'>
Expand Down Expand Up @@ -212,30 +212,37 @@ version of the raw dataset will probably go away.
<!-- ======================== -->

<mksrf_fvegtyp>
<!-- Potential Vegetation dataset -->
<!-- Potential Vegetation dataset TODO Peter Lawrence? -->
<entry pft_years="PtVg" >
<data_filename>lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.noanthro.c20230226/mksrf_landuse_ctsm52_noanthroLUH2_1.c20230226.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.cdf5.c181014.nc</urban_filename>
</entry>

<entry pft_years="1700">
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1700.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc</urban_filename>
</entry>

<entry pft_years="1850">
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_1850.c231228.nc</data_filename>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1850.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc</urban_filename>
</entry>

<entry pft_years="2000">
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_2000.c231228.nc</data_filename>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2000.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2000.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2000_cdf5_c20220910.nc</urban_filename>
</entry>

<entry pft_years="2005">
<data_filename>lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c20230226/mksrf_landuse_ctsm52_histLUH2_2005.c20230226.nc</data_filename>
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2005.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2005.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2005_cdf5_c20220910.nc</urban_filename>
Expand All @@ -256,9 +263,10 @@ version of the raw dataset will probably go away.
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc</urban_filename>
</entry>

<!-- Historical period from 1850 to 2015 -->
<entry pft_years="1850-2015" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_%y.c231228.nc</data_filename>
<!-- Historical period from 1700 to 2022 (expect 2023 soon) -->
<!-- Lake and urban data from 1700 to 1849 is copied from 1850 -->
<entry pft_years="1700-2022" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_%y.c240709.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_%y_cdf5_c20220910.nc</urban_filename>
Expand All @@ -268,11 +276,12 @@ version of the raw dataset will probably go away.


<!-- Future scenarios (up to 2100)-->
<!-- Lake data from 2018 to 2100 is copied from 2017 -->
<mksrf_fvegtyp_ssp>

<!-- SSP1-RCP 2.6 -->
<entry ssp_rcp="SSP1-2.6" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP126Deg025_231228/mksrf_landuse_ctsm52_SSP126_%y.c231228.nc</data_filename>
<!-- SSP1-RCP 2.6 TODO slevis: repl mksrf_landuse w new files -->
<entry ssp_rcp="SSP1-2.6" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240717/mksrf_landuse_ctsm53_TRSSP126_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_%y_cdf5_c20220910.nc</urban_filename>
Expand All @@ -284,43 +293,43 @@ version of the raw dataset will probably go away.
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_2100_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP1-RCP 1.9 -->
<entry ssp_rcp="SSP1-1.9" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP119Deg025_231228/mksrf_landuse_ctsm52_SSP119_%y.c231228.nc</data_filename>
<entry ssp_rcp="SSP1-1.9" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP119Deg025_240717/mksrf_landuse_ctsm53_TRSSP119_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_%y_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP2-RCP 4.5 -->
<entry ssp_rcp="SSP2-4.5" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP245Deg025_231228/mksrf_landuse_ctsm52_SSP245_%y.c231228.nc</data_filename>
<entry ssp_rcp="SSP2-4.5" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP245Deg025_240717/mksrf_landuse_ctsm53_TRSSP245_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp2/urban_properties_GaoOneil_05deg_ThreeClass_ssp2_%y_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP3-RCP 7.0 -->
<entry ssp_rcp="SSP3-7.0" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP370Deg025_231228/mksrf_landuse_ctsm52_SSP370_2100.c231228.nc</data_filename>
<entry ssp_rcp="SSP3-7.0" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP370Deg025_240717/mksrf_landuse_ctsm53_TRSSP370_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp3/urban_properties_GaoOneil_05deg_ThreeClass_ssp3_%y_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP4-RCP 3.4 -->
<entry ssp_rcp="SSP4-3.4" pft_years_ssp="2016-2100" >
<entry ssp_rcp="SSP4-3.4" pft_years_ssp="2023-2100" >
<data_filename>lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP4-3.4_%y.c20230226.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp4/urban_properties_GaoOneil_05deg_ThreeClass_ssp4_%y_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP4-RCP 6.0 -->
<entry ssp_rcp="SSP4-6.0" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP460Deg025_231228/mksrf_landuse_ctsm52_SSP460_%y.c231228.nc</data_filename>
<entry ssp_rcp="SSP4-6.0" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP460Deg025_240717/mksrf_landuse_ctsm53_TRSSP460_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp4/urban_properties_GaoOneil_05deg_ThreeClass_ssp4_%y_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP5-RCP 8.5 -->
<entry ssp_rcp="SSP5-8.5" pft_years_ssp="2016-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP585Deg025_231228/mksrf_landuse_ctsm52_SSP585_%y.c231228.nc</data_filename>
<entry ssp_rcp="SSP5-8.5" pft_years_ssp="2023-2100" >
<data_filename>/glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP585Deg025_240717/mksrf_landuse_ctsm53_TRSSP585_%y.c240717.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp5/urban_properties_GaoOneil_05deg_ThreeClass_ssp5_%y_cdf5_c20220910.nc</urban_filename>
Expand All @@ -332,7 +341,7 @@ version of the raw dataset will probably go away.
<urban_filename>lnd/clm2/rawdata/gao_oneill_urban/ssp5/urban_properties_GaoOneil_05deg_ThreeClass_ssp5_2100_cdf5_c20220910.nc</urban_filename>
</entry>
<!-- SSP5-RCP 3.4 -->
<entry ssp_rcp="SSP5-3.4" pft_years_ssp="2016-2100" >
<entry ssp_rcp="SSP5-3.4" pft_years_ssp="2023-2100" >
<data_filename>lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP5-3.4_%y.c20230226.nc</data_filename>
<mesh_filename>lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc</mesh_filename>
<lake_filename>lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc</lake_filename>
Expand Down

0 comments on commit 7303c61

Please sign in to comment.