Commit 98776fff authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

introduced _FABM_CONTIGUOUS_

parent 5b196270
......@@ -270,6 +270,12 @@
# define _IS_UNMASKED_(maskvalue) .true.
#endif
#ifdef _FABM_CONTIGUOUS_
# define _CONTIGUOUS_ ,contiguous
#else
# define _CONTIGUOUS_
#endif
#if _FABM_DIMENSION_COUNT_==0||(_FABM_DIMENSION_COUNT_==1&&defined(_FABM_VECTORIZED_DIMENSION_INDEX_))
# define _BEGIN_OUTER_INTERIOR_LOOP_
# define _END_OUTER_INTERIOR_LOOP_
......@@ -325,6 +331,7 @@
#if _HORIZONTAL_DIMENSION_COUNT_>0
# define _INDEX_HORIZONTAL_LOCATION_ (_HORIZONTAL_LOCATION_)
# define _DIMENSION_GLOBAL_HORIZONTAL_ ,dimension(_HORIZONTAL_LOCATION_DIMENSIONS_)
# define _ATTRIBUTES_GLOBAL_HORIZONTAL_ _DIMENSION_GLOBAL_HORIZONTAL_ _CONTIGUOUS_
# define _ARG_HORIZONTAL_LOCATION_ _HORIZONTAL_LOCATION_
# define _ARGUMENTS_HORIZONTAL_LOCATION_ ,_ARG_HORIZONTAL_LOCATION_
# define _ARGUMENTS_HORIZONTAL_LOCATION_RANGE_ ,_HORIZONTAL_LOCATION_RANGE_
......@@ -335,6 +342,7 @@
#else
# define _INDEX_HORIZONTAL_LOCATION_
# define _DIMENSION_GLOBAL_HORIZONTAL_
# define _ATTRIBUTES_GLOBAL_HORIZONTAL_
# define _ARG_HORIZONTAL_LOCATION_
# define _ARGUMENTS_HORIZONTAL_LOCATION_
# define _ARGUMENTS_HORIZONTAL_LOCATION_RANGE_
......@@ -350,7 +358,8 @@
#if _FABM_DIMENSION_COUNT_>0
# define _INDEX_LOCATION_ (_LOCATION_)
# define _DIMENSION_GLOBAL_ ,dimension(_LOCATION_DIMENSIONS_)
# define _DIMENSION_GLOBAL_ ,dimension(_LOCATION_DIMENSIONS_) _CONTIGUOUS_
# define _ATTRIBUTES_GLOBAL_ _DIMENSION_GLOBAL_ _CONTIGUOUS_
# define _POSTARG_LOCATION_ ,_LOCATION_
# define _ARGUMENTS_LOCATION_RANGE_ ,_LOCATION_RANGE_
# define _PREARG_LOCATION_ _LOCATION_,
......@@ -361,6 +370,7 @@
#else
# define _INDEX_LOCATION_
# define _DIMENSION_GLOBAL_
# define _ATTRIBUTES_GLOBAL_
# define _POSTARG_LOCATION_
# define _ARGUMENTS_LOCATION_RANGE_
# define _PREARG_LOCATION_
......
......@@ -26,6 +26,7 @@ set(DEFAULT_INSTITUTES
su # Swansea University, United Kingdom
niva # Norsk Institutt for Vannforskning, Norway
akvaplan # Akvaplan-niva, Norway
# uhh # University of Hamburg, Germany
)
# Ensure FABM_INSTITUTES tracks the up-to-date DEFAULT_INSTITUTES list unless the user manually customized FABM_INSTITUTES.
......
......@@ -4,6 +4,8 @@
#define _FABM_VERTICAL_BOTTOM_TO_SURFACE_
#define _FABM_CONTIGUOUS_
! Include FABM preprocessor definitions.
! This *must* be done after the host-specific variables are defined (above),
! because these are used in fabm.h.
......
......@@ -538,11 +538,11 @@ contains
# else
subroutine set_mask(self, mask, mask_hz)
# endif
class (type_fabm_model), target, intent(inout) :: self
class (type_fabm_model), target, intent(inout) :: self
# ifndef _FABM_HORIZONTAL_MASK_
_FABM_MASK_TYPE_, target, intent(in) _DIMENSION_GLOBAL_ :: mask
_FABM_MASK_TYPE_, target, intent(in) _ATTRIBUTES_GLOBAL_ :: mask
# endif
_FABM_MASK_TYPE_, target, intent(in) _DIMENSION_GLOBAL_HORIZONTAL_ :: mask_hz
_FABM_MASK_TYPE_, target, intent(in) _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: mask_hz
integer :: i
......@@ -599,8 +599,8 @@ contains
! valid for the lifetime of the model object.
! --------------------------------------------------------------------------
subroutine set_bottom_index(self, indices)
class (type_fabm_model), intent(inout) :: self
integer, target, intent(in) _DIMENSION_GLOBAL_HORIZONTAL_ :: indices
class (type_fabm_model), intent(inout) :: self
integer, target, intent(in) _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: indices
integer :: i
......@@ -1105,10 +1105,10 @@ contains
end subroutine require_horizontal_data
subroutine link_interior_data_by_variable(self, variable, dat, source)
class (type_fabm_model), intent(inout) :: self
type (type_internal_variable), intent(in) :: variable
real(rke) _DIMENSION_GLOBAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
class (type_fabm_model), intent(inout) :: self
type (type_internal_variable), intent(in) :: variable
real(rke) _ATTRIBUTES_GLOBAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
integer :: i
integer :: source_
......@@ -1136,7 +1136,7 @@ contains
subroutine link_interior_data_by_id(self, id, dat, source)
class (type_fabm_model), intent(inout) :: self
type(type_fabm_interior_variable_id), intent(in) :: id
real(rke) _DIMENSION_GLOBAL_, target, intent(in) :: dat
real(rke) _ATTRIBUTES_GLOBAL_, target, intent(in) :: dat
integer,optional, intent(in) :: source
if (associated(id%variable)) call link_interior_data_by_variable(self, id%variable, dat, source)
......@@ -1145,24 +1145,24 @@ contains
subroutine link_interior_data_by_sn(model, standard_variable, dat)
class (type_fabm_model), intent(inout) :: model
type (type_interior_standard_variable), intent(in) :: standard_variable
real(rke) _DIMENSION_GLOBAL_, target, intent(in) :: dat
real(rke) _ATTRIBUTES_GLOBAL_, target, intent(in) :: dat
call link_interior_data_by_id(model, get_interior_variable_id_sn(model, standard_variable), dat)
end subroutine link_interior_data_by_sn
subroutine link_interior_data_by_name(model, name, dat)
class (type_fabm_model), target, intent(inout) :: model
character(len=*), intent(in) :: name
real(rke) _DIMENSION_GLOBAL_, target, intent(in) :: dat
class (type_fabm_model), target, intent(inout) :: model
character(len=*), intent(in) :: name
real(rke) _ATTRIBUTES_GLOBAL_, target, intent(in) :: dat
call link_interior_data_by_id(model, get_interior_variable_id_by_name(model, name), dat)
end subroutine link_interior_data_by_name
subroutine link_horizontal_data_by_variable(self, variable, dat, source)
class (type_fabm_model), intent(inout) :: self
type (type_internal_variable), intent(in) :: variable
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
class (type_fabm_model), intent(inout) :: self
type (type_internal_variable), intent(in) :: variable
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
integer :: i
integer :: source_
......@@ -1188,26 +1188,26 @@ contains
end subroutine link_horizontal_data_by_variable
subroutine link_horizontal_data_by_id(self, id, dat, source)
class (type_fabm_model), intent(inout) :: self
type (type_fabm_horizontal_variable_id), intent(in) :: id
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
class (type_fabm_model), intent(inout) :: self
type (type_fabm_horizontal_variable_id), intent(in) :: id
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
integer, optional, intent(in) :: source
if (associated(id%variable)) call link_horizontal_data_by_variable(self, id%variable, dat, source)
end subroutine link_horizontal_data_by_id
subroutine link_horizontal_data_by_sn(model, standard_variable, dat)
class (type_fabm_model), intent(inout) :: model
class (type_horizontal_standard_variable), intent(in) :: standard_variable
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
class (type_fabm_model), intent(inout) :: model
class (type_horizontal_standard_variable), intent(in) :: standard_variable
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
call link_horizontal_data_by_id(model, get_horizontal_variable_id_sn(model, standard_variable), dat)
end subroutine link_horizontal_data_by_sn
subroutine link_horizontal_data_by_name(model, name, dat)
class (type_fabm_model), intent(inout) :: model
character(len=*), intent(in) :: name
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
class (type_fabm_model), intent(inout) :: model
character(len=*), intent(in) :: name
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
call link_horizontal_data_by_id(model, get_horizontal_variable_id_by_name(model, name), dat)
end subroutine link_horizontal_data_by_name
......@@ -1250,25 +1250,25 @@ contains
end subroutine link_scalar_by_name
subroutine link_interior_state_data(self, index, dat)
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_, target, intent(in) :: dat
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_, target, intent(in) :: dat
call link_interior_data_by_variable(self, self%state_variables(index)%target, dat, source=data_source_fabm)
end subroutine link_interior_state_data
subroutine link_bottom_state_data(self, index, dat)
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
call link_horizontal_data_by_variable(self, self%bottom_state_variables(index)%target, dat, source=data_source_fabm)
end subroutine link_bottom_state_data
subroutine link_surface_state_data(self, index, dat)
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
class (type_fabm_model), intent(inout) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, target, intent(in) :: dat
call link_horizontal_data_by_variable(self, self%surface_state_variables(index)%target, dat, source=data_source_fabm)
end subroutine link_surface_state_data
......@@ -1319,9 +1319,9 @@ contains
end subroutine link_all_surface_state_data
function get_interior_diagnostic_data(self, index) result(dat)
class (type_fabm_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_, pointer :: dat
class (type_fabm_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_, pointer :: dat
_ASSERT_(self%status >= status_start_done, 'get_interior_diagnostic_data', 'This routine can only be called after model start.')
dat => null()
......@@ -1330,9 +1330,9 @@ contains
end function get_interior_diagnostic_data
function get_horizontal_diagnostic_data(self, index) result(dat)
class (type_fabm_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, pointer :: dat
class (type_fabm_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, pointer :: dat
_ASSERT_(self%status >= status_start_done, 'get_horizontal_diagnostic_data', 'This routine can only be called after model start.')
dat => null()
......@@ -1343,7 +1343,7 @@ contains
function get_interior_data(self, id) result(dat)
class (type_fabm_model), target, intent(in) :: self
type (type_fabm_interior_variable_id), intent(in) :: id
real(rke) _DIMENSION_GLOBAL_, pointer :: dat
real(rke) _ATTRIBUTES_GLOBAL_, pointer :: dat
_ASSERT_(self%status >= status_start_done, 'get_interior_data', 'This routine can only be called after model start.')
dat => null()
......@@ -1352,9 +1352,9 @@ contains
end function get_interior_data
function get_horizontal_data(self, id) result(dat)
class (type_fabm_model), target, intent(in) :: self
type(type_fabm_horizontal_variable_id), intent(in) :: id
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, pointer :: dat
class (type_fabm_model), target, intent(in) :: self
type(type_fabm_horizontal_variable_id), intent(in) :: id
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, pointer :: dat
_ASSERT_(self%status >= status_start_done, 'get_horizontal_data', 'This routine can only be called after model start.')
dat => null()
......
......@@ -129,15 +129,15 @@ contains
#ifdef _HAS_MASK_
# ifdef _FABM_HORIZONTAL_MASK_
subroutine fabm_set_mask(self, mask_hz)
class (type_model), target, intent(inout) :: self
_FABM_MASK_TYPE_, target, intent(in) _DIMENSION_GLOBAL_HORIZONTAL_ :: mask_hz
class (type_model), target, intent(inout) :: self
_FABM_MASK_TYPE_, target, intent(in) _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: mask_hz
call self%set_mask(mask_hz)
end subroutine
# else
subroutine fabm_set_mask(self, mask, mask_hz)
class (type_model), target, intent(inout) :: self
_FABM_MASK_TYPE_, target, intent(in) _DIMENSION_GLOBAL_ :: mask
_FABM_MASK_TYPE_, target, intent(in) _DIMENSION_GLOBAL_HORIZONTAL_ :: mask_hz
class (type_model), target, intent(inout) :: self
_FABM_MASK_TYPE_, target, intent(in) _ATTRIBUTES_GLOBAL_ :: mask
_FABM_MASK_TYPE_, target, intent(in) _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: mask_hz
call self%set_mask(mask, mask_hz)
end subroutine
# endif
......@@ -249,16 +249,16 @@ contains
end subroutine
function fabm_get_interior_diagnostic_data(self, index) result(dat)
class (type_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_, pointer :: dat
class (type_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_, pointer :: dat
dat => self%get_interior_diagnostic_data(index)
end function
function fabm_get_horizontal_diagnostic_data(self, index) result(dat)
class (type_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _DIMENSION_GLOBAL_HORIZONTAL_, pointer :: dat
class (type_model), intent(in) :: self
integer, intent(in) :: index
real(rke) _ATTRIBUTES_GLOBAL_HORIZONTAL_, pointer :: dat
dat => self%get_horizontal_diagnostic_data(index)
end function
......
......@@ -30,16 +30,16 @@ module fabm_work
#ifdef _HAS_MASK_
# ifndef _FABM_HORIZONTAL_MASK_
_FABM_MASK_TYPE_, pointer _DIMENSION_GLOBAL_ :: mask => null()
_FABM_MASK_TYPE_, pointer _ATTRIBUTES_GLOBAL_ :: mask => null()
# endif
_FABM_MASK_TYPE_, pointer _DIMENSION_GLOBAL_HORIZONTAL_ :: mask_hz => null()
_FABM_MASK_TYPE_, pointer _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: mask_hz => null()
#endif
#ifdef _FABM_DEPTH_DIMENSION_INDEX_
# if _FABM_BOTTOM_INDEX_==0
integer :: bottom_index = -1
# elif _FABM_BOTTOM_INDEX_==-1
integer, pointer _DIMENSION_GLOBAL_HORIZONTAL_ :: bottom_indices => null()
integer, pointer _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: bottom_indices => null()
# endif
integer :: surface_index = -1
#endif
......@@ -50,11 +50,11 @@ module fabm_work
! --------------------------------------------------------------------------
type type_interior_data_pointer
real(rke), pointer _DIMENSION_GLOBAL_ :: p => null()
real(rke), pointer _ATTRIBUTES_GLOBAL_ :: p => null()
end type
type type_horizontal_data_pointer
real(rke), pointer _DIMENSION_GLOBAL_HORIZONTAL_ :: p => null()
real(rke), pointer _ATTRIBUTES_GLOBAL_HORIZONTAL_ :: p => null()
end type
type type_scalar_data_pointer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment