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

Diff of /MITgcm/pkg/diagnostics/diagnostics_setunits.F

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

revision 1.4 by edhill, Tue Jul 6 03:55:53 2004 UTC revision 1.5 by edhill, Wed Jul 7 03:10:15 2004 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  #include "DIAG_OPTIONS.h"  #include "DIAG_OPTIONS.h"
5    
6        subroutine diagnostics_setunits (myThid, chardiag, diagunits)  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7  C***********************************************************************  CBOP 0
8  C  Purpose  C     !ROUTINE: DIAGNOSTICS_SETUNITS
9  C  -------  
10  C   Wrapper routine to set the units of an active diagnostic  C     !INTERFACE:
11  C        SUBROUTINE DIAGNOSTICS_SETUNITS (
12  C  Arguments Description       I     myThid,
13  C  ----------------------       I     chardiag,
14  C     myThid ..... Current Process(or)       I     diagunits )
15  C     chardiag ... Character *8 expression for diag to fill  
16  C     diagunits .. Character *16 expression for diag units  C     !DESCRIPTION:
17  C***********************************************************************  C     Wrapper routine to set the units of an active diagnostic
18          
19    C     !USES:
20         implicit none         implicit none
21  #include "SIZE.h"  #include "SIZE.h"
22  #include "diagnostics_SIZE.h"  #include "diagnostics_SIZE.h"
23  #include "diagnostics.h"  #include "diagnostics.h"
24    
25    C     !INPUT PARAMETERS:
26        integer myThid        integer myThid
27        character *8 chardiag        character*8 chardiag
28        character *16 diagunits        character*16 diagunits
29    CEOP
30    
31  c Local variables  C     Local variables
 c ===============  
32        integer n, ndiagnum, ipointer        integer n, ndiagnum, ipointer
33    
34  C Run through list of active diagnostics to make sure  C     Run through list of active diagnostics to make sure
35  C we are trying to fill a valid diagnostic  C     we are trying to fill a valid diagnostic
36          
37        ndiagnum = 0        ndiagnum = 0
38        ipointer = 0        ipointer = 0
39        do n = 1,ndiagt        do n = 1,ndiagt
40         if(chardiag.eq.cdiag(n)) then          if(chardiag.eq.cdiag(n)) then
41          ndiagnum = n            ndiagnum = n
42          ipointer = idiag(n)            ipointer = idiag(n)
43         endif          endif
44        enddo        enddo
45        if( ndiagnum.ne.0 .and. ipointer.ne.0 ) then        if( ndiagnum.ne.0 .and. ipointer.ne.0 ) then
46         udiag(ndiagnum)=diagunits          udiag(ndiagnum)=diagunits
47        else        else
48         write(6,1000)chardiag          write(6,1000)chardiag
49        endif        endif
50          
51   1000 format(' ',' Warning: Trying to set units of diagnostic ',a8,   1000 format(' ',' Warning: Trying to set units of diagnostic ',a8,
52       .        ' But it is not a valid (or active) name ')       &     ' But it is not a valid (or active) name ')
53    
54        return        return
55        end        end

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22