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