1 |
molod |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_diagalarms.F,v 1.4 2005/10/03 18:46:50 molod Exp $ |
2 |
molod |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "FIZHI_OPTIONS.h" |
5 |
molod |
1.3 |
subroutine fizhi_diagalarms (myThid) |
6 |
molod |
1.1 |
|
7 |
|
|
C*********************************************************************** |
8 |
|
|
C Purpose |
9 |
|
|
C ------- |
10 |
|
|
C Routine to Set Alarms for diagnostic output |
11 |
|
|
C |
12 |
|
|
C Argument Description |
13 |
|
|
C -------------------- |
14 |
|
|
C myThid .... Process ID |
15 |
|
|
C |
16 |
molod |
1.3 |
C NOTE: This routine ASSUMES that fizhi_init_fixed has been called |
17 |
|
|
C IT WILL NOT WORK OTHERWISE |
18 |
molod |
1.1 |
C*********************************************************************** |
19 |
|
|
implicit none |
20 |
|
|
#include "SIZE.h" |
21 |
|
|
#include "EEPARAMS.h" |
22 |
|
|
#include "PARAMS.h" |
23 |
|
|
#include "DIAGNOSTICS_SIZE.h" |
24 |
|
|
#include "DIAGNOSTICS.h" |
25 |
|
|
#include "chronos.h" |
26 |
|
|
|
27 |
|
|
c Input Parameters |
28 |
|
|
c ---------------- |
29 |
molod |
1.3 |
integer myThid |
30 |
molod |
1.1 |
|
31 |
molod |
1.3 |
c Local variables |
32 |
molod |
1.1 |
c ------------------- |
33 |
|
|
integer nhmsf, n, nincr |
34 |
|
|
integer mmdd,hhmmss,nsecf2 |
35 |
|
|
character *9 tagname |
36 |
molod |
1.3 |
integer nymdb,nhmsb |
37 |
molod |
1.5 |
_RL absfreq |
38 |
molod |
1.3 |
|
39 |
molod |
1.1 |
c Set Alarm Clocks |
40 |
|
|
c ---------------- |
41 |
molod |
1.3 |
c To Set Begin Time for Alarm Clocks: |
42 |
|
|
c Increment < 1 month - counting starts at model start time |
43 |
|
|
c Increment >= 1 month - counting starts at beginning of start month |
44 |
|
|
c ---------------------------------------------------------------------- |
45 |
molod |
1.1 |
|
46 |
jmc |
1.2 |
C- 2D/3D field diagnostics: |
47 |
molod |
1.1 |
do n = 1,nlists |
48 |
molod |
1.4 |
absfreq = abs(freq(n)) |
49 |
|
|
if(absfreq.lt.100.) then |
50 |
molod |
1.3 |
nymdb = nymd |
51 |
|
|
nhmsb = nhms |
52 |
|
|
else |
53 |
|
|
nymdb = int(nymd/100) * 100 + 1 |
54 |
|
|
nhmsb = 0 |
55 |
|
|
endif |
56 |
molod |
1.1 |
write(tagname,'(A,I2.2)')'diagtag',n |
57 |
molod |
1.4 |
mmdd = int(absfreq) |
58 |
|
|
hhmmss = int((absfreq - int(absfreq))*1.e6) |
59 |
jmc |
1.2 |
nincr = mmdd * 1.e6 + hhmmss |
60 |
|
|
call set_alarm(tagname,nymdb,nhmsb,nincr) |
61 |
|
|
enddo |
62 |
|
|
|
63 |
|
|
C- Global/Regional statistics diagnostics: |
64 |
|
|
do n = 1,diagSt_nbLists |
65 |
molod |
1.4 |
absfreq = abs(diagSt_freq(n)) |
66 |
|
|
if(absfreq.lt.100.) then |
67 |
molod |
1.3 |
nymdb = nymd |
68 |
|
|
nhmsb = nhms |
69 |
|
|
else |
70 |
|
|
nymdb = int(nymd/100) * 100 + 1 |
71 |
|
|
nhmsb = 0 |
72 |
|
|
endif |
73 |
jmc |
1.2 |
write(tagname,'(A,I2.2)')'diagStg',n |
74 |
molod |
1.4 |
mmdd = int(absfreq) |
75 |
|
|
hhmmss = int((absfreq - int(absfreq))*1.e6) |
76 |
jmc |
1.2 |
nincr = mmdd * 1.e6 + hhmmss |
77 |
molod |
1.1 |
call set_alarm(tagname,nymdb,nhmsb,nincr) |
78 |
|
|
enddo |
79 |
|
|
|
80 |
|
|
return |
81 |
|
|
end |