Skip to content

Commit

Permalink
Update src/drivers/schism/fabm_driver.h with MASK definitions (#64)
Browse files Browse the repository at this point in the history
* Update src/drivers/schism/fabm_driver.h with MASK definitions

Recent versions of SCHISM need the MASK_TYPE and MASK_VALUE to be defined in the driver.  This Commit adds the relevant definitions.  We also update copyright and license (placed in public domain).

* Updated drivers/schism/fabm_driver with _FABM_HORIZONTAL_MASK_

SCHISM does not need a 3D mask, so for performance reasons `_FABM_HORIZONTAL_MASK_` should be defined

* Retracted addition of FABM_MASK_HORIZONTAL

Breaks existing code, we might reintroduce as soon as the 
1) discussion about performance is resolved
2) the SCHISM code respects this #define
  • Loading branch information
platipodium authored Apr 23, 2024
1 parent 11f3eee commit 561264d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/drivers/schism/fabm_driver.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
! Copyright 2017 Helmholtz-Zentrum Geesthacht
! Licensed under the Apache License, Version 2.0
! (http://www.apache.org/licenses/LICENSE-2.0)
! Author(s): Richard Hofmeister
! SPDX-FileCopyrightText: 2021-2024 Helmholtz-Zentrum hereon GmbH
! SPDX-FileCopyrightText: 2017-2021 Helmholtz-Zentrum Geesthacht GmbH
! SPDX-License-Identifier: CC0-1.0
! SPDX-FileContributor: Carsten Lemmen <carsten.lemmen@hereon.de>
! SPDX-FileContributor: Richard Hofmeister

#define _FABM_DIMENSION_COUNT_ 2
#define _FABM_DEPTH_DIMENSION_INDEX_ 1
Expand All @@ -10,4 +11,14 @@
#define _FABM_VERTICAL_BOTTOM_TO_SURFACE_
#define _FABM_BOTTOM_INDEX_ -1

#define _FABM_MASK_TYPE_ integer
#define _FABM_MASKED_VALUE_ 1

! For performance reasons it would be advisable to define _FABM_HORIZONTAL_MASK_
! which is sufficient to mask dry elements. It currently does break the
! code however, which still employs a 2D mask to mask elements below the bottom index
! within a water column. We need a discussion on whether it is more performant to
! do the calculations below bottom index nonetheless ...

#include "fabm.h"

0 comments on commit 561264d

Please sign in to comment.