1 |
C $Header: /u/gcmpack/MITgcm/pkg/diagnostics/diagnostics_setunits.F,v 1.3 2004/05/05 00:39:21 edhill Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "DIAG_OPTIONS.h" |
5 |
|
6 |
subroutine diagnostics_setunits (myThid, chardiag, diagunits) |
7 |
C*********************************************************************** |
8 |
C Purpose |
9 |
C ------- |
10 |
C Wrapper routine to set the units of an active diagnostic |
11 |
C |
12 |
C Arguments Description |
13 |
C ---------------------- |
14 |
C myThid ..... Current Process(or) |
15 |
C chardiag ... Character *8 expression for diag to fill |
16 |
C diagunits .. Character *16 expression for diag units |
17 |
C*********************************************************************** |
18 |
implicit none |
19 |
#include "SIZE.h" |
20 |
#include "diagnostics_SIZE.h" |
21 |
#include "diagnostics.h" |
22 |
|
23 |
integer myThid |
24 |
character *8 chardiag |
25 |
character *16 diagunits |
26 |
|
27 |
c Local variables |
28 |
c =============== |
29 |
integer n, ndiagnum, ipointer |
30 |
|
31 |
C Run through list of active diagnostics to make sure |
32 |
C we are trying to fill a valid diagnostic |
33 |
|
34 |
ndiagnum = 0 |
35 |
ipointer = 0 |
36 |
do n = 1,ndiagt |
37 |
if(chardiag.eq.cdiag(n)) then |
38 |
ndiagnum = n |
39 |
ipointer = idiag(n) |
40 |
endif |
41 |
enddo |
42 |
if( ndiagnum.ne.0 .and. ipointer.ne.0 ) then |
43 |
udiag(ndiagnum)=diagunits |
44 |
else |
45 |
write(6,1000)chardiag |
46 |
endif |
47 |
|
48 |
1000 format(' ',' Warning: Trying to set units of diagnostic ',a8, |
49 |
. ' But it is not a valid (or active) name ') |
50 |
return |
51 |
end |