cpld_gridgen  1.12.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
174 
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
subroutine allocate_all
Allocate grid variables.
Definition: grdvars.F90:173