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 utils/tools_AGRIF_CMEMS_2020/DOMAINcfg/src – NEMO

source: utils/tools_AGRIF_CMEMS_2020/DOMAINcfg/src/lbcnfd.F90 @ 10727

Last change on this file since 10727 was 10727, checked in by rblod, 5 years ago

new nesting tools (attempt) and brutal cleaning of DOMAINcfg, see ticket #2129

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
23   IMPLICIT NONE
24   PRIVATE
25
26   INTERFACE lbc_nfd
27      MODULE PROCEDURE   lbc_nfd_2d    , lbc_nfd_3d    , lbc_nfd_4d
28      MODULE PROCEDURE   lbc_nfd_2d_ptr, lbc_nfd_3d_ptr, lbc_nfd_4d_ptr
29      MODULE PROCEDURE   lbc_nfd_2d_ext
30   END INTERFACE
31   !
32   INTERFACE lbc_nfd_nogather
33!                        ! Currently only 4d array version is needed
34     MODULE PROCEDURE   lbc_nfd_nogather_2d    , lbc_nfd_nogather_3d
35     MODULE PROCEDURE   lbc_nfd_nogather_4d
36     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr, lbc_nfd_nogather_3d_ptr
37!     MODULE PROCEDURE   lbc_nfd_nogather_4d_ptr
38   END INTERFACE
39
40   TYPE, PUBLIC ::   PTR_2D   !: array of 2D pointers (also used in lib_mpp)
41      REAL(wp), DIMENSION (:,:)    , POINTER ::   pt2d
42   END TYPE PTR_2D
43   TYPE, PUBLIC ::   PTR_3D   !: array of 3D pointers (also used in lib_mpp)
44      REAL(wp), DIMENSION (:,:,:)  , POINTER ::   pt3d
45   END TYPE PTR_3D
46   TYPE, PUBLIC ::   PTR_4D   !: array of 4D pointers (also used in lib_mpp)
47      REAL(wp), DIMENSION (:,:,:,:), POINTER ::   pt4d
48   END TYPE PTR_4D
49
50   PUBLIC   lbc_nfd            ! north fold conditions
51   PUBLIC   lbc_nfd_nogather   ! north fold conditions (no allgather case)
52
53   INTEGER, PUBLIC, PARAMETER            ::   jpmaxngh = 3               !:
54   INTEGER, PUBLIC                       ::   nsndto, nfsloop, nfeloop   !:
55   INTEGER, PUBLIC, DIMENSION (jpmaxngh) ::   isendto                    !: processes to which communicate
56
57   !!----------------------------------------------------------------------
58   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
59   !! $Id: lbcnfd.F90 10425 2018-12-19 21:54:16Z smasson $
60   !! Software governed by the CeCILL license (see ./LICENSE)
61   !!----------------------------------------------------------------------
62CONTAINS
63
64   !!----------------------------------------------------------------------
65   !!                   ***  routine lbc_nfd_(2,3,4)d  ***
66   !!----------------------------------------------------------------------
67   !!
68   !! ** Purpose :   lateral boundary condition
69   !!                North fold treatment without processor exchanges.
70   !!
71   !! ** Method  :   
72   !!
73   !! ** Action  :   ptab with updated values along the north fold
74   !!----------------------------------------------------------------------
75   !
76   !                       !==  2D array and array of 2D pointer  ==!
77   !
78#  define DIM_2d
79#     define ROUTINE_NFD           lbc_nfd_2d
80#     include "lbc_nfd_generic.h90"
81#     undef ROUTINE_NFD
82#     define MULTI
83#     define ROUTINE_NFD           lbc_nfd_2d_ptr
84#     include "lbc_nfd_generic.h90"
85#     undef ROUTINE_NFD
86#     undef MULTI
87#  undef DIM_2d
88   !
89   !                       !==  2D array with extra haloes  ==!
90   !
91#  define DIM_2d
92#     define ROUTINE_NFD           lbc_nfd_2d_ext
93#     include "lbc_nfd_ext_generic.h90"
94#     undef ROUTINE_NFD
95#  undef DIM_2d
96   !
97   !                       !==  3D array and array of 3D pointer  ==!
98   !
99#  define DIM_3d
100#     define ROUTINE_NFD           lbc_nfd_3d
101#     include "lbc_nfd_generic.h90"
102#     undef ROUTINE_NFD
103#     define MULTI
104#     define ROUTINE_NFD           lbc_nfd_3d_ptr
105#     include "lbc_nfd_generic.h90"
106#     undef ROUTINE_NFD
107#     undef MULTI
108#  undef DIM_3d
109   !
110   !                       !==  4D array and array of 4D pointer  ==!
111   !
112#  define DIM_4d
113#     define ROUTINE_NFD           lbc_nfd_4d
114#     include "lbc_nfd_generic.h90"
115#     undef ROUTINE_NFD
116#     define MULTI
117#     define ROUTINE_NFD           lbc_nfd_4d_ptr
118#     include "lbc_nfd_generic.h90"
119#     undef ROUTINE_NFD
120#     undef MULTI
121#  undef DIM_4d
122   !
123   !  lbc_nfd_nogather routines
124   !
125   !                       !==  2D array and array of 2D pointer  ==!
126   !
127#  define DIM_2d
128#     define ROUTINE_NFD           lbc_nfd_nogather_2d
129#     include "lbc_nfd_nogather_generic.h90"
130#     undef ROUTINE_NFD
131#     define MULTI
132#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr
133#     include "lbc_nfd_nogather_generic.h90"
134#     undef ROUTINE_NFD
135#     undef MULTI
136#  undef DIM_2d
137   !
138   !                       !==  3D array and array of 3D pointer  ==!
139   !
140#  define DIM_3d
141#     define ROUTINE_NFD           lbc_nfd_nogather_3d
142#     include "lbc_nfd_nogather_generic.h90"
143#     undef ROUTINE_NFD
144#     define MULTI
145#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr
146#     include "lbc_nfd_nogather_generic.h90"
147#     undef ROUTINE_NFD
148#     undef MULTI
149#  undef DIM_3d
150   !
151   !                       !==  4D array and array of 4D pointer  ==!
152   !
153#  define DIM_4d
154#     define ROUTINE_NFD           lbc_nfd_nogather_4d
155#     include "lbc_nfd_nogather_generic.h90"
156#     undef ROUTINE_NFD
157!#     define MULTI
158!#     define ROUTINE_NFD           lbc_nfd_nogather_4d_ptr
159!#     include "lbc_nfd_nogather_generic.h90"
160!#     undef ROUTINE_NFD
161!#     undef MULTI
162#  undef DIM_4d
163
164   !!----------------------------------------------------------------------
165
166
167   !!======================================================================
168END MODULE lbcnfd
Note: See TracBrowser for help on using the repository browser.