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/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/LBC – NEMO

source: NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/LBC/lbcnfd.F90 @ 13228

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

better e3: update with trunk@13227 see #2385

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