9 use init_mod ,
only : nxt, nyt, nlevs, nxr, nyr
10 use init_mod ,
only : debug, logunit
15 real(kind=8),
parameter :: maskspval = 9.9692099683868690d+36
16 real(kind=8),
parameter :: hmin = 1.0d-3
23 real(kind=8),
allocatable,
dimension(:,:) :: bilin2d
24 real(kind=8),
allocatable,
dimension(:,:) :: consd2d
25 real(kind=8),
allocatable,
dimension(:,:,:) :: bilin3d
28 type(
vardefs),
allocatable,
dimension(:) :: b2d
29 type(
vardefs),
allocatable,
dimension(:) :: c2d
30 type(
vardefs),
allocatable,
dimension(:) :: b3d
33 real(kind=8),
allocatable,
dimension(:,:) :: rgb2d
34 real(kind=8),
allocatable,
dimension(:,:) :: rgc2d
35 real(kind=8),
allocatable,
dimension(:,:,:) :: rgb3d
38 real(kind=8),
allocatable,
dimension(:,:) :: mask3d
41 real(kind=8),
allocatable,
dimension(:,:) :: eta
52 subroutine setup_packing(nvalid, vars)
54 type(
vardefs),
intent(inout) :: vars(:)
55 integer ,
intent(in) :: nvalid
59 character(len=20) :: subname =
'setup packing' 62 if (debug)
write(logunit,
'(a)')
'enter '//trim(subname)
64 nbilin2d = 0; nbilin3d = 0; nconsd2d = 0
66 if (trim(vars(n)%var_remapmethod) ==
'bilinear')
then 67 if (vars(n)%var_dimen == 2) nbilin2d = nbilin2d + 1
68 if (vars(n)%var_dimen == 3) nbilin3d = nbilin3d + 1
71 if (trim(vars(n)%var_remapmethod) ==
'conserve')nconsd2d = nconsd2d + 1
73 if (debug)
write(logunit,
'(3(a,i4))')
'bilin 2d ',nbilin2d,
' bilin 3d ',nbilin3d,
' conserv 2d ',nconsd2d
76 if (nbilin2d > 0)
then 77 allocate(bilin2d(nbilin2d,nxt*nyt)); bilin2d = 0.0
78 allocate(b2d(1:nbilin2d))
79 if (debug)
write(logunit,
'(a)')
'allocate bilin2d fields and types ' 81 if (nconsd2d > 0)
then 82 allocate(consd2d(nconsd2d,nxt*nyt)); consd2d = 0.0
83 allocate(c2d(1:nconsd2d))
84 if (debug)
write(logunit,
'(a)')
'allocate consd2d fields and types ' 86 if (nbilin3d > 0)
then 87 allocate(bilin3d(nbilin3d,nlevs,nxt*nyt)); bilin3d = 0.0
88 allocate(b3d(1:nbilin3d))
89 if (debug)
write(logunit,
'(a)')
'allocate bilin3d fields and types ' 95 if (trim(vars(n)%var_remapmethod) ==
'bilinear')
then 96 if (vars(n)%var_dimen == 2 .and.
allocated(b2d))
then 97 i = i+1; b2d(i) = vars(n)
99 if (vars(n)%var_dimen == 3 .and.
allocated(b3d))
then 100 j = j+1; b3d(j) = vars(n)
103 if (trim(vars(n)%var_remapmethod) ==
'conserve' .and.
allocated(c2d))
then 104 k = k+1; c2d(k) = vars(n)
109 if (nbilin2d > 0)
then 110 allocate(rgb2d(nbilin2d,nxr*nyr)); rgb2d = 0.0
112 if (nconsd2d > 0)
then 113 allocate(rgc2d(nconsd2d,nxr*nyr)); rgc2d = 0.0
115 if (nbilin3d > 0)
then 116 allocate(rgb3d(nbilin3d,nlevs,nxr*nyr)); rgb3d = 0.0
118 if (debug)
write(logunit,
'(a)')
'exit '//trim(subname)
120 end subroutine setup_packing
121 end module arrays_mod