1 |
afe |
1.1 |
c*** Reads H and iobsloc |
2 |
|
|
subroutine ReadObsMat(mobs,iobsloc) |
3 |
|
|
|
4 |
|
|
implicit none |
5 |
|
|
|
6 |
|
|
integer, intent(in) :: mobs |
7 |
|
|
integer, intent(out) :: iobsloc(mobs) |
8 |
|
|
|
9 |
|
|
open(unit=3,file='assimilate/iobsloc') |
10 |
|
|
read(unit=3,'(1I7)') iobsloc |
11 |
|
|
close(unit=3) |
12 |
|
|
call flush() |
13 |
|
|
end subroutine ReadObsMat |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
c*** Reads a pickup file... |
17 |
|
|
|
18 |
|
|
subroutine ReadPickup(n,nx,ny,nz,y) |
19 |
|
|
|
20 |
|
|
implicit none |
21 |
|
|
|
22 |
|
|
integer, intent(in) :: n,nx,ny,nz |
23 |
|
|
real*8, intent(out) :: y(n) |
24 |
|
|
real*8 r8seg(nx) |
25 |
|
|
integer i, irec,j,k |
26 |
|
|
open(unit=3,file='pickup',status='old',access='direct',recl=nx*8) |
27 |
|
|
ccc Set counter for state |
28 |
|
|
i =1 |
29 |
|
|
ccc Reading uVel |
30 |
|
|
do k = 1,nz |
31 |
|
|
do j = 1,ny |
32 |
|
|
irec = (k-1)*ny + j |
33 |
|
|
read(3,rec=irec) r8seg |
34 |
|
|
call DA_BYTESWAPR8(nx,r8seg) |
35 |
|
|
y(i:i+nx) = r8seg(1:nx) |
36 |
|
|
i = i+nx |
37 |
|
|
enddo |
38 |
|
|
enddo |
39 |
|
|
ccc Skip Next Two gU and gUnm1 |
40 |
|
|
ccc Read vVel |
41 |
|
|
do k = 1,nz |
42 |
|
|
do j = 1,ny |
43 |
|
|
irec = (k-1)*ny + j + nz*ny*3 |
44 |
|
|
read(3,rec=irec) r8seg |
45 |
|
|
call DA_BYTESWAPR8(nx,r8seg) |
46 |
|
|
y(i:i+nx) = r8seg(1:nx) |
47 |
|
|
i=i+nx |
48 |
|
|
enddo |
49 |
|
|
|
50 |
|
|
enddo |
51 |
|
|
ccc Skip Next two gV and gVnm1 |
52 |
|
|
ccc Read wVel |
53 |
|
|
do k = 1,nz |
54 |
|
|
do j = 1,ny |
55 |
|
|
irec = (k-1)*ny + j + nz*ny*6 |
56 |
|
|
read(3,rec=irec) r8seg |
57 |
|
|
call DA_BYTESWAPR8(nx,r8seg) |
58 |
|
|
y(i:i+nx) = r8seg(1:nx) |
59 |
|
|
i=i+nx |
60 |
|
|
enddo |
61 |
|
|
enddo |
62 |
|
|
ccc Read theta |
63 |
|
|
do k = 1,nz |
64 |
|
|
do j = 1,ny |
65 |
|
|
irec = (k-1)*ny + j + nz*ny*7 |
66 |
|
|
read(3,rec=irec) r8seg |
67 |
|
|
call DA_BYTESWAPR8(nx,r8seg) |
68 |
|
|
y(i:i+nx) = r8seg(1:nx) |
69 |
|
|
i=i+nx |
70 |
|
|
enddo |
71 |
|
|
enddo |
72 |
|
|
ccc Now close the file |
73 |
|
|
close(unit=3) |
74 |
|
|
ccc Open Non-Hydrostatic |
75 |
|
|
open(unit=3,file='pickup_nh',status='old',access='direct',recl=nx*8) |
76 |
|
|
|
77 |
|
|
ccc Read pressure Non-hydrostatic |
78 |
|
|
do k = 1,nz |
79 |
|
|
do j = 1,ny |
80 |
|
|
irec = (k-1)*ny + j |
81 |
|
|
read(3,rec=irec) r8seg |
82 |
|
|
call DA_BYTESWAPR8(nx,r8seg) |
83 |
|
|
y(i:i+nx) = r8seg(1:nx) |
84 |
|
|
i = i+nx |
85 |
|
|
enddo |
86 |
|
|
enddo |
87 |
|
|
close(unit=3) |
88 |
|
|
ccc Done Reading State |
89 |
|
|
call flush() |
90 |
|
|
end subroutine ReadPickup |
91 |
|
|
|
92 |
|
|
subroutine DA_BYTESWAPR8( na, arr ) |
93 |
|
|
C IN: |
94 |
|
|
C n integer - Number of 8-byte words in arr |
95 |
|
|
C IN/OUT: |
96 |
|
|
C arr real*8 - Array declared as real*4(n) |
97 |
|
|
C |
98 |
|
|
C Created: 05/05/99 adcroft@mit.edu (This is an unfortunate hack!!) |
99 |
|
|
|
100 |
|
|
implicit none |
101 |
|
|
C Arguments |
102 |
|
|
integer na |
103 |
|
|
character*(*) arr |
104 |
|
|
C Local |
105 |
|
|
integer i |
106 |
|
|
character*(1) cc |
107 |
|
|
C ------------------------------------------------------------------ |
108 |
|
|
do i=1,8*na,8 |
109 |
|
|
cc=arr(i:i) |
110 |
|
|
arr(i:i)=arr(i+7:i+7) |
111 |
|
|
arr(i+7:i+7)=cc |
112 |
|
|
cc=arr(i+1:i+1) |
113 |
|
|
arr(i+1:i+1)=arr(i+6:i+6) |
114 |
|
|
arr(i+6:i+6)=cc |
115 |
|
|
cc=arr(i+2:i+2) |
116 |
|
|
arr(i+2:i+2)=arr(i+5:i+5) |
117 |
|
|
arr(i+5:i+5)=cc |
118 |
|
|
cc=arr(i+3:i+3) |
119 |
|
|
arr(i+3:i+3)=arr(i+4:i+4) |
120 |
|
|
arr(i+4:i+4)=cc |
121 |
|
|
enddo |
122 |
|
|
C ------------------------------------------------------------------ |
123 |
|
|
return |
124 |
|
|
end |
125 |
|
|
C========================== |
126 |
|
|
|
127 |
|
|
|
128 |
|
|
|