22 character(len=1024) :: name
23 real(kind_real),
allocatable :: auto(:,:,:)
24 real(kind_real),
allocatable ::
cross(:,:,:)
25 real(kind_real),
allocatable :: auto_inv(:,:,:)
26 real(kind_real),
allocatable :: reg(:,:,:)
48 class(vbal_blk_type),
intent(inout) :: vbal_blk
49 type(nam_type),
intent(in) :: nam
50 type(geom_type),
intent(in) :: geom
51 integer,
intent(in) :: nc2b
52 integer,
intent(in) :: iv
53 integer,
intent(in) :: jv
58 vbal_blk%name = trim(nam%varname(jv))//
'-'//trim(nam%varname(iv))
61 allocate(vbal_blk%auto(nc2b,geom%nl0,geom%nl0))
62 allocate(vbal_blk%cross(nc2b,geom%nl0,geom%nl0))
63 allocate(vbal_blk%auto_inv(nc2b,geom%nl0,geom%nl0))
64 allocate(vbal_blk%reg(nc2b,geom%nl0,geom%nl0))
77 class(vbal_blk_type),
intent(inout) :: vbal_blk
80 if (
allocated(vbal_blk%auto))
deallocate(vbal_blk%auto)
81 if (
allocated(vbal_blk%cross))
deallocate(vbal_blk%cross)
82 if (
allocated(vbal_blk%auto_inv))
deallocate(vbal_blk%auto_inv)
83 if (
allocated(vbal_blk%reg))
deallocate(vbal_blk%reg)
96 class(vbal_blk_type),
intent(in) :: vbal_blk
97 type(geom_type),
intent(in) :: geom
98 integer,
intent(in) :: np
99 integer,
intent(in) :: h_n_s(geom%nc0a,geom%nl0i)
100 integer,
intent(in) :: h_c2b(np,geom%nc0a,geom%nl0i)
101 real(kind_real),
intent(in) :: h_S(np,geom%nc0a,geom%nl0i)
102 real(kind_real),
intent(inout) :: fld(geom%nc0a,geom%nl0)
105 integer :: ic0a,il0,jl0,i_s,ic2b
106 real(kind_real) :: S,fld_tmp(geom%nc0a,geom%nl0)
115 do i_s=1,h_n_s(ic0a,
min(il0,geom%nl0i))
117 ic2b = h_c2b(i_s,ic0a,
min(il0,geom%nl0i))
118 s = h_s(i_s,ic0a,
min(il0,geom%nl0i))
121 fld_tmp(ic0a,il0) = fld_tmp(ic0a,il0)+s*vbal_blk%reg(ic2b,il0,jl0)*fld(ic0a,jl0)
141 class(vbal_blk_type),
intent(in) :: vbal_blk
142 type(geom_type),
intent(in) :: geom
143 integer,
intent(in) :: np
144 integer,
intent(in) :: h_n_s(geom%nc0a,geom%nl0i)
145 integer,
intent(in) :: h_c2b(np,geom%nc0a,geom%nl0i)
146 real(kind_real),
intent(in) :: h_S(np,geom%nc0a,geom%nl0i)
147 real(kind_real),
intent(inout) :: fld(geom%nc0a,geom%nl0)
150 integer :: ic0a,il0,jl0,i_s,ic2b
151 real(kind_real) :: S,fld_tmp(geom%nc0a,geom%nl0)
160 do i_s=1,h_n_s(ic0a,
min(il0,geom%nl0i))
162 ic2b = h_c2b(i_s,ic0a,
min(il0,geom%nl0i))
163 s = h_s(i_s,ic0a,
min(il0,geom%nl0i))
166 fld_tmp(ic0a,jl0) = fld_tmp(ic0a,jl0)+s*vbal_blk%reg(ic2b,il0,jl0)*fld(ic0a,il0)
subroutine vbal_blk_alloc(vbal_blk, nam, geom, nc2b, iv, jv)
subroutine vbal_blk_apply_ad(vbal_blk, geom, np, h_n_s, h_c2b, h_S, fld)
subroutine vbal_blk_dealloc(vbal_blk)
double * cross(const double *p1, const double *p2)
integer, parameter, public kind_real
subroutine vbal_blk_apply(vbal_blk, geom, np, h_n_s, h_c2b, h_S, fld)