/[MITgcm]/MITgcm/pkg/ecco/cost_averagesinit.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_averagesinit.F

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


Revision 1.3 - (show annotations) (download)
Thu Sep 1 05:32:56 2005 UTC (18 years, 9 months ago) by heimbach
Branch: MAIN
Changes since 1.2: +21 -7 lines
o Adding cost term for seaice obs (daily SMR vs. AREA)
  new seaice_cost init/weight/final routines
o Modularized cost_averages routines (new cost_averagesgeneric.F)

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_averagesinit.F,v 1.2 2004/10/11 16:38:53 heimbach Exp $
2
3 #include "COST_CPPOPTIONS.h"
4
5 subroutine cost_averagesinit( mythid )
6
7 c ==================================================================
8 c SUBROUTINE cost_averagesinit
9 c ==================================================================
10 c
11 c o Set average fields for temperature, salinity, surface pressure,
12 c and averaging counters to zero. The average fields are declared
13 c in the header file ecco_cost.h.
14 c
15 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
16 c
17 c changed: Christian Eckert eckert@mit.edu 11-Feb-2000
18 c
19 c - Restructured the code in order to create a package
20 c for the MITgcmUV.
21 c
22 c ==================================================================
23 c SUBROUTINE cost_averagesinit
24 c ==================================================================
25
26 implicit none
27
28 c == global variables ==
29
30 #include "EEPARAMS.h"
31 #include "SIZE.h"
32
33 #include "ecco_cost.h"
34 #include "ctrl_dummy.h"
35 #ifdef ALLOW_SEAICE
36 # include "SEAICE_COST.h"
37 #endif
38
39 c == routine arguments ==
40
41 integer mythid
42
43 c == local variables ==
44
45 integer bi,bj
46 integer i,j,k
47 integer itlo,ithi
48 integer jtlo,jthi
49 integer jmin,jmax
50 integer imin,imax
51
52 c == end of interface ==
53
54 c-- Set the loop ranges.
55 jtlo = mybylo(mythid)
56 jthi = mybyhi(mythid)
57 itlo = mybxlo(mythid)
58 ithi = mybxhi(mythid)
59 jmin = 1
60 jmax = sny
61 imin = 1
62 imax = snx
63
64 do bj = jtlo,jthi
65 do bi = itlo,ithi
66
67 #ifdef ALLOW_SSH_COST_CONTRIBUTION
68 c-- Initialise surface pressure average.
69 do j = jmin,jmax
70 do i = imin,imax
71 psbar(i,j,bi,bj) = 0. _d 0
72 enddo
73 enddo
74
75 xx_psbar_mean_dummy = 0. _d 0
76 #endif
77
78 #if (defined (ALLOW_THETA_COST_CONTRIBUTION) || \
79 defined (ALLOW_CTDT_COST_CONTRIBUTION) || \
80 defined (ALLOW_XBT_COST_CONTRIBUTION) || \
81 defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
82 defined (ALLOW_OBCS_COST_CONTRIBUTION))
83 c-- Initialise temperature average (3d).
84 do k = 1,nr
85 do j = jmin,jmax
86 do i = imin,imax
87 tbar(i,j,k,bi,bj) = 0. _d 0
88 enddo
89 enddo
90 enddo
91 xx_tbar_mean_dummy = 0. _d 0
92 #else
93 #ifdef ALLOW_SST_COST_CONTRIBUTION
94 c-- Initialise temperature average (2d).
95 k = 1
96 do j = jmin,jmax
97 do i = imin,imax
98 tbar(i,j,bi,bj) = 0. _d 0
99 enddo
100 enddo
101 xx_tbar_mean_dummy = 0. _d 0
102 #endif
103 #endif
104
105 #if (defined (ALLOW_SALT_COST_CONTRIBUTION) || \
106 defined (ALLOW_CTDS_COST_CONTRIBUTION) || \
107 defined (ALLOW_DRIFT_COST_CONTRIBUTION) || \
108 defined (ALLOW_OBCS_COST_CONTRIBUTION))
109 c-- Initialise salt average.
110 do k = 1,nr
111 do j = jmin,jmax
112 do i = imin,imax
113 sbar(i,j,k,bi,bj) = 0. _d 0
114 enddo
115 enddo
116 enddo
117 xx_sbar_mean_dummy = 0. _d 0
118 #else
119 #ifdef ALLOW_SSS_COST_CONTRIBUTION
120 c-- Initialise salinity average (2d).
121 k = 1
122 do j = jmin,jmax
123 do i = imin,imax
124 sbar(i,j,bi,bj) = 0. _d 0
125 enddo
126 enddo
127 xx_sbar_mean_dummy = 0. _d 0
128 #endif
129 #endif
130
131 #if (defined (ALLOW_DRIFTER_COST_CONTRIBUTION) || \
132 defined (ALLOW_OBCS_COST_CONTRIBUTION))
133 c-- Initialise uvel, vvel average.
134 do k = 1,nr
135 do j = jmin,jmax
136 do i = imin,imax
137 ubar(i,j,k,bi,bj) = 0. _d 0
138 vbar(i,j,k,bi,bj) = 0. _d 0
139 enddo
140 enddo
141 enddo
142 xx_ubar_mean_dummy = 0. _d 0
143 xx_vbar_mean_dummy = 0. _d 0
144 #endif
145
146 #ifdef ALLOW_DRIFTW_COST_CONTRIBUTION
147 c-- Initialise uvel, vvel average.
148 do k = 1,nr
149 do j = jmin,jmax
150 do i = imin,imax
151 wbar(i,j,k,bi,bj) = 0. _d 0
152 enddo
153 enddo
154 enddo
155 xx_wbar_mean_dummy = 0. _d 0
156 #endif
157
158 #ifdef ALLOW_SCAT_COST_CONTRIBUTION
159 c-- Initialise salinity average (2d).
160 do j = jmin,jmax
161 do i = imin,imax
162 tauxbar(i,j,bi,bj) = 0. _d 0
163 tauybar(i,j,bi,bj) = 0. _d 0
164 enddo
165 enddo
166 xx_taux_mean_dummy = 0. _d 0
167 xx_tauy_mean_dummy = 0. _d 0
168 #endif
169
170 #ifdef ALLOW_MEAN_HFLUX_COST_CONTRIBUTION
171 c-- Initialise salinity average (2d).
172 do j = jmin,jmax
173 do i = imin,imax
174 hfluxbar(i,j,bi,bj) = 0. _d 0
175 enddo
176 enddo
177 xx_hflux_mean_dummy = 0. _d 0
178 #endif
179
180 #ifdef ALLOW_MEAN_SFLUX_COST_CONTRIBUTION
181 c-- Initialise salinity average (2d).
182 do j = jmin,jmax
183 do i = imin,imax
184 sfluxbar(i,j,bi,bj) = 0. _d 0
185 enddo
186 enddo
187 xx_sflux_mean_dummy = 0. _d 0
188 #endif
189
190 #ifdef ALLOW_SEAICE
191
192 # ifdef ALLOW_SEAICE_COST_SMR_AREA
193 c-- Initialise salinity average (2d).
194 do j = jmin,jmax
195 do i = imin,imax
196 smrareabar(i,j,bi,bj) = 0. _d 0
197 enddo
198 enddo
199 xx_smrareabar_mean_dummy = 0. _d 0
200 # endif
201
202 #endif
203
204 enddo
205 enddo
206
207 return
208 end
209

  ViewVC Help
Powered by ViewVC 1.1.22