From b9446b0755096099d0011622429ee1ba80db43e2 Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Tue, 18 Mar 2025 15:38:08 +0100 Subject: [PATCH 01/18] Added Python version of aot_to_buffer --- python/extpar_aot_to_buffer.py | 209 +++++++++++++++++++++++++++++++++ python/lib/buffer.py | 40 +++++++ python/lib/fortran_namelist.py | 12 ++ python/lib/metadata.py | 30 +++++ python/lib/utilities.py | 19 +++ 5 files changed, 310 insertions(+) create mode 100755 python/extpar_aot_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..6dd01da22 --- /dev/null +++ b/python/extpar_aot_to_buffer.py @@ -0,0 +1,209 @@ +#!/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}', + tg.cdo_sellonlat(), 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}', + tg.cdo_sellonlat(), 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) +aerosols_names=['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt'] + +for i in range(5): + type = aerosols_names[i] + aot[:, i, :, :, :] = np.reshape(aot_nc.variables[type][:, :], (12, ke_tot, je_tot, ie_tot)) + +print(aot) +# aot = np.reshape(aot_nc.variables['aot'][:], (1, 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 14c57ba18..ae0d297fb 100644 --- a/python/lib/buffer.py +++ b/python/lib/buffer.py @@ -55,6 +55,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 @@ -99,6 +109,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,' @@ -155,3 +169,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 67df07174..6464a90cd 100644 --- a/python/lib/fortran_namelist.py +++ b/python/lib/fortran_namelist.py @@ -257,3 +257,15 @@ def __init__(self): self.variables = {'&isa_raw_data': {'isa_type'}} 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'}}) diff --git a/python/lib/metadata.py b/python/lib/metadata.py index d818ed607..2068cdccd 100644 --- a/python/lib/metadata.py +++ b/python/lib/metadata.py @@ -541,3 +541,33 @@ class Isa_10sec(IsaMeta): def __init__(self): super().__init__() self.long = 'European Environmental Agency 10sec' + + +#-------------------------------------------------------------------------- +#-------------------------------------------------------------------------- +# 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)' diff --git a/python/lib/utilities.py b/python/lib/utilities.py index fe4c7a707..c9ade2572 100644 --- a/python/lib/utilities.py +++ b/python/lib/utilities.py @@ -198,6 +198,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, From 393556fcaee082caf85d3ea7dc14de89e50838d7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 18 Mar 2025 14:39:34 +0000 Subject: [PATCH 02/18] GitHub Action: Apply Pep8-formatting --- python/extpar_aot_to_buffer.py | 5 +++-- python/lib/metadata.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/extpar_aot_to_buffer.py b/python/extpar_aot_to_buffer.py index 6dd01da22..d5447a82c 100755 --- a/python/extpar_aot_to_buffer.py +++ b/python/extpar_aot_to_buffer.py @@ -160,11 +160,12 @@ ke_tot = tg.ke_tot aot = np.empty((12, 5, ke_tot, je_tot, ie_tot), dtype=aot_meta.type) -aerosols_names=['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt'] +aerosols_names = ['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt'] for i in range(5): type = aerosols_names[i] - aot[:, i, :, :, :] = np.reshape(aot_nc.variables[type][:, :], (12, ke_tot, je_tot, ie_tot)) + aot[:, i, :, :, :] = np.reshape(aot_nc.variables[type][:, :], + (12, ke_tot, je_tot, ie_tot)) print(aot) # aot = np.reshape(aot_nc.variables['aot'][:], (1, ke_tot, je_tot, ie_tot)) diff --git a/python/lib/metadata.py b/python/lib/metadata.py index 2068cdccd..c567ac5cb 100644 --- a/python/lib/metadata.py +++ b/python/lib/metadata.py @@ -548,7 +548,6 @@ def __init__(self): # AOT - class AotMeta: def __init__(self): From cd83391be922d9bbe24fefc26698fafe0649ccfa Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Tue, 18 Mar 2025 16:39:34 +0100 Subject: [PATCH 03/18] Removed old Fortran files for AOT --- Makefile.in | 1 - src/extpar_aot_to_buffer.f90 | 235 ------------------------ src/extpar_consistency_check.f90 | 32 ++-- src/mo_agg_aot.f90 | 153 ---------------- src/mo_aot_data.f90 | 305 ------------------------------- src/mo_aot_output_nc.f90 | 271 --------------------------- src/mo_aot_target_fields.f90 | 72 -------- src/mo_extpar_output_nc.f90 | 6 +- src/mo_python_data.f90 | 12 +- src/mo_python_output_nc.f90 | 37 +++- src/mo_python_routines.f90 | 34 ++++ src/mo_python_tg_fields.f90 | 37 +++- src/mo_var_meta_data.f90 | 4 +- 13 files changed, 130 insertions(+), 1069 deletions(-) delete mode 100644 src/extpar_aot_to_buffer.f90 delete mode 100644 src/mo_agg_aot.f90 delete mode 100644 src/mo_aot_data.f90 delete mode 100644 src/mo_aot_output_nc.f90 delete mode 100644 src/mo_aot_target_fields.f90 diff --git a/Makefile.in b/Makefile.in index 6c996aaaa..7ef086b6a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,7 +111,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/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 9defd4e8b..7df0381ec 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, & @@ -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 @@ -308,7 +302,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, & @@ -319,7 +316,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 @@ -395,8 +393,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 @@ -628,8 +624,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 67e51a73a..c81ac880c 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, & 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 985337268..2ff05b620 100644 --- a/src/mo_python_output_nc.f90 +++ b/src/mo_python_output_nc.f90 @@ -54,7 +54,9 @@ MODULE mo_python_output_nc ! isa & def_isa_fields_meta, & & isa_field_meta, & - & isa_field_meta + ! aot + & def_aot_tg_meta, & + & aot_tg_meta IMPLICIT NONE @@ -79,7 +81,9 @@ MODULE mo_python_output_nc ! ahf & read_netcdf_buffer_ahf, & ! isa - & read_netcdf_buffer_isa + & read_netcdf_buffer_isa, & + ! aot + & read_netcdf_buffer_aot CONTAINS @@ -431,4 +435,33 @@ 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 + END MODULE mo_python_output_nc diff --git a/src/mo_python_routines.f90 b/src/mo_python_routines.f90 index cd94d5605..217ec0afd 100644 --- a/src/mo_python_routines.f90 +++ b/src/mo_python_routines.f90 @@ -456,6 +456,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 05bf5c5fe..563563558 100644 --- a/src/mo_python_tg_fields.f90 +++ b/src/mo_python_tg_fields.f90 @@ -46,7 +46,7 @@ MODULE mo_python_tg_fields & allocate_alb_target_fields, & & alb_interpol, & ! era - sst_field, & + & sst_field, & & wsnow_field, & & t2m_field, & & hsurf_field, & @@ -56,7 +56,10 @@ MODULE mo_python_tg_fields & ahf_field, & ! isa & allocate_isa_target_fields, & - & isa_field + & isa_field, & + ! aot + & allocate_aot_target_fields, & + & aot_tg REAL(KIND=wp), POINTER :: & @@ -97,7 +100,9 @@ MODULE mo_python_tg_fields ! ahf & ahf_field(:,:,:), & !< fields for artifical heat flux (12 months) ! isa - & isa_field(:,:,:) !< fraction land due to land use raw data + & isa_field(:,:,:), & !< fraction land due to land use raw data + ! aot + & aot_tg(:,:,:,:,:) !< aerosol optical thickness, aot_tg(ie,je,ke,ntype,ntime) TYPE(var_meta_info) :: meta_crutemp, meta_cruelev @@ -536,4 +541,30 @@ 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 + END MODULE mo_python_tg_fields diff --git a/src/mo_var_meta_data.f90 b/src/mo_var_meta_data.f90 index 786c4c1d0..66defd21c 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 From a7aac44fca7137ebf5ac77a3ebe2b61c77e0e2bf Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Tue, 18 Mar 2025 17:13:55 +0100 Subject: [PATCH 04/18] Replace INPUT_AOT with namelist.py --- .gitignore | 4 +++- Makefile.in | 3 ++- python/WrapExtpar.py | 4 ++-- templates/INPUT_AOT | 8 -------- templates/namelist | 7 +++++++ test/pytest/test_wrap_extpar.py | 6 +++--- test/testsuite/bin/run_extpar_cosmo.sh | 2 +- test/testsuite/bin/run_extpar_icon.sh | 2 +- test/testsuite/data/clm/12km_globe/INPUT_AOT | 8 -------- test/testsuite/data/clm/12km_globe/namelist.py | 7 +++++++ test/testsuite/data/clm/ecoclimap_sg/INPUT_AOT | 7 ------- test/testsuite/data/clm/ecoclimap_sg/namelist.py | 7 +++++++ test/testsuite/data/dwd/icon_d2/INPUT_AOT | 8 -------- test/testsuite/data/dwd/icon_d2/namelist.py | 7 +++++++ test/testsuite/data/dwd/icon_ecci/INPUT_AOT | 7 ------- test/testsuite/data/dwd/icon_ecci/namelist.py | 7 +++++++ test/testsuite/data/ecmwf/corine_icon/INPUT_AOT | 7 ------- test/testsuite/data/ecmwf/corine_icon/namelist.py | 7 +++++++ test/testsuite/data/mch/c1_aster/INPUT_AOT | 7 ------- test/testsuite/data/mch/c1_aster/namelist.py | 7 +++++++ test/testsuite/data/mch/c7_globe/INPUT_AOT | 7 ------- test/testsuite/data/mch/c7_globe/namelist.py | 7 +++++++ test/testsuite/data/mpim/icon_r2b4/INPUT_AOT | 7 ------- test/testsuite/data/mpim/icon_r2b4/namelist.py | 7 +++++++ 24 files changed, 75 insertions(+), 75 deletions(-) delete mode 100644 templates/INPUT_AOT delete mode 100644 test/testsuite/data/clm/12km_globe/INPUT_AOT delete mode 100644 test/testsuite/data/clm/ecoclimap_sg/INPUT_AOT delete mode 100644 test/testsuite/data/dwd/icon_d2/INPUT_AOT delete mode 100644 test/testsuite/data/dwd/icon_ecci/INPUT_AOT delete mode 100644 test/testsuite/data/ecmwf/corine_icon/INPUT_AOT delete mode 100644 test/testsuite/data/mch/c1_aster/INPUT_AOT delete mode 100644 test/testsuite/data/mch/c7_globe/INPUT_AOT delete mode 100644 test/testsuite/data/mpim/icon_r2b4/INPUT_AOT diff --git a/.gitignore b/.gitignore index 867b0fde3..b3230e6e8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ modules.env # Build stage files: *.o /bin/extpar_alb_to_buffer.py -/bin/extpar_aot_to_buffer.exe +/bin/extpar_aot_to_buffer.py /bin/extpar_consistency_check.exe /bin/extpar_cru_to_buffer.py /bin/extpar_emiss_to_buffer.py @@ -27,6 +27,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 7ef086b6a..26b5be329 100644 --- a/Makefile.in +++ b/Makefile.in @@ -84,7 +84,8 @@ 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_isa_to_buffer.py + $(srcdir)/python/extpar_isa_to_buffer.py \ + $(srcdir)/python/extpar_aot_to_buffer.py # Dependency files: dep_files:= $(addsuffix .d,$(f90_files) $(c_files)) diff --git a/python/WrapExtpar.py b/python/WrapExtpar.py index 87efc0676..25c1e110f 100755 --- a/python/WrapExtpar.py +++ b/python/WrapExtpar.py @@ -195,7 +195,7 @@ 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_LU', 'INPUT_FLAKE', 'INPUT_SCALE_SEP', 'INPUT_SOIL', 'INPUT_CHECK', 'namelist' ] @@ -734,7 +734,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/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 e00cc0cf7..06621fccf 100644 --- a/templates/namelist +++ b/templates/namelist @@ -67,3 +67,10 @@ input_edgar = { 'raw_data_edgar_filename_nh3': '@RAW_DATA_EDGAR_FILENAME_NH3@', '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@' +} diff --git a/test/pytest/test_wrap_extpar.py b/test/pytest/test_wrap_extpar.py index 7f07ee36a..888dbea6a 100644 --- a/test/pytest/test_wrap_extpar.py +++ b/test/pytest/test_wrap_extpar.py @@ -238,7 +238,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" ', @@ -263,7 +263,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" ', @@ -288,7 +288,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" ', 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 a1e60443c..a63ca62ce 100755 --- a/test/testsuite/bin/run_extpar_icon.sh +++ b/test/testsuite/bin/run_extpar_icon.sh @@ -62,11 +62,11 @@ 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 # 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_hwsd=extpar_hwsdART_to_buffer.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..b155e5d03 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': 'aod_GACP.nc', + 'aot_buffer_file': 'aot_buffer.nc' +} 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 56de10557..b481cdb89 100644 --- a/test/testsuite/data/dwd/icon_ecci/namelist.py +++ b/test/testsuite/data/dwd/icon_ecci/namelist.py @@ -26,3 +26,10 @@ 'raw_data_cdnc_filename': 'modis_cdnc_climatology_Q06.nc', 'cdnc_buffer_file': 'cdnc_buffer.nc', } + +input_aot = { + 'iaot_type': 1, + 'raw_data_aot_path': '', + 'raw_data_aot_filename': 'aod_GACP.nc', + 'aot_buffer_file': 'aot_buffer.nc' +} 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..676f0bb33 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': 'aod_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..ecabe6c3a 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': 'aod_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..6a13a4950 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': 'aod_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..d7dc56888 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': 'aod_GACP.nc', + 'aot_buffer_file': 'aot_buffer.nc' +} From ef42bc0ceab5ddb35e3c640e65e005632044e194 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 18 Mar 2025 16:14:27 +0000 Subject: [PATCH 05/18] GitHub Action: Apply Pep8-formatting --- python/WrapExtpar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/WrapExtpar.py b/python/WrapExtpar.py index 25c1e110f..9df119567 100755 --- a/python/WrapExtpar.py +++ b/python/WrapExtpar.py @@ -195,8 +195,8 @@ def write_namelist(args, namelist): templates_dir = os.path.join(DATA_DIR, "templates") files = [ 'INPUT_ORO', 'INPUT_RADTOPO', 'INPUT_OROSMOOTH', 'INPUT_SGSL', - '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) From c5576191111ac542fa050c3a8d840c5277f9e033 Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Tue, 18 Mar 2025 17:28:13 +0100 Subject: [PATCH 06/18] Adapted configure.ac --- aclocal.m4 | 4 ++-- configure | 16 ++-------------- configure.ac | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) 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]) From f4883813c5515ed8e22cce960f4a583685290485 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Wed, 19 Mar 2025 09:09:45 +0100 Subject: [PATCH 07/18] fix typo --- test/testsuite/data/clm/ecoclimap_sg/namelist.py | 2 +- test/testsuite/data/dwd/icon_ecci/namelist.py | 2 +- test/testsuite/data/ecmwf/corine_icon/namelist.py | 2 +- test/testsuite/data/mch/c1_aster/namelist.py | 2 +- test/testsuite/data/mch/c7_globe/namelist.py | 2 +- test/testsuite/data/mpim/icon_r2b4/namelist.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testsuite/data/clm/ecoclimap_sg/namelist.py b/test/testsuite/data/clm/ecoclimap_sg/namelist.py index b155e5d03..b2000e472 100644 --- a/test/testsuite/data/clm/ecoclimap_sg/namelist.py +++ b/test/testsuite/data/clm/ecoclimap_sg/namelist.py @@ -33,6 +33,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } diff --git a/test/testsuite/data/dwd/icon_ecci/namelist.py b/test/testsuite/data/dwd/icon_ecci/namelist.py index b481cdb89..4722f180d 100644 --- a/test/testsuite/data/dwd/icon_ecci/namelist.py +++ b/test/testsuite/data/dwd/icon_ecci/namelist.py @@ -30,6 +30,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } diff --git a/test/testsuite/data/ecmwf/corine_icon/namelist.py b/test/testsuite/data/ecmwf/corine_icon/namelist.py index 676f0bb33..4e806861d 100644 --- a/test/testsuite/data/ecmwf/corine_icon/namelist.py +++ b/test/testsuite/data/ecmwf/corine_icon/namelist.py @@ -45,6 +45,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } diff --git a/test/testsuite/data/mch/c1_aster/namelist.py b/test/testsuite/data/mch/c1_aster/namelist.py index ecabe6c3a..28c84c53c 100644 --- a/test/testsuite/data/mch/c1_aster/namelist.py +++ b/test/testsuite/data/mch/c1_aster/namelist.py @@ -24,6 +24,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } diff --git a/test/testsuite/data/mch/c7_globe/namelist.py b/test/testsuite/data/mch/c7_globe/namelist.py index 6a13a4950..7ee8b2630 100644 --- a/test/testsuite/data/mch/c7_globe/namelist.py +++ b/test/testsuite/data/mch/c7_globe/namelist.py @@ -38,6 +38,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } diff --git a/test/testsuite/data/mpim/icon_r2b4/namelist.py b/test/testsuite/data/mpim/icon_r2b4/namelist.py index d7dc56888..9368f1323 100644 --- a/test/testsuite/data/mpim/icon_r2b4/namelist.py +++ b/test/testsuite/data/mpim/icon_r2b4/namelist.py @@ -41,6 +41,6 @@ input_aot = { 'iaot_type': 1, 'raw_data_aot_path': '', - 'raw_data_aot_filename': 'aod_GACP.nc', + 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc' } From aa86a2462b7754e079d09ae30bd8dc8f86029452 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Wed, 19 Mar 2025 11:13:47 +0100 Subject: [PATCH 08/18] omit tg.sellatlonbox, leads to artifacts --- python/extpar_aot_to_buffer.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/extpar_aot_to_buffer.py b/python/extpar_aot_to_buffer.py index d5447a82c..2645c7e47 100755 --- a/python/extpar_aot_to_buffer.py +++ b/python/extpar_aot_to_buffer.py @@ -125,12 +125,12 @@ # calculate weights utils.launch_shell('cdo', '-f', 'nc4', lock, '-P', omp, f'genbil,{grid}', - tg.cdo_sellonlat(), raw_data_aot, weights) + 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}', - tg.cdo_sellonlat(), raw_data_aot, aot_cdo) + raw_data_aot, aot_cdo) #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- @@ -167,9 +167,6 @@ aot[:, i, :, :, :] = np.reshape(aot_nc.variables[type][:, :], (12, ke_tot, je_tot, ie_tot)) -print(aot) -# aot = np.reshape(aot_nc.variables['aot'][:], (1, ke_tot, je_tot, ie_tot)) - #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- logging.info('') From 94d41e4c977d964d3977aee28803a70e834c3a48 Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Fri, 21 Mar 2025 16:36:53 +0100 Subject: [PATCH 09/18] Changed naming of variables --- python/extpar_aot_to_buffer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/extpar_aot_to_buffer.py b/python/extpar_aot_to_buffer.py index 2645c7e47..e141b4139 100755 --- a/python/extpar_aot_to_buffer.py +++ b/python/extpar_aot_to_buffer.py @@ -160,11 +160,11 @@ ke_tot = tg.ke_tot aot = np.empty((12, 5, ke_tot, je_tot, ie_tot), dtype=aot_meta.type) -aerosols_names = ['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt'] +aerosol_names = ['black_carbon', 'dust', 'organic', 'sulfate', 'sea_salt'] for i in range(5): - type = aerosols_names[i] - aot[:, i, :, :, :] = np.reshape(aot_nc.variables[type][:, :], + aerosol_name = aerosol_names[i] + aot[:, i, :, :, :] = np.reshape(aot_nc.variables[aerosol_name][:, :], (12, ke_tot, je_tot, ie_tot)) #-------------------------------------------------------------------------- From 9a687c6566da7f6bc9602fcbbd6873a9dc40343b Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Fri, 21 Mar 2025 17:40:34 +0100 Subject: [PATCH 10/18] Added input_aot in namelist_template.py --- python/lib/namelist_template.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/lib/namelist_template.py b/python/lib/namelist_template.py index 98cce9179..a29e8f327 100644 --- a/python/lib/namelist_template.py +++ b/python/lib/namelist_template.py @@ -91,3 +91,11 @@ 'raw_data_isa_filename': 'NOAA_ISA_CDO.nc', 'isa_buffer_file': 'isa_buffer.nc', } + +input_aot = { + 'iaot_type': 1, + 'raw_data_aot_path': '', + 'raw_data_aot_filename': 'aot_GACP.nc', + 'aot_buffer_file': 'aot_buffer.nc', +} + From d4dd4c40018581b877efb15694506369a8fe4abd Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Fri, 21 Mar 2025 18:34:08 +0100 Subject: [PATCH 11/18] Updated docs for AOT --- .../user_manual_03_fortran_modules.md | 80 ------------------- .../user_manual_04_python_modules.md | 53 +++++++++++- .../user_manual_06_namelist_input.md | 29 +++---- 3 files changed, 63 insertions(+), 99 deletions(-) diff --git a/docs/user_manual/user_manual_03_fortran_modules.md b/docs/user_manual/user_manual_03_fortran_modules.md index 60d03c2e0..f065e1f70 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 2ea7ab4ec..9315857b2 100644 --- a/docs/user_manual/user_manual_04_python_modules.md +++ b/docs/user_manual/user_manual_04_python_modules.md @@ -35,8 +35,9 @@ 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` and `input_edgar`. These dictionaries -replace their corresponding Fortran namelist files `INPUT_`. +`input_ahf`, `input_isa`, `input_edgar` and `input_aot`. These +dictionaries replace their corresponding Fortran namelist files +`INPUT_`. `input_alb` provides information about the albedo data type and the paths and filenames of the input/output data. @@ -65,6 +66,10 @@ input/output data. `input_edgar` only provides information about the the path and the filenames of the input/output data. +`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. + ## extpar_alb_to_buffer ----------------------- @@ -393,6 +398,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) + [^1]: [https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/rawdata/mksrf_soilcol.081008.nc :material-open-in-new:](https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/rawdata/mksrf_soilcol.081008.nc){:target="_blank"} diff --git a/docs/user_manual/user_manual_06_namelist_input.md b/docs/user_manual/user_manual_06_namelist_input.md index f0d65ebb8..c77c196e2 100644 --- a/docs/user_manual/user_manual_06_namelist_input.md +++ b/docs/user_manual/user_manual_06_namelist_input.md @@ -20,7 +20,7 @@ Whereas for the Fortran namelists and the Python dictionaries the user can speci | 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_AOT | settings for aerosol data | `extpar_aot_to_buffer` | `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` | @@ -192,22 +192,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,6 +236,17 @@ 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 | +| `isa_buffer_file` | character | | | name for AOT buffer file | + ## hwsdART Data ### NAMELIST `/hwsdART_nml/` (`INPUT_hwsdART`) From 594feb4d4c6dc2000086c1ba59ff21424b6f94ac Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 21 Mar 2025 17:34:41 +0000 Subject: [PATCH 12/18] GitHub Action: Apply Pep8-formatting --- python/lib/namelist_template.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/lib/namelist_template.py b/python/lib/namelist_template.py index a29e8f327..56defb38e 100644 --- a/python/lib/namelist_template.py +++ b/python/lib/namelist_template.py @@ -98,4 +98,3 @@ 'raw_data_aot_filename': 'aot_GACP.nc', 'aot_buffer_file': 'aot_buffer.nc', } - From 6a4e8247da8f0475d3dafde042b4afa158e7cdee Mon Sep 17 00:00:00 2001 From: stelliom <67868694+stelliom@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:07:54 +0100 Subject: [PATCH 13/18] Added tolerance for AER_SO4 --- test/testsuite/data/ecmwf/corine_icon/tolerances | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testsuite/data/ecmwf/corine_icon/tolerances b/test/testsuite/data/ecmwf/corine_icon/tolerances index 46e6be15f..40ebb3808 100644 --- a/test/testsuite/data/ecmwf/corine_icon/tolerances +++ b/test/testsuite/data/ecmwf/corine_icon/tolerances @@ -16,3 +16,4 @@ EMIS_RAD, 8.5e-07 FOR_D, 8.5e-07 LAI_MX, 8.5e-07 RSMIN, 8.5e-07 +AER_SO4, 4.0e-08 From 90d390699f5fe6a8039572aba019d16b7bed5743 Mon Sep 17 00:00:00 2001 From: Mikael Stellio Date: Tue, 25 Mar 2025 14:35:37 +0100 Subject: [PATCH 14/18] Updated tolerances for AER_SO4 only where needed --- test/testsuite/data/clm/ecoclimap_sg/tolerances | 1 + test/testsuite/data/dwd/icon_ecci/tolerances | 1 + test/testsuite/data/ecmwf/corine_icon/tolerances | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) 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_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/tolerances b/test/testsuite/data/ecmwf/corine_icon/tolerances index 40ebb3808..46e6be15f 100644 --- a/test/testsuite/data/ecmwf/corine_icon/tolerances +++ b/test/testsuite/data/ecmwf/corine_icon/tolerances @@ -16,4 +16,3 @@ EMIS_RAD, 8.5e-07 FOR_D, 8.5e-07 LAI_MX, 8.5e-07 RSMIN, 8.5e-07 -AER_SO4, 4.0e-08 From 3c3f3da9ea10263669a56e821764d9351aaee877 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 26 Mar 2025 09:26:36 +0000 Subject: [PATCH 15/18] GitHub Action: Apply Pep8-formatting --- python/lib/fortran_namelist.py | 2 ++ python/lib/metadata.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/python/lib/fortran_namelist.py b/python/lib/fortran_namelist.py index fa03a7395..58617a7f6 100644 --- a/python/lib/fortran_namelist.py +++ b/python/lib/fortran_namelist.py @@ -264,11 +264,13 @@ 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 476366ec8..97a95ea36 100644 --- a/python/lib/metadata.py +++ b/python/lib/metadata.py @@ -570,6 +570,8 @@ class AotAeroCom(AotMeta): def __init__(self): super().__init__() self.long = 'aerosol optical thickness; AeroCom1 (MPI_MET)' + + # art From b36067608111e796b6410d55d0601b7311267be0 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Wed, 26 Mar 2025 10:29:26 +0100 Subject: [PATCH 16/18] rename hwsd to art --- src/mo_extpar_output_nc.f90 | 2 +- src/mo_python_output_nc.f90 | 4 ++-- src/mo_var_meta_data.f90 | 6 +++--- test/pytest/test_wrap_extpar.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mo_extpar_output_nc.f90 b/src/mo_extpar_output_nc.f90 index bbd1fd343..0f832d89c 100644 --- a/src/mo_extpar_output_nc.f90 +++ b/src/mo_extpar_output_nc.f90 @@ -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_output_nc.f90 b/src/mo_python_output_nc.f90 index 8814a38dc..e5c4cc8c5 100644 --- a/src/mo_python_output_nc.f90 +++ b/src/mo_python_output_nc.f90 @@ -75,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 @@ -527,7 +527,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_var_meta_data.f90 b/src/mo_var_meta_data.f90 index 616e7e243..17de4fb20 100644 --- a/src/mo_var_meta_data.f90 +++ b/src/mo_var_meta_data.f90 @@ -170,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, & @@ -982,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 @@ -1210,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/test/pytest/test_wrap_extpar.py b/test/pytest/test_wrap_extpar.py index f1b529c93..a476c30a4 100644 --- a/test/pytest/test_wrap_extpar.py +++ b/test/pytest/test_wrap_extpar.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" ', From 8c67ca188bb1c7442ca2d32747eedf27e9fa96b2 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Wed, 26 Mar 2025 10:30:48 +0100 Subject: [PATCH 17/18] fix merge error --- src/mo_python_output_nc.f90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mo_python_output_nc.f90 b/src/mo_python_output_nc.f90 index e5c4cc8c5..bf184370b 100644 --- a/src/mo_python_output_nc.f90 +++ b/src/mo_python_output_nc.f90 @@ -101,13 +101,10 @@ MODULE mo_python_output_nc & read_netcdf_buffer_ahf, & ! isa & read_netcdf_buffer_isa, & -<<<<<<< HEAD ! aot & read_netcdf_buffer_aot, & -======= ! art & read_netcdf_buffer_art ->>>>>>> 81fd839084b1bcc1ac9ce4a1b516921d77c379ed CONTAINS From 2047e4f54bacad6ca0000a1cc908279c81b2f6f7 Mon Sep 17 00:00:00 2001 From: Jonas Jucker Date: Wed, 26 Mar 2025 10:34:17 +0100 Subject: [PATCH 18/18] fix another merge error --- src/mo_python_output_nc.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mo_python_output_nc.f90 b/src/mo_python_output_nc.f90 index bf184370b..9e051fc53 100644 --- a/src/mo_python_output_nc.f90 +++ b/src/mo_python_output_nc.f90 @@ -483,6 +483,7 @@ SUBROUTINE read_netcdf_buffer_aot(netcdf_filename, & 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, & @@ -499,6 +500,9 @@ SUBROUTINE read_netcdf_buffer_art(netcdf_filename, & & art_lsan, & & 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