diff --git a/doc/api.rst b/doc/api.rst index 444fe5a..22be503 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -50,12 +50,18 @@ Name Description =============== ========================================= GO_BC_NONE No boundary conditions are applied. GO_BC_EXTERNAL Some external forcing is applied. This must be implemented by a kernel. + The domain can be specified using a ``tmask``, but if no ``tmask`` is + specified, a dummy ``tmask`` is created that will define an all ocean + domain. GO_BC_PERIODIC Periodic boundary conditions are applied. =============== ========================================= The infrastructure requires this information in order to determine the extent of the model grid. +Note that at this stage ``GO_BC_PERIODIC`` is not supported when +using distributed memory. This is tracked in issue #54. + The index offset is required because a model (kernel) developer has choice in how they actually implement the staggering of variables on a grid. This comes down to a choice of which grid points in the vicinity @@ -98,8 +104,12 @@ object. This is done via a call to the ``grid_init`` subroutine:: !! wet (1), dry (0) or external (-1). integer, dimension(m,n), intent(in), optional :: tmask -It should be noted that currently only grids with constant -resolution in *x* and *y* are supported by this routine. + +If no T-mask is supplied then this routine configures the grid +appropriately for an all-wet domain by allocating a default +T-mask. It should also be noted that currently only grids with +constant resolution in *x* and *y* are supported by this routine. + .. _gocean1.0-fields: diff --git a/finite_difference/src/grid_mod.f90 b/finite_difference/src/grid_mod.f90 index 4a05d86..5cbdcc2 100644 --- a/finite_difference/src/grid_mod.f90 +++ b/finite_difference/src/grid_mod.f90 @@ -96,9 +96,9 @@ module grid_mod !! -1 == wet outside simulated region !! This is the key quantity that determines the region that !! is actually simulated. However, we also support the - !! specification of a model consisting entirely of wet points - !! Since this does not require a T-mask, we do not allocate - !! this array for that case. + !! specification of a model consisting entirely of wet points. + !! In this case a dummy tmask will be allocated, set to indicate + !! an all wet domain. integer, allocatable :: tmask(:,:) !> Pointer to tmask on remote device (if any) type(c_ptr) :: tmask_device @@ -324,7 +324,9 @@ end function grid_constructor !! @param[in] dxarg Grid spacing in x dimension !! @param[in] dyarg Grid spacing in y dimension !! @param[in] tmask Array holding the T-point mask which defines - !! the contents of the local domain. + !! the contents of the local domain. Need not be + !! supplied if domain is all wet, in which case a + !! dummy all-wet tmask will be created internally. subroutine grid_init(grid, dxarg, dyarg, tmask) use decomposition_mod, only: subdomain_type, decomposition_type use parallel_mod, only: map_comms, get_rank, get_num_ranks, on_master