1 |
cnh |
1.2 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
heimbach |
1.1 |
C Compare KPPhbl_01_01.00000_00720_240 to KPPhbl_orig. |
4 |
|
|
C for North Atlantic test domain. |
5 |
|
|
C Maximum difference between two files is reported. |
6 |
|
|
C On SGI compile using "f77 -bytereclen comp_jpl.f" |
7 |
|
|
|
8 |
|
|
program comp_orig |
9 |
|
|
|
10 |
|
|
implicit none |
11 |
|
|
|
12 |
|
|
integer nx, ny, nrec |
13 |
|
|
parameter (nx=20, ny=16, nrec=4) |
14 |
|
|
|
15 |
|
|
integer lbuffer1, lbuffer2, i, j, k, irec |
16 |
|
|
character fni*80, fno*80 |
17 |
|
|
real*4 fld1(nx,ny), fld2(nx,ny), maxdiff |
18 |
|
|
|
19 |
|
|
fni='KPPhbl.001.001.data' |
20 |
|
|
fno='KPPhbl_orig' |
21 |
|
|
lBuffer1=nx*ny*4 |
22 |
|
|
lBuffer2=nx*ny*4 |
23 |
|
|
open(1,file=fni,access='direct',recl=lBuffer1) |
24 |
|
|
open(2,file=fno,access='direct',recl=lBuffer2) |
25 |
|
|
|
26 |
|
|
irec=0 |
27 |
|
|
maxdiff=0. |
28 |
|
|
do k=1,nrec |
29 |
|
|
irec=irec+1 |
30 |
|
|
read(1,rec=irec) ((fld1(i,j),i=1,nx),j=1,ny) |
31 |
|
|
read(2,rec=irec) ((fld2(i,j),i=1,nx),j=1,ny) |
32 |
|
|
do i=1,nx |
33 |
|
|
do j=1,ny |
34 |
|
|
maxdiff=max(maxdiff,abs(fld1(i,j)-fld2(i,j))) |
35 |
|
|
enddo |
36 |
|
|
enddo |
37 |
|
|
enddo |
38 |
|
|
close(1) |
39 |
|
|
close(2) |
40 |
|
|
|
41 |
|
|
if(maxdiff.lt.5e-4) then |
42 |
|
|
print*,'North Atlantic test passed. KPPhbl file is unchanged.' |
43 |
|
|
else |
44 |
|
|
print*,'WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!' |
45 |
|
|
print*,'North Atlantic test failed. KPPhbl file has changed.' |
46 |
|
|
endif |
47 |
|
|
print*,'Maximum difference is',maxdiff,' m.' |
48 |
|
|
|
49 |
|
|
stop |
50 |
|
|
end |