Skip to content

Commit 784519e

Browse files
committed
Made ilookup_table_lu selectable
1 parent e25efba commit 784519e

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ _1. EXTPAR settings as JSON, see official docs_
4747
"it_cl_type": 1,
4848
"iera_type": 1,
4949
"iemiss_type": 1,
50+
"ilookup_table_lu": 1,
5051
"enable_cdnc": false,
5152
"enable_edgar": false,
5253
"enable_art": false,

python/WrapExtpar.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def main():
7373
it_cl_type = config.get('it_cl_type')
7474
iera_type = config.get('iera_type')
7575
iemiss_type = config.get('iemiss_type')
76+
ilookup_table_lu = config.get('ilookup_table_lu')
7677
enable_cdnc = config.get('enable_cdnc', False)
7778
enable_edgar = config.get('enable_edgar', False)
7879
enable_art = config.get('enable_art', False)
@@ -88,10 +89,10 @@ def main():
8889
generate_external_parameters(
8990
igrid_type, args.input_grid, iaot_type, ilu_type, ialb_type,
9091
isoil_type, itopo_type, it_cl_type, iera_type, iemiss_type,
91-
enable_cdnc, enable_edgar, enable_art, use_array_cache, nhori,
92-
radtopo_radius, args.raw_data_path, args.run_dir, args.account,
93-
args.host, args.no_batch_job, lurban, lsgsl, lfilter_oro, l_use_corine,
94-
lradtopo)
92+
ilookup_table_lu, enable_cdnc, enable_edgar, enable_art,
93+
use_array_cache, nhori, radtopo_radius, args.raw_data_path,
94+
args.run_dir, args.account, args.host, args.no_batch_job, lurban,
95+
lsgsl, lfilter_oro, l_use_corine, lradtopo)
9596

9697

9798
def generate_external_parameters(igrid_type,
@@ -104,6 +105,7 @@ def generate_external_parameters(igrid_type,
104105
it_cl_type,
105106
iera_type,
106107
iemiss_type,
108+
ilookup_table_lu,
107109
enable_cdnc,
108110
enable_edgar,
109111
enable_art,
@@ -140,6 +142,7 @@ def generate_external_parameters(igrid_type,
140142
'it_cl_type': it_cl_type,
141143
'iera_type': iera_type,
142144
'iemiss_type': iemiss_type,
145+
'ilookup_table_lu': ilookup_table_lu,
143146
'enable_cdnc': enable_cdnc,
144147
'enable_edgar': enable_edgar,
145148
'enable_art': enable_art,
@@ -493,7 +496,7 @@ def generate_globe_filenames():
493496
def setup_lu_namelist(args):
494497
namelist = {}
495498
namelist['i_landuse_data'] = args['ilu_type']
496-
namelist['ilookup_table_lu'] = args['ilu_type']
499+
namelist['ilookup_table_lu'] = args['ilookup_table_lu']
497500
namelist['raw_data_lu_path'] = args['raw_data_path']
498501
namelist['raw_data_glcc_path'] = args['raw_data_path']
499502
namelist['lu_buffer_file'] = 'lu_buffer.nc'

test/pytest/test_wrap_extpar.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ def test_setup_lu_namelist_type_1():
217217
args = {
218218
'ilu_type': 1,
219219
'raw_data_path': '/path/to/data',
220-
'l_use_corine': False
220+
'l_use_corine': False,
221+
'ilookup_table_lu': 1
221222
}
222223
expected_namelist = {
223224
'i_landuse_data':
@@ -253,7 +254,8 @@ def test_setup_lu_namelist_corine():
253254
args = {
254255
'ilu_type': 1,
255256
'raw_data_path': '/path/to/data',
256-
'l_use_corine': True
257+
'l_use_corine': True,
258+
'ilookup_table_lu': 1
257259
}
258260
expected_namelist = {
259261
'i_landuse_data': 1,
@@ -275,7 +277,8 @@ def test_setup_lu_namelist_type_2():
275277
args = {
276278
'ilu_type': 2,
277279
'raw_data_path': '/path/to/data',
278-
'l_use_corine': False
280+
'l_use_corine': False,
281+
'ilookup_table_lu': 2
279282
}
280283
expected_namelist = {
281284
'i_landuse_data': 2,
@@ -297,11 +300,12 @@ def test_setup_lu_namelist_type_6():
297300
args = {
298301
'ilu_type': 6,
299302
'raw_data_path': '/path/to/data',
300-
'l_use_corine': False
303+
'l_use_corine': False,
304+
'ilookup_table_lu': 1
301305
}
302306
expected_namelist = {
303307
'i_landuse_data': 6,
304-
'ilookup_table_lu': 6,
308+
'ilookup_table_lu': 1,
305309
'raw_data_lu_path': '/path/to/data',
306310
'raw_data_glcc_path': '/path/to/data',
307311
'lu_buffer_file': 'lu_buffer.nc',

0 commit comments

Comments
 (0)