[go: up one dir, main page]

Menu

[r34]: / common / exchg.f90  Maximize  Restore  History

Download this file

22 lines (20 with data), 550 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
!*---------------------------------------------------------------------
!* EXCHG - swap individual elements in a grid field data set accor-
!* ding to NLOC markers in LOC1,2.
!*---------------------------------------------------------------------
subroutine exchg(x,y,u,n,loc1,loc2,nloc)
real x(n),y(n),u(n)
integer loc1(nloc),loc2(nloc)
do i=1,nloc
tmp=x(loc1(i))
x(loc1(i))=x(loc2(i))
x(loc2(i))=tmp
tmp=y(loc1(i))
y(loc1(i))=y(loc2(i))
y(loc2(i))=tmp
tmp=u(loc1(i))
u(loc1(i))=u(loc2(i))
u(loc2(i))=tmp
end do
return
end