Skip to content

Commit 8bbe9fb

Browse files
stelliomgithub-actions
andauthored
Add switch for CDNC datasets (#431)
Co-authored-by: github-actions <github-actions@github.com>
1 parent 6737113 commit 8bbe9fb

File tree

15 files changed

+138
-14
lines changed

15 files changed

+138
-14
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+
"icdnc_type": 1,
5051
"ilookup_table_lu": 1,
5152
"enable_cdnc": false,
5253
"enable_edgar": false,

docs/user_manual/user_manual_04_python_modules.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,10 @@ The executable *extpar_cdnc_to_buffer* allows the interpolation of
383383
climatology data for cloud droplet number needed for the Cloud-Aerosol
384384
in ICON to the target grid.
385385

386-
The namelist contains only the path to the raw data, the raw data file
387-
names and the name of the buffer file.
386+
The namelist contains the path to the raw data, the raw data file
387+
names and the name of the buffer file. The integer switch (*icdnc_type*) informs
388+
EXTPAR about which of the 3 available datasets has been chosen: 1 (MODIS Q06),
389+
2 (MODIS G18), 3 (MODIS BR17).
388390

389391
The remapping to the target grid uses the *first order conservative*
390392
interpolation. No other processing steps take place.
@@ -396,7 +398,9 @@ interpolation. No other processing steps take place.
396398

397399
- generate namelist: INPUT_cdnc
398400

399-
- data input: cdnc_climatology_Q06.nc
401+
- data input: modis_cdnc_climatology_Q06.nc (icdnc_type=1),
402+
modis_cdnc_climatology_G18.nc (icdnc_type=2),
403+
modis_cdnc_climatology_BR17_37mu_adjusted.nc (icdnc_type=3)
400404

401405
- Output: buffer file with cloud droplet number data (input_cdnc:
402406
cdnc_buffer_file)

docs/user_manual/user_manual_06_namelist_input.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ The COSMO grid is defined by a rotated latlon-grid.
215215
|-----------|------|---------|------|-------------|
216216
| `raw_data_cdnc_path` | character | | | Path to CDNC raw data |
217217
| `raw_data_cdnc_filename` | character | | | Filename of CDNC raw data |
218+
| `icdnc_type` | integer | | | type of used CDNC data source <br> 1: MODIS Q06 <br> 2: MODIS G18 <br> 3: MODIS BR17 |
218219

219220
## Aerosol Optical Thickness Data
220221

python/WrapExtpar.py

Lines changed: 16 additions & 2 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+
icdnc_type = config.get('icdnc_type')
7677
ilookup_table_lu = config.get('ilookup_table_lu')
7778
enable_cdnc = config.get('enable_cdnc', False)
7879
enable_edgar = config.get('enable_edgar', False)
@@ -90,7 +91,7 @@ def main():
9091

9192
generate_external_parameters(
9293
igrid_type, args.input_grid, iaot_type, ilu_type, ialb_type,
93-
isoil_type, itopo_type, it_cl_type, iera_type, iemiss_type,
94+
isoil_type, itopo_type, it_cl_type, iera_type, iemiss_type, icdnc_type,
9495
ilookup_table_lu, enable_cdnc, enable_edgar, enable_art,
9596
use_array_cache, nhori, radtopo_radius, tcorr_lapse_rate, tcorr_offset,
9697
args.raw_data_path, args.run_dir, args.account, args.host,
@@ -107,6 +108,7 @@ def generate_external_parameters(igrid_type,
107108
it_cl_type,
108109
iera_type,
109110
iemiss_type,
111+
icdnc_type,
110112
ilookup_table_lu,
111113
enable_cdnc,
112114
enable_edgar,
@@ -146,6 +148,7 @@ def generate_external_parameters(igrid_type,
146148
'it_cl_type': it_cl_type,
147149
'iera_type': iera_type,
148150
'iemiss_type': iemiss_type,
151+
'icdnc_type': icdnc_type,
149152
'ilookup_table_lu': ilookup_table_lu,
150153
'enable_cdnc': enable_cdnc,
151154
'enable_edgar': enable_edgar,
@@ -717,10 +720,21 @@ def setup_urban_namelist(args):
717720

718721
def setup_cdnc_namelist(args):
719722
namelist = {}
723+
icdnc_type = args['icdnc_type']
720724

725+
namelist['icdnc_type'] = icdnc_type
721726
namelist['raw_data_cdnc_path'] = args['raw_data_path']
722727
namelist['cdnc_buffer_file'] = 'cdnc_buffer.nc'
723-
namelist['raw_data_cdnc_filename'] = 'modis_cdnc_climatology_Q06.nc'
728+
if icdnc_type == 1:
729+
namelist['raw_data_cdnc_filename'] = 'modis_cdnc_climatology_Q06.nc'
730+
elif icdnc_type == 2:
731+
namelist['raw_data_cdnc_filename'] = 'modis_cdnc_climatology_G18.nc'
732+
elif icdnc_type == 3:
733+
namelist[
734+
'raw_data_cdnc_filename'] = 'modis_cdnc_climatology_BR17_37mu_adjusted.nc'
735+
else:
736+
logging.error(f'Unknown icdnc_type {args["icdnc_type"]}')
737+
raise ValueError(f'Unknown icdnc_type {args["icdnc_type"]}')
724738

725739
return namelist
726740

python/extpar_cdnc_to_buffer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
elif (igrid_type == 2):
9090
raise exception("cdnc data only works with ICON")
9191

92+
cdnc_type = utils.check_cdnctype(icdnc['icdnc_type'])
93+
9294
raw_data_cdnc = utils.clean_path(icdnc['raw_data_cdnc_path'],
9395
icdnc['raw_data_cdnc_filename'])
9496

@@ -101,7 +103,12 @@
101103
lat_meta = metadata.Lat()
102104
lon_meta = metadata.Lon()
103105

104-
cdnc_meta = metadata.Cdnc()
106+
if (cdnc_type == 1):
107+
cdnc_meta = metadata.CdncQ06()
108+
elif (cdnc_type == 2):
109+
cdnc_meta = metadata.CdncG18()
110+
elif (cdnc_type == 3):
111+
cdnc_meta = metadata.CdncBR17()
105112

106113
#--------------------------------------------------------------------------
107114
#--------------------------------------------------------------------------

python/lib/fortran_namelist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@ class InputCdnc:
202202
'''
203203

204204
def __init__(self):
205+
self.variables = {'&cdnc_raw_data': {'icdnc_type'}}
205206

206-
self.variables = ({'&cdnc_io_extpar': {'cdnc_buffer_file'}})
207+
self.variables.update({'&cdnc_io_extpar': {'cdnc_buffer_file'}})
207208

208209

209210
class InputEmiss:

python/lib/metadata.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,31 @@ def __init__(self):
264264
self.short = '_'
265265

266266

267-
class Cdnc(CdncMeta):
267+
class CdncQ06(CdncMeta):
268268

269269
def __init__(self):
270270
super().__init__()
271271
self.dim = {0: 'time', 1: 'ke', 2: 'je', 3: 'ie'}
272272
self.name = 'cdnc'
273-
self.long = 'cloud droplet number density (characteristic value for atmospheric column). Source: National Aeronautics and Space Administration (NASA). MODerate resolution Imaging Spectroradiometer (MODIS), https://modis.gsfc.nasa.gov/data/'
273+
self.long = 'cloud droplet number density (characteristic value for atmospheric column). Source: National Aeronautics and Space Administration (NASA). MODerate resolution Imaging Spectroradiometer (MODIS) Q06, https://modis.gsfc.nasa.gov/data/'
274+
275+
276+
class CdncG18(CdncMeta):
277+
278+
def __init__(self):
279+
super().__init__()
280+
self.dim = {0: 'time', 1: 'ke', 2: 'je', 3: 'ie'}
281+
self.name = 'cdnc'
282+
self.long = 'cloud droplet number density (characteristic value for atmospheric column). Source: National Aeronautics and Space Administration (NASA). MODerate resolution Imaging Spectroradiometer (MODIS) G18, https://modis.gsfc.nasa.gov/data/'
283+
284+
285+
class CdncBR17(CdncMeta):
286+
287+
def __init__(self):
288+
super().__init__()
289+
self.dim = {0: 'time', 1: 'ke', 2: 'je', 3: 'ie'}
290+
self.name = 'cdnc'
291+
self.long = 'cloud droplet number density (characteristic value for atmospheric column). Source: National Aeronautics and Space Administration (NASA). MODerate resolution Imaging Spectroradiometer (MODIS) BR17, https://modis.gsfc.nasa.gov/data/'
274292

275293

276294
#--------------------------------------------------------------------------

python/lib/utilities.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,25 @@ def check_emisstype(emiss_type):
234234
return emiss_type
235235

236236

237+
def check_cdnctype(cdnc_type):
238+
'''
239+
check cdnc_type for correctness and return value,
240+
if not exit programme
241+
'''
242+
243+
if (cdnc_type == 1):
244+
logging.info('process cdnc data from sampling method Q06')
245+
elif (cdnc_type == 2):
246+
logging.info('process cdnc data from sampling method G18')
247+
elif (cdnc_type == 3):
248+
logging.info('process cdnc data from sampling method BR17')
249+
else:
250+
logging.error(f'cdnc_type {cdnc_type} does not exist.')
251+
raise ValueError(f'cdnc_type {cdnc_type} does not exist.')
252+
253+
return cdnc_type
254+
255+
237256
def check_gridtype(input_grid_org):
238257
'''
239258
check gridtype read from input_grid_org

src/extpar_consistency_check.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ PROGRAM extpar_consistency_check
220220
& undef_ndvi, minimal_ndvi, &
221221
! cdnc
222222
& ntime_cdnc, &
223+
& icdnc_type, &
223224
! albedo
224225
& ntime_alb, &
225226
& wso_min,wso_max,csalb,csalbw,zalso, &
@@ -580,6 +581,7 @@ PROGRAM extpar_consistency_check
580581
INQUIRE(file=TRIM(namelist_file),exist=l_use_cdnc)
581582
IF (l_use_cdnc) THEN
582583
CALL read_namelists_extpar_cdnc(namelist_file, &
584+
& icdnc_type, &
583585
& cdnc_buffer_file, &
584586
& cdnc_output_file )
585587
ENDIF

src/mo_python_data.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ MODULE mo_python_data
1010
! ndvi
1111
& undef_ndvi, minimal_ndvi, ntime_ndvi, &
1212
! cdnc
13+
& icdnc_type, &
1314
& ntime_cdnc, &
1415
!albedo
1516
& ntime_alb, &
@@ -47,6 +48,7 @@ MODULE mo_python_data
4748
! ndvi
4849
& ntime_ndvi = 12, & !< number of timesteps (12 for monthly mean values)
4950
! cdnc
51+
& icdnc_type = 1, &
5052
& ntime_cdnc = 12, & !< number of timesteps (12 for monthly mean values)
5153
! albedo
5254
& ntime_alb = 12, & !< number of timesteps (12 for monthly mean values)

0 commit comments

Comments
 (0)