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.
lbcnfd.F90 in NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/LBC – NEMO

source: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/LBC/lbcnfd.F90 @ 11822

Last change on this file since 11822 was 11822, checked in by acc, 4 years ago

Branch 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. Sette tested updates to branch to align with trunk changes between 10721 and 11740. Sette tests are passing but results differ from branch before these changes (except for GYRE_PISCES and VORTEX) and branch results already differed from trunk because of algorithmic fixes. Will need more checks to confirm correctness.

  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1MODULE lbcnfd
2   !!======================================================================
3   !!                       ***  MODULE  lbcnfd  ***
4   !! Ocean        : north fold  boundary conditions
5   !!======================================================================
6   !! History :  3.2  ! 2009-03  (R. Benshila)  Original code
7   !!            3.5  ! 2013-07  (I. Epicoco, S. Mocavero - CMCC) MPP optimization
8   !!            4.0  ! 2017-04  (G. Madec) automatique allocation of array argument (use any 3rd dimension)
9   !!----------------------------------------------------------------------
10
11   !!----------------------------------------------------------------------
12   !!   lbc_nfd       : generic interface for lbc_nfd_3d and lbc_nfd_2d routines
13   !!   lbc_nfd_3d    : lateral boundary condition: North fold treatment for a 3D arrays   (lbc_nfd)
14   !!   lbc_nfd_2d    : lateral boundary condition: North fold treatment for a 2D arrays   (lbc_nfd)
15   !!   lbc_nfd_nogather       : generic interface for lbc_nfd_nogather_3d and
16   !!                            lbc_nfd_nogather_2d routines (designed for use
17   !!                            with ln_nnogather to avoid global width arrays
18   !!                            mpi all gather operations)
19   !!----------------------------------------------------------------------
20   USE dom_oce        ! ocean space and time domain
21   USE in_out_manager ! I/O manager
22   USE lib_mpp        ! MPP library
23
24   IMPLICIT NONE
25   PRIVATE
26
27   INTERFACE lbc_nfd
28      MODULE PROCEDURE   lbc_nfd_2d    , lbc_nfd_3d    , lbc_nfd_4d
29      MODULE PROCEDURE   lbc_nfd_2d_ptr, lbc_nfd_3d_ptr, lbc_nfd_4d_ptr
30      MODULE PROCEDURE   lbc_nfd_2d_ext
31   END INTERFACE
32   !
33   INTERFACE lbc_nfd_nogather
34!                        ! Currently only 4d array version is needed
35     MODULE PROCEDURE   lbc_nfd_nogather_2d    , lbc_nfd_nogather_3d
36     MODULE PROCEDURE   lbc_nfd_nogather_4d
37     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr, lbc_nfd_nogather_3d_ptr
38!     MODULE PROCEDURE   lbc_nfd_nogather_4d_ptr
39   END INTERFACE
40
41   TYPE, PUBLIC ::   PTR_2D   !: array of 2D pointers (also used in lib_mpp)
42      REAL(wp), DIMENSION (:,:)    , POINTER ::   pt2d
43   END TYPE PTR_2D
44   TYPE, PUBLIC ::   PTR_3D   !: array of 3D pointers (also used in lib_mpp)
45      REAL(wp), DIMENSION (:,:,:)  , POINTER ::   pt3d
46   END TYPE PTR_3D
47   TYPE, PUBLIC ::   PTR_4D   !: array of 4D pointers (also used in lib_mpp)
48      REAL(wp), DIMENSION (:,:,:,:), POINTER ::   pt4d
49   END TYPE PTR_4D
50
51   PUBLIC   lbc_nfd            ! north fold conditions
52   PUBLIC   lbc_nfd_nogather   ! north fold conditions (no allgather case)
53
54   INTEGER, PUBLIC, PARAMETER            ::   jpmaxngh = 3               !:
55   INTEGER, PUBLIC                       ::   nsndto, nfsloop, nfeloop   !:
56   INTEGER, PUBLIC, DIMENSION (jpmaxngh) ::   isendto                    !: processes to which communicate
57
58   !!----------------------------------------------------------------------
59   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
60   !! $Id$
61   !! Software governed by the CeCILL license (see ./LICENSE)
62   !!----------------------------------------------------------------------
63CONTAINS
64
65   !!----------------------------------------------------------------------
66   !!                   ***  routine lbc_nfd_(2,3,4)d  ***
67   !!----------------------------------------------------------------------
68   !!
69   !! ** Purpose :   lateral boundary condition
70   !!                North fold treatment without processor exchanges.
71   !!
72   !! ** Method  :   
73   !!
74   !! ** Action  :   ptab with updated values along the north fold
75   !!----------------------------------------------------------------------
76   !
77   !                       !==  2D array and array of 2D pointer  ==!
78   !
79#  define DIM_2d
80#     define ROUTINE_NFD           lbc_nfd_2d
81#     include "lbc_nfd_generic.h90"
82#     undef ROUTINE_NFD
83#     define MULTI
84#     define ROUTINE_NFD           lbc_nfd_2d_ptr
85#     include "lbc_nfd_generic.h90"
86#     undef ROUTINE_NFD
87#     undef MULTI
88#  undef DIM_2d
89   !
90   !                       !==  2D array with extra haloes  ==!
91   !
92#  define DIM_2d
93#     define ROUTINE_NFD           lbc_nfd_2d_ext
94#     include "lbc_nfd_ext_generic.h90"
95#     undef ROUTINE_NFD
96#  undef DIM_2d
97   !
98   !                       !==  3D array and array of 3D pointer  ==!
99   !
100#  define DIM_3d
101#     define ROUTINE_NFD           lbc_nfd_3d
102#     include "lbc_nfd_generic.h90"
103#     undef ROUTINE_NFD
104#     define MULTI
105#     define ROUTINE_NFD           lbc_nfd_3d_ptr
106#     include "lbc_nfd_generic.h90"
107#     undef ROUTINE_NFD
108#     undef MULTI
109#  undef DIM_3d
110   !
111   !                       !==  4D array and array of 4D pointer  ==!
112   !
113#  define DIM_4d
114#     define ROUTINE_NFD           lbc_nfd_4d
115#     include "lbc_nfd_generic.h90"
116#     undef ROUTINE_NFD
117#     define MULTI
118#     define ROUTINE_NFD           lbc_nfd_4d_ptr
119#     include "lbc_nfd_generic.h90"
120#     undef ROUTINE_NFD
121#     undef MULTI
122#  undef DIM_4d
123   !
124   !  lbc_nfd_nogather routines
125   !
126   !                       !==  2D array and array of 2D pointer  ==!
127   !
128#  define DIM_2d
129#     define ROUTINE_NFD           lbc_nfd_nogather_2d
130#     include "lbc_nfd_nogather_generic.h90"
131#     undef ROUTINE_NFD
132#     define MULTI
133#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr
134#     include "lbc_nfd_nogather_generic.h90"
135#     undef ROUTINE_NFD
136#     undef MULTI
137#  undef DIM_2d
138   !
139   !                       !==  3D array and array of 3D pointer  ==!
140   !
141#  define DIM_3d
142#     define ROUTINE_NFD           lbc_nfd_nogather_3d
143#     include "lbc_nfd_nogather_generic.h90"
144#     undef ROUTINE_NFD
145#     define MULTI
146#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr
147#     include "lbc_nfd_nogather_generic.h90"
148#     undef ROUTINE_NFD
149#     undef MULTI
150#  undef DIM_3d
151   !
152   !                       !==  4D array and array of 4D pointer  ==!
153   !
154#  define DIM_4d
155#     define ROUTINE_NFD           lbc_nfd_nogather_4d
156#     include "lbc_nfd_nogather_generic.h90"
157#     undef ROUTINE_NFD
158!#     define MULTI
159!#     define ROUTINE_NFD           lbc_nfd_nogather_4d_ptr
160!#     include "lbc_nfd_nogather_generic.h90"
161!#     undef ROUTINE_NFD
162!#     undef MULTI
163#  undef DIM_4d
164
165   !!----------------------------------------------------------------------
166
167
168   !!======================================================================
169END MODULE lbcnfd
Note: See TracBrowser for help on using the repository browser.