cpld_gridgen 1.14.0
Loading...
Searching...
No Matches
grdvars.F90
Go to the documentation of this file.
1
7
8module grdvars
9
10 use gengrid_kinds, only : dbl_kind, real_kind, int_kind
11
12 implicit none
13
14 integer :: ni
15 integer :: nj
16 integer :: npx
17
18 integer :: nx
19 integer :: ny
20
21 logical :: editmask
23 logical :: debug
26 logical :: do_postwgts
29 logical :: roottask
30
31 integer, parameter :: nv = 4.
32 integer, parameter :: ncoord = 2*4.
34 integer, parameter :: nverts = 2*4.
36 integer, parameter :: nvars = ncoord + nverts
37
38
39 real(dbl_kind) :: sg_maxlat
41 integer(int_kind) :: ipole(2)
43
44 integer, parameter, dimension(nv) :: ivertct = (/0, -1, -1, 0/)
47 integer, parameter, dimension(nv) :: jvertct = (/0, 0, -1, -1/)
50 integer, dimension(nv) :: ivertcv
53 integer, dimension(nv) :: jvertcv
56 integer, dimension(nv) :: ivertcu
59 integer, dimension(nv) :: jvertcu
62 integer, dimension(nv) :: ivertbu
65 integer, dimension(nv) :: jvertbu
68 ! Super-grid source grid variables
69 real(dbl_kind), allocatable, dimension(:,:) :: x
70 real(dbl_kind), allocatable, dimension(:,:) :: y
71 real(dbl_kind), allocatable, dimension(:,:) :: dx
73 real(dbl_kind), allocatable, dimension(:,:) :: dy
75
76 ! Output grid variables
77 real(dbl_kind), allocatable, dimension(:,:) :: latct
79 real(dbl_kind), allocatable, dimension(:,:) :: lonct
81 real(dbl_kind), allocatable, dimension(:,:) :: latcv
83 real(dbl_kind), allocatable, dimension(:,:) :: loncv
85 real(dbl_kind), allocatable, dimension(:,:) :: latcu
87 real(dbl_kind), allocatable, dimension(:,:) :: loncu
89 real(dbl_kind), allocatable, dimension(:,:) :: latbu
92 real(dbl_kind), allocatable, dimension(:,:) :: lonbu
95 real(dbl_kind), allocatable, dimension(:,:) :: areact
96 real(dbl_kind), allocatable, dimension(:,:) :: anglet
98 real(dbl_kind), allocatable, dimension(:,:) :: angle
99 real(dbl_kind), allocatable, dimension(:,:) :: angchk
101
102 real(dbl_kind), allocatable, dimension(:,:,:) :: latct_vert
104 real(dbl_kind), allocatable, dimension(:,:,:) :: lonct_vert
106
107 real(dbl_kind), allocatable, dimension(:,:,:) :: latcv_vert
109 real(dbl_kind), allocatable, dimension(:,:,:) :: loncv_vert
111
112 real(dbl_kind), allocatable, dimension(:,:,:) :: latcu_vert
114 real(dbl_kind), allocatable, dimension(:,:,:) :: loncu_vert
116
117 real(dbl_kind), allocatable, dimension(:,:,:) :: latbu_vert
119 real(dbl_kind), allocatable, dimension(:,:,:) :: lonbu_vert
121
122
123 real(dbl_kind), allocatable, dimension(:) :: xlonct
125 real(dbl_kind), allocatable, dimension(:) :: xlatct
127 real(dbl_kind), allocatable, dimension(:) :: xangct
129
130 real(dbl_kind), allocatable, dimension(:) :: xloncu
132 real(dbl_kind), allocatable, dimension(:) :: xlatcu
134 real(dbl_kind), allocatable, dimension(:) :: dlatbu
136 real(dbl_kind), allocatable, dimension(:) :: dlatcv
138 ! MOM6 fix fields
139 real(real_kind), allocatable, dimension(:,:) :: wet4
141 real(dbl_kind), allocatable, dimension(:,:) :: wet8
143
144 real(real_kind), allocatable, dimension(:,:) :: dp4
146 real(dbl_kind), allocatable, dimension(:,:) :: dp8
148
149 ! CICE6 fields
150 real(dbl_kind), allocatable, dimension(:,:) :: ulon
152 real(dbl_kind), allocatable, dimension(:,:) :: ulat
154 real(dbl_kind), allocatable, dimension(:,:) :: htn
156 real(dbl_kind), allocatable, dimension(:,:) :: hte
158
159 real(kind=real_kind), parameter :: minimum_depth = 9.5
160 real(kind=real_kind), parameter :: maximum_depth = 6500.0
161 real(kind=real_kind), parameter :: masking_depth = 0.0
164 real(kind=real_kind), parameter :: maximum_lat = 88.0
165
166 ! ATM resolutions
167 integer, parameter :: maxatmres = 10
168 integer, allocatable, dimension(:) :: catm
169
170contains
174
175 subroutine allocate_all
176
177 allocate( x(0:nx,0:ny), y(0:nx,0:ny) )
178 allocate( dx(nx,0:ny), dy(0:nx,ny) )
179
180 allocate( latct(ni,nj), lonct(ni,nj) )
181 allocate( latcv(ni,nj), loncv(ni,nj) )
182 allocate( latcu(ni,nj), loncu(ni,nj) )
183 allocate( latbu(ni,nj), lonbu(ni,nj) )
184
185 allocate( areact(ni,nj), anglet(ni,nj), angle(ni,nj), angchk(ni,nj))
186
187 allocate( latct_vert(ni,nj,nv), lonct_vert(ni,nj,nv) )
188 allocate( latcv_vert(ni,nj,nv), loncv_vert(ni,nj,nv) )
189 allocate( latcu_vert(ni,nj,nv), loncu_vert(ni,nj,nv) )
190 allocate( latbu_vert(ni,nj,nv), lonbu_vert(ni,nj,nv) )
191
192 allocate( xlonct(ni), xlatct(ni), xangct(ni) )
193 allocate( xloncu(ni), xlatcu(ni) )
194 allocate( dlatbu(ni), dlatcv(ni) )
195
196 allocate( wet4(ni,nj) )
197 allocate( wet8(ni,nj) )
198
199 allocate( dp4(ni,nj) )
200 allocate( dp8(ni,nj) )
201
202 allocate( ulon(ni,nj), ulat(ni,nj) )
203 allocate( htn(ni,nj), hte(ni,nj) )
204
205 end subroutine allocate_all
206
207end module grdvars