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/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90 @ 2613

Last change on this file since 2613 was 2613, checked in by gm, 12 years ago

dynamic mem: #785 ; move the allocation of ice in iceini_2/iceini module + bug fixes (define key_esopa)

  • Property svn:keywords set to Id
File size: 6.9 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   !!----------------------------------------------------------------------
10#if defined key_bdy 
11   !!----------------------------------------------------------------------
12   !!   'key_bdy'                      Unstructured Open Boundary Condition
13   !!----------------------------------------------------------------------
14   USE par_oce         ! ocean parameters
15   USE bdy_par         ! Unstructured boundary parameters
16
17   IMPLICIT NONE
18   PUBLIC
19
20   !!----------------------------------------------------------------------
21   !! Namelist variables
22   !!----------------------------------------------------------------------
23   CHARACTER(len=80) ::   cn_mask        !: Name of unstruct. bdy mask file
24   CHARACTER(len=80) ::   cn_dta_frs_T   !: Name of unstruct. bdy data file at T points for FRS conditions
25   CHARACTER(len=80) ::   cn_dta_frs_U   !: Name of unstruct. bdy data file at U points for FRS conditions
26   CHARACTER(len=80) ::   cn_dta_frs_V   !: Name of unstruct. bdy data file at V points for FRS conditions
27   CHARACTER(len=80) ::   cn_dta_fla_T   !: Name of unstruct. bdy data file at T points for Flather scheme
28   CHARACTER(len=80) ::   cn_dta_fla_U   !: Name of unstruct. bdy data file at U points for Flather scheme
29   CHARACTER(len=80) ::   cn_dta_fla_V   !: Name of unstruct. bdy data file at V points for Flather scheme
30   !
31   LOGICAL ::   ln_tides = .false.    !: =T apply tidal harmonic forcing along open boundaries
32   LOGICAL ::   ln_vol  = .false.     !: =T volume correction             
33   LOGICAL ::   ln_mask = .false.     !: =T read bdymask from file
34   LOGICAL ::   ln_clim = .false.     !: =T bdy data files contain  1 time dump  (-->bdy forcing will be constant)
35   !                                  !                         or 12 months     (-->bdy forcing will be cyclic)
36   LOGICAL ::   ln_dyn_fla  = .false. !: =T Flather boundary conditions on barotropic velocities
37   LOGICAL ::   ln_dyn_frs  = .false. !: =T FRS boundary conditions on velocities
38   LOGICAL ::   ln_tra_frs  = .false. !: =T FRS boundary conditions on tracers (T and S)
39   LOGICAL ::   ln_ice_frs  = .false. !: =T FRS boundary conditions on seaice (leads fraction, ice depth, snow depth)
40   !
41   INTEGER ::   nn_rimwidth = 7       !: boundary rim width
42   INTEGER ::   nn_dtactl   = 1       !: = 0 use the initial state as bdy dta ; = 1 read it in a NetCDF file
43   INTEGER ::   nn_volctl   = 1       !: = 0 the total volume will have the variability of the surface Flux E-P
44   !                                  !  = 1 the volume will be constant during all the integration.
45
46   !!----------------------------------------------------------------------
47   !! Global variables
48   !!----------------------------------------------------------------------
49   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdytmask   !: Mask defining computational domain at T-points
50   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyumask   !: Mask defining computational domain at U-points
51   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   bdyvmask   !: Mask defining computational domain at V-points
52
53   !!----------------------------------------------------------------------
54   !! Unstructured open boundary data variables
55   !!----------------------------------------------------------------------
56   INTEGER, DIMENSION(jpbgrd) ::   nblen    = 0           !: Size of bdy data on a proc for each grid type
57   INTEGER, DIMENSION(jpbgrd) ::   nblenrim = 0           !: Size of bdy data on a proc for first rim ind
58   INTEGER, DIMENSION(jpbgrd) ::   nblendta = 0           !: Size of bdy data in file
59
60   INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbi, nbj        !: i and j indices of bdy dta
61   INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbr             !: Discrete distance from rim points
62   INTEGER, DIMENSION(jpbdim,jpbgrd) ::   nbmap           !: Indices of data in file for data in memory
63   
64   REAL(wp) ::   bdysurftot                               !: Lateral surface of unstructured open boundary
65
66   REAL(wp), DIMENSION(jpbdim)        ::   flagu, flagv   !: Flag for normal velocity compnt for velocity components
67   REAL(wp), DIMENSION(jpbdim,jpbgrd) ::   nbw            !: Rim weights of bdy data
68
69   REAL(wp), DIMENSION(jpbdim)     ::   sshbdy            !: Now clim of bdy sea surface height (Flather)
70   REAL(wp), DIMENSION(jpbdim)     ::   ubtbdy, vbtbdy    !: Now clim of bdy barotropic velocity components
71   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tbdy  , sbdy      !: Now clim of bdy temperature and salinity 
72   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ubdy  , vbdy    !: Now clim of bdy velocity components
73   REAL(wp), DIMENSION(jpbdim) ::   sshtide               !: Tidal boundary array : SSH
74   REAL(wp), DIMENSION(jpbdim) ::   utide, vtide          !: Tidal boundary array : U and V
75#if defined key_lim2
76   REAL(wp), DIMENSION(jpbdim) ::   frld_bdy    !: now ice leads fraction climatology   
77   REAL(wp), DIMENSION(jpbdim) ::   hicif_bdy   !: Now ice  thickness climatology
78   REAL(wp), DIMENSION(jpbdim) ::   hsnif_bdy   !: now snow thickness
79#endif
80
81   !!----------------------------------------------------------------------
82   !! NEMO/OPA 4.0 , NEMO Consortium (2011)
83   !! $Id$
84   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
85   !!----------------------------------------------------------------------
86CONTAINS
87
88   FUNCTION bdy_oce_alloc()
89      !!----------------------------------------------------------------------
90      INTEGER :: bdy_oce_alloc
91      !!----------------------------------------------------------------------
92      !
93      ALLOCATE( bdytmask(jpi,jpj) , tbdy(jpbdim,jpk) , sbdy(jpbdim,jpk) ,     &
94         &      bdyumask(jpi,jpj) , ubdy(jpbdim,jpk) ,                        &
95         &      bdyvmask(jpi,jpj) , vbdy(jpbdim,jpk) ,                    STAT=bdy_oce_alloc )
96         !
97      IF( lk_mpp             )   CALL mpp_sum ( bdy_oce_alloc )
98      IF( bdy_oce_alloc /= 0 )   CALL ctl_warn('bdy_oce_alloc: failed to allocate arrays.')
99      !
100   END FUNCTION bdy_oce_alloc
101
102#else
103   !!----------------------------------------------------------------------
104   !!   Dummy module                NO Unstructured Open Boundary Condition
105   !!----------------------------------------------------------------------
106   LOGICAL ::   ln_tides = .false.  !: =T apply tidal harmonic forcing along open boundaries
107#endif
108
109   !!======================================================================
110END MODULE bdy_oce
Note: See TracBrowser for help on using the repository browser.