da_alloc_and_copy_be_arrays.inc
References to this file elsewhere.
1 subroutine da_alloc_and_copy_be_arrays (vg , v, jts,jte, kts,kte)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 type (be_subtype), intent(inout) :: vg ! Global backgrd error struct.
10 type (be_subtype), intent(inout) :: v ! Local backgrd error struct.
11 integer, intent(in) :: jts,jte ! Tile dimension.
12 integer, intent(in) :: kts,kte ! Tile dimension.
13
14 ! Allocate local-grid structure.
15 v % mz = vg % mz
16 if (v % mz > 0) then
17 allocate (v % val(jts:jte,1:v % mz))
18 allocate (v % evec(jts:jte,kts:kte,1:v % mz))
19 allocate (v % rf_alpha(1:v % mz))
20 end if
21
22 ! Make local copies from global arrays.
23 if (v % mz > 0) then
24 v % val(jts:jte,1:v % mz) = vg % val(jts:jte,1:v % mz)
25 v % evec(jts:jte,kts:kte,1:v % mz) = vg % evec(jts:jte,kts:kte,1:v % mz)
26 v % rf_alpha(1:v % mz) = vg % rf_alpha(1:v % mz)
27 end if
28
29 ! Deallocate global arrays.
30 if (v % mz > 0) then
31 deallocate (vg % val )
32 deallocate (vg % evec)
33 deallocate (vg % rf_alpha)
34 end if
35
36 end subroutine da_alloc_and_copy_be_arrays
37
38