Commit de7fa502 authored by Robert Schweppe's avatar Robert Schweppe

Merge branch 'develop' into 'master'

Develop

See merge request !25
parents f5ba4a8d f3670d83
# Multiscale parameter regionalization - MPR
- The current release is **[MPR 0.2](https://git.ufz.de/chs/MPR/tags/0.2)**.
- The current release is **[MPR 0.3](https://git.ufz.de/chs/MPR/tags/0.3)**.
- General information can be found on the [MPR website](http://www.ufz.de/index.php?en=40126).
**Please note:** The [GitLab repository](https://git.ufz.de/chs/MPR) grants read access to the code.
......
......@@ -6,7 +6,7 @@
[subrepo]
remote = git@git.ufz.de:chs/lightweight_fortran_lib.git
branch = master
commit = 570476ffee69c6a6f4a7a46226eb32a5640cb86e
parent = dd200c958a2877ea8b8c4af76ad5fca2ba6152db
commit = 495d0a5dee6c8d3dfe745d4eef134b8dc2df9ef9
parent = 42b1f6dab8ba2921319f80cf62536b33867ec8ea
method = merge
cmdver = 0.4.0
This diff is collapsed.
......@@ -9,7 +9,7 @@
!> \author Matthias Cuntz
!> \date Nov 2011
MODULE mo_constants
module mo_constants
! This module contains basic and derived constants
!
......@@ -36,135 +36,135 @@ MODULE mo_constants
! Copyright 2011-2014 Matthias Cuntz
USE mo_kind, ONLY : sp, dp, i4
use mo_kind, only : sp, dp, i4
use, intrinsic :: iso_fortran_env, only : input_unit, output_unit, error_unit
IMPLICIT NONE
implicit none
! Mathematical
!> Pi in double precision
REAL(dp), PARAMETER :: PI_dp = 3.141592653589793238462643383279502884197_dp ! Pi
real(dp), parameter :: PI_dp = 3.141592653589793238462643383279502884197_dp ! Pi
!> Pi in single precision
REAL(sp), PARAMETER :: PI_sp = 3.141592653589793238462643383279502884197_sp
real(sp), parameter :: PI_sp = 3.141592653589793238462643383279502884197_sp
!> Pi/2 in double precision
REAL(dp), PARAMETER :: PIO2_dp = 1.57079632679489661923132169163975144209858_dp ! Pi/2
real(dp), parameter :: PIO2_dp = 1.57079632679489661923132169163975144209858_dp ! Pi/2
!> Pi/2 in single precision
REAL(sp), PARAMETER :: PIO2_sp = 1.57079632679489661923132169163975144209858_sp
real(sp), parameter :: PIO2_sp = 1.57079632679489661923132169163975144209858_sp
!> 2*Pi in double precision
REAL(dp), PARAMETER :: TWOPI_dp = 6.283185307179586476925286766559005768394_dp ! 2*Pi
real(dp), parameter :: TWOPI_dp = 6.283185307179586476925286766559005768394_dp ! 2*Pi
!> 2*Pi in single precision
REAL(sp), PARAMETER :: TWOPI_sp = 6.283185307179586476925286766559005768394_sp
real(sp), parameter :: TWOPI_sp = 6.283185307179586476925286766559005768394_sp
!> Square root of 2 in double precision
REAL(dp), PARAMETER :: SQRT2_dp = 1.41421356237309504880168872420969807856967_dp ! Sqrt(2)
real(dp), parameter :: SQRT2_dp = 1.41421356237309504880168872420969807856967_dp ! Sqrt(2)
!> Square root of 2 in single precision
REAL(sp), PARAMETER :: SQRT2_sp = 1.41421356237309504880168872420969807856967_sp
real(sp), parameter :: SQRT2_sp = 1.41421356237309504880168872420969807856967_sp
!> 2/3 in double precision
REAL(dp), PARAMETER :: TWOTHIRD_dp = 0.6666666666666666666666666666666666667_dp ! 2/3
real(dp), parameter :: TWOTHIRD_dp = 0.6666666666666666666666666666666666667_dp ! 2/3
!> 2/3 in single precision
REAL(sp), PARAMETER :: TWOTHIRD_sp = 0.6666666666666666666666666666666666667_sp
real(sp), parameter :: TWOTHIRD_sp = 0.6666666666666666666666666666666666667_sp
!> degree to radian conversion (pi/180) in double precision
REAL(dp), PARAMETER :: deg2rad_dp = PI_dp / 180._dp ! deg2rad
real(dp), parameter :: deg2rad_dp = PI_dp / 180._dp ! deg2rad
!> degree to radian conversion (pi/180) in double precision
REAL(sp), PARAMETER :: deg2rad_sp = PI_sp / 180._sp
real(sp), parameter :: deg2rad_sp = PI_sp / 180._sp
!> radian to conversion (180/pi) in double precision
REAL(dp), PARAMETER :: rad2deg_dp = 180._dp / PI_dp ! rad2deg
real(dp), parameter :: rad2deg_dp = 180._dp / PI_dp ! rad2deg
!> radian to degree conversion (180/pi) in single precision
REAL(sp), PARAMETER :: rad2deg_sp = 180._sp / PI_sp
real(sp), parameter :: rad2deg_sp = 180._sp / PI_sp
!> Time conversion
!> Seconds per day [s] in single precision
REAL(sp), public, PARAMETER :: secday_sp = 86400.0_sp
REAL(dp), public, PARAMETER :: secday_dp = 86400.0_dp ! secday [s]
REAL(dp), public, parameter :: DayHours = 24.0_dp ! hours per day
real(sp), public, parameter :: secday_sp = 86400.0_sp
real(dp), public, parameter :: secday_dp = 86400.0_dp ! secday [s]
real(dp), public, parameter :: DayHours = 24.0_dp ! hours per day
real(dp), public, parameter :: YearMonths = 12.0_dp ! months per year
real(dp), public, parameter :: YearDays = 365.0_dp ! days in a year
real(dp), public, parameter :: DaySecs = 86400.0_dp ! sec in a day
real(dp), public, parameter :: HourSecs = 3600.0_dp ! seconds per hour
! Physical
!> Psychrometric constant [kPa K^-1] in double precision
REAL(dp), PARAMETER :: Psychro_dp = 0.0646_dp ! psychrometric constant [kPa C-1]
real(dp), parameter :: Psychro_dp = 0.0646_dp ! psychrometric constant [kPa C-1]
!> Psychrometric constant [kPa K^-1] in sibgle precision
REAL(sp), PARAMETER :: Psychro_sp = 0.0646_sp
real(sp), parameter :: Psychro_sp = 0.0646_sp
!> Gravity accelaration [m^2 s^-1] in double precision
REAL(dp), PARAMETER :: Gravity_dp = 9.81_dp ! Gravity acceleration [m^2/s]
real(dp), parameter :: Gravity_dp = 9.81_dp ! Gravity acceleration [m^2/s]
!> Gravity accelaration [m^2 s^-1] in single precision
REAL(sp), PARAMETER :: Gravity_sp = 9.81_sp
real(sp), parameter :: Gravity_sp = 9.81_sp
!> Solar constant in [J m^-2 s^-1] in double precision
REAL(dp), PARAMETER :: SolarConst_dp = 1367._dp ! Solar constant in [W m-2 = kg s-3]
real(dp), parameter :: SolarConst_dp = 1367._dp ! Solar constant in [W m-2 = kg s-3]
!> Solar constant in [J m^-2 s^-1] in single precision
REAL(sp), PARAMETER :: SolarConst_sp = 1367._sp
real(sp), parameter :: SolarConst_sp = 1367._sp
!> Specific heat for vaporization of water in [J m-2 mm-1] in double precision
REAL(dp), PARAMETER :: SpecHeatET_dp = 2.45e06_dp ! Specific heat in [W s m-2 mm-1 = kg s-2 mm-1]
real(dp), parameter :: SpecHeatET_dp = 2.45e06_dp ! Specific heat in [W s m-2 mm-1 = kg s-2 mm-1]
!> Specific heat for vaporization of water in [J m-2 mm-1] in single precision
REAL(sp), PARAMETER :: SpecHeatET_sp = 2.45e06_sp
real(sp), parameter :: SpecHeatET_sp = 2.45e06_sp
!> Standard temperature [K] in double precision
REAL(dp), PARAMETER :: T0_dp = 273.15_dp ! Celcius <-> Kelvin [K]
real(dp), parameter :: T0_dp = 273.15_dp ! Celcius <-> Kelvin [K]
!> Standard temperature [K] in single precision
REAL(sp), PARAMETER :: T0_sp = 273.15_sp
real(sp), parameter :: T0_sp = 273.15_sp
!> Stefan-Boltzmann constant [W m^-2 K^-4] in double precision
REAL(dp), PARAMETER :: sigma_dp = 5.67e-08_dp ! Stefan-Boltzmann constant [W/m^2/K^4]
real(dp), parameter :: sigma_dp = 5.67e-08_dp ! Stefan-Boltzmann constant [W/m^2/K^4]
!> Stefan-Boltzmann constant [W m^-2 K^-4] in single precision
REAL(sp), PARAMETER :: sigma_sp = 5.67e-08_sp
real(sp), parameter :: sigma_sp = 5.67e-08_sp
! Earth radius [m] in single precision
REAL(sp), PARAMETER :: RadiusEarth_sp = 6371228._sp
real(sp), parameter :: RadiusEarth_sp = 6371228._sp
! Earth radius [m] in double precision
REAL(dp), PARAMETER :: RadiusEarth_dp = 6371228._dp
real(dp), parameter :: RadiusEarth_dp = 6371228._dp
!> standard atmospehere
!> Standard pressure [Pa] in double precision
REAL(dp), PARAMETER :: P0_dp = 101325._dp ! Standard pressure [Pa]
real(dp), parameter :: P0_dp = 101325._dp ! Standard pressure [Pa]
!> Standard pressure [Pa] in single precision
REAL(sp), PARAMETER :: P0_sp = 101325._sp
real(sp), parameter :: P0_sp = 101325._sp
!> standard density [kg m^-3] in double precision
REAL(dp), PARAMETER :: rho0_dp = 1.225_dp ! Standard air density
real(dp), parameter :: rho0_dp = 1.225_dp ! Standard air density
!> standard density [kg m^-3] in single precision
REAL(sp), PARAMETER :: rho0_sp = 1.225_sp
real(sp), parameter :: rho0_sp = 1.225_sp
!> specific heat capacity of air [J kg^-1 K^-1] in double precision
REAL(dp), PARAMETER :: cp0_dp = 1005.0_dp ! Standard specific heat of air
real(dp), parameter :: cp0_dp = 1005.0_dp ! Standard specific heat of air
!> specific heat capacity of air [J kg^-1 K^-1] in single precision
REAL(sp), PARAMETER :: cp0_sp = 1005.0_sp
real(sp), parameter :: cp0_sp = 1005.0_sp
! Numerical Recipes
!> Pi in double precision
REAL(dp), PARAMETER :: PI_D = 3.141592653589793238462643383279502884197_dp ! Pi
real(dp), parameter :: PI_D = 3.141592653589793238462643383279502884197_dp ! Pi
!> Pi in single precision
REAL(sp), PARAMETER :: PI = 3.141592653589793238462643383279502884197_sp
real(sp), parameter :: PI = 3.141592653589793238462643383279502884197_sp
!> Pi/2 in double precision
REAL(dp), PARAMETER :: PIO2_D = 1.57079632679489661923132169163975144209858_dp ! Pi/2
real(dp), parameter :: PIO2_D = 1.57079632679489661923132169163975144209858_dp ! Pi/2
!> Pi/2 in single precision
REAL(sp), PARAMETER :: PIO2 = 1.57079632679489661923132169163975144209858_sp
real(sp), parameter :: PIO2 = 1.57079632679489661923132169163975144209858_sp
!> 2*Pi in double precision
REAL(dp), PARAMETER :: TWOPI_D = 6.283185307179586476925286766559005768394_dp ! 2*Pi
real(dp), parameter :: TWOPI_D = 6.283185307179586476925286766559005768394_dp ! 2*Pi
!> 2*Pi in single precision
REAL(sp), PARAMETER :: TWOPI = 6.283185307179586476925286766559005768394_sp
real(sp), parameter :: TWOPI = 6.283185307179586476925286766559005768394_sp
!> Square root of 2 in double precision
REAL(dp), PARAMETER :: SQRT2_D = 1.41421356237309504880168872420969807856967_dp ! Sqrt(2)
real(dp), parameter :: SQRT2_D = 1.41421356237309504880168872420969807856967_dp ! Sqrt(2)
!> Square root of 2 in single precision
REAL(sp), PARAMETER :: SQRT2 = 1.41421356237309504880168872420969807856967_sp
real(sp), parameter :: SQRT2 = 1.41421356237309504880168872420969807856967_sp
!> Euler''s constant in double precision
REAL(dp), PARAMETER :: EULER_D = 0.5772156649015328606065120900824024310422_dp ! Euler
real(dp), parameter :: EULER_D = 0.5772156649015328606065120900824024310422_dp ! Euler
!> Euler''s constant in single precision
REAL(sp), PARAMETER :: EULER = 0.5772156649015328606065120900824024310422_sp
real(sp), parameter :: EULER = 0.5772156649015328606065120900824024310422_sp
! Standard file units
!> Standard input file unit
! INTEGER, PARAMETER :: nin = 5 ! standard input stream
INTEGER, PARAMETER :: nin = input_unit ! standard input stream
! integer, parameter :: nin = 5 ! standard input stream
integer, parameter :: nin = input_unit ! standard input stream
!> Standard output file unit
! INTEGER, PARAMETER :: nout = 6 ! standard output stream
INTEGER, PARAMETER :: nout = output_unit ! standard output stream
! integer, parameter :: nout = 6 ! standard output stream
integer, parameter :: nout = output_unit ! standard output stream
!> Standard error file unit
! INTEGER, PARAMETER :: nerr = 0 ! error output stream
INTEGER, PARAMETER :: nerr = error_unit ! error output stream
! integer, parameter :: nerr = 0 ! error output stream
integer, parameter :: nerr = error_unit ! error output stream
!> Standard file unit for namelist
INTEGER, PARAMETER :: nnml = 100 ! namelist unit
integer, parameter :: nnml = 100 ! namelist unit
! computational, these values need to be the same!!!
real(dp), public, parameter :: nodata_dp = -9999.0_dp ! [-] global no data value
integer(i4), public, parameter :: nodata_i4 = int(nodata_dp) ! [-] global no data value
!> epsilon(1.0) in double precision
REAL(dp), public, PARAMETER :: eps_dp = epsilon(1.0_dp)
REAL(sp), public, PARAMETER :: eps_sp = epsilon(1.0_sp)
real(dp), public, parameter :: eps_dp = epsilon(1.0_dp)
real(sp), public, parameter :: eps_sp = epsilon(1.0_sp)
END MODULE mo_constants
end module mo_constants
This diff is collapsed.
......@@ -53,6 +53,12 @@ MODULE mo_utils
PUBLIC :: swap ! swaps arrays or elements of an array
PUBLIC :: special_value ! Special IEEE values
public :: flip ! flips a dimension of an array
interface flip
procedure flip_1D_dp, flip_2D_dp, flip_3D_dp, flip_4D_dp, flip_1D_i4, flip_2D_i4, flip_3D_i4, flip_4D_i4
end interface
! ------------------------------------------------------------------
! NAME
......@@ -1034,4 +1040,280 @@ CONTAINS
end function special_value_sp
subroutine flip_1D_dp(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
real(dp), dimension(:), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
real(dp), dimension(:), allocatable :: temp_data
integer(i4) :: iDim1
if (iDim > 1_i4) then
call message('Cannot flip 1D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1)))
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1) = data(iDim1)
end do
call move_alloc(temp_data, data)
end subroutine flip_1D_dp
subroutine flip_2D_dp(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
real(dp), dimension(:, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
real(dp), dimension(:, :), allocatable :: temp_data
integer(i4) :: iDim2, iDim1
if (iDim > 2_i4) then
call message('Cannot flip 2D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2)))
if (iDim == 1_i4) then
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2) = data(iDim1, iDim2)
end do
end do
else if (iDim == 2_i4) then
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1) = data(:, iDim2)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_2D_dp
subroutine flip_3D_dp(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
real(dp), dimension(:, :, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
real(dp), dimension(:, :, :), allocatable :: temp_data
integer(i4) :: iDim3, iDim2, iDim1
if (iDim > 3_i4) then
call message('Cannot flip 3D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2), size(data, 3)))
if (iDim == 1_i4) then
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2, iDim3) = data(iDim1, iDim2, iDim3)
end do
end do
end do
else if (iDim == 2_i4) then
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1, iDim3) = data(:, iDim2, iDim3)
end do
end do
else if (iDim == 3_i4) then
do iDim3 = 1, size(data, 3)
temp_data(:, :, size(data, 3) - iDim3 + 1) = data(:, :, iDim3)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_3D_dp
subroutine flip_4D_dp(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
real(dp), dimension(:, :, :, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
real(dp), dimension(:, :, :, :), allocatable :: temp_data
integer(i4) :: iDim4, iDim3, iDim2, iDim1
if (iDim > 4_i4) then
call message('Cannot flip 4D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2), size(data, 3), size(data, 4)))
if (iDim == 1_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2, iDim3, iDim4) = data(iDim1, iDim2, iDim3, iDim4)
end do
end do
end do
end do
else if (iDim == 2_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1, iDim3, iDim4) = data(:, iDim2, iDim3, iDim4)
end do
end do
end do
else if (iDim == 3_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
temp_data(:, :, size(data, 3) - iDim3 + 1, iDim4) = data(:, :, iDim3, iDim4)
end do
end do
else if (iDim == 4_i4) then
do iDim4 = 1, size(data, 4)
temp_data(:, :, :, size(data, 4) - iDim4 + 1) = data(:, :, :, iDim4)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_4D_dp
subroutine flip_1D_i4(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
integer(i4), dimension(:), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
integer(i4), dimension(:), allocatable :: temp_data
integer(i4) :: iDim1
if (iDim > 1_i4) then
call message('Cannot flip 1D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1)))
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1) = data(iDim1)
end do
call move_alloc(temp_data, data)
end subroutine flip_1D_i4
subroutine flip_2D_i4(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
integer(i4), dimension(:, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
integer(i4), dimension(:, :), allocatable :: temp_data
integer(i4) :: iDim2, iDim1
if (iDim > 2_i4) then
call message('Cannot flip 2D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2)))
if (iDim == 1_i4) then
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2) = data(iDim1, iDim2)
end do
end do
else if (iDim == 2_i4) then
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1) = data(:, iDim2)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_2D_i4
subroutine flip_3D_i4(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
integer(i4), dimension(:, :, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
integer(i4), dimension(:, :, :), allocatable :: temp_data
integer(i4) :: iDim3, iDim2, iDim1
if (iDim > 3_i4) then
call message('Cannot flip 3D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2), size(data, 3)))
if (iDim == 1_i4) then
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2, iDim3) = data(iDim1, iDim2, iDim3)
end do
end do
end do
else if (iDim == 2_i4) then
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1, iDim3) = data(:, iDim2, iDim3)
end do
end do
else if (iDim == 3_i4) then
do iDim3 = 1, size(data, 3)
temp_data(:, :, size(data, 3) - iDim3 + 1) = data(:, :, iDim3)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_3D_i4
subroutine flip_4D_i4(data, iDim)
use mo_string_utils, only: compress, num2str
use mo_message, only: message
integer(i4), dimension(:, :, :, :), allocatable, intent(inout) :: data
integer(i4), intent(in) :: iDim
integer(i4), dimension(:, :, :, :), allocatable :: temp_data
integer(i4) :: iDim4, iDim3, iDim2, iDim1
if (iDim > 4_i4) then
call message('Cannot flip 4D-array at dimension ', compress(trim(num2str(iDim))))
stop 1
end if
allocate(temp_data(size(data, 1), size(data, 2), size(data, 3), size(data, 4)))
if (iDim == 1_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
do iDim1 = 1, size(data, 1)
temp_data(size(data, 1) - iDim1 + 1, iDim2, iDim3, iDim4) = data(iDim1, iDim2, iDim3, iDim4)
end do
end do
end do
end do
else if (iDim == 2_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
do iDim2 = 1, size(data, 2)
temp_data(:, size(data, 2) - iDim2 + 1, iDim3, iDim4) = data(:, iDim2, iDim3, iDim4)
end do
end do
end do
else if (iDim == 3_i4) then
do iDim4 = 1, size(data, 4)
do iDim3 = 1, size(data, 3)
temp_data(:, :, size(data, 3) - iDim3 + 1, iDim4) = data(:, :, iDim3, iDim4)
end do
end do
else if (iDim == 4_i4) then
do iDim4 = 1, size(data, 4)
temp_data(:, :, :, size(data, 4) - iDim4 + 1) = data(:, :, :, iDim4)
end do
end if
call move_alloc(temp_data, data)
end subroutine flip_4D_i4
END MODULE mo_utils
......@@ -5,8 +5,13 @@ import numpy as np
from copy import copy
import re
from collections import OrderedDict
import argparse
MAX_LINE_LENGTH = 100
DO_TESTS = False
DEFAULT_CONFIG_FILE = 'mpr.nml'
DEFAULT_PARAM_FILE = 'mpr_global_parameter.nml'
DEFAULT_SOURCE_FOLDER = './src/'
class TF(object):
......@@ -455,14 +460,33 @@ def get_parameters(*args):
arg['parameter_values']) if key is not None})
return params_dict
def parse_args():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='''Preprocessor script for MPR.
author: Stephan Thober, Robert Schweppe
created: Mar 2018''')
parser.add_argument('-c'