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