-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbdy_oce.f90
96 lines (96 loc) · 3.91 KB
/
bdy_oce.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
MODULE bdy_oce
USE par_oce
USE lib_mpp
IMPLICIT NONE
PUBLIC
INTEGER, PUBLIC, PARAMETER :: jp_bdy = 10
INTEGER, PUBLIC, PARAMETER :: jpbgrd = 3
TYPE, PUBLIC :: OBC_INDEX
INTEGER, DIMENSION(jpbgrd) :: nblen
INTEGER, DIMENSION(jpbgrd) :: nblenrim
INTEGER, POINTER, DIMENSION(:, :) :: nbi
INTEGER, POINTER, DIMENSION(:, :) :: nbj
INTEGER, POINTER, DIMENSION(:, :) :: nbr
INTEGER, POINTER, DIMENSION(:, :) :: nbmap
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: nbw
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: nbd
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: nbdout
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: flagu
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: flagv
END TYPE OBC_INDEX
TYPE, PUBLIC :: OBC_DATA
INTEGER, DIMENSION(2) :: nread
LOGICAL :: ll_ssh
LOGICAL :: ll_u2d
LOGICAL :: ll_v2d
LOGICAL :: ll_u3d
LOGICAL :: ll_v3d
LOGICAL :: ll_tem
LOGICAL :: ll_sal
LOGICAL :: ll_fvl
REAL(KIND = wp), POINTER, DIMENSION(:) :: ssh
REAL(KIND = wp), POINTER, DIMENSION(:) :: u2d
REAL(KIND = wp), POINTER, DIMENSION(:) :: v2d
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: u3d
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: v3d
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: tem
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: sal
LOGICAL :: ll_a_i
LOGICAL :: ll_h_i
LOGICAL :: ll_h_s
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: a_i
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: h_i
REAL(KIND = wp), POINTER, DIMENSION(:, :) :: h_s
END TYPE OBC_DATA
LOGICAL, PUBLIC :: ln_bdy
CHARACTER(LEN = 80), DIMENSION(jp_bdy) :: cn_coords_file
CHARACTER(LEN = 80) :: cn_mask_file
LOGICAL, DIMENSION(jp_bdy) :: ln_coords_file
LOGICAL :: ln_mask_file
LOGICAL :: ln_vol
INTEGER :: nb_bdy
INTEGER :: nb_jpk_bdy
INTEGER, DIMENSION(jp_bdy) :: nn_rimwidth
INTEGER :: nn_volctl
CHARACTER(LEN = 20), DIMENSION(jp_bdy) :: cn_dyn2d
INTEGER, DIMENSION(jp_bdy) :: nn_dyn2d_dta
CHARACTER(LEN = 20), DIMENSION(jp_bdy) :: cn_dyn3d
INTEGER, DIMENSION(jp_bdy) :: nn_dyn3d_dta
CHARACTER(LEN = 20), DIMENSION(jp_bdy) :: cn_tra
INTEGER, DIMENSION(jp_bdy) :: nn_tra_dta
LOGICAL, DIMENSION(jp_bdy) :: ln_tra_dmp
LOGICAL, DIMENSION(jp_bdy) :: ln_dyn3d_dmp
REAL(KIND = wp), DIMENSION(jp_bdy) :: rn_time_dmp
REAL(KIND = wp), DIMENSION(jp_bdy) :: rn_time_dmp_out
CHARACTER(LEN = 20), DIMENSION(jp_bdy) :: cn_ice
INTEGER, DIMENSION(jp_bdy) :: nn_ice_dta
REAL(KIND = wp), DIMENSION(jp_bdy) :: rn_ice_tem
REAL(KIND = wp), DIMENSION(jp_bdy) :: rn_ice_sal
REAL(KIND = wp), DIMENSION(jp_bdy) :: rn_ice_age
REAL(KIND = wp), ALLOCATABLE, SAVE, DIMENSION(:, :), TARGET :: bdytmask
REAL(KIND = wp), ALLOCATABLE, SAVE, DIMENSION(:, :), TARGET :: bdyumask
REAL(KIND = wp), ALLOCATABLE, SAVE, DIMENSION(:, :), TARGET :: bdyvmask
REAL(KIND = wp) :: bdysurftot
INTEGER, DIMENSION(jp_bdy) :: nn_dta
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global_z
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global_dz
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global2
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global2_z
REAL(KIND = wp), ALLOCATABLE, DIMENSION(:, :, :), TARGET :: dta_global2_dz
TYPE(OBC_INDEX), DIMENSION(jp_bdy), TARGET :: idx_bdy
TYPE(OBC_DATA), DIMENSION(jp_bdy), TARGET :: dta_bdy
CONTAINS
FUNCTION bdy_oce_alloc()
USE lib_mpp, ONLY: ctl_warn, mpp_sum
INTEGER :: bdy_oce_alloc
ALLOCATE(bdytmask(jpi, jpj), bdyumask(jpi, jpj), bdyvmask(jpi, jpj), STAT = bdy_oce_alloc)
!$ACC KERNELS
bdytmask(:, :) = 1._wp
bdyumask(:, :) = 1._wp
bdyvmask(:, :) = 1._wp
!$ACC END KERNELS
IF (lk_mpp) CALL mpp_sum(bdy_oce_alloc)
IF (bdy_oce_alloc /= 0) CALL ctl_warn('bdy_oce_alloc: failed to allocate arrays.')
END FUNCTION bdy_oce_alloc
END MODULE bdy_oce