!> @file src/inifor_types.f90
!------------------------------------------------------------------------------!
! This file is part of the PALM model system.
!
! PALM is free software: you can redistribute it and/or modify it under the
! terms of the GNU General Public License as published by the Free Software
! Foundation, either version 3 of the License, or (at your option) any later
! version.
!
! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
! A PARTICULAR PURPOSE. See the GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License along with
! PALM. If not, see .
!
! Copyright 2017-2018 Leibniz Universitaet Hannover
! Copyright 2017-2018 Deutscher Wetterdienst Offenbach
!------------------------------------------------------------------------------!
!
! Current revisions:
! -----------------
!
!
! Former revisions:
! -----------------
! $Id: inifor_types.f90 3447 2018-10-29 15:52:54Z forkel $
! Renamed source files for compatibilty with PALM build system
!
!
! 3395 2018-10-22 17:32:49Z eckhard
! Added *_is_set LOGICALs to inifor_config type to indicate option invocation
! from the command-line
! Added 1D index vertical weights lists to support addressing averaging regions
! by list of columns instead of index bounds
!
!
! 3183 2018-07-27 14:25:55Z suehring
! Introduced new PALM grid stretching:
! - Converted vertical grid_definition coordinte variables to pointers
! Improved command line interface:
! - Moved INIFOR configuration into a new derived data type
! Removed unnecessary variables
!
!
! 3182 2018-07-27 13:36:03Z suehring
! Initial revision
!
!
!
! Authors:
! --------
! @author Eckhard Kadasch
!
! Description:
! ------------
!> The types module provides derived data types used in INIFOR.
!------------------------------------------------------------------------------!
MODULE types
USE defs, &
ONLY: dp, DATE, PATH, SNAME, LNAME
USE netcdf, &
ONLY: NF90_MAX_VAR_DIMS, NF90_MAX_NAME
IMPLICIT NONE
TYPE inifor_config
CHARACTER(LEN=DATE) :: start_date !< String of the FORMAT YYYYMMDDHH indicating the start of the intended PALM-4U simulation
CHARACTER(LEN=PATH) :: input_path !< Path to the input data file directory
CHARACTER(LEN=PATH) :: hhl_file !< Path to the file containing the COSMO-DE HHL variable (height of half layers, i.e. vertical cell faces)
CHARACTER(LEN=PATH) :: namelist_file !< Path to the PALM-4U namelist file
CHARACTER(LEN=PATH) :: output_file !< Path to the INIFOR output file (i.e. PALM-4U dynamic driver')
CHARACTER(LEN=PATH) :: soiltyp_file !< Path to the file containing the COSMO-DE SOILTYP variable (map of COSMO-DE soil types)
CHARACTER(LEN=PATH) :: static_driver_file !< Path to the file containing the COSMO-DE SOILTYP variable (map of COSMO-DE soil types)
CHARACTER(LEN=SNAME) :: flow_prefix !< Prefix of flow input files, e.g. 'laf' for COSMO-DE analyses
CHARACTER(LEN=SNAME) :: input_prefix !< Prefix of all input files, e.g. 'laf' for COSMO-DE analyses
CHARACTER(LEN=SNAME) :: radiation_prefix !< Prefix of radiation input files, e.g 'laf' for COSMO-DE analyses
CHARACTER(LEN=SNAME) :: soil_prefix !< Prefix of soil input files, e.g. 'laf' for COSMO-DE analyses
CHARACTER(LEN=SNAME) :: soilmoisture_prefix !< Prefix of input files for soil moisture spin-up, e.g 'laf' for COSMO-DE analyses
CHARACTER(LEN=SNAME) :: averaging_mode
CHARACTER(LEN=SNAME) :: bc_mode
CHARACTER(LEN=SNAME) :: ic_mode
CHARACTER(LEN=SNAME) :: rotation_method
REAL(dp) :: p0
REAL(dp) :: ug
REAL(dp) :: vg
REAL(dp) :: z0 !< Elevation of the PALM-4U domain above sea level [m]
REAL(dp) :: averaging_angle !< latitudal and longitudal width of averaging regions [deg]
LOGICAL :: debug
LOGICAL :: p0_is_set
LOGICAL :: ug_is_set
LOGICAL :: vg_is_set
LOGICAL :: flow_prefix_is_set !<
LOGICAL :: input_prefix_is_set !<
LOGICAL :: radiation_prefix_is_set !<
LOGICAL :: soil_prefix_is_set !<
LOGICAL :: soilmoisture_prefix_is_set !<
END TYPE inifor_config
TYPE grid_definition
CHARACTER(LEN=SNAME) :: name(3) !< names of the grid dimensions, e.g. (/'x', 'y', 'z'/) or (/'latitude', 'longitude', 'height'/)
CHARACTER(LEN=SNAME) :: kind !< names of the grid dimensions, e.g. (/'x', 'y', 'z'/) or (/'latitude', 'longitude', 'height'/)
INTEGER :: k_min !< Index of lowest PALM grid level that is not cut by local COSMO orography; vertically separates interpolation and extrapolation region.
INTEGER :: nx !< number of gridpoints in the first dimension
INTEGER :: ny !< number of gridpoints in the second dimension
INTEGER :: nz !< number of gridpoints in the third dimension, used for PALM points
INTEGER :: nlev !< number of COSMO grid levels
INTEGER :: n_columns !< number of averaging columns of the source grid
INTEGER, ALLOCATABLE :: ii(:,:,:) !< Given a point (i,j,k) in the PALM-4U grid, ii(i,j,l) gives the x index of the l'th horizontl neighbour on the COSMO-DE grid.
INTEGER, ALLOCATABLE :: jj(:,:,:) !< Given a point (i,j,k) in the PALM-4U grid, jj(i,j,l) gives the y index of the l'th horizontl neighbour on the COSMO-DE grid.
INTEGER, ALLOCATABLE :: kk(:,:,:,:) !< Given a point (i,j,k) in the PALM-4U grid, kk(i,j,k,l) gives the z index of the l'th vertical neighbour in the intermediate grid.
INTEGER, ALLOCATABLE :: iii(:) !< profile averaging neighbour indices
INTEGER, ALLOCATABLE :: jjj(:) !< profile averaging neighbour indices
INTEGER, ALLOCATABLE :: kkk(:,:,:) !< indices of vertical interpolation neightbours, kkk(