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