/[MITgcm]/MITgcm/pkg/sbo/sbo_calc.F
ViewVC logotype

Contents of /MITgcm/pkg/sbo/sbo_calc.F

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


Revision 1.6 - (show annotations) (download)
Thu Oct 9 04:19:20 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52k_post, checkpoint52, checkpoint52f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51l_pre, checkpoint52m_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint51r_post, checkpoint51i_post, checkpoint52d_post, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint52j_post, branch-netcdf, checkpoint52l_post, checkpoint51o_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.5: +2 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

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

  ViewVC Help
Powered by ViewVC 1.1.22