Skip to content

Commit 2b9b2ae

Browse files
authored
Merge pull request #1196 from GEOS-ESM/feature/borescan_peat_and_hwsd
BCS processing to support HWSDv2 soil preprocessing and new Peat GPA22
2 parents 256f395 + 64442e5 commit 2b9b2ae

21 files changed

Lines changed: 5228 additions & 450 deletions

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/Shared/catch_constants.f90

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ module catch_constants
141141
! Use of peat-specific hydrology (PEATCLSM) is triggered by a porosity threshold.
142142
! Porosity of peat tiles depends on bcs version.
143143
!
144-
! bcs version | source of peat info | porosity
145-
! -----------------------------------------------------------------
146-
! NLv3, NLv4 | HWSD | poros=0.80
147-
! NLv5 | PEATMAP | poros=0.93
144+
! bcs version | source of peat info | porosity | PEATCLSM
145+
! --------------------------------------------------------------------------
146+
! NLv3, NLv4 | HWSDv1.21 | poros=0.80 | no
147+
! NLv5, v11, v12, v13 | HWSDv1.21 + PEATMAP | poros=0.93 | yes
148+
! v14 | Global Peatland Map 2.0 | poros=0.93 | yes
148149
!
149150
! - reichle, 26 Jan 2022
150151

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/create_README.csh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,27 @@ APPENDIX I - mkCatchParam input options and log ................................
550550
across a given catchment land element to determine that catchment’s effective soil
551551
depth.
552552
553+
PEAT_INFO=0:
554+
Peat tiles are determined based solely on the organic carbon content provided
555+
by the HWSDv1.21 texture data.
556+
557+
PEAT_INFO=1:
553558
For PEATMAP, sixteen ARC/GIS shapefiles were obtained from Xu et al. (2017). Canada and
554559
Hokaido-Mongolia-NorthKorea provided peat fractions inside designated polygons. All
555-
other regional shape files give exact perimeter of of the peatland. A global 30-arcsec
560+
other regional shape files give exact perimeter of the peatland. A global 30-arcsec
556561
raster array (43200x21600) of peatland fraction was constructed using those 16 shapefiles.
557-
Soil types derived on tiles are now further updated using the peatmap data. If the computed
562+
Soil types derived on tiles are now further updated using the PEATMAP data. If the computed
558563
fractional coverage of peatland based on PEATMAP data at a given catchment-tile excceeds 0.5(?),
559564
we assume the dominant soil type is as peatland. Soil hydraulic parameters for all
560-
peatland tiles are now obtained from Bechtold et al. (2019).
565+
peatland tiles are now obtained from Bechtold et al. (2019). Bugs in the processing logic
566+
result in inconsistent parameter values for some tiles; the number of tiles with
567+
inconsistent parameters depends on resolution.
568+
569+
PEAT_INFO=2:
570+
The Global Peatland Map 2.0 (GPM 2.0) from the Greifwald Mire Centre is used to
571+
determine peat/mineral on the 30-arcsec raster grid. Tiles are considered peat
572+
if the majority of the contributing raster grid cells is peat based on GPM 2.0,
573+
regardless of the HWSDv1.21 organic carbon content values.
561574
562575
2.2 Data files and images
563576

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/make_bcs_questionary.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,26 +184,33 @@ def ask_questions(default_grid="Cubed-Sphere"):
184184
fixes that were implemented since the archived BCs in the above-mentioned \n \
185185
directories were originally created. The impact of these differences on \n \
186186
science is insignificant, and the parameter files produced by current \n \
187-
code are scientifically equivalent to the corresponding archived BCs. \n",
187+
code are scientifically equivalent to corresponding archived BCs. \n \
188+
Current code always applies \"mean land elevation fix\" of v13. For v12 and earlier, land elevation produced \n \
189+
by current code thus differs from that in bcs_shared project disk. \n",
188190
"choices": [ \
189191
"NL3 : Icarus-NLv3 (archived*: /discover/nobackup/projects/gmao/bcs_shared/legacy_bcs/Icarus-NLv3/)", \
190192
"NL4 : NLv4 [SMAPL4] (archived*: /discover/nobackup/projects/gmao/bcs_shared/legacy_bcs/Icarus-NLv4/) \n\
191193
= NL3 + JPL veg height", \
192194
"NL5 : NLv5 [SMAPL4] (archived*: /discover/nobackup/projects/gmao/bcs_shared/legacy_bcs/Icarus-NLv5/)\n \
193195
= NL3 + JPL veg height + PEATMAP", \
194-
"v06 : NL3 + JPL veg height + PEATMAP + MODIS snow alb", \
195-
"v07 : NL3 + PEATMAP", \
196-
"v08 : NL3 + MODIS snow alb", \
197-
"v09 : NL3 + PEATMAP + MODIS snow alb", \
198-
"v10 : NL3 + PEATMAP + MODIS snow alb v2", \
199196
"v11 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2", \
200197
"v12 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2 + Argentina peatland fix", \
201198
"v13 : As in v12 + mean land elevation fix + MOM6 v2 (OM4) ocean-seaice bathymetry", \
199+
"v14 : As in v13 but with GPM 2.0 peat", \
202200
"ICA : Icarus (archived*: /discover/nobackup/projects/gmao/bcs_shared/legacy_bcs/Icarus/)", \
203201
"GM4 : Ganymed-4_0 (archived*: /discover/nobackup/projects/gmao/bcs_shared/legacy_bcs/Ganymed-4_0/)", \
204202
"F25 : Fortuna-2_5 (archived*: n/a)"],
205203
},
206204

205+
# The following bcs versions were never used for major model versions or products and thus are not in
206+
# the bcs_shared project directory on Discover:
207+
#
208+
# "v06 : NL3 + JPL veg height + PEATMAP + MODIS snow alb", \
209+
# "v07 : NL3 + PEATMAP", \
210+
# "v08 : NL3 + MODIS snow alb", \
211+
# "v09 : NL3 + PEATMAP + MODIS snow alb", \
212+
# "v10 : NL3 + PEATMAP + MODIS snow alb v2", \
213+
207214
{
208215
"type": "select",
209216
"name": "grid_type",

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/make_bcs_shared.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,36 @@
2626
"v11": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"},
2727
"v12": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"},
2828
"v13": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v2"},
29+
"v14": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v2"},
2930
}
3031

31-
_DEFAULTS = {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}
32+
_REQUIRED_VERSION_KEYS = ("TOPO_VERSION", "MOM6_BATHY_VERSION")
3233

3334
def resolve_bcs_matrix(bcs_version: str):
3435
key = (bcs_version or "").strip()
35-
return {**_DEFAULTS, **_VERSION_MATRIX.get(key, {})}
36+
37+
if not key:
38+
valid = ", ".join(sorted(_VERSION_MATRIX))
39+
raise ValueError(
40+
f"BCS version is not defined. Must be one of: {valid}"
41+
)
42+
43+
if key not in _VERSION_MATRIX:
44+
valid = ", ".join(sorted(_VERSION_MATRIX))
45+
raise ValueError(
46+
f"Unknown BCS version '{key}'. Must be one of: {valid}"
47+
)
48+
49+
entry = _VERSION_MATRIX[key]
50+
51+
missing = [name for name in _REQUIRED_VERSION_KEYS if name not in entry]
52+
if missing:
53+
raise ValueError(
54+
f"BCS version '{key}' is missing required version setting(s): "
55+
f"{', '.join(missing)}"
56+
)
57+
58+
return entry
3659

3760
def topo_version_for_bcs(bcs_version: str) -> str:
3861
return resolve_bcs_matrix(bcs_version)["TOPO_VERSION"]
@@ -198,7 +221,7 @@ def get_script_mv(grid_type):
198221
199222
/bin/rm -r {TMP_DIR}
200223
201-
# if necessary, copy resolution-independent CO2 file from MAKE_BCS_INPUT_DIR to bcs dir
224+
# if necessary, copy resolution-independent CO2 and route files from MAKE_BCS_INPUT_DIR to bcs dir
202225
203226
if(-f land/shared/CO2_MonthlyMean_DiurnalCycle.nc4) then
204227
echo "CO2_MonthlyMean_DiurnalCycle.nc4 already present in bcs dir."
@@ -207,10 +230,10 @@ def get_script_mv(grid_type):
207230
echo "Successfully copied CO2_MonthlyMean_DiurnalCycle.nc4 to bcs dir."
208231
endif
209232
210-
if(-f land/shared/route_parameters.nc ) then
233+
if(-f route/route_parameters.nc ) then
211234
echo "route_parameters.nc already present in bcs dir."
212235
else
213-
/bin/cp -p {MAKE_BCS_INPUT_DIR}/route/routing_model/v1/route_parameters.nc land/shared/route_parameters.nc
236+
/bin/cp -p {MAKE_BCS_INPUT_DIR}/route/routing_model/v1/route_parameters.nc route/route_parameters.nc
214237
echo "Successfully copied route_parameters.nc to bcs dir."
215238
endif
216239

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/mkCatchParam.F90

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PROGRAM mkCatchParam
4444
character*128 :: ARG, MaskFile
4545
character*256 :: CMD
4646
character*1 :: opt
47-
character*7 :: PEATSOURCE = 'GDLHWSD'
47+
character*128 :: PEATSOURCE = ''
4848
character*3 :: VEGZSOURCE = 'D&S'
4949
character*2 :: DL ='DC'
5050
integer :: II, JJ, Type
@@ -207,8 +207,19 @@ PROGRAM mkCatchParam
207207
fnameRst='rst/'//trim(Gridname)
208208
fnameTil='til/'//trim(Gridname)
209209
endif
210-
211-
if(use_PEATMAP) PEATSOURCE = 'PEATMAP'
210+
211+
select case (PEAT_INFO)
212+
case (0)
213+
PEATSOURCE = 'HWSDv1.21 (formerly "GDLHWSD")'
214+
case (1)
215+
PEATSOURCE = 'HWSDv1.21 + PEATMAP (Xu et al 2017, doi:10.5518/252)'
216+
case (2)
217+
PEATSOURCE = 'Global Peatland Map 2.0 (Greifswald)'
218+
case default
219+
write (log_file,'(a)') 'Unknown PEAT_INFO. Stopping!'
220+
stop
221+
end select
222+
212223
if(jpl_height) VEGZSOURCE = 'JPL'
213224

214225
if (trim(SNOWALB)=='MODC061' .or. trim(SNOWALB) =='MODC061v2') process_snow_albedo=.true.

0 commit comments

Comments
 (0)