Skip to content

Commit 399932a

Browse files
authored
Add support to set nhori (#410)
1 parent 7f59fd7 commit 399932a

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ _1. EXTPAR settings as JSON, see official docs_
5555
"lfilter_oro": false,
5656
"lurban": false,
5757
"lradtopo": true,
58+
"nhori": 24,
5859
"radtopo_radius": 40000
5960
}
6061
}

python/WrapExtpar.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,15 @@ def main():
8181
lfilter_oro = config.get('lfilter_oro', False)
8282
lurban = config.get('lurban', False)
8383
lradtopo = config.get('lradtopo', False)
84+
nhori = config.get('nhori', 24)
8485
radtopo_radius = config.get('radtopo_radius', 40000.0)
8586

8687
generate_external_parameters(
8788
igrid_type, args.input_grid, iaot_type, ilu_type, ialb_type,
8889
isoil_type, itopo_type, it_cl_type, iera_type, iemiss_type,
89-
enable_cdnc, enable_edgar, enable_art, use_array_cache, radtopo_radius,
90-
args.raw_data_path, args.run_dir, args.account, args.host,
91-
args.no_batch_job, lurban, lsgsl, lfilter_oro, lradtopo)
90+
enable_cdnc, enable_edgar, enable_art, use_array_cache, nhori,
91+
radtopo_radius, args.raw_data_path, args.run_dir, args.account,
92+
args.host, args.no_batch_job, lurban, lsgsl, lfilter_oro, lradtopo)
9293

9394

9495
def generate_external_parameters(igrid_type,
@@ -105,6 +106,7 @@ def generate_external_parameters(igrid_type,
105106
enable_edgar,
106107
enable_art,
107108
use_array_cache,
109+
nhori,
108110
radtopo_radius,
109111
raw_data_path,
110112
run_dir,
@@ -140,6 +142,7 @@ def generate_external_parameters(igrid_type,
140142
'enable_art': enable_art,
141143
'use_array_cache': use_array_cache,
142144
'lradtopo': lradtopo,
145+
'nhori': nhori,
143146
'radtopo_radius': radtopo_radius,
144147
'lsgsl': lsgsl,
145148
'lfilter_oro': lfilter_oro,
@@ -362,7 +365,7 @@ def setup_oro_namelist_cosmo(args):
362365
namelist.update(orography_smoothing_params())
363366

364367
# &radtopo
365-
namelist['nhori'] = 24
368+
namelist['nhori'] = args['nhori']
366369
if args['lradtopo']:
367370
namelist['lradtopo'] = ".TRUE."
368371
else:
@@ -466,7 +469,7 @@ def setup_oro_namelist_icon(args, lonmax, lonmin, latmax, latmin):
466469
namelist['lradtopo'] = ".FALSE."
467470

468471
# only relevant if lradtopo=.TRUE., but needed for namelist
469-
namelist['nhori'] = 24
472+
namelist['nhori'] = args['nhori']
470473
namelist['max_missing'] = 0.95
471474
namelist['min_circ_cov'] = 1
472475
namelist['radius'] = args['radtopo_radius']

test/pytest/test_wrap_extpar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ def test_setup_oro_namelist_icon_globe():
679679
'itopo_type': 1,
680680
'raw_data_path': '/path/to/raw/data',
681681
'lradtopo': False,
682+
'nhori': 24,
682683
'radtopo_radius': 40000.0
683684
}
684685
lonmax, lonmin, latmax, latmin = 180.0, -180.0, 90.0, -90.0
@@ -765,6 +766,7 @@ def test_setup_oro_namelist_icon_merit_lradtopo():
765766
'itopo_type': 3,
766767
'raw_data_path': '/path/to/raw/data',
767768
'lradtopo': True,
769+
'nhori': 24,
768770
'radtopo_radius': 60000.0
769771
}
770772
lonmax = 30.0
@@ -898,6 +900,7 @@ def test_all_placeholders_replaced_cosmo(tmp_dir):
898900
"enable_art": False,
899901
'tile_mode': 0,
900902
"use_array_cache": False,
903+
"nhori": 24,
901904
"radtopo_radius": 40000.0,
902905
"raw_data_path": '/dummy/raw_data_path',
903906
"run_dir": str(tmp_dir),
@@ -934,6 +937,7 @@ def test_all_placeholders_replaced_icon(tmp_dir, icon_grid):
934937
"enable_art": False,
935938
'tile_mode': 1,
936939
"use_array_cache": False,
940+
"nhori": 24,
937941
"radtopo_radius": 40000.0,
938942
"raw_data_path": '/dummy/raw_data_path',
939943
"run_dir": str(tmp_dir),

0 commit comments

Comments
 (0)