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.
bdy_oce.F90 in branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: branches/NERC/dev_r3874_FASTNEt/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90 @ 6736

Last change on this file since 6736 was 6736, checked in by jamesharle, 8 years ago

FASTNEt code modifications

  • Property svn:keywords set to Id
File size: 8.3 KB
Line 
1MODULE bdy_oce
2   !!======================================================================
3   !!                       ***  MODULE bdy_oce   ***
4   !! Unstructured Open Boundary Cond. :   define related variables
5   !!======================================================================
6   !! History :  1.0  !  2001-05  (J. Chanut, A. Sellar)  Original code
7   !!            3.0  !  2008-04  (NEMO team)  add in the reference version     
8   !!            3.3  !  2010-09  (D. Storkey) add ice boundary conditions
9   !!            3.4  !  2011     (D. Storkey) rewrite in preparation for OBC-BDY merge
10   !!----------------------------------------------------------------------
11#if defined key_bdy 
12   !!----------------------------------------------------------------------
13   !!   'key_bdy'                      Unstructured Open Boundary Condition
14   !!----------------------------------------------------------------------
15   USE par_oce         ! ocean parameters
16   USE bdy_par         ! Unstructured boundary parameters
17   USE lib_mpp         ! distributed memory computing
18
19   IMPLICIT NONE
20   PUBLIC
21
22   TYPE, PUBLIC ::   OBC_INDEX    !: Indices and weights which define the open boundary
23      INTEGER,          DIMENSION(jpbgrd) ::  nblen
24      INTEGER,          DIMENSION(jpbgrd) ::  nblenrim
25      INTEGER, POINTER, DIMENSION(:,:)   ::  nbi
26      INTEGER, POINTER, DIMENSION(:,:)   ::  nbj
27      INTEGER, POINTER, DIMENSION(:,:)   ::  nbr
28      INTEGER, POINTER, DIMENSION(:,:)   ::  nbmap
29      REAL   , POINTER, DIMENSION(:,:)   ::  nbw
30      REAL   , POINTER, DIMENSION(:,:,:)   ::  nbz
31      REAL   , POINTER, DIMENSION(:)     ::  flagu
32      REAL   , POINTER, DIMENSION(:)     ::  flagv
33   END TYPE OBC_INDEX
34
35   TYPE, PUBLIC ::   OBC_DATA     !: Storage for external data
36      REAL, POINTER, DIMENSION(:)     ::  ssh
37      REAL, POINTER, DIMENSION(:)     ::  u2d
38      REAL, POINTER, DIMENSION(:)     ::  v2d
39      REAL, POINTER, DIMENSION(:,:)   ::  u3d
40      REAL, POINTER, DIMENSION(:,:)   ::  v3d
41      REAL, POINTER, DIMENSION(:,:)   ::  tem
42      REAL, POINTER, DIMENSION(:,:)   ::  sal
43#if defined key_lim2
44      REAL, POINTER, DIMENSION(:)     ::  frld
45      REAL, POINTER, DIMENSION(:)     ::  hicif
46      REAL, POINTER, DIMENSION(:)     ::  hsnif
47#endif
48   END TYPE OBC_DATA 
49
50   !!----------------------------------------------------------------------
51   !! Namelist variables
52   !!----------------------------------------------------------------------
53   CHARACTER(len=80), DIMENSION(jp_bdy) ::   cn_coords_file !: Name of bdy coordinates file
54   CHARACTER(len=80)                    ::   cn_mask_file   !: Name of bdy mask file
55   !
56   LOGICAL, DIMENSION(jp_bdy) ::   ln_coords_file           !: =T read bdy coordinates from file;
57   !                                                        !: =F read bdy coordinates from namelist
58   LOGICAL                    ::   ln_mask_file             !: =T read bdymask from file
59   LOGICAL                    ::   ln_vol                   !: =T volume correction             
60   !
61   INTEGER                    ::   nb_bdy                   !: number of open boundary sets
62   INTEGER, DIMENSION(jp_bdy) ::   nn_rimwidth              !: boundary rim width for Flow Relaxation Scheme
63   INTEGER                    ::   nn_volctl                !: = 0 the total volume will have the variability of the surface Flux E-P
64   !                                                        !  = 1 the volume will be constant during all the integration.
65   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn2d                 ! Choice of boundary condition for barotropic variables (U,V,SSH)
66   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn2d_dta           !: = 0 use the initial state as bdy dta ;
67                                                            !: = 1 read it in a NetCDF file
68                                                            !: = 2 read tidal harmonic forcing from a NetCDF file
69                                                            !: = 3 read external data AND tidal harmonic forcing from NetCDF files
70   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn3d                 ! Choice of boundary condition for baroclinic velocities
71   INTEGER, DIMENSION(jp_bdy) ::   nn_dyn3d_dta           !: = 0 use the initial state as bdy dta ;
72                                                            !: = 1 read it in a NetCDF file
73   INTEGER, DIMENSION(jp_bdy) ::   nn_tra                   ! Choice of boundary condition for active tracers (T and S)
74   INTEGER, DIMENSION(jp_bdy) ::   nn_tra_dta             !: = 0 use the initial state as bdy dta ;
75                                                            !: = 1 read it in a NetCDF file
76   INTEGER                    ::   nb_jpk              ! Number of levels in the bdy data (set < 0 if consistent with planned run)
77#if defined key_lim2
78   INTEGER, DIMENSION(jp_bdy) ::   nn_ice_lim2              ! Choice of boundary condition for sea ice variables
79   INTEGER, DIMENSION(jp_bdy) ::   nn_ice_lim2_dta          !: = 0 use the initial state as bdy dta ;
80                                                            !: = 1 read it in a NetCDF file
81#endif
82   !
83   
84   !!----------------------------------------------------------------------
85   !! Global variables
86   !!----------------------------------------------------------------------
87   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdytmask   !: Mask defining computational domain at T-points
88   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyumask   !: Mask defining computational domain at U-points
89   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyvmask   !: Mask defining computational domain at V-points
90
91   REAL(wp)                                    ::   bdysurftot !: Lateral surface of unstructured open boundary
92
93   REAL(wp), POINTER, DIMENSION(:,:)           ::   pssh       !:
94   REAL(wp), POINTER, DIMENSION(:,:)           ::   phur       !:
95   REAL(wp), POINTER, DIMENSION(:,:)           ::   phvr       !: Pointers for barotropic fields
96   REAL(wp), POINTER, DIMENSION(:,:)           ::   pu2d       !:
97   REAL(wp), POINTER, DIMENSION(:,:)           ::   pv2d       !:
98
99   !!----------------------------------------------------------------------
100   !! open boundary data variables
101   !!----------------------------------------------------------------------
102
103   INTEGER,  DIMENSION(jp_bdy)                     ::   nn_dta            !: =0 => *all* data is set to initial conditions
104                                                                          !: =1 => some data to be read in from data files
105   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::   dta_global        !: workspace for reading in global data arrays
106   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET ::   dta_global_1      !: workspace for reading in global data arrays
107   REAL(wp), ALLOCATABLE, DIMENSION(:,:  ), TARGET ::   dta_global_2      !: workspace for reading in global data arrays
108   TYPE(OBC_INDEX), DIMENSION(jp_bdy), TARGET      ::   idx_bdy           !: bdy indices (local process)
109   TYPE(OBC_DATA) , DIMENSION(jp_bdy)              ::   dta_bdy           !: bdy external data (local process)
110
111   !!----------------------------------------------------------------------
112   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
113   !! $Id$
114   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
115   !!----------------------------------------------------------------------
116CONTAINS
117
118   FUNCTION bdy_oce_alloc()
119      !!----------------------------------------------------------------------
120      USE lib_mpp, ONLY: ctl_warn, mpp_sum
121      !
122      INTEGER :: bdy_oce_alloc
123      !!----------------------------------------------------------------------
124      !
125      ALLOCATE( bdytmask(jpi,jpj) , bdyumask(jpi,jpj), bdyvmask(jpi,jpj),                    & 
126         &      STAT=bdy_oce_alloc )
127         !
128      IF( lk_mpp             )   CALL mpp_sum ( bdy_oce_alloc )
129      IF( bdy_oce_alloc /= 0 )   CALL ctl_warn('bdy_oce_alloc: failed to allocate arrays.')
130      !
131   END FUNCTION bdy_oce_alloc
132
133#else
134   !!----------------------------------------------------------------------
135   !!   Dummy module                NO Unstructured Open Boundary Condition
136   !!----------------------------------------------------------------------
137   LOGICAL ::   ln_tides = .false.  !: =T apply tidal harmonic forcing along open boundaries
138#endif
139
140   !!======================================================================
141END MODULE bdy_oce
142
Note: See TracBrowser for help on using the repository browser.