cpld_gridgen  1.11.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(:,:) :: angq
73 
74  real(dbl_kind), allocatable, dimension(:,:) :: dx
76  real(dbl_kind), allocatable, dimension(:,:) :: dy
78  real(dbl_kind), allocatable, dimension(:,:) :: xsgp1
80  real(dbl_kind), allocatable, dimension(:,:) :: ysgp1
82 
83  ! Output grid variables
84  real(dbl_kind), allocatable, dimension(:,:) :: latct
86  real(dbl_kind), allocatable, dimension(:,:) :: lonct
88  real(dbl_kind), allocatable, dimension(:,:) :: latcv
90  real(dbl_kind), allocatable, dimension(:,:) :: loncv
92  real(dbl_kind), allocatable, dimension(:,:) :: latcu
94  real(dbl_kind), allocatable, dimension(:,:) :: loncu
96  real(dbl_kind), allocatable, dimension(:,:) :: latbu
99  real(dbl_kind), allocatable, dimension(:,:) :: lonbu
102  real(dbl_kind), allocatable, dimension(:,:) :: areact
103  real(dbl_kind), allocatable, dimension(:,:) :: anglet
105  real(dbl_kind), allocatable, dimension(:,:) :: angle
106 
107  real(dbl_kind), allocatable, dimension(:,:,:) :: latct_vert
109  real(dbl_kind), allocatable, dimension(:,:,:) :: lonct_vert
111 
112  real(dbl_kind), allocatable, dimension(:,:,:) :: latcv_vert
114  real(dbl_kind), allocatable, dimension(:,:,:) :: loncv_vert
116 
117  real(dbl_kind), allocatable, dimension(:,:,:) :: latcu_vert
119  real(dbl_kind), allocatable, dimension(:,:,:) :: loncu_vert
121 
122  real(dbl_kind), allocatable, dimension(:,:,:) :: latbu_vert
124  real(dbl_kind), allocatable, dimension(:,:,:) :: lonbu_vert
126 
127 
128  real(dbl_kind), allocatable, dimension(:) :: xlonct
130  real(dbl_kind), allocatable, dimension(:) :: xlatct
132  real(dbl_kind), allocatable, dimension(:) :: xloncu
134  real(dbl_kind), allocatable, dimension(:) :: xlatcu
136  real(dbl_kind), allocatable, dimension(:) :: dlatbu
138  real(dbl_kind), allocatable, dimension(:) :: dlatcv
140  ! MOM6 fix fields
141  real(real_kind), allocatable, dimension(:,:) :: wet4
143  real(dbl_kind), allocatable, dimension(:,:) :: wet8
145 
146  real(real_kind), allocatable, dimension(:,:) :: dp4
148  real(dbl_kind), allocatable, dimension(:,:) :: dp8
150 
151  ! CICE6 fields
152  real(dbl_kind), allocatable, dimension(:,:) :: ulon
154  real(dbl_kind), allocatable, dimension(:,:) :: ulat
156  real(dbl_kind), allocatable, dimension(:,:) :: htn
158  real(dbl_kind), allocatable, dimension(:,:) :: hte
160 
161  real(kind=real_kind), parameter :: minimum_depth = 9.5
162  real(kind=real_kind), parameter :: maximum_depth = 6500.0
163  real(kind=real_kind), parameter :: masking_depth = 0.0
166  real(kind=real_kind), parameter :: maximum_lat = 88.0
167 
168 contains
172 
173  subroutine allocate_all
175  allocate( x(0:nx,0:ny), y(0:nx,0:ny), angq(0:nx,0:ny) )
176  allocate( dx(nx,0:ny), dy(0:nx,ny) )
177 
178  allocate( xsgp1(0:nx,0:ny+1), ysgp1(0:nx,0:ny+1) )
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) )
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) )
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 
207 end module grdvars