[911] | 1 | MODULE bdy_oce |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE bdy_oce *** |
---|
| 4 | !! Unstructured Open Boundary Cond. : define related variables |
---|
| 5 | !!====================================================================== |
---|
[1125] | 6 | !! History : 1.0 ! 2001-05 (J. Chanut, A. Sellar) Original code |
---|
| 7 | !! 3.0 ! 2008-04 (NEMO team) add in the reference version |
---|
[2528] | 8 | !! 3.3 ! 2010-09 (D. Storkey) add ice boundary conditions |
---|
[3294] | 9 | !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge |
---|
[9656] | 10 | !! 3.6 ! 2014-01 (C. Rousset) add ice boundary conditions for new model |
---|
| 11 | !! 4.0 ! 2018 (C. Rousset) SI3 compatibility |
---|
[911] | 12 | !!---------------------------------------------------------------------- |
---|
| 13 | USE par_oce ! ocean parameters |
---|
| 14 | |
---|
| 15 | IMPLICIT NONE |
---|
| 16 | PUBLIC |
---|
| 17 | |
---|
[7646] | 18 | INTEGER, PUBLIC, PARAMETER :: jp_bdy = 10 !: Maximum number of bdy sets |
---|
| 19 | INTEGER, PUBLIC, PARAMETER :: jpbgrd = 3 !: Number of horizontal grid types used (T, U, V) |
---|
| 20 | |
---|
[3294] | 21 | TYPE, PUBLIC :: OBC_INDEX !: Indices and weights which define the open boundary |
---|
[5836] | 22 | INTEGER , DIMENSION(jpbgrd) :: nblen |
---|
| 23 | INTEGER , DIMENSION(jpbgrd) :: nblenrim |
---|
| 24 | INTEGER , POINTER, DIMENSION(:,:) :: nbi |
---|
| 25 | INTEGER , POINTER, DIMENSION(:,:) :: nbj |
---|
| 26 | INTEGER , POINTER, DIMENSION(:,:) :: nbr |
---|
| 27 | INTEGER , POINTER, DIMENSION(:,:) :: nbmap |
---|
| 28 | REAL(wp), POINTER, DIMENSION(:,:) :: nbw |
---|
| 29 | REAL(wp), POINTER, DIMENSION(:,:) :: nbd |
---|
| 30 | REAL(wp), POINTER, DIMENSION(:,:) :: nbdout |
---|
| 31 | REAL(wp), POINTER, DIMENSION(:,:) :: flagu |
---|
| 32 | REAL(wp), POINTER, DIMENSION(:,:) :: flagv |
---|
[3294] | 33 | END TYPE OBC_INDEX |
---|
| 34 | |
---|
[4292] | 35 | !! Logicals in OBC_DATA structure are true if the chosen algorithm requires this |
---|
| 36 | !! field as external data. If true the data can come from external files |
---|
| 37 | !! or model initial conditions. If false then no "external" data array |
---|
| 38 | !! is required for this field. |
---|
| 39 | |
---|
[3294] | 40 | TYPE, PUBLIC :: OBC_DATA !: Storage for external data |
---|
[5836] | 41 | INTEGER , DIMENSION(2) :: nread |
---|
| 42 | LOGICAL :: ll_ssh |
---|
| 43 | LOGICAL :: ll_u2d |
---|
| 44 | LOGICAL :: ll_v2d |
---|
| 45 | LOGICAL :: ll_u3d |
---|
| 46 | LOGICAL :: ll_v3d |
---|
| 47 | LOGICAL :: ll_tem |
---|
| 48 | LOGICAL :: ll_sal |
---|
[7646] | 49 | LOGICAL :: ll_fvl |
---|
[5836] | 50 | REAL(wp), POINTER, DIMENSION(:) :: ssh |
---|
| 51 | REAL(wp), POINTER, DIMENSION(:) :: u2d |
---|
| 52 | REAL(wp), POINTER, DIMENSION(:) :: v2d |
---|
| 53 | REAL(wp), POINTER, DIMENSION(:,:) :: u3d |
---|
| 54 | REAL(wp), POINTER, DIMENSION(:,:) :: v3d |
---|
| 55 | REAL(wp), POINTER, DIMENSION(:,:) :: tem |
---|
| 56 | REAL(wp), POINTER, DIMENSION(:,:) :: sal |
---|
[9570] | 57 | #if defined key_si3 |
---|
[5836] | 58 | LOGICAL :: ll_a_i |
---|
[9019] | 59 | LOGICAL :: ll_h_i |
---|
| 60 | LOGICAL :: ll_h_s |
---|
[5836] | 61 | REAL(wp), POINTER, DIMENSION(:,:) :: a_i !: now ice leads fraction climatology |
---|
[9019] | 62 | REAL(wp), POINTER, DIMENSION(:,:) :: h_i !: Now ice thickness climatology |
---|
| 63 | REAL(wp), POINTER, DIMENSION(:,:) :: h_s !: now snow thickness |
---|
[3294] | 64 | #endif |
---|
[6140] | 65 | #if defined key_top |
---|
| 66 | CHARACTER(LEN=20) :: cn_obc !: type of boundary condition to apply |
---|
| 67 | REAL(wp) :: rn_fac !: multiplicative scaling factor |
---|
| 68 | REAL(wp), POINTER, DIMENSION(:,:) :: trc !: now field of the tracer |
---|
| 69 | LOGICAL :: dmp !: obc damping term |
---|
| 70 | #endif |
---|
[3294] | 71 | END TYPE OBC_DATA |
---|
| 72 | |
---|
[911] | 73 | !!---------------------------------------------------------------------- |
---|
| 74 | !! Namelist variables |
---|
| 75 | !!---------------------------------------------------------------------- |
---|
[7646] | 76 | LOGICAL, PUBLIC :: ln_bdy !: Unstructured Ocean Boundary Condition |
---|
| 77 | |
---|
[3294] | 78 | CHARACTER(len=80), DIMENSION(jp_bdy) :: cn_coords_file !: Name of bdy coordinates file |
---|
| 79 | CHARACTER(len=80) :: cn_mask_file !: Name of bdy mask file |
---|
[1125] | 80 | ! |
---|
[3294] | 81 | LOGICAL, DIMENSION(jp_bdy) :: ln_coords_file !: =T read bdy coordinates from file; |
---|
| 82 | ! !: =F read bdy coordinates from namelist |
---|
| 83 | LOGICAL :: ln_mask_file !: =T read bdymask from file |
---|
| 84 | LOGICAL :: ln_vol !: =T volume correction |
---|
[1125] | 85 | ! |
---|
[3294] | 86 | INTEGER :: nb_bdy !: number of open boundary sets |
---|
[11081] | 87 | INTEGER, DIMENSION(jp_bdy) :: nb_jpk_bdy !: number of levels in the bdy data (set < 0 if consistent with planned run) |
---|
[3294] | 88 | INTEGER, DIMENSION(jp_bdy) :: nn_rimwidth !: boundary rim width for Flow Relaxation Scheme |
---|
| 89 | INTEGER :: nn_volctl !: = 0 the total volume will have the variability of the surface Flux E-P |
---|
| 90 | ! ! = 1 the volume will be constant during all the integration. |
---|
[4292] | 91 | CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_dyn2d ! Choice of boundary condition for barotropic variables (U,V,SSH) |
---|
| 92 | INTEGER, DIMENSION(jp_bdy) :: nn_dyn2d_dta !: = 0 use the initial state as bdy dta ; |
---|
[3294] | 93 | !: = 1 read it in a NetCDF file |
---|
| 94 | !: = 2 read tidal harmonic forcing from a NetCDF file |
---|
| 95 | !: = 3 read external data AND tidal harmonic forcing from NetCDF files |
---|
[4292] | 96 | CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_dyn3d ! Choice of boundary condition for baroclinic velocities |
---|
| 97 | INTEGER, DIMENSION(jp_bdy) :: nn_dyn3d_dta !: = 0 use the initial state as bdy dta ; |
---|
[3294] | 98 | !: = 1 read it in a NetCDF file |
---|
[4292] | 99 | CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_tra ! Choice of boundary condition for active tracers (T and S) |
---|
| 100 | INTEGER, DIMENSION(jp_bdy) :: nn_tra_dta !: = 0 use the initial state as bdy dta ; |
---|
[3294] | 101 | !: = 1 read it in a NetCDF file |
---|
[5836] | 102 | LOGICAL , DIMENSION(jp_bdy) :: ln_tra_dmp !: =T Tracer damping |
---|
| 103 | LOGICAL , DIMENSION(jp_bdy) :: ln_dyn3d_dmp !: =T Baroclinic velocity damping |
---|
| 104 | REAL(wp), DIMENSION(jp_bdy) :: rn_time_dmp !: Damping time scale in days |
---|
| 105 | REAL(wp), DIMENSION(jp_bdy) :: rn_time_dmp_out !: Damping time scale in days at radiation outflow points |
---|
[3651] | 106 | |
---|
[9657] | 107 | CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_ice ! Choice of boundary condition for sea ice variables |
---|
| 108 | INTEGER , DIMENSION(jp_bdy) :: nn_ice_dta !: = 0 use the initial state as bdy dta ; |
---|
| 109 | !: = 1 read it in a NetCDF file |
---|
[5836] | 110 | REAL(wp), DIMENSION(jp_bdy) :: rn_ice_tem !: choice of the temperature of incoming sea ice |
---|
| 111 | REAL(wp), DIMENSION(jp_bdy) :: rn_ice_sal !: choice of the salinity of incoming sea ice |
---|
| 112 | REAL(wp), DIMENSION(jp_bdy) :: rn_ice_age !: choice of the age of incoming sea ice |
---|
[3294] | 113 | ! |
---|
| 114 | |
---|
[911] | 115 | !!---------------------------------------------------------------------- |
---|
| 116 | !! Global variables |
---|
| 117 | !!---------------------------------------------------------------------- |
---|
[4292] | 118 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdytmask !: Mask defining computational domain at T-points |
---|
| 119 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyumask !: Mask defining computational domain at U-points |
---|
| 120 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyvmask !: Mask defining computational domain at V-points |
---|
[911] | 121 | |
---|
[3294] | 122 | REAL(wp) :: bdysurftot !: Lateral surface of unstructured open boundary |
---|
| 123 | |
---|
[911] | 124 | !!---------------------------------------------------------------------- |
---|
[3294] | 125 | !! open boundary data variables |
---|
[911] | 126 | !!---------------------------------------------------------------------- |
---|
| 127 | |
---|
[3294] | 128 | INTEGER, DIMENSION(jp_bdy) :: nn_dta !: =0 => *all* data is set to initial conditions |
---|
| 129 | !: =1 => some data to be read in from data files |
---|
[3651] | 130 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global !: workspace for reading in global data arrays (unstr. bdy) |
---|
[7646] | 131 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global_z !: workspace for reading in global depth arrays (unstr. bdy) |
---|
| 132 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global_dz !: workspace for reading in global depth arrays (unstr. bdy) |
---|
[3651] | 133 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global2 !: workspace for reading in global data arrays (struct. bdy) |
---|
[7646] | 134 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global2_z !: workspace for reading in global depth arrays (struct. bdy) |
---|
| 135 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:), TARGET :: dta_global2_dz !: workspace for reading in global depth arrays (struct. bdy) |
---|
[4354] | 136 | !$AGRIF_DO_NOT_TREAT |
---|
[3294] | 137 | TYPE(OBC_INDEX), DIMENSION(jp_bdy), TARGET :: idx_bdy !: bdy indices (local process) |
---|
[4292] | 138 | TYPE(OBC_DATA) , DIMENSION(jp_bdy), TARGET :: dta_bdy !: bdy external data (local process) |
---|
[4354] | 139 | !$AGRIF_END_DO_NOT_TREAT |
---|
[2715] | 140 | !!---------------------------------------------------------------------- |
---|
[9598] | 141 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[10888] | 142 | !! $Id$ |
---|
[10068] | 143 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 144 | !!---------------------------------------------------------------------- |
---|
| 145 | CONTAINS |
---|
| 146 | |
---|
| 147 | FUNCTION bdy_oce_alloc() |
---|
| 148 | !!---------------------------------------------------------------------- |
---|
[10425] | 149 | USE lib_mpp, ONLY: ctl_stop, mpp_sum |
---|
[2715] | 150 | ! |
---|
| 151 | INTEGER :: bdy_oce_alloc |
---|
| 152 | !!---------------------------------------------------------------------- |
---|
| 153 | ! |
---|
[4292] | 154 | ALLOCATE( bdytmask(jpi,jpj) , bdyumask(jpi,jpj), bdyvmask(jpi,jpj), & |
---|
[3294] | 155 | & STAT=bdy_oce_alloc ) |
---|
[4354] | 156 | ! |
---|
| 157 | ! Initialize masks |
---|
[7753] | 158 | bdytmask(:,:) = 1._wp |
---|
| 159 | bdyumask(:,:) = 1._wp |
---|
| 160 | bdyvmask(:,:) = 1._wp |
---|
[4354] | 161 | ! |
---|
[10425] | 162 | CALL mpp_sum ( 'bdy_oce', bdy_oce_alloc ) |
---|
| 163 | IF( bdy_oce_alloc /= 0 ) CALL ctl_stop( 'STOP', 'bdy_oce_alloc: failed to allocate arrays.' ) |
---|
[2715] | 164 | ! |
---|
| 165 | END FUNCTION bdy_oce_alloc |
---|
| 166 | |
---|
[911] | 167 | !!====================================================================== |
---|
| 168 | END MODULE bdy_oce |
---|
[3294] | 169 | |
---|