cpld_gridgen  1.13.0
All Data Structures Files Functions Variables Pages
grdvars.F90
Go to the documentation of this file.
1 
7 
8 module 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  integer, parameter :: nar = 6
167  integer, parameter, dimension(nar) :: catm = (/48, 96, 192, 384, 768, 1152/)
168 
169 contains
173 
174  subroutine allocate_all
176  allocate( x(0:nx,0:ny), y(0:nx,0:ny) )
177  allocate( dx(nx,0:ny), dy(0:nx,ny) )
178 
179  allocate( latct(ni,nj), lonct(ni,nj) )
180  allocate( latcv(ni,nj), loncv(ni,nj) )
181  allocate( latcu(ni,nj), loncu(ni,nj) )
182  allocate( latbu(ni,nj), lonbu(ni,nj) )
183 
184  allocate( areact(ni,nj), anglet(ni,nj), angle(ni,nj), angchk(ni,nj))
185 
186  allocate( latct_vert(ni,nj,nv), lonct_vert(ni,nj,nv) )
187  allocate( latcv_vert(ni,nj,nv), loncv_vert(ni,nj,nv) )
188  allocate( latcu_vert(ni,nj,nv), loncu_vert(ni,nj,nv) )
189  allocate( latbu_vert(ni,nj,nv), lonbu_vert(ni,nj,nv) )
190 
191  allocate( xlonct(ni), xlatct(ni), xangct(ni) )
192  allocate( xloncu(ni), xlatcu(ni) )
193  allocate( dlatbu(ni), dlatcv(ni) )
194 
195  allocate( wet4(ni,nj) )
196  allocate( wet8(ni,nj) )
197 
198  allocate( dp4(ni,nj) )
199  allocate( dp8(ni,nj) )
200 
201  allocate( ulon(ni,nj), ulat(ni,nj) )
202  allocate( htn(ni,nj), hte(ni,nj) )
203 
204  end subroutine allocate_all
205 
206 end module grdvars