New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
crslbclnk.F90 in NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/CRS – NEMO

source: NEMO/branches/2019/dev_r11470_HPC_12_mpi3/src/OCE/CRS/crslbclnk.F90 @ 11799

Last change on this file since 11799 was 11799, checked in by mocavero, 5 years ago

Update the branch to v4.0.1 of the trunk

  • Property svn:keywords set to Id
File size: 4.4 KB
RevLine 
[4015]1MODULE crslbclnk
2   !!======================================================================
3   !!                       ***  MODULE  crslbclnk  ***
4   !!               A temporary solution for lbclnk for coarsened grid.
5   !! Ocean        : lateral boundary conditions for grid coarsening
6   !!=====================================================================
7   !! History :   ! 2012-06  (J. Simeon, G. Madec, C. Ethe, C. Calone)     Original code
[6140]8   !!----------------------------------------------------------------------
9   USE par_kind, ONLY: wp
[4015]10   USE dom_oce
11   USE crs
[6140]12   !
[4015]13   USE lbclnk
14   USE in_out_manager
15   
16   INTERFACE crs_lbc_lnk
[9019]17      MODULE PROCEDURE crs_lbc_lnk_3d, crs_lbc_lnk_2d
[4015]18   END INTERFACE
19   
20   PUBLIC crs_lbc_lnk
21   
[6140]22   !!----------------------------------------------------------------------
[9598]23   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[5215]24   !! $Id$
[10068]25   !! Software governed by the CeCILL license (see ./LICENSE)
[6140]26   !!----------------------------------------------------------------------
[4015]27CONTAINS
28
[11799]29   SUBROUTINE crs_lbc_lnk_3d( pt3d1, cd_type1, psgn, kfillmode, pfillval  )
[4015]30      !!---------------------------------------------------------------------
31      !!                  ***  SUBROUTINE crs_lbc_lnk  ***
32      !!
33      !! ** Purpose :   set lateral boundary conditions for coarsened grid
34      !!
35      !! ** Method  :   Swap domain indices from full to coarse domain
36      !!                before arguments are passed directly to lbc_lnk.
37      !!                Upon exiting, switch back to full domain indices.
38      !!----------------------------------------------------------------------
[6140]39      CHARACTER(len=1)                        , INTENT(in   ) ::   cd_type1 ! grid type
40      REAL(wp)                                , INTENT(in   ) ::   psgn     ! control of the sign
41      REAL(wp), DIMENSION(jpi_crs,jpj_crs,jpk), INTENT(inout) ::   pt3d1    ! 3D array on which the lbc is applied
[11799]42      INTEGER                     , OPTIONAL  , INTENT(in   ) ::   kfillmode   ! filling method for halo over land (default = cst)
43      REAL(wp)                    , OPTIONAL  , INTENT(in   ) ::   pfillval    ! background value (used at closed boundaries)
[6140]44      !
45      LOGICAL  ::   ll_grid_crs
[4015]46      !!----------------------------------------------------------------------
[6140]47      !
[4015]48      ll_grid_crs = ( jpi == jpi_crs )
[6140]49      !
50      IF( .NOT.ll_grid_crs )   CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain
51      !
[11799]52      CALL lbc_lnk( 'crslbclnk', pt3d1, cd_type1, psgn, kfillmode, pfillval )
[6140]53      !
54      IF( .NOT.ll_grid_crs )   CALL dom_grid_glo   ! Return to parent grid domain
55      !
[4015]56   END SUBROUTINE crs_lbc_lnk_3d
57   
[6140]58   
[11799]59   SUBROUTINE crs_lbc_lnk_2d(pt2d, cd_type, psgn, kfillmode, pfillval )
[4015]60      !!---------------------------------------------------------------------
61      !!                  ***  SUBROUTINE crs_lbc_lnk  ***
62      !!
63      !! ** Purpose :   set lateral boundary conditions for coarsened grid
64      !!
65      !! ** Method  :   Swap domain indices from full to coarse domain
66      !!                before arguments are passed directly to lbc_lnk.
67      !!                Upon exiting, switch back to full domain indices.
68      !!----------------------------------------------------------------------
[6140]69      CHARACTER(len=1)                    , INTENT(in   ) ::   cd_type  ! grid type
70      REAL(wp)                            , INTENT(in   ) ::   psgn     ! control of the sign
71      REAL(wp), DIMENSION(jpi_crs,jpj_crs), INTENT(inout) ::   pt2d     ! 2D array on which the lbc is applied
[11799]72      INTEGER                 , OPTIONAL  , INTENT(in   ) ::   kfillmode   ! filling method for halo over land (default = constant)
73      REAL(wp)                , OPTIONAL  , INTENT(in   ) ::   pfillval    ! background value (used at closed boundaries)
[6140]74      !     
75      LOGICAL  ::   ll_grid_crs
[4015]76      !!----------------------------------------------------------------------
[6140]77      !
[4015]78      ll_grid_crs = ( jpi == jpi_crs )
[6140]79      !
80      IF( .NOT.ll_grid_crs )   CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain
81      !
[11799]82      CALL lbc_lnk( 'crslbclnk', pt2d, cd_type, psgn, kfillmode, pfillval )
[6140]83      !
84      IF( .NOT.ll_grid_crs )   CALL dom_grid_glo   ! Return to parent grid domain
85      !
[4015]86   END SUBROUTINE crs_lbc_lnk_2d
87
[6140]88   !!======================================================================
[4015]89END MODULE crslbclnk
Note: See TracBrowser for help on using the repository browser.