[1344] | 1 | MODULE 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 |
---|
[9019] | 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 |
---|
[1344] | 31 | END INTERFACE |
---|
[6140] | 32 | ! |
---|
[9019] | 33 | INTERFACE lbc_nfd_nogather |
---|
| 34 | ! ! Currently only 4d array version is needed |
---|
[10425] | 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 |
---|
[9019] | 38 | ! MODULE PROCEDURE lbc_nfd_nogather_4d_ptr |
---|
[4230] | 39 | END INTERFACE |
---|
[2287] | 40 | |
---|
[9019] | 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 |
---|
[4230] | 50 | |
---|
[9019] | 51 | PUBLIC lbc_nfd ! north fold conditions |
---|
| 52 | PUBLIC lbc_nfd_nogather ! north fold conditions (no allgather case) |
---|
| 53 | |
---|
[6140] | 54 | INTEGER, PUBLIC, PARAMETER :: jpmaxngh = 3 !: |
---|
| 55 | INTEGER, PUBLIC :: nsndto, nfsloop, nfeloop !: |
---|
| 56 | INTEGER, PUBLIC, DIMENSION (jpmaxngh) :: isendto !: processes to which communicate |
---|
[4230] | 57 | |
---|
[1344] | 58 | !!---------------------------------------------------------------------- |
---|
[9598] | 59 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[2287] | 60 | !! $Id$ |
---|
[10068] | 61 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2287] | 62 | !!---------------------------------------------------------------------- |
---|
[1344] | 63 | CONTAINS |
---|
| 64 | |
---|
[9019] | 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 | ! |
---|
[10425] | 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 |
---|
[9019] | 138 | ! |
---|
| 139 | ! !== 3D array and array of 3D pointer ==! |
---|
| 140 | ! |
---|
[10425] | 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 |
---|
[9019] | 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 |
---|
[1344] | 164 | |
---|
[9019] | 165 | !!---------------------------------------------------------------------- |
---|
[1344] | 166 | |
---|
| 167 | |
---|
[6140] | 168 | !!====================================================================== |
---|
[1344] | 169 | END MODULE lbcnfd |
---|