Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions m_aps.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ MODULE m_aps
! Purpose : Defines grid dimensions.
!-------------------------------------------------------------------------------------------------------------------------------
TYPE TGridHeader
REAL*4 :: xorgl ! x-origin of the grid [km]
real :: xorgl ! x-origin of the grid [km]
! (origin is left-upper corner of grid)
REAL*4 :: yorgl ! y-origin of the grid [km]
real :: yorgl ! y-origin of the grid [km]
! (origin is left-upper corner of grid)
INTEGER*4 :: nrcol ! number of grid columns
INTEGER*4 :: nrrow ! number of grid rows
REAL*4 :: grixl ! horizontal size of grid cell [km]
REAL*4 :: griyl ! vertical size of grid cell [km]
real :: grixl ! horizontal size of grid cell [km]
real :: griyl ! vertical size of grid cell [km]
END TYPE TGridHeader

!-------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -81,8 +81,8 @@ MODULE m_aps
!-------------------------------------------------------------------------------------------------------------------------------
TYPE TApsGridReal
TYPE (TGridHeader) :: gridheader ! grid header
REAL*4, DIMENSION(:), POINTER :: average ! average of all grid values
REAL*4, DIMENSION(:,:,:), POINTER :: value ! 3D array with real values
real, DIMENSION(:), POINTER :: average ! average of all grid values
real, DIMENSION(:,:,:), POINTER :: value ! 3D array with real values
END TYPE TApsGridReal

!-------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -113,10 +113,10 @@ MODULE m_aps
! DESCRIPTION : Returns value of grid cell with input coordinates.
! If coordinates outside grid, the average value (real grid) or 0 (integer) grid is returned. A flag, which
! indicates whether coordinates were inside the grid, is also returned.
! INPUTS : x (real*4). RDM x-coordinate value (in km).
! y (real*4). RDM y-coordinate value (in km).
! INPUTS : x (real). RDM x-coordinate value (in km).
! y (real). RDM y-coordinate value (in km).
! grid (type TAPSGrid, generic) The aps grid definition.
! OUTPUTS : value (integer*4 or real*4, generic with grid type)
! OUTPUTS : value (integer*4 or real, generic with grid type)
! The value in the grid cell or the default value (in case of location outside grid)
! iscell (logical) Whether value comes from a grid cell.
!-------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -129,7 +129,7 @@ MODULE m_aps
! SUBROUTINE : SetAverage
! DESCRIPTION : Sets average field in aps grid structure. Average is calculated over all cells with value > 0. It is possible
! to multiply all values by a certain factor first.
! INPUTS : factor (real*4, optional). Multiplication factor.
! INPUTS : factor (real, optional). Multiplication factor.
! INPUT/OUTPUTS: grid (TApsGridReal). The field grid.average is adjusted.
!-------------------------------------------------------------------------------------------------------------------------------
INTERFACE SetAverage
Expand Down Expand Up @@ -176,8 +176,8 @@ SUBROUTINE read_aps_real(filename, gridtitle, floatgrid, error)
INTEGER*4 :: nrrow ! number of grid rows
INTEGER*4 :: ierr ! error status (ierr != 0 => error)
CHARACTER*1 :: teststring ! helpvariable
REAL*4 :: r ! helpvariable
REAL*4, DIMENSION(:,:), ALLOCATABLE :: helpgrid
real :: r ! helpvariable
real, DIMENSION(:,:), ALLOCATABLE :: helpgrid

! CONSTANTS
CHARACTER*512 :: ROUTINENAAM ! name of subroutine
Expand Down Expand Up @@ -509,7 +509,7 @@ SUBROUTINE set_average(factor, grid, fieldnumber)
USE m_commonconst ! EPS_DELTA only

! SUBROUTINE ARGUMENTS - INPUT
REAL*4, INTENT(IN), OPTIONAL :: factor ! multiplication factor for the whole grid
real, INTENT(IN), OPTIONAL :: factor ! multiplication factor for the whole grid

! SUBROUTINE ARGUMENTS - I/O
TYPE (TApsGridReal), INTENT(INOUT) :: grid ! real APS grid
Expand Down Expand Up @@ -549,8 +549,8 @@ SUBROUTINE grid_value_integer(x, y, grid, gridvalue, iscell, fieldnumber)
!DEC$ ATTRIBUTES DLLEXPORT:: grid_value_integer

! SUBROUTINE ARGUMENTS - INPUT
REAL*4, INTENT(IN) :: x ! RDM x-coordinate value (in km)
REAL*4, INTENT(IN) :: y ! RDM y-coordinate value (in km)
real, INTENT(IN) :: x ! RDM x-coordinate value (in km)
real, INTENT(IN) :: y ! RDM y-coordinate value (in km)
TYPE (TAPSGridInt), INTENT(IN) :: grid ! integer APS grid

! SUBROUTINE ARGUMENTS - OUTPUT
Expand Down Expand Up @@ -593,12 +593,12 @@ SUBROUTINE grid_value_real(x, y, grid, gridvalue, iscell, fieldnumber)
!DEC$ ATTRIBUTES DLLEXPORT:: grid_value_real

! SUBROUTINE ARGUMENTS - INPUT
REAL*4, INTENT(IN) :: x ! RDM x-coordinate value (in km)
REAL*4, INTENT(IN) :: y ! RDM y-coordinate value (in km)
real, INTENT(IN) :: x ! RDM x-coordinate value (in km)
real, INTENT(IN) :: y ! RDM y-coordinate value (in km)
TYPE (TAPSGridReal), INTENT(IN) :: grid ! real APS grid

! SUBROUTINE ARGUMENTS - OUTPUT
REAL*4, INTENT(OUT) :: gridvalue ! the value in the grid cell or the default value
real, INTENT(OUT) :: gridvalue ! the value in the grid cell or the default value
! (in case of location outside grid)
LOGICAL, INTENT(OUT) :: iscell ! whether value comes from a grid cell
INTEGER, OPTIONAL, INTENT(IN) :: fieldnumber ! fieldnumber to retreive data from
Expand Down Expand Up @@ -636,8 +636,8 @@ END SUBROUTINE grid_value_real
SUBROUTINE grid_cell_index(x, y, gridheader, m, n, iscell)

! SUBROUTINE ARGUMENTS - INPUT
REAL*4, INTENT(IN) :: x ! RDM x-coordinate [km]
REAL*4, INTENT(IN) :: y ! RDM y-coordinate [km]
real, INTENT(IN) :: x ! RDM x-coordinate [km]
real, INTENT(IN) :: y ! RDM y-coordinate [km]
TYPE (TGridHeader), INTENT(IN) :: gridheader ! Header definition of grid

! SUBROUTINE ARGUMENTS - OUTPUT
Expand Down
44 changes: 22 additions & 22 deletions m_commonconst.f90
Original file line number Diff line number Diff line change
Expand Up @@ -65,38 +65,38 @@ MODULE m_commonconst
INTEGER*4, PARAMETER :: ncolBuildingEffectTable = 5 ! 1st column corresponds to distance from building. 2-5 correspond to different building types

! CONSTANTS - overige
REAL*4 :: z0_FACT_NL = 10000. ! default factor for conversion of z0_nl gridvalue to meters
REAL*4 :: z0_FACT_EUR = 10000. ! default factor for conversion of z0_eur gridvalue to meters

REAL*4, PARAMETER :: zmet_T = 1.5 ! reference height for temperature measurements [m]
real :: z0_FACT_NL = 10000. ! default factor for conversion of z0_nl gridvalue to meters
real :: z0_FACT_EUR = 10000. ! default factor for conversion of z0_eur gridvalue to meters

INTEGER*4, PARAMETER :: IGEO = 0 ! 1 -> Geographical coordinates lon-lat [degrees]; 0 -> RDM coordinates [m]
real, PARAMETER :: zmet_T = 1.5 ! reference height for temperature measurements [m]

INTEGER*4, PARAMETER :: IGEO = 0 ! 1 -> Geographical coordinates lon-lat [degrees]; 0 -> RDM coordinates [m]
INTEGER*4, PARAMETER :: MISVALNUM = -9999 ! missing value
INTEGER*4, PARAMETER :: FIRSTYEAR = 1977 ! first year, used for interpolating background maps
INTEGER*4, PARAMETER :: FUTUREYEAR = 2020 ! future year, used for interpolating background maps
REAL*4 :: r4_for_tiny ! help variable to define EPS_DELTA
REAL*8 :: r8_for_tiny ! help variable to define DEPS_DELTA
REAL*4, PARAMETER :: EPS_DELTA = tiny(r4_for_tiny) ! tiny number (real)
REAL*8, PARAMETER :: DPEPS_DELTA = tiny(r8_for_tiny) ! tiny number (double precision)
REAL*4, PARAMETER :: HUMAX = 500. ! maximal plume height [m]
real :: r4_for_tiny ! help variable to define EPS_DELTA
double precision :: r8_for_tiny ! help variable to define DEPS_DELTA
real, PARAMETER :: EPS_DELTA = tiny(r4_for_tiny) ! tiny number (real)
double precision, PARAMETER :: DPEPS_DELTA = tiny(r8_for_tiny) ! tiny number (double precision)
real, PARAMETER :: HUMAX = 500. ! maximal plume height [m]
CHARACTER*8, PARAMETER :: MODVERSIE = '5.0.0.0' ! model version OPS-LT
CHARACTER*20, PARAMETER :: RELEASEDATE = '26 dec 2019' ! release date

!

! CONSTANTS - Data
!

INTEGER*4 :: NACHTZOMER(NSTAB, NTRAJ) ! relative occurrences (%) of nighttime hours in summer (for each stability class and distance class) ("NACHT" = night, "ZOMER" = summer)
INTEGER*4 :: NACHTWINTER(NSTAB, NTRAJ) ! relative occurrences (%) of nighttime hours in winter (for each stability class and distance class) ("NACHT" = night)
REAL*4 :: DISPH(NSTAB) ! coefficients for vertical dispersion coefficient sigma_z; sigma_z = dispg*x**disph
REAL*4 :: STOKES(NPARTCLASS) ! Sedimentation velocity (m/s) needed for plume descent in case of heavy particles, for each particle class
REAL*4 :: SCWINTER(NSTAB) ! variation in NO2/NOx ratio (relative to stability class S2) for each stability class (only in winter)
REAL*4 :: cf_so2(NBGMAPS) ! correction factors for the difference between model output and measurements for SO2
REAL*4 :: cf_nox(NBGMAPS) ! correction factors for the difference between model output and measurements for NOx
REAL*4 :: cf_nh3(NBGMAPS) ! correction factors for the difference between model output and measurements for NH3
REAL*4 :: tf_so2(NYEARS + 1) ! trendfactors for SO2: concentration in year T, relative to the concentration in reference year
REAL*4 :: tf_no2(NYEARS + 1) ! trendfactors for NO2: concentration in year T, relative to the concentration in reference year
REAL*4 :: tf_nh3(NYEARS + 1) ! trendfactors for NH3: concentration in year T, relative to the concentration in reference year
REAL*4 :: nox_no2_beta(2) ! coefficient in conversion NO2 = beta(1)*log(NOx) + beta(2)
real :: DISPH(NSTAB) ! coefficients for vertical dispersion coefficient sigma_z; sigma_z = dispg*x**disph
real :: STOKES(NPARTCLASS) ! Sedimentation velocity (m/s) needed for plume descent in case of heavy particles, for each particle class
real :: SCWINTER(NSTAB) ! variation in NO2/NOx ratio (relative to stability class S2) for each stability class (only in winter)
real :: cf_so2(NBGMAPS) ! correction factors for the difference between model output and measurements for SO2
real :: cf_nox(NBGMAPS) ! correction factors for the difference between model output and measurements for NOx
real :: cf_nh3(NBGMAPS) ! correction factors for the difference between model output and measurements for NH3
real :: tf_so2(NYEARS + 1) ! trendfactors for SO2: concentration in year T, relative to the concentration in reference year
real :: tf_no2(NYEARS + 1) ! trendfactors for NO2: concentration in year T, relative to the concentration in reference year
real :: tf_nh3(NYEARS + 1) ! trendfactors for NH3: concentration in year T, relative to the concentration in reference year
real :: nox_no2_beta(2) ! coefficient in conversion NO2 = beta(1)*log(NOx) + beta(2)
CHARACTER*10 :: CNAME(3,5) ! names of substances (primary, secondary, second secondary, deposited, name in DEPAC)
CHARACTER*10 :: CNAME_SUBSEC(4) ! names of sub-secondary species (HNO3, NO3_C, NO3_F)
CHARACTER*10 :: UNITS(2) ! units for concentration
Expand Down
Loading