diff --git a/.gitignore b/.gitignore
index 74788e25b..193fa5368 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,6 +15,7 @@ modules.env
# Build stage files:
*.o
/bin/extpar_alb_to_buffer.py
+/bin/extpar_aot_to_buffer.py
/bin/extpar_aot_to_buffer.exe
/bin/extpar_art_to_buffer.py
/bin/extpar_consistency_check.exe
@@ -28,6 +29,8 @@ modules.env
/bin/extpar_ndvi_to_buffer.py
/bin/extpar_soil_to_buffer.exe
/bin/extpar_topo_to_buffer.exe
+/bin/extpar_cdnc_to_buffer.py
+/bin/extpar_edgar_to_buffer.py
/mod/*
/src/info_extpar.f90
diff --git a/Makefile.in b/Makefile.in
index dfc921518..924582586 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -84,6 +84,7 @@ script_files:= \
$(srcdir)/python/extpar_edgar_to_buffer.py \
$(srcdir)/python/extpar_cdnc_to_buffer.py \
$(srcdir)/python/extpar_ahf_to_buffer.py \
+ $(srcdir)/python/extpar_aot_to_buffer.py \
$(srcdir)/python/extpar_art_to_buffer.py \
$(srcdir)/python/extpar_isa_to_buffer.py
@@ -112,7 +113,6 @@ NO_INC_TARGETS:= depend dummy-depend mostlyclean clean distclean dist
.PRECIOUS: $(dir_files)
prog_names:= \
- extpar_aot_to_buffer \
extpar_consistency_check \
extpar_flake_to_buffer \
extpar_landuse_to_buffer \
diff --git a/aclocal.m4 b/aclocal.m4
index 206206c8f..81fe23e30 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/configure b/configure
index e3408e51b..5d107733c 100755
--- a/configure
+++ b/configure
@@ -581,7 +581,7 @@ PACKAGE_STRING='extpar 5.3.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
-ac_unique_file="src/extpar_aot_to_buffer.f90"
+ac_unique_file="src/extpar_topo_to_buffer.f90"
enable_option_checking=no
ac_subst_vars='LTLIBOBJS
LIBOBJS
@@ -642,7 +642,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -724,7 +723,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -977,15 +975,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1123,7 +1112,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1276,7 +1265,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
diff --git a/configure.ac b/configure.ac
index c72fef052..1c315f81f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.69])
AC_INIT([extpar], [5.3.0])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([config])
-AC_CONFIG_SRCDIR([src/extpar_aot_to_buffer.f90])
+AC_CONFIG_SRCDIR([src/extpar_topo_to_buffer.f90])
AC_PROG_CC
AC_LANG([C])
diff --git a/docs/user_manual/user_manual_03_fortran_modules.md b/docs/user_manual/user_manual_03_fortran_modules.md
index 23a887d58..ec5a7ab87 100644
--- a/docs/user_manual/user_manual_03_fortran_modules.md
+++ b/docs/user_manual/user_manual_03_fortran_modules.md
@@ -753,86 +753,6 @@ LCZ look-up tables are based on the values published in
- buffer file with landuse data (/lu_io_extpar/ lu_buffer_file)
- buffer file with GLCC data (/glcc_io_extpar/ glcc_buffer_file)
-## extpar_aot_to_buffer
-
-### Short description
-
-The executable *extpar_aot_to_buffer* aggregates aerosol optical
-thickness data to the target grid.
-
-#### Target grid definition
-
-The definition of the target grid is again done using the namelist
-`INPUT_grid_org`. As the subroutines are exactly the same as the ones
-used in *extpar_topo_to_buffer*, it is referred to the subsection
-*'Target grid definition'* in section
-[3.1](#extpar_topo_to_buffer), where the procedure is explained in
-more detail.
-
-#### Raw aerosol optical depth data
-
-The namelist `INPUT_AOT` is kept very simple. It contains only the path
-and the name of the raw aerosol optical depth data. The integer switch
-(*iaot_type*) informs EXTPAR which of the 2 available datasets has been
-chosen: 1 (Tegen), 2 (AeroCom).
-Additionally, also the filenames of the buffer and output files for the
-aggregated data is specified.
-
-In order to allocate the variables used to read the raw data, the
-dimensions of the raw data is defined. These dimensions include the
-number of rows and columns of the NetCDF raw data file, the number of
-months, which is equal to 12, as a full yearly cycle is described, and
-the number of types of aerosols contained in the raw data file. This
-number is 5 for iaot_type=1 or 2 , as the raw data file contains the
-aerosol optical thickness information of black carbon, dust, organic
-matter, sulfate and sea salt. The 3 first data-sets which provide
-raw data for different aerosol types refer to Tegen[^1] and AeroCom[^2].
-
-In a next step, the complete raw data is read into memory; this is
-possible since the aerosol optical depth raw data is of rather coarse
-resolution (see [Table 8](#tab:aerosol)). Also, the grid of the raw data is determined
-from NetCDF meta data. Before the aggregation to the target grid can
-start, the target grid fields must be allocated, using the target grid,
-the number of months and aerosol types or spectral bands.
-
-
-
-
-**Raw data set** | **resolution**
------------------- | --------------------------
-Tegen | 4 x 5 degree
-AeroCom | 1 x 1 degree
-
-*Table 8: Resolution of raw data-sets for aerosol optical depths.*
-
-
-#### Aggregation of the aerosol optical depth to the target field
-
-As the resolution of all raw data sets is so coarse, there is no need to
-go through the whole raw data set and find the corresponding target grid
-element. Here there is only one loop over the target grid. For every
-target grid element four surrounding raw data points are searched for.
-With these four points, a weight for the bilinear interpolation is
-computed. As the raw data grids of the 5 different aerosols are equal,
-the four surrounding points are the same for all months and aerosol
-types. Four new arrays (SW, SE, NE, NW) are then defined, which contain
-the four neighbor values, for each month and each type. These can now be
-used, together with the previously calculated weights, to calculate the
-bilinear interpolation.
-
-Finally the data is saved in a NetCDF buffer and an output file, and the
-allocated variables are deallocated.
-
-### Used namelist files and data in-/output
-
-- namelists files: INPUT_grid_org, INPUT_COSMO_GRID,
- INPUT_ICON_GRID, INPUT_AOT
-
-- data input: aot_GACP.nc, aod_AeroCom1.nc
-
-- Output: buffer file with aerosol data (/aerosol_io_extpar/
- aot_buffer_file)
-
## extpar_soil_to_buffer
### Short description
diff --git a/docs/user_manual/user_manual_04_python_modules.md b/docs/user_manual/user_manual_04_python_modules.md
index 6aed5c118..250738400 100644
--- a/docs/user_manual/user_manual_04_python_modules.md
+++ b/docs/user_manual/user_manual_04_python_modules.md
@@ -35,7 +35,7 @@ in the paragraph *Data processing* of each Python module.
The namelist `namelist.py` contains the Python dictionaries
`input_alb`, `input_tclim`, `input_emiss`, `input_ndvi`,
-`input_ahf`, `input_isa`, `input_art` and `input_edgar`. These dictionaries
+`input_ahf`, `input_isa`, `input_art`, `input_aot` and `input_edgar`. These dictionaries
replace their corresponding Fortran namelist files `INPUT_`.
`input_alb` provides information about the albedo data type and the
@@ -65,8 +65,12 @@ input/output data.
`input_edgar` only provides information about the the path and the
filenames of the input/output data.
-`input_art` also provides information about the the path and the
-filenames of the input/output data only.
+`input_aot` contains a switch to select the type of AOT data and
+provides information about the path and the filenames of the input/output
+data.
+
+`input_art` only provides information about the the path and the
+filenames of the input/output data.
## extpar_alb_to_buffer
-----------------------
@@ -396,6 +400,50 @@ interpolation. No other processing steps take place.
- Output: buffer file with cloud droplet number data (input_cdnc:
cdnc_buffer_file)
+## extpar_aot_to_buffer
+
+### Short description of the subprogram *extpar_aot_to_buffer*
+
+The executable *extpar_aot_to_buffer* aggregates aerosol optical
+thickness data for 5 aerosol types (black carbon, dust, organic,
+sulfate, and sea salt) to the target grid. Note that the raw data
+stores each aerosol type in its own variable, while the buffer file
+stores the remapped data in a single 5D variable.
+
+For the aggregation of the AOT the namelist `namelist.py` is simple
+again. It contains only the path and the name of the raw aerosol optical
+depth data. The integer switch (*iaot_type*) informs EXTPAR which of the
+2 available datasets has been chosen: 1 (Tegen), 2 (AeroCom). Additionally,
+also the filenames of the buffer and output files for the aggregated data
+is specified. Note that the underlying processing does not differ between
+different types of AOT.
+
+The remapping to the target grid uses the *bilinear* interpolation. No
+other processing steps take place.
+
+
+
+
+**Raw data set** | **resolution**
+------------------ | --------------------------
+Tegen | 4 x 5 degree
+AeroCom | 1 x 1 degree
+
+*Table 8: Resolution of raw data-sets for aerosol optical depths.*
+
+
+### Used namelist files and data in-/output:
+
+- namelists files: namelist.py (dict: input_aot), INPUT_grid_org,
+ INPUT_COSMO_GRID, INPUT_ICON_GRID
+
+- generate namelist: INPUT_AOT
+
+- data input: aot_GACP.nc( iaot_type=1),
+ aod_AeroCom1.nc (iaot_type=2)
+
+- Output: buffer file with ISA data (input_aot: aot_buffer_file)
+
## extpar_art_to_buffer {#extpar_art_to_buffer}
diff --git a/docs/user_manual/user_manual_06_namelist_input.md b/docs/user_manual/user_manual_06_namelist_input.md
index 805887c4e..3b07cee25 100644
--- a/docs/user_manual/user_manual_06_namelist_input.md
+++ b/docs/user_manual/user_manual_06_namelist_input.md
@@ -10,27 +10,19 @@ Whereas for the Fortran namelists and the Python dictionaries the user can speci
## Namelist files {#namelist_input_for_extpar_namelist_files}
-| **Namelist file** | **Purpose** | **Made by script** | **Used by program** |
-| -------------------- | ---------------------------------------------------------------- | ------------------------------ | ----------------------------- |
-| INPUT_grid_org | define target grid type | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer`, `extpar_art_to_buffer` |
-| INPUT_COSMO_GRID | define target domain for COSMO grid | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer`, `extpar_art_to_buffer` |
-| INPUT_ICON_GRID | define target domain for ICON grid | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer`, `extpar_art_to_buffer` |
-| INPUT_ORO | settings for orography data | runscript | `extpar_topo_to_buffer` |
-| INPUT_OROSMOOTH | settings for orography smoothing | runscript | `extpar_topo_to_buffer` |
-| INPUT_RADTOPO | settings for generating topographical shading fields | runscript | `extpar_topo_to_buffer` |
-| INPUT_SCALE_SEP | settings to control scale separation for SSO an Z0 calculation | runscript | `extpar_topo_to_buffer` |
-| INPUT_LU | settings for landuse data | runscript | `extpar_landuse_to_buffer` |
-| INPUT_AOT | settings for aerosol data | runscript | `extpar_aot_to_buffer` |
-| INPUT_TCLIM | settings for temperature data | `extpar_cru_to_buffer` | `extpar_consistency_check` |
-| INPUT_NDVI | settings for NDVI data | `extpar_ndvi_to_buffer` | `extpar_consistency_check` |
-| INPUT_SOIL | settings for soil data | runscript | `extpar_soil_to_buffer` |
-| INPUT_FLAKE | settings for lake data | runscript | `extpar_flake_to_buffer` |
-| INPUT_ALB | settings for albedo data | `extpar_albedo_to_buffer` | `extpar_consistency_check` |
-| INPUT_ISA | settings for fraction of impervious surface area data | `extpar_isa_to_buffer` | `extpar_consistency_check` |
-| INPUT_AHF | settings for anthropogenic heat flux data | `extpar_ahf_to_buffer` | `extpar_consistency_check` |
-| INPUT_EMISS | settings for emissivity data | `extpar_emiss_to_buffer` | `extpar_consistency_check` |
+| **Namelist file** | **Purpose** | **Made by script** | **Used by program** |
+| -------------------- | ---------------------------------------------------------------- | ------------------------------ | ----------------------------- |
+| INPUT_grid_org | define target grid type | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer`, `extpar_art_to_buffer` |
+| INPUT_COSMO_GRID | define target domain for COSMO grid | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer`, `extpar_art_to_buffer` |
+| INPUT_ICON_GRID | define target domain for ICON grid | runscript | `extpar_consistency_check`, `extpar_aot_to_buffer`, `extpar_landuse_to_buffer`, `extpar_topo_to_buffer`, `extpar_cru_to_buffer`, `extpar_ndvi_to_buffer`, `extpar_soil_to_buffer`, `extpar_flake_to_buffer`, `extpar_isa_to_buffer`, `extpar_ahf_to_buffer`, `extpar_emiss_to_buffer` |
+| INPUT_ORO | settings for orography data | runscript | `extpar_topo_to_buffer` |
+| INPUT_OROSMOOTH | settings for orography smoothing | runscript | `extpar_topo_to_buffer` |
+| INPUT_RADTOPO | settings for generating topographical shading fields | runscript | `extpar_topo_to_buffer` |
+| INPUT_SCALE_SEP | settings to control scale separation for SSO an Z0 calculation | runscript | `extpar_topo_to_buffer` |
+| INPUT_LU | settings for landuse data | runscript | `extpar_landuse_to_buffer` |
+| INPUT_AOT | settings for aerosol data | `extpar_aot_to_buffer` | `extpar_aot_to_buffer` |
| INPUT_ART | settings for HWSD USDA data | `extpar_art_to_buffer` | |
-| INPUT_edgar | settings for EDGAR data | `extpar_edgar_to_buffer` | `extpar_consistency_check` |
+| INPUT_EDGAR | settings for EDGAR data | `extpar_edgar_to_buffer` | `extpar_consistency_check` |
| INPUT_CDNC | settings for cdnc data | `extpar_cdnc_to_buffer` | `extpar_consistency_check` |
| INPUT_ERA | settings for ERA data | `extpar_era_to_buffer` | `extpar_consistency_check` |
| INPUT_CHECK | settings for the consistency check | runscript | `extpar_consistency_check` |
@@ -192,22 +184,6 @@ The COSMO grid is defined by a rotated latlon-grid.
|--------------------------|-----------|------------|---------|----------------|
| `glcc_buffer_file` | character | | | name for GLCC buffer file |
-## Aerosol Optical Depth {#namelist_input_for_extpar_aot}
-
-### NAMELIST `/aerosol_raw_data/` (INPUT_AOT)
-
-| **Parameter** | **Type** | **Default** | **Unit** | **Description** |
-|---------------------------|-----------|------------|---------|----------------|
-| `raw_data_aot_path` | character | | | path to aerosol raw data |
-| `raw_data_aot_filename` | character | | | filename of aerosol raw data |
-| `iaot_type` | integer | 1 | | index to specify AOD raw data set: 1:Tegen, 2:AeroCom |
-
-### NAMELIST `/aerosol_io_extpar/` (INPUT_AOT)
-
-| **Parameter** | **Type** | **Default** | **Unit** | **Description** |
-|----------------------|-----------|------------|---------|----------------|
-| `aot_buffer_file` | character | | | name for aerosol buffer file |
-
## Climatological 2m Temperature {#namelist_input_for_extpar_cru}
### DICT `input_tclim` (namelist.py)
@@ -252,8 +228,27 @@ The COSMO grid is defined by a rotated latlon-grid.
| `raw_data_cdnc_path` | character | | | Path to CDNC raw data |
| `raw_data_cdnc_filename` | character | | | Filename of CDNC raw data |
+## Aerosol Optical Thickness Data
+
+### DICT `input_aot` (namelist.py)
+
+| **Parameter** | **Type** | **Default** | **Unit** | **Description** |
+|-------------------------|-----------|-------------|----------|------------------------------------------------------|
+| `raw_data_isa_path` | character | | | path to AOT raw data |
+| `raw_data_isa_filename` | character | | | filename of AOT raw data |
+| `iaot_type` | integer | | | type of used AOT data source: (1) Tegen; (2) AeroCom |
+| `aot_buffer_file` | character | | | name for AOT buffer file |
+
## art Data
+### DICT `input_art` (namelist.py)
+
+| **Parameter** | **Type** | **Default** | **Unit** | **Description** |
+|-------------------------|-----------|-------------|----------|------------------------------------------------------|
+| `raw_data_art_path` | character | | | path to ART raw data |
+| `raw_data_art_filename` | character | | | filename of ART raw data |
+| `art_buffer_file` | character | | | name for ART buffer file |
+
### NAMELIST `/art_nml/` (`INPUT_ART`)
| Parameter | Type | Default | Unit | Description |
diff --git a/python/WrapExtpar.py b/python/WrapExtpar.py
index 30d225871..dcbf830c6 100755
--- a/python/WrapExtpar.py
+++ b/python/WrapExtpar.py
@@ -198,8 +198,8 @@ def write_namelist(args, namelist):
templates_dir = os.path.join(DATA_DIR, "templates")
files = [
'INPUT_ORO', 'INPUT_RADTOPO', 'INPUT_OROSMOOTH', 'INPUT_SGSL',
- 'INPUT_AOT', 'INPUT_LU', 'INPUT_FLAKE', 'INPUT_SCALE_SEP',
- 'INPUT_SOIL', 'INPUT_CHECK', 'namelist'
+ 'INPUT_LU', 'INPUT_FLAKE', 'INPUT_SCALE_SEP', 'INPUT_SOIL',
+ 'INPUT_CHECK', 'namelist'
]
replace_placeholders(args, files, templates_dir, namelist)
@@ -748,7 +748,7 @@ def setup_runscript(args):
executables = [
'"extpar_landuse_to_buffer.exe" ', '"extpar_topo_to_buffer.exe" ',
- '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.exe" ',
+ '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.py" ',
'"extpar_flake_to_buffer.exe" ', '"extpar_soil_to_buffer.exe" ',
'"extpar_alb_to_buffer.py" ', '"extpar_ndvi_to_buffer.py" '
]
diff --git a/python/extpar_aot_to_buffer.py b/python/extpar_aot_to_buffer.py
new file mode 100755
index 000000000..e141b4139
--- /dev/null
+++ b/python/extpar_aot_to_buffer.py
@@ -0,0 +1,207 @@
+#!/usr/bin/env python3
+import logging
+import os
+import sys
+import subprocess
+import netCDF4 as nc
+import numpy as np
+
+# extpar modules from lib
+try:
+ from extpar.lib import (
+ utilities as utils,
+ grid_def,
+ buffer,
+ metadata,
+ fortran_namelist,
+ environment as env,
+ )
+except ImportError:
+ import utilities as utils
+ import grid_def
+ import buffer
+ import metadata
+ import fortran_namelist
+ import environment as env
+from namelist import input_aot as iaot
+
+# initialize logger
+logging.basicConfig(filename='extpar_aot_to_buffer.log',
+ level=logging.INFO,
+ format='%(message)s',
+ filemode='w')
+
+logging.info('============= start extpar_aot_to_buffer =======')
+logging.info('')
+
+# print a summary of the environment
+env.check_environment_for_extpar(__file__)
+
+# check HDF5
+lock = env.check_hdf5_threadsafe()
+
+# get number of OpenMP threads for CDO
+omp = env.get_omp_num_threads()
+
+# unique names for files written to system to allow parallel execution
+grid = 'grid_description_aot' # name for grid description file
+reduced_grid = 'reduced_icon_grid_aot.nc' # name for reduced icon grid
+weights = 'weights_aot.nc' # name for weights of spatial interpolation
+
+# names for output of CDO
+aot_cdo = 'aot_ycon.nc'
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= delete files from old runs =======')
+logging.info('')
+
+utils.remove(grid)
+utils.remove(reduced_grid)
+utils.remove(weights)
+utils.remove(aot_cdo)
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= init variables from namelist =====')
+logging.info('')
+
+igrid_type, grid_namelist = utils.check_gridtype('INPUT_grid_org')
+
+if (igrid_type == 1):
+ path_to_grid = \
+ fortran_namelist.read_variable(grid_namelist,
+ 'icon_grid_dir',
+ str)
+
+ icon_grid = \
+ fortran_namelist.read_variable(grid_namelist,
+ 'icon_grid_nc_file',
+ str)
+
+ icon_grid = utils.clean_path(path_to_grid, icon_grid)
+
+ tg = grid_def.IconGrid(icon_grid)
+
+ grid = tg.reduce_grid(reduced_grid)
+
+elif (igrid_type == 2):
+ tg = grid_def.CosmoGrid(grid_namelist)
+ tg.create_grid_description(grid)
+
+aot_type = utils.check_aottype(iaot['iaot_type'])
+
+raw_data_aot = utils.clean_path(iaot['raw_data_aot_path'],
+ iaot['raw_data_aot_filename'])
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= initialize metadata ==============')
+logging.info('')
+
+lat_meta = metadata.Lat()
+lon_meta = metadata.Lon()
+
+if (aot_type == 1):
+ aot_meta = metadata.AotTegen()
+elif (aot_type == 2):
+ aot_meta = metadata.AotAeroCom()
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= write FORTRAN namelist ===========')
+logging.info('')
+
+input_aot = fortran_namelist.InputAot()
+fortran_namelist.write_fortran_namelist('INPUT_AOT', iaot, input_aot)
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= CDO: remap to target grid ========')
+logging.info('')
+
+# calculate weights
+utils.launch_shell('cdo', '-f', 'nc4', lock, '-P', omp, f'genbil,{grid}',
+ raw_data_aot, weights)
+
+# regrid aot
+utils.launch_shell('cdo', '-f', 'nc4', lock, '-P', omp,
+ f'settaxis,1111-01-01,0,1mo', f'-remap,{grid},{weights}',
+ raw_data_aot, aot_cdo)
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= reshape CDO output ===============')
+logging.info('')
+
+aot_nc = nc.Dataset(aot_cdo, "r")
+
+if (igrid_type == 1):
+
+ # infer coordinates/dimensions from CDO file
+ ie_tot = len(aot_nc.dimensions['cell'])
+ je_tot = 1
+ ke_tot = 1
+ lon = np.rad2deg(
+ np.reshape(aot_nc.variables['clon'][:], (ke_tot, je_tot, ie_tot)))
+ lat = np.rad2deg(
+ np.reshape(aot_nc.variables['clat'][:], (ke_tot, je_tot, ie_tot)))
+
+else:
+
+ # infer coordinates/dimensions from tg
+ lat, lon = tg.latlon_cosmo_to_latlon_regular()
+ ie_tot = tg.ie_tot
+ je_tot = tg.je_tot
+ ke_tot = tg.ke_tot
+
+aot = np.empty((12, 5, ke_tot, je_tot, ie_tot), dtype=aot_meta.type)
+aerosol_names = ['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt']
+
+for i in range(5):
+ aerosol_name = aerosol_names[i]
+ aot[:, i, :, :, :] = np.reshape(aot_nc.variables[aerosol_name][:, :],
+ (12, ke_tot, je_tot, ie_tot))
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= write to buffer file =============')
+logging.info('')
+
+# init buffer file
+buffer_file = buffer.init_netcdf(iaot['aot_buffer_file'], je_tot, ie_tot)
+
+# add 12 months as additional dimension
+buffer_file = buffer.add_dimension_month(buffer_file)
+
+# add 5 aerosol types as additional dimension
+buffer_file = buffer.add_dimension_aerosols(buffer_file)
+
+# write lat/lon
+buffer.write_field_to_buffer(buffer_file, lon, lon_meta)
+buffer.write_field_to_buffer(buffer_file, lat, lat_meta)
+
+# write aot fields
+buffer.write_field_to_buffer(buffer_file, aot, aot_meta)
+
+buffer.close_netcdf(buffer_file)
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= clean up =========================')
+logging.info('')
+
+utils.remove(weights)
+utils.remove(aot_cdo)
+
+#--------------------------------------------------------------------------
+#--------------------------------------------------------------------------
+logging.info('')
+logging.info('============= extpar_aot_to_buffer done ========')
+logging.info('')
diff --git a/python/lib/buffer.py b/python/lib/buffer.py
index e9dc14b00..c2148bc78 100644
--- a/python/lib/buffer.py
+++ b/python/lib/buffer.py
@@ -54,6 +54,16 @@ def add_dimension_month(buffer):
return buffer
+def add_dimension_aerosols(buffer):
+ '''
+ add 5 aerosol types as dimension to netCDF
+ '''
+
+ buffer.createDimension('ntype', None)
+
+ return buffer
+
+
def open_netcdf(buffer_name):
'''
open netcdf with buffer_name
@@ -98,6 +108,10 @@ def write_field_to_buffer(buffer, field, field_meta):
elif (dim_nr == 4):
write_4d_field(buffer, field, field_meta)
+ # 5d-field
+ elif (dim_nr == 5):
+ write_5d_field(buffer, field, field_meta)
+
# unsupported
else:
logging.error(f'field {field_meta.name} has {dim_nr} dimensions,'
@@ -154,3 +168,29 @@ def write_4d_field(buffer, field_4d, meta):
raise
logging.info(f'4D-field {meta.name} written')
+
+
+def write_5d_field(buffer, field_5d, meta):
+ '''
+ write 5d field.data to buffer
+
+ buffer is the netCDF file to write field_5d
+ field_5d needs to have the same shape as netcdf_var
+ the metadata for each variable is stored in meta
+ meta is defined in module metadata
+ '''
+ netcdf_var = buffer.createVariable(
+ meta.name, meta.type,
+ (meta.dim[0], meta.dim[1], meta.dim[2], meta.dim[3], meta.dim[4]))
+
+ netcdf_var.standard_name = meta.long
+ netcdf_var.long_name = meta.long
+ netcdf_var.units = meta.units
+
+ try:
+ netcdf_var[:, :, :, :, :] = field_5d.data
+ except ValueError:
+ logging.error('Error during netCDF IO', exc_info=True)
+ raise
+
+ logging.info(f'5D-field {meta.name} written')
diff --git a/python/lib/fortran_namelist.py b/python/lib/fortran_namelist.py
index 2e15c3658..58617a7f6 100644
--- a/python/lib/fortran_namelist.py
+++ b/python/lib/fortran_namelist.py
@@ -23,6 +23,7 @@
-InputIsa
-InputArt
-InputCdnc
+ -InputAot
'''
@@ -259,6 +260,17 @@ def __init__(self):
self.variables.update({'&isa_io_extpar': {'isa_buffer_file'}})
+class InputAot:
+ '''
+ define structure of namelist "INPUT_AOT"
+ '''
+
+ def __init__(self):
+ self.variables = {'&aerosol_raw_data': {'iaot_type'}}
+
+ self.variables.update({'&aerosol_io_extpar': {'aot_buffer_file'}})
+
+
class InputArt:
'''
define structure of namelist "INPUT_ART"
diff --git a/python/lib/metadata.py b/python/lib/metadata.py
index c5491b511..97a95ea36 100644
--- a/python/lib/metadata.py
+++ b/python/lib/metadata.py
@@ -545,6 +545,33 @@ def __init__(self):
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
+# AOT
+
+
+class AotMeta:
+
+ def __init__(self):
+ self.type = np.float32
+ self.standard = ''
+ self.dim = {0: 'time', 1: 'ntype', 2: 'ke', 3: 'je', 4: 'ie'}
+ self.name = 'AOT_TG'
+ self.units = ''
+
+
+class AotTegen(AotMeta):
+
+ def __init__(self):
+ super().__init__()
+ self.long = 'aerosol optical thickness; Tegen JGR 1997 (NASA/GISS)'
+
+
+class AotAeroCom(AotMeta):
+
+ def __init__(self):
+ super().__init__()
+ self.long = 'aerosol optical thickness; AeroCom1 (MPI_MET)'
+
+
# art
diff --git a/python/lib/namelist_template.py b/python/lib/namelist_template.py
deleted file mode 100644
index cb50080de..000000000
--- a/python/lib/namelist_template.py
+++ /dev/null
@@ -1,101 +0,0 @@
-'''
-This is a template for the namelist -> rename to namelist.py for use
-
-Make sure, the namelist.py is contained in the run-directory of Extpar.
-All Python scripts use the same namelist.py file, but use different
-dictionaries:
-
- -extpar_alb_to_buffer.py: input_alb
-
- -extpar_cru_to_buffer.py: input_tclim
-
- -extpar_emiss_to_buffer.py: input_emiss
-
- -extpar_ndvi_to_buffer.py: input_ndvi
-
- -extpar_era_to_buffer.py: input_era
-
- -extpar_ahf_to_buffer.py: input_ahf
-
- -extpar_isa_to_buffer.py: input_isa
-
- -extpar_art_to_buffer.py: input_art
-'''
-
-input_tclim = {
- 'raw_data_t_clim_path': '',
- 'raw_data_tclim_coarse': 'absolute_hadcrut3.nc',
- 'raw_data_tclim_fine': 'CRU_T2M_SURF_clim.nc',
- 't_clim_buffer_file': 'cru_buffer.nc',
- 'it_cl_type': 1
-}
-
-input_alb = {
- 'ialb_type': 2,
- 'raw_data_alb_path': '',
- 'raw_data_alb_filename': 'global_soil_albedo.nc',
- 'raw_data_alnid_filename': 'month_alnid_new.nc',
- 'raw_data_aluvd_filename': 'month_aluvd_new.nc',
- 'alb_buffer_file': 'albedo_buffer.nc',
- 'alb_output_file': 'albedo_cosmo.nc',
-}
-
-input_emiss = {
- 'iemiss_type': 1,
- 'raw_data_emiss_path': '',
- 'raw_data_emiss_filename': 'CAM_bbe_int_2010-2015_full.nc',
- 'emiss_buffer_file': 'emiss_buffer.nc',
- 'emiss_output_file': 'emiss_icon.nc'
-}
-
-input_ndvi = {
- 'raw_data_ndvi_path': '',
- 'raw_data_ndvi_filename': 'NDVI_1998_2003.nc',
- 'ndvi_buffer_file': 'ndvi_buffer.nc',
- 'ndvi_output_file': 'ndvi_extpar_cosmo.nc'
-}
-
-input_edgar = {
- 'raw_data_edgar_path': '',
- 'raw_data_edgar_filename_bc': 'v8.1_FT2022_AP_BC_2022_TOTALS_flx.nc',
- 'raw_data_edgar_filename_oc': 'v8.1_FT2022_AP_OC_2022_TOTALS_flx.nc',
- 'raw_data_edgar_filename_so2': 'v8.1_FT2022_AP_SO2_2022_TOTALS_flx.nc',
- 'raw_data_edgar_filename_nox': 'v8.1_FT2022_AP_NOx_2022_TOTALS_flx.nc',
- 'raw_data_edgar_filename_nh3': 'v8.1_FT2022_AP_NH3_2022_TOTALS_flx.nc',
- 'edgar_buffer_file': 'edgar_buffer.nc',
-}
-
-input_cdnc = {
- 'raw_data_cdnc_path': '',
- 'raw_data_cdnc_filename': 'modis_cdnc_climatology_Q06.nc',
- 'cdnc_buffer_file': 'cdnc_buffer.nc',
-}
-
-input_era = {
- 'iera_type': 1,
- 'raw_data_era_path': '',
- 'raw_data_era_ORO': 'ERA5_ORO_1990.nc',
- 'raw_data_era_T2M': 'ERA5_T2M_1990_2019.nc',
- 'raw_data_era_SST': 'ERA5_SST_1990_2019.nc.',
- 'raw_data_era_SD': 'ERA5_SD_1990_2019.nc',
- 'era_buffer_file': 'era_buffer.nc',
-}
-
-input_ahf = {
- 'iahf_type': 1,
- 'raw_data_ahf_path': '',
- 'raw_data_ahf_filename': 'AHF_2006_CDO.nc',
- 'ahf_buffer_file': 'ahf_buffer.nc',
-}
-
-input_isa = {
- 'raw_data_isa_path': '',
- 'raw_data_isa_filename': 'NOAA_ISA_CDO.nc',
- 'isa_buffer_file': 'isa_buffer.nc',
-}
-
-input_art = {
- 'raw_data_art_path': '',
- 'raw_data_art_filename': 'HWSD0_USDA.nc',
- 'art_buffer_file': 'art_buffer.nc',
-}
diff --git a/python/lib/utilities.py b/python/lib/utilities.py
index ca0337d44..da1a5bef2 100644
--- a/python/lib/utilities.py
+++ b/python/lib/utilities.py
@@ -197,6 +197,25 @@ def check_isatype(isa_type):
return isa_type
+def check_aottype(aot_type):
+ '''
+ check aot_type for correctnes and return value,
+ if not exit programme
+ '''
+
+ if (aot_type > 2 or aot_type < 1):
+ logging.error(f'aot_type {aot_type} does not exist.')
+ raise ValueError(f'aot_type {aot_type} does not exist.')
+
+ if (aot_type == 1):
+ logging.info('process aot data with spatial resolution of 30sec')
+
+ if (aot_type == 2):
+ logging.info('process aot data with spatial resolution of 10sec')
+
+ return aot_type
+
+
def check_emisstype(emiss_type):
'''
check emiss_type for correctness and return value,
diff --git a/src/extpar_aot_to_buffer.f90 b/src/extpar_aot_to_buffer.f90
deleted file mode 100644
index e994a2281..000000000
--- a/src/extpar_aot_to_buffer.f90
+++ /dev/null
@@ -1,235 +0,0 @@
-!+ Fortran main program to aggregate aerosol optical thickness raw data to target grid
-!
-! History:
-! Version Date Name
-! ------------ ---------- ----
-! V1_0 2010/12/21 Hermann Asensio
-! Initial release
-! V1_1 2011/01/20 Hermann Asensio
-! small bug fixes accroding to Fortran compiler warnings
-! V1_3 2011/04/19 Hermann Asensio
-! clean up of code
-! V1_7 2013/01/25 Guenther Zaengl
-! Parallel threads for ICON and COSMO using Open-MP,
-! Several bug fixes and optimizations for ICON search algorithm,
-! particularly for the special case of non-contiguous domains;
-! simplified namelist control for ICON
-! V2_0 2013/08/08 Daniel Luethi
-! Addition of 2 alternative Aerosol Climatologies
-! V4_0 2013/08/17 authors from RHM and Daniel Lthi
-! Addition of support for MACv2 aerosol fields
-!
-! Code Description:
-! Language: Fortran 2003.
-!=======================================================================
-!> Fortran main program to aggregate aerosol optical thickness raw data to target grid
-!>
-!! @par extpar_aot_to_buffer
-!!
-!! This program interpolates monthly aerosol optical thicknesses for five different types of aerosols
-!!
-!! - black carbon
-!! - dust
-!! - organic
-!! - SO4
-!! - sea salt
-!!
-!! iaot_type = 1
-!! from a global climatology from Ina Tegen (Tegen et al. 1997) to a target grid (COSMO/ICON).
-!! The raw data and the describing paper are available at NASA/GISS at the Global Aerosol Climatology Project
-!! (GACP http://gacp.giss.nasa.gov/data_sets/transport/).
-!!
-!!
-!! Tegen, I., P. Hollrigl, M. Chin, I. Fung, D. Jacob, and J. Penner 1997.
-!!
-!! Contribution of different aerosol species to the global aerosol extinction optical thickness:
-!! Estimates from model results.
-!! J. Geophys. Res., 102, 23895-23915.
-!!
-!! iaot_type = 2
-!! aerosol climatology from the AEROCOM project
-!! (http://aerocom.met.no/aerocomhome.html)
-!!
-!! Kinne, S., M. Schulz, C. Textor, S. Guibert, Y. Balkanski, S.E. Bauer,
-!! T. Berntsen, T.F. Berglen, O. Boucher, M. Chin, W. Collins, F. Dentener,
-!! T. Diehl, R. Easter, J. Feichter, D. Fillmore, S. Ghan, P. Ginoux, S. Gong,
-!! A. Grini, J. Hendricks, M. Herzog, L. Horowitz, I. Isaksen, T. Iversen,
-!! A. Kirkevg, S. Kloster, D. Koch, J.E. Kristjansson, M. Krol, A. Lauer,
-!! J.F. Lamarque, G. Lesins, X. Liu, U. Lohmann, V. Montanaro, G. Myhre,
-!! J. Penner, G. Pitari, S. Reddy, . Seland, P. Stier, T. Takemura, and X. Tie:
-!! An AeroCom initial assessment optical properties in aerosol component modules
-!! of global models, Atmos. Chem. Phys., 6, 1815-1834, 2006.
-!!
-PROGRAM extpar_aot_to_buffer
-
- USE mo_logging
- USE mo_kind, ONLY: wp, i4
- USE info_extpar, ONLY: info_print
-
- USE mo_target_grid_data, ONLY: lon_geo, &
- & lat_geo, &
- & tg
-
- USE mo_target_grid_routines, ONLY: init_target_grid
-
- USE mo_io_units, ONLY: filename_max
-
-
- USE mo_aot_data, ONLY: allocate_aot_data, &
- & deallocate_aot_data, &
- & get_dimension_aot_data, &
- & get_aot_grid_and_data, &
- & lon_aot, &
- & lat_aot, &
- & aot_grid, &
- & aot_data, &
- & read_namelists_extpar_aerosol, &
- & iaot_type
-
- USE mo_agg_aot, ONLY: agg_aot_data_to_target_grid
-
- USE mo_aot_target_fields, ONLY: allocate_aot_target_fields, &
- & aot_tg
-
- USE mo_aot_output_nc, ONLY: write_netcdf_buffer_aot
-
- USE mo_io_utilities, ONLY: join_path
-
- IMPLICIT NONE
-
- CHARACTER(len=filename_max) :: netcdf_filename, &
- & filename, &
- & namelist_grid_def, &
- & input_namelist_file, &
- & raw_data_aot_path, & !< path to raw data
- & raw_data_aot_filename, & !< filename temperature climatology raw data
- & aot_buffer_file !< name for aerosol buffer file
-
- REAL (KIND=wp) :: undefined
-
- INTEGER (KIND=i4) :: ntype, & !< number of types of aerosols
- nrows, & !< number of rows
- ncolumns, & !< number of columns
- ntime !< number of times
-
- !local variables
- input_namelist_file='INPUT_AOT'
- namelist_grid_def = 'INPUT_grid_org'
- undefined = -999.0_wp
-
- CALL initialize_logging("extpar_aot_to_buffer.log")
- CALL info_print()
-
- !--------------------------------------------------------------------------
- !--------------------------------------------------------------------------
- CALL logging%info('')
- CALL logging%info('============= start aot_to_buffer ==============')
- CALL logging%info('')
-
- !--------------------------------------------------------------------------
- !--------------------------------------------------------------------------
- CALL logging%info('')
- CALL logging%info('============= read namelist and get dimension ==')
- CALL logging%info('')
-
- !--------------------------------------------------------------------------------------------------------
- ! get information on target grid, allocate target fields with coordinates and determin the coordinates
- ! for th target grid
-
- CALL init_target_grid(namelist_grid_def)
-
- !------------------------------------------------------------------------------------
-
- ! get information about aerosol data
- CALL read_namelists_extpar_aerosol(input_namelist_file, &
- & iaot_type, &
- & raw_data_aot_path, &
- & raw_data_aot_filename, &
- & aot_buffer_file)
-
-
- filename = join_path(raw_data_aot_path,raw_data_aot_filename)
-
- ! inquire dimensions
- CALL get_dimension_aot_data(filename, &
- nrows, &
- ncolumns, &
- ntime, &
- ntype)
-
- !--------------------------------------------------------------------------
- !--------------------------------------------------------------------------
-
- CALL logging%info('')
- CALL logging%info('============= allocate fields ==================')
- CALL logging%info('')
-
- CALL logging%info('l_use_array_cache=.FALSE. -> can only be used in consistency_check')
-
- ! allocate aot raw data fields
- CALL allocate_aot_data(nrows,ncolumns,ntime,ntype)
-
- ! allocate target grid fields for aerosol optical thickness
- CALL allocate_aot_target_fields(tg, ntime, ntype, l_use_array_cache=.FALSE.)
-
- !--------------------------------------------------------------------------
- !--------------------------------------------------------------------------
-
- CALL logging%info('')
- CALL logging%info('============= get grid and data ===============')
- CALL logging%info('')
-
- ! read in aot raw data
- CALL get_aot_grid_and_data(filename, &
- nrows, &
- ncolumns, &
- ntime, &
- ntype, &
- aot_grid, &
- lon_aot, &
- lat_aot, &
- aot_data)
-
-
- aot_tg = undefined ! set target grid values to undefined
-
- !-------------------------------------------------------------------------------
- !-------------------------------------------------------------------------------
-
- CALL logging%info('')
- CALL logging%info('============= start aggregation ================')
- CALL logging%info('')
-
- CALL agg_aot_data_to_target_grid(ntime,ntype)
-
- !-------------------------------------------------------------------------------
- !-------------------------------------------------------------------------------
-
- CALL logging%info( '')
- CALL logging%info('============= write data to netcdf==============')
- CALL logging%info( '')
-
- netcdf_filename = TRIM(aot_buffer_file)
- CALL write_netcdf_buffer_aot(netcdf_filename, &
- & tg, &
- & undefined, &
- & lon_geo, &
- & lat_geo, &
- & ntype, &
- & ntime, &
- & aot_tg, &
- & iaot_type)
-
- !-------------------------------------------------------------------------------
- !-------------------------------------------------------------------------------
-
- CALL logging%info( '')
- CALL logging%info('============= deallocate fields =================')
- CALL logging%info( '')
-
- CALL deallocate_aot_data()
-
- CALL logging%info( '')
- CALL logging%info('============= aot_to_buffer done ================')
-
-END PROGRAM extpar_aot_to_buffer
diff --git a/src/extpar_consistency_check.f90 b/src/extpar_consistency_check.f90
index ea3a91c9f..e2ce9e883 100644
--- a/src/extpar_consistency_check.f90
+++ b/src/extpar_consistency_check.f90
@@ -186,17 +186,6 @@ PROGRAM extpar_consistency_check
USE mo_topo_data, ONLY: lradtopo, nhori, max_tiles, itopo_type, &
& radius, min_circ_cov, max_missing, itype_scaling
- USE mo_aot_target_fields, ONLY: allocate_aot_target_fields,&
- & aot_tg
-
- USE mo_aot_output_nc, ONLY: read_netcdf_buffer_aot
-
- USE mo_aot_data, ONLY: ntype_aot, &
- & ntime_aot, &
- & iaot_type
-
- USE mo_aot_data, ONLY: read_namelists_extpar_aerosol
-
USE mo_flake_routines, ONLY: read_namelists_extpar_flake
USE mo_flake_tg_fields, ONLY: fr_lake, &
@@ -251,7 +240,11 @@ PROGRAM extpar_consistency_check
& max_tiles_isa, &
& undef_isa, &
& minimal_isa, &
- & isa_type
+ & isa_type, &
+ ! aot
+ & ntype_aot, &
+ & ntime_aot, &
+ & iaot_type
USE mo_python_routines, ONLY: read_namelists_extpar_emiss, &
& read_namelists_extpar_t_clim, &
@@ -264,7 +257,8 @@ PROGRAM extpar_consistency_check
& const_check_interpol_alb, &
& read_namelists_extpar_era, &
& read_namelists_extpar_ahf, &
- & read_namelists_extpar_isa
+ & read_namelists_extpar_isa, &
+ & read_namelists_extpar_aerosol
USE mo_python_tg_fields, ONLY: &
! emiss
@@ -318,7 +312,10 @@ PROGRAM extpar_consistency_check
& allocate_ahf_target_fields, &
! isa
& isa_field, &
- & allocate_isa_target_fields
+ & allocate_isa_target_fields, &
+ ! aot
+ & aot_tg, &
+ & allocate_aot_target_fields
USE mo_python_output_nc, ONLY: read_netcdf_buffer_emiss, &
@@ -330,7 +327,8 @@ PROGRAM extpar_consistency_check
& read_netcdf_buffer_alb, &
& read_netcdf_buffer_era, &
& read_netcdf_buffer_ahf, &
- & read_netcdf_buffer_isa
+ & read_netcdf_buffer_isa, &
+ & read_netcdf_buffer_aot
USE mo_io_utilities, ONLY: join_path
@@ -408,8 +406,6 @@ PROGRAM extpar_consistency_check
& t_clim_buffer_file, & !< name for temperature climatology buffer
& t_clim_output_file, & !< name for temperature climatology output file
! aerosol optical thickness
- & raw_data_aot_path, & !< path to raw data
- & raw_data_aot_filename, & !< filename temperature climatology raw data
& aot_buffer_file, & !< name for aerosol buffer file
& topo_files(1:max_tiles), & !< filenames globe raw data
! flake
@@ -642,8 +638,6 @@ PROGRAM extpar_consistency_check
namelist_file = 'INPUT_AOT'
CALL read_namelists_extpar_aerosol(namelist_file, &
& iaot_type, &
- & raw_data_aot_path, &
- & raw_data_aot_filename, &
& aot_buffer_file)
!--------------------------------------------------------------------------------------------------------
diff --git a/src/mo_agg_aot.f90 b/src/mo_agg_aot.f90
deleted file mode 100644
index c0aa44f9b..000000000
--- a/src/mo_agg_aot.f90
+++ /dev/null
@@ -1,153 +0,0 @@
-!+ Fortran module to aggregate aerosol optical thickness raw data to target grid
-!
-! History:
-! Version Date Name
-! ------------ ---------- ----
-! V1_0 2010/12/21 Hermann Asensio
-! Initial release
-! V1_3 2011/04/19 Hermann Asensio
-! suppurt unlimited time dimension for netcdf
-! V4_0 2016/08/17 authors from RHM and Daniel Lüthi
-! Add support for MACv2 aerosol fields
-!
-! Code Description:
-! Language: Fortran 2003.
-!=======================================================================
-!> Fortran module to aggregate aerosol optical thickness raw data to target grid
-!!
-!! This module interpolates monthly aerosol optical thicknesses for five different type of aerosols
-!!
-!! - black carbon
-!! - dust
-!! - organic
-!! - SO4
-!! - sea salt
-!!
-!! from a global climatology from Ina Tegen (Tegen et al. 1997) to a target grid (COSMO/ICON).
-!! The raw data and the describing paper are available at NASA/GISS at the Global Aerosol Climatology Project
-!! (GACP http://gacp.giss.nasa.gov/data_sets/transport/).
-!!
-!!
-!! Tegen, I., P. Hollrigl, M. Chin, I. Fung, D. Jacob, and J. Penner 1997.
-!!
-!! Contribution of different aerosol species to the global aerosol extinction optical thickness:&
-!!& Estimates from model results.
-!! J. Geophys. Res., 102, 23895-23915.
-!> \author Hermann Asensio
-MODULE mo_agg_aot
-
- !> kind parameters are defined in MODULE data_parameters
- USE mo_logging
- USE mo_kind, ONLY: wp, i4
-
- USE mo_bilinterpol, ONLY: get_4_surrounding_raw_data_indices, &
- & calc_weight_bilinear_interpol, &
- & calc_value_bilinear_interpol
-
- USE mo_target_grid_data, ONLY: lon_geo, &
- & lat_geo, &
- & tg
-
- USE mo_aot_data, ONLY :lon_aot, &
- & lat_aot, &
- & aot_data, &
- & aot_grid
-
- USE mo_aot_target_fields, ONLY: aot_tg
-
- IMPLICIT NONE
-
- PRIVATE
-
- PUBLIC :: agg_aot_data_to_target_grid
-
- CONTAINS
-
- !> Subroutine to aggregate aerosol optical thickness data to the target grid
- SUBROUTINE agg_aot_data_to_target_grid(ntime,ntype)
- !-------------------------------------------------------------------------------------
-
- INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
- & ntime!< number of times
-
- REAL (KIND=wp) :: point_lon_geo, & !< longitude coordinate in geographical system of input point
- & point_lat_geo, & !< latitude coordinate in geographical system of input point
- & data_array_sw(ntime,ntype), & !< data array values at south-western point
- & data_array_se(ntime,ntype), & !< data array values at south-eastern point
- & data_array_ne(ntime,ntype), & !< data array values at north-eastern point
- & data_array_nw(ntime,ntype), & !< data array values at north-western point
- & target_array_value(ntime,ntype), & !< interpolated values
- & bwlon, &
- & bwlat, &
- & bwlon2d(ntime,ntype),&
- & bwlat2d(ntime,ntype)
-
-
- INTEGER (KIND=i4) :: western_column, & !< the index of the western_column of raw data
- & eastern_column, & !< the index of the eastern_column of raw data
- & northern_row, & !< the index of the northern_row of raw data
- & southern_row, & !< the index of the southern_row of raw data
- & i,j,k ! counters
-
- ! global data flag
- LOGICAL :: gldata=.TRUE. ! AOT data are global
- CALL logging%info('Enter routine: agg_aot_data_to_target_grid')
-
- target_array_value = -999.
-
- ! loop through all target grid elements
- DO i=1,tg%ie
- DO j=1,tg%je
- DO k=1,tg%ke
- point_lon_geo = lon_geo(i,j,1)
- point_lat_geo = lat_geo(i,j,1)
-
- CALL get_4_surrounding_raw_data_indices( aot_grid, &
- lon_aot, &
- lat_aot, &
- gldata, &
- point_lon_geo, &
- point_lat_geo, &
- western_column,&
- eastern_column,&
- northern_row, &
- southern_row)
-
- ! calculate weight for bilinear interpolation
- target_array_value = -999.
- IF ((western_column /= 0) ) THEN ! point is not out of data grid range
-
- CALL calc_weight_bilinear_interpol(point_lon_geo, &
- point_lat_geo, &
- lon_aot(western_column), &
- lon_aot(eastern_column), &
- lat_aot(northern_row), &
- lat_aot(southern_row), &
- bwlon, &
- bwlat)
- ! the weights are bwlon and bwlat
- ! put all relevant data to an array, dimension (ntime, ntype) for each grid point
- ! perform the interpolation
- bwlon2d = bwlon
- bwlat2d = bwlat
-
- data_array_sw(1:ntime,1:ntype) = aot_data(western_column,southern_row,1:ntime,1:ntype)
- data_array_se(1:ntime,1:ntype) = aot_data(eastern_column,southern_row,1:ntime,1:ntype)
- data_array_ne(1:ntime,1:ntype) = aot_data(eastern_column,northern_row,1:ntime,1:ntype)
- data_array_nw(1:ntime,1:ntype) = aot_data(western_column,northern_row,1:ntime,1:ntype)
- target_array_value = calc_value_bilinear_interpol(bwlon2d,bwlat2d,&
- data_array_sw, data_array_se, data_array_ne, data_array_nw)
- aot_tg(i,j,k,1:ntype,1:ntime) = TRANSPOSE(target_array_value(1:ntime,1:ntype))
- ELSE
- aot_tg(i,j,k,1:ntype,1:ntime) = TRANSPOSE(target_array_value(1:ntime,1:ntype))
- ENDIF
-
- ENDDO
- ENDDO
- ENDDO ! loop through all target grid elements
-
- CALL logging%info('Exit routine: agg_aot_data_to_target_grid')
-
- END SUBROUTINE agg_aot_data_to_target_grid
-
-END MODULE mo_agg_aot
diff --git a/src/mo_aot_data.f90 b/src/mo_aot_data.f90
deleted file mode 100644
index 2668d833c..000000000
--- a/src/mo_aot_data.f90
+++ /dev/null
@@ -1,305 +0,0 @@
-!+ Fortran module with data fields for Aerosol optical thickness data
-!
-! History:
-! Version Date Name
-! ------------ ---------- ----
-! V1_0 2010/12/21 Hermann Asensio
-! Initial release
-! V4_0 2016/08/17 authors from RHM and Daniel Lthi
-! Added support for MACv2 aerosol data fields
-!
-! Code Description:
-! Language: Fortran 2003.
-!=======================================================================
-!> Fortran module with data fields for Aerosol optical thickness data
-!> \author Hermann Asensio
-!
-MODULE mo_aot_data
-
- USE mo_logging
- USE mo_kind, ONLY: wp,i4
-
- USE netcdf, ONLY: nf90_open, &
- nf90_close, &
- nf90_inquire, &
- nf90_inquire_dimension, &
- nf90_inquire_dimension, &
- nf90_inq_varid, &
- nf90_get_var, &
- nf90_nowrite
-
- USE mo_utilities_extpar, ONLY: free_un
-
- USE mo_io_utilities, ONLY: check_netcdf
-
- USE mo_grid_structures, ONLY: reg_lonlat_grid
-
- USE mo_io_units, ONLY: filename_max
-
- USE mo_aot_target_fields, ONLY: aot_tg
-
- IMPLICIT NONE
-
- PRIVATE
-
- PUBLIC :: aot_grid, ntime_aot, iaot_type
-
- PUBLIC :: allocate_aot_data, &
- deallocate_aot_data, &
- read_namelists_extpar_aerosol, &
- get_dimension_aot_data, &
- get_aot_grid_and_data, &
- lon_aot, &
- lat_aot, &
- aot_data, &
- ntype_aot, &
- aot_varname, &
- aot_longname, &
- aot_shortname
-
- TYPE(reg_lonlat_grid) :: aot_grid !< definition of the raw data grid for the AOT dataset
- REAL (KIND=wp), ALLOCATABLE :: lon_aot(:), & !< longitude of aot grid
- & lat_aot(:), & !< latitude of aot grid
- & aot_data(:,:,:,:) !< aerosol optical thickness, aot(ntype,ncolumns,nrows,ntime)
-
- INTEGER (KIND=i4), PARAMETER :: ntype_aot = 5, & !< number of types of aerosols
- & ntime_aot = 12, & !< 12 monthly mean data of aeorsol optical thickness
- & nspb_aot = 9 !< 9 spectral bands of aeorsol optical thickness
-
- CHARACTER (len=32) :: aot_varname(ntype_aot) = & !< variable name for aerosolt type
- & (/ 'bc ', 'dust ', 'org ', 'so4 ', 'ssalt' /)
- CHARACTER (len=80) :: aot_longname(ntype_aot) = & !< long name for aereosol type
- & (/ 'aerosol optical thickness of black carbon ', &
- & 'aerosol optical thickness of dust ', &
- & 'aerosol optical thickness of organic matter', &
- & 'aerosol optical thickness of sulfate ', &
- & 'aerosol optical thickness of sea salt ' /)
- CHARACTER (len=20) :: aot_shortname(ntype_aot)= & !< short name for aereosol type
- & (/ 'AER_BC ', &
- & 'AER_DUST ', &
- & 'AER_ORG ', &
- & 'AER_SO4 ', &
- & 'AER_SS ' /)
-
- INTEGER (KIND=i4) :: iaot_type = 1
-
- CONTAINS
-
- !---------------------------------------------------------------------------
- !> subroutine to read namelist for aerosol optical thickness data settings for EXTPAR
- SUBROUTINE read_namelists_extpar_aerosol(namelist_file, &
- & iaot_type, &
- & raw_data_aot_path, &
- & raw_data_aot_filename, &
- & aot_buffer_file)
-
- CHARACTER (LEN=*), INTENT(IN) :: namelist_file !< filename with namelists for for EXTPAR settings
-
- ! aerosol optical thickness
- CHARACTER (LEN=filename_max) :: raw_data_aot_path, &
- & raw_data_aot_filename, &
- & aot_buffer_file, &
- & filename
- INTEGER (KIND=i4) :: iaot_type, nuin, ierr
-
-!> namelist with filenames for aerosol optical thickness data input
- NAMELIST /aerosol_raw_data/ raw_data_aot_path, raw_data_aot_filename, iaot_type
-
-!> namelist with filenames for aerosol optical thickness data output
- NAMELIST /aerosol_io_extpar/ aot_buffer_file
-
- nuin = free_un() ! functioin free_un returns free Fortran unit number
- filename = TRIM(namelist_file)
-
- OPEN(nuin,FILE=filename, IOSTAT=ierr)
-
- READ(nuin, NML=aerosol_raw_data, IOSTAT=ierr)
- READ(nuin, NML=aerosol_io_extpar, IOSTAT=ierr)
-
- CLOSE(nuin)
-
- IF (ierr /= 0) THEN
- WRITE(message_text,*)'Cannot read ', filename
- CALL logging%error(message_text,__FILE__, __LINE__)
- ENDIF
-
- END SUBROUTINE read_namelists_extpar_aerosol
-!---------------------------------------------------------------------------
-
-!> subroutine to allocate aot data fields
- SUBROUTINE allocate_aot_data(nrows,ncolumns,ntime,ntype)
-
- IMPLICIT NONE
-
- INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
- & nrows, & !< number of rows
- & ncolumns, & !< number of columns
- & ntime !< number of times
-
- INTEGER :: errorcode !< error status variable
-
- CALL logging%info('Enter routine: allocate_aot_data')
-
- ALLOCATE (lon_aot(1:ncolumns+1), STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant allocate the array lon_aot',__FILE__,__LINE__)
- lon_aot = 0.0
-
- ALLOCATE (lat_aot(1:nrows), STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant allocate the array lat_aot',__FILE__,__LINE__)
- lat_aot = 0.0
-
- ALLOCATE (aot_data(1:ncolumns+1,1:nrows,1:ntime,1:ntype),STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant allocate the array aot_data',__FILE__,__LINE__)
- aot_data = 0.0
-
- END SUBROUTINE allocate_aot_data
-
- !> get dimension information of aot data from netcdf file
- SUBROUTINE get_dimension_aot_data(aot_filename, &
- & nrows, &
- & ncolumns, &
- & ntime, &
- & ntype)
-
- IMPLICIT NONE
-
- CHARACTER (LEN=*), INTENT(IN) :: aot_filename !< filename aot raw data
-
- INTEGER (KIND=i4), INTENT(OUT) :: ntype, & !< number of types of aerosols
- & nrows, & !< number of rows
- & ncolumns, & !< number of columns
- & ntime !< number of times
-
- !local variables
- CHARACTER (LEN=filename_max) :: filename
- CHARACTER (LEN=80) :: dimname
- INTEGER :: ncid, ndimension, nVars, &
- & nGlobalAtts, unlimdimid, dimid, &
- & length
-
- CALL logging%info('Enter routine: get_dimension_aot_data')
-
- ! open netcdf file
- filename = TRIM(aot_filename)
-
- CALL check_netcdf( nf90_open(filename,NF90_NOWRITE, ncid))
-
- ! look for numbers of dimensions, Variable, Attributes, and the dimid for the unlimited dimension (probably time)
- CALL check_netcdf (nf90_inquire(ncid,ndimension, nVars, nGlobalAtts,unlimdimid))
-
- DO dimid=1,ndimension
- CALL check_netcdf( nf90_inquire_dimension(ncid,dimid, dimname, length) )
- IF ( TRIM(dimname) == 'lon') ncolumns=length
- IF ( TRIM(dimname) == 'lat') nrows=length
- IF ( TRIM(dimname) == 'time') ntime=length
- ENDDO
-
- ntype=ntype_aot
-
- ! close netcdf file
- CALL check_netcdf( nf90_close( ncid))
-
- END SUBROUTINE get_dimension_aot_data
-
- !> get all aot data and coordinates and grid description
- SUBROUTINE get_aot_grid_and_data(aot_filename, &
- & nrows, &
- & ncolumns, &
- & ntime, &
- & ntype, &
- & aot_grid, &
- & lon_aot, &
- & lat_aot, &
- & aot_data)
- IMPLICIT NONE
-
- CHARACTER (LEN=*), INTENT(IN) :: aot_filename !< filename aot raw data
- INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
- & nrows, & !< number of rows
- & ncolumns, & !< number of columns
- & ntime !< number of times
-
- TYPE(reg_lonlat_grid), INTENT(INOUT) :: aot_grid
-
- REAL (KIND=wp), INTENT(INOUT) :: lon_aot(1:ncolumns+1), &
- lat_aot(1:nrows), &
- aot_data(:,:,:,:)
- !local variables
- REAL, ALLOCATABLE :: aot_data_stype(:,:,:)
-
- INTEGER :: ncid,n, coovarid(2), &
- & varid(ntype)
-
- CHARACTER (LEN=80) :: varname(ntype), & !< name of variable
- & cooname(2) !< name of coordinates
-
- CALL logging%info('Enter routine: get_aot_grid_and_data')
-
- cooname(1) = 'lon'
- cooname(2) = 'lat'
-
- ! open netcdf file
- CALL check_netcdf( nf90_open(TRIM(aot_filename),NF90_NOWRITE, ncid))
- DO n=1,2
- CALL check_netcdf( nf90_inq_varid(ncid, TRIM(cooname(n)), coovarid(n)))
- ENDDO
-
- CALL check_netcdf(nf90_get_var(ncid, coovarid(1), lon_aot(1:ncolumns)))
- CALL check_netcdf(nf90_get_var(ncid, coovarid(2), lat_aot))
-
- varname(1) = 'black_carbon'
- varname(2) = 'dust'
- varname(3) = 'organic'
- varname(4) = 'sulfate'
- varname(5) = 'sea_salt'
-
- ALLOCATE (aot_data_stype(ncolumns,nrows,ntime))
- DO n=1,ntype
- CALL check_netcdf( nf90_inq_varid(ncid, TRIM(varname(n)), varid(n)))
-
- CALL check_netcdf(nf90_get_var(ncid, varid(n), aot_data_stype))
-
- aot_data(1:ncolumns,:,:,n) = aot_data_stype(1:ncolumns,:,:)
- ENDDO
- DEALLOCATE (aot_data_stype)
- CALL check_netcdf( nf90_close( ncid))
- ! close netcdf file
-
- ! extend aot_data by 1 column so that the field covers the whole globe
- aot_data(ncolumns+1,:,:,:) = aot_data(1,:,:,:)
-
- ! set aot_grid values
- aot_grid%start_lon_reg = lon_aot(1)
- aot_grid%start_lat_reg = lat_aot(1)
- aot_grid%dlon_reg = (lon_aot(ncolumns) - lon_aot(1) ) / (ncolumns - 1)
- aot_grid%dlat_reg = (lat_aot(nrows) - lat_aot(1) ) / (nrows -1)
- aot_grid%nlon_reg = ncolumns+1
- aot_grid%nlat_reg = nrows
-
- aot_grid%end_lon_reg = lon_aot(ncolumns) + aot_grid%dlon_reg
- aot_grid%end_lat_reg = lat_aot(nrows)
- lon_aot(ncolumns+1)=lon_aot(ncolumns) + aot_grid%dlon_reg
-
- END SUBROUTINE get_aot_grid_and_data
-
- SUBROUTINE deallocate_aot_data()
-
- IMPLICIT NONE
-
- INTEGER :: errorcode
-
- CALL logging%info('Enter routine: deallocate_aot_data')
-
- DEALLOCATE (lon_aot, STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant deallocate the array lon_aot',__FILE__,__LINE__)
- DEALLOCATE (lat_aot, STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant deallocate the array lat_aot',__FILE__,__LINE__)
-
- DEALLOCATE (aot_data, STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant deallocate the array aot_data',__FILE__,__LINE__)
- DEALLOCATE (aot_tg, STAT=errorcode)
- IF(errorcode.NE.0) CALL logging%error('Cant deallocate the array aot_tg',__FILE__,__LINE__)
-
- END SUBROUTINE deallocate_aot_data
-
-END MODULE mo_aot_data
diff --git a/src/mo_aot_output_nc.f90 b/src/mo_aot_output_nc.f90
deleted file mode 100644
index 763379f1e..000000000
--- a/src/mo_aot_output_nc.f90
+++ /dev/null
@@ -1,271 +0,0 @@
-!+ Fortran module for aerosol input output routines
-!
-! History:
-! Version Date Name
-! ------------ ---------- ----
-! V1_0 2010/12/21 Hermann Asensio
-! Initial release
-! V1_3 2011/04/19 Hermann Asensio
-! change netcdf output: time variable
-! V1_4 2011/04/21 Hermann Asensio
-! clean up
-! V2_0 2013/08/18 Daniel Luethi
-! added support for alternative aerosol climatologies AEROCOM and MNACC-II
-! V4_0 2016/08/17 authors from RHM and Daniel Lthi
-! added support for MACv2 climatological aerosol fields
-!
-! Code Description:
-! Language: Fortran 2003.
-!=======================================================================
-!> Fortran module for aerosol input output routines
-!> \author Hermann Asensio
-MODULE mo_aot_output_nc
-
- USE mo_logging
- USE mo_kind, ONLY: wp,i4
-
- USE mo_grid_structures, ONLY: target_grid_def
-
- USE mo_io_utilities, ONLY: netcdf_attributes, &
- & netcdf_put_var, &
- & open_new_netcdf_file, &
- & close_netcdf_file, &
- & set_date_mm_extpar_field, &
- & netcdf_get_var, &
- & dim_meta_info
-
- USE mo_var_meta_data, ONLY: dim_2d_tg, &
- & dim_3d_tg, &
- & def_dimension_info_buffer, &
- & def_aot_tg_meta, &
- & lat_geo_meta, &
- & def_com_target_fields_meta, &
- & lon_geo_meta, &
- & aot_tg_meta
-
- IMPLICIT NONE
-
- PRIVATE
-
- PUBLIC :: write_netcdf_buffer_aot, &
- & read_netcdf_buffer_aot
-
- CONTAINS
-
- !> create a netcdf file for the AOT data in the buffer
- SUBROUTINE write_netcdf_buffer_aot(netcdf_filename, &
- & tg, &
- & undefined, &
- & lon_geo, &
- & lat_geo, &
- & ntype, &
- & ntime, &
- & aot_tg, &
- & iaot_type)
-
-
- CHARACTER (len=*), INTENT(IN):: netcdf_filename !< filename for the netcdf file
- TYPE(target_grid_def), INTENT(IN):: tg !< structure with target grid description
- REAL(KIND=wp), INTENT(IN):: undefined, &
- & lon_geo(:,:,:), &
- & lat_geo(:,:,:), &
- & aot_tg(:,:,:,:,:)
-
-
- INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
- & ntime, & !< number of times
- & iaot_type !< ID of aeorosol raw data
-
-
- ! local variables
- REAL (KIND=wp),ALLOCATABLE :: time(:) !< time variable
- INTEGER (KIND=i4) :: dataDate, & !< date, for edition independent use of GRIB_API dataDate as Integer in the format ccyymmdd
- & dataTime, & !< time, for edition independent use GRIB_API dataTime in the format hhmm
- & ndims,ncid, errorcode, &
- & n
-
- INTEGER, PARAMETER :: nglob_atts=5
- TYPE(netcdf_attributes) :: global_attributes(nglob_atts)
- TYPE(dim_meta_info), ALLOCATABLE :: dim_list(:) !< dimensions for netcdf file
-
- CALL logging%info('Enter routine: write_netcdf_buffer_aot')
- !-------------------------------------------------------------
- ! define global attributes
- IF (iaot_type == 1 ) THEN
- CALL set_global_att_aot(global_attributes)
- ELSEIF(iaot_type == 2 ) THEN
- CALL set_global_att_aot_aero(global_attributes)
- ELSE
- CALL logging%error('Unknown aot data option',__FILE__,__LINE__)
- ENDIF
- !set up dimensions for buffer
- CALL def_dimension_info_buffer(tg)
-
- ! define dimensions and meta information for variable aot_tg for netcdf output
- CALL def_aot_tg_meta(ntime,ntype,dim_3d_tg)
- ! dim_aot_tg and aot_tg_meta
-
- ! define meta information for target field variables lon_geo, lat_geo
- CALL def_com_target_fields_meta(dim_3d_tg)
- ! lon_geo_meta and lat_geo_meta
-
- ALLOCATE(time(1:ntime),STAT=errorcode)
- IF (errorcode /= 0 ) CALL logging%error('Cant allocate array time',__FILE__,__LINE__)
- DO n=1,ntime
- CALL set_date_mm_extpar_field(n,dataDate,dataTime)
- time(n) = REAL(dataDate,wp) + REAL(dataTime,wp)/10000. ! units = "day as %Y%m%d.%f"
- ENDDO
-
- ! set up dimensions for netcdf output
- ndims = 5
- ALLOCATE(dim_list(1:ndims),STAT=errorcode)
- IF (errorcode /= 0 ) CALL logging%error('Cant allocate array dim_list',__FILE__,__LINE__)
-
- dim_list(1) = dim_3d_tg(1) ! ie
- dim_list(2) = dim_3d_tg(2) ! je
- dim_list(3) = dim_3d_tg(3) ! ke
- dim_list(4)%dimname = 'ntype'
- dim_list(4)%dimsize = ntype
- dim_list(5)%dimname = 'time'
- dim_list(5)%dimsize = ntime
-
-
-
- !-----------------------------------------------------------------
- CALL open_new_netcdf_file(netcdf_filename=TRIM(netcdf_filename), &
- & dim_list=dim_list, &
- & global_attributes=global_attributes, &
- & time=time, &
- & ncid=ncid)
-
- ! lon
- CALL netcdf_put_var(ncid,lon_geo,lon_geo_meta,undefined)
-
- ! lat
- CALL netcdf_put_var(ncid,lat_geo,lat_geo_meta,undefined)
-
- ! aot_tg
- CALL netcdf_put_var(ncid,aot_tg,aot_tg_meta,undefined)
-
- CALL close_netcdf_file(ncid)
-
- CALL logging%info('Exit routine: write_netcdf_buffer_aot')
-
- END SUBROUTINE write_netcdf_buffer_aot
-
- !> set global attributes for netcdf with aerosol optical thickness data
- !global climatology from Ina Tegen (Tegen et al. 1997)
- SUBROUTINE set_global_att_aot(global_attributes)
- TYPE(netcdf_attributes), INTENT(INOUT) :: global_attributes(1:5)
-
- !local variables
- CHARACTER(len=10) :: ydate
- CHARACTER(len=10) :: ytime
- CHARACTER(len=2) :: cc
- CHARACTER(len=2) :: yy
- CHARACTER(len=2) :: mm
- CHARACTER(len=2) :: dd
- CHARACTER(len=2) :: hh
- CHARACTER(len=2) :: minute
-
- ! define global attributes
-
- global_attributes(1)%attname = 'title'
- global_attributes(1)%attributetext='Aerosol Optical Thickness'
-
- global_attributes(2)%attname = 'institution'
- global_attributes(2)%attributetext='DWD'
-
-
- global_attributes(3)%attname = 'source'
- global_attributes(3)%attributetext='Global Aerosol Climatology Project'
-
- CALL DATE_AND_TIME(ydate,ytime)
- READ(ydate,'(4A2)') cc,yy,mm,dd
- READ(ytime,'(2A2)') hh, minute
-
- ydate=TRIM(cc)//TRIM(yy)//'-'//TRIM(mm)//'-'//TRIM(dd)
- ytime=TRIM(hh)//':'//TRIM(minute)
-
- global_attributes(4)%attname = 'history'
- global_attributes(4)%attributetext=TRIM(ydate)//'T'//TRIM(ytime)//' aot_to_buffer'
-
- global_attributes(5)%attname = 'references'
- global_attributes(5)%attributetext='http://gacp.giss.nasa.gov/data_sets/transport/'
-
- END SUBROUTINE set_global_att_aot
-!----------------------------------------------------------------------------
-
-!> set global attributes for netcdf with aerosol optical thickness data AeroCom1
-!gs_21.03.12
- SUBROUTINE set_global_att_aot_aero(global_attributes)
- TYPE(netcdf_attributes), INTENT(INOUT) :: global_attributes(1:5)
-
- !local variables
- CHARACTER(len=10) :: ydate
- CHARACTER(len=10) :: ytime
- CHARACTER(len=2) :: cc
- CHARACTER(len=2) :: yy
- CHARACTER(len=2) :: mm
- CHARACTER(len=2) :: dd
- CHARACTER(len=2) :: hh
- CHARACTER(len=2) :: minute
-
- ! define global attributes
-
- global_attributes(1)%attname = 'title'
- global_attributes(1)%attributetext='14 model median (AeroCom1): LO,LS,UL,SP,CT,MI,NF,OT,OG,IM,GM,GO,GI,GR'
-
- global_attributes(2)%attname = 'institution'
- global_attributes(2)%attributetext='MPI_MET'
-
-
- global_attributes(3)%attname = 'source'
- global_attributes(3)%attributetext='Global Aerosol Climatology Project'
-
- CALL DATE_AND_TIME(ydate,ytime)
- READ(ydate,'(4A2)') cc,yy,mm,dd
- READ(ytime,'(2A2)') hh, minute
-
- ydate=TRIM(cc)//TRIM(yy)//'-'//TRIM(mm)//'-'//TRIM(dd)
- ytime=TRIM(hh)//':'//TRIM(minute)
-
- global_attributes(4)%attname = 'history'
- global_attributes(4)%attributetext=TRIM(ydate)//'T'//TRIM(ytime)//' aot_to_buffer'
-
- global_attributes(5)%attname = 'references'
- global_attributes(5)%attributetext='created by stefan_kinne in 2010_11'
-
- END SUBROUTINE set_global_att_aot_aero
-
- !> read netcdf file for the AOT data in the buffer
- SUBROUTINE read_netcdf_buffer_aot(netcdf_filename, &
- & tg, &
- & ntype, &
- & ntime, &
- & aot_tg)
-
-
- CHARACTER (len=*), INTENT(IN) :: netcdf_filename !< filename for the netcdf file
- TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
- INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
- & ntime !< number of times
-
- REAL (KIND=wp), INTENT(OUT) :: aot_tg(:,:,:,:,:) !< aerosol optical thickness, aot_tg(ie,je,ke,ntype,ntime)
-
- CALL logging%info('Enter routine: read_netcdf_buffer_aot')
- !set up dimensions for buffer
- CALL def_dimension_info_buffer(tg)
- ! dim_3d_tg
-
- ! define dimensions and meta information for variable aot_tg for netcdf output
- CALL def_aot_tg_meta(ntime,ntype,dim_3d_tg)
- ! dim_aot_tg and aot_tg_meta
-
- CALL netcdf_get_var(TRIM(netcdf_filename),aot_tg_meta,aot_tg)
-
- CALL logging%info('Exit routine: read_netcdf_buffer_aot')
-
- END SUBROUTINE read_netcdf_buffer_aot
-
-END MODULE mo_aot_output_nc
diff --git a/src/mo_aot_target_fields.f90 b/src/mo_aot_target_fields.f90
deleted file mode 100644
index 5ceb9df46..000000000
--- a/src/mo_aot_target_fields.f90
+++ /dev/null
@@ -1,72 +0,0 @@
-!+ Fortran module for Aerosol optical thickness data, specification of the target grid fields
-!
-! History:
-! Version Date Name
-! ------------ ---------- ----
-! V1_0 2010/12/21 Hermann Asensio
-! Initial release
-! V1_3 2011/04/19 Hermann Asensio
-! cleanup of code
-! V4_0 2016/08/17 authors from RHM and Daniel Lthi
-! added support for MACv2 spectrally stratified monthly aerosol fields
-!
-! Code Description:
-! Language: Fortran 2003.
-!=======================================================================
-!> Fortran module for Aerosol optical thickness data, specification of the target grid fields
-!> \author Hermann Asensio
-!
-
-MODULE mo_aot_target_fields
-
- USE mo_logging
- USE mo_kind, ONLY: wp, i4
- USE mo_array_cache, ONLY: allocate_cached
- USE mo_grid_structures, ONLY: target_grid_def
-
- IMPLICIT NONE
-
- PRIVATE
-
- PUBLIC :: allocate_aot_target_fields
- PUBLIC :: aot_tg
-
- !< aerosol optical thickness, aot_tg(ie,je,ke,,ntype,ntime)
- REAL(KIND=wp), POINTER :: aot_tg(:,:,:,:,:)
-
- CONTAINS
-
- !> allocate fields for TARGET grid
- !!
- !! the target grid for the GME has 3 dimension (ie,je,jd),
- !! the target grid for the COSMO model has 2 dimension (ie,je)
- !! the target grid for the ICON model has 1 dimension (ne)
- !! depending of the target model the second and third dimension of the target fields should be
- !! allocated with the length 1
- SUBROUTINE allocate_aot_target_fields(tg,ntime, ntype,l_use_array_cache)
-
- TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
- INTEGER (KIND=i4), INTENT(IN) :: ntime, & !< number of times
- & ntype !< number of types of aerosol
-
- LOGICAL, INTENT(in) :: l_use_array_cache
-
- INTEGER(KIND=i4) :: errorcode !< error status variable
-
- errorcode = 0
-
- CALL logging%info('Enter routine: allocate_aot_target_fields')
-
- IF (l_use_array_cache) then
- CALL allocate_cached('aot_tg', aot_tg, [tg%ie,tg%je,tg%ke,ntype,ntime])
- ELSE
- ALLOCATE(aot_tg(tg%ie,tg%je,tg%ke,ntype,ntime), stat=errorcode)
- ENDIF
- IF(errorcode /= 0) CALL logging%error('Cant allocate the array aot_tg',__FILE__,__LINE__)
- aot_tg = 0.0_wp
-
- CALL logging%info('Exit routine: allocate_aot_target_fields')
-
-END SUBROUTINE allocate_aot_target_fields
-
-END MODULE mo_aot_target_fields
diff --git a/src/mo_extpar_output_nc.f90 b/src/mo_extpar_output_nc.f90
index b29aa7f13..0f832d89c 100644
--- a/src/mo_extpar_output_nc.f90
+++ b/src/mo_extpar_output_nc.f90
@@ -74,8 +74,6 @@ MODULE mo_extpar_output_nc
USE mo_io_units, ONLY: filename_max
- USE mo_aot_data, ONLY: ntype_aot, ntime_aot
-
USE mo_soil_data, ONLY: HWSD_data
USE mo_topo_data, ONLY: itopo_type, topo_aster, topo_gl, topo_merit
@@ -93,7 +91,9 @@ MODULE mo_extpar_output_nc
& undef_alb_bs, &
& ntime_ndvi, &
& ntime_emiss, &
- & ntime_cdnc
+ & ntime_cdnc, &
+ & ntype_aot, &
+ & ntime_aot
USE mo_terra_urb, ONLY: l_terra_urb, &
& terra_urb_write_netcdf, &
@@ -1187,7 +1187,7 @@ SUBROUTINE write_cdi_icon_grid_extpar(netcdf_filename, &
CALL def_ndvi_meta(ntime_ndvi,dim_1d_icon)
! dim_ndvi_tg, ndvi_max_meta, ndvi_field_mom_meta, ndvi_ratio_mom_meta
- IF (l_use_art) CALL def_hwsd_art_meta(dim_1d_icon)
+ IF (l_use_art) CALL def_art_meta(dim_1d_icon)
IF (l_use_edgar) CALL def_edgar_meta(dim_1d_icon)
diff --git a/src/mo_python_data.f90 b/src/mo_python_data.f90
index f02eaf6fb..86244ce15 100644
--- a/src/mo_python_data.f90
+++ b/src/mo_python_data.f90
@@ -31,7 +31,11 @@ MODULE mo_python_data
& undef_isa, &
& minimal_isa, &
& isa_type, &
- & max_tiles_isa
+ & max_tiles_isa, &
+ ! aot
+ & iaot_type, &
+ & ntype_aot, &
+ & ntime_aot
@@ -56,7 +60,11 @@ MODULE mo_python_data
! ahf
& iahf_type = 1, &
! isa
- & isa_type=1
+ & isa_type=1, &
+ ! aot
+ & iaot_type=1, &
+ & ntype_aot=5, &
+ & ntime_aot=12
REAL (KIND=wp) :: &
! emiss
diff --git a/src/mo_python_output_nc.f90 b/src/mo_python_output_nc.f90
index 6df1263cc..9e051fc53 100644
--- a/src/mo_python_output_nc.f90
+++ b/src/mo_python_output_nc.f90
@@ -54,6 +54,9 @@ MODULE mo_python_output_nc
! isa
& def_isa_fields_meta, &
& isa_field_meta, &
+ ! aot
+ & def_aot_tg_meta, &
+ & aot_tg_meta, &
& isa_field_meta, &
! art
& art_clon_meta, &
@@ -72,7 +75,7 @@ MODULE mo_python_output_nc
& art_lsan_meta, &
& art_sand_meta, &
& art_udef_meta, &
- & def_hwsd_art_meta
+ & def_art_meta
IMPLICIT NONE
@@ -98,6 +101,8 @@ MODULE mo_python_output_nc
& read_netcdf_buffer_ahf, &
! isa
& read_netcdf_buffer_isa, &
+ ! aot
+ & read_netcdf_buffer_aot, &
! art
& read_netcdf_buffer_art
@@ -451,6 +456,34 @@ SUBROUTINE read_netcdf_buffer_isa(netcdf_filename, &
END SUBROUTINE read_netcdf_buffer_isa
+ SUBROUTINE read_netcdf_buffer_aot(netcdf_filename, &
+ & tg, &
+ & ntype, &
+ & ntime, &
+ & aot_tg)
+
+ CHARACTER (len=*), INTENT(IN) :: netcdf_filename !< filename for the netcdf file
+ TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
+ INTEGER (KIND=i4), INTENT(IN) :: ntype, & !< number of types of aerosols
+ & ntime !< number of times
+
+ REAL (KIND=wp), INTENT(OUT) :: aot_tg(:,:,:,:,:) !< aerosol optical thickness, aot_tg(ie,je,ke,ntype,ntime)
+
+ CALL logging%info('Enter routine: read_netcdf_buffer_aot')
+ !set up dimensions for buffer
+ CALL def_dimension_info_buffer(tg)
+ ! dim_3d_tg
+
+ ! define dimensions and meta information for variable aot_tg for netcdf output
+ CALL def_aot_tg_meta(ntime,ntype,dim_3d_tg)
+ ! dim_aot_tg and aot_tg_meta
+
+ CALL netcdf_get_var(TRIM(netcdf_filename),aot_tg_meta,aot_tg)
+
+ CALL logging%info('Exit routine: read_netcdf_buffer_aot')
+
+ END SUBROUTINE read_netcdf_buffer_aot
+
SUBROUTINE read_netcdf_buffer_art(netcdf_filename, &
& tg, &
& art_hcla, &
@@ -468,23 +501,22 @@ SUBROUTINE read_netcdf_buffer_art(netcdf_filename, &
& art_sand, &
& art_udef)
-
CHARACTER (len=*), INTENT(IN) :: netcdf_filename !< filename for the netcdf file
TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
- REAL (KIND=wp), INTENT(OUT) :: art_hcla(:,:,:), & !< field for Fraction of Heavy Clay from hwsd
- & art_silc(:,:,:), & !< field for Fraction of Silty Clay from hwsd
- & art_lcla(:,:,:), & !< field for Fraction of Light Clay from hwsd
- & art_sicl(:,:,:), & !< field for Fraction of Silty Clay Loam from hwsd
- & art_cloa(:,:,:), & !< field for Fraction of Clay Loam from hwsd
- & art_silt(:,:,:), & !< field for Fraction of Silt from hwsd
- & art_silo(:,:,:), & !< field for Fraction of Silty Loam from hwsd
- & art_scla(:,:,:), & !< field for Fraction of Sandy Clay from hwsd
- & art_loam(:,:,:), & !< field for Fraction of Loam from hwsd
- & art_sclo(:,:,:), & !< field for Fraction of Sandy Clay Loam from hwsd
- & art_sloa(:,:,:), & !< field for Fraction of Sandy Loam from hwsd
- & art_lsan(:,:,:), & !< field for Fraction of Loamy Sand from hwsd
- & art_sand(:,:,:), & !< field for Fraction of Sand from hwsd
- & art_udef(:,:,:) !< field for Fraction of Undefined or Water from hwsd
+ REAL (KIND=wp), INTENT(OUT):: art_hcla(:,:,:), & !< field for Fraction of Heavy Clay from hwsd
+ & art_silc(:,:,:), & !< field for Fraction of Silty Clay from hwsd
+ & art_lcla(:,:,:), & !< field for Fraction of Light Clay from hwsd
+ & art_sicl(:,:,:), & !< field for Fraction of Silty Clay Loam from hwsd
+ & art_cloa(:,:,:), & !< field for Fraction of Clay Loam from hwsd
+ & art_silt(:,:,:), & !< field for Fraction of Silt from hwsd
+ & art_silo(:,:,:), & !< field for Fraction of Silty Loam from hwsd
+ & art_scla(:,:,:), & !< field for Fraction of Sandy Clay from hwsd
+ & art_loam(:,:,:), & !< field for Fraction of Loam from hwsd
+ & art_sclo(:,:,:), & !< field for Fraction of Sandy Clay Loam from hwsd
+ & art_sloa(:,:,:), & !< field for Fraction of Sandy Loam from hwsd
+ & art_lsan(:,:,:), & !< field for Fraction of Loamy Sand from hwsd
+ & art_sand(:,:,:), & !< field for Fraction of Sand from hwsd
+ & art_udef(:,:,:) !< field for Fraction of Undefined or Water from hwsd
CALL logging%info('Enter routine: read_netcdf_buffer_art')
@@ -496,7 +528,7 @@ SUBROUTINE read_netcdf_buffer_art(netcdf_filename, &
CALL def_com_target_fields_meta(dim_3d_tg)
! lon_geo_meta and lat_geo_meta
!define meta information for various EMISS data related variables for netcdf output
- CALL def_hwsd_art_meta(dim_3d_tg)
+ CALL def_art_meta(dim_3d_tg)
! dim_emiss_tg, emiss_max_meta, emiss_field_mom_meta, emiss_ratio_mom_meta
CALL netcdf_get_var(TRIM(netcdf_filename),art_hcla_meta,art_hcla)
diff --git a/src/mo_python_routines.f90 b/src/mo_python_routines.f90
index 3cdf12867..7f68ea85c 100644
--- a/src/mo_python_routines.f90
+++ b/src/mo_python_routines.f90
@@ -488,6 +488,40 @@ SUBROUTINE read_namelists_extpar_isa(namelist_file, &
END SUBROUTINE read_namelists_extpar_isa
+ SUBROUTINE read_namelists_extpar_aerosol(namelist_file, &
+ & iaot_type, &
+ & aot_buffer_file)
+
+ CHARACTER (LEN=*), INTENT(IN) :: namelist_file !< filename with namelists for for EXTPAR settings
+
+ ! aerosol optical thickness
+ CHARACTER (LEN=filename_max) :: aot_buffer_file, &
+ & filename
+ INTEGER (KIND=i4) :: iaot_type, nuin, ierr
+
+!> namelist with filenames for aerosol optical thickness data input
+ NAMELIST /aerosol_raw_data/ iaot_type
+
+!> namelist with filenames for aerosol optical thickness data output
+ NAMELIST /aerosol_io_extpar/ aot_buffer_file
+
+ nuin = free_un() ! functioin free_un returns free Fortran unit number
+ filename = TRIM(namelist_file)
+
+ OPEN(nuin,FILE=filename, IOSTAT=ierr)
+
+ READ(nuin, NML=aerosol_raw_data, IOSTAT=ierr)
+ READ(nuin, NML=aerosol_io_extpar, IOSTAT=ierr)
+
+ CLOSE(nuin)
+
+ IF (ierr /= 0) THEN
+ WRITE(message_text,*)'Cannot read ', filename
+ CALL logging%error(message_text,__FILE__, __LINE__)
+ ENDIF
+
+ END SUBROUTINE read_namelists_extpar_aerosol
+
!> open netcdf-file and get netcdf unit file number
SUBROUTINE open_netcdf_ALB_data(path_alb_file, &
ncid)
diff --git a/src/mo_python_tg_fields.f90 b/src/mo_python_tg_fields.f90
index 7154d7761..9d7831d50 100644
--- a/src/mo_python_tg_fields.f90
+++ b/src/mo_python_tg_fields.f90
@@ -57,6 +57,9 @@ MODULE mo_python_tg_fields
! isa
& allocate_isa_target_fields, &
& isa_field, &
+ ! aot
+ & allocate_aot_target_fields, &
+ & aot_tg, &
! hswdART
& allocate_art_target_fields, &
& art_hcla, &
@@ -114,6 +117,8 @@ MODULE mo_python_tg_fields
& ahf_field(:,:,:), & !< fields for artifical heat flux (12 months)
! isa
& isa_field(:,:,:), & !< fraction land due to land use raw data
+ ! aot
+ & aot_tg(:,:,:,:,:), & !< aerosol optical thickness, aot_tg(ie,je,ke,ntype,ntime)
! hswdART
& art_hcla(:,:,:), &
& art_silc(:,:,:), &
@@ -567,6 +572,31 @@ SUBROUTINE allocate_isa_target_fields(tg, l_use_array_cache)
END SUBROUTINE allocate_isa_target_fields
+ SUBROUTINE allocate_aot_target_fields(tg,ntime, ntype,l_use_array_cache)
+
+ TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
+ INTEGER (KIND=i4), INTENT(IN) :: ntime, & !< number of times
+ & ntype !< number of types of aerosol
+
+ LOGICAL, INTENT(in) :: l_use_array_cache
+
+ INTEGER(KIND=i4) :: errorcode !< error status variable
+
+ errorcode = 0
+
+ CALL logging%info('Enter routine: allocate_aot_target_fields')
+
+ IF (l_use_array_cache) then
+ CALL allocate_cached('aot_tg', aot_tg, [tg%ie,tg%je,tg%ke,ntype,ntime])
+ ELSE
+ ALLOCATE(aot_tg(tg%ie,tg%je,tg%ke,ntype,ntime), stat=errorcode)
+ ENDIF
+ IF(errorcode /= 0) CALL logging%error('Cant allocate the array aot_tg',__FILE__,__LINE__)
+ aot_tg = 0.0_wp
+
+ CALL logging%info('Exit routine: allocate_aot_target_fields')
+
+ END SUBROUTINE allocate_aot_target_fields
SUBROUTINE allocate_art_target_fields(tg, l_use_array_cache)
TYPE(target_grid_def), INTENT(IN) :: tg !< structure with target grid description
diff --git a/src/mo_var_meta_data.f90 b/src/mo_var_meta_data.f90
index 8bd42a6a2..17de4fb20 100644
--- a/src/mo_var_meta_data.f90
+++ b/src/mo_var_meta_data.f90
@@ -54,12 +54,10 @@ MODULE mo_var_meta_data
& icosahedral_triangular_grid
USE mo_topo_data, ONLY: itype_scaling
- USE mo_python_data, ONLY: iera_type, isa_type, iahf_type
+ USE mo_python_data, ONLY: iera_type, isa_type, iahf_type, iaot_type
USE mo_terra_urb, ONLY: l_terra_urb, terra_urb_def_fields_meta
- USE mo_aot_data, ONLY : iaot_type
-
IMPLICIT NONE
PRIVATE
@@ -172,7 +170,7 @@ MODULE mo_var_meta_data
& alb_dry_meta, alb_sat_meta, &
! art
- & dim_art_tg, def_hwsd_art_meta, art_clon_meta, art_clat_meta, &
+ & dim_art_tg, def_art_meta, art_clon_meta, art_clat_meta, &
& art_hcla_meta, art_silc_meta, art_lcla_meta, &
& art_sicl_meta, art_cloa_meta, art_silt_meta, &
& art_silo_meta, art_scla_meta, art_loam_meta, &
@@ -984,7 +982,7 @@ SUBROUTINE def_isa_fields_meta(diminfo,coordinates,grid_mapping)
END SUBROUTINE def_isa_fields_meta
!> define meta information for landuse target fields
- SUBROUTINE def_hwsd_art_meta(diminfo,coordinates,grid_mapping)
+ SUBROUTINE def_art_meta(diminfo,coordinates,grid_mapping)
TYPE(dim_meta_info),TARGET :: diminfo(:) !< pointer to dimensions of variable
@@ -1212,7 +1210,7 @@ SUBROUTINE def_hwsd_art_meta(diminfo,coordinates,grid_mapping)
art_hcla_meta%coordinates = coord
art_hcla_meta%data_set = 'HWSD Digital Soil Map of the World'
- END SUBROUTINE def_hwsd_art_meta
+ END SUBROUTINE def_art_meta
!> define meta information for NDVI data for netcdf output
SUBROUTINE def_ndvi_meta(ntime,diminfo,coordinates,grid_mapping)
diff --git a/templates/INPUT_AOT b/templates/INPUT_AOT
deleted file mode 100644
index 905e53ce7..000000000
--- a/templates/INPUT_AOT
+++ /dev/null
@@ -1,8 +0,0 @@
-&aerosol_raw_data
- iaot_type = @IAOT_TYPE@
- raw_data_aot_path = '@RAW_DATA_AOT_PATH@'
- raw_data_aot_filename = '@RAW_DATA_AOT_FILENAME@'
-/
-&aerosol_io_extpar
- aot_buffer_file = '@AOT_BUFFER_FILE@'
-/
diff --git a/templates/namelist b/templates/namelist
index c21591e86..2b5e7784e 100644
--- a/templates/namelist
+++ b/templates/namelist
@@ -68,6 +68,13 @@ input_edgar = {
'edgar_buffer_file': '@EDGAR_BUFFER_FILE@',
}
+input_aot = {
+ 'iaot_type': @IAOT_TYPE@,
+ 'raw_data_aot_path': '@RAW_DATA_AOT_PATH@',
+ 'raw_data_aot_filename': '@RAW_DATA_AOT_FILENAME@',
+ 'aot_buffer_file': '@AOT_BUFFER_FILE@'
+}
+
input_art = {
'raw_data_art_path': '@RAW_DATA_ART_PATH@',
'raw_data_art_filename': '@RAW_DATA_ART_FILENAME@',
diff --git a/test/pytest/test_wrap_extpar.py b/test/pytest/test_wrap_extpar.py
index 6c96ae04c..a476c30a4 100644
--- a/test/pytest/test_wrap_extpar.py
+++ b/test/pytest/test_wrap_extpar.py
@@ -252,7 +252,7 @@ def test_setup_runscript_with_urban_cosmo():
os.path.join(os.getcwd(), 'lib'),
'extpar_executables': [
'"extpar_landuse_to_buffer.exe" ', '"extpar_topo_to_buffer.exe" ',
- '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.exe" ',
+ '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.py" ',
'"extpar_flake_to_buffer.exe" ', '"extpar_soil_to_buffer.exe" ',
'"extpar_alb_to_buffer.py" ', '"extpar_ndvi_to_buffer.py" ',
'"extpar_ahf_to_buffer.py" ', '"extpar_isa_to_buffer.py" ',
@@ -278,7 +278,7 @@ def test_setup_runscript_without_urban_icon():
os.path.join(os.getcwd(), 'lib'),
'extpar_executables': [
'"extpar_landuse_to_buffer.exe" ', '"extpar_topo_to_buffer.exe" ',
- '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.exe" ',
+ '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.py" ',
'"extpar_flake_to_buffer.exe" ', '"extpar_soil_to_buffer.exe" ',
'"extpar_alb_to_buffer.py" ', '"extpar_ndvi_to_buffer.py" ',
'"extpar_era_to_buffer.py" ', '"extpar_emiss_to_buffer.py" ',
@@ -304,7 +304,7 @@ def test_setup_runscript_without_urban_with_edgar_and_cdnc_icon():
os.path.join(os.getcwd(), 'lib'),
'extpar_executables': [
'"extpar_landuse_to_buffer.exe" ', '"extpar_topo_to_buffer.exe" ',
- '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.exe" ',
+ '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.py" ',
'"extpar_flake_to_buffer.exe" ', '"extpar_soil_to_buffer.exe" ',
'"extpar_alb_to_buffer.py" ', '"extpar_ndvi_to_buffer.py" ',
'"extpar_era_to_buffer.py" ', '"extpar_emiss_to_buffer.py" ',
@@ -331,7 +331,7 @@ def test_setup_runscript_with_art_icon():
os.path.join(os.getcwd(), 'lib'),
'extpar_executables': [
'"extpar_landuse_to_buffer.exe" ', '"extpar_topo_to_buffer.exe" ',
- '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.exe" ',
+ '"extpar_cru_to_buffer.py" ', '"extpar_aot_to_buffer.py" ',
'"extpar_flake_to_buffer.exe" ', '"extpar_soil_to_buffer.exe" ',
'"extpar_alb_to_buffer.py" ', '"extpar_ndvi_to_buffer.py" ',
'"extpar_era_to_buffer.py" ', '"extpar_emiss_to_buffer.py" ',
diff --git a/test/testsuite/bin/run_extpar_cosmo.sh b/test/testsuite/bin/run_extpar_cosmo.sh
index 5487c8766..2cbdfb588 100755
--- a/test/testsuite/bin/run_extpar_cosmo.sh
+++ b/test/testsuite/bin/run_extpar_cosmo.sh
@@ -59,11 +59,11 @@ binary_ndvi=extpar_ndvi_to_buffer.py
binary_tclim=extpar_cru_to_buffer.py
binary_ahf=extpar_ahf_to_buffer.py
binary_isa=extpar_isa_to_buffer.py
+binary_aot=extpar_aot_to_buffer.py
# fortran executables
binary_lu=extpar_landuse_to_buffer.exe
binary_topo=extpar_topo_to_buffer.exe
-binary_aot=extpar_aot_to_buffer.exe
binary_soil=extpar_soil_to_buffer.exe
binary_flake=extpar_flake_to_buffer.exe
binary_consistency_check=extpar_consistency_check.exe
diff --git a/test/testsuite/bin/run_extpar_icon.sh b/test/testsuite/bin/run_extpar_icon.sh
index 3b35587d7..327274419 100755
--- a/test/testsuite/bin/run_extpar_icon.sh
+++ b/test/testsuite/bin/run_extpar_icon.sh
@@ -62,12 +62,12 @@ binary_isa=extpar_isa_to_buffer.py
binary_ahf=extpar_ahf_to_buffer.py
binary_edgar=extpar_edgar_to_buffer.py
binary_cdnc=extpar_cdnc_to_buffer.py
+binary_aot=extpar_aot_to_buffer.py
binary_art=extpar_art_to_buffer.py
# fortran executables
binary_lu=extpar_landuse_to_buffer.exe
binary_topo=extpar_topo_to_buffer.exe
-binary_aot=extpar_aot_to_buffer.exe
binary_soil=extpar_soil_to_buffer.exe
binary_flake=extpar_flake_to_buffer.exe
binary_consistency_check=extpar_consistency_check.exe
diff --git a/test/testsuite/data/clm/12km_globe/INPUT_AOT b/test/testsuite/data/clm/12km_globe/INPUT_AOT
deleted file mode 100644
index bd2c49eff..000000000
--- a/test/testsuite/data/clm/12km_globe/INPUT_AOT
+++ /dev/null
@@ -1,8 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path='',
- raw_data_aot_filename='aod_AeroCom1.nc'
- iaot_type=2
-/
-&aerosol_io_extpar
- aot_buffer_file='extpar_buffer_aot.nc',
-/
diff --git a/test/testsuite/data/clm/12km_globe/namelist.py b/test/testsuite/data/clm/12km_globe/namelist.py
index 97118ec7d..844178795 100644
--- a/test/testsuite/data/clm/12km_globe/namelist.py
+++ b/test/testsuite/data/clm/12km_globe/namelist.py
@@ -20,3 +20,10 @@
'raw_data_ndvi_filename': 'NDVI_1998_2003.nc',
'ndvi_buffer_file': 'ndvi_buffer.nc'
}
+
+input_aot = {
+ 'iaot_type': 2,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aod_AeroCom1.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/clm/ecoclimap_sg/INPUT_AOT b/test/testsuite/data/clm/ecoclimap_sg/INPUT_AOT
deleted file mode 100644
index 9dc7433e1..000000000
--- a/test/testsuite/data/clm/ecoclimap_sg/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path = './'
- raw_data_aot_filename = 'aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file = 'extpar_aot_BUFFER.nc'
-/
diff --git a/test/testsuite/data/clm/ecoclimap_sg/namelist.py b/test/testsuite/data/clm/ecoclimap_sg/namelist.py
index bec7cf9da..b2000e472 100644
--- a/test/testsuite/data/clm/ecoclimap_sg/namelist.py
+++ b/test/testsuite/data/clm/ecoclimap_sg/namelist.py
@@ -29,3 +29,10 @@
'raw_data_era_SD': 'ERA-I_SD_1986_2015.nc',
'era_buffer_file': 'era_buffer.nc',
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/clm/ecoclimap_sg/tolerances b/test/testsuite/data/clm/ecoclimap_sg/tolerances
index dd8e83bae..4b9888c48 100644
--- a/test/testsuite/data/clm/ecoclimap_sg/tolerances
+++ b/test/testsuite/data/clm/ecoclimap_sg/tolerances
@@ -11,3 +11,4 @@ W_SNOW, 6.0e-07
T_2M_CLIM, 8.0e-05
TOPO_CLIM, 9.0e-04
T_SEA, 6.0e-05
+AER_SO4, 4.0e-08
diff --git a/test/testsuite/data/dwd/icon_d2/INPUT_AOT b/test/testsuite/data/dwd/icon_d2/INPUT_AOT
deleted file mode 100644
index 114c63bdd..000000000
--- a/test/testsuite/data/dwd/icon_d2/INPUT_AOT
+++ /dev/null
@@ -1,8 +0,0 @@
-&aerosol_raw_data
- iaot_type=1,
- raw_data_aot_path = './'
- raw_data_aot_filename = 'aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file = 'extpar_aot_BUFFER.nc'
-/
diff --git a/test/testsuite/data/dwd/icon_d2/namelist.py b/test/testsuite/data/dwd/icon_d2/namelist.py
index 000773e62..49b3134d1 100644
--- a/test/testsuite/data/dwd/icon_d2/namelist.py
+++ b/test/testsuite/data/dwd/icon_d2/namelist.py
@@ -30,3 +30,10 @@
'raw_data_era_SD': 'ERA5_SD_1990_2019.nc',
'era_buffer_file': 'era_buffer.nc',
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/dwd/icon_ecci/INPUT_AOT b/test/testsuite/data/dwd/icon_ecci/INPUT_AOT
deleted file mode 100644
index 9dc7433e1..000000000
--- a/test/testsuite/data/dwd/icon_ecci/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path = './'
- raw_data_aot_filename = 'aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file = 'extpar_aot_BUFFER.nc'
-/
diff --git a/test/testsuite/data/dwd/icon_ecci/namelist.py b/test/testsuite/data/dwd/icon_ecci/namelist.py
index 46a7ce787..b7002180c 100644
--- a/test/testsuite/data/dwd/icon_ecci/namelist.py
+++ b/test/testsuite/data/dwd/icon_ecci/namelist.py
@@ -27,6 +27,12 @@
'cdnc_buffer_file': 'cdnc_buffer.nc',
}
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
input_art = {
'raw_data_art_path': '',
'raw_data_art_filename': 'HWSD0_USDA.nc',
diff --git a/test/testsuite/data/dwd/icon_ecci/tolerances b/test/testsuite/data/dwd/icon_ecci/tolerances
index 1c6908f9f..282a7f2a6 100644
--- a/test/testsuite/data/dwd/icon_ecci/tolerances
+++ b/test/testsuite/data/dwd/icon_ecci/tolerances
@@ -8,3 +8,4 @@ T_CL, 4.0e-05
ALUVD, 9.0e-06
ALNID, 9.0e-06
cdnc, 7.0e-05
+AER_SO4, 4.0e-08
\ No newline at end of file
diff --git a/test/testsuite/data/ecmwf/corine_icon/INPUT_AOT b/test/testsuite/data/ecmwf/corine_icon/INPUT_AOT
deleted file mode 100644
index 9dc7433e1..000000000
--- a/test/testsuite/data/ecmwf/corine_icon/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path = './'
- raw_data_aot_filename = 'aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file = 'extpar_aot_BUFFER.nc'
-/
diff --git a/test/testsuite/data/ecmwf/corine_icon/namelist.py b/test/testsuite/data/ecmwf/corine_icon/namelist.py
index a9bd17978..4e806861d 100644
--- a/test/testsuite/data/ecmwf/corine_icon/namelist.py
+++ b/test/testsuite/data/ecmwf/corine_icon/namelist.py
@@ -41,3 +41,10 @@
'raw_data_ahf_filename': 'AHF_2006_NOAA_30sec_lonlat.nc',
'ahf_buffer_file': 'ahf_buffer.nc'
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/mch/c1_aster/INPUT_AOT b/test/testsuite/data/mch/c1_aster/INPUT_AOT
deleted file mode 100644
index 45928052d..000000000
--- a/test/testsuite/data/mch/c1_aster/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path='',
- raw_data_aot_filename='aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file='extpar_buffer_aot.nc',
-/
diff --git a/test/testsuite/data/mch/c1_aster/namelist.py b/test/testsuite/data/mch/c1_aster/namelist.py
index 5d8e95c0d..28c84c53c 100644
--- a/test/testsuite/data/mch/c1_aster/namelist.py
+++ b/test/testsuite/data/mch/c1_aster/namelist.py
@@ -20,3 +20,10 @@
'raw_data_ndvi_filename': 'NDVI_1998_2003.nc',
'ndvi_buffer_file': 'ndvi_buffer.nc'
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/mch/c7_globe/INPUT_AOT b/test/testsuite/data/mch/c7_globe/INPUT_AOT
deleted file mode 100644
index 45928052d..000000000
--- a/test/testsuite/data/mch/c7_globe/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path='',
- raw_data_aot_filename='aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file='extpar_buffer_aot.nc',
-/
diff --git a/test/testsuite/data/mch/c7_globe/namelist.py b/test/testsuite/data/mch/c7_globe/namelist.py
index d7b94f004..7ee8b2630 100644
--- a/test/testsuite/data/mch/c7_globe/namelist.py
+++ b/test/testsuite/data/mch/c7_globe/namelist.py
@@ -34,3 +34,10 @@
'raw_data_ahf_filename': 'AHF_2006_2.5min_lonlat.nc',
'ahf_buffer_file': 'ahf_buffer.nc'
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}
diff --git a/test/testsuite/data/mpim/icon_r2b4/INPUT_AOT b/test/testsuite/data/mpim/icon_r2b4/INPUT_AOT
deleted file mode 100644
index 9dc7433e1..000000000
--- a/test/testsuite/data/mpim/icon_r2b4/INPUT_AOT
+++ /dev/null
@@ -1,7 +0,0 @@
-&aerosol_raw_data
- raw_data_aot_path = './'
- raw_data_aot_filename = 'aot_GACP.nc'
-/
-&aerosol_io_extpar
- aot_buffer_file = 'extpar_aot_BUFFER.nc'
-/
diff --git a/test/testsuite/data/mpim/icon_r2b4/namelist.py b/test/testsuite/data/mpim/icon_r2b4/namelist.py
index ec7faf413..9368f1323 100644
--- a/test/testsuite/data/mpim/icon_r2b4/namelist.py
+++ b/test/testsuite/data/mpim/icon_r2b4/namelist.py
@@ -37,3 +37,10 @@
'raw_data_edgar_filename_nh3': 'v8.1_FT2022_AP_NH3_2022_TOTALS_flx.nc',
'edgar_buffer_file': 'edgar_buffer.nc',
}
+
+input_aot = {
+ 'iaot_type': 1,
+ 'raw_data_aot_path': '',
+ 'raw_data_aot_filename': 'aot_GACP.nc',
+ 'aot_buffer_file': 'aot_buffer.nc'
+}