Skip to content

Commit

Permalink
#64 Updatd documentation and comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Jan 31, 2024
1 parent 79bc758 commit 685f19f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 12 additions & 2 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down
10 changes: 6 additions & 4 deletions finite_difference/src/grid_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 685f19f

Please sign in to comment.