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/trunk/src/OCE/LBC – NEMO

source: NEMO/trunk/src/OCE/LBC/lbcnfd.F90 @ 13286

Last change on this file since 13286 was 13286, checked in by smasson, 4 years ago

trunk: merge extra halos branch in trunk, see #2366

  • Property svn:keywords set to Id
File size: 10.1 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_sp    , lbc_nfd_3d_sp    , lbc_nfd_4d_sp
29      MODULE PROCEDURE   lbc_nfd_2d_ptr_sp, lbc_nfd_3d_ptr_sp, lbc_nfd_4d_ptr_sp
30      MODULE PROCEDURE   lbc_nfd_2d_ext_sp
31      MODULE PROCEDURE   lbc_nfd_2d_dp    , lbc_nfd_3d_dp    , lbc_nfd_4d_dp
32      MODULE PROCEDURE   lbc_nfd_2d_ptr_dp, lbc_nfd_3d_ptr_dp, lbc_nfd_4d_ptr_dp
33      MODULE PROCEDURE   lbc_nfd_2d_ext_dp
34   END INTERFACE
35   !
36   INTERFACE lbc_nfd_nogather
37!                        ! Currently only 4d array version is needed
38     MODULE PROCEDURE   lbc_nfd_nogather_2d_sp    , lbc_nfd_nogather_3d_sp
39     MODULE PROCEDURE   lbc_nfd_nogather_4d_sp
40     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr_sp, lbc_nfd_nogather_3d_ptr_sp
41     MODULE PROCEDURE   lbc_nfd_nogather_2d_dp    , lbc_nfd_nogather_3d_dp
42     MODULE PROCEDURE   lbc_nfd_nogather_4d_dp
43     MODULE PROCEDURE   lbc_nfd_nogather_2d_ptr_dp, lbc_nfd_nogather_3d_ptr_dp
44!     MODULE PROCEDURE   lbc_nfd_nogather_4d_ptr
45   END INTERFACE
46
47   TYPE, PUBLIC ::   PTR_2D_dp   !: array of 2D pointers (also used in lib_mpp)
48      REAL(dp), DIMENSION (:,:)    , POINTER ::   pt2d
49   END TYPE PTR_2D_dp
50   TYPE, PUBLIC ::   PTR_3D_dp   !: array of 3D pointers (also used in lib_mpp)
51      REAL(dp), DIMENSION (:,:,:)  , POINTER ::   pt3d
52   END TYPE PTR_3D_dp
53   TYPE, PUBLIC ::   PTR_4D_dp   !: array of 4D pointers (also used in lib_mpp)
54      REAL(dp), DIMENSION (:,:,:,:), POINTER ::   pt4d
55   END TYPE PTR_4D_dp
56
57   TYPE, PUBLIC ::   PTR_2D_sp   !: array of 2D pointers (also used in lib_mpp)
58      REAL(sp), DIMENSION (:,:)    , POINTER ::   pt2d
59   END TYPE PTR_2D_sp
60   TYPE, PUBLIC ::   PTR_3D_sp   !: array of 3D pointers (also used in lib_mpp)
61      REAL(sp), DIMENSION (:,:,:)  , POINTER ::   pt3d
62   END TYPE PTR_3D_sp
63   TYPE, PUBLIC ::   PTR_4D_sp   !: array of 4D pointers (also used in lib_mpp)
64      REAL(sp), DIMENSION (:,:,:,:), POINTER ::   pt4d
65   END TYPE PTR_4D_sp
66
67
68   PUBLIC   lbc_nfd            ! north fold conditions
69   PUBLIC   lbc_nfd_nogather   ! north fold conditions (no allgather case)
70
71   INTEGER, PUBLIC, PARAMETER            ::   jpmaxngh = 3               !:
72   INTEGER, PUBLIC                       ::   nsndto                     !:
73   INTEGER, PUBLIC, DIMENSION (jpmaxngh) ::   isendto                    !: processes to which communicate
74   INTEGER, PUBLIC                       ::   ijpj
75
76   !!----------------------------------------------------------------------
77   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
78   !! $Id$
79   !! Software governed by the CeCILL license (see ./LICENSE)
80   !!----------------------------------------------------------------------
81CONTAINS
82
83   !!----------------------------------------------------------------------
84   !!                   ***  routine lbc_nfd_(2,3,4)d  ***
85   !!----------------------------------------------------------------------
86   !!
87   !! ** Purpose :   lateral boundary condition
88   !!                North fold treatment without processor exchanges.
89   !!
90   !! ** Method  :   
91   !!
92   !! ** Action  :   ptab with updated values along the north fold
93   !!----------------------------------------------------------------------
94   !
95   !                       !==  SINGLE PRECISION VERSIONS
96   !
97   !
98   !                       !==  2D array and array of 2D pointer  ==!
99   !
100#  define SINGLE_PRECISION
101#  define DIM_2d
102#     define ROUTINE_NFD           lbc_nfd_2d_sp
103#     include "lbc_nfd_generic.h90"
104#     undef ROUTINE_NFD
105#     define MULTI
106#     define ROUTINE_NFD           lbc_nfd_2d_ptr_sp
107#     include "lbc_nfd_generic.h90"
108#     undef ROUTINE_NFD
109#     undef MULTI
110#  undef DIM_2d
111   !
112   !                       !==  2D array with extra haloes  ==!
113   !
114#  define DIM_2d
115#     define ROUTINE_NFD           lbc_nfd_2d_ext_sp
116#     include "lbc_nfd_ext_generic.h90"
117#     undef ROUTINE_NFD
118#  undef DIM_2d
119   !
120   !                       !==  3D array and array of 3D pointer  ==!
121   !
122#  define DIM_3d
123#     define ROUTINE_NFD           lbc_nfd_3d_sp
124#     include "lbc_nfd_generic.h90"
125#     undef ROUTINE_NFD
126#     define MULTI
127#     define ROUTINE_NFD           lbc_nfd_3d_ptr_sp
128#     include "lbc_nfd_generic.h90"
129#     undef ROUTINE_NFD
130#     undef MULTI
131#  undef DIM_3d
132   !
133   !                       !==  4D array and array of 4D pointer  ==!
134   !
135#  define DIM_4d
136#     define ROUTINE_NFD           lbc_nfd_4d_sp
137#     include "lbc_nfd_generic.h90"
138#     undef ROUTINE_NFD
139#     define MULTI
140#     define ROUTINE_NFD           lbc_nfd_4d_ptr_sp
141#     include "lbc_nfd_generic.h90"
142#     undef ROUTINE_NFD
143#     undef MULTI
144#  undef DIM_4d
145   !
146   !  lbc_nfd_nogather routines
147   !
148   !                       !==  2D array and array of 2D pointer  ==!
149   !
150#  define DIM_2d
151#     define ROUTINE_NFD           lbc_nfd_nogather_2d_sp
152#     include "lbc_nfd_nogather_generic.h90"
153#     undef ROUTINE_NFD
154#     define MULTI
155#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr_sp
156#     include "lbc_nfd_nogather_generic.h90"
157#     undef ROUTINE_NFD
158#     undef MULTI
159#  undef DIM_2d
160   !
161   !                       !==  3D array and array of 3D pointer  ==!
162   !
163#  define DIM_3d
164#     define ROUTINE_NFD           lbc_nfd_nogather_3d_sp
165#     include "lbc_nfd_nogather_generic.h90"
166#     undef ROUTINE_NFD
167#     define MULTI
168#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr_sp
169#     include "lbc_nfd_nogather_generic.h90"
170#     undef ROUTINE_NFD
171#     undef MULTI
172#  undef DIM_3d
173   !
174   !                       !==  4D array and array of 4D pointer  ==!
175   !
176#  define DIM_4d
177#     define ROUTINE_NFD           lbc_nfd_nogather_4d_sp
178#     include "lbc_nfd_nogather_generic.h90"
179#     undef ROUTINE_NFD
180!#     define MULTI
181!#     define ROUTINE_NFD           lbc_nfd_nogather_4d_ptr
182!#     include "lbc_nfd_nogather_generic.h90"
183!#     undef ROUTINE_NFD
184!#     undef MULTI
185#  undef DIM_4d
186#  undef SINGLE_PRECISION
187
188   !!----------------------------------------------------------------------
189   !
190   !                       !==  DOUBLE PRECISION VERSIONS
191   !
192   !
193   !                       !==  2D array and array of 2D pointer  ==!
194   !
195#  define DIM_2d
196#     define ROUTINE_NFD           lbc_nfd_2d_dp
197#     include "lbc_nfd_generic.h90"
198#     undef ROUTINE_NFD
199#     define MULTI
200#     define ROUTINE_NFD           lbc_nfd_2d_ptr_dp
201#     include "lbc_nfd_generic.h90"
202#     undef ROUTINE_NFD
203#     undef MULTI
204#  undef DIM_2d
205   !
206   !                       !==  2D array with extra haloes  ==!
207   !
208#  define DIM_2d
209#     define ROUTINE_NFD           lbc_nfd_2d_ext_dp
210#     include "lbc_nfd_ext_generic.h90"
211#     undef ROUTINE_NFD
212#  undef DIM_2d
213   !
214   !                       !==  3D array and array of 3D pointer  ==!
215   !
216#  define DIM_3d
217#     define ROUTINE_NFD           lbc_nfd_3d_dp
218#     include "lbc_nfd_generic.h90"
219#     undef ROUTINE_NFD
220#     define MULTI
221#     define ROUTINE_NFD           lbc_nfd_3d_ptr_dp
222#     include "lbc_nfd_generic.h90"
223#     undef ROUTINE_NFD
224#     undef MULTI
225#  undef DIM_3d
226   !
227   !                       !==  4D array and array of 4D pointer  ==!
228   !
229#  define DIM_4d
230#     define ROUTINE_NFD           lbc_nfd_4d_dp
231#     include "lbc_nfd_generic.h90"
232#     undef ROUTINE_NFD
233#     define MULTI
234#     define ROUTINE_NFD           lbc_nfd_4d_ptr_dp
235#     include "lbc_nfd_generic.h90"
236#     undef ROUTINE_NFD
237#     undef MULTI
238#  undef DIM_4d
239   !
240   !  lbc_nfd_nogather routines
241   !
242   !                       !==  2D array and array of 2D pointer  ==!
243   !
244#  define DIM_2d
245#     define ROUTINE_NFD           lbc_nfd_nogather_2d_dp
246#     include "lbc_nfd_nogather_generic.h90"
247#     undef ROUTINE_NFD
248#     define MULTI
249#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr_dp
250#     include "lbc_nfd_nogather_generic.h90"
251#     undef ROUTINE_NFD
252#     undef MULTI
253#  undef DIM_2d
254   !
255   !                       !==  3D array and array of 3D pointer  ==!
256   !
257#  define DIM_3d
258#     define ROUTINE_NFD           lbc_nfd_nogather_3d_dp
259#     include "lbc_nfd_nogather_generic.h90"
260#     undef ROUTINE_NFD
261#     define MULTI
262#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr_dp
263#     include "lbc_nfd_nogather_generic.h90"
264#     undef ROUTINE_NFD
265#     undef MULTI
266#  undef DIM_3d
267   !
268   !                       !==  4D array and array of 4D pointer  ==!
269   !
270#  define DIM_4d
271#     define ROUTINE_NFD           lbc_nfd_nogather_4d_dp
272#     include "lbc_nfd_nogather_generic.h90"
273#     undef ROUTINE_NFD
274!#     define MULTI
275!#     define ROUTINE_NFD           lbc_nfd_nogather_4d_ptr
276!#     include "lbc_nfd_nogather_generic.h90"
277!#     undef ROUTINE_NFD
278!#     undef MULTI
279#  undef DIM_4d
280
281   !!----------------------------------------------------------------------
282
283
284
285   !!======================================================================
286END MODULE lbcnfd
Note: See TracBrowser for help on using the repository browser.