/[MITgcm]/MITgcm/pkg/diagnostics/diagout.F
ViewVC logotype

Annotation of /MITgcm/pkg/diagnostics/diagout.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Feb 26 18:33:46 2004 UTC (20 years, 3 months ago) by molod
Branch: MAIN
Changes since 1.1: +14 -9 lines
Modification to fix bugs

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 molod 1.2 #ifdef ALLOW_FIZHI
19 molod 1.1 #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 molod 1.2 integer myThid, listnum
29    
30     integer k, m, n
31 molod 1.1 character*8 parms1
32     character*1 parse1(8)
33     character*3 mate_index
34     integer mate
35 molod 1.2 _RL qtmp1(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nr+Nrphys,Nsx,Nsy)
36     _RL qtmp2(1-OLx:sNx+Olx,1-Oly:sNy+Oly,Nr+Nrphys,Nsx,Nsy)
37     _RL undef, getcon
38    
39 molod 1.1 equivalence ( parms1 , parse1(1) )
40     equivalence ( mate_index , parse1(6) )
41    
42    
43 molod 1.2 undef = getcon('UNDEF')
44    
45 molod 1.1 do n=1,nfields(listnum)
46     do m=1,ndiagt
47     if( flds(n,listnum).eq.cdiag(m) .and. idiag(m).ne.0 ) then
48    
49     parms1 = gdiag(m)
50     if(ndiag(m).ne.0.and.idiag(m).ne.0.and.parse1(5).ne.'D')then
51     if( myThid.eq.0 ) write(6,2000) n,cdiag(n),ndiag(n),gdiag(n)
52     if(parse1(5).ne.'C') then
53     do k=1,kdiag(n)
54 molod 1.2 call getdiag ( myThid,k,n,undef,qtmp1)
55 molod 1.1 enddo
56    
57     c Check for Vector Diagnostic and Mate
58     c ------------------------------------
59     if( parse1(1).eq.'U' .or. parse1(1).eq.'V' ) then
60     read (mate_index,100) mate
61     100 format(i3)
62    
63     if( idiag(mate).ne.0 ) then
64     if(first) then
65     if( myThid.eq.0 ) write(6,2001) cdiag(n),mate,cdiag(mate)
66     2001 format(1x,'Computing Vector Mate for ',a8,5x,
67     . 'Diagnostic # ',i3,2x,a8)
68     endif
69     do k=1,kdiag(mate)
70 molod 1.2 CALL GETDIAG ( myThid,k,mate,undef,qtmp1(1,1,k))
71 molod 1.1 enddo
72     parms2 = gdiag(mate)
73     else
74     if(first) then
75     if( myThid.eq.0 ) write(6,2002) cdiag(n),mate,cdiag(mate)
76     2002 format(1x,' Vector Mate for ',a8,5x,
77     . 'Diagnostic # ',i3,2x,a8,' not enabled')
78     endif
79     endif
80    
81     endif
82    
83     ELSE
84    
85     read (mate_index,100) mate
86     do k=1,kdiag(n)
87 molod 1.2 call getdiag2 ( myThid,k,n,undef,qtmp1(1,1,k))
88     call getdiag2 ( myThid,k,mate,undef,qtmp1(1,1,k))
89 molod 1.1 do j = 1,jm
90     do i = 1,im
91     if(qtmp2(i,j,k).ne.0.) then
92     qtmp1(i,j,k) = qtmp1(i,j,k) / qtmp2(i,j,k)
93     else
94     qtmp1(i,j,k) = undef
95     endif
96     enddo
97     enddo
98     enddo
99    
100     ENDIF
101    
102    
103     call mdswritefield(
104    
105     enddo
106    
107     2000 format(1x,'Computing Diagnostic # ',i3,2x,a8,5x,'Counter: ',
108     . i3,6x,'Parms: ',a16)
109     RETURN
110     END

  ViewVC Help
Powered by ViewVC 1.1.22