/[MITgcm]/MITgcm/pkg/aim_v23/aim_write_tave.F
ViewVC logotype

Contents of /MITgcm/pkg/aim_v23/aim_write_tave.F

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


Revision 1.2 - (show annotations) (download)
Fri Jan 3 03:51:26 2003 UTC (21 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint50c_post, checkpoint52d_pre, checkpoint48e_post, checkpoint50c_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint48i_post, checkpoint50d_pre, checkpoint52k_post, checkpoint51, checkpoint50, checkpoint52, checkpoint50d_post, checkpoint52f_post, checkpoint50b_pre, checkpoint51f_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint48d_post, checkpoint48f_post, checkpoint52b_pre, checkpoint51l_pre, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint52f_pre, checkpoint47j_post, branchpoint-genmake2, checkpoint51r_post, checkpoint48c_post, checkpoint51i_post, checkpoint51b_post, checkpoint51c_post, checkpoint52d_post, checkpoint50g_post, checkpoint52a_pre, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint52j_post, checkpoint50e_post, branch-netcdf, checkpoint51e_post, checkpoint48, checkpoint49, checkpoint51o_post, checkpoint51f_pre, checkpoint47h_post, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint50b_post, checkpoint51m_post, checkpoint51a_post, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.1: +61 -18 lines
 time-average AIM output: become independent from statvars time-average
  (can be used with #undef ALLOW_TIMEAVE) ; add new variables (e.g., RH)

1 C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_write_tave.F,v 1.1 2002/11/22 17:17:03 jmc Exp $
2 C $Name: $
3
4 #include "AIM_OPTIONS.h"
5
6 CStartOfInterFace
7 SUBROUTINE AIM_WRITE_TAVE( myTime, myIter, myThid )
8 C *==========================================================*
9 C | SUBROUTINE AIM_WRITE_TAVE
10 C | o Write out AIM time-average output
11 C *==========================================================*
12 IMPLICIT NONE
13
14 C === Global variables ===
15 #include "SIZE.h"
16 #include "EEPARAMS.h"
17 #include "PARAMS.h"
18 #include "AIM_PARAMS.h"
19 #include "AIM_DIAGS.h"
20 LOGICAL DIFFERENT_MULTIPLE
21 EXTERNAL DIFFERENT_MULTIPLE
22
23 C Common (shared with RD_WR_FLD routines in read_write_fld.F)
24 COMMON /RD_WR_FLD/ globalFile
25 LOGICAL globalFile
26
27 C == Routine arguments ==
28 C myTime - Current time of simulation ( s )
29 C myIter - Iteration number
30 C myThid - Number of this instance of the routine
31 _RL myTime
32 INTEGER myIter
33 INTEGER myThid
34 CEndOfInterface
35
36 #ifdef ALLOW_AIM
37
38 C == Local variables ==
39 INTEGER bi, bj, K
40 CHARACTER*(MAX_LEN_MBUF) msgBuf, suff, fn
41 LOGICAL gf
42 gf = globalFile
43
44 #ifdef ALLOW_AIM_TAVE
45
46 IF (aim_taveFreq.LE.0.) RETURN
47
48 C Dump files and restart average computation if needed
49 IF ( myIter.NE.nIter0 .AND.
50 & DIFFERENT_MULTIPLE(aim_taveFreq,myTime,
51 & myTime-deltaTClock)
52 & ) THEN
53
54 C Normalize by integrated time
55 DO bj = myByLo(myThid), myByHi(myThid)
56 DO bi = myBxLo(myThid), myBxHi(myThid)
57 CALL TIMEAVE_NORMALIZ(USTRtave,aim_timeAve,1,bi,bj,myThid)
58 CALL TIMEAVE_NORMALIZ(VSTRtave,aim_timeAve,1,bi,bj,myThid)
59 CALL TIMEAVE_NORMALIZ(TSRtave,aim_timeAve,1,bi,bj,myThid)
60 CALL TIMEAVE_NORMALIZ(OLRtave,aim_timeAve,1,bi,bj,myThid)
61 CALL TIMEAVE_NORMALIZ(SSRtave,aim_timeAve,1,bi,bj,myThid)
62 CALL TIMEAVE_NORMALIZ(SLRtave,aim_timeAve,1,bi,bj,myThid)
63 CALL TIMEAVE_NORMALIZ(SHFtave,aim_timeAve,1,bi,bj,myThid)
64 CALL TIMEAVE_NORMALIZ(EVAPtave,aim_timeAve,1,bi,bj,myThid)
65 CALL TIMEAVE_NORMALIZ(PRECNVtave,aim_timeAve,1,bi,bj,myThid)
66 CALL TIMEAVE_NORMALIZ(PRECLStave,aim_timeAve,1,bi,bj,myThid)
67 CALL TIMEAVE_NORMALIZ(CLOUDCtave,aim_timeAve,1,bi,bj,myThid)
68 CALL TIMEAVE_NORMALIZ(CLTOPtave,aim_timeAve,1,bi,bj,myThid)
69 CALL TIMEAVE_NORMALIZ(CBMFtave, aim_timeAve,1,bi,bj,myThid)
70 CALL TIMEAVE_NORMALIZ(DRAGtave, aim_timeAve,1,bi,bj,myThid)
71 CALL TIMEAVE_NORMALIZ(aimV0tave,aim_timeAve,1,bi,bj,myThid)
72 CALL TIMEAVE_NORMALIZ(aimT0tave,aim_timeAve,1,bi,bj,myThid)
73 CALL TIMEAVE_NORMALIZ(aimQ0tave,aim_timeAve,1,bi,bj,myThid)
74
75 CALL TIMEAVE_NORMALIZ(aimRHtave,aim_timeAve,Nr,bi,bj,myThid)
76 ENDDO
77 ENDDO
78
79
80 _BARRIER
81 _BEGIN_MASTER( myThid )
82
83 WRITE(fn,'(A,I10.10)') 'aimPhytave.',myIter
84 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
85 & 'RL',1,USTRtave, 1,myIter,myThid)
86 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
87 & 'RL',1,VSTRtave, 2,myIter,myThid)
88 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
89 & 'RL',1,TSRtave , 3,myIter,myThid)
90 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
91 & 'RL',1,OLRtave , 4,myIter,myThid)
92 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
93 & 'RL',1,SSRtave , 5,myIter,myThid)
94 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
95 & 'RL',1,SLRtave , 6,myIter,myThid)
96 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
97 & 'RL',1,SHFtave , 7,myIter,myThid)
98 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
99 & 'RL',1,EVAPtave, 8,myIter,myThid)
100 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
101 & 'RL',1,PRECNVtave, 9,myIter,myThid)
102 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
103 & 'RL',1,PRECLStave,10,myIter,myThid)
104 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
105 & 'RL',1,CLOUDCtave,11,myIter,myThid)
106 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
107 & 'RL',1,CLTOPtave, 12,myIter,myThid)
108 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
109 & 'RL',1,CBMFtave, 13,myIter,myThid)
110 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
111 & 'RL',1,DRAGtave, 14,myIter,myThid)
112 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
113 & 'RL',1,aimV0tave, 15,myIter,myThid)
114 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
115 & 'RL',1,aimT0tave, 16,myIter,myThid)
116 CALL MDSWRITEFIELD(fn,writeBinaryPrec,gf,
117 & 'RL',1,aimQ0tave, 17,myIter,myThid)
118
119 WRITE(suff,'(I10.10)') myIter
120 CALL WRITE_FLD_XYZ_RL('aim_RHtave.',suff,aimRHtave,
121 & myIter,myThid)
122
123 WRITE(msgBuf,'(A,I10)')
124 & '// AIM Time-average written, t-step', myIter
125 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
126 & SQUEEZE_RIGHT, myThid )
127 WRITE(msgBuf,'(A)') ' '
128 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
129 & SQUEEZE_RIGHT, myThid )
130
131 _END_MASTER( myThid )
132 _BARRIER
133
134 C Reset averages to zero
135 DO bj = myByLo(myThid), myByHi(myThid)
136 DO bi = myBxLo(myThid), myBxHi(myThid)
137 CALL TIMEAVE_RESET(USTRtave, 1, bi, bj, myThid)
138 CALL TIMEAVE_RESET(VSTRtave, 1, bi, bj, myThid)
139 CALL TIMEAVE_RESET(TSRtave, 1, bi, bj, myThid)
140 CALL TIMEAVE_RESET(OLRtave, 1, bi, bj, myThid)
141 CALL TIMEAVE_RESET(SSRtave, 1, bi, bj, myThid)
142 CALL TIMEAVE_RESET(SLRtave, 1, bi, bj, myThid)
143 CALL TIMEAVE_RESET(SHFtave, 1, bi, bj, myThid)
144 CALL TIMEAVE_RESET(EVAPtave, 1, bi, bj, myThid)
145 CALL TIMEAVE_RESET(PRECNVtave,1, bi, bj, myThid)
146 CALL TIMEAVE_RESET(PRECLStave,1, bi, bj, myThid)
147 CALL TIMEAVE_RESET(CLOUDCtave,1, bi, bj, myThid)
148 CALL TIMEAVE_RESET(CLTOPtave, 1, bi, bj, myThid)
149 CALL TIMEAVE_RESET(CBMFtave, 1, bi, bj, myThid)
150 CALL TIMEAVE_RESET(DRAGtave, 1, bi, bj, myThid)
151 CALL TIMEAVE_RESET(aimV0tave, 1, bi, bj, myThid)
152 CALL TIMEAVE_RESET(aimT0tave, 1, bi, bj, myThid)
153 CALL TIMEAVE_RESET(aimQ0tave, 1, bi, bj, myThid)
154 CALL TIMEAVE_RESET(aimRHtave,Nr, bi, bj, myThid)
155 DO k=1,Nr
156 aim_timeAve(k,bi,bj)=0.
157 ENDDO
158 ENDDO
159 ENDDO
160
161 ENDIF
162
163 #endif /* ALLOW_AIM_TAVE */
164
165 #endif /* ALLOW_AIM */
166
167 RETURN
168 END

  ViewVC Help
Powered by ViewVC 1.1.22