1 |
C $Header: /u/u3/gcmpack/MITgcm/pkg/sbo/sbo_calc.F,v 1.3.4.1 2003/10/02 18:18:33 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "SBO_OPTIONS.h" |
5 |
|
6 |
SUBROUTINE SBO_CALC( myCurrentTime, myIter, myThid ) |
7 |
C /==========================================================\ |
8 |
C | SUBROUTINE SBO_CALC | |
9 |
C | o Do SBO diagnostic output. | |
10 |
C |==========================================================| |
11 |
C | NOTE: The following subtleties are ignored for time | |
12 |
C | being but may need revisiting at some point in time. | |
13 |
C | 1) The model is volume-preserving and Boussinesq so | |
14 |
C | quantities like oceanic mass need to be interpreted | |
15 |
C | with some care. | |
16 |
C | 2) The sea surface height variable etaN lags other | |
17 |
C | prognostic variables by half a time step. This lag | |
18 |
C | is ignored in SBO computations. | |
19 |
C | 3) Density is computed using function SBO_RHO which is | |
20 |
C | not exaclty equivalent to the model s FIND_RHO. | |
21 |
C \==========================================================/ |
22 |
IMPLICIT NONE |
23 |
|
24 |
c======================================================================= |
25 |
c |
26 |
c Written by Richard Gross (Richard.Gross@jpl.nasa.gov) |
27 |
c June 10, 2001: Modified for online computations in MIT GCM UV |
28 |
c by Dimitris Menemenlis (Menemenlis@jpl.nasa.gov) |
29 |
c |
30 |
c Purpose |
31 |
c calc_sbo calculates the core products of the IERS Special Bureau |
32 |
c for the Oceans including oceanic mass, center-of-mass, angular |
33 |
c momentum, and bottom pressure. |
34 |
c |
35 |
c Usage |
36 |
c 1. calc_sbo must be called, and the results saved, at each time step |
37 |
c in order to create a time series of the IERS SBO core products |
38 |
c 2. it is suggested that after the time series have been generated |
39 |
c and before saving the results to a file, time-mean values be |
40 |
c computed and removed from all of the calculated core products |
41 |
c and that the mean values be reported along with the demeaned |
42 |
c time series |
43 |
c |
44 |
c Availability |
45 |
c ftp://euler.jpl.nasa.gov/sbo/software/calc_sbo.f |
46 |
c |
47 |
c Reference |
48 |
c Gross, R. S., F. O. Bryan, Y. Chao, J. O. Dickey, S. L. Marcus, |
49 |
c R. M. Ponte, and R. Tokmakian, The IERS Special Bureau for the |
50 |
c Oceans, in IERS Technical Note on the IERS Global Geophysical |
51 |
c Fluids Center, edited by B. Chao, in press, Observatoire de Paris, |
52 |
c Paris, France, 2000. |
53 |
c |
54 |
c Required inputs |
55 |
c gridded values of horizontal velocity (u,v), temperature, |
56 |
c salinity, and sea surface height along with the latitude, |
57 |
c and longitude of the grid points and the thicknesses of the |
58 |
c vertical layers |
59 |
c |
60 |
c External routines called by calc_sbo |
61 |
c real function rho1(s, t) |
62 |
c returns density of sea water given salinity s and temperature t |
63 |
c (a default version of rho1 has been included with calc_sbo, |
64 |
c however in general this should be replaced by a function that |
65 |
c returns the density of the model ocean so that the same density |
66 |
c as the model s is used to compute the sbo products) |
67 |
c |
68 |
c Assumptions |
69 |
c 1. the input velocity, temperature, salinity, and sea surface |
70 |
c height fields are assumed to be defined on the same grid |
71 |
c 2. the horizontal grid is assumed to be equally spaced in |
72 |
c latitude and longitude |
73 |
c 3. land is flagged in the input quantities by a salinity or |
74 |
c temperature value greater than or equal to 999.99 |
75 |
c 4. input quantities are assumed to have the following units: |
76 |
c salinity (s) parts per thousand |
77 |
c temperature (t) degrees centigrade |
78 |
c eastwards velocity (u) centimeters per second |
79 |
c northwards velocity (v) centimeters per second |
80 |
c sea surface height (ssh) meters |
81 |
c latitude of grid point degrees N |
82 |
c longitude of grid point degrees E |
83 |
c thickness of layer meters |
84 |
c 5. input quantities are passed to calc_sbo via common blocks |
85 |
c /ogcm/ and /vgrid/ |
86 |
c 6. land is flagged in the output ocean-bottom pressure (obp) |
87 |
c by a value of -999.99 |
88 |
c 7. calulated products have the units: |
89 |
c mass of oceans (mass) kilograms (kg) |
90 |
c center-of-mass of oceans (com) meters (m) |
91 |
c oceanic angular momentum (oam) kg-m**2/second |
92 |
c ocean-bottom pressure (obp) Pascals (Newton/m**2) |
93 |
c 8. calculated products are passed out of calc_sbo via common |
94 |
c block /sbo/ |
95 |
c 9. the sea surface height layer is assumed to have the same |
96 |
c velocity, temperature, and salinity as the first depth layer |
97 |
c |
98 |
c For questions regarding calc_sbo or the IERS SBO, please contact: |
99 |
c Richard Gross Richard.Gross@jpl.nasa.gov |
100 |
c Jet Propulsion Laboratory ph. +1 818-354-4010 |
101 |
c Mail Stop 238-332 fax +1 818-393-6890 |
102 |
c 4800 Oak Grove Drive |
103 |
c Pasadena, Ca 91109-8099 |
104 |
c USA |
105 |
c |
106 |
c======================================================================= |
107 |
|
108 |
C === Global variables === |
109 |
#include "SIZE.h" |
110 |
#include "EEPARAMS.h" |
111 |
#include "PARAMS.h" |
112 |
#include "GRID.h" |
113 |
#include "DYNVARS.h" |
114 |
#include "CG2D.h" |
115 |
#include "SBO.h" |
116 |
|
117 |
C == Routine arguments == |
118 |
C myCurrentTime - Current time of simulation ( s ) |
119 |
C myIter - Iteration number |
120 |
C myThid - Number of this instance of SBO_CALC |
121 |
_RL myCurrentTime |
122 |
INTEGER myIter, myThid |
123 |
|
124 |
#ifdef ALLOW_SBO |
125 |
|
126 |
c external function called by calc_sbo |
127 |
c returns density of sea water |
128 |
_RL sbo_rho |
129 |
|
130 |
c internal variables |
131 |
c bi, bj - array indices |
132 |
c I - index over longitude grid points |
133 |
c J - index over latitude grid points |
134 |
c K - index over layers |
135 |
c lat - latitude of grid point (radians) |
136 |
c lat_deg - latitude of grid point (degrees) |
137 |
c lon - longitude of grid point (radians) |
138 |
c radius - radius of bottom of layer (m) |
139 |
c darea - element of surface area (unit radius) |
140 |
c dradius - element of radius (m) |
141 |
c dvolume - element of volume (m**3) |
142 |
c s - salinity at grid point (ppt) |
143 |
c t - temperature at grid point (deg C) |
144 |
c u - eastward velocity at grid point (m/s) |
145 |
c v - northward velocity at grid point (m/s) |
146 |
c density - density at grid point (kg/m**3) |
147 |
c ae - earth s mean radius (m) (PREM value) |
148 |
c grav - earth s mean gravity (m/s**2) (PREM) |
149 |
c sbo_omega - earth s mean angular velocity (rad/s) |
150 |
integer bi, bj, I, J, K |
151 |
_RL lat, lat_deg, lon, radius, darea, dradius, dvolume, depth |
152 |
_RL s, t, u, v, density |
153 |
_RL ae /6.3710e6/ |
154 |
_RL grav /9.8156/ |
155 |
_RL sbo_omega /7.292115e-5/ |
156 |
|
157 |
c initialize variables to be computed |
158 |
xoamc = 0.0 |
159 |
yoamc = 0.0 |
160 |
zoamc = 0.0 |
161 |
xoamp = 0.0 |
162 |
yoamp = 0.0 |
163 |
zoamp = 0.0 |
164 |
mass = 0.0 |
165 |
xcom = 0.0 |
166 |
ycom = 0.0 |
167 |
zcom = 0.0 |
168 |
DO bj = myByLo(myThid), myByHi(myThid) |
169 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
170 |
DO J = 1-OLy, sNy+OLy |
171 |
DO I = 1-OLx, sNx+OLx |
172 |
obp(I,J,bi,bj) = 0.0 |
173 |
ENDDO |
174 |
ENDDO |
175 |
ENDDO |
176 |
ENDDO |
177 |
|
178 |
c loop over all grid points, accumulating mass, com, oam, and obp |
179 |
|
180 |
do bj = myByLo(myThid), myByHi(myThid) |
181 |
do bi = myBxLo(myThid), myBxHi(myThid) |
182 |
do J = 1, sNy |
183 |
do I = 1, sNx |
184 |
|
185 |
c latitude (rad) |
186 |
lat_deg = yC(I,J,bi,bj) |
187 |
lat = yC(I,J,bi,bj) * pi / 180.0 |
188 |
|
189 |
c longitude (rad) |
190 |
lon = xC(I,J,bi,bj) * pi / 180.0 |
191 |
|
192 |
c unit radius |
193 |
darea = dyF(I,J,bi,bj) * dxF(I,J,bi,bj) / ae / ae |
194 |
|
195 |
do K = 0, Nr |
196 |
c K=0 => ssh |
197 |
if (K .eq. 0) then |
198 |
|
199 |
c if land, flag it in obp and skip it |
200 |
if (_hFacC(i,j,1,bi,bj).eq.0.) then |
201 |
obp(I,J,bi,bj) = -999.99 |
202 |
goto 1010 |
203 |
end if |
204 |
|
205 |
radius = ae |
206 |
dradius = etaN(I,J,bi,bj) |
207 |
c assume surface has same vel and density as first layer |
208 |
s = salt(I,J,1,bi,bj) |
209 |
t = theta(I,J,1,bi,bj) |
210 |
u =(uvel(I,J,1,bi,bj)+uvel(I+1,J,1,bi,bj))/2. |
211 |
v =(vvel(I,J,1,bi,bj)+vvel(I,J+1,1,bi,bj))/2. |
212 |
|
213 |
else |
214 |
|
215 |
c if land, skip it |
216 |
if (_hFacC(i,j,k,bi,bj).eq.0.) goto 1010 |
217 |
|
218 |
c radius to center of cell (m) |
219 |
radius = ae - abs(rC(K)) |
220 |
dradius = drF(K) |
221 |
s = salt(I,J,K,bi,bj) |
222 |
t = theta(I,J,K,bi,bj) |
223 |
u =(uvel(I,J,K,bi,bj)+uvel(I+1,J,K,bi,bj))/2. |
224 |
v =(vvel(I,J,K,bi,bj)+vvel(I,J+1,K,bi,bj))/2. |
225 |
end if |
226 |
|
227 |
c cell volume (m**3) |
228 |
dvolume = darea * radius**2 * dradius |
229 |
|
230 |
c get density |
231 |
depth = ae - radius |
232 |
density = sbo_rho(depth,lat_deg,s,t) |
233 |
|
234 |
c accumulate mass of oceans |
235 |
mass = mass + density * dvolume |
236 |
|
237 |
c accumulate center-of-mass of oceans |
238 |
xcom = xcom + density * cos(lat) * cos(lon) |
239 |
& * radius * dvolume |
240 |
ycom = ycom + density * cos(lat) * sin(lon) |
241 |
& * radius * dvolume |
242 |
zcom = zcom + density * sin(lat) * |
243 |
& radius * dvolume |
244 |
|
245 |
c accumulate oceanic angular momentum due to currents |
246 |
xoamc = xoamc + ( v*sin(lon)-u*sin(lat)*cos(lon)) |
247 |
& * density * radius * dvolume |
248 |
yoamc = yoamc + (-v*cos(lon)-u*sin(lat)*sin(lon)) |
249 |
& * density * radius * dvolume |
250 |
zoamc = zoamc + u*cos(lat) |
251 |
& * density * radius * dvolume |
252 |
|
253 |
c accumulate oceanic angular momentum due to pressure |
254 |
xoamp = xoamp - sin(lat) * cos(lat) * cos(lon) |
255 |
& * sbo_omega * density * radius**2 * dvolume |
256 |
yoamp = yoamp - sin(lat) * cos(lat) * sin(lon) |
257 |
& * sbo_omega * density * radius**2 * dvolume |
258 |
zoamp = zoamp + cos(lat)**2 |
259 |
& * sbo_omega * density * radius**2 * dvolume |
260 |
|
261 |
c accumulate ocean-bottom pressure |
262 |
obp(I,J,bi,bj) = obp(I,J,bi,bj) + |
263 |
& grav * density * dradius |
264 |
|
265 |
c end loop over depth |
266 |
end do |
267 |
|
268 |
1010 continue |
269 |
|
270 |
c end loop over longitude |
271 |
end do |
272 |
|
273 |
c end loop over latitude |
274 |
end do |
275 |
|
276 |
c end loop over bi |
277 |
end do |
278 |
|
279 |
c end loop over bj |
280 |
end do |
281 |
|
282 |
c sum all values across model tiles |
283 |
_GLOBAL_SUM_R8( mass , myThid ) |
284 |
_GLOBAL_SUM_R8( xcom , myThid ) |
285 |
_GLOBAL_SUM_R8( ycom , myThid ) |
286 |
_GLOBAL_SUM_R8( zcom , myThid ) |
287 |
_GLOBAL_SUM_R8( xoamc , myThid ) |
288 |
_GLOBAL_SUM_R8( yoamc , myThid ) |
289 |
_GLOBAL_SUM_R8( zoamc , myThid ) |
290 |
_GLOBAL_SUM_R8( xoamp , myThid ) |
291 |
_GLOBAL_SUM_R8( yoamp , myThid ) |
292 |
_GLOBAL_SUM_R8( zoamp , myThid ) |
293 |
|
294 |
c finish calculating center-of-mass of oceans |
295 |
xcom = xcom / mass |
296 |
ycom = ycom / mass |
297 |
zcom = zcom / mass |
298 |
|
299 |
#endif /* ALLOW_SBO */ |
300 |
|
301 |
return |
302 |
end |