1 |
molod |
1.1 |
subroutine diagout (myThid,listnum) |
2 |
|
|
C*********************************************************************** |
3 |
|
|
C |
4 |
|
|
C Purpose |
5 |
|
|
C Routine to write Output for Diagnostic Fields |
6 |
|
|
C |
7 |
|
|
C Argument Description |
8 |
|
|
C myThid ... Process(or) number |
9 |
|
|
C listnum .. Diagnostics list number being written |
10 |
|
|
C |
11 |
|
|
C*********************************************************************** |
12 |
|
|
|
13 |
|
|
implicit none |
14 |
|
|
#include "EEPARAMS.h" |
15 |
|
|
#include "CPP_OPTIONS.h" |
16 |
|
|
#include "SIZE.h" |
17 |
|
|
|
18 |
|
|
#ifdef(ALLOW_FIZHI)then |
19 |
|
|
#include "fizhi_SIZE.h" |
20 |
|
|
#else |
21 |
|
|
integer Nrphys |
22 |
|
|
parameter (Nrphys=1) |
23 |
|
|
#endif |
24 |
|
|
|
25 |
|
|
#include "diagnostics_SIZE.h" |
26 |
|
|
#include "diagnostics.h" |
27 |
|
|
|
28 |
|
|
integer m, n |
29 |
|
|
character*8 parms1 |
30 |
|
|
character*1 parse1(8) |
31 |
|
|
character*3 mate_index |
32 |
|
|
integer mate |
33 |
|
|
_RL qtmp1(sNx,sNy,Nrphys) |
34 |
|
|
_RL qtmp2(sNx,sNy,Nrphys) |
35 |
|
|
|
36 |
|
|
equivalence ( parms1 , parse1(1) ) |
37 |
|
|
equivalence ( mate_index , parse1(6) ) |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
do n=1,nfields(listnum) |
41 |
|
|
do m=1,ndiagt |
42 |
|
|
if( flds(n,listnum).eq.cdiag(m) .and. idiag(m).ne.0 ) then |
43 |
|
|
|
44 |
|
|
parms1 = gdiag(m) |
45 |
|
|
if(ndiag(m).ne.0.and.idiag(m).ne.0.and.parse1(5).ne.'D')then |
46 |
|
|
if( myThid.eq.0 ) write(6,2000) n,cdiag(n),ndiag(n),gdiag(n) |
47 |
|
|
if(parse1(5).ne.'C') then |
48 |
|
|
do k=1,kdiag(n) |
49 |
|
|
call getdiag ( k,n,bi,bj,undef,qtmp1(1,1,k)) |
50 |
|
|
enddo |
51 |
|
|
|
52 |
|
|
c Check for Vector Diagnostic and Mate |
53 |
|
|
c ------------------------------------ |
54 |
|
|
if( parse1(1).eq.'U' .or. parse1(1).eq.'V' ) then |
55 |
|
|
read (mate_index,100) mate |
56 |
|
|
100 format(i3) |
57 |
|
|
|
58 |
|
|
if( idiag(mate).ne.0 ) then |
59 |
|
|
if(first) then |
60 |
|
|
if( myThid.eq.0 ) write(6,2001) cdiag(n),mate,cdiag(mate) |
61 |
|
|
2001 format(1x,'Computing Vector Mate for ',a8,5x, |
62 |
|
|
. 'Diagnostic # ',i3,2x,a8) |
63 |
|
|
endif |
64 |
|
|
do k=1,kdiag(mate) |
65 |
|
|
CALL GETDIAG ( k,mate,bi,bj,undef,qtmp1(1,1,k)) |
66 |
|
|
enddo |
67 |
|
|
parms2 = gdiag(mate) |
68 |
|
|
else |
69 |
|
|
if(first) then |
70 |
|
|
if( myThid.eq.0 ) write(6,2002) cdiag(n),mate,cdiag(mate) |
71 |
|
|
2002 format(1x,' Vector Mate for ',a8,5x, |
72 |
|
|
. 'Diagnostic # ',i3,2x,a8,' not enabled') |
73 |
|
|
endif |
74 |
|
|
endif |
75 |
|
|
|
76 |
|
|
endif |
77 |
|
|
|
78 |
|
|
ELSE |
79 |
|
|
|
80 |
|
|
read (mate_index,100) mate |
81 |
|
|
do k=1,kdiag(n) |
82 |
|
|
call getdiag2 ( k,n,bi,bj,undef,qtmp1(1,1,k)) |
83 |
|
|
call getdiag2 ( k,mate,bi,bj,undef,qtmp1(1,1,k)) |
84 |
|
|
do j = 1,jm |
85 |
|
|
do i = 1,im |
86 |
|
|
if(qtmp2(i,j,k).ne.0.) then |
87 |
|
|
qtmp1(i,j,k) = qtmp1(i,j,k) / qtmp2(i,j,k) |
88 |
|
|
else |
89 |
|
|
qtmp1(i,j,k) = undef |
90 |
|
|
endif |
91 |
|
|
enddo |
92 |
|
|
enddo |
93 |
|
|
enddo |
94 |
|
|
|
95 |
|
|
ENDIF |
96 |
|
|
|
97 |
|
|
|
98 |
|
|
call mdswritefield( |
99 |
|
|
|
100 |
|
|
enddo |
101 |
|
|
|
102 |
|
|
2000 format(1x,'Computing Diagnostic # ',i3,2x,a8,5x,'Counter: ', |
103 |
|
|
. i3,6x,'Parms: ',a16) |
104 |
|
|
RETURN |
105 |
|
|
END |