1
!> @param[in] o1 first dimension of output array
2
!! @param[in] o2 second dimension of output array
3
!! @param[in] o3 third dimension of output array
4
!! @param[out] out the resulting array
5
!! @param[in] i1 first dimension of in array
6
!! @param[in] in array to be copied
7
subroutine BUD_TRANSFER_FUNC(copy,1Dto3D)(o1,o2,o3,out,i1,in)
8
integer(ii_), intent(in) :: o1, o2, o3, i1
9
#ifdef BUD_TYPE_VAR_PREC
10
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(out) :: out(o1,o2,o3)
11
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(in) :: in(i1)
13
BUD_TYPE_VAR, intent(out) :: out(o1,o2,o3)
14
BUD_TYPE_VAR, intent(in) :: in(i1)
16
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,o1,i1/(o2*o3),in(1))
19
!> @param[in] o1 first dimension of output array
20
!! @param[in] o2 second dimension of output array
21
!! @param[in] o3 third dimension of output array
22
!! @param[out] out the resulting array
23
!! @param[in] i1 first dimension of in array
24
!! @param[in] i2 second dimension of in array
25
!! @param[in] in array to be copied
26
recursive subroutine BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,i1,i2,in)
27
integer(ii_), intent(in) :: o1, o2, o3, i1, i2
28
#ifdef BUD_TYPE_VAR_PREC
29
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(out) :: out(o1,o2,o3)
30
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(in) :: in(i1,i2)
32
BUD_TYPE_VAR, intent(out) :: out(o1,o2,o3)
33
BUD_TYPE_VAR, intent(in) :: in(i1,i2)
36
! Cycle call to assert correct memory alignment
37
call BUD_TRANSFER_FUNC(copy,3Dto3D)(o1,o2,o3,out,i1,o2,i2/o2,in(1,1))
39
call BUD_TRANSFER_FUNC(copy,3Dto3D)(o1,o2,o3,out,o1,o2,(i1*i2)/(o1*o2),in(1,1))
43
!> @param[in] o1 first dimension of output array
44
!! @param[in] o2 second dimension of output array
45
!! @param[in] o3 third dimension of output array
46
!! @param[out] out the resulting array
47
!! @param[in] i1 first dimension of in array
48
!! @param[in] i2 second dimension of in array
49
!! @param[in] i3 third dimension of in array
50
!! @param[in] in array to be copied
51
recursive subroutine BUD_TRANSFER_FUNC(copy,3Dto3D)(o1,o2,o3,out,i1,i2,i3,in)
52
integer(ii_), intent(in) :: o1, o2, o3, i1, i2, i3
53
#ifdef BUD_TYPE_VAR_PREC
54
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(out) :: out(o1,o2,o3)
55
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(in) :: in(i1,i2,i3)
57
BUD_TYPE_VAR, intent(out) :: out(o1,o2,o3)
58
BUD_TYPE_VAR, intent(in) :: in(i1,i2,i3)
60
integer(ii_) :: j1, j2, j3
61
if ( o1 == i1 .and. o2 == i2 ) then
62
do j3 = 1 , min(o3,i3)
65
out(j1,j2,j3) = in(j1,j2,j3)
71
! Cycle down in dimension to retrive a correct dimension
72
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,o1,(i1*i2*i3)/o1,in(1,1,1))
75
!> @param[in] o1 first dimension of output array
76
!! @param[in] o2 second dimension of output array
77
!! @param[in] o3 third dimension of output array
78
!! @param[out] out the resulting array
79
!! @param[in] i1 first dimension of in array
80
!! @param[in] i2 second dimension of in array
81
!! @param[in] i3 third dimension of in array
82
!! @param[in] i4 fourth dimension of in array
83
!! @param[in] in array to be copied
84
subroutine BUD_TRANSFER_FUNC(copy,4Dto3D)(o1,o2,o3,out,i1,i2,i3,i4,in)
85
integer(ii_), intent(in) :: o1, o2, o3, i1, i2, i3, i4
86
#ifdef BUD_TYPE_VAR_PREC
87
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(out) :: out(o1,o2,o3)
88
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(in) :: in(i1,i2,i3,i4)
90
BUD_TYPE_VAR, intent(out) :: out(o1,o2,o3)
91
BUD_TYPE_VAR, intent(in) :: in(i1,i2,i3,i4)
93
if ( o1 == i1 .and. o2 == i2 ) then
94
call BUD_TRANSFER_FUNC(copy,3Dto3D)(o1,o2,o3,out,i1,i2,i3*i4,in(1,1,1,1))
95
else if ( o1 == i1 ) then
96
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,i1,i2*i3*i4,in(1,1,1,1))
98
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,o1,(i1*i2*i3*i4)/o1,in(1,1,1,1))
102
!> @param[in] o1 first dimension of output array
103
!! @param[in] o2 second dimension of output array
104
!! @param[in] o3 third dimension of output array
105
!! @param[out] out the resulting array
106
!! @param[in] i1 first dimension of in array
107
!! @param[in] i2 second dimension of in array
108
!! @param[in] i3 third dimension of in array
109
!! @param[in] i4 fourth dimension of in array
110
!! @param[in] i5 fifth dimension of in array
111
!! @param[in] in array to be copied
112
subroutine BUD_TRANSFER_FUNC(copy,5Dto3D)(o1,o2,o3,out,i1,i2,i3,i4,i5,in)
113
integer(ii_), intent(in) :: o1, o2, o3, i1, i2, i3, i4, i5
114
#ifdef BUD_TYPE_VAR_PREC
115
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(out) :: out(o1,o2,o3)
116
BUD_TYPE_VAR(BUD_TYPE_VAR_PREC), intent(in) :: in(i1,i2,i3,i4,i5)
118
BUD_TYPE_VAR, intent(out) :: out(o1,o2,o3)
119
BUD_TYPE_VAR, intent(in) :: in(i1,i2,i3,i4,i5)
121
if ( o1 == i1 .and. o2 == i2 ) then
122
call BUD_TRANSFER_FUNC(copy,3Dto3D)(o1,o2,o3,out,i1,i2,i3*i4*i5,in(1,1,1,1,1))
123
else if ( o1 == i1 ) then
124
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,i1,i2*i3*i4*i5,in(1,1,1,1,1))
126
call BUD_TRANSFER_FUNC(copy,2Dto3D)(o1,o2,o3,out,o1,(i1*i2*i3*i4*i5)/o1,in(1,1,1,1,1))
131
#undef BUD_TYPE_VAR_PREC
132
#undef BUD_TYPE_VAR_P
135
! project-buds -- local file settings
136
! Anything below this line may be overwritten by scripts
137
! Below are non-editable settings
143
! f90-associate-indent: 2
144
! f90-continuation-indent: 2
145
! f90-structure-indent: 2
146
! f90-critical-indent: 2
147
! f90-program-indent: 2