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
RevLine 
[1344]1MODULE lbcnfd
2   !!======================================================================
3   !!                       ***  MODULE  lbcnfd  ***
4   !! Ocean        : north fold  boundary conditions
5   !!======================================================================
[2413]6   !! History :  3.2  ! 2009-03  (R. Benshila)  Original code
[9019]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)
[1344]9   !!----------------------------------------------------------------------
10
[2413]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)
[9019]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)
[2413]19   !!----------------------------------------------------------------------
20   USE dom_oce        ! ocean space and time domain
21   USE in_out_manager ! I/O manager
[11536]22   USE lib_mpp        ! MPP library
[2413]23
[1344]24   IMPLICIT NONE
25   PRIVATE
26
27   INTERFACE lbc_nfd
[13226]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
[1344]34   END INTERFACE
[6140]35   !
[9019]36   INTERFACE lbc_nfd_nogather
37!                        ! Currently only 4d array version is needed
[13226]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
[9019]44!     MODULE PROCEDURE   lbc_nfd_nogather_4d_ptr
[4230]45   END INTERFACE
[2287]46
[13226]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
[4230]56
[13226]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
[9019]68   PUBLIC   lbc_nfd            ! north fold conditions
69   PUBLIC   lbc_nfd_nogather   ! north fold conditions (no allgather case)
70
[6140]71   INTEGER, PUBLIC, PARAMETER            ::   jpmaxngh = 3               !:
[13286]72   INTEGER, PUBLIC                       ::   nsndto                     !:
[6140]73   INTEGER, PUBLIC, DIMENSION (jpmaxngh) ::   isendto                    !: processes to which communicate
[13286]74   INTEGER, PUBLIC                       ::   ijpj
[4230]75
[1344]76   !!----------------------------------------------------------------------
[9598]77   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[2287]78   !! $Id$
[10068]79   !! Software governed by the CeCILL license (see ./LICENSE)
[2287]80   !!----------------------------------------------------------------------
[1344]81CONTAINS
82
[9019]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   !
[13226]95   !                       !==  SINGLE PRECISION VERSIONS
96   !
97   !
[9019]98   !                       !==  2D array and array of 2D pointer  ==!
99   !
[13226]100#  define SINGLE_PRECISION
[9019]101#  define DIM_2d
[13226]102#     define ROUTINE_NFD           lbc_nfd_2d_sp
[9019]103#     include "lbc_nfd_generic.h90"
104#     undef ROUTINE_NFD
105#     define MULTI
[13226]106#     define ROUTINE_NFD           lbc_nfd_2d_ptr_sp
[9019]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
[13226]115#     define ROUTINE_NFD           lbc_nfd_2d_ext_sp
[9019]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
[13226]123#     define ROUTINE_NFD           lbc_nfd_3d_sp
[9019]124#     include "lbc_nfd_generic.h90"
125#     undef ROUTINE_NFD
126#     define MULTI
[13226]127#     define ROUTINE_NFD           lbc_nfd_3d_ptr_sp
[9019]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
[13226]136#     define ROUTINE_NFD           lbc_nfd_4d_sp
[9019]137#     include "lbc_nfd_generic.h90"
138#     undef ROUTINE_NFD
139#     define MULTI
[13226]140#     define ROUTINE_NFD           lbc_nfd_4d_ptr_sp
[9019]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   !
[10425]150#  define DIM_2d
[13226]151#     define ROUTINE_NFD           lbc_nfd_nogather_2d_sp
[10425]152#     include "lbc_nfd_nogather_generic.h90"
153#     undef ROUTINE_NFD
154#     define MULTI
[13226]155#     define ROUTINE_NFD           lbc_nfd_nogather_2d_ptr_sp
[10425]156#     include "lbc_nfd_nogather_generic.h90"
157#     undef ROUTINE_NFD
158#     undef MULTI
159#  undef DIM_2d
[9019]160   !
161   !                       !==  3D array and array of 3D pointer  ==!
162   !
[10425]163#  define DIM_3d
[13226]164#     define ROUTINE_NFD           lbc_nfd_nogather_3d_sp
[10425]165#     include "lbc_nfd_nogather_generic.h90"
166#     undef ROUTINE_NFD
167#     define MULTI
[13226]168#     define ROUTINE_NFD           lbc_nfd_nogather_3d_ptr_sp
[10425]169#     include "lbc_nfd_nogather_generic.h90"
170#     undef ROUTINE_NFD
171#     undef MULTI
172#  undef DIM_3d
[9019]173   !
174   !                       !==  4D array and array of 4D pointer  ==!
175   !
176#  define DIM_4d
[13226]177#     define ROUTINE_NFD           lbc_nfd_nogather_4d_sp
[9019]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
[13226]186#  undef SINGLE_PRECISION
[1344]187
[9019]188   !!----------------------------------------------------------------------
[13226]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
[1344]280
[13226]281   !!----------------------------------------------------------------------
[1344]282
[13226]283
284
[6140]285   !!======================================================================
[1344]286END MODULE lbcnfd
Note: See TracBrowser for help on using the repository browser.