Home

Documentation User's Guide and Reference Manual

image

Contents

1. 154 15 1 4 sgi 154 15 1 5 distributed memory 154 15 2 Compilers 154 15 2 11190 154 15 3 Dataflow I O Options 154 15 3 1 ramdrive 154 15 3 2 crayio 155 15 3 3 fio 155 15 4 155 15 4 1 coarse_grained_parallelism 155 15 5 Grid generation soo ho ren 155 15 5 1 drivegrids aoaaa 155 15 5 2 generate a grid 155 15 5 3 read my grid 155 15 5 4 writemy grid ees 155 15 5 5 centered amp 156 15 6 Grid Transformations 156 15 6 1 rot grid 156 15 7 Topography and geometry generation len 156 15 7 1 156 15 7 2 idealized kmt 156 15 7 3 scripps kmt 156 15 7 4 _ 156 15 7 5 readimykmt 156 15 7 6 writemmy kmt 157 15 7 7 flat
2. 52 5 4 2 Integration control 53 5 4 3 Surface boundary conditions 53 5 4 4 Time steps 54 5 4 5 External mode 55 5 4 6 55 5 4 7 Diagnostic intervals 56 5 4 8 Directing output 59 5 4 9 Isopycnal diffusion 59 5 4 10 Pacanowski Philander 60 5 4 11 Smagorinsky mixing 60 5 4 12 Bryan Lewis mixing 60 5 4 13 Held Larichev mixing 60 6 Modules and Modularity 61 6 1 What are modules 61 6 2 List 62 6 2 1 convect F 63 6 2 2 denscoef E 2 222 eee os 63 6 2 3 64 6 2 4 jomngr F 64 6 2 5 poisson F 65 6 2 6 66 6 2 7 timeinterp F 67 6 2 8 timer F 67 6 2 9 67 6 2 10 topog F 10 6 2 11 u
3. 12 2 Work done by Coriolis terms 12 3 Work done by pressure terms 13 Stevens Open Boundary Conditions 13 1 Boundary specifications 13 2 Options 13 3 New Files 13 4 Changes in existing subroutines ees 13 5 Data Preparation Routines 13 6 TO DO List How to set up open 14 Options for testing modules 14 1 Testing modules 14 1 1 test convect 14 1 2 4 14 1 3 drivegrids 22e 14 1 4 testiomngr 14 1 5 test poisson 4 4 4 ll les 14 1 6 test ppmix 14 1 7 test rotation 4 2l e ee ees 14 1 8 test timeinterp 14 1 9 test timer 14 1 l0test tmngr 4 2 ll e ee o n on 14 l lldrivetopog 14 1 12test 14 1 13drivemwsim 0 CONTENTS xiii 15 General Model Options 153 15 1 Computer 153 15 1 1 cray ymp ssaa 153 15 1 2 90 153 15 1 3 490
4. 225 18 2 5 fetmetcdf 226 18 2 6 gyre components 221 18 2 7 matrix sections 4 2 2l rh 228 18 2 8 meridionaloverturning 4 ees 228 18 2 9 meridionaltracer budget 228 18 2 10netcdf 230 18 2 11 234 18 2 12save mixing coeff 234 18 2 13show external mode 235 18 2 14show_zonal_meanofsbe 235 18 2 15snapshots 236 18 2 16stability_tests 237 18 2 17 _ 238 18 2 18time averages 242 xvi CONTENTS 18 2 19time step monitor 242 18 2 20to0pog netedf ee 243 18 2 21trace coupled fluxes ee 244 18 2 22tracedndices 244 18 2 23tracer averages 244 18 2 24tracer yZ 245 18 2 25trajectories 246 18 2 26xbt 247 19 Getting Started 251 19 1 System Requirements 251 19 2 Changes for Fortran 77 users 251 19 3 Special reque
5. 17 6 G 1 1 40 1 i i Q0 1 Q4 i i cddru p 17 7 a00 41 0 i i Q0 1 04 1 1 i cddyui j ay i 17 8 20 0 41 0 i i Using Equations 17 1 17 4 the first brackets in Equation 16 13 can be rewritten as To within roundoff However in these cases the elliptic equations for the prognostic surface pressure p are of course different than those given above for the prognostic stream function V 216 CHAPTER 17 ELLIPTIC EQUATION SOLVER OPTIONS dau Lj COS QU Y Y Y gt eddy jy cddt n TEE jrow j i j 0 i24 j iti jrow j dYUjrow j 2AT dyu jn jn d 17 JA Lir pin jrowt j 4j iti jrow 3 7 GUXW pj oy pint T 17 9 and in a similar fashion the implicit Coriolis contributions from the second brackets in Equation 16 13 can be rewritten as 1 1 0 0 f NC 5 eddz up VERE EM j 0 j 20 i 1 j 1 iti row 3 cddyujs j cdd t jn _ Siow Lit pitt irow4j tj 17 10 iti jrow j which provides a very compact and efficient way of calculating the coefficient matrix coeffi coed jrow Y Y Y x j pin grp gn j cddyuij ji cddyt n j TEE i 0i 1 j 20 U dau Lin cos row j pow 5 AYU jrow4j 2AT YU 5 o4 jt
6. 15 190 bfluz aidif 2AT dztk kz dZWk kz Frat 15 189 bake 7 15 191 The solution is arrived at by performing a decomposition and forward substitution using bet Brey Ek 1 Fea bet do k 2 kz Eg Cy 1f bet bet By Ak Ek Ek Fh bet enddo then a back substitution using do k kz 1 1 1 Ee Ek k41 enddo 15 19 5 beta plane Normally the equations in MOM 2 are formulated in spherical coordinates This option turns the model into a beta plane f f B y where 8 07 0 and f is taken at the latitude given by OF owt 15 19 6 f plane Normally the equations in MOM 2 are formulated in spherical coordinates This option turns the model into a f plane as in option beta plane with B 0 Choosing f as the equator sets flat space cartesian grid 15 19 7 source term This option allows adding source terms to the momentum and tracer equations as indicated in Sections 11 11 4 and 11 10 4 15 19 8 readrmsk This option allows importing region masks mskhr 4 and mskvr into MOM 2 for use with certain diagnostics 15 19 9 show details When enabled this option allows details from various parts of the setup calculations to be printed to file stdout When MOM 2 executed the printout indicates where this option will give more information if enabled When enabled it leads to lots of printout and is left disabled unless the missing details are neede
7. po F 0 0 0 2 25 2 2 KINETIC ENERGY BUDGET 9 It is of interest to integrate the previous local budget over some fixed volume to determine a finite domain budget a e pis as ag pw po d Kitt po dE ei te 2 26 where 1 u v w 5 is the boundary of the domain si is the outward normal on the boundary di a d sin d dz a cos d d dz is the volume measure and 25 is the measure on the particular boundary surface An interesting domain is one whose upper boundary Zup is the upper surface of the ocean since that is where energy is input neglecting interior geothermal sources and whose lower boundary is the bottom topography Zpottom H A For this domain define the volume average lt gt V f dz where the domain volume is given by Vea J H A d sin 9 dA 2 27 Volume averaging the kinetic energy equation yields E v fex iis AdS lt pgw gt 4p lt F gt p lt ls te gt PVT 48 diua pV 48 E Broom 2 28 where lt e gt This budget employed the upper and lower boundary conditions on the horizontal currents TP Jwind 2 29 T TP bottom 2 30 with Tying the wind stress Thottom the bottom stress and the currents dotted into each of these stresses are taken as the surface and bott
8. Minimum size Memory Window for Biharmonic option with jmw 4 Memory Window for Biharmonic option with jmw Memory Window with Fully opened Memory Window with jmw jmt Basic Dataflow for Coarse Grained Multitasking Comparing Coarse and Fine Grained Multitasking MOM 1 and MOM 2 Code structures Distributed memory 2nd order memory window Distributed memory 4th order memory window Anatomy of an idealized module Grid Grid cells in A and Z 2 sns Grid cells in and Z 2 2 sns Comparing grid construction methods A sample jrow field Coupling ATMOS and OCEAN models Flowchart for program driver 22A Flowchart for subroutine gasbe 2A Flowchart for subroutine gosbe 2A Flowchart for subroutine mom ees Dataflow for various types of timesteps 22222 Advective Directory structure for 2 One dimensional grid with subcells 7 1 2 5 corresponding to the x axis cells in the x y plane shown in the next figure 2 2 MOM2 x y plane and its partition
9. 183 15 16 5held larichev 184 15 17Eddy interaction 7 185 15 17 lneptune 185 15 18Advection schemes 185 15 18 1 186 15 18 2fourth order tracer advection 186 15 18 3quicker 187 15 18 4166 2 189 15 19Miscellaneous 194 15 19 1 knudsen 194 15 19 2pressure gradient average 194 15 19 3fourth order memory window 195 15 19 4implicitvmix 195 15 19 5beta plane 2l less 197 15 19 6 plane 2 2 e ns 197 15 19 7source term 197 15 19 8readrmsk 197 15 19 9show details ers 197 CONTENTS XV 15 19 1 iming 198 15 19 l quivalence mw sns 198 16 External Mode Options 199 16 1 stream function 4 2l ll ee 199 16 1 1 The equation 199 16 1 2 The coefficient 202 16 1 3 Solving the equation 202
10. Pn by T 16 pP B 149 e AOE us un A ENIM Tj us p B 151 P 5 tasse amp T 5 9 B 152 ve Soe 6 7 1 amp 1 a A Tj 6 B 153 Ww EC 6 7 154 o AE 6 7 j ik 1byp ip Tja p p TRN B 155 P E by Tj piep 19 156 IED m Tasse 157 290 APPENDIX B ISOPYCNAL DIFFUSION A V 34 58 1 58 1 Lyk 6 7 k 1650714 1 byl k 162021 1 B 158 35 _ A 35 V 35 1 j k 1 Lik EM 2 Vp 35 P 6 7 07 1 GT 10203 B 159 36 _ A 36 V 36 1 1 BOEDE 6 7 Ov Ti aga s pj B 160 B 2 7 Slope constraint In these expressions the diffusion coefficient for a particular quarter cell is given by A m This coefficient will be chosen to satisfy the numerical stability constraint on the diffusion equation For the small angle tensor the prescription of Gerdes et al 1991 is the MOM2 default in which for large slopes the diffusion coefficient is quadratically rescaled to a smaller value Their prescription applied to the present formulation says for each quarter cell n if the slope n gt 6 then the corresponding diffusion coefficient A n is rescaled as A n A n 6 5S n This prescription provides a unique definition of the diffusion coefficient and thus provides for a unique definition of the diffusive fluxes
11. Sinn Am 12 412 21 A21 L 13 A13 31 A31 L 23 423 32 A32 A 4 12 412 _ 12 A12 L 13 A13 _ 13 A13 L 25 A73 _ 23 423 A 5 0 A 6 where the symmetry of 7 and the anti symmetry of A were used This property implies for example that A guTO T A 7 A On 0 T A 8 Effective advection velocity Consider the tracer mixing operator constructed from an anti symmetric tensor R T 4 m A OnT A 10 Property A 8 implies R T A4 04 A O T A 11 which allows for the identification of a velocity uj mA A 12 and which brings the anti symmetric mixing process into the form of an advection R T ti4 VT A 13 It is important to note that the advection velocity t4 is divergence free V d4 A 14 04 04 A4 A 15 0 A 16 where the last identity used relation A 9 above Therefore tracer mixing as parameterized with an anti symmetric tensor DT a Q 4 V T R T A A 17 A l BASIC PROPERTIES 267 can be written d d4 V T 0 A 18 which allows for the identification of an effective advective transport velocity Plumb and Mahlman 1987 i cd A 19 Skew or anti symmetric flux Rhines 1986 and Middleton and Loder 1989 discuss the skew flux instead of the effective advection velocity This flux is defined as FR A OT A 20 which allows the skew symmetric mixing process to be written as Qj 4 d V T V
12. 2 is given below by terms 14 15 and 16 nre adv k j adv veu 1 4 nreg termbm44m reg o Ung dru cos d ADV 18 116 jrow termbmi4sa reg ADV Uyi um termbmienneg sages EP MIT ADV aag 818 termbmartnmrey Mey 18 119 WYWnreg dicen a OR O 18 120 smflinnreg SMfijn nreg 18 121 Term 17 represents the average horizontal velocity components within the cell and avgw is the average vertical component smflz represents the windstress acting on the top of the near surface cells and Equation 18 121 is only averaged over the regional volumes at the ocean surface Term balance for Tracer Equation Using operators and arrays described in Section 11 10 7 all components of the tracer equa tion are contracted into regional volumes with the canonical forms given below As with the 18 2 LIST OF DIAGNOSTIC OPTIONS 241 momentum contraction above one way to think of this is that all cells within a regional volume 7 nreg are replaced by one gigantic T cell and the value of all terms in the tracer equation are given for this one cell Subscript n 1 refers to the temperature component and n 2 refers to the salinity 7 nreg tik jn lk jn T terMbtinnreg LEATH Pro on mn 18 122 T termbla nnreg ADV re 18 123 termbts nnreg ADV O 18 124 s reg ADV Tagg rey 18 125 termbtsnmreg DIFF Trg 18 126 termbte nnreg
13. 3 5 1 Fine grained parallelism autotasking 3 5 2 Coarse grained parallelism microtasking 3 5 3 Parallelism on Distributed Systems 2l 3 5 4 Comparing Coarse and Fine Grained Parallelism 4 Database 4 1 Datafiles 5 1 Naming convention for variables 5 2 The main variables 2 2 rs 5 2 4 Relating j and jrow 22s 5 2 2 Cell faces 5 2 3 Model size lt 13 13 14 15 16 16 19 19 19 20 21 24 25 41 41 X CONTENTS 5 2 4 45 5 2 5 46 5 2 6 1 46 5 2 7 Time level indices 46 5 2 8 3 Prognostic variables 2e AT 5 2 9 2 Prognostic variables e 4T 5 2 10 3 D Workspace variables aaa 4T 5 2 41 3 D Masks 2 ee 48 5 2 12 Surface Boundary Condition variables 49 5 2 13 2 D Workspace variables aaa 49 5 3 50 5 3 1 Tracer 50 5 3 2 Momentum Operators 51 5 4 Namelist variables 51 5 4 4 Time and date
14. 273 B Isopycnal diffusion 275 0 1 Functional 275 B 0 2 Neutral directions 276 B 0 3 Full isopycnal diffusion 276 B 1 Functional formalism in the 276 B 1 1 The functional for a general diffusion operator 277 B 1 2 Functional as the source for variance tendency 277 B 1 3 The functional for isopycnal 278 B 1 4 Continuum diffusive fluxes 222 278 2 Discretization of the diffusion 219 2 1 A one dimensional warm up 22e 280 B 2 2 281 CONTENTS xvii B 2 3 Subcell 282 B 2 4 Tracer gradients within the subcells 283 B 2 5 Discretized functional 286 B 2 6 Reference points for computing the density gradients 286 B 2 7 Slope constraint 290 B 2 8 Derivative of the functional 290 B 2 9 Diffusive fluxes 304 General comments 304 B 3 1 Isopycnal diffusion 304 B 3 2 Reference points and grid stencil 305
15. cosh nr 6 diff_fbin 1 B 228 grow grow where the diffusive flux vector in the appendix is related to that of the model through diff f niri B 229 The flux vector has components defined at the center of the east north and bottom of cell k jrowrespectively The diffusive flux vector satisfies the appropriate flux conditions at the B 3 GENERAL COMMENTS 305 domain boundaries At the walls there is no normal flux at the bottom there is the option of specifying a bottom flux for studying say geothermal processes typically assumed zero and at the top surface tracer flux information is fed into the vertical flux component In general these flux conditions are enforced in the model using the mask array tmaski The shifting of the labels on the respective diffusive flux components is necessary in order to bring the difference of the fluxes onto the center of the cell T k jrow For example the difference x diff feik OUT 230 is defined at the center of T k jrow whereas _ is defined at the center of T 1 5 jrow The denominator d t represents the grid distance between the east and west faces of T k jrow The fluxes in the meridional and vertical directions follow similarly which yields diff feix diff fei 1 kj diff fring diff fnik ja Toe cos row dati cos dYtirow fbi B 231 421 B
16. 162 15 10 5 5 168 15 11Filtering 168 15 11 1fourfil 168 15 11 2firfil ee 165 15 11 3 1_ 166 15 1214 27 5 166 15 12 1 5 166 15 12 2linearized_advection 167 15 13Explicit 167 15 13 1fulleonvect 168 15 14Vertical sub grid scale mixing schemes 171 15 14 1 171 15 14 2ppvmix 172 15 14 3kppmix 173 15 14 amp 173 15 15Horizontal sub grid scale mixing schemes lens 174 15 15 1 consthmix 22e Sn 174 15 15 2biharmonic 175 15 15 3smagnimix 2 44 ee 176 15 16Hybrid mixing 178 15 16 1 bryan lewis vertical 178 15 16 2bryan_lewis_horizontal 179 15 16 3isopyemix 179 15 16 4gent mewilliams
17. Pj cddatjn pe TT U Hi pin jrow4 j dx uj jn COS Oo ow j 2AT f a cddru dU cddyl n EP C SFirow i _ Hi gin jrow j cddyuj ji lt cddatju in 17 11 Hiir jrowtj where is the Kronecker Delta function which is 1 when 74 1 i and 0 when 4 i z i The entire coefficient array is calculated by six nested loops on i jrow t j i and 5 with each iteration adding the terms above to the proper coefficient bucket The matrix for right hand side of Equation 16 13 can be written as 1 1 U jrow X X eddyty EULLI COS Qf su pj i 0 7 0 t eddxtg ZUG jrowtj 2 dits ou 1 17 12 The coefficient matrix is symmetric except for the implicit Coriolis term the second bracket in Equation 16 13 The preferred method of solving Equation 16 13 is by conjugate gradi ents as described in Dukowicz Smith and Malone 1993 Refer to Section 17 1 for more detail on the elliptic solvers and to Appendix 16 1 4 for more details on the island equations We have come to call these loops Amtrack Normal Form because the indentation of the DO loops and the long executable statement in the middle resemble the Amtrack logo Properly ordered these nested loops vectorize very well on a Cray YMP 5 to Section 16 1 5 17 5 SF 5 POINT 217 17 5 sf 5 point This form approximates averages of c
18. The only change is whether a time step length is Ar or 2Ar 11 2 TIME AND SPACE DISCRETIZATIONS 109 11 1 2 Forward On forward time steps when the memory window is partially opened as indicated by time step n2 both 1 and variables are loaded with what was 1 disk data on the previous time step In the third column memory pointers are set to reflect this The equation is the same as for the leapfrog time steps except that 2A7 is now replaced by Ar 11 1 3 Euler Backward Euler backward steps are comprised of two half steps The first is identical to a forward step and the second fills variables within the memory window with 1 data from the first step When the memory window is opened all the way an euler shuffleis required to get data properly aligned in preparation for the next time step This is the only data movement required when the memory window is fully opened 11 1 4 Others Another possibility is to do Robert time filtering every time step Schematically this amounts to h h 4 h7 2h 4 11 2 where is an adjustable parameter This is not an efficient operation when the memory win dow is only partially opened because it requires re cycling through all latitudes on disk every time step It s trivial when the memory window is fully opened however this scheme is not implemented as of this writing 11 2 Time and Space discretizations Equations are solved for a group of latit
19. gt dx Uitip Y NE Ts X 1 jq 0 2 2 7 1 39 543 148 i 16e Pipi 1 74 Pij 1 sTicip j 14jg ij 1 JI E opidi 124 T pf pr 1 y t 6 pf A ay 4211 cos d 0 a Y X 1 jq 0 H t ge Litia t 7 I9 9 533 38 2 6 P Pitipj iq 2Pijtiq which is the meridional difference 7 1 79 SEXE a cos of 1 diui i 1 1 jq 0 1 14j d l J Ll ikj 1 qs t _ n 1 TE t 5 au sah k ew where the z derivative in the denominator was averaged in order to bring it to the appropriate meridional face of the T cell Shifting the ip sum and introducing the volume factor Vr yields ASVr Vra t j 1 7 y cos 1 d ui ip 5 1 ip j 1 jq X 4dzxt cos 1 j 0 jq 0 D 5 3 14 38 JWI by Ti jo Pi ip Z vbi j i reni Mea Jom 1lc 2 1 t k j 1 6s pU LN t 1 my t 5 NUN 300 APPENDIX B ISOPYCNAL DIFFUSION Recombination of terms in the z x plane For the x z plane it is important to be explicit about the particular value of the diffusion coefficient to be used in order to ensure that the numerical stability criteria discussed in Griffies et al 1997 is satisfied Explicit reference to the latitude will be omitted except for dyt T
20. dzty 18 79 imi l Volt ML 18 80 2 1 Abs 18 81 2 and the relation between j and jrow is as described in Section 5 2 Surface heat flux is converted to watts m windstress is in dyne cm precip minus evaporation is in mm day velocity is in cm sec temperature is in degC and salinity is in ppt 35 0 The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file zmean sbc dta If option netcdf or show zonal mean of sbc netcdf is enabled data is written in NetCDF format to file zmean_sbc dta nc rather than in unformatted IEEE The interval between output is specified by variable zmbcint and the control is specified by variable iozmbc 18 2 15 snapshots Option snapshots saves instantaneous values of prognostic and associated variables The vari ables are tracers for n 1 nt horizontal velocities for n 1 2 vertical velocity at the base of T cells adv vbt kj surface tracer flux stf for n 1 nt surface momentum flux sm fijn for n 1 2 and the external mode which is given by either 81 OF DSi jrow r This output data may be restricted to certain contiguous latitude and depth ranges using variables input through namelist Refer to Section 5 4 for information on namelist variables Note that on time step itt which corresponds to 1 data is written from time level rather than 1 bec
21. 2 15 147 g 15 18 ADVECTION SCHEMES 189 E adv fbikj adv vbti jj quickka li ei noi wicks 2 2 z w li kl n r 1 T CUTUR 2 CUPUL 3 li k 1 j n r 1 2 2 z w curvy li k 2 j n r 1 T CuTU 2 li kl n r 1 t CUT 3 lik jn r 1 15 148 Note the way wT and wt are used to account for z axis which is positive upwards The coefficients are given by quick 2 dztk41 dztk41 dzti 15 149 quick o 2 dztk dztk41 dzti 15 150 2 4216 dztyai dzty 4 2 421 4216 dztk41 15 151 5 2 421 dztk41 dztk dzty 4 dzt 15 152 2 421 dztyai dzty si 2 dztk 2151 dzty 15 153 2 421 dztk41 dztk 2 dztk 2 15 154 2 421 dztk41 dztk41 dzty43 det dzty41 15 155 2 421 x dztyai dzty 2 dzty dztk41 15 156 15 18 4 fct The main disadvantage of the widely used central differences advection scheme or other higher order schemes is the numerical dispersion that is most noticeable near large gradients in the advected quantity Non physical oscillations or ripples under and overshoots and negative concentrations of positive definite quantities may occur Addition of explicit diffusion in the coordinate direct
22. 2AT is al H jrow X 2Uj row 18 13 1 5 1 1 gt oy a A 6 5 AA row I l A d jT OU AU gal LEES EIS T EULirow 2 18 14 where jrow is given by Equation 16 9 and is given by Equation 16 4 Since the coefficient matrix required for solving Equation 18 11 is generated within MOM 2 for purposes of solving the prognostic surface pressure and implicit free surface methods this coefficient matrix can be easily generated It is done by essentially replacing 1 with H in the method given within Section 17 4 The average forcing X is computed as 1 amp X8 UAM X L U P jrow 1 Hi ijrow 1 COS O irow 1 6S DE aA jrow 1 1 cos Pirow 1 18 15 with the aid of Equations 18 13 and 18 14 where L is the number of timesteps in the averaging period Equation 18 11 is then inverted for Poi jrow by the method of conjugate gradients Equations 18 13 and 18 14 may be solved directly by line integrals to construct jrow However the integration paths must be chosen carefully so as not to propagate errors introduced by a non zero tolerance when solving the stream function equation Choosing nine point numer ics by enabling option sf_9_point minimizes these errors compared to using option sf 5 point The solution p is thus an average and may be written as ascii to the model print out or as 32 bit IEEE
23. After completing the above operations the resulting nine point equivalent of Bryan s external mode equation is obtained The finite difference counterpart of Equation 16 1 for non uniform grids is given as dzu cos 1 A DA d dyu TOW sl A i 1 irow 2AT iL Hi l jrow 1 dYUjrow we 1 dyu 1 dat 1 ae 1 1 7 cos ow 1 dau DU X Y I4 F t dytjrow ses 1 1 Ay 1 jrow 1 l jrow 1 F dat Ge yeu 1 6s Ay l jrow l jrow 1 r o da uj 1 cos ay 1 2Ui 1 jrow 1 1 421 x dYUjrow 1 Enna 16 13 where is given by Equation 16 4 Comparing this to Equation 16 1 V Gr corresponds to the first bracket f V corresponds to the second bracket and k VxXF corresponds to the third bracket which is 214 jrow 6o dazu 4 COS dU oui 1 jrow 1 1 421 6 dytjrow 1 112 16 14 If the time step constraint imposed by convergence of meridians needs to be relaxed ztd jrow is filtered in longitude by one of two techniques Fourier filtering Bryan Manabe Pacanowski 1975 enabled by option fourfil or finite impulse response filtering enabled by option firfil Both should be used with caution and only when necessary at high latitudes firfil is
24. Philander G P N C Lau R C Pacanowski and M J Nath 1989 Two different simulations ofthe Southern Oscillation and El Nino with coupled ocean atmosphere general circulation models Phil Trans R Soc Lond 329 167 178 Tziperman E and K Bryan 1993 Estimating global air sea fluxes from surface properties and from climatological flux data using an oceanic general circulation model Journal of Geophysical Research 98 22629 22644
25. Redler R and Claus W B ning 1996 Effect of the overflows on the circulation of the North Atlantic A regional model study submitted to J Geophys Res Oceans Rhines P B 1986 Lectures on ocean circulation dynamics In Large scale transport processes in oceans and atmospheres edited by J Willebrand and D L T Anderson D Reidel Publishing Rood R B 1987 Numerical advection algorithms and their role in atmospheric transport and chemistry models Rev Geophys 25 71 100 Rosati A and K Miyakoda 1988 A general circulation model for upper ocean simulation Journal of Physical Oceanography 18 1601 1626 Semtner Jr J 1974 n oceanic general circulation model with bottom topography In Numerical Simulation of Weather and Climate Technical Report No 9 UCLA Depart ment of Meteorology Smagorinsky J 1963 General circulation experiments with the primitive equations I The basic experiment Monthly Weather Review 91 99 164 Smith R D J K Dukowicz and R C Malone 1992 Parallel ocean general circulation modeling Physica D 60 38 61 Stevens D P 1991 The open boundary condition in the United Kingdom Fine Resolution Antarctic Model J Phys Oceanogr 21 1494 1499 Stevens D P 1990 On open boundary conditions for three dimensional primitive equation ocean circulation models Geophys Astrophys Fluid Dynamics 51 103 133 Takacs L L and R Balgovind 1983 High latit
26. adv veu 4k AYU jrow adv vnu k Uk dna t Ui kj ln uf 2 Uk jn Uk j ln adv vnu i jo 09 dU 2 Uik jnr F kl adv_vbu kj EJ 5 2 2 UV kn t Ui k ljn r U adv vbu jr eos o 2 UidyUjrow tan QU TOW ik jn Ui k j 3 n 7 COS dzty radius 12 9 where the minus sign in the mertic term is used when n 1 and the plus sign is used when n 2 Using the condition that the normal velocity on land cells is zero allows rearrangement of terms yielding the form imt 1 jmt 1l km 2 1 A 5 5 5 adv_veu adv 4 k j dYUjrow 1 2 jrow 2 k 1 1 k j 1 dru U 1 3 adv_vbu kj C608 5 dt Udy Ujrow jns Ui kein c eau Ui dens 0 kj t Uik jtm c 00 k jti Vk jdn AVVN k j1 Ui kir 7 00 00 koi epis c adv vbu U cos Q 5 o 49 uid yu ou d zt 0 12 10 Notice the similarity between Equations 12 10 and 12 6 The first term in brackets vanishes because mass continuity applies to each cell Summing the second term in brackets results in zero if the normal velocity component is zero on land cells and the previous arguments involving symmetry are applied It should be noted that if k jn in Equation 12 7 is replaced by internal and external modes jn and then Equation 12 1
27. dpsi iterations type dpsi_type guess dpsi Zres s type res type res As forc type operator A type inv op 11002 dimension 0 max iterations dpsi res s As beta alpha dpsi 0 guess res 0 forc A dpsi 0 beta 0 1 s 0 zerovector do k 1 to max iterations Zres k 1 Z x res k 1 beta k res k 1 Zres k 1 s k Zres k 1 beta k beta k 1 s k 1 As k x s k alpha k beta k s k As k dpsi k dpsi k 1 alpha k s k 213 214 CHAPTER 17 ELLIPTIC EQUATION SOLVER OPTIONS res k res k 1 alpha k x As k estimated error err estimate k alpha k s k if estimated error lt epsilon exit end do if k gt max iterations then print x did not converge in k iterations stop congrad end if iterations k dpsi dpsi k end In MOM 2 all land masses are usually treated as islands when using this option with op tion stream_function because it has been found that this treatment speeds convergence Island sums are turned off when solving for surface pressure by setting nisle 0 The test for con vergence has also been changed from that used in MOM 1 and previous versions In MOM 2 the sum of all estimated future corrections to the prognostic variable is calculated assuming geometric decrease of the maximum correction and the iteration is terminated when this sum is within the requested tolerance Tests indicate that
28. jrow cells within the memory window These advective velocities are then suitably averaged to construct advective velocities on the north east and bottom faces of U k jrow cells These are the finite difference counterpart of the advective velocities in Equation 2 10 and are developed as follows Advective velocities are defined in a direction normal to the cell face Refer to Figure 11 3a which indicates a T cell surrounded by four U cells in the horizontal plane Advective velocity on the eastern face of a T cell is a weighted average in the meridional direction of the zonal velocities at the vertices of the face A similar relation holds for the advective velocity on the northern face of a T cell but it involves a zonal average of the meridional velocities In both cases the average is in a direction normal to the flow Ui k jir dyu Ui kj dU ou adv vel kJ y SS Y 1 1 7 y 1 11 26 jrow 1 After each group of internal mode velocities are solved within a time step they are written back to disk The external mode is unknown until all rows have been solved and subroutine tropic solves for the external mode The only way to get the full velocity on disk is to read all rows back into memory after the external mode has been solved This is why the external mode is added at the beginning of each time step for time levels 7 and r l I Contained within file adv vel F 114 CHAPTER 11 DISCRETE EQUATIONS Uikj2 dau Wi 12
29. 19 1 System Requirements A Fortran 90 preferable compiler f90 or a Fortran 77 compiler 77 is required along with a preprocessor such as UNIX cpp or its equivalent Run scripts are written in UNIX C shell so the ability to handle this is also required For executing MOM 2 a high end workstation SGI SUN DEC etc or supercomputer CRAY YMP CRAY C90 CRAY 90 etc is required 19 2 Changes for Fortran 77 users Since the arrival of the CRAY T90 in September 1996 the Unicos operating system at GFDL only supports a Fortran 90 compiler If using a Fortran 77 compiler note the following changes from previous versions of MOM 2 Namelist input data has been made compliant with the Fortran 90 form The script run mom now stores each namelist input record as a separate file instead of concatenating all namelists into one file This is fine for Fortran 77 also but instead of terminating namelist records with an amp end each namelist record is now terminated with a This termi nator must be changed back to amp end if executing under a Fortran 77 environment e Run scripts for executing the model e g run mom described below and for preparing data e g run sbc etc also described below use the f90 command since they are typically executed on the CRAY T90 If using Fortran 77 the appropriate f77 command must be substituted Look at script run mom sgi which is the counterpart to run mom on the SGI
30. EA esses 126 LY Sone en by Ti DUM B 127 I ae by asp 128 ES 6 p by Tua esp wy B 129 09 E wy B 130 A Sane ibep ay B 131 I E amp Ta j u y B 132 1 ELA 8 7 133 LP ae ie pet B 134 LU E eT Spe 35 E 6 T j 16 yp P byT i j a 6s p Dy B 136 Functional in the z x plane The z x plane quadratic form contains contributions from the T point 7 in the following 12 terms j index suppressed A 13 V 13 2 LED ES 6 Ti k 16s p Dy 6 71 ab 21 B 137 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 289 Ly E 18 009 esas py B 138 Li T 6 p D T iab py B 139 LE ivory pl 6T aes p B 140 LA EL 6T erbei o B 141 LS EI pe B 142 E 6 7 ae b op T 6716 0 2B B 143 LU oe 6 7 i Lbs pt sup T Las pU FU B 144 LS eame T ET aaa s pU Py B 145 E Tipp E Py B 146 6 p ep ea 6 T TH EE B 147 D vum pP 5 6T mU CE B 148 Functional in the y z plane The y z plane quadratic form contains contributions from the T point 7 in the following 12 terms i index suppressed LP eae 67 j k 1
31. In the above variables ihalfstep and iref are calculated internally by the time manager also internal variable ieom is used to reference into the end of month time structure Function avg alarm is internal to the time manager as well as array on Switches testts and testperts are updated every time step and are available anywhere in MOM 2 by including file switch h in the routine where the switches are needed 6 2 10 topog F File topog F contains the topography module which is used to design a topography and geometry for the particular resolution specified by module grids The module is exercised in stand alone mode by script run topog which enables option drive topog This is the recommended way of generating topography and geometry When option drive topog is not enabled the geometry and topography are constructed from with the model Before executing module topog the grid must be defined using module grids Refer to Chapter 9 for a description of how to construct geometry and topography 6 2 11 util F File util F contains the utility module It is exercised in stand alone mode by script run util which enables option test_util The module is a collection of various subroutines or utilities used throughout MOM 2 All output from these utilities is passed through argument lists Input to the utilities is also passed through argument lists except for dimensional information which is passed by including file size h within each utility T
32. MOM 1 MOM 2 Coarse Grained Parallelism Fine Grained Parallelism eArrays are two dimensianal eArrays are three dinensiawl d se oe Su eAll processors work f similtanecusly an each logo for eAll processors work similtensously cn separate eSize of Memory Window 1005 controlls the number of gays REP Figure 3 11 Differences in code structure between MOM 1 and MOM 2 3 5 PARALLELIZATION t BLE t 7 1 j3 1 32 32 s Reding Processor 2 and writing Processor 1 memory sausua Reading Processor and writing Processor 2 memory Figure 3 12 Inter processor communication required for a second order memory window 39 40 CHAPTER 3 DATAFLOW Reding Processor 2 and writing Processor 1 waummumi Reading Processor and writing Processor 2 Figure 3 13 Inter processor communication required for a fourth order memory window Chapter 4 Database A database is included with MOM 2 The database is not needed to start using MOM 2 although use of MOM 2 is certainly limited without it Refer to Chapter 19 for details on how to get this data and Section 19 6 for a description of programs which access it This database is far from being complete It should be considered as a starting point and act as a prototype for extensions using other datasets GFDL is not a data center and there is no intention to extend this with other datasets 4 1 Data files The DATABASE co
33. Zp and setting the desired number of processors with an environment variable The essential thing to keep in mind is that for each nested do loop each computed row in the memory window is assigned to a separate processor and all processors work simultaneously About the only consideration is to insure that the total number of latitude rows which are to be solved jmt 2 divided by the number of requested processors num processors is an integral number of rows per processor rows per processor jmt 2 num processors 3 9 Otherwise a static imbalance will occur where processors will stand idle Note that the standard test case with jmt 61 will typically not meet this condition for any reasonable number of Note that the parameter num processors in file size h does not have to be set since it is only used for option coparse_grained_parallelism Only the environment variable NCPUS which sets the number of processors on the CRAY C90 needs to be set for fine grained parallelism 1 computed row is one where prognostic quantities are updated to time level 1 13 Realize that just because a specific number of processors are requested is no guarantee that they will all be used when executing in a multi programming environment Some may be busy with other jobs However for this discussion the assumption will be that the system is dedicated to one single job 3 5 PARALLELIZATION 21 processors However setting
34. bug fixes In the past both of these operations have presented significant difficulties These difficulties have been largely eliminated by the method described in Sections 19 15 and 19 16 Cases in point are the I O manager and time manager modules CHAPTER 1 DESIGN PHILOSOPHY Chapter 2 Ocean Primitive Equations 2 1 Continuous equations MOM 2 is a finite difference version of the primitive equations governing ocean circulation As described by Bryan 1969 the equations consist of the Navier Stokes equations subject to the Boussinesq hydrostatic and rigid lid approximations along with a nonlinear equation of state which couples two active tracers temperature and salinity to the fluid velocity Additionally MOM 2 has an option to relax the rigid lid approximation and solve the free surface equation The Boussinesq approximation is justified on the basis of the relatively small variations in density within the ocean The mean ocean density profile po z typically varies no more than 296 from its depth averaged value 1 035 gm em Gill 1982 The Boussinesq approximation consists of replacing pe z by its vertically averaged value po In order to account for density variations affecting buoyancy the Boussinesq approximation retains the full prognostic density p p A z t when multiplying the constant gravitational acceleration For scaling consistency variations in density must also be neglected in viscous and di
35. deepen shallow sets jrow where there are fewer than kmt_min vertical levels round_shallow sets jrow to either 0 or kmt_min depending on which is closest Search for perimeter violations between land masses Basically there must be at least two T cells separating distinct land masses If not there is ambiguity in defining a stream function Subroutine isleperim does this analysis by finding all land masses and their ocean perimeter cells Violations can be corrected according to one of the following options fill perimeter violations builds a land bridge to connect two land masses by setting kmt jrow at the first T cell discovered to be in the perimeter of both land masses Each land bridge reduces the number of islands by one This is the default action iden perimeter violations removes land cells from one of the land masses until a separation between land masses of at least two T cells is achieved The values of kMti jrow on these newly created ocean cells are set to the average of the values of jrow On adjacent ocean cells It sometimes happens that steep topographic gradients as indicated in Killworth 1987 are another source of problems Because this requires knowledge of time step length and mixing coefficients these problems are not detected in module topog and analysis is left to MOM 2 In many cases the instability that results can be controlled by changing time step length
36. show that the evaluation point of most of the factors in Equation 17 9 is the same going both ways The remaining factors cddyuy j cddzuy and cdd t all change sign when 7 is replaced by 1 i 7 is replaced by 1 J i is replaced by 1 i and 7 is replaced by 1 7 Thus the product of any two of these is unchanged and each diagonal coeffiecient at i jrow is equal to the opposite diagonal coefficient at 1 j If i i there are two possibilities either 7 i 0 i 1 Assume that j j Otherwise i jrow and j are not neighbors but identical The transitions back 206 CHAPTER 16 EXTERNAL MODE OPTIONS to i jrow are in this case i i i 4 i i and jrow j 1 j 1 j so i 4 i i i and as above jrow j j 1 j This time only 7 changes to 1 j and j changes to 1 j As a result the factors eddyuj and cddytj change sign but the factors cddz uj and remain unchanged All other factors remain evaluated at the same points so again symmetry holds in that the northern or southern coefficient in Equation 17 9 centered at i jrow is the same as the opposite coefficient in Equation 17 9 centered at i 7 The case where j j is proved similarly Antisymmetry of the implicit Coriolis terms If one applies the same arguments to the implicit Coriol
37. 0 whenever hj jrow 0 The following two dimensional quantities are diagnosed from other prognostic quantities and are therefore recomputed every time step They are dimensioned by imt jmt ZWi jrow n Vertical average of time derivatives of the momentum equation used as forcing for the external mode equations at i jrow locations on the U grid Units are em sec 214 jrow curl of ZU jrown defined at jrow locations on the T grid Units are 1 sec 50 CHAPTER 5 VARIABLES e jrow residual from the elliptic solver defined at jrow locations on the T grid Units depend on whether streamfunction or rigid lid surface pressure or implicit free surface method is used Refer to these variables for units e jrow time rate of change of stream function rigid lid surface pressure or implicit free surface defined at i jrow locations on the T grid Refer to these variables for units Cfiirow 13 141 coefficient arrays for solving the external mode elliptic equation with 5 point or 9 point numerics Units are l sec cm Normally this is independent of time except when solving the Coriolis part of the external mode implicitly Since this computation is done very fast it is computed every time step even when the Coriolis term is solved explicitly The third and fourth indices are deviations about i and jrow respectively They give access to cell i jrow and all eight surrounding grid cells 5 3 Operators
38. 1 3 4 Data layout on disk All three dimensional prognostic data resides on disk The ordering of the data is the same for each latitude row The zonal component of velocity internal mode only is first followed by the meridional component of velocity internal mode only and then each tracer n 1 nt Therefore there are 2 nt data fields for each latitude row and each data field is written as if it were dimensioned as data imt km 3 5 Parallelization Parallelization is achieved through multitasking which is spreading one job across multiple processors When is it necessary to multitask When the number of processors exceeds the number of jobs in the system processors will stand idle and overall system efficiency will degrade unless multitasking is used In an operational environment a forecast may be required every 20 CHAPTER 3 DATAFLOW 4 hours and if the model takes 8 hours on one processor then it makes sense to multitask Other reasons include when long running experiments take too long to complete or when it is impossible to exhaust a monthly computer time allocation using one processor Multitasking has not been used in any significant way on the Cray C90 with 16 processors at GFDL The reason is that there are about 30 batch jobs in the system at all times and the efficiency averaged over 24 hours is about 9396 It is anticipated that with an upgrade to 30 processors overall system efficiency will drop significantly unless mu
39. 1 This is typical for all other fourth order schemes in MOM 2 such as the fourth order advection of tracers All such schemes require option fourth order memory window which is automatically enabled in file size h when any of the existing fourth order schemes are enabled This is described further in Section 15 19 3 Refer to Figure 3 5 Using results from the formal treatment in the previous section dataflow for fourth order schemes is similar to Figure 3 4 with only one row being computed ncrows jmw 3 1 and one additional latitude row in the north In order to move this memory window northward data must be copied from the three northernmost rows jmw ncrows 3 instead of from two northernmost rows as for second order schemes Figure 3 6 indicates what happens as this memory window is opened further to jmw 5 rows Again dataflow is similar to Figure 3 7 except that two central rows are calculated nerows jmw 3 2 Calculations always proceed up to latitude row jrow jmt 1 even with higher order schemes There are no out of bounds references because meridional indexing is limited to a maximum at latitude jrow jmt and a maximum corresponding memory window row given by j min j jof f jmt jof f To accommodate higher order schemes when a fully open memory window jmw jmt is used meridional fluxes are set to zero at latitude jrow jmt which allows calculations to proceed through latitude row jrow jmt
40. 1 of either the stream function prognostic surface pressure or implicit free surface depending on which option is enabled Stream function is in units of cm sec surface pressure and implicit free surface is in units of gram cm sec The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file psi dta surf press dta or ifree surf dta If option netcdf or show external mode netedf is enabled data is written in NetCDF format to file psi dta nc surf press dta nc or ifree surf dta nc rather than in unformatted IEEE The in terval between output is specified by variable extint and the control is specified by variable ioezt 18 2 14 show zonal mean of sbc Option show zonal mean of sbc saves instantaneous zonal means of all surface boundary con ditions as a function of latitude This is useful to verify that the surface boundary conditions are reasonable at least in the zonal mean sense 236 CHAPTER 18 DIAGNOSTIC OPTIONS 1 imi l U ZMSMirow n TT REPE 18 74 grow 4 2 1 imi l U ZMSM firown Vol 5 SM fijn 18 75 grow 4 2 1 imi l T 2ZM8ljrown Voll tilin A 18 76 grow 4 2 imi l zmst f Ll 5 st fijn 18 77 jrow n Volt v 1 270010 grow 4 2 where the volume elements and total volumes on U cells and T cells are Y row umask ij o dacu cos Co ow dYUjrow dzty 18 78 T row mask jrow dat cos row
41. 14 AT OT x 15 or OT x 16 ore OT x 17 OTi kj 18 aL OT i 19 ar OT i 20 aL OTi kj X X X X APPENDIX B ISOPYCNAL DIFFUSION 0 pii yu k ick T 6T abs pls A 13 V 13 i k 5 LU 8T kdir rT 1 k z tjr CDti i k bop _ 2 dzwp_1 cos dazu 4 A 14 V 14 i k i 6 1 _ by T 6 DL Taten bp dzwp i1 cos A 15 V 15 i k s ET bn p IVp 15 dzwy i cos bf dauj i A 16 V 16 us 0 Ti por p Vp 16 i k p k 17 17 cs dzwy cos V07 i 1 k zPi 1 k 1 cos pr deu A ptt k 2 Pi k cos oF A 18 V 18 20 V 20 Vp 18 Tele i 1l k Sup cos oP dau 4 Vp 20 P i 1 k p cos gr dau T 6T l k 1 _ 1 k 6 Tia E 241 k i Lk i 1 k 1 k 607 6620344 h k 1 amp 6 ali nrp Lk 1 6 cli 1 i 1 k i l k k B 173 B 174 B 175 B 176 B 177 B 178 B 179 B 180 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 21 OT 22 OTi kj 23
42. 18 137 242 CHAPTER 18 DIAGNOSTIC OPTIONS When options isopycmiz and gent mcwilliams are enabled Equations 18 133 18 134 and 18 135 also include the advective or transport velocities from option gent mcwilliams given by adv adv vntiso and adv vbtiso p j respectively Term 15 represents the average tracer within the cell and term stflz represents the surface tracer flux acting on the top of the surface cells Equation 18 137 is only averaged over the regional volumes at the ocean surface 18 2 18 time averages Option time_averages saves the same variables as does option snapshots However the variables are time averaged for stability and are defined on an averaging grid which can be the model grid or a sparse subset of the model grid Often for analysis purposes it is not necessary to have data at every grid point or for the entire domain When this is the case the size of the archive disk space may be significantly reduced The variables are tracers for n 1 nt horizontal velocities tik jn for n 1 2 vertical velocity at the base of T cells adv vbti kj surface tracer flux stf for n 1 nt surface momentum flux sm fijn for n 1 2 and the external mode which is given by either DSliirow r OT DSi jrow r Before using this diagnostic the averaging grid must be constructed by first executing script run timeavgs with option drive timeavgs enabled This runs the averaging grid generator in a stan
43. 18 37 imt 1 X A7 18 38 imt 1 Volt now gt AY 18 39 Voli 18 40 km Volz now gt AK 18 41 18 42 The canonical form of the northward components of tracer transport by various means and deviations is given as m me jrowyn 5 lt Tk jrow gt lt Vie jrow gt dztp 18 43 lin jrow n TING jrow n tN jrow n 18 44 imt 1 tins jrown 2 lt T row gt lt Vijrow 27 deti 18 45 228 CHAPTER 18 DIAGNOSTIC OPTIONS jrow n TING jrow n lina jrowyn tins jrow n 18 46 imt 1 U m m m cos Q Uns jrow n X sm fi 1 j4 t dazu t inr lt gt t M 18 47 4 2 jrow km imt 1 ling jrown 5 0 5 adv fni x AT dz 18 48 k 1 1 2 km imt 1 ttnzjrown diff fring AF dzty 18 49 k 1 1 2 tng jrowyn jrowyn jrow n 18 50 Note the factor of 0 5 which is needed to correct the advective flux of tracer as described in Section 11 10 2 These terms may also be broken down as a function of latitude within mskhri jrow The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file If option netcdf or gyre components netcdf is enabled data is written in NetCDF format to file gyre comp dta nc rather than in unformatted IEEE The interval between output is specified by variable gyreint and the control is specified by variable iogyre 18 2
44. 62 01 5 12 1 dif f cbtir ot dif f cb back 15 41 visc_cht ET t viec back 15 42 5 where grav 980 6cm sec In regions of vertical instability the mixing coefficients are set to their limiting values visc cbt kj visc cbu limit rit lt 0 15 43 diff cbt diff cbt limit rit lt 0 15 44 15 14 VERTICAL SUB GRID SCALE MIXING SCHEMES 173 Typically dif f_cbtlimit is set to 10 cm sec when option implicitumiz is enabled Otherwise it is set to fricemaz The value of visc cbu limit is always set to fricmaz The viscosity coefficients are then averaged onto the bottom of U cells visc_cbu kj 15 45 To account for the effect of high frequency wind mixing near the surface which is absent in climatological monthly mean wind stress the mixing coefficients at the base of level one are taken as the maximum of the predicted mixing coefficients and parameter windmiz diff cbt y21 mamz windmiz dif f cbt k 1 15 46 k 1 maz windmiz visc cbuj j 4 15 47 Choosing coefficients A reasonable range for the background diffusion coefficient diff cbt back is from molecular val ues of 0 00134 to bulk values of about 0 1 cm sec For background viscosity coef ficient visc cbu back a reasonable range is from molecular values of 0 0134 em sec to bulk values of about 1 0 cm sec Based on Pacanowski and Philander 1981 reasonable values for the maximum m
45. A visc ceujk 15 76 although these viscous coefficients are only used for diagnostic purposes The first term in Equations 15 73 and 15 74 is in flux form and the flux across the eastern face of the U cell is given by amp diff feis 4 7 strainis ia 15 77 where n 1 is for the Equation 15 73 and n 2 is for Equation 15 74 The second term in Equation 15 74 is in flux form but the second term in Equation 15 73 is not which yields Equations 2 28 and 2 29 in Rosati Miyakoda 1988 used 2 in the denominator instead of 2 which was also used in MOM 1 Also in Equation 2 28 should be m7 178 CHAPTER 15 GENERAL MODEL OPTIONS the following form for the meridional flux through the northern face of the U cell When n 1 the form is diff fnij 0 15 78 and when n 2 the form is diff fnii irj straini k j 1 1 COS 15 79 Treating the second term in Equation 15 73 as a metric term yields the following form when n l 1 smag metric kj IA 1 1 straini k j 1 3 cos 15 80 5 and when n 2 the form is U sin o 4 smag metric strain 15 81 g 1 6 3 radius cos T Mli kj 1 9 7 1 1 For diffusion of tracers there is no metric term and the fluxes across T cell faces can be computed directly as diff feiy Adding dif f cb
46. K The K component is handled implicitly as indicated in Section 11 10 7 11 10 4 Source terms It is possible to introduce sources into the tracer equation by enabling option source term If this option is enabled the source term is initialized to zero for each component of the tracer equation source kj 0 0 11 55 Adding new sources or sinks to the tracer equations is a matter of calculating them and adding to source as indicated in Sections 11 10 5 and 11 10 6 11 10 5 Sponge boundaries If option spongesis enabled a Newtonian damping term is added to the tracer equation through the source term near northern and southern boundaries where is a Newtonian damping time scale input through a namelist and I a is interpolated in time from data prepared by the scripts in PREP_DATA If option equatorialsponge is enabled then the profile from Equation 15 1 is used for 7 instead of data prepared in PREP_DATA Refer to Section 5 4 for information on namelist variables The time interpolation method is the same as described in Section 10 2 source sourceik 11 56 11 10 6 Shortwave solar penetration If option shortwave is enabled the divergence of shortwave penetration is also added to the source term using 11 57 SOUTCEj SOUTCELL j SbcoCni jrow mi jrow isw where subscript isw points to the shortwave surface boundary condition This only applies f
47. adv ntig 11 27 kg 9 dat This form is not arbitrary and comes from the condition that the work done by horizontal pressure forces must equal the work done by buoyancy The details are given in Section 12 3 Note that with non uniform resolution the denominator is not equal to the sum of the weights if the grid is constructed as dat dru _ 11 28 d Lirow d Lirow dyujsos Wirow T o 11 29 which was done in MOM 1 and earlier implementations However MOM 2 allows grid construction by dru dru det 11 30 d jrow d jrow dytirow 11 31 which guarantees that the denominator always equals the sum of the weighting factors This is presumed to allow more accurate advective velocities when the grid is stretched in the horizontal Refer to Chapter 7 for a further discussion on non uniform grids and advection From the incompressibility condition expressed by Equation 2 5 the advective velocity on the bottom face of each cell is defined as the vertical integral of the divergence of the horizontal advective velocities from the surface down to the level of the particular cell The rigid lid assumption sets the advective velocity at the top face of the first cell to zero If option implicit free surface is enabled the advective velocity at the top face of the first cell is 6 PSijrow Actually since there is no prognostic equation for vertical velocity the vertica
48. e For a 2 4 by 2 4 mid latitude thermocline model the following settings were used disf dtuv 3000 0 sec dits 30000 0 with acceleration of dits with depth using dtxcel 1 0 to dtzcely 5 0 e For a Ay 1 by Ag 1 3 equatorial basin the following settings were used dtsf dtuv dtts 3000 0 sec The following variables set the time steps in seconds e diis time step length for tracers e dtuv time step length for internal mode velocities e disf time step length for external mode velocities 5 4 5 External mode Namelist riglid These variables are for setting limits for the elliptic solvers e mzscan maximum number of iterations e sor successive over relaxation constant for use with option oldrelax and hypergrid e tolrsf admissible error for the stream function in cm sec A reasonable starting point is 105 e tolrsp admissible error for the surface pressure in gram cm sec A reasonable starting point is 1074 e tolrfs admissible error for the implicit free surface in gram cm sec A reasonable starting point is 1074 5 4 6 Mixing Namelist mizing These variables are for setting mixing and related values e am lateral viscosity coefficient in cm sec for option consthmiz Refer to Bryan Manabe Pacanowski 1975 for estimating a value e ah lateral diffusion coefficient in for option consthmiz e ambi absolute value of lateral viscosity coefficient in cm
49. i digo t 7 1 NEST The terms from subcells 4 6 12 are Ag cos iens ost x n a I z Ti j ma 8 50 2 cos Ha ztpdyu 1 lt x 1 UM Tij 64 Tiqij 1 1 1 DP yp ay spi y 24 421 cos QU x pt um D Ti y Tij um 6 pt ya AS TM cos QU x j 1 j 1 2 1 amp 8 205 SY spica Y 1 Introducing a summation allows these four terms to be combined into two terms Ae cos QU eame d x os QT 6 p PI 8 T Hip Y 6 P yPitip j 1 54 itip j 18zPi YF Hp wep Fp Hp 0 Py t cos of x 298 APPENDIX B ISOPYCNAL DIFFUSION 0 DEM 6 oC 0 9 6 T 61516 2 779 y or M E 2 1 5 206 BP Gta Jt Jt Jt jq 1 dta P There are now a total of eight terms It is possible to combine the pairs appearing with the same summation into a total of four terms each with a double summation These four terms are 21 4 cos oP LAN 2 Trj 1 7 421 AF 4 P cun 0 1 6 SyPitipj ia e ELE EF cos oe EMINUS 634 32 i ip j dy j 4 jg cos OF Y jq 1 M 6 yiip ja
50. jrow fields which have been constructed outside the MOM 2 environment However imported jrow fields are subjected to the same consistency tests for violations as are constructed jrow fields It s a good idea to verify checksums when importing km1 jrow fields to make sure that something wasn t inadvertently changed Importing and exporting is also useful with larger topographic datasets such as the 1 12 ETOPOS5 Bringing these gigantic datasets into model runs can adversely affect model turn around time It may be better to export the resulting Amt jrow field then import it into a model execution instead of using ETOPO5 within the model Note that the km1t 4 field only needs to be constructed or imported into the model once at the beginning or time of initial conditions After that it is incorporated as part of the restart file restart dta Regardless of how kmt 4 is generated module topog produces a checksum which can be used to verify that the kMti jrow field produced by script run_topog is the one being used by MOM 2 Their scale is about 10 degrees in latitude and longitude 9 2 MODIFICATIONS TO KMT 91 9 2 Modifications to KMT The base jrow field constructed above may have problems as illustrated in Figure 9 1 These include perimeter overlaps minimum depth violations and potentially troublesome areas such as isolated cells In addition the researcher may wish to modify the kmt jrow field for v
51. 15 12 TX 15 12 164 CHAPTER 15 GENERAL MODEL OPTIONS where Ar is the time step The instability can be removed by filtering Bryan Manabe and Pacanowski 1975 and Takacs Balgovind 1983 the highest wave numbers out of the solution since they are the most unstable ones Filtering is not to be encouraged and is not recommended unless absolutely necessary When necessary it should be restricted to the northernmost and southernmost latitudes in the domain Typically the filtering works on strips of latitude defined by the researcher The latitudes filtered in the southern hemisphere are from rjfrst to rjft for tracers and from rjfrst to rjfu1 for velocity components These latitudes are actually converted to the nearest model latitudes before being used The reason for rjfrst is to skip over the latitudes containing Antartica In the northern hemisphere filtering operates on latitudes from rjft2 to yt 41 for tracers and from rjfu2 to yujmt 3 for velocities Although the intent was for demonstration purposes only latitude ranges for filtering could have been set more conservatively in the MOM 1 test case In the MOM 2 test cases the same latitude ranges are kept for compatibility reasons In practice there is probably no need to filter southern hemisphere latitudes because of Antarctica In the northern hemisphere it might be necessary to filter poleward of 70 or 75 N and the latitude ranges should be set accordingly These latitud
52. 15 181 jetrac min jsmw ncrows jmt 1 jof f 15 182 jsirac where function min limits jetrac to memory window rows corresponding to latitude rows less than jmt Refer to the formal treatment of dataflow in the memory window given in Section 3 3 2 where the starting and ending rows are given The situation is further complicated when this option is used in conjunction with a fourth order option such as option bsharmonic The minimum configuration for the memory window is then jmw 5 This time tracers are again computed for rows 2 and 3 while velocities are computed for row 2 but an extra fifth row is needed for the biharmonic computation for tracers on row 3 Yes it works 15 19 3 fourth order memory window The memory window typically has a minimum size of three latitude rows jmw 3 which is appropriate for second order accurate numerics Some options use fourth order numerics or in some cases averaging operators which require information from two cells away All fourth order schemes require option fourth order memory window which is automatically enabled in file size h when any of the existing fourth order schemes are enabled These schemes require the minimum size of the memory window to be four latitude rows jwm 4 Some combination of schemes require the minimum memory window to be of size jmw 5 However more is required than simply opening up the window to jmw 4 rows In the minimum size fourth order window pro
53. 18 185 1 2 1 L I 5 SM i 18 186 1 Term 17 represents the average horizontal velocity components within the cell and xbtw is the average vertical component uzbisf represents the windstress acting on the top of the near surface cell XBTs for the Tracer Equation Using operators and arrays described in Section 11 10 7 all components of the Tracer Equation are averaged in time for each station m and at each level k The averaging period L corresponds to the number of time steps in the average Subscript n 1 refers to the temperature component and n 2 refers to the salinity 1 Ath aic tik 1 tzbliknm SON ITT oon 18 187 ly jn nth T gt SA 1 L tbt knmih 5 ADV Triky 18 188 1 1 L tbla knmth 5 ADV 18 189 1 1 L tablaknymth rL2 ADV Tz 18 190 1 1 L tabts knmth F2 DIFF 18 191 1 1 L tabte ks th T2 DIFFI yik 18 192 1 1 L 12017 ks th L2 DIFF TA 18 193 1 1 L 12018 knjmth 2 SOUTCEi kj 18 194 1 1 L tabto knjmth 2 caplicit convection 18 195 1 18 196 When options isopycmiz and gent mcwilliams are enabled then Equations 18 188 18 189 and 18 190 also include the flux form of the advection terms from option gent mcwilliams 250 CHAPTER 18 DIAGNOSTIC OPTIONS given by ADV _Txiso kj Tyisoi kj and ADV_Tziso k j respectively In Equation 18 195 the quan
54. 34 39 6 1 ip k Ij y 5 yo 6 zPi k 1 kr j jg cos A 1 4dzt 2 dzwy 1 kr Y AU Fija i k jli 1 kr J jq zTik ldckr j4d jq 0 jq 0 DOMUM 6 poi Ja 2Pik ltkrgjtjq 2 8 7 79 2 08 779 2 2 8 7 7 5 2 Pii ip k j4 tja Supi sk j y E I s jaja where the non negative diagonal component K of the Redi tensor is given by 15 93 Kg m x d dip Y AT 79 0 i k 34 39 2 t k j kd ik j deg t ut my 5 gt ke 0 1 6 k UD s x dZWk 1 kr D i k j k 1 kr j jq 44 y fqn 182 CHAPTER 15 GENERAL MODEL OPTIONS 6 k j 39 y kd 1 i ik 5 1 HIN s pfi my The small angle limit of these results yields wh X dzWk 1 kr Y jq 15 95 29 0 0 diff fntie cos j6 T COS oU 1 i o j 4d zt 2 dzWwy 1 kr Y AG tig i k 1 k 1 kr j jq T k lLkr 4jq X jq 0 split ik dd ja 15 96 zPi k 1 kr j jq Vertical Flux The isopycnal component of the diffusive flux through the bottom face of a T cell dif f POER for the full Redi tensor is broken into two parts the component and the off diagonal kS component di f f_fbiso which contains KP and K pieces The vertical diffusion term for tracers is also broken into two parts for isopycnal mixi
55. B 113 a X B 114 Md _ B 115 A _ B 116 B 2 5 Discretized functional For each of the three planes there are 12 components to the functional which contain contri butions from the grid tracer value T These 12 components correspond to the 12 subcells shown in Figures B 2 and B 3 For example the x y plane functional can be written e ly S SEP cgo o AMV Lir B 117 Gk where the discretized quadratic form is E VT n Velna Lik z A n V 12 Xu B 118 n 1 and A n is the non negative diffusion coefficient for the subcell B 2 6 Reference points for computing the density gradients The proper calculation of the density gradients is an essential element in the isopycnal diffusion discretization There are two physical constraints that motivate a particular choice for the form of the discretization The first involves the generally nontrivial dependence of the density B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 287 on the pressure Since neutral directions need to be approximated for defining the orientation of the diffusive fluxes McDougall 1987 the densities appearing in a particular discretized density gradient must be referenced to the same pressure level In the z coordinate model it is simple to employ the same number of reference levels as there are depth levels This allows for the most accurate approximation to the neutral directions as possib
56. Each disk still contains jmt latitudes but they are now divided into two logical sections As indicated in Section 3 5 3 this approach is easily extendible to distributed memory systems 3 5 PARALLELIZATION 23 In general if there were num processors processors disk space would be divided into num processors logical sections Each processor would have one memory window of size jmw 3 and work on latitude rows within one of the logical sections on all three disks Processor n would be assigned the task of reading latitude rows on disks 1 and between starting row jstask n and ending row jetask n which are given by gmt 2 jstask n maa int n 1 jextra 1 0001 num_processors 1 jextra 3 11 o jmt 2 jetask n min int n float 1 jextra 1 0001 num processors gmt jextra 3 12 where jextra is the number of extra buffer rows normally this is set to zero except when option fourth order window is enabled and the number of calculated rows per task is given by num rept n jetask n jstask n 1 jmw nerows 3 13 where jmw ncrows is the number of buffer rows For the case of two processors the process starts by reading the first three adjacent lati tudes slices from the 7 1 disk into the memory window of processor 1 followed by three corresponding latitude rows from the r disk After the equations ar
57. Fluid Dynamics Program Thesis Princeton University Bryan K 1969 A numerical method for the study of the circulation of the world ocean Journal of Computational Physics 4 347 376 Bryan K and M D Cox 1972 An approximate equation of state for numerical models of the ocean circulation Journal of Physical Oceanography 2 510 514 Bryan K 5 Manabe and Pacanowski 1975 A global ocean atmosphere climate model Part The oceanic circulation Journal of Physical Oceanography 5 30 46 Bryan K 1984 Accelerating the convergence to equilibrium of ocean climate models Journal of Physical Oceanography 14 666 673 Bryan K 1989 The Design of Numerical Models of the Ocean Circulation Oceanic Circula tion Models Combining Data and Dynamics Anderson and J Willebrand eds Kluwer Academic Publishers 465 500 315 316 APPENDIX D REFERENCES Bryan K 1991 Michael Cox 1941 1989 His pioneering contributions to ocean circulation modeling Journal of Physical Oceanography 21 1259 1270 Courant and Hilbert Methods of Mathematical Physics 2 volumes Wiley Interscience Cox M D 1984 A primitive equation 3 dimensional model of the ocean GFDL Ocean Group Technical Report No 1 Cox M D 1987 Isopycnal diffusion in a z coordinate ocean model Ocean modeling T4 1 5 Deardorff J W 1973 The use of subgrid scale transport equations in a three dimensional model of atmo
58. For example option pressure gradient average requires tracers to be solved on more rows than velocities within the memory window although this is easily done 18 CHAPTER 3 DATAFLOW After the copy operation is completed data is read from the next set of latitudes jrows on disk which are given by jst jof f jrow jet joff 3 4 into the memory window starting at row js and ending at row je where js jmw ncrows 1 3 5 je min jmw jmt jof f 3 6 The function min takes the minimum of jmw and jmt jof f to account for a potentially partially full last memory window This prevents index out of bounds After each load of the memory window some intermediate computations Refer to Figure 11 1 for a flowchart of these steps are needed to support solving of the prognostic equations All such intermediate quantities are computed over the entire range of their dimensions within the memory window before solving the prognostic computations Prognostic equations are solved starting at row jscalc and ending at row jecalc in the memory window These rows are given by jscalc 2 3 7 jecale min jsmw 4 ncrows 1 jmt 1 jof f 3 8 where again the function min limits jecalc to memory window rows corresponding to latitude rows less than or equal to jmt 1 Specific example Refer to Figure 3 4 which gives a schematic of the disk and memory configuration for a minimum memory window size of jm
59. OTi kj oL 1 7 OT i oL UO 1 7 OTi kj OT kj ar 1 7 OTi kj or a9 1 7 OT i arn 1 7 OTi kj 1 7 OT i aro X X A V 5 VOP 6 1 7 UP i1 cos c c _ A V 8 IV e 8 _ A 9 V 9 9 6 pi yPigj 1 _ A 6 V 6 TV 6 1 1 ORAL AVC 1 by ps n cos 6 6 1 cos 6 7 1 78 cos dazu 4 2 1 7 1 7 1 cos pai diu A 10 V 1 SpA diu G3 1 20 1 7 1 dyuj 1 12 1 7 1 zPi j 1 dyuj 1 AQLV 1 _ A 2 V 12 6 7 1 78 6 7 116 0 yop runs Tij 6 16 14 yPi41 4 1 2 jJ diui 14 yP i41 byT41 j 16 G1 OT 3 56sp 1 1 i 1 7 by Ti Lj 16 1 1 7 1 2 1 nu 1 n 16 G3 1 yPi j 1 3 1 _ yPi j 1 by Ti 6yTi by Ti j vj 1 1 6 EL i 5 i 1 j 1 i 1 j41 i m age Jj T LN a 1 7 1 vPjj 1 291 164 165 166 B 167 B 168 B 169 B 170 B 171 B 172 292 2 plane Taking the derivative of the 12 contributions to the functional in the z x plane yields 13 art OT x
60. T 2 Aj cos r where AY and AU are resolution of U cells at the bounding surfaces a and 8 is the number of cells given by Equation 7 1 in section 7 1 and the subscript m refers to longitude index i or latitude index j These methods can also be applied to cells in the vertical even though 78 CHAPTER 7 GRIDS T and U cells are not staggered vertically Refer to Figure 7 4 and assume phantom W cells of thickness dzw staggered vertically such that the W grid point within cell W lies at the bottom of cell Tg and the T grid point within cell lies at the top of cell Wg Now replace U by W in the expressions for both methods given above The motivation for method 2 is first to notice that on a non uniform grid advective velocities are a weighted average of velocities but the denominator is not the sum of the weights as indicated in Section 11 5 This form of the advective velocities is implied by energy conservation arguments as given in Section 12 3 Secondly the average of the quantity being advected is not defined coincident with the advecting velocity Redefining the average operator in Equation 7 3 results in second moments not being conserved as indicated in Chapter 12 Method 2 remedies both problems by simply redefining the location of grid points within grid cells All equations remain the same In method 1 U cell size is the average of adjacent T cell sizes This means that
61. Weaver et al 1993 However it is not difficult to set up a complete convection scheme which uses less computer time than the implicit scheme The standard scheme Since the GFDL model works the grid row by row we ll only discuss how one grid row is treated Here s how 1 Compute the densities for all grid cells in the row Two adjacent levels are always refer enced to the same pressure in order to get the static stability of this pair of levels 2 Mix all unstable pairs 3 Since we have now only compared and mixed even pairs i e levels 1 amp 2 levels 3 amp 4 etc repeat steps 1 and 2 for odd pairs i e levels 2 amp 3 levels 4 amp 5 etc 4 Repeat steps 1 3 a predetermined number of times There are a couple of problems here We ve already said that strictly speaking this never leads to complete mixing of an unstable water column 5o the process is repeated several times at each time step to approximate complete mixing But each time all grid cells are checked for instabilities again even those we already found to be stable Each density calculation requires evaluation of a third order polynomial Cox 1972 in T and S This is where the cpu time is eaten up 15 13 EXPLICIT CONVECTION 169 Marotzke s scheme This scheme works as follows 1 Same as step 1 above except that the stability of all pairs of grid cells is checked odd and even pairs so that the density of interior levels is computed twi
62. With regard to T cells subscript n refers to a particular tracer Subscript T in both cases refers to the discrete time level 5 2 9 2 Prognostic variables The two dimensional prognostic quantities are pst jrow r Stream function defined at jrow locations on the T grid in units of cm sec where 10 2 is sverdrup jrow r 18 Written as Pi jrow r in this manual PSijrow r prognostic surface pressure defined at i locations on the T grid in units of gram cm sec This variable is also used as the implicit free surface in terms of pressure and the units are the same 5 2 10 3 D Workspace variables These variables are determined diagnostically in the sense that they are computed from other prognostic quantities and are therefore not indexed by time level The three dimensional diag nostic and workspace variables are listed below e Six variables are needed for advective velocities T cells and U cells Units are cm sec adv_veti k advective velocity on the east face of cell T k advective velocity on the north face of cell k jrow adv vbt advective velocity on the bottom face of cell T k jrow 1 2 3 4 adv veu advective velocity on the east face of cell U jrow 5 k advective velocity on the north face of cell U k jrow 6 advective velocity on the bottom face of cell U k jrow Referrin
63. diffusion tensor Small tensor For the small tensor the diabatic piece is simply which should be done implicitly along with the K piece of the isopycnal diffusion tensor B 3 6 Highlighting the different average operations There are numerous differences between the new scheme and that implemented by Cox 1987 One difference is in the form of the averaging operations In particular for the small slope fluxes taking a uniform grid in the respective directions and neglecting the specification of the reference points allows for the double sums in the new scheme to collapse to familiar averaging operators lor example consider the x z fluxes in the small angle limit The old scheme used the discretization Ta FE Ar be Tih B 233 02 i TRUE 2 2 6 7 k Lv 2 Fip sT ak AI lP 1 B 234 ik 1 6 8 0 iu Dm p 1 whereas the new fluxes with uniform grid neglecting the reference points and assuming stant diffusion coefficients are given by TRAN EN 1 2 Ay k 2 235 1 gt M E 4_ 6 0 jj2 B 236 Ij 1 6 7 1 8 7 P 16 The difference between the fluxes is related to how the averages are applied to the z derivative terms for the x flux and how the averages are applied to the x derivative terms in the z flux Namely the new scheme a
64. discretizing the equations within each cell and solving all cells by finite difference techniques which are discussed in subsequent chapters The horizontal velocity u v can be divided into two parts a depth independent or external mode velocity u v representing the barotropic flow and a depth dependent internal mode velocity representing the baroclinic flow 2 13 v TD 2 14 A rigid lid at the ocean surface implies that the barotropic mode is non divergent which allows the external mode velocity to be expressed in terms of a stream function by el 1 Fa 2 15 1 where H is the depth from the ocean surface to the bottom Lateral boundary conditions are no slip with insulating walls for heat and salt i e no flux on side walls At the ocean surface boundary conditions are supplied for heat salt and momentum At the ocean bottom there is an insulating condition for heat and salt Bottom boundary conditions on horizontal velocity may be given as free slip or a linear bottom drag Since the bottom is a material surface at z H A the bottom boundary condition on vertical velocity See Gill 1982 Chapter 4 is u w osi 00 2 17 If bottom flow exists it is required to be tangent to the bottom slope Another way to generate Equation 2 17 is to integrate Equation 2 5 from the surface to the ocean bottom using Equations 2 13 2 14 2 15 2 16 and the condition that w 0 at the
65. enddo enddo Chapter contributed by Arne Biastoch abiastoch ifm uni kiel de 150 CHAPTER 13 STEVENS OPEN BOUNDARY CONDITIONS Chapter 14 Options for testing modules 14 1 Testing modules Modules and the usage of modules are described in Chapter 6 Within each module is a driver intended to exercise the module in a simple environment This means executing in a stand alond mode as opposed to from within a model execution Associated with each module is a run script which activates the included driver with an option These options are listed below and are not to be enabled from within a model execution because the model becomes the driver 14 1 1 test_convect This option activates a driver for the convection module in file convect F Refer to Sectionsub section convect F for details 14 1 2 drive denscoef When executing the model required density coefficients are automatically computed from within by calling module denscoef However script run_denscoef activates a driver in stand alone mode which gives details about density coefficients Executing run_denscoef uses infor mation from module grids and file size h to construct density coefficients which depend on the vertical discretization of the grid cells Refer to Section 6 2 2 for details on density 14 1 3 drive_grids This option activates a driver for the grids module in file grids F Refer to Sectionsubsec tion grids F for details 14 1 4 test iomngr T
66. for each longitude and latitude coordinate zt and yt 4 on the T grid On the U grid there is a corresponding field of integers jrow derived as the minimum of the four surrounding jrow values km jrow min kmti row kmtidirow kmt jrow F1 kmt F1 jrow4 1 9 1 In continental areas and regions where land rises above the ocean surface kbmt jrow 0 Vertical levels are indexed from the uppermost at k 1 to the bottom of the domain at k km Beneath the ocean surface land cells exist where k gt jrow on the T grid and where k gt Amu jrowon U grid The depth from the ocean surface to the bottom of the ocean is defined at the longitude and latitude of U cells as Hi jrow ZU k kmui jrow 9 2 where zt is the depth of the bottom of the kth vertical level as given by module grids Although module topog may be executed as part of MOM 2 designing kmt jrow by executing MOM 2 is similar to using a sledge hammer to work with tacks The preferred method is to do the construction by executing script run topog from a MOM_UPDATES directory as described for module grids in Section 7 3 Script run_topog will execute module topog in a stand alone mode by enabling option drive topog Once topography and geometry are judged satisfactory module topeg along with the resulting topography and geometry can be used from MOM 2 during model execution 9 1 Constructing the field At each T cell longitude and latit
67. for example aAA 1 2 dzu and so the volume of box 1 is V 1 1 2 dzu a sin py asin 1 dztr B 37 Taking d dyu 2a gives sin oF sin o7 cos O dyu 2a Hence within this local 8 plane approximation the volume of box 1 is given by V 1 1 4 dzu dyu cos oU dzty B 38 Since the variance reduction property desired is not sacrificed by making this approximation the volumes of the 12 subcells in the x y plane will be taken to be 1 V 1 V 7 V 9 74i cos 0 dyu dzty 1 V 2 V 5 V 10 194 cos oF dyu dzty 1 V 3 V 8 V 11 19 1 cos eU dyu 1 dzty 1 V 4 V 6 V 12 d cos oU a dyu 4 dzty B 39 For the z x plane there are no subtleties related to the spherical earth Without approximation the 12 subcells have the volumes V 13 V 19 V 21 cos dyt 4 V 14 V 17 V 22 pde cos dyt dzwy 4 V 15 V 20 V 23 dyt dzw V 16 2 V 18 2 V 24 cos of dyt B 40 For the y z plane without approximation the 12 subcells have the volumes V 25 V 31 V 33 cos 1 dzwi i V 26 V 29 V 34 Idet cos dyu dzwy 4 V 27 V 32 V 35 cos dyu 1020 1 V 28 V 30 V 36 19 cos dyu dzwy B 41 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 283 B 2 4 Tracer gradients within the subcells Within the 36 cells th
68. for writing data for use with option snapshots e limavgint interval in days between writing data for use with option time_averages e limavgper period in days for producing time averaged data for use with option time averages This averaging period may be set shorter than the interval timavgint e xbtint interval in days between writing data for use with option zbts e xbtper period in days for producing time averaged data for use with option 2015 This averaging period may be set shorter than the interval xbtint 5 4 NAMELIST VARIABLES 59 5 4 8 Directing output Namelist io These variables are used for directing diagnostic output to either the model printout file which is in ascii or to 32 bit IEEE data files with suffixes dta These control variables will not direct output to NetCDF formatted files NetCDF format is controlled by options described under each diagnostic in Chapter 18 Control variables are integers and exert control as follows If control variable 0 then output is written to unformatted IEEE file and stdout If control variable gt 0 and Z 6 then output is written to unformatted IEEE file If control variable 6 then output is written to stdout which is file fort 6 The script run mom redirects stdout to file results and copies it to a printout file The namelist variables are expnam character 60 experiment name totavg control variable for writing output from option tracer averages i
69. it is reasonable to damp sea surface salinity back to climatological values on some Newtonian time scale for a surface boundary condition As mentioned in Section 10 3 restoring SST and sea surface salinity to data can be done by enabling option restorst Note that damping time scale and thickness may by set differently for each tracer However instead of restoring SST the next simplest atmosphere in the hierarchy may be thought of as being parameterized with bulk formulae as given by the idealized version in Philander Pacanowski 1986 or the more complete version in Rosati Miyakoda 1988 Although these bulk parameterizations are not included in MOM 2 as of this writing they are easy to implement The largest uncertainties are due to clouds One must be cautious with this type of atmosphere since the global integral of heatflux into the ocean averaged over one seasonal cycle may be non zero which will lead to a drift in the ocean heat content with time 10 3 Surface boundary condition details As mentioned in the previous sections surface boundary conditions are contained within ar ray sbcocni jrow m defined on the mom grid If option coupled is enabled they are also contained within array 0 defined the atmosphere surface boundary condition grid Ajj If option coupled is not enabled then array sbcatmj does not exist The total number of surface boundary conditions numsbc is divided into numosbc for the ocean and num
70. jmt km imt jmt words are needed If op tion time averages disk is enabled disk space is used for the storage area otherwise the storage space is in memory If memory is insufficient or solid state disk space is insufficient option snap shots is the only way to save the data 18 2 19 time step monitor Option time step monitor computes instantaneous values of total kinetic energy per unit vol ume averaged over the entire domain volume in units of gm cm sec It also computes first and second moments of tracer quantities The mean tracer is the first moment and tracer variance is the second moment about the mean in units of tracer squared Additionally the quantity Depending on whether option stream function r gid lid surface pressure or implicit free surface is enabled Neglecting the vertical velocity component on the basis of scale analysis 10Tracer variance is not conserved if explicit convection is active or there is a non zero surface tracer flux It is also not conserved when diffusion is present Refer to Appendix A for further discussion dta 18 2 LIST OF DIAGNOSTIC OPTIONS 243 OT Ot in units of degC sec for nz1 and grams of salt per grams of water sec for n 2 averaged over the domain volume is computed The explicit forms are given by jmi l km imt 1 2 ke E vun So WU kn AU 18 138 jgrow 2k 1 1 2 1 1 jmt l km 1 lt lk jn gt Vo
71. parallelism In this case a third disk is needed 8 Reasons for this ordering are given in Section 3 1 3 3 THE MEMORY WINDOW 17 Formal description Even though this description pertains to an arbitrary sized memory window it amy be helpful to look at Figure 3 4 In all that follows the global index jrow refers to the latitude row on disk and the local index 7 refers to the latitude row within the memory window Let there be jmt latitudes arranged monotonically from south to north with jrow 1 representing the southernmost latitude and jrow jmt the northernmost one Assume an arbitrary memory window of size jmw with lt jmw lt jmt The first usage of the memory window loads latitude rows jrow 1 through jrow jmw into memory window rows j 1 through 7 7mw The number of rows where prognostic quantities are computed within a memory window is given by nerows lt jmw 2 3 1 The starting row for these computations is always 7 2 Typically for second order accurate numerical schemes ncrows jmw 2 although ncrows may be less for higher order schemes or those needing special treatment If latitude rows jrow 1 and jrow jmt are used only as boundary rows then the number of memory windows num windows needed to update prognostic variables is given by num windows int jmt 2 ncrows gmt 3 nerows int jmt 2 nerows 3 2 where the int function represents the integer part of a quantity and the
72. sec for option biharmonic Refer to Section 15 15 2 for estimating a value 56 CHAPTER 5 VARIABLES ahbi absolute value of lateral diffusion coefficient in cm sec for option biharmonic Refer to Section 15 15 2 for estimating a value kappa_m vertical viscosity coefficient in cm sec for option constumiz kappa_h vertical diffusion coefficient in cm sec for option constumiz cdbot bottom drag coefficient aidif implicit vertical diffusion factor The vertical diffusion term is solved implicitly when option implicitumiz or isopycmix is enabled Otherwise aidif is not used When solving implicitly 0 lt aidif lt 1 with aidif 1 giving fully implicit and aidif 0 giving fully explicit treatment Why should semi implicit vertical diffusion be used The recommendation from Haltiner and Williams 1980 is for aidif 0 5 when solving semi implicitly This gives the Crank Nicholson implicit scheme which is always stable This setting is supposed to be the most accurate one However this is not the case when solving a time dependent problem as discussed in Section 15 19 4 In cases where the vertical mixing coefficients severely limit the time step because of fine vertical resolution or large coefficients this constraint on the time step can be relaxed by solving the vertical diffusion term implicitly ncon number of passes on the convective adjustment routine Only meaningful when option fullconvect is not enabled
73. termMmbt n nreg termbts nnreg termbto nnreg DIFF DIFF Ta SOUT CE nreg nreg T nreg explicit convection 769 When options isopycmix and gent_mcwilliams are enabled then Equations 18 123 18 124 and 18 125 also include the flux form of the advection terms from option gent_mcwilliams given by ADV Tziso Tyisoik j and ADV _Tzis0 respectively In Equation 18 130 the quantity explicit convection comes from solving Equation 18 122 before and after explicit convection The equation for the gigantic grid cell in each regional volume 7 nreg Jis given by 9 termbti nnreg 5 termbte s eg 2 18 132 Note that terms 2 3 and 4 are the flux form of advection When summed up they represent the physical advection in the cell However when taken separately they do not represent the true advection 2 because they contain divergent components The canonical form for the true advection in A z is given below by terms 11 12 and 13 7 nreg ado vet adv vet ik termbti ti deb costo ADV Tix 18 133 17 jrow 7 nreg do k adv vnt seg GEO WONT kj 7 gl ADV 18 134 g INE dyt COS a I Grow grow 7 nreg ado vbt adv_unt y termbl3 n nreg MA ADV 18 135 termbtis n nreg Taga reg 18 136 stflitnnreg D
74. the elliptic equation is inverted by one of three methods the preferred method is enabled by option conjugate_gradient a sequential relaxation method is enabled by option oldrelaz and more highly vectorized version of the sequential relaxation method is enabled by option hypergrid The conjugate gradient solver may fail to converge for large values of the implicit Coriolis parameter acor which de symmetrize the equations 16 1 4 Island equations When solving Equations 16 2 and 16 2 by the method of stream function Dirichlet boundary conditions on velocity are used Specifically both components of vertically integrated velocity are set to zero on all land U cells This implies To within roundoff 16 1 STREAM FUNCTION 203 6X bi jrow 0 16 18 s Piou 0 16 19 which further implies that Vi constant on all T cells within land masses and surrounding ocean coastal perimeters At this point it is useful to change to a directional notation letting cell i jrow be referred to as cell The central coefficient coeffi jrow 0 0 for cell from Equation 16 17 is referred to as C7 the coefficient coeff jrow 1 0 at the eastern face of cell is referred ne to as C7 the coefficient coeffi jrow 1 1 at the northeastern corner of cell is referred to as C7 and so forth Using this notation Equation 16 17 may be written for the Cth T cell as C7 be Cf bp C be CP be be Cre wp ae CS C
75. the operator remains symmetric with respect to islands This form exactly eliminates the surface pressure term from the momentum equations when used with option stream function It has a checkerboard null space which in most cases is not a problem because of the Dirichlet boundary conditions Options rigid lid surface pressure and implicit free surface require the use of a nine point coefficient matrix and in these cases option sf_9_point must also be enabled The null space is a problem when option rigid lid surface pressure is chosen and it must be removed Adding the missing divergence from the rigid lid surface pressure to the central term constructs the im plicit free surface which suppresses the null space Details of these methods appear later Constructing the coefficient matrix for Equation 16 13 can be difficult The mathematician among us Goldberg points out that the finite difference operators can be written in terms of matrices as follows 0 0 1 x a rou 5 cddxty ji Qipi jrow i 17 1 j 1i 1 0 0 dytjrow 6 Gigrow M cddyts Qipi jrowtj 17 2 j 1i 1 1 1 dau 5 cddz uj ji Qipi jrowtj 17 3 j 0 i 0 1 1 dyujzow fel Gigi jrowkj 17 4 j 0i 0 where and cddyu j are defined as 2x2 matrices a_1 0 40 0 i i cddzlj j 17 5 G 1 1 a0 1 i i a_1 0 40 0 i i
76. viscous coefficient on the east face of cell U k jrow visc cnuj j viscous coefficient on the north face of cell U k jrow DO e W M visc_cbu k j viscous coefficient on the bottom face of cell U k jrow Additionally other variables may be needed but these are dependent on enabled options and will not be listed here 5 2 11 3 D Masks e To promote vectorization two fields are used to differentiate ocean and land cells l tmask mask for k 1 0 for ocean 0 0 for land 2 umask mask for U k jrow 1 0 for ocean 0 0 for land 5 2 THE MAIN VARIABLES 49 5 2 12 Surface Boundary Condition variables The surface boundary condition quantities are contained in three arrays Note that one is dimensioned by the total number of latitude rows jmt while two are dimensioned by the size of the memory window jmw Sbcocni jrow m surface boundary conditions which are dimensioned as imt jmt numsbc where numsbc is the number of surface boundary conditions Refer to Section 10 3 for usage details smf jn components of the surface momentum flux defined on the U grid for the latitude rows within the memory window n 1 is for zonal momentum flux windstress in the zonal direction and n 2 is for meridional momentum flux windstress in the meridional direction This field is dimensioned by the memory window size as smf imt jmuw 2 Units are in dynes cm stf jn components of the surface trac
77. which can also be written Ay 1 524652 e 1 9 85 1 5 K Tash c 1 5 8 14 52 6 5 1 9 5 A 51 SIL Gees o e Note that Redi uses the symbol 6 instead of 5 in her expression The ratio of the diapycnal to isopycnal diffusivities defines the typically small number Ap A amp 1077 An equivalent form is suggested by writing the tensor in the orthonormal isopycnal frame as 1 K Ar 0 0 0 0 1 1 0 A 52 1 which separates the effects of the anisotropy between the along and across isopycnal directions This expression can be written in the compact form KU 63 m 83 n Aple lE A 53 as noted in equation A 46 Transforming to the z level frame yields 100 P Pepy PoP omn 1 v TEY Pare 0 0 1 rity iz V Paps yp which can also be written K Kmn Arle 1 At 6mn m n ADP Pn A 55 IV pl where pm Omnp Vp the components of the diapycnal unit vector written in the z level frame see equation A 43 Note that equation A 55 could have been written down immediately once equation A 53 was hypothesized and the unit vectors 4 41 A 42 and 4 43 were determined Small angle approximation There have been no small angle approximations i e lt lt 1 made in computing the represen tation K Therefore for model
78. x D J 1 oy 6 2 B201 J 1 J J J2 6 07 6 pf it Introducing a summation allows these four terms to be combined into two terms A cos oY dztydyu x 4 E OS cos oT i ip j 2 ip 1 ip 7 bx Tij y Titip J VP iip iip iip i ip qn BEI OP Ae cos 6 x 2 7 29 2 2 2 7479 gt 8 p 6170 Oulu sure api ___ 4 202 Pijtiq jazo ept P The terms from subcells 3 8 11 are A cos x bep a OTe 6 TH i 1 j Y t j 1 1 1 yPi j 1 t p t ypt y cos 4 1 Ldztydyu 1 2 d x s minc 156 Ti 1 4 1 Ti iby pt 2d Gp bye e Sep YP Shaw cos 8i x Caen i 2 yp Ur Ti ij ecu 6595 2 8 pf 59 2 6 9592 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 297 Ae Feu deti COS dLa x 2 1 2 1 2 1 Svp 76 Ta epe B 203 jal jal jal spi Gupta Y E Introducing a summation allows these four terms to be combined into two terms A cos cos Sot x itip cp Y 6 ip 7 AU Titip j 1 4 Tia ue pe UP i ip j 1 i ip tO p ii bye es ep ane Ghose COS 8i x 2 7 39 5 Ti 1 j i y Tij 16 LIU Y zP i 1ljtijq OT 2 2 779 77434 9 B 204 9 1
79. 0 15 24 vfu 0 15 25 where f 20 sind u is zonal velocity and is meridional velocity When discretizing and solving the Coriolis term explicitly the solution is given by ud ut t 2Ar 15 26 vith ai 22Ar ful 15 27 When treating the Coriolis term semi implicitly an implicit Coriolis factor 0 5 acor 1 is used and the system becomes u 2Ar acor fot uw 2A7 1 acor fv 15 28 ot 4 2Ar acor fut v7 2Ar 1 fu 15 29 The solution after a little algebra is given by fv 2AT f THL lat p2Ar 15 u ERAT 1 2247 f 15 30 T 1 T 1 2 acor f fv THI Ju AT acor f fot 15 31 T 1 2247 f 15 31 Note that option damp_inertial_oscillation will also damp external Rossby waves although the fastest ones are of largest spatial scales well resolved by the grid and do not limit the time step Refer to Section 5 4 4 for information on choosing time steps 15 12 Linearizations 15 12 1 linearized density Instead of the third order polynomial approximation to the equation for density a linear form given by P k j 7a lik jr 15 32 is used where is arbitrarily set to 2 0x1074 Note that there is no dependence on depth and the usual form p po 1 t is not used The reason is for numerical accuracy Adding the 15 13 EXPLICIT CONVECTION 167 constant
80. 1 and zero for all other levels In principle initial conditions could also come from a particular MOM 2 restart file although this is not the intent of the following options One and only one of these options must be enabled 158 CHAPTER 15 GENERAL MODEL OPTIONS 15 8 1 equatorial thermocline An idealized equatorial thermocline from Philander and Pacanowski 1980 is approximated by a function dependent on depth but not latitude or longitude Salinity is held constant at 35 ppt and the temperature profile is given by zt zik tk To 1 tanh Z DTO E 15 1 where H 80x10 cm Zo 30 102 T 7 5 C and T 10 0 C The intent is to initial ize idealized equatorial models It is also useful to use option sponges which damps the solution back to Equation 15 1 along the northern and southern boundaries to kill off Kelvin waves Simple idealized windstress can also be set using options equatorial taur and equatorial Refer to these options for more details 15 8 2 idealized_ic This constructs an idealized temperature and salinity distribution based on zonal averages of annual means from the Levitus 1982 data The distribution is only a function of latitude and depth and is contained totally within MOM 2 so no external datasets are needed This option makes MOM 2 easily portable to various computer platforms Recommendation As a matter of strategy it is recommended that any new model be fir
81. 10 e EXP contains one sub directory for each experimental design but only EXP TEST CASE is indicated If there were others they would have the same structure EXP also contains printout files from the four test cases described later They were produced on the CRAY T90 at GFDL and are named printout 0 gfld printout 1 gfld printout 2 gfld and print out 3 gfld These files can be used for comparison with results generated elsewhere and are described further in Section 19 8 Under the EXP TEST CASE are two sub directories 1 MOM UPDATES contains only code and run scripts from the MOM 2 directory which need to be altered to define an experiment e g the test case Actually no fortran code is included here because the basic 2 files are already configured for the test case Typically though the following would be a minimum set of useful ones module grids and run_grids which are used to design the grid size h which is used to implement the grid size and module topog and run topog which are used to design the topography and geometry Also any other subroutine requiring changes must be placed in this directory because Cray script run mom looks to this MOM UPDATES directory for all updated code 2 PREP UPDATES contains only code and CRAY T90 run scripts from the PREP_DATA directory which would have be altered to define the test case Actually none are 256 CHAPTER 19 GETTING STARTED here since the ones in PREP DATA are alread
82. 11 81 o which assumes that density at the ocean surface is the same as at depth 21 12 Pressure gradient terms at successive levels 2 through Emu jrow are built by partial sums d 0 ae aa gradp 431 Y grav dzWm gram CEM mal g Pim Pimi 11 82 2 cos 2 dzWm mac Pim A4 grad pi ia Y 11 83 2 When option pressure gradient average is enabled p in Equations 11 79 through 11 83 is replaced by the time averaged value given by Equation 15 180 and discussed further in Section 15 19 2 Note that since the integration is to levels of constant depth hydrostatic pressure gradients at depth are zero when p is a function of z only Note also that the pressure gradients are different for grid construction methods 1 and 2 as discussed in Chapter 7 2 3 11 11 2 Momentum components After constructing both components of the hydrostatic pressure gradients the remaining terms on the right hand side of the momentum equations are computed first for the zonal component of momentum given by Equation 2 1 and then for the meridional component of momentum given by Equation 2 2 This is accomplished by a do n 1 2 loop extending to Section 11 11 9 All workspace arrays used in the momentum operators are re computed for each component of momentum Therefore all momentum operators can only be used from within this n loop which implies all diagnostics using these operators are issued from withi
83. 22 J dz L B 5 where the last expression introduces the negative semi definite quadratic form L On TK OT PVT B 6 Note that L lt 0 is another way of stating that the diffusive flux F is directed down the tracer gradient VT This result does not imply that each component of the diffusive flux F O4T Kk is directed down the corresponding tracer gradient Namely for any particular direction say the x direction F T gt 0 which means the flux is directed up the x gradient of the tracer This particular upgradient transfer is compensated by stronger downgradient transfers in the orthogonal directions which provides for the scalar product representing the full projection of the flux vector onto the gradient of the tracer to be negative semi definite It is illustrative to verify the correspondence between the functional S and the diffusion operator R T The first variation of S under the effects of an infinitesimal variation of the tracer T T where T 0 on the boundaries is given by Courant and Hilbert _ 61 61 SS fa gp nlg 1 B 7 implying that the functional derivative is given by 5 L L T T B 8 Using the explicit form for the quadratic form L 10 renders 6S oT R T B 9 B 1 2 Functional as the source for variance tendency In addition to providing a direct connection to the diffusion o
84. 330 pages in length and can be printed with the UNIX manual2 2 ps command However this is not recommended because it can tie up a printer for a long time The recommended way of printing is to use a postscript previewer such as ghostview to mark off about 50 pages at time and print it in sections If this cannot be done then the manual should be printed in off hours to minimize the impact Graphics and Figures are in color but black and white copies should be fine If a color version of a figure is desired mark it using a postscript previewer such as ghostview and save to a file The file can then be sent to a color printer Special acknowledgments To a large part MOM 2 owes its existence to both Kirk Bryan and Jerry Mahlman the director of GFDL for creating an environment in which this work could take place Their generosity is gratefully appreciated Also appreciated is the time and efforts of countless of researchers who have tested beta versions pointed out problems and continue to suggest improvements along with offering their parameterizations Disclaimer As with any research tool of this magnitude and complexity bugs are inevitable and some have undoubtedly survived the testing phase Researchers are encouraged to bring The design and maintenance of the MOM web page are due to the ongoing efforts of Keith Dixon kd gfdl gov 0 1 INTRODUCTION vii them to our attention Anyone may use MOM 2 freely but the authors assume
85. 52 5 1 A 61 0 5 1 5 where Ay is the ratio of the vertical to horizontal diffusion coefficient Therefore diffusive mixing with I in the z level frame introduces first order in slope errors in the off diagonal terms whereas the diagonal terms contain second order in slope errors The error in the 3 3 component however is the most relevant as it represents an added source of Note the rotation need not transform the symmetry present in the x y z form of the small angle mixing tensor into gt symmetry in the 65 6 form The x y coordinate symmetry however is preserved A 4 SYMMETRIC AND ANTLI SYMMETRIC TENSORS 213 diapycnal mixing i e a false diapycnal mixing For example with the usual diffusivity ratio zz 1077 modest slopes 5 zz 3x 107 are sufficient to add diapycnal mixing through the 5 term which is on the same order as It is for this reason that horizontal mixing especially in regions of the ocean with larger than modest slopes but still within the small slope approximation is incompatible with the hypothesis that mixing is predominantly along the isopycnal directions As seen above the distinction between horizontal and along isopycnal mixing is quite impor tant However the distinction between vertical mixing and diapycnal mixing is not generally important except for extremely large slopes The reason for this ambiguity can be easily u
86. 8 Z y 1 2 will not conserve second moments because neither the third nor fourth term will vanish MOM 2 uses Equation 12 4 to construct averaged quantities and therefore conserves first and second moments Since q in the above equations stands for any prognostic quantity non linear terms are conserved for each component of momentum However in sperical coordinates both components must be considered to eliminate the work done by the non linear metric term For example let dn uii and construct the volume integral of the work done by the non linear terms using operators defined in Section 11 11 5 imt 1 jmt 1l km 2 5 5 Ui kn ADV Ui ADV ADV Uzix t 2 jrow 2 k 1 n 1 ADV metrici k jn cos QU dau dytjrow dzty 12 7 jrow Expanding the advection operators yield the work done in terms of fluxes on all faces of the U cells imt 1 jmt l km 2 4 4 a adv_fej adv_fnrj pj adv fni j i 5 5 Ui k 3 m AU VL 7 a AU d U 5 kai nai 2cos ow dari 2608 Pip oy dYUjrow U adv fbig i adv fbikj u TT Ode Ck C Us k3 3 n 2421 radius VEDY Cft TT dYUjrow dzty 12 8 Expanding the advective fluxes further leads to imi 1l jmi l km 2 gt gt adv veui p Ae een t 2 jrow 2k 1n 1 12 2 WORK DONE BY CORIOLIS TERMS 137 Ui jnr t tihein
87. An alternative used by Danabasoglu and McWilliams 1995 suggests a hyperobolic tangent rescaling This second rescaling is implemented in MOM as an option For the full tensor the rescaling is Aln 6 A n S n S n for S n lt 5 n lt SC For the special case of a grid in which 6 gt 1 2 the full tensor requires no rescaling of the diffusion coefficients in order to maintain numerical stability Slope constraints are discussed more completely in Griffies et al 1997 Note that the original slope clipping scheme of Xoc 1987 is not supported anymore due to its potential to introduce unphysically large diabatic fluxes and to artificially cap of convection see Griffies et al 1997 for further discussion B 2 8 Derivative of the functional x y plane Taking the derivative of the 12 contributions to the functional in the x y plane yields Av 5 5 _ LA bT 456 3 _ 6 T bx 53 OTi kj IVp 1 Lj vyPi j yt j pi cosl dzu 161 E dau i dyuj 210 AQ woos 3 _ 2 2 3 eee 6T by Ti jep J 3 T dzu B 162 cos 1 dau dyu oL A V 5 5 TST S _ u Qa OTi 3 8T aho COS pr dau diu no 6 o0 E _ Pints B 163 ny AAV y rT j 63 T 46 53 OT x V p 4 2 yPij 1 yt1j 1 Pi B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 1 7
88. Cyber 205 experience involved two Cyber 205 s and a Cyber 170 front end delivered to GFDL in stages between 1982 and 1983 It was the resulting Cyberized version of the model that was distributed as the Cox 1984 ocean model code Over the lifetime of the Cyber system Cox installed other features such as variable horizontal resolution multiple tracers and isopycnal mixing until his untimely death in 1989 In anticipation of a Cray YMP with 8 processors 32 Mwords of central memory eventually upgraded to 64 Mwords and 256 M words of Solid State Disk at GFDL in 1990 the model was rewritten again This time by Pacanowski Dixon and Rosati 1991 using ideas of modular programming to allow for more options and increased model flexibility This development work which became known as MOM 1 Modular Ocean Model could not have happened without reliance on workstations and the acceptance of UNIX With the realization of the importance of workstations for productivity within GFDL SUN workstations were replaced by suite of SGI 4D 25 INDIGO and INDIGO s totaling 115 within the early 1990 s With the aid of these faster workstations further design work was carried out primarily by Pacanowski and Rosati but with numerous contributions from others both inside and outside of GFDL This led to the incarnation known as MOM 2 Version 1 1995 Early in 1996 a Cray C90 was installed at GFDL with 16 processors 256 Mwords of central memory 1 Gword of
89. Figure 3 3b Note that the first row in the mem ory window is j and the last row is j jmw but computations typically go from j jsmw 2 through j jemw jmw 1 Prognostic quantities temperature salinity horizontal velocity com ponents within the memory window are dimensioned in the meridional direction by jmw although not all quantities are dimensioned this way For instance if a quantity q involves meridional averages or differences of temperature and it were dimensioned as q imt km jmw then q i k jmw would referencer temperature at index 7 1 which is out of bounds be cause the meridional dimension of temperature is jm Such quantities are dimensioned as q imt km 1 emw and can only be computed within the range 1 When computing these quantities the idea is to do so over their full dimension taking into account that it may be less than 7mw In many of the following figures the memory window will be represented in its simplist form given schematically in Figure 3 3d 3 3 2 How it works A formal description of dataflow through a memory window of arbitrary size will now be given followed by a specific example of a minimum memory window size of 7mw 3 The case of a memory window opened to jm 5 is given as an example of fine grained multitasking in Section 3 5 To simplify figures a memory window schematic of the form shown in Figure 3 3d is used This is not case when multitasking with option coarse grained
90. Laboratory Princeton USA Semtner Jr J 1974 n oceanic general circulation model with bottom topography In Numerical Simulation of Weather and Climate Technical Report No 9 UCLA Depart ment of Meteorology Semtner Jr A J 1986a Finite difference formulation of a World Ocean model In Advanced Physical Oceanographic Numerical Modeling J J O Brien Ed D Reidel Publishing Company 187 202 Semtner Jr A J 1986a History and methodology of modeling the circulation of the World Ocean In Advanced Physical Oceanographic Numerical Modeling J J O Brien Ed D Reidel Publishing Company 23 32 Smith R D J K Dukowicz and R C Malone 1992 Parallel ocean general circulation modeling Physica D 60 38 61 Send U and J Marshall 1995 Integral effects of deep convection Journal of Physical Oceanography 25 855 812 Treguier A M J K Dukowicz and K Bryan Properties of nonuniform grids used in ocean general circulation models Submitted to Journal of Geophysical Research 1995 Webb D J 1995 The Vertical Advection of Momentum in Bryan Cox Semtner OCean General Circulation Models Journal of Physical Oceanography 25 3186 3195 Zalesak 5 T 1979 Fully multidimensional flux corrected transport algorithms for fluid Journal of Computational Physics 31 335 362 321 D 0 9 General modeling issues Bryan K and M D Cox 1972 An approximate equation of state for numerical mo
91. OT x 24 A OT x y z plane Taking the derivative of the 12 contributions to the functional in the y z plane yields 25 OTi kj 26 ae OTi kj 27 ae OTi kj 28 OTi kj X X AQUVOQI IVp 21 P A 22 V 22 V p 22 i k 1 rpi Lk 7 dzwy 4 2 6 1 1 dzwy 4 AQ3 VQ2 X vp i 1 n dzwy San i k 1 ePi k l dzwy V 24 A QUVQ4 6 7 6 3 IV 6 7 46 QST 4 k4 1 sPi 1 kti i k 1 i k 1 6 oli pe 102p 6 ali 1 1620 6 7 k 162p Lk 17 T l k 102p 2 6 1 1 6 1 2 6 1 1 6 1 8 1 1 AQS V 25 4 IVp 25 6 Tjk i p poe nk _ 6 00 dzWy dyuj i A 26 V 26 each Tab SD _ dzWwy i dyu A 27 V 27 4 WEDE 67 6 987 amp Tj ies p j k ui _ dzwy diu A 28 V 28 Gu NS 6 T k j k dzWwy diu 4 i k 1 1 1 20 k41 6T p k 293 B 181 B 182 B 183 B 184 B 185 B 186 B 187 B 188 B 189 294 29 aL OT 30 1 OT 31 1 OT 32 OT 33 aL OT 34 are OT 35 aL OT 36 aL OT X A 29 V 29 dyu Ve j 1 k 2PG41 k 1 A 30 V 30 dyu Wee Lk LE
92. The T indicates a minus sign for n 1 and a plus sign for n 2 In terms of the above operators the finite difference counterpart to Equation 2 10 plus the advection metric term in Equations 2 1 and 2 2 is given as LY uia inu ADV ADV ADV Uzix ADV metrici 11 107 Coriolis treatment he 43082 0 sec is arrived at assuming approximately 86400 x 1 zz 86164 seconds in one sidereal day 366 The 366 is used to account for a 1 day co rotation 11 11 CLINIC COMPUTES INTERNAL MODE VELOCITIES 127 The Coriolis term may be handled explicitly or semi implicitly Refer to Section 15 11 3 for a discussion of the semi implicit treatment of the Coriolis term and when it is warranted When solving explicitly the Coriolis term is given by CORIOLIS k jn 29 sin Uik ian 11 108 When solving implicitly option damp inertial oscillation is enabled and the semi implicit Cori olis factor acor is used In the semi implicit treatment of the Coriolis term the explicit part is given by CORIOLIS 1 20 sin OF ow tU E i3 n l 11 109 and the handling of the implicit part is detailed below in Section 11 11 10 For both explicit and semi implicit treatment the indicates a plus sign for n 1 and a minus sign for n 2 11 11 6 Solving for the time derivative of velocity The vertical diffusion term in the momentum equations may be solved explicitl
93. The tik 1 7 1 and 3 2 7 1 derived from the solution of Equation 16 13 are exact solutions of the finite difference vertically averaged momentum Equations 16 2 and 16 3 When option sf_d_point is enabled the nine point coefficient matrix is approximated by a five point coefficient matrix involving five non zero coefficients coeff for 0 or j 0 as in Bryan 1969 It is arrived at by averaging terms used to construct the nine point coefficient matrix in a different way resulting in a coefficient matrix that differs from the one used by Bryan 1969 The five point coefficient matrix is not as accurate as the nine point matrix although the nine point matrix has a checkerboard null mode Refer to Appendix C for a discussion on null modes However in the stream function this null mode is largely suppressed because Vi jrow is constant along boundaries The five point matrix does not have this checkerboard null mode However both five and nine point operators have a constant null mode Arbitrarily one land mass is chosen and all stream function values are referenced to this land mass value to eliminate the constant null mode Either the five point or nine point operator must be chosen by enabling options sf 5 point or sf 9 point 16 1 3 Solving the equation After choosing whether five point numerics enabled by option sf 5 point or nine point numerics enabled by option sf_9_point is to be used with Equation 16 13
94. This option is automatically enabled in file size h if no other advective schemes are enabled Do not directly enable it with a preprocessor directive The advective flux on the eastern northern and bottom sides of cell T k jrowis given by adv fein lik ins litik jnr 2 15 111 adv fnikj ik inis Ut 2 15 112 tikt jnr 2 15 113 Note that twice the advective flux is actually computed in the model by eliminating the division by 2 for reasons of speed optimization 15 18 2 fourth_order_tracer_advection Option fourth_order_tracer_advection replaces the second order advective scheme with a fourth order scheme and requires option fourth order memory window to be enabled This is auto matically done when option fourth order tracer advection is enabled Consider any quantity qi fori 1 to N points Expanding 1 G 1 G 2 and 2 in a Taylor series about q yields Og 18 1O q 1 i di te 15 114 du ttg tapi t ePi 0 lO q 10 q 1 OG i 15 115 d t OFT DP 60 64 ON l Pqi 80 q 16 O q i dqit2 t2 toot 15 116 2 qt oi 60 i 64 Ogi OG 80 160 q 2 t 22 aa 15 117 di 2 7 021 6 64 The above expansions can be combined to yield qi l07q t di Git di 5
95. UNIX cat command Rather the NetCDF necat utility is needed 18 2 11 save convection When convection is being computed explicitly option implicitumiz is not enabled the in stantaneous value of the component of the time rate of change of temperature due to explicit convection can be saved three dimensionally If cell T k jrowis a land cell its value is set to a flag value 1077 to denote land If no convection has taken place in cell k irow the convection for that cell is zero Otherwise after convection petore convection i k j 1 7 1 1 1 convect ee o SAT 17 18 67 output from this diagnostic is written only as 32 bit IEEE unformatted data to file cvct dta If option netcdf or save_convection_netcdf is enabled data is written in NetCDF format to file cvct dta nc rather than in unformatted IEEE The interval between output is specified by variable exconvint and there is no control variable since only the unformatted data is written 18 2 12 save mixing Much of the physics in MOM 2 is distilled into mixing coefficients Mixing coefficients can be computed in a variety of ways depending on the combinations of horizontal and vertical 18 2 LIST OF DIAGNOSTIC OPTIONS 235 subgrid scale mixing parameterization options which have been enabled In some cases the mixing coefficients are not explicitly computed However the flux across faces of cells is always computed Option save miring
96. a memory This is reminiscent of the Cox implementation which however lacked generality due to the absence of dimensioning with a j index 3 4 DATA LAYOUT ON DISK 19 window simulator can be executed using script run mwsim Although this simulator is set up to show what happens in coarse grained parallelism removing this option in the run script and changing the size of jmw jmt in file mwsim F will be instructive 3 3 3 Dataflow in higher order schemes In Section 3 3 2 dataflow between memory and disk was described for a memory window of minimum size ynw 3 In higher order schemes the minimum size increases For instance option biharmonic is a fourth order horizontal mixing scheme Fourth order schemes require two additional rows so the minimum size of the memory window is jmw 5 Using five rows the essential point is to calculate second order fluxes defined on the three central rows Meridionally differencing these second order fluxes yields one fourth order mixing term defined at the central computed row However since calculations proceed from south to north and the southern most latitude is land the second order flux is assumed to be zero at jrow If these northward fluxes are saved and moved as the memory window moves northward there is no need to have a memory window with jmw 5 rows The minimum size of the memory window is reduced to jmw 4 and the number of calculated rows within the memory window is nerows jmw 3
97. and implicitumiz is not enabled nmix number of time steps between mixing time steps A mixing time step is either a Forward or Euler Backward time step as opposed to the normal leapfrog time step eb Boolean for using Euler backward mixing scheme used on mixing time steps acor implicit Coriolis factor for treating the Coriolis term semi implicitly For semi implicit treatment 0 5 lt lt 1 and option damp inertial oscillation must be enabled Refer to Section 15 11 3 for a discussion of when this is appropriate dampts Newtonian damping time scale in days used with option restorst Note that damping time scale may by set differently for each tracer dampdz Thickness in cm used to convert Newtonian damping to a flux when enabling option restorst Note that damping thickness may by set differently for each tracer annlev Boolean for replacing seasonal sponge data by annual means when enabling option sponges 5 4 7 Diagnostic intervals Namelist diagn These variables are used for setting diagnostic intervals and related items The interval is a real number and has a Boolean variable switch associated with it which is set by the time manager every time step The Boolean variable is set to true when the model integration time mod the interval is less than or equal to half a timestep Otherwise it is set false To add a switch three variables must be added to the common block in switch h an interval real
98. chosen as the position of the most unstable cell If the local time step exceeds the model time step by an amount which can be set through namelist then a CFL violation is detected The number of times a CFL violation is allowed may also be set through namelist Variables within the local neighborhood of the offending cells are shown and when the number of offenses exceeds the allowable number the model is brought down Refer to Section 5 4 for choosing time step lengths and setting a region over which stability calculations are performed The default region is the entire domain 2 The local Reynolds number is estimated along each of the principle directions as x kj y kj 2 kj Uik jdr AU VISC_CEU k j Uik j 2T AYU jrow viSC ChU j adv y dzwy visc cbu y and the location of the maximum is found and printed 3 The local Peclet number is estimated along each of the principle directions as pecli y zZ Wik j Ayr dE dif f ceti Uik j 2T dYUjrow kj 061 20 di f f ent x and the location of the maximum is found and printed 18 85 18 86 18 87 18 88 18 89 18 90 238 CHAPTER 18 DIAGNOSTIC OPTIONS 4 The locations where numerics are breaking down and producing spurious tracer extrema are determined This is done by searching the immediate neighborhood of cell i k 7 for extr
99. coeff estimates mixing coefficients from flux across cell faces For momentum the coefficients on east north and bottom faces of U cells is estimated by dif f fei x k j 1 UI feug 18 68 cos T Uik ja 1 dif f fniyj 18 69 dif f fbi 266 _ 18 70 d 18 70 where 10720 to keep from dividing by zero where no gradient in velocity exists For tracers the coefficients on east north and bottom faces of T cells is estimated by diff feiri k j2 L Seiki i 18 71 t T T cos AX UG k 4 7 1 enia o o f mins _ 18 72 UNUS s lassi dif f fbi LICET RR 18 73 hI EQ iat t 18 73 where plays the same role as for velocities If option isopycmir is enabled the K11 22 33 k elements of the isopycnal mixing tensor along with the suitably averaged mixing coefficients A75 AP Abs and are additionally output The output from this diagnostic i is written as 39 bit IEEE unformatted data to file emix dta If option netcdf or save_mixing_coeff_netcdf is enabled data is written in NetCDF format to file emiz dta nc rather than in unformatted IEEE The interval between output is specified by variable cmixint and there is no control variable since only the unformatted data is written 18 2 13 show external mode Option show_external_mode saves instantaneous values at time level
100. conserved numerically Each cell has six faces and certain variables must be defined on all faces For instance advective velocities zonal meridional and vertical are located on cell faces defined normal to those faces and positive in a direction of increasing longitude latitude and decreasing depth Additional variables defined on cell faces are diffusive coefficients viscous coefficients diffusive fluxes and advective fluxes Note that names for variables on cell faces are only needed on the east north and bottom faces of cells This is because the west south and top faces of 1 Positive vertical velocity at the bottom of a cell points upward in the positive z direction 5 2 THE MAIN VARIABLES 45 cell k jrow are the east face of cell T 4 4 the north face of cell T jrow 1 and bottom face of cell T 1 A similar arrangement holds for U cells 5 2 3 Model size parameters The main dimensional parameters are e iml number of longitudinal grid cells in the model domain This is output by mod ule grids when specifying a domain and resolution e jmt number of latitudinal grid cells in the model domain This is output by mod ule grids when specifying a domain and resolution e km number of grid cells between the ocean surface and the bottom in the model domain This is output by module grids when specifying a domain and resolution e jmw number of latitude rows within the memory window Th
101. cos m i ip k j i ip k j cip lig tip kj iip itip k DE in PT t 5 X kr 0 1 8 E 15 89 15 16 HYBRID MIXING SCHEMES 181 1 444 gt 1 kr Y AY tipk 3 i k Jli 1 k l ckr 3 zTi4ip k lLkr X d kx 0 i ip k j c i ip k j 6 Pirin ke rj 6 o Fine i ip k j 2 2 15 90 2 Kj 5 ig 04 6 yPi ip k k j zPi ip k 141 3 The small slope limit is found by taking the limit 6 p 6 01 lt lt The diagonal component of the Redi tensor in this limit is ux x dzWk 14kr Y ki ipk 1 4kr j 15 91 0 where the diffusion coefficient Ag tir bli ip k 1 kr j is now determined by the small slope constraints discussed in Section B 2 7 in the Appendix The small slope diffusive flux then takes the form e diff Fetes KIRI oTi 1 x dzWk ike Y AC J 4 kli ip k 1 kr 2 67 Ti Lip k ipkr j X Adzly 220 by ne J k j 15 92 tip k 1 kr i Meridional Flux 180 The isopycnal component of the diffusive flux through the northern face of a T cell dif f fnt kj for the full Redi tensor is given by cose d L cos o T kj T 5 dii pip 5 AT Os T A rip k j4 jq x t ip 0 jq 0 plikitiay 6 pti y diff fnt F thy ik 1 1 0 7 4 Yr ik i k j 734 2 08 779 2 5k
102. data may take a non trivial time to copy so be prepared to go to lunch As an alternative the database for MOM 2 is available on exabyte tape Data Grade 8mm 112m This method of access is not encouraged since it is relatively easy for GFDL to get flooded with requests and this presents a problem If a copy of the database on exabyte tape is requested the name of the person requesting the data will be noted Please be willing to pass on the favor by making a copy for someone else if asked Also please send a blank exabyte tape with the request Files can be extracted from the exabyte tape with the following steps mkdir DATABASE make a directory to hold the climatological DATABASE cd DATABASE change to the database directory tar xvf dev rst0 extract the database files from tape on exabyte drive rst0 19 5 HOW TO FIND THINGS IN MOM 2 253 19 5 How to find things in MOM 2 Finding things within a large model like MOM 2 is no problem with the aid of UNIX utilities such as grep For example suppose all areas within the model having anything to do with isopycnal mixing are to be located Searching for option with the following command grep i isopycmix Fh will find all such sections The i option is useful because it ignores upper lower case dis tinctions Searching for names of variables can likewise show every place where they are used Definitions for variables can be seen by searching all h files Another v
103. days as given by Equation 15 3 in Section 15 9 7 This option together with options idealized_ic and restorst allow MOM 2 to be easily portable to various computer platforms 15 9 SURFACE BOUNDARY CONDITIONS 159 Recommendation When setting up a new model for the first time it is recommended that option simple_sbe be used Only after verifying that results are reasonable should more suitable options be considered 15 9 2 equatorial taux This option is meant to specify a constant windstress of taux0 dynes cm in the zonal direction for idealized equatorial studies It will replace the zonal windstress given by option simple_sbe and its default value of taux0 0 5 can be changed via namelist Refer to Section 5 4 15 9 3 equatorial_tauy This option is meant to specify a constant windstress of tauyO dynes cm in the meridional direction for idealized equatorial studies It will replace the meridional windstress given by option simple_sbc and its default value of tawy0 0 0 can be changed via namelist Refer to Section 5 4 15 9 4 time mean sbc data This option is used to supply annual mean Hellerman and Rosenstein windstress and annual mean Levitus 1982 sea surface temperature and salinity for use with option restorst Data is prepared for the resolution in mom as described in Section 19 6 Refer to Section 10 2 for further discussion If option restorst is enabled surface temperature and salinity are damped back to this annual m
104. first term is the number of full memory windows needed to update prognostic variables on latitudes jrow 2 through jrow jmt 1 To account for the last few rows there may be an extra memory window which is only partially full and this is given by the second term in the calculation of num windows If num windows gt 1 then preparation is made for computing a second group of latitudes by copying data from the northernmost jmw ncrows rows in the memory window into the southernmost 7mw ncrows rows in the memory window The ordering of the copy is important else data copied in one operation will be wiped out by the next copy A general prescription for copying data southward equivalent to moving the memory window northward is given by For variables dimensioned as array imt km jmw copy all elements of i and as follows array i k 1 array i k jemw array i k 2 array i k jmw e For variables dimensioned as array imt km 1 jemw copy all elements of i and as follows array i k 1 array i k jemw e For variables dimensioned as array imt km jsmw jmw copy all elements of i and k as follows array i k jsmw array i k jmw e For variables dimensioned as array imt km jsmw jemw no copy is necessary Latitudes within the memory window with local index j are related to latitudes on disk with global index jrow by an offset f which is calculated as joff mw 1 nerows for mw 1 to windows 3 3
105. for open boundary conditions This was done by Arne Biastoch abiastoch ifm uni kiel de but has not been converted to the CRAY T90 at GFDL at this point run_obcpsi is a run script which uses file obcpsi for constructing data needed for open boundary conditions This was done by Arne Biastoch abiastoch Gifm uni kiel de but has not been converted to the CRAY T90 at GFDL at this point e SBC contains three sub directories for supplying various types of surface boundary con ditions to MOM 2 Each is located in a separate sub directory 1 TIME MEAN contains subroutines which supply the time mean Hellerman and Rosenstein climatological winds 1983 along with the time mean Levitus 1982 SST and sea surface salinity climatologies which are used by the test case to compute effec tive heat and salt fluxes given a damping time scale and thickness which can be input from a MOM 2 namelist Refer to Section 5 4 for information on namelist variables Note that the time scale and thickness can be different for restoring temperature and salinity These time means are assumed to have been created using scripts from PREP DATA so they are appropriately defined as functions of latitude and longi tude on the domain and resolution specified by module grids The option used to configure this type of surface boundary condition for MOM 2 is time mean sbc data which is described further in Chapter 10 MONTHLY contains subroutines which supply monthly mea
106. form given in equation A 45 since that form transformed into the full non small angle representation of equation A 50 Using the full transformation back to the orthonormal isopycnal frame A IK or in matrix form small small 5 Sz Poo 47 Wis 5 TET 1152 x A 57 _ 1 Jae CVARS VIS 1 0 1 5 S 3 LES ES 1 ys aos Vent SER pm m 1 98 6 95 0 Te se yields the orthonormal isopycnal frame representation of the small angle approximated tensor Ar 0 0 ApS 0 0 0 CA _ 2 0 0 Ap 0 S 1 The small angle approximation is seen to add a small amount of along isopycnal mixing the 2 2 term A 1 7 as well as a term proportional to the generally small number ApS Dropping these terms is consistent with the small angle approximation which then recovers the purely diagonal mixing tensor Aj 67 ez ez Ap Errors with z level mixing Consider the traditional diffusive mixing Section A 2 with some tensor I that is diagonal in the z level frame Diffusive mixing with I is quite different than diffusive mixing with K as can be seen clearly by transforming I to the orthonormal isopycnal frame 8 S 8 8 S F 0 Ay 0 0 5 VES z itm vm 0 Ag 0 3 ILL SV1 5 5 5 1 5 S SJLILS Tes MN NEM 0 0 Ay 0 5 MM Jus Ves VAS 7157 VIE A 60 which yields __ A 1 5 0 0 _ 0 1
107. in cp time than running one processor This redundancy is not needed in the fine grained approach to parallelism However there is still other redundancy in the fine grained approach which can be eliminated by opening up the window all the way to jmw jmt In this case land sea masks are calculated only once and there is no copying or reading of data This will speed up the calculations by 8 but the cost will be large amounts of memory The bottom line is that as the number of processors increases redundant calculations increase when using coarse grained parallelism but decrease to zero when using fine grained parallelism with a fully opened memory window Private Shared variables When using fine grained parallelism there is no issue as to whether variables are private or shared Essentially the compiler resolves this issue at the level of each do loop However when using coarse grained parallelism all variables must be typed as being private or shared This is of no grave consequence when a model is unchanging but is of major concern in a research model where development is actively ongoing Automatic parallelization tools such as those from Applied Parallel Research are currently being used for automatically typing variables Although this approach requires some intelligent intervention results have been very encouraging Overall these tools seem to be a rational solution for allowing MOM 2 to be executed on PVP systems like the
108. in order to ensure a dissipative operator all choices of discretization should be made in the framework of the discretized functional As noted earlier the power of this perspective is that whatever the discretization used for the functional the resulting diffusion operator derived from taking the functional derivative will be dissipative To put some details behind these comments consider the component of the x y plane func tional arising from the first subcell see Figure B 2 Ignoring the issues of reference points this term has the form ya 2 3B 6s Ti 1 kjbyPik i Oy Ti je pi idsi B 119 The numerator has contributions from density at the three grid points p 4j41 Pi k j and Pi i j These three points form a triangle or triad in the x y plane see Figure 2 A self consistent and simple choice of reference point is the corner of this triad which for this case is the T cell point k 7 With this choice each of the three densities appearing in a triad will employ the same thermal and saline partial derivatives which are referenced to this single point T herefore the density gradients for this particular contribution to the functional will be discretized as Od 1 Pis bo Site B 120 by Sing 121 In this expression the thermal and saline coefficients are written Gne po Oik js Sik B 122 Biki Ps biki S
109. interior is forced by data prescribed at the boundary and passive in which there is no forcing at the boundary and phenomena generated within the domain can propagate outward without disturbing the interior solution Open boundaries may be placed along the northern southern eastern and or western edges of the domain At open boundaries baroclinic velocities are calculated using linearized hori zontal momentum equations and the streamfunction is prescribed from other model results or calculated transports e g directly or indirectly from the Sverdrup relation Thus the vertical shear of the current is free to adjust to local density gradients Heat and salt are advected out of the domain if the normal component of the velocity at the boundary is directed outward When the normal component of the velocity at the boundary is directed inward heat and salt are either restored to prescribed data active open boundary conditions or not passive open boundary conditions In contrast to the above described active open boundary conditions passive ones are characterized by not restoring tracers at inflow points Additionally a simple Orlanski radiation condition Orlanski 1976 is used for the streamfunction Refer to Chapter 13 for all the options and details 15 11 Filtering In general the equations of motion are filtered in various ways to remove components from the solution which are physically unimportant but neve
110. is used to separate the term into explicit and implicit parts Isopycnal mixing When option isopycmix is enabled the vertical diffusion operator in Equation 11 60 be comes diff fb diff foi DIFF Tz 1 aidif CUED pos zl diff_fbiso y 1 diff fbisoi k 11 dzt 66 where the implicit factor is aidi f and the term is within diff_fb 1 which is solved implic itly The and K terms are handled explicitly no implicit treatment within diff fbiso i which is defined by Equation 11 54 The horizontal isopycnal fluxes are given by Equations 11 50 and 11 51 Refer to Section 15 16 3 for further details on isopycnal mixing Gent McWilliams advection velocities If option isopycmix and option gent mcwilliams are enabled the advective operators for Equation 11 72 are given by 11 10 TRACER COMPUTES TRACERS 121 adv vetisoi dur 1 vetiso 4 kj c 1 1 D ADV Tzisojk 67 COS PF pow et ade vntisoi tikinr 1 adv vntiso ki a o lbs dl ADV _Tyiso kj 1 4 7 11 68 COS dytjrow adv fbiso 1 adv_fbiso ADV Tzisoikj TER 11 69 where twice the advective flux at the bottom of the T cell is adv_fbisoi 2 adv_vbiso kj 11 70 As with the normal advective flux the factor of two is for reasons of computational speed Note also tha
111. j 2 Pigs 24 cos 1 Ui k j jrow 1 c dztk Pi 2 j 2 T Pi 1 j 2 U 2dEUiti COS jrowpi 216 T Pind Pij 2dau cos QU jrow Uk lur i dztk Pi 2 j 1 T Pi42 7 Pig Pio 2dxu cos QU c Aipiurow dztk PitAj 2 T Pi j 2 Pi 1 j 1 P j41 Ui k j41 2 7 Aijrow41 d2lg RM 2 UUirow41 Pi 2 j 2 T Pi 1 j 2 Pi 2 j 1 Pi 1 j 1 2dYUjrow 1 Wi41 k j 1 2 7 Aidt jrow41 dZtk Piti jti T P jgi Pini Pij Uik j 2T Aj jrow dzly mre 2dyu jrow T Piti j l Pi 2 j Pii 2dYUjrow Wi41 k j 2 7 Ait1jrow dztk 12 13 Because the normal component of velocity is zero on all boundaries the terms in Equation 12 13 can be rearranged around p Collecting terms for jrow 1 and multiplying numerator T and denominator by the area of a T cell dzt 41 cos 05 5 44 dytjsow41 results in 1 jmti l km imt 1 5 5 Pit1 k j 1 drt 41C08 owt dYtirow i dtk Po jrow 0 k 1 1 0 oes adv veti y i41 adv vni ik 41 T 12 14 dat COS Pirow l dytjrow41 COS Pirow 1 12 8 WORK DONE BY PRESSURE TERMS 139 where the limits of the sum have been adjusted to cover all cells and the advective velocity on the eastern face of t
112. jrow l 1 adv vnu kj adv vnt k duw adv ntizi k i41 duei dunrow 11 36 1 adv_vet dus adv vet y 44 dun duw dYthjrow deta K dk jrow i k j 1 jrow i41 advveuj p j adv vet 4 5 p ji c due 11 37 1 k as adv vbti y AUS jrow duw COS row dru Drow T jrow T jrow 1 adv vbt 44 4 US jrow due cos adv vbt y j41 AUN jrow duwi cos adv vbt 4 y ipa c dunno due cos Prowl 11 38 This weighting eliminates the problem of numerical de coupling between the advective velocities on the bottom of T cells and U cells in the presence of flow over topographic gradients as in MOM 1 and previous implementations It should also be noted that the weighting factors dus dun due and duw are always equal if grid construction is by method 1 as described in Chapter 7 A gain in speed can be realized by removing these factors from the above equations if method 2 is not to be used Refer to Sections 11 11 5 and 11 10 7 for details on how these advective velocities are used 11 6 isopyc computes isopycnal mixing tensor components Subroutine isopyc computes the isopycnal mixing tensor components and the isopycnal ad vection velocities which parameterize the effect of mesoscale eddies on the isopycnals This only applies when opti
113. l km imi 1 2 var X X X gt tisine usa A in 18 17 jrow 2k 1 1 2 1 int _ X 18 18 lt gt represents the external mode component of the work done by lt akin gt represents the internal mode component of the work done by k jn and the relation between j and jrow is as described in Section 5 2 The volume element and total volume are given by U k jrow umaski jrow dzu cos QU ur dztk 18 19 grow jm 1l km imt 1 Vo Y Aus 18 20 jrow 2k 1 1 2 Work done by each term in the momentum equations is computed using operators described in Sections 11 11 5 Total change in kinetic energy gt A err iri Ui kn Ukn 1 Uik jm r 1 Udkj r 1 E lt 00 eres gt lt eres oT gt 18 21 2AT 2AT Non linear terms The work done by non linear terms on the velocity is broken into two parts Gl is the horizontal part including the metric term and G2 is the vertical part G1 G2 should be zero The nonlinear error G1 G2 which should be roundoff to within machine precision On a Cray YMP with 64 bit words this amounts to the error being about 1x107 smaller than the leading term in the computation of G1 and G2 Gl lt ADV U2 4 ADV ADV metricipjn gt lt ADV ADV metricikjn gt 18 29 G2 lt gt lt ADV Uzr gt 1
114. necessary to construct density coefficients prior to executing the model 260 CHAPTER 19 GETTING STARTED 5 Certain options require input variables to be set All are set to default values but these values may not be appropriate for the particular model being used Their values may be changed to more appropriate ones through namelist For setting input variables read through Section 5 4 for a description of the namelist variables Also guidance is often given within the description of the option and this information should be read The following steps are optional They apply if the DATABASE is to be used or op tion time_averages is enabled 1 If it is desirable to use data from the DATABASE copy the scripts from PREP_DATA into the EXP ATLANTIC PREP_UPDATES directory change pathnames to point ap propriately and execute run_sbc followed by scripts run ic and run sponge These will build a copy of the DATABASE appropriate to the domain and resolution specified in module grids 2 If it is desirable to produce time averages during the integration copy script run timeavgs and file timeavgs F to EXP ATLANTIC MOM_UPDATES The grid used for producing time averages must be defined by modifying the USER INPUT section of file timeavgs F The entire model grid or a subset of grid points may be chosen If after executing this script a change is made to module grids then this script must be executed again to re establish the averaging grid If e
115. numbner a Boolean variable which acts as the logical switch and an integer variable used as an index within module tmngr Refer to include file switch h to see the structure Refer to 5 4 NAMELIST VARIABLES 57 the section where alarms are set within module tmngr for examples of how to implement new switches tsiint interval in days between writing time step integrals This is used with op tion time step monitor tavgint interval in days between writing data for use with option tracer averages itavg Boolean for writing regional mask when used with option tracer averages It should be set true on the first time step of the first run and false thereafter This allows datasets from multiple runs to be concatenated without regional mask information being duplicated tmbint interval in days between writing data for option meridional tracer budget tmbper period in days for producing time averaged data for use with option merid ional tracer budget This averaging period may be set shorter than the interval tmbint itmb Boolean for writing msktmb when used with option meridional tracer budget lt should be set true on the first time step of the first run and false thereafter This allows datasets from multiple runs to be concatenated without regional mask information being duplicated stabint interval in days between doing stability analysis for use with option stabil ity_tests cflons starting longitude deg for
116. on the 1 disk Note that tau 1 data in row jrow 2 is destroyed in the process Subsequent reading calculating and writing overwrites latitude rows jrow 3 through jmt 1 on ther 1 disk with 1 data A more detailed description of this will be given in the next section 3 3 The Memory Window The memory window in MOM 2 is a generalization of the slab approach used in MOM 1 and prior version of the model where three latitudes rows were kept in memory This generalized approach in MOM 2 is capable of simulating the older method but allows for greater flexibility Some of the advantages of this memory window are e Higher order finite difference schemes and parameterizations which require access to more than three latitude rows can be implemented in a straight forward manner e There is a reduction in the number of names required for variables For example in MOM 1 and previous incarnations tracers required three names one for the row being computed one for the row to the north and another for the row to the south In MOM 2 there is only need for one name rows to the north and south are accessed by meridional indices j f and j41 Essentially all prognostic variables are subscripted by three spatial dimensions as if infinite central memory were available However the actual memory needed is controlled by the size of the memory window Equations and coding looks the same regardless of how large or small the memory window i
117. one corner lying at a T point In the discretization considered here these are the 12 cells for a particular x y or z x projection which contain contributions from the central T point They correspond to the 4 subcells discussed in the previous one dimensional example For the three planes there are a total of 36 quarter cells to which 7 contributes The direction perpendicular to the plane has distance given by the T distance either dzt for the x y plane dxt for the y z plane or dyt for the z x plane Inside of these quarter cells it is possible to prescribe a different diffusion coefficient This added freedom in choosing the diffusion coefficients is essential to the method employed for maintaining the 282 APPENDIX B ISOPYCNAL DIFFUSION numerical stability when the slopes get large These details for slope checking will be given in Section B 2 7 When discretizing the derivatives appearing in the functional the derivative inside a triangle determined by adjacent T points will be taken as constant As seen in the one dimensional example this assumption is essential to reducing to the familiar discretization of the Laplacian in the flat isopycnal case 5 points in a two dimensional example B 2 3 Subcell volumes On a spherical earth the areas in the x y plane for a domain of longitudinal width AA and latitudinal width is given by aAA asin s asin where a is the radius of the earth For box 1 in Figure B 2
118. or diffusion coefficients In extreme cases consideration might be given to smoothing the entire topography field before interpolating to kmt jrow Not an option as of this writing If a smoothing is implemented be aware that coastlines may change 92 CHAPTER 9 TOPOGRAPHY AND GEOMETRY 9 3 Viewing results The recommended way of viewing the resulting topography kmt jrow field and f H field is to save these results using option topog_netcdf This is described in Section 18 2 20 A good way to visualize results is with Ferret which is a graphical analysis tool developed by Steve Hankin 1994 at NOAA PMEL email ferret amp pmel noaa gov URL http www pmel noaa gov ferret home html As an alternative a map of the resulting Amt row field is printed out as as part of the results from executing module topog For gigantic domains it may be desirable to limit the printed output and directions for doing this are given in the output file 9 4 Fine tuning kmt Although many of the problems with geometry and topography can be handled in a routine fashion sometimes it is desirable to interact with the modification process At one point module topog contained interactive editors but these accounted for approximately 3500 lines of code which was hardly justifiable These editors along with intermediate files for storing changes have been dropped The current approach is to save output with option topog_netcdf which involves relatively litt
119. relaxation alternately solving on the red black squares of a checkerboard enabled by option hypergrid in MOM 2 66 CHAPTER 6 MODULES AND MODULARITY and conjugate gradients enabled by option conjugate_gradient in MOM 2 These solvers form the basis of solving the external mode stream function and the newer rigid lid surface pres sure and implicit free surface method developed by Dukowicz and Smith 1994 The first two methods require choosing a successive overrelaxation constant sor which may be input through namelist Its optimal value is dependent on geography and topography Refer to Section 5 4 for information on namelist variables This module provides an easy way to optimize this con stant In principle the conjugate gradient solver is the most efficient of the three and is the recommended one The others are retained for compatibility reasons and as an alternative if the conjugate gradient solver should fail on a particular geometric configuration or value of the implicit Coriolis parameter acor The stopping criterion for convergence within the elliptic solvers is input through a namelist tolrsf for stream function tolrsp for surface pressure and tolrfs for the implicit free surface This criterion behaves differently than the corresponding variable crit which was used in MOM 1 In MOM 2 the sum of the truncated series of future corrections to the prognostic variable is estimated assuming geometric convergence and the iteration is ter
120. resolutions are A and Ag The number of discrete cells contained between a and D is given by 18 a Aa Ag 2 where must be an integer and the resolution for any cell A is given by N 7 1 Ag As 0 An DET 05 7 2 where m 1 As an example if a and p were longitudes the western edge of the first cell would be a a and the eastern edge of cell N would be at 7 1 3 Describing a domain and resolution A grid domain and resolution is built by specifying bounding coordinates and resolution at those coordinates for each region Example 1 Imagine grid with a longitudinal resolution A 1 encircling the earth and a meridional resolution Ag 1 3 equatorward of 10 N and 10 S and a vertical grid spacing A 10 meters between the surface and a depth of 100 meters This domain and resolution is specified in the following manner Two bounding longitudes one at 0 E and the other as 360 E with 1 at both longitudes two bounding latitudes one at 10 and the other at 10 with A 1 3 at both latitudes and two bounding depths one at and the other at 100x10 cm with A 10x10 cm at both depths These specifications imply 360 grid cells in longitude 60 grid cells in latitude and 10 grid cells in depth Example 2 In the preceeding example if it were desired to extend the latitudinal domain poleward of 10 N and 10 S to 30 N and 30 S where the meri
121. same number of days If false then the actual number of days per month will be used This is only used when eqyear is true e the length of each month in days when eqmon true 5 4 2 Integration control Namelist contrl These variables are used for setting the integration time when to initialize and when to write restart files e init Boolean for denoting whether the first time step of a run is to perform initializations such as reading in initial conditions etc When init false then the execution is started from a restart data file Refer to restrt listed below e runlen length of run in units given by rununits e rununits units for runlen Either days months or years e seglim time in days for one segment of ocean or atmosphere Only used with op tion coupled e restrt Boolean for controlling whether a restart is to be written at the end of the run e inilpt Boolean for controlling whether particle trajectories are to be initialized on the first time step of a run This is only used if option trajectories is enabled 5 4 3 Surface boundary conditions Namelist mbcin These variables are for surface boundary conditions e mapsbe indices for relating how surface boundary conditions are ordered m 1 to the maximum number of surface boundary conditions e sbcname character 10 names for surface boundary conditions e dunits character 15 names for units of surface
122. set to 10 gram cm sec Refer to Section 5 4 for information on namelist variables Use of polar filtering on and V leads to problems Removing the filtering eliminates the problems So the filtering has been removed for this method Whether it can be eliminated for the stream function method has yet to be determined 16 4 explicit free surface This is a version of the Killworth explicit free surface being implemented in MOM 2 by Mar tin Schmidt during the beta test period Any questions should be directed to Martin at mschmidt paula io warnemuende de Section 16 4 contributed by Martin Schmidt mschmidt paulaio warnemuende de 10 Better numerics than in MOM 1 Chapter 17 Elliptic Equation Solver Options There are three methods for solving the external mode elliptic equation and two forms for the numerics of the coefficient matrix One and only one of the methods should be chosen and one form of the coefficient matrix All are described in the following sections 17 1 conjugate gradient This option selects a conjugate gradient technique to invert the elliptic equation for all external mode options using either five point or nine point operators selected by options sf 9 point or sf 5 point The algorithm below is a Fortran 90 version of the algorithm in Smith Dukowicz and Malone 1992 subroutine congrad A guess forc dpsi iterations epsilon use matrix module intent in A guess forc epsilon intent out
123. surface z 0 The finite difference equivalent of this second method will be used to generate vertical velocities in the interior as well as at the bottom Initial conditions typically consist of specifying a density structure through potential tem perature and salinity with the ocean at rest The finite difference equivalent of the continuous equations will be developed in Chapter 11 2 2 Kinetic energy budget This section discusses a kinetic energy budget for the ocean primitive equations in their con tinuous form For this purpose the work of Holland 1975 is followed quite closely Bryan and The 43082 0 sec is arrived at assuming approximately 86400 x 1 86164 seconds in one siderial day 366 The 366 is used to account for a 1 day co rotation The viscosity coefficient is constant with option consthmir but varies with option smagnimiz Options are discussed in Chapter 15 8 CHAPTER 2 OCEAN PRIMITIVE EQUATIONS Lewis 1979 F Bryan 1986 Treguier 1992 and Goddard 1995 provide further discus sions and examples A diagnostic from MOM 2 provides the corresponding domain averaged budget for the finite difference solutions The budget for available potential energy APE which is also of interest for energy studies is not provided by the generic MOM 2 options The previously mentioned references should be consulted for discussions of APE 2 2 1 Total budget The horizontal momentum equations are a relev
124. that the functional relation ship can easily be changed by the researcher Values required for this option can be changed through namelist Refer to Section 5 4 for information on namelist variables diff_cet ahb ahs ahb exp 1 0x104 15 85 15 16 3 isopycmix Option isopycmix enables a hybrid mixing scheme which mixes tracers but not momentum along locally defined neutral directions by means of vertical and horizontal mixing in Equations 2 3 and 2 4 One basic horizontal mixing scheme e g option consthmix and one basic vertical mixing scheme e g option constumix must also be enabled for use with option Diffusion coefficients for tracers from the basic mixing schemes are used as background coefficients in the horizontal and vertical but these may be set to zero The isopycnal mixing co efficient typically O 107em sec along with the maximum allowable isopycnal slope Smar typically 1 100 and referred to as variable slma in the model are input through namelist Refer to Section 5 4 for information on namelist variables Sub options The following options are available for use with option isopycmiz e Option full tensor includes all terms in the Redi tensor If this option is not used then the small angle approximation to the Redi tensor is used Note that the full tensor is very computationally expensive but is most accurate in regions of strongly sloping isopycnal
125. the control is specified by variable iots 18 2 20 topog netcdf The output from option topog netedf is ocean depth at cells given by AT jrow ZWkmti jrow 18 147 244 CHAPTER 18 DIAGNOSTIC OPTIONS in units of em and f HT in units of em sec where the Coriolis term f is defined at the latitude of T cells When this option is enabled output is written in a NetCDF format to file topog dta nc There is no 32 bit IEEE unformatted data option Therefore the only way to get it is to enable option topog_netcdf using option netcdf will not do it Although this option is intended to be used when executing the topography module in stand alone mode from script run_topog it can also be enabled in a model run using script run mom There is no associated interval or control variable 18 2 21 trace coupled fluxes This diagnostic is useful as an aid to diagnosing problems with coupling to atmosphere models using option coupled It gives some gross statistics for the surface boundary conditions at various key places as they are being constructed for both atmosphere and ocean models Output from this diagnostic is only written to file printout and is not intended for post processing 18 2 22 trace indices This diagnostic is useful when trying to understand how the memory window operates for various settings of jmw Refer to Section 3 3 2 for a description of how the memory window works It gives a trace of the latitude loop ind
126. the doubly cyclic case cyclic in latitude also and on the northern and southernmost cells 1 0 jmt 0 15 9 Note that solar shortwave data is not supplied with MOM 2 and so must be supplied by the researcher 162 CHAPTER 15 GENERAL MODEL OPTIONS 15 10 2 solid walls This implements solid walls at domain boundaries in longitude and latitude The condition is kml jrow kmtimt jrow 1 15 10 jmt The domain is finite and closed 15 10 3 symmetry This implements a symmetric boundary condition across the equator Specifically the second last row of velocity points must be defined on the equator 0 0 Note that the equator is at the northern end of the domain The condition applies when j in the memory window corresponds to jrow jmt 1 and is given by tikjtin likin Uik j 1 1 UkSgd Uik j 1 2 Ui k 7 2 PSl jrow 1 psliirow kmti jrow 1 kmt jrow 15 11 15 10 4 sponges This implements a poor man s open boundary condition along the northernmost and south ernmost artificial walls in a limited domain basin A Newtonian damping term is added to the tracer equations which damps the solution back to data within a specified width from the walls The form is given by Equation 11 56 and the data is generated by script run sponge in PREP DATA If option equatorial thermocline is enabled then the profile from Equation 15 1 is
127. the flux corrected transport In other words where the FCT is diffusing tracers with the lower order upwind advection This is done by saving the change in tracer per time step due to the flux corrected transport scheme minus a second order advection term Output from this diagnostic is only available in NetCDF format If option fci netedf is enabled data is written in NetCDF format to file fct dta nc The interval between output is specified by variable fctint and the data is instantaneous 18 2 LIST OF DIAGNOSTIC OPTIONS 221 18 2 6 gyre components Option gyre components computes instantaneous values of various components of northward tracer transport The longitudinally averaged temperature and meridional velocity are con structed for the latitude of QU as a function of depth Also the vertically averaged tempera ture and meridional velocity are constructed for the latitude of QU as a function of longitude jrow im t 1 me lt j gt ti m AT 18 30 k jrow ga 2 JI im t 1 lt Vijrow gt 18 31 Fae Z x lt Ti TOW gt 18 32 d VaL km lt View X adv onti s AT 18 33 VolzE hed Un Note that a factor of cos MC built into adv vnt The volume elements and volume of the latitude strip as a function of depth are AT tmask y tmaski dot 18 34 drui cos 18 35 AT tmask k j tmask dztk 18 36 AU dst
128. the mixing tensor as seen in Section A 1 can be thought of as an added advective transport of tracers see in particular the equations leading up to A 19 The transport velocity defined by such a tensor is divergence free equation A 16 and preserves all tracer moments if it has zero normal value on the boundaries discussion following equation A 34 The parameterization of Gent and McWilliams 1990 has been reformulated in terms of such an effective transport velocity by Gent et al 1995 Other types of mixing can be parameterized by anti symmetric mixing tensors For example Middleton and Loder 1989 summarize the effects of mixing by non zero angular momentum waves which gives rise to skew fluxes A 5 Summary The traditional manner of parameterizing tracer mixing in ocean models is through the use of a second order mixing tensor The basic mathematical properties of such mixing have been 214 APPENDIX A TRACER MIXING KINEMATICS reviewed in this appendix In general the mixing tensor contains both a symmetric positive semi definite component and an anti symmetric component The symmetric component repre sents dissipative processes associated with diffusive mixing The numerical discretization of this process is discussed further in Appendix B The anti symmetric component can be formulated in terms of an advective velocity which in addition to the usual Eulerian velocity contributes to conservative tracer mixing Because t
129. this solver converges significantly faster than the one in MOM 11 Section 17 1 contributed by Charles Goldberg chgQ g fdl gov 17 2 oldrelax This is a sequential over relaxation method which requires an over relaxation constant This constant is dependent on geometry and topography and the optimum one can be found by using script run poisson to exercise the elliptic solvers This method uses the coefficient ma trices given by options sf 9 point or sf point This is not the recommended method and is retained for compatibility reasons and in case option conjugate gradient should fail on a particular configuration 17 3 hypergrid This is a more highly vectorized version of oldrelax using the coefficient matrices given by options sf 9 point or sf point This is not the recommended method and is retained for com patibility reasons and in case option conjugate gradient should fail on a particular configuration 17 4 sf 9 point This option uses the full nine point numerics for the coefficient matrix in Equation 16 17 when inverting the external mode elliptic Equation 16 13 This matrix is slightly different than the Because of the difference in meaning between the MOM 1 tolerance crit and the MOM 2 tolerance tolrsf care must be taken to assure that both are converging to the same tolerance when doing these tests 17 4 SF 9 POINT 215 one used in MOM 1 and earlier versions Particular attention has been given to assuring that
130. three The ramdrive is usually configured as one huge pool of shared memory However when options coarse grained parallelism ramdrive and distributed memory are en abled the memory pool is distributed among processors this part is still under development so details can be expected to change The dimensioning of this distributed memory requires a pa rameter nprocessors which is specified in file size h and sets the value of num processors which ordinarily would take its value from namelist As described in Section 3 5 2 processor 1 will contain latitude rows from jstask 1 to jetask 1 processor 2 will have latitude rows istask 2 to jetask 2 and so forth Details will be hidden within file odam F and the rest of the model will be untouched except for an area below the latitude loop in subroutine mom which is where communication between processors will take place Recall from Section 3 5 2 that there will be some overlapping of latitude rows adjacent to the ramdrive memory boundary on each processor After all latitude rows have been updated to 1 data latitude rows adjacent to the boundary of each memory section will have to be updated This means that processors which share boundary latitude rows must read each 3 5 PARALLELIZATION 25 other s memory to update these rows Once these boundary rows have been updated everything is in place for the next time step to begin Refer to Figure 3 12 for an example
131. to guide this discretization as emphasized by Dukowicz and Smith is to recover the familiar discretization of the Laplacian 5 point in the two dimensional case in the case of flat isopycnals Furthermore all details about the discretization will be made at the level of the functional These details include the particular grid choice as motivated from Smith and Dukowicz and the choice for reference points to be used in approximating the neutral directions In the following no explicit reference will be made to the time step As it is necessary to lag the time step by one step for numerical stability of the diffusion equation a time step of T will be implicit throughout B 2 1 A one dimensional warm up In order to illustrate the general framework provided by the functional approach it is useful to consider the trivial case of one dimensional diffusion It should be noted that in one dimension there is no issue of isopycnal diffusion and so this example cannot illustrate any of the subtle issues related to the discretization of the neutral directions Those issues will be discussed at the appropriate point in the derivation of the three dimensional case Figure B 1 shows the grid which corresponds to the x axis in Figure B 2 Let V n and A n be the volume and diffusion coefficient corresponding to the subcell n Consider the following discretization of the functional 1 5 3 gt AQ V Q 5T n B 25 where the n sum is over
132. trieving it from the GFDL anonymous ftp Assume all local updates are in MOM_2_OLD EXP BOX MOM_UPDATES For illustrative purposes this will be referred to as OLD UPDATES It is important to realize that although many of the routines in the newer version of MOM 2 may have changed only routines in OLD UPDATES will have to be examined Make a directory under MOM 2 with the same structure using mkdir MOM 2 EXP BOX MOM UPDATES In what follows let the above sub directory be referred to as NEW UPDATES The recommended method Use to compare each routine in OLD UPDATES with the corresponding one in MOM 2 Within gdiff click the right mouse button and select the option to PICK all changes from the routine in MOM 2 Then use the mouse to mark each change to be added from the routine in OLD_UPDATES Select WRITE FILE type in the filename using a pathname to NEW UPDATES and the file written will have all marked changes merged together In the event that part of a local change overlaps a change in MOM 2 an editor can be used to make the resulting code as intended As newer releases of MOM 2 become available the above strategy for upgrading is strongly recommended This method has been in use at GFDL over the past year to incorporate new changes into the development version of MOM 2 as well as to upgrade researchers from older versions to the development version An alternative method If there is no access to gdiff ut
133. two tracers are dynamically active in the sense that they determine density Other tracers may be added by setting parameter nt gt 2 but the additional tracers are passive In previous versions of the model tracers were solved after the baroclinic velocities However in order to accommodate option pressure_gradient_average tracers are now computed before baroclinic velocities 11 10 1 Tracer components Each tracer is considered as a component of one tracer equation and solved separately by a do n 1 nt loop extending to Section 11 10 10 As with the finite difference momentum equations given in Section 11 11 5 the finite difference tracer equation is written in flux form to conserve first and second moments as discussed in Chapter 12 11 10 2 Advective and Diffusive fluxes Advective and diffusive fluxes across the north east and bottom faces of T cells within the memory window are calculated for use by the advection and diffusion operators described in Section 11 10 7 The canonical forms are given below The actual form of the diffusive flux may differ depending on which option is enabled Note that advective flux is missing a factor of 1 which is incorporated into the advection operator for reasons of speed Also a cosine factor has been absorbed into the definition of adv vnt k for reasons of speed Limits on 7 are typically jemw 2 and jemw jmw 1 except for the last memory window which may only be partially full Merid
134. un dyu 1 j 1 k 2Pj 1 k A 31 V 31 A 32 V 32 VBD 1 k 6 p up diu 1 A 33 V 33 dzWk IVp 34 3 k 1 YP pk 1 dzw 4 V683 j k 1 1 amp 1 A 34 V 34 _ A 35 V 35 IVp 35 A yP j k l pP Sn yP j 1 k 1 dzw E j k 1 dzwy A 36 V 36 2 6 6 7741 6 7 1 k au T 1 40 Tj APPENDIX B ISOPYCNAL DIFFUSION k 169p k Lk k by th Lk T LE j 1 k T j 1 k k 1 T m j 1 k Tia zP ipi k Ga 1 k ik j 1 k zP4 3 k 1 ik 1 hk 1 amp 1 2 6T pU 1 6 75 6 en 8 1 yPj 1 k41 j k 1 k yp k 1 yTj 1 k Tj k 1 j k 1 162 p gt k Kl 190 191 192 193 194 195 196 197 198 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 295 Recombination of terms in the x y plane At this stage the functional derivatives have been computed and so the diffusion operator is available In order to organize the results in a more compact form it is useful to rearrange terms in order to identify diffusive fluxes The contributions to the diffusion operator from the x y plane portion of the functional y
135. unformatted data to file diag_surf dta If option netedf or diagnos tic surf height netedfis enabled data is written in NetCDF format to file diag_surf dta nc rather than in unformatted IEEE The interval between output is specified by variable dspint and the control is specified by variable iodsp The averaging period is typically the same as the interval but may be specified shorter by variable dspper These variables are input through namelist Refer to Section 5 4 for information on namelist variables 18 2 LIST OF DIAGNOSTIC OPTIONS 225 18 2 4 energy analysis Option energy_analysis computes the instantaneous scalar product of and the momentum Equations 2 1 and 2 2 integrated over the entire domain to verify energy conservation as demonstrated for the continuous equations in Section 2 2 The finite discrete equivalent is demonstrated in Chapter 12 From Equations 2 13 and 2 14 the total velocity 4 is divided into internal mode amp and external mode 7 components The work done by each term in Equa tions 2 1 and 2 2 is broken into internal and external mode contributions Note that this approach is different than that given in Cox 1984 Units are in gm em sec Define two operators for integrating the scalar product of 4 and any terms in Equations 2 1 and 2 2 In finite difference form they are 1 jm 1l km imt 1 2 lt aikgn gt VolU 5 5 XO Tijn 18 16 jrow 2k 1 i 2 n 1 1 jmti
136. up the domain in module grids to yield jmt 66 latitude rows will meet this condition for 2 4 8 16 and 32 processors Once the above condition has been met the memory window size is given by jmw rows per processor 2 3 10 where the 2 is for the number of buffer rows How it works Consider Figure 3 7 which portrays the situation when the memory window is opened to jm 5 rows which is appropriate for fine grained parallelism using m 3 processors There is much similarity between this and the case of jmw 3 given above in Section 3 3 2 except that three central rows 7 2 3 4 are now calculated within each memory window and there are correspondingly fewer northward moves The memory window moves three rows at a time but still only requires copying data from the top two rows to the bottom two rows as in the case when jm 3 Note however that a condition of static imbalance exists when the northernmost latitude rows are being solved In this example the above condition for an integral number of rows per processor is not met Apart from the condition of static imbalance there is a possibility of dynamic imbalance which again leads to idle processors This happens when latitude rows have unequal amounts of work For instance some latitudes may have convection and others may not Or some latitude rows may be filtered while others may not In general there is no easy solution here In the case where the memory window is op
137. volume as indicated by the example in ptraj F If option lyapunov is enabled the deformation rate matrix em is also calculated as the particles are integrated Pierrehumpert Yang 1993 The Lyapunov exponent A is useful in quantifying the dispersion of the particle cloud and can be computed from the eigenvalues of this matrix as follows Let c ema 1 4 2 ema 18 162 Then the Lyapunov coefficient is given by log 0 T 18 163 If c gt 0 then 2 19 emia vto 18 164 Otherwise emi 2 e lol 18 165 2 This diagnostic is useful for investigating the evolution of water masses three dimensional flow structure and mixing properties of currents and waves Stokes drift chaotic mixing etc On the fly while MOM 2 integrates Only in two dimensions longitude and latitude 18 2 LIST OF DIAGNOSTIC OPTIONS 247 The storage requirement is six times the number of particles and the computation is relatively fast How many particles are reasonable Start with about 10 000 and depending on how the results look make adjustments Particle positions are saved to the restart file to provide the necessary starting point for integrating the particles for arbitrary lengths of time The output from Equation 18 161 which consists of an x y z position and a set of 3 integers per particle may be written as ascii to the model printout or as 32 bit IEEE unformat
138. window last memory window call clinic as before changes are in the subroutine itself tracer for the first part of the window cobc for jrow jmt 1 setocn F e include cobc h obc data h e define option lists for open boundary units _ 1 opt_obcpsi1 e define annlevobc logical for annual boundary data no time interpolation include in namelist mixing and initialize initialize coefficients varl cls cln vad clps clpn add in setocn_obc inc read open boundaries for T and 5 obc1 mom and put into unit obc1 add in setocn_obc inc read open boundaries for obcpsii mom and put into unit obcpsii add in setocn_obc inc subroutine rowi initialize Tracer for options obctest and obctest2 setvbc F Set surface boundary conditions to zero for option obctest option no_sbc for use with op tion simple_sbc snapit F e include cobc h e write open boundary conditions parameter cls cln vads vadn option obcparameter only for zonal open boundary conditions topog F Because the open boundaries resides at 7 2 and 7 jmt 1 i similar for each open boundary condition an extra has to be introduced identically to the virtual boundary row So a duplex boundary must enclose the domain either open or closed but always identically 13 5 DATA PREPARATION ROUTINES 147 two rows next to the open boundaries are set equal to the boundary row itself Otherwise in the case of sloping botto
139. workstations at GFDL Option f90 must be added to the list of MOM 2 options when compiling with a Fortran 90 compiler This is needed to configure the Fortran open statement properly Remove this option if compiling with a Fortran 77 compiler Diagnostic routines which save data in NetCDF format require a parameter setting to indicate the size of the largest model dimension which is typically imt jmt or km Fortran 90 allows the use of a max function within a parameter statement which conve niently automates the choice Functions were not allowed in parameter statements under 1 Because namelist and the open statement are standard features as opposed to non uniform extensions 251 252 CHAPTER 19 GETTING STARTED cf 77 on the CRAY YMP or CRAY C90 On these and other such systems the max function needs to be replaced with the maximum of imt jmt km Which one to use is of course dependent on model configuration In summary if a Fortran 77 compiler is being used the namelist terminator within the run scripts must be changed back to amp end the f90 command must be changed back to the appropriate f77 command with appropriate compiler options and the option Df90 must be removed from the option list 19 3 Special request for beta testers A newer I O manager is available which is much smaller simpler and easier to use and make changes
140. x E m k j 1 39 k j 1 34 1 44 y Tk j 1620 7 l kr j l jq 6 7 1 kr j 1 1 26 ZI k 1 kr j 1 5q k j 1 j4 k j 1 439 2 k j 1459 5 2 ipzoa vi 1 tp k j TIRE k j 1 P Pk 1 kr j TRE B 2 9 Diffusive fluxes The above details provide the explicit form for the discretization of the diffusion operator All that is needed is to divide out the volume factor Vr according to equation B 24 As an additional step it is useful to identify diffusive fluxes since the MOM model is coded in terms of fluxes across cell faces Identifying diffusive fluxes also allows for an easier implementation of the no flux boundary conditions than working directly with the diffusion operator These forms are provided in Section 15 16 3 in the main part of the manual B 3 General comments This section presents some general comments and details regarding the implementation of the new isopycnal scheme B 3 1 Isopycnal diffusion operator The isopycnal diffusion operator is given by the divergence of the diffusive fluxes MH 1 Z RIT k erus cos yF pja Fas B 227 1 The fluxes admit no computational modes since only nearest neighbor differences are employed This operator is defined at the center of the T grid cell T k jrow Exposing the spherical coor dinates gives DIFF Tx kj DIFF DIFF Tzi x diff feici 6a diff fni ja
141. x ADV Uy 18 169 uzbtsknmth x ADV Uzij 18 170 knymth LX pta 18 171 UTD k nmth PEDIU 18 172 uzbtsknmih x DIFF Uz pi 18 173 uxbig ks ho x DIFF metrici 18 174 uzblio sum L x CORIOLIS js 18 175 urbt x SOUTCE kj 18 176 uzxbtio ka x grad p y js 18 177 UTOS knmth x ADV metrici y jn 18 178 18 179 In Equation 18 167 the quantity grad_p jn 1 calculated from Equations 18 13 and 18 14 The equation for the kth grid cell at the mth station is given by 13 ugbt UTOL kn mth 18 180 2 Note that terms 3 4 and 5 are the flux form of advection When summed up they represent the physical advection in the cell However when taken separately they do not represent the physical advection in z because they contain divergent components The canonical form of the physical advection in 2 is given below by terms 14 15 and 16 L 1 ado veu y adv veu BAZI i 1l k j uxbty4knmth L X Uk jn dew cosdu T ADV p 18 181 fl LUj COS ow L 1 ado ki adv vnu p 1 uxblyska t T tikim 1 0 ADV U yi 18 182 1 dYUjrow COS Grow 18 2 LIST OF DIAGNOSTIC OPTIONS 249 L 1 adv y adv vnu y kg tho F Uik jnr m ADV Uz k 18 183 L 21 dzt 1 L UTDHUT knmth T2 Uns 18 184 1 L 1 dv vbu k i dv IA Q4 vUUi k 1 j Qd v OU kj
142. y is the reciprocal of the damping time scale in seconds This term could be added to the momentum equations using source j source rayleighi 11 97 and additional sources and sinks could be stacked in a likewise manner 11 11 5 Momentum operators Finite difference momentum operators as described in Section 5 1 are used for various terms when solving for the time derivatives in Equations 2 1 and 2 2 These operators are also used in diagnostics throughout MOM 2 Note that the arrays embedded within the operators must be defined when the operators are invoked The operators are defined in file fdifm h and their canonical forms are given by diff f eik j dff fei y cos dau diff f niki diff fnix ii DIFF Uyikj dl dy 11 99 grow Grow diff fbi k i diff f biki DIFF 11 98 DIFF di 11 100 1 tan ow DIFF metrici yj Am dins skein A 11 101 _ 2 sin OF ow UWi4 1 k j 3 n r 1 T Ui 1 k j 3 n 7 1 T 7 radius cos Oo row dat advu_fe adv fei 1 ADV Utik SO 11 102 Pikas 2cos ow lt Uj l fni adv ADV Uyin ii 11 103 COS fb 4 ADV Uzin NEN 11 104 tan ADV metrici Tadius blo t Wisk B myr 11 105 11 106 where the earth s rotation rate Q 556 and the mean radius of the earth is given by radius 6370 0z105cm
143. 0 will not vanish for the internal mode component of the work Nor will it vanish for the external mode component of the work Both components must be added for the sum to vanish 12 2 Work done by Coriolis terms There is no contribution from integrating the work done by the Coriolis force The summation 18 imi 1l jm l km 2 b B 222 Uus 20 sin ow 0 12 11 1 2 jrow 2k 1n 1 Again only use of the full velocity guarantees that the sum will vanish 138 CHAPTER 12 DISCRETE ENERGETICS 12 3 Work done by pressure terms In Section 2 2 1 it was shown that the work done by pressure forces equals the work done by buoyancy in the continuous equations when integration is over the entire domain The finite difference result is also equal to the work done by buoyancy For this derivation the definition of variables indices and the relation between jrow and j as given in Section 5 2 1 will be used In the terminology of MOM 2 the work done by presure forces summed over all ocean U cells is given by 1 jmi l km imt 1 Y X X Quae OR uos deu dzty Po jrow 2k 1 i 2 12 12 p is defined on T cells Expanding these terms using Equations 11 6 11 7 11 3 11 4 and taking the area element of a U cell as Aj dau cos dYUjrow Yields 1 gmt 1 km imt 1 gt gt jrow 2k 1 i 2 Pit j 2 Pipini Pi
144. 1 1 Do 66 Dj row ZU irow 2 16 3 where p is the unknown surface pressure and 210 jrown contains the vertically averaged ad vection diffusion hydrostatic pressure gradients and explicit part of the Coriolis term The implicit part of the Coriolis term is given by firow acor 2Q sin OF ow 16 4 When the finite difference curl is taken particular attention must be taken to assure that the unknown surface pressure terms are eliminated even when the grid is non uniform Here is an outline of the steps needed to do this Starting with Equations 16 2 and 16 3 make the following substitutions _ 1 F Os iirow r 1 16 5 d jrow _ 1 y 16 6 8 7 2 1 cos Co ow aCe 1 _ 1 F b4 Wijrow rt1 16 7 1 1 4 r 16 8 I2 COS Uu AQ Xrow r 41 jrow Wi jrow r 1 VLirow r 1 16 9 and multiply the equations as follows This approach was first worked out by Charles Goldberg personal communication using algebraic manip ulations The derivation given here 1s in terms of finite difference operators 16 1 STREAM FUNCTION 201 dau cos QU qn 16 2 16 10 dyUjrow Eqn 16 3 16 11 Then take the finite difference equivalent of the curl operation using dytjrow 6g Eqni6 10 dat 6 Eqnio 11 16 12
145. 1 45 difffbio stfijn 11 46 btfijn 11 47 adv fbi o adv vbt o tii nur t lia nu 11 48 0 0 11 49 11 10 3 Isopycnal fluxes When option isopycemiz is enabled the horizontal components of the isopycnal diffusive flux in Section 15 16 3 are added to the horizontal diffusive flux in Equations 11 42 and 11 43 The complete diffusive flux across the northern and eastern face of a T cell then is given by diff feti 11 50 diff fnis diff fnt 11 51 where the isopycnal diffusion fluxes diff fetis and diff f n are given in Section 15 16 3 The background fluxes are given by diff feet Ule 11 52 UT cos froy deui tik jmn diff fred cos QU oy E ert 11 53 dYUjrow where and are the coefficients from whatever subgrid scale mixing pa rameterization option has been enabled The K and K parts of the diffusive flux across 23 7 to within roundoff Note that unlike adv vbt kb j adv_vbu 45 can be non zero if there is a bottom slope 11 10 TRACER COMPUTES TRACERS 119 the bottom face of the T cell is given as diff_fbiso which is the vertical flux term F7 from Section 15 16 3 minus the piece diff f bisoj kj FF kj 11 54 Note that the isopycnal diffusion coefficient Ar has been absorbed into the tensor components 1 32
146. 10 3 Flowchart for subroutine gasbe F 106 CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE socam array of Ocesn S B C eg 7 0 the atmos grid sbcocn array of Ocean S B C eg T T an the n grid j Do n 1 num osbc index m to reference ccesn S B C n eg T t eSet cyclic camitics cn sbcatm eCompute global mean of sbcatm eExtrapolate sbcatm into land areas eInterpolate sbcatm to sboocn eSet cyclic aaditians an eCcnvert sbon to ocean units eConmpute global mean of schoon End do Figure 10 4 Flowchart for subroutine gosbc F Chapter 11 Discrete equations Once surface boundary conditions are available for the ocean as described in Chapter 10 the ocean equations are integrated for one time step with each call to subroutine mom As indi cated schematically in Figure 10 2 and described further in Section 10 1 mom may need to be called repeatedly until integration has been carried out for one time segment l or a flowchart indicating the calling sequence within mom for one time step refer to Figure 11 1 The process starts by incrementing the ocean time step counter itt by one itt itt 41 11 1 and calling module tmngr which increments ocean time by the number of seconds in one time step Refer to Section 5 4 4 for choosing a time step length Module tmngr additionally calculates a time and date as described in Section 6 2 9 and determines which events are to be acti
147. 15 18 4 15 18 3 quicker This is a third order advection scheme for tracers which significantly reduces the over shooting inherent in the second order center differenced advection scheme The cost is less than a 10 increase in overall time It is enabled by option quicker and is based on the quick scheme of Leonard 1979 but has been modified to lag the upstream correction by putting it on time level r 1 This was first recommended personal communication by Jeurgen Willebrand who demonstrated it in a one dimensional advection diffusion model The advantage of this is that it allows the same time step as for second order advection If this is not done the scheme is unstable unless the time step is reduced by about one half The discretization of Farrow and Stevens 1995 has been followed but not their predictor corrector method since the lagged correction mentioned above solves the stability problem The formulation given in NCAR 1996 is recovered by changing the 7 1 to 7 in all upstream corrective terms This is done by additionally enabling option ncar_upwind3 Each direction is discretized independently of others and so the scheme is un compensated for multi dimensions In the zonal direction twice the advective flux out of the eastern face of the T cell is given by ut vet adv vet 2 15 124 u adv vet adv_vet 2 15 125 adv feiyj quick lig jn sa quick 2 litt
148. 16 1 4 Island equations 202 16 1 5 Symmetry in the stream function equation 205 16 2 _ 207 16 2 1 The equations aooaa sns 207 16 2 2 208 16 3 implicit freesurface 209 16 3 1 209 16 3 2 211 16 4 explicit free surface oaoa 212 17 Elliptic Equation Solver Options 213 17 1 conjugate gradient 213 17 2 oldrelax 214 17 3 hypergrid 214 17 4 sf9 point 214 17 5 sf5 point 2 2 ee 217 18 Diagnostic Options 219 18 1 219 18 1 1 NetCDF formatted 4 220 18 1 2 IEEE formatted 4 220 18 1 3 Sampling data 221 18 1 4 Regional 222 18 2 List of diagnostic options 4 4 2 les 222 18 2 1 222 18 2 2 density netcdf 22222 es 223 18 2 3 diagnosticsurf height 224 18 2 4 energy analysis
149. 2 the centering coefficients alph gam theta are set to 1 0 1 for the rigid lid surface pressure method and 1 3 1 3 1 2 for the implicit free surface method The relevant equations corresponding to Equations 16 40 16 41 and 16 42 are as follows 1 6 T Ui jrow U ow 2 cos U 6 U row 16 43 grow Vijrow Vib 2Ar 16 44 ADS jrow PS jrow ps Tow 16 45 1 ijrow pp rec V Ut jrow 16 46 1 Vi ivow Ta Vivirow WU jrow V row 16 47 i jrow Ar ni jrow l d 9 B cos X 1 DSL row gam PST Sosa 16 48 jrow V jrow 2AT 2Ui jrow 2 M 01 gam PSE row 1 jrow 1 16 49 ZUijrowl f gcor veg 1 gcor Vic 1 Grow 16 50 210 CHAPTER 16 EXTERNAL MODE OPTIONS ZUijrow2 f gcor UF kj 1 gcor Gi jrow 2 16 51 where U and V are vertically averaged velocity components and terms involving jrow 1 have been dropped from Equations 16 46 and 16 47 to obtain the operator splitting as discussed in DM Also w 2Ar acor f and the forcing terms G jrow 1 and jrow 2 contain all remaining terms which are known The elliptic equation takes the form 6 A j 1 e _ 5y AD Si 2 jrow 2 66 Hicirow 1c08 95 4 AS A psic2
150. 27 Yu 15 118 Og 2 T di 1 di 2 2 i 385 15 119 Multiplying Equation 15 118 by 7 subtracting Equation 15 119 and changing to grid spacing Az yields F Fy x 1 15 12 0q O0x _ 15 120 where 7 12 and 1 12 for fourth order accuracy and 1 2 and 0 for second order accuracy Since the argument is the same for zonal meridional and vertical directions consider the zonal direction A fully fourth order advective scheme would set qik j 40 0 lik 15 122 15 18 ADVECTION SCHEMES 187 However as implemented in MOM 2 the scheme is only psuedo fourth order because the advecting velocity is left second order while the average tracer on the cell faces is expanded to fourth order using F lins Biens T Akin 15 123 Note that for ocean T cells adjacent to land cells the scheme is reduced to second order This is easily accomplished by using a land sea mask to select the appropriate coefficients A and for each T cell In principle a fully fourth order scheme could easily be implemented by expanding fluxes according to Equation 15 122 but this has not been done The reason is that fourth order schemes although more accurate on small scales still produce undershoots and overshoots which can have significant effect on local areas of the ocean These can be eliminated using flux corrected transport methods as described in Section
151. 2tp E Piki 12 39 jrow 2k 2 i 2 which is the work done by buoyancy and the counterpart to Equation 2 33 140 CHAPTER 12 DISCRETE ENERGETICS Chapter 13 Stevens Open Boundary Conditions Open boundary conditions have been tested successfully in the FRAM model Stevens 1991 and in the community modeling effort CME e g D scher and Redler 1995 They have also been used in a GF DL model of the North Atlantic in the framework of MAST2 DYNAMO Dynamo 1994 as well as in a regional model of the subpolar North Atlantic Redler and B ning 1996 The above mentioned experiments performed at Kiel were based on Ren Redler s implementation in MOM 1 This chapter was written by Arne Biastoch and describes an implementation of these open boundary conditions at the northern southern eastern and or western boundary for a basin in MOM 2 The approach is based on the methodology of Stevens 1990 There are two types of open boundary conditions active in which the interior is forced at inflow points by data prescribed at the boundary and passive in which there is no forcing at the boundary and phenomena generated within the domain can propagate outward without disturbing the interior solution At open boundaries baroclinic velocities are calculated using linearized horizontal momen tum equations and the streamfunction is prescribed from other model results or calculated transports e g directly or indirectly from t
152. 3 2 Reference points and grid stencil With a pressure dependent equation of state for seawater the particular choice made for the reference points needed to define the density gradients is very important For example not all choices provide for a dissipative diffusion operator The choice for reference points was made at the stage of discretizing the functional The crucial property that must be preserved in order to derive a dissipative diffusion operator is the sign definiteness of the functional since this object is the source for the tracer variance tendency see equation B 12 Preserving the sign definiteness is trivial when choosing reference points at the stage of discretizing the functional but is more difficult and generally not preserved if choosing these points at a later stage of the derivation The details for choosing these points are given in Section B 2 6 from the perspective of the functional For the present purposes it is sufficient to spell out the grid stencil used for the small angle flux F since the full tensor and other flux components have similar stencils Figure B 4 shows this stencil as implied by the formula Fz ginal KU oT kj 1 1 1 MEM Y pus AGT PMD i Eli ip k 1 kr j 4421 kr 0 0 1 62 Ti pip k 1 krj B 232 s zPitip k 1 kr j This flux is defined at the east face of the T cell k 7 which is located in between the T points i k j
153. 4 80 Bryan K 1969 Climate and the ocean circulation The ocean model Monthly Weather Review 97 806 827 Bryan K and M D Cox 1972 The circulation of the world ocean A numerical study Part I A homogeneous model Journal of Physical Oceanography 2 319 335 Bryan K 1975 Three dimensional numerical models of the ocean circulation In Numerical Models of Ocean Circulation National Academy of Sciences Washington D C Bryan K 1979 Models of the world ocean Dynamics of Atmospheres and Oceans 3 321 338 Bryan K and L J Lewis 1979 A water mass model of the world ocean Journal of Geo physical Research 84 2503 2517 Bryan K and J L Sarmiento 1985 Modeling ocean circulation Advances in Geophysics 28a 433 459 Cox M D 1975 A baroclinic numerical model of the world ocean preliminary results In Numerical Models of Ocean Circulation National Academy of Sciences Washing ton D C Cox M D 1984 A primitive equation 3 dimensional model of the ocean GFDL Ocean Group Technical Report No 1 328 APPENDIX D REFERENCES Cox M D 1989 An idealized model of the World Ocean Part I The global scale water masses Journal of Physical Oceanography 19 1730 1752 Danabasoglu G and J C McWilliams 1995 Sensitivity of the global ocean circulation to parameterizations of mesoscale tracer transports Journal of Climate 8 2967 2987 England M H 1993 Representing the global
154. 7 matrix sections The purpose of option matriz sectionsis mainly for debugging It is useful when trying to look at numbers as the model integrates Various quantities are printed in matrix form as a function of longitude x and depth 2 for specific latitudes The latitudes and ranges of longitudes and depths for limiting the printout are input through namelist Refer to Section 5 4 for information on namelist variables The output from this diagnostic is written as ascii to the model printout file and there is no NetCDF capability The interval between output is specified by variable prazint 18 2 8 meridional overturning Option meridional overturning computes instantaneous values of a meridional mass transport stream function in units of cm sec This is useful in determining aspects of the thermohaline circulation k imt 1 U fjrow k 5 Wim jt COS Q i ou dtu dzim 18 51 1 i 2 The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file overturn dta If option netcdf or meridional overturning netcdf is enabled data is written in NetCDF format to file overturn dta nc rather than in unformatted IEEE The interval between output is specified by variable vmsfint and the control is specified by variable iovmsf 18 2 9 meridional tracer budget What are the dominant meridional balances if any in the model and how do they depend on time Option meridional trace
155. 8 23 226 CHAPTER 18 DIAGNOSTIC OPTIONS Buoyancy B lt grav adv vbt x lt grav vbt kj mage gt 18 24 Horizontal pressure gradients G lt gradpikin gt lt 18 25 The work done by the horizontal pressure gradients should equal the work done by buoyancy G B should be zero The imbalance G B is the energy conversion error which should be roundoff within machine precision On a Cray YMP with 64 bit words this amounts to the error being about 1x107 smaller than either term Mixing The work done by viscous mixing terms on the velocity is broken into two parts Di lt DIFF Urip t DIFF Uyg DIFF metricjpin gt lt DIFF t DIFFU Yi DIFF metrici y jn mt gt 18 26 D2 lt DIFF Uzr gt lt DIFF Uz gt 18 27 Wind and Bottom drag smfi SH lt smfign gt 18 28 W2 bmf gt lt Ibmh gt 18 29 The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file energy_int dta If option netcdf or energy_analysis_netcdf is enabled data is written in NetCDF format to file energy int dta nc rather than in unformatted IEEE The interval between output is specified by variable glenint and the control is specified by variable oglen 18 2 5 fct netcdf Option fct_netcdf is intended to show the difference between second order advection of tracers and
156. 9 A global ocean atmosphere climate model with seasonal variation for future studies of climate sensitivity Dynamics of Atmospheres and Oceans 3 393 426 Manabe 5 and R J Stouffer 1988 Two stable equilibria of a coupled ocean atmosphere model Journal of Climate 1 841 866 Manabe S Bryan and M J Spelman 1990 Transient response of a global coupled ocean atmosphere model to doubling of atmospheric CO2 Journal of Physical Oceanography 20 122 149 Manabe S J Stouffer M J Spelman and Bryan and M J Spelman 1991 Transient responses of a coupled ocean atmosphere model to gradual changes of atmospheric Part I annual mean response Journal of Climate 4 785 818 Manabe 5 M J Spelman and R J Stouffer 1992 Transient responses of a coupled ocean atmosphere model to gradual changes of atmospheric Part I Seasonal response Journal of Climate 5 105 126 329 Manabe 5 and R J Stouffer 1994 Multiple century response of a couple ocean atmosphere model to an increase of atmospheric carbon dioxide Journal of Climate T 5 23 Philander G P T Yamagata and R C Pacanowski 1984 Unstable Air Sea Interactions in the Tropics Journal of Atmospheric Sciences 41 604 613 Philander G P R C Pacanowski N C Lau and M J Nath 1992 Simulation of ENSO with a Global Atmosphere GCM Coupled to a High Resolution Tropical Pacific Ocean GCM Journal of Climate 5 308 329
157. 995 The energetics of interannual variability in the tropical Pacific Ocean Program in Atmospheric and Oceanic Sciences Thesis Princeton University Goloviznin V M Samarskii A A and A P Favorskii 1977 A variational approach to constructing finite difference mathematical models in hydrodynamics Sov Phys Dokl 22 432 434 Griffies 5 M A Gnanadesikan C Pacanowski and V Larichev 1996 Towards an adiabatic realization of isopycnal diffusion in a z Coordinate ocean model in preparation Haltiner G J and R T Williams 1980 Numerical Prediction and Dynamic Meteo rology Wiley Hamming R W 1977 Digital Filters Prentice Hall 317 Hankin 5 and M Denham 1994 FERRET An Analysis Tool for Gridded Data Users Guide Version 3 1 NOAA PMEL TMAP Hanson J and C L Lawson 1969 Extensions and applications of the Householder algorithm for solving linear least squares problems Math Comput 23 181 812 Held I M and V D Larichev 1996 A scaling theory for horizontally homogeneous baro clinically unstable flow on a beta plane Submitted to Journal of Atmospheric Sciences 53 946 952 Large W G J C McWilliams and 5 C Doney 1994 Oceanic vertical mixing A review and a model with a nonlocal boundary layer parameterization Rev of Geophys 32 363 403 Larichev V D and I M Held 1995 Eddy amplitudes and fluxes in a homogeneous model of fully developed baroclinic instab
158. As outlined in Section 5 1 operators are used to construct various terms in the tracer and momentum equations They are implemented as statement functions requiring no storage and their details are expanded out in Sections 11 11 5 and 11 10 7 It is important to note that for operators to work correctly all items buried within the details of the operator must be defined correctly at the time when the operator is used As with variables operators also have a placement on the grid as explained below 5 3 1 Tracer Operators The details of the following operators used in solving the tracer equations are defined in file fdift h e ADV Tr i the flux form of the zonal x advection of tracer defined on the k jrow grid point Units are in tracer units per second e ADV the flux form of the meridional y advection of tracer defined on the Ti k jrow grid point Units are in tracer units per second e ADV Tz i flux form of the vertical z advection of tracer defined on the T k jrow grid point Units are in tracer units per second e ADV Tziso counterpart to ADV Tz using the Gent McWilliams advective velocity which comes from parameterizing the effect of mesoscale eddies on isopycnals Only used when option gent mewilliams is enabled Units are in tracer units per second e ADV Tyiso the counterpart to ADV k using the Gent McWilliams advective velocity which comes from parameterizing the eff
159. B 3 3 Rescaling the along isopycnal diffusion coefficient 306 B 3 4 Vertical diffusion equation 22A 306 B 3 5 Diabatic piece aoaaa 306 B 3 6 Highlighting the different average operations 307 C A note about computational modes 313 D References 315 D 0 7 References used in the manual 315 D 0 8 Numerical aoaaa 319 D 0 9 General modeling issues 321 D 0 10 Sub Grid Scale Parameterization 321 D 0 11 General Numerical Oceanography Eddy Resolving 323 D 0 12 General Numerical Oceanography Non eddy resolving 324 D 0 13 Tracers 324 D 0 14 Atlantic and High Latitude 325 D 0 15 326 D 0 16 Southern Ocean 327 D 0 17 Global 327 D 0 18 Coupled 328 xviii CONTENTS List of Figures 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 6 1 7 1 7 2 7 3 7 4 9 1 10 1 10 2 10 3 10 4 11 1 11 2 11 3 19 1 B 1 B 2 B 3 Various ways to slice a three dimensional volume Basic Dataflow when unitaskig Anatomy of a Memory Window les Minimum size Memory Window with jmw 3
160. CRAY T90 as well as distributed systems like the CRAY T3E Remaining details are currently being worked out Bingo Parallel efficiency Refer to Figure 3 11 which schematically shows the difference between code structures Let the coarse grained approach be viewed as the MOM 1 code structure although MOM 2 can simulate this and the fine grained approach be viewed as the MOM 2 code structure In the coarse grained approach MOM 1 coding the parallel region shown in red is the latitude loop which wraps around all of the dynamics and physics This work can be reduced to a succession of doubly nested do loops as indicated where the scalar region is marked in blue and the vector region is marked in green on the a PVP Parallel Vector Processor like the CRAY YMP Each processor gets all the work for one latitude row and all processors work simultaneously on separate latitudes Since the parallel loop contains the totality of doubly nested do loops there is no shortage of work for any processor To insure a static load balance jmt 2 should be an integral multiple of the number of processors otherwise some will stand l lhis is done to conserve memory However it is an interesting counter intuitive point that sometimes it is better to do redundant calculations rather than save intermediate results in temporary work arrays Depending on the speed of the load and store operations compared with the multiply and add operations if redundant computatio
161. DF format capability to new diagnostics Routines within directory MOM 2 NETCDF need to know which computer platform they are being used on This information is supplied through preprocessor ifdef options as in MOM 2 Scripts run mom and run mom sgi set the computer platform option and based on this choice adds options needed for routines within directory MOM 2 NETCDF Using the high level interface In general each NetCDF file needs dimensional information indicating the total number of variables to be written to the NetCDF file the total number of axes used and the size of the longest axis For instance if arrays A imt jmt and B imt jmt were to be written periodically in time then the total number of variables would be two the total number of axes would be three longitude latitude and time and the longest axes would be either the first or second depending on the sizes of imt and jmt The time axis is infinitely extendible and doesn t count in this respect Typically this information is prescribed for each diagnostic by the following code parameter ndimsout 4 nvarsout 2 mxdimout max imt jmt km where ndimsout is the total number of axes to be used longitude latitude depth time etc nvarsout is the total number of variables to be written and mzdimout is the size of the longest axis imt jmt km If a mistake is made in defining any of the above parameters an error message will point back to the offending paramet
162. DSM approach is to define an auxiliary velocity and V in terms of a time difference of surface pressure Aps and vertically averaged velocities U and V as follows a m 1 6 1 ULL 2AT 6 APS jrow 16 27 cos jrow Vi jrow V 2Ar 16 28 DSL jrow 16 29 The momentum equations can then be re written in terms of and V as l z AL 3 Lew gyal Uijrow UT 28 TwSs Apsi tjrow 1 16 30 1 jrow Tau U row WU jrow T VI 16 31 1 e Ui jrow 2AT ZUi 6 P87 oua 16 32 cos 2AT 2Uijrow 2 6l PS 16 33 ZU jrowl f gcor m t 1 gcor eu Gi jrow 1 16 34 2Uijrow2 Ulp 1 geor Uti Gi jrow 2 16 35 where w 2Ar acor f and the forcing terms Gj jrow 1 and Gj jrow contain all remaining terms which are known If solving the Coriolis term explicitly acor 0 then gcor 1 otherwise gcor 0 for implicit treatment acor gt 1 2 Single Instruction stream Multiple Data streams 208 CHAPTER 16 EXTERNAL MODE OPTIONS Equations 16 30 and 16 31 can be solved if terms involving Aps are dropped The justification given by DSM is that these terms are the same order of magnitude as the time truncation error which is O 7 This is the operator splitt
163. E unformatted data formatted ascii text or both depending on the value of a control variable specific to the particular diagnostic The record structure of any non netcdf diagnostic file can be found by examining the sections of MOM 2 which write the data This information is also embedded in header records When writing native unformatted data records in MOM 2 each data record is preceded by a header record of the form write iounit stamp iotext expnam Where stamp is a 32 character specification of the model date and time corresponding to the time stept when the data was written iotezt is an 80 character description of what is in the data record and how it is to be read and expnam is a 60 character experiment name which identifies an experiment that wrote the data All 32 bit IEEE unformatted diagnostic datasets in MOM 2 have this structure This makes it easy to decipher any unformatted output from MOM 2 The following program is intended as an example of how to decphfer any MOM 2 unformatted diagnostic output file and is intended to run on a workstation Program decifer character 32 stamp character 80 iotext character 60 expnam character 30 filename iounit 21 filename snapshots dta Set the file name Other files have the same dta suffix but are not 32 bit IEEE data Refer to Section 19 7 for details For datasets which are averaged through time this stamp corresponds to the end of each averaging period The length of e
164. FDL MOM 2 is intended to execute reasonably well on a variety of computers However optimizing for the idiosyncrasies in computer environments outside GFDL is left to the researcher As in the Cyber 205 experience It is reassuring that the ideas influencing the design of MOM 2 have not significantly altered speed when compared to MOM 1 Early comparisons were carried out using the standard test case resolution of 4 by 3 and 2 CHAPTER 1 DESIGN PHILOSOPHY the business of compilers and better algorithms not physical scientists playing games to beat compilers Two philosophies of model building can be summarized by first stating the intent and then asking a question 1 The aim is to do as much science as possible with this model Now how can it be made to execute as fast as possible 2 The aim is to make this model execute as fast as possible Now what science can be done with it MOM 2 is the result of focusing on the first 1 1 2 Flexibility To be a useful research tool MOM 2 needs to be easily configurable in many different ways Also of importance is access to a large number of parameterizations for intercomparisons within the framework of one model Using preprocessor ifdefs gives this flexibility However indis criminant use of preprocessor ifdefs can lead to a tangled mess of limited usefullness 1 1 3 Modularity MOM 2 is continually being infused with new ideas and the resulting growth can present pro
165. Fa A 21 The skew flux is directed orthogonal to the local tracer gradient since Fa FTO T A 0 TO T 0 A 22 A 1 2 Tracer moments Multiplying the tracer equation 0 4 4 VIT On JO T A 23 by T t where is some positive integer yields ur TN 10 JT A 24 OUT mna T o TNT I TJO A 25 In Sp TN N 1 T 78 0 J 26 The time tendency is therefore given by OTN V T 48 J7 0 T N N D T Om TO TJ A21 V FrTN dgTN N N DTN 0 TO TK A 28 where the flux pm Jmng T A 29 30 A 31 was introduced Note that the above steps assumed a divergence free velocity field V 0 and the identity A 7 A O TO T 0 was employed Integrating the previous equation over some domain yields J di TY di v ETN N N DPN KI TOT A 32 268 APPENDIX A TRACER MIXING KINEMATICS Stokes Theorem brings this expression to a dz TN jaa FON aT N N 1 az PN 2 Knp TO T A 33 where is the outward normal to the boundary Assuming the normal velocity vanishes at the domain boundary 0 yields for the time tendency of the globally integrated N th tracer moment J d TN faa Fe Fa TY N N az TOT ABA It is of interest to consider some special cases First consider the case with no diffusive mixing which means there is a zero symmetr
166. M 2 e generate a grid generates a grid based on specifications in the USER INPUT section of module grids It is used both in the script run_grids and when executing MOM 2 7 4 SUMMARY OF OPTIONS 81 e read my grid allows grids developed elsewhere to be imported into MOM 2 write my grid writes a copy of the grid information to file grid dta out e centered 1 constructs a grid using method 1 from Section 7 2 3 If not enabled the grid is constructed using method 2 from Section 7 2 3 which is different than the way it has been constructed in previous versions of the model 82 CHAPTER 7 GRIDS rgia cn the Surface Figure 7 1 Grid cell arrangement on a horizontal longitude latitude surface 7 4 SUMMARY OF OPTIONS A regicn cn the A Z Surface Ou 1 1 1 1 1 nt cell Us Vk jnt eap gt Figure 7 2 Grid cell arrangement a vertical longitude depth surface 83 84 CHAPTER 7 GRIDS A regicn cn the Z Surface cell Ux 1 1 1 Vakdar j 1 1 1 uz gt n Figure 7 3 Grid cell arrangement on a vertical latitude depth surface 7 4 SUMMARY OF OPTIONS 85 Grid points within non uniform grid cells dzw 4 dz Ua Figure 7 4 Comparison of two grid cell construction methods applied in the vertical dimension 86 CHAPTER 7 GRIDS Chapter 8 Grid Rotation A grid rotation is one of the simplest types of grid transformations that can
167. MOM 2 Version 2 0 5 Documentation User s Guide and Reference Manual Edited by Ronald C Pacanowski Release date Nov 7 1996 GFDL Ocean Technical Report 3 2 0 1 Introduction A bit of history The GFDL Modular Ocean Model acronym MOM 2 is a three dimensional primitive equation ocean model based on the pioneering work of Kirk Bryan 1969 Early Fortran implementations of Bryan s ideas were carried out chiefly by Mike Cox in Washington D C during the late 1960 s on IBM 70301 stretch and then a CDC 6600 computer Cox continued those developments by constructing a global model at GFDL on a UNIVAC 1108 Bert Semtner converted that model to execute on Princeton University s IBM 360 91 in 1970 and both codes were in use through 1973 with Semtner s version surviving for use on an interim IBM 360 195 in 1974 While at GFDL and UCLA Semtner 1974 rewrote the model to take advantage of the instruction stack on the IBM 360 195 and also with future vector architectures in mind The first vector machine to arrive at GFDL in 1975 was a four pipeline Texas Instru ment ASC acronym for Advanced Scientific Computer and the model of Semtner 1974 was used as the starting point for further conversion efforts by Cox and Pacanowski After the ASC Cox abandoned the ASC version of the model in favor of Semtner s latest version and optimized it for the CDC Cyber 205 which required very long vector lengths for efficiency Actually the
168. OS NEW MOM_2 SBC ATMOS gt diffs atmos diff e MOM 2 NETCDF NEW MOM_2 NETCDF gt diffs netcdf diff e MOM_2 EXP TEST_CASE MOM_UPDATES NEW MOM 2 EXP TEST CASE MOM UPDATES gt diffs momupdates diff e MOM_2 EXP TEST_CASE PREP_UPDATES NEW MOM 2 EXP TEST CASE PREP UPDATES gt diffs prepupdates How to apply changes from diff e It is sometimes useful to construct a newfile from an oldfile plus changes If the changes were constructed from diff e oldfile newfile gt changes then the newfile can be constructed from the oldfile using the following C shell script bin csh f if 3 then echo update builds newfile from oldfile using changes echo usage update oldfile changes newfile exit endif set oldfile 1 set chgs 2 set newfile 3 set work temp cat chgs gt work echo w newfile gt gt work echo q newfile gt gt work ed oldfile work bin rm work 19 17 Registration for MOM 2 MOM 2 is free Basically nothing to do except send in your e mail address if you are not already on the mailing list The mailing list is kept in the same directory as MOM 2 and will be updated as needed The purpose of the list is to inform researches of changes to MOM 2 If no longer interested please request that your name be removed from the list 264 CHAPTER 19 GETTING STARTED MM Directory Structure OTHERS Figure 19 1 Directory structure
169. P ab 16 20 where superscript indicates the cell to the north of cell with index i jrow 1 superscript ne indicates the cell to the northeast of cell with index i 1 jrow 1 and so forth Superscript o refers to the the Cth cell with index i jrow The central coefficient C7 is related to the surrounding coefficients by e CR CP CP CY CF CP 16 21 An island equation is generated by summing Equation 16 20 over all cells within an island including coastal ocean perimeter cells At each cell within the island proper the left hand side of Equation 16 20 is zero because of Equation 16 21 and the condition that d Y y constant 16 22 After summing over all cells within the ocean perimeter and island proper the only locations with non zero contributions to the left hand side sum are ocean perimeter cells This can be expressed as the sum of L times nine products where subscript runs from 1 to L which is the number of island perimeter cells L SC vf LOCO PLC vpTCPO f 1 L pe CP p be CT vi std 16 23 f 1 Without loss of generality all coefficients adjacent to land cells on the left hand side may be set to zero which leaves only the island stream function 4 and values of w exterior to the island perimeter Indeed this is the very reason that reciprocals of H are set to zero on land which zeroes
170. Part I Journal of Computational Physics 1 119 143 Arakawa A and V R Lamb 1977 Computational design of the basic dynamical processes of the UCLA general circulation model Methods in Computational Physics 17 114 265 Bryan K 1969 A numerical method for the study of the circulation of the world ocean Journal of Computational Physics 4 347 376 Boris J P D L Book 1973 Flux corrected transport I SHASTA A fluid transport algorithm that works Journal of Computational Physics 11 38 69 Brown J A K A Campana 1978 An economical time differencing system for numerical weather prediction Monthly Weather Review 106 1125 1136 Chervin R M and A J Semtner Jr 1990 An ocean modeling system for supercomputer architectures of the 1990s Climate Ocean Interactions M E Schlesinger Ed Kluwer Academic 87 95 Cox M D 1984 A primitive equation 3 dimensional model of the ocean GFDL Ocean Group Technical Report No 1 Cox M D 1987 Isopycnal diffusion in a z coordinate ocean model Ocean modeling T4 1 5 Dukowicz J K R D Smith and C Malone 1993 A reformulation and implementation of the Bryan Cox Semtner ocean model on the connection machine Journal of Atmospheric and Oceanic Technology 2 195 208 Dukowicz J K and R D Smith 1994 Implicit free surface method for the Bryan Cox Semtner ocean model Journal of Geophysical Research 99 7991 8014 320 APPENDIX D REFE
171. RENCES Gerdes R C K berle and J Willebrand 1991 T he influence of numerical advection schemes on the results of ocean general circulation models Climate Dynamics 5 211 226 Gerdes R 1993 A primitive equation ocean circulation model using a general vertical coor dinate transformation 1 Description and testing of the model Journal of Geophysical Research 98 14683 14701 Haltiner G J and R T Williams 1980 Numerical Prediction and Dynamic Meteo rology Wiley Killworth P D J M Smith A E Gill 1984 Speeding up ocean ciruclation models Ocean Modeling UNPUBLISHED MANUSCRIPT 56 1 5 Killworth P D 1987 Topographic instabilities in level model OGCM s Ocean Modeling UNPUBLISHED MANUSCRIPT 75 9 12 Killworth P D D Stainforth D J Webb and 5 M Paterson 1991 The development of a free surface Bryan Cox Semtner ocean model Journal of Physical Oceanography 21 1333 1348 Korshiya T K Tishkin V F Favorskii A P and M Y Shashkov 1980 Flow variational difference schemes for calculating the diffusion of a magnetic field Sov Phys Dokl 25 832 834 Mesinger F and A Arakawa 1976 Numerical methods used in atmospheric problems Vol 1 WMO ICSU Joint Organizing Committee GARP Publications Series No 17 64 pages Pacanowski R C K Dixon and A Rosati 1991 The GFDL modular ocean model user guide The GFDL Ocean Group Technical Report No 2 Geophysical Fluid Dynamics
172. Rosati but is not yet ready Questions should be directed to Tony ar gfdl gov Section 15 14 3 contributed by Tony Rosati ar g f dl gov 15 14 4 tcvmix This is a basic scheme which supplies values for vertical mixing coefficients km and based on the second order turbulence closure scheme of Mellor and Yamada level 2 5 as given in Rosati and Miyakoda 1988 The scheme is being implemented by Tony Rosati but is not yet ready Questions should be directed to Tony ar gfdl gov 174 CHAPTER 15 GENERAL MODEL OPTIONS Section 15 14 4 contributed by Tony Rosati ar g fdl gov 15 15 Horizontal sub grid scale mixing schemes The following options parameterize the way in which momentum and tracers are mixed hori zontally in the ocean One and only one of these options must be enabled Refer to Section 15 16 for additional hybrid mixing schemes ones that mix tracers but not momentum 15 15 1 consthmix This is a basic mixing parameterization that uses constant values for horizontal mixing coeffi cients m and in Equations 2 8 2 9 2 3 and 2 4 These constants are implemented on the eastern and northern faces of U and T cells as diff_ceu Am 15 48 diff cnu Am 15 49 diff cet 15 50 diff_cnt 15 51 Note that there are no subscripts on the mixing coefficients since these are independent of space For reasons of computational speed these mixing coefficients are incorporated with grid factors whe
173. ST OF DIAGNOSTIC OPTIONS 245 nhreg m 1 TO M M Toss Areal 18 153 km Areal 4 gt k nhreg Area o 5 Area m 18 154 mal where Areal o is the total area of all regions at level k In a likewise manner the tracer flux through the ocean surface for tracer n as a function of region number m is given by 1 imt 1 jm 1 Stfmn St hii jrow 18 155 Arca 1 2 jrow 2 1 nhreg sf STF ing Areal n 18 156 o L The output from this diagnostic is written as ascii to the model printout or as 32 bit IEEE unformatted data to file tracer avg dta If option netedf or tracer averages netedf is enabled data is written in NetCDF format to file tracer avg dta nc rather than in unformatted IEEE The interval between output is specified by variable tavgint and the control is specified by variable iotavg Note that the regional mask mskhr j owis also written to file tracer avg dta when the initialization boolean itavg is true It should be set true on the first run but false thereafter 18 2 24 tracer_yz Option tracer yz computes instantaneous values of the zonal integral of the tracer and tracer equation term by term for each component Contraction of the tracer equation along longitude yields a two dimensional equation as a function of latitude and depth Using operators described in Section 11 10 7 yields imi l D 2 Mi grow r gt 2 ATI growl AD
174. T points are always centered within T cells but U points are off center when the grid is non uniform This was the method used in model versions prior to MOM 2 In method 2 the construction is the other way around T cell size is the average of adjacent U cell sizes Accordingly U points are always centered within U cells but T points are off center when the resolution is non uniform It should be noted that MOM 2 allows both methods Although the default grid construction is by method 2 enabling option centered_t when compiling will result in grid construction by method 1 Accuracy of numerics When resolution is constant the finite difference numerics are second order accurate In this case grid cells and grid points are at the same locations regardless of whether they are constructed using method 1 or method 2 However contrary to widespread belief when reso lution is non uniform numerics are still second order accurate if the stretching is based on a smooth analytic function See Treguier Dukowicz and Bryan 1995 Even though methods 1 and 2 are second order accurate is one slightly better than the other In particular does the horizontal staggering of grid cells implied by method 2 give slightly better horizontal advection of tracers while the staggering implied by method 1 give more accurate horizontal advection of momentum Also since T cells and U cells are not staggered in the vertical does method 2 gives more accurate vertica
175. TET e Te Y AYT 2 3 SEES kh S V 2 4 w ug 088 2 5 p pg 2 6 p p T S p 2 7 where horizontal friction advection and horizontal diffusion are given by Ag Vu Ay Ea tae 2900 my 2 8 a a cos F 1 tan 2sin uy P As Vv T An a2 Poste 2 9 1 1 Lla Toco UAH Tosg 999979909 0079 2 10 1 Va 2 cos o cosg C 2 11 f 29sin 2 12 In the above equations T and 5 are potential temperature and salinity v w are the zonal meridional and vertical velocities p is the pressure p is the potential density g is the mean gravity 980 6 cm sec a is the mean radius of the earth 6370 x 10 Km and are Potential temperature is used because local stability is dependent on potential density gradients Also in an adiabatic ocean both salinity and potential temperature are materially conserved active tracers 2 2 KINETIC ENERGY BUDGET 7 vertical eddy viscosity and diffusivity coefficients em sec Am and Aj are horizontal eddy viscosity and diffusivity coefficients cm sec and Q ec is taken as the earth s LT jg rotation rate If coefficient A is not spatially constant the additional viscous terms of Wajsowicz 1993 are accounted for These equations are solved within MOM 2 by dividing the ocean volume into a three dimen sional lattice of rectangularly shaped cells of arbitrary size
176. Ti 1 76 1 2 iq dYUj jq cos Y Pitip jtia jq 1 ip 7 1 24 434 34 Pitipj iq 2 7 79 y Pi ipd jq 6 2 qdzt cos 0 8 p 2 3429 1 7 1 1 yTij yT 5 16 1 749 diui cip v Tips iabuDi pa itia 6 x 1 i ip j yPitip i ia 2 6 UE id ip 3 x 0 E i ip j pj ig sPi y yc epe Uitip Y jq 1 534 34 Pitinj iq Pre DIAM 22 7429 y G3 32 Pitip jt iq X x 79 0 iita 3 3 8 207 2Pijtiq y In order to identify a difference operator in the first term of equation B 207 let the label ip run from 0 to 1 and adjust the label accordingly With this shift the first and second terms take the form AS 4 cos pen ODE s Ti 1 j ypi 14 gt dyu Lj cos Y 1 Hipi __ 1 7 29 nya 4 4 cos p pen 6 1 56 aur t ip j yPitipjtiq 8 1 ip 5 cos gt 1 6p vPj 1 iiy atja 20 1 7 yPi1 ip j iq 1 i 14ip j yPi 1 ip jtiq X 0 1 F tipi g yli l cip Fjq i 1l cip j JJ i ip j WM X 0 Ti 1 2 7 279 id ip 3 2 In order to cente
177. ULARITY for times up to about 5 million years using 32 bit integers On 64 bit computers time can be tracked to an accuracy of one millisecond for a period longer than the age of the universe The time manager is divided into two sections one increment time is a clock and calen dar which integrates model time forward by one time step each time it is called the other set_time_switches calculates when specific events e g saving snapshot data reading bound ary condition data etc will take place based on the model time and intervals or averaging periods set by the researcher Logical Boolean Switches Once model time corresponding to the current time step has been calculated by module tm ngr a long list of logical variables are set based on input variables specified by the researcher and the current model time The logical variables act as switches which indicate whether spe cific events diagnostics mixing time steps end of month end of week Tuesday etc will happen or not during the current time step Include file switch h contains all logical switches along with a long list of input variables used by the researcher to specify the interval in days between various requested events or the period in days for averaging diagnostic quantities The list of input variables can be accessed through namelist and each input variable must have an associated logical switch The logical switch is set to true when within half a ti
178. Uzik j the flux form of the vertical z advection of momentum defined on the Ui jrow grid point Units are in cm sec e ADV metric jn the metric term for momentum advection defined on the U k jrow grid point Units are in cm sec DIFF Uz the flux form of the zonal x diffusion of momentum defined on the Ui jrow grid point Units are in em sec DIFF Uy the flux form of the meridional y diffusion of momentum defined on the Ui k jrow grid point Units are in cm sec e DIFF_Uz p the flux form of the vertical diffusion of momentum defined on the Ui k jrow grid point Units are in cm sec e DIFF metric jn the metric term for momentum diffusion defined on the U k jrow grid point Units are in cm sec e CORIOLIS k jn Coriolis term defined on the U k jrow grid point Units are in cm sec 5 4 Namelist variables Although MOM 2 is configured in various ways using UNIX cpp options the value of many of the variables and constants within MOM 2 and its parameterizations are defaulted and their values can be over ridden using namelist input Included below are the variables input through namelists categorized by namelist name 9 T his is the explicit portion of indicated in 15 16 3 when option isopyc is enabled If option implicitumix is enabled then it is the explicit part of the vertical diffusion These are the and K tensor components indicated in Section 15 16 3 1f option implicit
179. V Tz ADV T yis Qo ma Mt 2 jrow DIFF Tz DIFF jJ o imti 4 T2 2 AT k jrow SOUTCELI 18 157 where n is the tracer and the relation between j and jrow is as described in Section 5 2 The zonal advection and diffusion are not shown because they are eliminated by the summing operation The length element and total length are given by AT tmask k jrow dat 18 158 imi l Li jrow X ATi 18 159 i 2 246 CHAPTER 18 DIAGNOSTIC OPTIONS Each sum in Equation 18 157 is output as one data field along with the zonally averaged tracer The output from this diagnostic is only written in NetCDF format no option for IEEE to file tracer_yz dta nc The interval between output is specified by variable tyzint 18 2 25 trajectories using a forward time step and a Option trajectories integrates particles along trajectories particle velocity determined by instantaneous linear interpolation every time step Let n particles be placed at positions Pi z y z y 2 Pa v z y z at time t0 The position of the nth particle at time 11 is given as P z y z Vila y z dt 18 160 which is discretized as Pi az z Pile yz Ar Va ns 2 18 161 where V7 is the particle velocity at P7 z y 2 arrived at by linear interpolation from k j1 Uk 2 7 and adv vbt kj Particles are neutrally buoyant and are initially spread uniformly within an arbitrary
180. a and restrict m memory windows for use with m processors and coarse grained parallelism to access m adjacent latitudes Then there are 2 m 1 boundary rows that are redundant marked with an X Removing these redundant rows and compressing what remains leads to one memory window of size m 2 rows for use with m processors and fine grained parallelism Each component of the memory windows in Figure 3 10a is labeled Computed rows are of memory size C with a work area of size WC The boundary rows are of memory size B with work area of size WB D expresses the size ratio of work arrays to prognostic arrays for calculated rows and expresses the size ratio of work arrays for buffer rows to computed rows Let M1 represent the memory needed for m memory windows used with coarse grained parallelism and M2 represent the memory needed for the corresponding memory window equivalent using fine grained parallelism An expression for the ratio of memory sizes is given in Figure 3 10b The table gives the ratio MI as a function of number of processors m and D for a typical value of a i Note that the memory reduction is a strong function of m and a weak function of 6 What is not shown is that the memory reduction is also a weak function of for values that normally would be encountered The bottom line is that coarse grained parallelism takes twice as much memory on m 10 processors as fine grained parallelism and the same amount of memory for one p
181. abled when compiling under Fortran 77 15 3 Dataflow I O Options Various options for handling I O between disk and the memory window are available Each has its advantages and disadvantages as described in the following sections One and only one of these options must be enabled It should be noted that regardless of which option is used details are implemented at the lowest level routines This allows the higher level code structure in particular the reading and writing of data to remain the same for all options The I O manager assigns unit numbers for each file with appropriate attributes Refer to Section 6 2 4 for details 15 3 1 ramdrive This one is similar in concept to the usage of the word ramdrive in the IBM PC world It concerns configuring a portion of memory to behave like disk which speeds up programs that are I O intensive particularly when disks are relatively slow The catch is that there must be enough memory available to contain the disk data In MOM 2 this option defines a huge memory array and replaces all reads and writes to disk with copying variables into or out of locations in this huge array This is done at the lowest subroutine levels so that the higher level 15 4 PARALLELIZATION 155 routines look the same regardless of whether this I O option is used or not This option is not specific to any computer platform and therefore makes MOM 2 highly portable 15 3 2 crayio This option uses the CRAY specific wordio p
182. acer diffusion in the longitude direction at a given point is given by operator DIFF_Tx i k j These operators are defined in include files and may be located using the UNIX command grep as indicated in Section 19 5 5 2 The main variables 5 2 1 Relating j and jrow In MOM 2 variables dimensioned by the number of rows in the memory window jmw are referenced with index j So A k j would refer to an array dimensioned as A imt km jmw where the allowable range for index j is from 1 through 7mw Variables dimensioned by the total number of latitude rows in the grid jmt are referenced with index jrow So B i jrow would refer to an array dimensioned as B imt jmt where the allowable range for index jrow is from 1 through jmt In this manual A k j is written as and B i jrow is written as jrow to save space and make the equations more readable In general jrow j joff where offset joff indicates how far the memory window has moved northward Refer to Figure 3 4 and Section 3 3 2 for a description of how this works In MOM 2 whether an array is indexed by j or by jrow is dictated entirely by whether it is dimensioned by jmw or jmt 5 2 2 Cell faces As described below in addition to defining prognostic variables at grid points within T cells and U cells it is useful to define other variables on the faces of these cells This is because the equations are written in finite difference flux form to allow quantities to be
183. ach averaging period is also saved in this case 18 1 DESIGN 221 open iounit FILE filename FO0RM unformatted ACCESS sequential rewind iounit do n 1 100000 read iounit end 110 stamp iotext expnam read the header record write 1x a32 1x a80 stamp iotext show the header record read iounit skip the data record enddo 110 continue write End of file on filename on unit iounit stop end Note that when printed the header records give the Fortran statement needed to read the following data record In principal this presents an interesting concept Program decifer could write the Fortran program needed to read the data However details have not been worked out because there is a better approach and that is NetCDF format Recommendation Move over to saving NetCDF formatted data as soon as possible Eventually in an effort to minimize redundancy code for saving data in 32 bit IEEE format will be removed Newly added diagnostics do not have an option to write 32 bit IEEE format 18 1 3 Sampling data Depending on the particular diagnostic output may consist of instantaneous or time averaged data Instantaneous data is written out periodically on those time steps that fall nearest to the end of a specified interval For instance specifying a 30 day interval means that results are written out every 30 days from some specified reference time The reference time is also specified through namel
184. ack 15 82 M d dif f fnini Alani dif f cback 15 83 where di f f c back is an arbitrary background value Note that the fourth m in Equation 2 34 of Rosati Miyakoda 1988 should be m t 15 16 Hybrid mixing schemes Hybrid mixing schemes affect mixing of tracers but not momentum They may be enabled concurrently with one basic mixing option 15 16 1 bryan_lewis_vertical This is a hybrid mixing scheme Bryan Lewis 1979 which specifies the vertical diffusion coef ficient for tracers in Equations 2 3 and 2 4 as a depth dependent function given by dfkph T where afkph 0 8 cm sec dfkph 1 05 cm sec sfkph 4 5 107 and zfkph 2500 0x10 em These values imply a diffusivity coefficient ranging from 0 3 em sec near the surface of the ocean to 1 3 em sec near the bottom Values required for this option can be changed through namelist Refer to Section 5 4 for information on namelist variables diff_cbt afkph arctan sfkph zfkph 15 84 15 16 HYBRID MIXING SCHEMES 179 15 16 2 bryan lewis horizontal This is a hybrid mixing scheme Bryan Lewis 1979 which specifies the horizontal diffusion coefficient for tracers Aj in Equations 2 3 and 2 4 to be a function of depth given by 21 50000 0 with ahs 5 0 10 cm sec and ahs 1 0x10 Note that dif f_cet and dif f cnt are a function of only to conserve memory It should be noted
185. ackage to read and write data to and from disk As currently configured option crayio directs the iomngr to assign scatch files to CRAY solid state disk So solid state disk is assumed If the sds attribute is removed from the file specification then the files will reside on rotating disk 15 3 3 fio This option uses Fortran direct access I O to read and write data to and from disk It works on CRAY SGI workstations and presumably any other platform which supports Fortran direct access I O Record size is specified in words which is converted to bytes within the iomngr 15 4 Parallelization Currently there are two ways to parallelize MOM 2 The first is with autotasking which gives fine grained parallelism at the do loop level All that is required is to set the desired number of processors and open the memory window up as described in Section 3 5 1 The second is coarse grained parallelism which is enabled with an option 15 4 1 coarse_grained_parallelism Coarse grained parallelism is high level parallelism enforced at the level of the latitude rows rather than at the do loop level as in fine grained parallelism For details refer to Section 3 5 2 15 5 Grid generation How to design grids is detailed in Chapter 7 and the options are summarized below 15 5 1 drive_grids Script run grids uses option drive grids to execute the grids module in stand alone mode This is the recommended method for designing grids Option d
186. advection velocities in MOM 2 are computed at the centers of the eastern northern and bottom faces of the cells The velocities are given by adv vetiso k j adv kj and adv vbtiso p respectively In MOM 2 version 1 the eddy induced transport velocities were discretized based on the notes of Gokhan Danabasoglu who implemented the Gent McWilliams 1990 isopycnal parameterization as Z A 15 101 I adv velisojy i 184 CHAPTER 15 GENERAL MODEL OPTIONS A Z adv vntiso kj 6 Wl 15 102 However the above form contains a null mode and has been replaced by the following adv vetisoj kj 6 ArrH 52015 15 103 vntiso kj 6 ArrH 5 5 15 104 where Arry is the isopycnal thickness diffusion coefficient and the neutral slope in the zonal direction at the bottom of the eastern face of a T grid cell is given by 2 Ta A ikja Dus ikja 1 I m P 6 Bing Ossa and the neutral slope in the meridional direction at the bottom of the northern face of a T grid 5 15 105 cell is given by po 0 Unus Bos TL M r ODE ES eirca Bing Ollie i271 where the and are defined as in Section B 2 6 15 106 The vertical component of the isopycnal advection velocity is obtained by vertically integrating the divergence of the horizontal isopycnal advection velocities as is done in the notes o
187. ally increasing with increasing index 6 2 LIST OF MODULES A module contains e Collectian of subroutines within F file e Driver to exercise cmpornts e Irput Odput List include file e Details pushed into lower level subxoutines e Restricted camectivity Example F Example h Figure 6 1 Schematic idealization of the anatomy of a module in MOM 2 13 74 CHAPTER 6 MODULES AND MODULARITY Chapter 7 Grids Before constructing surface boundary conditions initial conditions or executing a model the model domain and resolution must be specified The specification takes place within mod ule grids which is contained in file grids F 7 1 Domain and Resolution The model domain which may be global is defined as a thin shelled volume bounded by six coordinates two latitudes two longitudes and two depths on the surface of a spherical earth Embedded within this domain is a rectangular grid system aligned such that the principle directions are along longitude measured in degrees east of Greenwich latitude measured in degrees north of the equator and depth zt measured in centimeters from the surface of the spherical shell to the ocean bottom Note that the vertical coordinate z increases upwards 7 1 1 Regions The domain may be further sub divided into regions each of which is similarly bounded by six coordinates two latitudes two longitudes and two depths Within each region res
188. always advectively dominated Therefore the upstream scheme might actually be less diffusive than the central differences scheme with explicit diffusion in the larger part of the model domain Central differences and upstream algorithms represent in a sense opposite extremes each minimizing one kind of error at the expense of another A linear compromise between both schemes may be useful in certain cases e g Fiadeiro and Veronis 1977 but will in general exhibit dispersive effects A nonlinear compromise is the flux corrected transport FCT algo rithm Boris and Book 1973 Zalesak 1979 A comparison of the central differences upstream and FCT schemes for oceanographic two and three dimensional examples is given in Gerdes et al 1991 Here the flux difference anti diffusive flux between a central difference scheme or any other higher order scheme and an upstream scheme is computed Adding the anti diffusive flux in full to the upstream flux would maximally reduce diffusion but introduce dispersive rip ples The central idea is to limit the anti diffusive flux locally such that no under and overshoots are introduced One possible criterion is to insist that from one time step to the next no new maxima or minima around one grid cell are created by advection As remarked by Rood 1987 the FCT is more a philosophy rather than an explicit algorithm as the crucial limiting step is essentially left to the user s discretion Depending on the cho
189. ance and the requirements on diffusion to suppress two grid point noise can be relaxed somewhat in three dimensions However the problem is indeed of great practical importance as shown among others by Weaver and Sarachik 1990 Gerdes et al 1991 Farrow and Stevens 1995 The upstream scheme is an equally simple advection scheme that is free from the dispersive effects mentioned above However it has very different numerical errors The main disadvantage of the only first order accurate scheme is its large amount of implicit diffusion Here one sided upstream differences are used to calculate the advective fluxes The upstream discretized advective diffusive balance in one dimension is U 4 0 U U _ 2 1 Ti Ta 2AT and the solution is as given above for the central differences scheme except that the grid P cl t Ua T 2Ti Tii 15 160 number is replaced by Pe 2U Ax 2A U Az 15 161 that is always less than two The truncation error of the advection scheme in multi dimensions is OT 5 5 09 ulAe 05A tuj uj 15 162 i ifj which can be interpreted as implicit diffusion with diffusion coefficients given by 0 5 uil Aa 15 163 For small time steps small compared to the maximum time step allowed by the CFL criterion the effective diffusion is such that the grid P cl t number is two It should be noted that the tracer balance is thus
190. and 1 j shown in Figure B 4 The two reference points to be used in computing this flux are at the T points i k j and i 1 3 The horizontal line represents the zonal density gradient which is computed both with reference to the amp point and to the 1 point The four vertical lines represent the four vertical density gradients which are computed with reference to the two corresponding points at level 306 APPENDIX B ISOPYCNAL DIFFUSION B 3 3 Rescaling the along isopycnal diffusion coefficient As discussed in Griffies et al 1997 prescriptions for dealing with the isopycnal fluxes when the isopycnal slopes go outside the bounds of the numerically stable regime are ad hoc The ad hoc nature of the rescaling is not surprising since the ability of the numerical grid to compute the diffusion operator with sufficient integrity breaks down for such isopycnal slopes Three prescriptions have been implemented in MOM2 to handle these limbo regions two for the small angle tensor and one for the full tensor Each prescription focuses on the x z y z z x and z y off diagonal components and rescales the diffusion coefficient for these terms independently and in a local manner thus introducing the four diffusion coefficients A A A and Local rescaling provides for a unique definition of the fluxes which is important in order to conserve the fluxes in the model To determine the value of each of the four diffusion
191. and MOM 2 EXP which in general contains a sub directory for each experiment Details of these sub directories are given below e PREP_DATA contains subroutines and CRAY T90 run scripts for extracting data from the DATABASE and interpolating it to arbitrary resolution for use as surface boundary conditions and initial conditions within MOM 2 Before this can be done the domain and resolution must first be specified in module grids as discussed in Chapter 7 The run scripts are In principle this DATABASE could be expanded to include other datasets but this has not been done as of this writing Model output may be composed of a printout file diagnostic files and restart data For example EXP ATLANTIC EXP PACIFIC EXP GLOBE Note that these interpolated datasets are only needed for test cases 1 and 2 Test cases 0 and 3 rely on internally generated data 9 All DATABASE data consists of a header record preceding each data record Included in each header is time stamp It contains the time corresponding to the instantaneous time at the end of the averaging period It also contains a period which refers to the length of the time average As an example a time stamp of m d y 2 1 1900 h m s 0 0 0 points to the beginning of the 156 day of Feb on year 1900 A period of 31 days for this record means that the data 1s average over the preceding 31 days i e it is an average for January 254 CHAPTER 19 GETTING STARTED run
192. anded out The big difference is that the former is easier to understand and work with for humans Instead of using operators all terms in the equations could be computed once and stored in arrays This would allow less redundant calculation but be prohibitive in memory usage It is an 43 44 CHAPTER 5 VARIABLES interesting counter intuitive point that it is sometimes faster to do redundant calculation rather than save intermediate results in arrays Depending on the speed of the load store operations compared with the multiply add operations if redundant computation contains little work it may be faster to compute redundantly In practice this depends on the computer and compiler optimizations This can be verified by executing script run timer which exercises the timing utilities in module timer by solving a tracer equation in various ways It is one measure of a mature compiler when the speed differences implied by solving the equations in various ways is relatively small On the CRAY YMP the differences are about 1096 whereas on the SGI workstation they can exceed 50 Within operators capital letters are reserved for the intended operation and small letters act as qualifiers A list of abbreviations is given below p lt ADV T Advection of tracer longitude direction DIFF_T Diffusion of tracer latitude direction ADV_U Advection of velocity z vertical direction DIFF_U Diffusion of velocity lt As an example tr
193. ant place to begin a derivation of the kinetic energy equation _ w tan DA OU L te Vu wu ween PA ge FY 2 1 ET d Vu fot ap cosg uz 2 18 2 2 ci Ven c fu RIT L PE ee F 2 19 where u v is the horizontal current and the frictional terms F F F were defined in Equations 2 8 and 2 9 For the following it will be useful to note the gradient Ep P Dna p 2 20 Vp and continuity equation which is the vector form of Equation 2 5 V 0 ux v cos wz 0 2 21 a cos Also note that for the scalings relevant to the primitive equations the kinetic energy per unit volume is dominated by the contribution from horizontal currents e al 24 y 2 22 Taking the scalar product of p u v with the horizontal momentum equations 2 18 and 2 19 yields e Ve T Vp d po F Po U Ka uz s po V Kus 2 23 The time tendency of the kinetic energy is therefore determined by the combined effects of the advection of kinetic energy Ve wez the work done by pressure Vp and the change in energy due to frictional forces F Fey Po U KmUz 2z po v Kg 2 Po Po Km Uz z po Em tz 2 24 Using the continuity equation 2 21 and hydrostatic relation p gp the local kinetic energy budget becomes e VW ed ew 0
194. antic Journal of Physical Oceanography 24 91 107 Bryan F 1986 High latitude salinity effects and interhemispheric thermohaline circulations Nature 323 301 304 Bryan F O 1987 Parameter sensitivity of primitive equation ocean general circulation models Journal of Physical Oceanography 17 970 985 Bryan F O and W R Holland 1989 A high resolution simulation of the wind and thermo haline driven circulation in the North Atlantic Ocean In Parameterization of Small Scale Processes Proceedings of the Fourth Aha Huliko a Hawaiian Winter Workshop edited by P M ller and G Holloway University of Hawaii at Manoa 99 115 Bryan F O C W B ning and W R Holland 1995 On the midlatitude circulation in a high resolution model of the North Atlantic Journal of Physical Oceanography 25 289 305 D scher R C Boning and P Herrmann 1994 Response of circulation and heat transport in the North Atlantic to changes in thermohaline forcing in Northern Latitudes model study Journal of Physical Oceanography 24 2306 2320 Hughes T M C and A J Weaver 1994 Multiple equilibria of an asymmetric two basin ocean model Journal of Physical Oceanography 24 619 637 Moore A M and C J C Reason 1993 The response of a global general circulation model to climatological surface boundary conditions for temperature and salinity Journal of Physical Oceanography 23 300 328 Power 5 B and R Kl
195. archer specifies the interval e g glenint for diagnostic output in units of days through namelist tmngr sets the corresponding logical switch e g glents every time step 12 interval must be referenced to a starting time which may be specified as the beginning of the experiment the beginning of a particular job or a specific date in time Each event may have its own interval and averaging period 6 2 LIST OF MODULES 69 It is set to true when within half a time step of the requested interval otherwise it is false All decisions relating to the interval e g glenint are based on the logical switch e g glents The following statement placed inside the time manager in the section for switches based on an interval will calculate the logical switch glents alarm iglenint ihalfstep glenint iref In the above variables ihalfstep and iref are calculated internally by the time manager Switch glents is updated every time step and is available anywhere in MOM 2 by including file switch h in the routine where the switch is needed Switches based on an interval and averaging period Suppose the intent was to compute 5 0 day averages of XB T s every 30 0 days The following five variables would be added to the common block in file switch h Let gbt be the mnemonic for XBT s then the naming convention used in switch h implies e xbtint an interval real for diagnostic output e xbtts a switch logical corre
196. are used for velocity components because of the no slip boundary condition at the edges of the strips Vorticity 214 jrow is filtered with even Fourier coefficients Note that there is no windowing in the transform Also this method is a real time burner and FFT s are of little use because of the arbitrary strip widths The time burning aspect was the motivation for option firfil 15 11 2 firfil For reasons outlined in Section 15 11 1 prognostic variables in polar latitudes may have to be filtered This option uses multiple passes with a simple symmetric finite impulse response filter Hamming 1977 to accomplish the filtering Its advantage over option fourfilis speed As with fourier filtering the amount of filtering can be a function of latitude and is controlled by the number of passes of the filter on the data The number of passes is arbitrairly given by cos 7 lt ie 15 19 where jft0 is some reference latitude and numfit is the number of filter applications per prognostic variable per latitude numfit is for variables on cell latitudes and there is a corresponding number of passes used for variables on U cell latitudes given by numflu Equation 15 19 is arbitrary and should be adjusted by the researcher to get the desired effect It is set in subroutine setocn This filter differs from the Fourier filter in that it filters across land using masks to set boundary conditions It does not need the strips and is much faster
197. arious reasons and these modifications may themselves introduce problems All problems are remedied by iterating over a sequence of steps using guidance given in the form of options Iteration is required because changes made in any step may affect other steps Usually after a few iterations all changes are consistent The steps are e If option fill isolated cells is enabled isolated T cells are made into land cells Isolated cells are deeper than nearest neighbor T cells Think of them as potholes Also affected are cells where the four surrounding U cells are land cells They cannot communicate with horizontal neighbors through advection because all surrounding velocities are zero MOM 2 will run with these conditions but sometimes they cause problems Specific researcher changes to the kmt row field are added These may take the form of hard wiring kMt jrow to specific values for any number of reasons They should be put in the USER INPUT section of module topog Setting large areas of may be handled using routine setkmt as is done when generating the idealized dataset Limit the minimum number of vertical levels in the ocean to parameter kmt_min 2 This parameter may be increased but not decreased There is some choice for altering jrow to meet this condition The choice is made by enabling one of the following options fill_shallow makes land cells where there are fewer than min vertical levels
198. as MOM 2 Version 2 Documentation User s Guide and Reference Manual GFDL Ocean Technical Report 3 2 Geophysical Fluid Dynamics Laboratory NOAA Princeton N J 08542 edited by Ronald C Pacanowski 1996 Other con tributers to this documentation have been acknowledged within and their work is gratefully appreciated Although the design components and options of MOM 2 have been documented in one sense this documentation is incomplete because of the very nature of the actively developing research tool which it describes Nevertheless the salient features are documented and as new features are added there is a strong commitment at GFDL to keep this manual up to date If certain sections appear thin this should be viewed as an opportunity to point out the need for clarification Contributions are welcomed and contributers will be acknowledged as authors of their sections Model development The focus of MOM 2 development work at GFDL is to maximize scientific productivity within the computational environment at GFDL However the model is sufficiently general to be of use elsewhere Therefore the MOM 2 code and this documentation are being made available free to the oceanographic and climate community For system requirements refer to Section 19 1 As ideas are developed and progress is made by various groups within the modeling com munity it is hoped that the modular structure of MOM 2 will be capable of incorporating their devel
199. as ca 1000 horizontal grid points and 15 levels and was integrated for 1 year time step 1 5 h on a Cray YMP Three different model states were used A a state with almost no static instability achieved by strong uniform surface heating B a state with convection occurring at about 1596 of all grid points C a state with convection at 3096 of all grid points The latter two were near equilibrium with permanent convection I compared the overall cpu time consumed by these runs with different convection schemes The standard scheme was tried for three different numbers of iterations ncon The results are summarized in the table the overall cpu time is given relative to a run with no convection scheme Convection scheme relative cpu time A B C No convection scheme 1 1 1 standard ncon 1 1 13 1 13 1 13 standard ncon 7 1 88 1 89 1 92 standard ncon 10 2 25 2 27 2 32 implicit 1 52 1 52 1 52 complete 1 12 1 20 1 36 It was surprising to find that the few innocent looking lines of model code that handle the convection consume a large percentage of the overall processing time The numbers are probably an upper limit a model with realistic topography and time dependent forcing will use a bigger chunk of the cpu time for iterations in the relaxation routine for the stream function so that the relative amount spent on convection will be lower In my test runs the standard scheme adds 13 cpu time per pass My complete convection scheme used as mu
200. asbc for the atmosphere The ordering of surface boundary conditions in both arrays is the same and is specified by a mapping array mapsbc Why not just specify an order and forget about mapsbc The reason is that array mapsbc allows new surface boundary conditions to be added or old ones to be removed from the list in a relatively easy way The default ordering is given below These five surface boundary conditions for the ocean come from the atmosphere 1 mapsbc 1 references 7 which is the eastward windstress exerted on the ocean in units of dynes cm If the wind in the atmosphere model is positive blowing towards the east then the ocean and land exert a westward stress which decelerates the atmosphere From the atmosphere point of view this stress is negative However the ocean and land are being accelerated by the transfer of momentum through the boundary layer Therefore the correct sign for the stress acting on the ocean is positive towards the east 2 mapsbe 2 references 7 4 which is the northward windstress exerted on the ocean in units of dynes cm A northward windstress is positive 3 mapsbc 3 references heat flux in units of langley sec where 1 langley 1 cal em A positive heatflux means heat is being pumped into the ocean 4 mapsbc 4 references a salinity flux into the ocean in units of grams cm sec In MOM 2 the rigid lid approximation implies that ocean volume is constant Therefore when it 6 When using
201. ata to file 201 1 If option netcdf or zbis netcdf is enabled data is written in NetCDF format to file xbt dta nc rather than in unformatted IEEE The interval between output is specified by variable xbtint and the control is specified by variable iozbt The averaging period is typically the same as the interval but may be specified shorter by variable xbtper These variables are input through namelist Refer to Section 5 4 for information on namelist variables Define m stations with coordinates m m which are sampled to a depth of z cm Discretize these locations to the nearest model grid points xbtlonm zbtlatm xbtdpt XBTs for the Momentum Equations Using operators and arrays described in Section 11 11 5 all components of the Momentum Equation are averaged in time for each station m and at each level k The averaging period L corresponds to the number of time steps in the average Subscript n 1 refers to the zonal velocity component and n 2 refers to the meridional component The canonical form of the terms for the mth station at level k are given as L 1 Wk nl utb knmi FY eee 18 166 L e 2AT iz ULOL kth I2 grad pi kin 18 167 1 13 Nine times if option lyapunovis enabled This option has outgrown its name Think of it as an enhanced XBT 1 67 items are computed for each T and U grid cell combination 248 CHAPTER 18 DIAGNOSTIC OPTIONS uzbtaknmih x ADV 18 168
202. ation to neutral directions has been added paper in progress by Griffies Gnanadesikan Pacanowski and Larichev Consistent with the new isopycnal mixing formulation improvements have also been made to the numerics in the Gent McWilliams parameterization A fourth order advection scheme for tracers the FCT scheme of Gerdes K berle and Willebrand 1991 a third order advection scheme for tracers by Holland very similar to the Quick scheme of Leonard 1979 the pressure gradient averaging technique of Brown and Campana 1978 the Neptune effect of Holloway 1992 a general grid rotation by Eby and open boundaries by Biastoch of Stevens 1990 have been added The discretization of vertical mixing of Pacanowski Philander 1981 has been changed to yield more accurate and stable solutions as indicated in Section 15 14 2 There has also been vi some restructuring of the memory window logic to allow for a more robust implementation of parallelism and fourth order schemes Since the arrival of a CRAY T90 and Unicos 9 operating system in August 1996 there is no longer a Fortran 77 compiler cf77 It has been replaced by a Fortran 90 compiler f90 which for the most part is compatible with cf77 However the Fortran 90 compiler necessitated changes in run scripts and namelists have been made Fortran 90 compliant These and other related changes are summarized in Section 19 2 Work in progress The coarse grained parallelism a
203. ation with only the advective terms being omitted Solving for the external mode stream function is similar to solving in a closed domain with walls at jrow 1 and jmt After each solution two boundary rows are set active open boundary conditions or calculated passive open boundary conditions using a radiation condition after Orlanski 1976 _ _ cy Ob B a 06 13 2 Because the Poisson solver calculates the updated stream function from jrow 3 to jrow gmt 2 In Stevens 1990 4 is calculated from from jrow 2 to jrow jmt 1 the first and the last two boundary rows are equal in s This is desirable because there should be no barotropic velocity tangent to the boundary and a zero derivative across the first two rows assures this 13 2 Options The following options are available as ifdefs obc south open boundary at the southern wall jrow 2 obc_north open boundary at the northern wall jrow jmt 1 obc_west open boundary at the western wall i 2 obc_east open boundary at the eastern wall i imt 1 obc is automatically defined if any of the above ifdefs are enabled 13 3 NEW FILES 143 orlanski Orlanski radiation condition for passive open boundary conditions If not set active open boundary conditions are assumed obcparameter write open boundary conditions related parameters into snapshot file only if obc south and or obc north are enabled obctest configura
204. atrix sections e prslon starting longitude deg for writing xz data for use with option matrix sections e prelon ending longitude deg for writing xz data for use with option matriz sections e prsdpt starting depth cm for writing xz data for use with option matriz sections e predpt ending depth cm for writing xz data for use with option matriz sections e slatzy starting latitude deg for writing xy data for use with option matrix sections e clatzy ending latitude deg for writing xy data for use with option matriz sections e slonzy starting longitude deg for writing xy data for use with option matriz sections e clonzy ending longitude deg for writing xy data for use with option matriz sections e irajint interval in days between writing data for use with option trajectories e dspint interval in days between writing data for use with option diagnostic surf height e dspper period in days for producing time averaged data for use with option diagnos tic surf height This averaging period may be set shorter than the interval dspint e snapint interval in days between writing data for use with option snapshots e snapls starting latitude deg for writing data for use with option snapshots e snaple ending latitude deg for writing data for use with option snapshots e snapds starting depth cm for writing data for use with option snapshots e snapde ending depth cm
205. ause the 1 external mode is unknown at the time when data is writ ten Therefore tik jn is total velocity containing both internal and external modes The output from this diagnostic is written as 32 bit IEEE unformatted data to file snapshots dta If option netedf or snapshots netedf is enabled data is written in NetCDF format to file snap shots dta nc rather than in unformatted IEEE The structure of this file is very similar to the one from option time_averages The interval between output is specified by variable snapint Depending on whether option stream function r gid lid surface pressure or implicit free surface is enabled 18 2 LIST OF DIAGNOSTIC OPTIONS 18 2 16 stability tests 237 Option stability_tests computes various stability criteria and related items within a portion or all of the model domain The limits of volume of domain to be considered when testing are set through namelist Refer to Section 5 4 for information on namelist variables If MOM 2 blows up this diagnostic is useful in finding where it went unstable The following are computed 1 Based on local velocities within each cell a maximum local time step is computed for the three principal directions as x ATi kj y ATP 2 cos Qo 2 kl dYUjrow 2 Lk 2 dzwy 2 adv vbt k 18 82 18 83 18 84 These local time steps are compared with the model specified time step and the location of the largest is
206. b lems For example anyone who repeatedly changes or adds to a large model will appreciate that after time the model can become unmanageable At some point inter connectivity between sections of code increases to a point where making changes in one place inadvertently breaks something seemingly unrelated Further limitations become apparent when previously added code acts as a road block to new development To a large extent modularity has been used as the key organizational approach to solve this problem and its use is explained in Chapter 6 The other part of the solution involves resisting temptation to make changes in a quick and dirty way for short term gains which inevitably turn into long term hindrances 1 1 4 Documentation A good documentation aids in understanding the big picture as well as the little details which are necessary if a model is to be used and extended by many researchers To this end details of numerics right down to the subscripts within this documentation consistantly match what is found in the model code This level of detail plus a straightforward coding style bolsters the scientific accessibility of MOM 2 The manual should be considered a living document which actively reflects the current status of MOM 2 as well as serving as a repository for details inappropriate for published papers and guidelines for usage of parameterizations Therefore understanding this documentation will allow researchers to take a big step to
207. be applied to a spherically gridded model This transform is particularly useful for studies of high latitude oceans where the convergence of lines of longitude may limit time steps or where the ocean contains a pole as in the Arctic The idea is to define a new grid in which the area of interest is far from the grid poles In limited domain models the pole can be rotated outside of the domain For global models one possibility is rotate the North Pole to 40 W 78 N which puts the North pole in Greenland and keeps the South pole in Antarctica Other uses include rotating the grid to match the angle of a coastline or to provide more flexibility in specifying lateral boundary conditions Option rot_grid modifies the Coriolis term to handle a rotated model grid which is specified using three Euler angles for solid body rotation The Euler angles are computed by defining the geographic latitude and longitude of the rotated north pole and a point on the prime meridian as described below To make this option easier to use several rotation routines are provided within module ro tation The driver may be used to help define the rotation write file of geographic latitudes and test the rotation with idealized data Other routines demonstrate how to interpolate scalar and vector data from a geographically gridded data set to a rotated model grid To run the driver use the script run rotation 8 1 Defining the rotation Any spherical grid rota
208. bers to specify particular surface boundary conditions throughout the code 104 CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE eeeeeeecccee ccan Initialization Initialization Do n l segments eeeDivide integration time into segments Get Atmos SBC and interpolate to Ams grid Do n 1 ntspas armos o o o o o o o Amos for time segment holding SBC fixed End do Get Ocean SRC and 7 interpolate to grid Do n 1 ntspos Integrate Ocean for ane time segment holding SBC fixed End do Figure 10 2 Flowchart for main program driver F which controls surface boundary conditions in MOM 2 10 8 SURFACE BOUNDARY CONDITION DETAILS 105 if first thn eFind ocesn damn tems of Amos indices ef m doin is limited set blending are Ed if sococn array of Atmospheric S B C eg SST the ocean grid socam array of Atmospheric S B C eg SST cn the atmcs grid j Do n 1 num asbc index m to reference Amos S B C n eg SST eIf n domain is limited then Apply prescribed sbcatm outside ocesn damin Sec cyclic axuitiam an sooom eExtrapolate ocn into land areas eInterpolate soon to sbcatm eIf coan domain is limited then Extrapolate dam Into blending zone eSet cyclic conditions m cam eConvert sbcatm to atmos units eCompute global mean of scbatm End do Figure
209. bles from any subroutine This is their greatest strength and also their greatest weakness They expose all variables in the block to potential change by any subroutine that includes it whereas argument lists limit the exposure Also when exchanging subroutines between unrelated models there is possibility for naming conflicts when common blocks are used Nevertheless experience with MOM 1 and MOM 2 indicates that the advantages of a well structured common block outweigh the disadvantages Internal to each subroutine details are pushed into lower level subroutines which are kept near the bottom of the module If the overhead in calling the routine is not negligible the routine should be inlined On CRAY computers this is a matter of supplying a list of routines to inline Pushing details into lower level subroutines tends to make the structure of higher level routines more understandable However this process can be carried too far and judgement needs to be exercised After applying this throughout MOM 2 certain lower level subroutines show up repeatedly When this happens they are extracted and put into a utility module One example of this is util F This utility module can then be included as needed within other modules or MOM 2 The net effect is to end up with less redundant code and a restricted way in which subroutines interact within modules and modules interact with MOM 2 6 2 List of Modules The following sections contain a listing
210. bottom 157 15 7 8 fillisolated_cells ee 157 15 7 9 fillshallow 157 15 7 10deepen shallow 157 15 7 11 5 157 15 7 12fill perimeter violations 157 15 7 13widen perimeter violations een 157 15 8 Initial 8 157 15 8 1 equatorialthermocline 2e 158 15 8 2 idealized ic 158 15 8 3 levitusic 158 15 9 Surface Boundary Conditions 158 15 9 1 simplessbc 2h 158 15 9 2 equatorialtaux less 159 15 9 3 equatorialtauy llle 159 15 9 4 time mean sbc data 159 15 9 5 time varying sbe data 159 15 9 6 coupled 159 15 9 7 restorst 159 xiv CONTENTS 15 9 8 56 160 15 9 9 minimize_sbc_memory 161 15 10Lateral Boundary Conditions 161 15 10 1cyclic 161 15 10 2solid_walls 2n 162 15 10 38 162 15 10 4sponges
211. boundary conditions coabc conversion factors for converting surface boundary conditions from their di mensional units in the model where they were constructed to the other model s units If option coupled is not enabled then data is assumed to be in units required by MOM and no conversion is done e crils convergence criteria used to terminate solving the elliptic equation which extrap olates surface boundary conditions into land areas on the model grid The extrapolation takes place on the native grid before interpolating to the other model grid This only applies when option coupled is enabled 54 CHAPTER 5 VARIABLES e numpas maximum number of iterations used to extrapolate data into land regions on the model grids where it was constructed This only applies when option coupled is enabled e bwidth blending zone width in degrees when using limited domain ocean models with global atmosphere models This only applies when option coupled is enabled e laur zonal windstress in dynes cm for idealized equatorial studies Refer to Section 15 9 2 e meridional windstress in dynes cm for idealized equatorial studies Refer to Section 15 9 3 5 4 4 Time steps Namelist tsteps Historically ocean time is measured in terms of tracer time steps It should be noted that the equations in MOM 2 can be solved asynchronously Bryan 1984 using one timestep for the internal mode dtuv another for the externa
212. bu kj Km 15 35 diff_cbt Kh 15 36 If implicit vertical mixing is used by enabling option implicitumix then mixing coefficients in regions of gravitational instability are set to their maximum values using dif f cbtip dif fcbttimit 15 37 Typically the value of di f f cbt limit is set to 10 cm sec Note that vise_chu_limit is not used to limit dif 7 but could be What value to use for visc cbu limit in convective regions needs further study Diffusive fluxes at the bottom of cells take the form 172 CHAPTER 15 GENERAL MODEL OPTIONS diff fbiy dif f cbui y j uig ine Uik 1 j n 7 1 d2Wk 15 38 for momentum and diff cbtik illik lk i dzwk 15 39 for tracers The mixing coefficients km and are independent of time and are input through namelist Refer to Section 5 4 for information on namelist variables 15 14 2 ppvmix This is a basic vertical mixing scheme which calculates Richardson dependent values of mixing coefficients and based on the formulation of Pacanowski and Philander 1981 In previous discretizations the Richardson number was first computed at the base of U cells then averaged onto T cells after which the three dimensional viscosity coefficients visc cbu were computed using Richardson numbers at the base of U cells and the three dimensional diffusivity coefficients dif f_cbt k were computed using Richardson numbers at the base of T cells Actuall
213. but usually a few trials is enough to locate the necessary pole position 8 2 Rotating Scalars and Vectors Code changes to mom are limited to modifying the calculation and dimension of the Coriolis variable cori Running the rotation driver will create the latitude data file needed to calculate the correct Coriolis terms but the creation of all other data files is left to the researcher The subroutine rot_intrp_sclr may be used to interpolate scalars such as depths surface tracers etc while subroutine rot_intrp_vctr can be used to interpolate and correct the angles for vectors such as wind stress 8 3 Considerations Although additional execution time used by this option is negligible the option may complicate subsequent analysis by the researcher Rotated model results can be interpolated back to the geographic grid for comparison but this may involve recalculating many diagnostics such as zonal integrals since all diagnostics within MOM 2 are only computed on the rotated model grid Section 15 6 1 contributed by Michael Eby eby uvic ca Chapter 9 Topography and geometry As described in Chapter 7 the model domain is filled with a rectangular arrangement of T cells and U cells In general some of these grid cells will be land cells and others will be ocean cells Geometry and topography are implemented as an array of integers km jrow indicating the number of ocean cells stacked vertically between the surface and ocean bottom
214. by Boussinesq in 1903 n MOM 1 and the Cox versions of the model was set to 1 0 gm cm an error of 3 5 relative to the accepted value of 1 035 gm cm to eliminate a few multiplies in the momentum equations for reasons of computational speed MOM 2 uses po 1 035 Note that this is not valid if the purpose is to accurately model convection where horizontal and vertical scales may be comparable 6 CHAPTER 2 OCEAN PRIMITIVE EQUATIONS Consistent with the above approximations Bryan 1969 also made the thin shell approxi mation because the depth of the ocean is much less than the earth s radius which is assumed to be a constant The Coriolis component and viscous terms involving vertical velocity in the horizontal momentum equations are ignored on the basis of scale analysis and an eddy viscosity hypothesis is invoked This hypothesis implies that the affect of sub grid scale motion on larger scale motions can be accounted for in terms of eddy mixing coefficients Much of the physics since Bryan 1969 revolves around paramaterizing mixing within the ocean The continuous equations formulated in spherical coordinates is latitude increasing north ward with zero defined at the equator is longitude increasing eastward with zero defined at an arbitrary longitude and z is positive upwards with zero defined at the ocean surface are up L u LER _ py sgh Gt PY 2 1 vt L v eb fu po ste F 2 2
215. c Typically the ocean surface is assumed to be rigid within atmospheric models However in certain regions surface velocities can exceed 50 cm sec which is enough to effect bulk transfer estimates of evaporation and surface stress The stress is related to the relative difference between wind speed and the ocean currents as in Pacanowski 1987 mapsbc 9 references the meridional component of velocity from the first level in the vertical in units of cm sec Adding or removing surface boundary conditions 27A product of PREP_DATA scripts operating on the DATABASE in CASE 1 and CASE 2 CASE 0 uses an idealized data generated internally as a function of latitude only Interpolations to model time are explained under option time varying sbc data in Section 10 2 10 3 SURFACE BOUNDARY CONDITION DETAILS 103 As an example suppose one wanted the first six surface boundary conditions but not the rest Use the UNIX command grep numosbc h to find numosbc and set parameters to numosbc 5 and numasbc 1 This reduces memory requirements and no other changes are necessary However suppose one wanted to remove the short wave boundary condition from the previous example The following steps would be needed e grep numosbc h to find and set numosbc 4 numasbc 1 e grep mapsbc 5 F to find and remove references for mapsbc 5 e grep mapsbc 6 F to change references for mapsbc 6 to mapsbc 5 This is much cleaner than hard wiring num
216. c are bypassed because spatial interpolation to the mom grid is not needed Also the length of a time segment reduces to the length of one ocean time step In general the datasets contain either time mean conditions or time varying conditions and there are three options which configure these types of surface boundary conditions for mom e simple_sbc allows for the simplest of atmospheric datasets All surface boundary condi tions are a function only of latitude No time dependence here although it could easily be incorporated The test case prototype is described in Sections 19 6 and 19 7 as CASE 0 In this case there is no dataset on disk and sbcocn jrow m is not needed since all surface boundary conditions are generated internally T his is an appropriate option for building forcing functions for idealized surface boundary conditions e time mean sbc data uses an atmosphere dataset defined in SBC TIME MEAN The test case prototype is described in Sections 19 6 and 19 7 as CASE 1 The dataset resides on disk and each surface boundary condition is a function of latitude and longitude The dataset should be prepared for the grid in MOM 2 using scripts in PREP_DATA as described in Section 19 6 The surface boundary condition data is read into the surface boundary condition array sbeocn jrow m once in atmos for all latitude rows where m gives the ordering of the boundary conditions as described in Section 10 3 On every time step data from sbce0cn
217. c models In this section the general case will be considered where the atmosphere is assumed to be a GCM with domain and resolution differing from that of MOM 2 and two way coupling between MOM 2 and the atmosphere model will be allowed Option coupled configures MOM 2 for this general case and the test case prototype is described in Sections 19 6 and 19 7 as CASE 3 A flowchart of drivert is given in Figure 10 2 It begins by calling subroutine setocn to perform initializations for mom Included in the list are such things as initializing variables reading namelists to over ride defaults setting up the grid topography initial conditions region masks etc In short everything that needs to be done only once per model execution Following this a call is made to subroutine setatm which completes whatever setup is required by atmos At this point the integration is ready to begin Integration time is divided into a number of equal length time segments which determine the coupling period In practice this interval should always be chosen short enough to adequately resolve time scales of coupled interac tion Typically this value would be one day Within the segment loop atmos and mom are Wind rain heatflux etc Primarily SST General circulation model Contained within file driver F This is the main program for MOM 2 Contained within file setocn F Contained within file mom F This is the subroutine that does the tim
218. ce for two different reference pressures 2 Don t mix yet just mark all unstable pairs and find continuous regions of the water column which are unstable neutral stability is treated as unstable 3 Mix the unstable regions 4 If there was instability in any column repeat steps 1 to 3 Those columns which were completely stable in the previous round are not dealt with again in 2 and 3 but the densities are still recomputed for the entire grid row Repeat until no more instabilities are found 5o Marotzke relaxed the condition that only two levels are mixed at a time and complete mixing will be achieved with at most k 1 passes through the water column if k is the number of model levels However if only one grid point of a row requires n iterations the densities for the entire grid row will be recomputed n times so it still doesn t look too good in terms of cpu efficiency The fast way 1 Compute all densities like in 1 of Marotzke 2 Compare all density pairs to find instabilities From here on deal column by column with those grid points where an instability was found performing the following steps 3 Mix the uppermost unstable pair 4 Check the next level below If it is less dense than the mixture mix all three Continue incorporating more levels in this way until a statically stable level is reached 5 Then check the level above the newly mixed part of the water column to see whether this has be
219. ce of a T cell and the x derivative terms appearing in the z flux onto the bottom face of the T cell This is a natural choice for averaging when working on the B grid and provides an example of what we meant in the previous paragraph about creative discretization 313 314 APPENDIX C A NOTE ABOUT COMPUTATIONAL MODES There is a problem however with this discretization due to the presence of both the average and derivative operations acting in the same spatial direction on a single field The problem is that this combination of operations introduces computational modes For example in the x flux the z derivative of the tracer defined on the east face of T cell i k is Tiki Tiga eq 4dzty Tik and likewise for the z derivative of the density quick inspection of this forumla indicates that by taking both a z average and a z derivative allows for the presence of 2Az computational modes T 4 Ti k41 and pij 1 1 For fields containing this structure the discretized z derivative on the east face will vanish For the z flux 2Az computational modes exist due to the combination of the x average and x derivative In general when working on the B grid and acting on a single field such combinations of an average in one direction combined with a derivative in the same direction introduces computational modes in this field The presence of the grid waves and the ability to increase their amplitud
220. cell of land mass m that is a nearest neighbor of a The coefficient of the island perimeter value AV in the elliptic Equation 16 13 centered at is the sum of the contributions from all nearest neighbors of a that are in the island perimeter of land mass m Each contribution will be shown equal to a corresponding contribution of A to the island equation for land mass m Individually each coefficient of the equation centered at cell a say the coefficient in the direction of cell 8 is equal to the opposite coefficient in the contribution to the island equation arising from 8 Since multiple island perimeter cells as nearest neighbors of o lead to a sum of their individual contributions and since the island equation is the sum of the individual equations centered at island perimeter points 8 both summations lead to the same result Thus even the coefficient values involving islands satisfy the symmetry relation Aa Ag if the implicit Coriolis parameter is zero Asymmetry of the barotropic equations in MOM 1 The barotropic equations presented to the solvers in MOM 1 were not symmetric even when the implicit Coriolis parameter acor was set to zero In an attempt to optimize the code to save a few floating point operations in the calculation of Ax each equation was divided by its diagonal coefficient coeffi jrow o o Since these diagonal coefficients depend on topography and grid factors they are not equal at neighboring cells and the r
221. centering of the squared z derivative will be prescribed in which no computational modes are introduced and proper placement is given This point will be addressed in the discussion of equation B 208 for now it will be ignored The functional derivative of these x y plane gradients is given by OVT 1 i j osol dru duu B 57 OT j cos T dau dyu dzWk OVT 2 i j gt B 58 OT j cos pr deu diu dz wy OVT 3 i 2 B 59 OT cos T dau dyuj dzwy 284 2 plane APPENDIX B ISOPYCNAL DIFFUSION i j dyea dun B 60 TAG B 61 am B 62 63 PETER B 64 _ 4 B 65 EL B 66 _ UTER B 67 _ UTER B 68 For the z x plane suppressing the j index the tracer gradient in the 12 boxes is given by VT 13 i6 T aa IET k ROT a B 69 VT 14 i6 T k i B 70 VT 15 i6 T a 6 k 71 16 i6 T j6y Tig 6 1 B 72 VT 17 i6 T 6 73 VT 18 i6 T Ti cac 6 B 74 VT 19 i6 T a k6lT aaa B 75 VT 20 i6 T a vTi aa k67T aa B 76 VT 21 i6 T aaa 6 k T k B 77 VT 22 i6 T pa j6y B 78 VT 23 i6 T aaa 36 kpi B 79 VT 24 i6 T 1 j y B 80 The functional de
222. ch a general consistency check is done involving all enabled options Two levels of messages are given error and warning checks After all messages are listed if one or more error messages is present the model will stop Warning messages will not stop the model but the researcher should be aware of them and convinced they are harmless before continuing The preliminary setup finishes with a summary of enabled options after which a breakdown of the number of time steps per ocean segment and number of segments per integration is given This is of interest only when option coupled is enabled A heavy battery of diagnostics are enabled but only for illustrative purposes They are fully described in Chapter 18 and the I O control variables are set to save data to unformatted files with suffix dta as well as formatted to the printout file At the end of the integration all files are listed and a timing analysis is given detailing times taken by various sections of MOM 2 This is useful but once the information is digested the timing should be turned off by not enabling option timing Density coefficients are computed by a call to module denscoef F from within the model 19 9 HOW TO SET UP A MODEL 259 The other printout files are very similar except for case 3 which has more output because option trace coupled fluxes has been enabled to show details of surface boundary conditions as they are being interpolated from ocean to atmosphere and visa ver
223. ch time as 1 3 iterations of the standard scheme depending on the amount of convection For zero convection it is as fast as one pass of the standard scheme because it does the same job in this case Additional cpu time is only used at those grid points where convection actually occurs My scheme is considerably faster than the implicit scheme especially for models where convection happens only at a few grid points or only part of the time I did not have Marotzke s scheme available 15 14 VERTICAL SUB GRID SCALE MIXING SCHEMES 171 for the test but in his 1991 paper he mentions a comparison where the computation time with the implicit scheme was 6096 of that with his scheme This would give Marotzke s scheme a relative cpu time of about 2 5 in the table with strong dependence on the amount of convective activity Surface heat fluxes looked identical in the runs with the implicit and complete schemes The standard scheme showed significant deviations however in the surface flux as well as the convective heat flux at different depths This is not surprising since the rate at which heat is brought up by convection will be reduced if mixing is incomplete The runs with ncon 7 and ncon 10 still differed noticeably from each other and from the complete mixing case It is possible that this could affect the deep circulation which is driven by convective heat loss but I didn t do long integrations to test this The problem gets worse for longer t
224. cher For instance a computational scientist s approach to numerical ocean modeling is not the same as an oceanographer s Since MOM 2 is an oceanographic research tool code is structured according to concepts that are important to the numerical oceanographer The main idea is to increase modularity by arranging code into sections that fit the numerical oceanographer s conceptual model isolating these code sections from each other as much as possible and restricting how they interact As implemented in MOM 2 a module is a collection of subroutines which relate to the same concept and are bundled within a F file One useful feature of a module as defined in MOM 2 is the capability of being executed in a stand alone mode apart from MOM 2 as well as from within MOM 2 Executing in a stand alone mode provides a simplified environment which aids in configuring the model development work and debugging Many sections of MOM 2 are modular but cannot be run in a stand alone mode In principle they could become modules but When the number of options is large an effective way is needed to point out incompatibilities and inconsis tencies This is the purpose of subroutine checks 61 62 CHAPTER 6 MODULES AND MODULARITY are so tied into the underlying structure of MOM 2 that providing a reasonable set of inputs is problematic The diagnostics and subroutines that solve for the internal mode velocities or tracers are examples of modular code b
225. cision for packing purposes and maximum allowable number of variables The following call to get_def retrieves these properties and sets the appropriate internal netcdf variables do n 1 num call get def n cvarnam n cvarlnam n amp cvarunits n nvdims n idimindx 1 n amp validr 1 n lspval n vspval n nbits n enddo All of the above information is encapsulated into a NetCDF file named fname using the following call to neseti which calls the MOM 2 NETCDEF routine ncsetup Routine ncseti is an interface routine provided to allow MOM 2 to be compiled in double precision on workstations It then converts data to single precision which is expected by the Netcdf routines Refer to Section 19 11 iverbose O icaltype 0 call ncseti fname lclobber gtitle lgspval gspval amp ndimsout lendims cdimnam cdimlnam amp cdimunits cart axis ipositive amp dimvals mxdimout time amp nvarsout cvarnam cvarlnam cvarunits nbits amp nvdims idimindx ndimsout amp validr lspval vspval iverbose Note that ncseti need only be called once for each diagnostic Afterwards all properties of the data are uniquely defined Filename fname is now ready to receive data Assume array 1 is dimensioned by imt km and is filled with convection data for every jrow The following lines store the data from ezcnv1 into latitude row jrow in the NetCDF file set the starting indices and length istart 1 1
226. coarse models with global domains where the time step is limited by the inertial period 1 f 199 200 CHAPTER 16 EXTERNAL MODE OPTIONS is that the normal component of the gradient of the stream function amp 0 on lateral boundaries Actually since the viscous terms in the vertically averaged forcing are of the form V u and V v another boundary condition is necessary The additional boundary condition is that the tangential component of the stream function f Vw 0 on lateral boundaries Bryan 1969 gives the discretization of Equation 16 1 in terms of five point numerics This means that the discretized equation at grid point with subscripts i jrow involves the four nearest neighboring points with subscripts 44 1 jrow 1 jrow i jrow 1 and i jrow 1 Semtner 1974 derives the nine point equivalent of Bryan s external mode equation which additionally involves the four nearest neighboring corner points 1 1 jrow 1 1 jrow 4 1 i 4 1 jrow 1 and 1 1 jrow 1 A similar approach is given below The finite difference counterpart of Equation 16 1 is arrived at by starting with the verti cally averaged finite differenced momentum equations T Uik jir fjrow Uik j2 1 Ui i2 31 A JAF lik iara 6 0271 Do COS 9U PL jrow Zui jrow 1 16 2 Ui k j 2 r 1 Ui kj 2 7 1 f a 3 1 z Uik jlr lik i
227. coefficients the new scheme requires the checking of slopes for four surrounding triads of grid points Within a particular triad the diffusion coefficient is rescaled according to the numerical stability constraints Therefore each of the four diffusion coefficients A A and A contains four sub components Each particular triad can be involved in specifying more than one diffusion coefficient e g see Figures B 2 and B 3 Hence it is necessary to maintain the completely local specification of the sub components of the diffusion coefficients Otherwise non unique fluxes can arise Additionally without this local specification the variance reducing property of the scheme is no longer guaranteed The need to rescale diffusion coefficients adds a bit of complexity to the algorithm as well as increased time and memory requirements Additionally the rescaling introduces an unphysical spatial dependence to the diffusion coefficient which adds a corresponding advective transport proportional to the divergence of the scaled diffusion coefficient The introduction of the full tensor with a well resolved grid i e a grid for which 6 gt 1 2 provides a method which requires no rescaling and no unphysical advective transport Additionally there is a savings of memory due to the ability to collapse the four diffusion coefficients A 7 A and into a single constant e g for the simple case of a constant all diffusion coeffici
228. come unstable now If so include it in the mixed part and go back to 3 If not search for more unstable regions below the one we just mixed by working your way down the water column comparing pairs of levels if you find another unstable pair go to 3 Note that levels which have been mixed are from then on treated as a unit This scheme has a slightly more complicated logical structure it needs a few more integer variables and if statements to keep track of which part of the water column we have already dealt with The advantage is that we only recompute the densities of those levels we need levels which are not affected by the convection process are only checked once The scheme includes diagnostics which allow to plot the convection depth at each grid point Discussion Perhaps these schemes are best discussed with an example Imagine a model with five levels At one grid point levels 2 amp 3 and levels 3 amp 4 are statically unstable The standard scheme will at the first pass mix 3 amp 4 and then 2 amp 3 It will repeat this ncon times Marotzke s 170 CHAPTER 15 GENERAL MODEL OPTIONS scheme will mark the unstable pairs and then mix 2 4 in one go It will then return to this column for a second pass and check all levels once more My scheme will mix 2 amp 3 then compare the densities of 3 amp 4 and if unstable mix 2 4 like Marotzke s scheme It will then recompute the density of level 4 compare levels 4 amp 5 and m
229. computing data for use with option stability tests cflone ending longitude deg for computing data for use with option stability tests cflats starting latitude deg for computing data for use with option stability tests cflate ending latitude deg for computing data for use with option stability tests cfldps starting depth cm for computing data for use with option stability tests cfldpe ending depth cm for computing data for use with option stability tests mazcfl maximum number of CFL violations before quitting for use with option stabil ity lests zmbcint interval in days between writing data for option show zonal mean of sbc glenint interval in days between writing data for option energy_analysis irmbint interval in days between writing data for option term balances itrmb Boolean for writing regional masks when used with option term balances vmsfint interval in days between writing data for option meridional overturning gyreint interval in days between writing data for option gyre components exconvint interval in days between writing data for option save convection cmizint interval in days between writing data for option save_mizxing_coeff 58 CHAPTER 5 VARIABLES e extint interval in days between writing data for option show erternal mode e przzint interval in days between writing data for use with option matrix sections e priat latitudes for writing data for use with option m
230. ctories are located at GFDL They will have to be changed at each in stallation Control forwWhich test case executes is given by C shell variable CASE CASE 0 is for test case 0 and so forth 8 Levitus 1982 SST and sea surface salinity are to be used as initial conditions option levitus_ic must be enabled as discussed in Section 15 8 19 8 SAMPLE PRINTOUT FILES 257 When run_mom executes it copies all Fortran code from directory MOM 2 into a work ing directory followed by all code from either 2 SBC TIME MEAN if CASE 1 MOM 2 SBC MONTHLY if CASE 2 MOM 2 SBC ATMOS if CASE 3 If any NetCDF option is on all files from MOM 2 NETCDF are also copied Lastly it copies all Fortran code from the EXP TEST CASE MOM UPDATES directory thereby installing all changes necessary if any to build the particular model Various ways of configuring MOM 2 are controlled by options This includes enabling diagnostics as described in Chapters 18 and 15 Options are set within the script using cpp preprocessor commands of the form Doption1 Doption2 and so forth These options eliminate or include various portions of code to construct a model having the desired components They are also used to enable diagnostics and whether output is in NetCDF format or not Note also that the computer platform is specified within run mom Currently the list includes Decray_ymp Dcray_c90 90 and Dsgi Based on which setting is chose
231. curate in the middle of continents Where land and ocean areas on the ocean and atmosphere grids are mismatched this will ameliorate the sensing of erroneous Ex j by the ocean e Interpolate sbeatmy to sbcocn jrow m Since ocean resolution is typically higher than that of the atmosphere due to the difference in Rossby radius scales the interpolation is linear The interpolation is carried out using subroutine ctf from file util F Note that linear interpolation does not exactly conserve the quantity being interpolated However linear interpolation has been used without causing noticable drift in coupled integrations without flux correction of up to 20 years at GFDL For integrations simulating thousands of years linear interpolation may not be good enough To conserve fluxes exactly one possibility although drastic is to design the Contained within file gosbc F 21This method is arbitrary However when solving this equation iteratively it is important not to zero out from previous solutions over land areas Their purpose is to act as a good initial guess to limit the iterations needed for subsequent solutions 10 2 COUPLING TO DATASETS 99 grids such that an integral number of ocean cells overlay each atmospheric grid cell Then the quantity to be interpolated can simply be broadcast from each atmospheric cell to all underlying ocean cells However this is really not necessary Assume that the value of the quantit
232. d 198 CHAPTER 15 GENERAL MODEL OPTIONS 15 19 10 timing This option allows any Fortran source code or portions of the code to be timed using a simple set of timing routines Executing script run timer will exercise these routines by solving a tracer equation in various ways This is useful when trying to optimize speed for a particular computer platform Refer to Section 6 2 8 for details 15 19 11 equivalence mw This option hides the nine two dimension fields of the coefficient matrix for inverting the external mode elliptic equation over the memory window space This can be done since the external mode and internal mode are essentially orthogonal calculations and the space required by one can be used by the other Chapter 16 External Mode Options There are three ways to solve for external mode depth independent velocities and they are described in the following sections 16 1 stream function Option stream function enables the time honored standard approach which basically eliminates the unknown surface pressure from the momentum equations by vertically integrating and taking the curl Boundary conditions are Dirichlet which necessitate solving island equations as given in Section 16 1 4 Changes to the coefficient matrices and in the handling of islands in the elliptic solvers have resulted in faster convergence rates than in MOM 1 The external mode velocities given by the stream function approach are guaranteed to be diverge
233. d described below The individual terms in Equation 18 56 are given as 1 L 1 Em PATI te erat T stor j ow 2 gt VM 18 57 1 jrow k 1 i 2 L km imt 1 tdivjrown Ec Y YD ADV jrow 18 58 LI jrow k 1 i 2 d L imi l T tflUrjrown LL 51 18 59 1 Grow 1 1 1 km imt 1l tSOTCjrown Dn 5 SOUTCEC kj issu 18 60 1 jrow k 1 1 2 km imt 1 l 1 L DIFF Tyi skj A 18 61 1 jrow k 1 1 2 tdi fjrown 230 CHAPTER 18 DIAGNOSTIC OPTIONS where the area element and total area of a latitude are given by AT row tmask 1 jrow dzt cos row lt dytjrow 18 62 imi l Al ow 18 63 2 18 64 The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file tracer bud dta If option netedf or meridional tracer budget netedf is enabled data is written in NetCDF format to file tracer bud dta nc rather than in unformat ted IEEE The interval between output is specified by variable tmbint and the control is specified by variable iotmb The averaging period is typically the same as the interval but may be spec ified shorter by variable tmbper These variables are input through namelist Refer to Section 5 4 for information on namelist variables Note further that this dataset may be contracted in latitude and region space to yield a zero dimensional
234. d alone mode To define the averaging grid follow the example in the USER INPUT section of timeavgs F It is possible to arbitrarily pick which model grid points will be on the averaging grid However the code is set to specify a constant spacing between points on the averaging grid in longitude latitude and depth Model grid points nearest to this spacing will be chosen as the averaging grid To incorporate this averaging grid into MOM 2 follow the directions given when script run timeavgs executes The output from this diagnostic is written as 32 bit IEEE unformatted data to file t ime mean If option netcdf or time_averages_netcdf is enabled data is written in NetCDF format to file time_mean dta ne rather than in unformatted IEEE The interval between output is specified by variable timavgint The averaging period is controlled by variable timavgper Both variables are input through namelist Refer to Section 5 4 for information on namelist variables Typi cally the averaging period is set equal to the interval for output but it may be specified as less than the interval Refer to Section 18 1 3 for a discussion of when this is appropriate If option time_averages can produce the same output as option snapshots then isn t op tion snapshots redundant It would be except for the fact that option time_averages needs storage space to accumulate data to produce averages This space is equal to the size of the data being averaged Typically 5 imt
235. d size Variable mixing coefficients for momentum are a bit more difficult In addition to making a similar substitution in Equation 15 52 additional terms given in Wajsowicz 1993 must be included Note that option smagnimix does include such terms 15 15 2 biharmonic This is a basic mixing parameterization which is best thought of as another form of constant horizontal mixing that replaces the V terms by V terms and uses biharmonic mixing coeffi cients Amb and App instead of Am and A in Equations 2 8 2 9 2 3 and 2 4 A rough scaling argument is given by Aj V a z Ag V a 15 56 which leads to A Am 15 57 where A is the grid scale To compute V mixing terms for each tracer component second order V mixing terms are computed first using the diffusion operators given by Equations 11 58 and 11 59 The second order mixing term is given by del2 y i442 DIFF t DIFF 15 58 for n 1 nt tracer components assuming the northern and eastern fluxes of tracer have been computed using Equations 11 42 and 11 43 The offset of 2 is intended to leave room for two velocity components Fluxes of del2 k 42 on the eastern and northern sides of T cells are then computed using diff_cet kj 342 6 del2i k j n 2 cos del2 del2 2 diff cet kj GEL 1 Kj nr2 7 C zi kj n2 1 2smw jemiw 15 59 cos Pirow dzu dif
236. d system is linear with one equilibrium Exercise caution if contemplating this Contained in file gasbc F 15 At grid locations given by st and ytjrow 10 1 COUPLING TO ATMOSPHERIC MODELS 97 where subscript m refers to the ordering described in Section 10 3 Typically only SST is needed but it may be desirable to let the atmosphere sense that the ocean surface is moving in which case the horizontal velocity components might also be used Pacanowski 1987 In any event these quantities are accumulated in sbcocn jrow m within MOM 2 and averaged at the end of each time segment Basically what needs to be done in gasbc is to interpolate the time averaged sbcocn jrow m fields to sbcatm which is an array of the same surface boundary conditions except defined on the atmosphere boundary condition gridt One of the duties of setatm is to define A as the atmospheric boundary condition grid which includes extra boundary points along the borders to facilitate these interpolations SST outside Ocean domain There is a complication if the ocean is of limited extent SST must be prescribed outside the ocean domain as a surface boundary condition for the atmosphere on the A grid To accommodate this the ocean domain T7 must be known in terms of Ajj and a buffer or blending zone must be established Within this zone SST from mom is blended with the prescribed SST outside the ocean domain as indicated in Figure 10 3 As a simpli
237. dating central row and writing results back to disk 30 CHAPTER 3 DATAFLOW Figure 3 3 a A slice through the volume of three dimensional prognostic variables on disk Note that only two tracers nt 2 are assumed For nt gt 2 a new box is added for each tracer b Schematic of a memory window of size jmw 6 holding the slice c Two dimensional schematic of the memory window d One dimensional schematic of the memory window 3 5 PARALLELIZATION 31 je v fo e o fot CI je v fo e o fot x aci zow on ais Read from disk to MW Memory to memory Calculated Row j in the MW Offset between jrow ard j written beck to T1 jro R C P Figure 3 4 Schematic of dataflow between disk and memory for one timestep with a memory window size of jmw 3 in MOM 2 32 CHAPTER 3 DATAFLOW Memory juw 4 for Bibamunic sd e x aci zow on ais Read from disk to MW Memory to memory copy Calculated Row j in the W GEL E written keck to T1 ro R C P Figure 3 5 Example of dataflow between disk and memory for one timestep with a memory window size of jmw 4 and the biharmonic option in MOM 2 3 5 PARALLELIZATION 33 Memory 5 for Bihamunic E E H E x jron cn disk Read from disk to MW 7 Memory to memory Calculated Row j in the MW Offset between jrow and j written beck to TL sce Fig
238. ddy resolving model Journal of Physical Oceanography 18 320 338 B ning C 1989 Influence of a rough bottom topography on flow kinematics in an eddy resolving circulation model Journal of Physical Oceanography 19 77 97 B ning C and R G Budich 1992 Eddy dynamics in a primitive equation model sensitivity to horizontal resolution and friction Journal of Physical Oceanography 22 361 381 B ning C W and P Herrmann 1994 Annual cycle of poleward heat transport in the ocean results from high resolution modeling of the North and Equatorial Atlantic Journal of Physical Oceanography 24 91 107 Bryan F O and W R Holland 1989 A high resolution simulation of the wind and thermo haline driven circulation in the North Atlantic Ocean In Parameterization of Small Scale Processes Proceedings of the Fourth Aha Huliko a Hawaiian Winter Workshop edited by P M ller and G Holloway University of Hawaii at Manoa 99 115 Bryan F O C W B ning and W R Holland 1995 On the midlatitude circulation in a high resolution model of the North Atlantic Journal of Physical Oceanography 25 289 305 Bryan K 1986 Poleward buoyancy transport in the ocean and mesoscale eddies Journal of Physical Oceanography 5 921 933 Bryan K 1991 Poleward heat transport in the ocean A review of a hierarchy of models of increasing resolution Tellus 43 104 115 Cox M D 1979 A numerical study of Somali Cur
239. dels of the ocean circulation Journal of Physical Oceanography 2 510 514 Bryan K 1984 Accelerating the convergence to equilibrium of ocean climate models Journal of Physical Oceanography 14 666 673 Gerdes R C K berle and J Willebrand 1991 The influence of numerical advection schemes on the results of ocean general circulation models Climate Dynamics 5 211 226 Gerdes R 1993 A primitive equation ocean circulation model using a general vertical coor dinate transformation 1 Description and testing of the model Journal of Geophysical Research 98 14683 14701 Gerdes R 1993 A primitive equation ocean circulation model using a general vertical co ordinate transformation 2 Application to an overflow problem Journal of Geophysical Research 98 14703 14726 Hirst A C and T McDougall 1996 Deep water properties and surface buoyancy flux as simulated by a z coordinate model including eddy flux advection Journal of Physical Oceanography 26 1320 1343 Haney L 1971 Surface thermal boundary condition for ocean circulation models Journal of Physical Oceanography 1 241 248 Korshiya T K Tishkin V F Favorskii A P and M Y Shashkov 1980 Flow variational difference schemes for calculating the diffusion of a magnetic field Sov Phys Dokl 25 832 834 Power 5 B 1995 Climate drift in a global ocean general circulation model Journal of Physical Oceanography 25 1025 1036 Ti
240. described in Section 19 5 Recommendation MOM 2 can produce many types of diagnostics and all are described within this chap ter How to organize and view results from these diagnostics has been a major problem in the past With the adoption of a NetCDF standard results can now be viewed almost without effort A good way to visualize results is to use Ferret which is a graphical analysis tool developed by Steve Hankin 1994 at NOAA PMEL email ferret pmel noaa gov URL http www pmel noaa gov ferret home html Note that when enabling lots of diagnostics substantial reduction in computational time can be realized by opening up the memory window even on a single processor As an example execute the test case script run mom and open the memory window wider than the minimum jmw 3 in file size h Of course the price to be paid is an increase in the required memory After timing a particular configuration option timing should always be disabled because the act of timing takes non negligible time 219 220 CHAPTER 18 DIAGNOSTIC OPTIONS 18 1 1 NetCDF formatted data In general the format of diagnostic output files can be either in 32bit unformatted IEEE as described in Section 18 1 2 or as NetCDF Saving diagnostic data in NetCDF format is the preferred approach since diagnostic output is immediately accessible to visualization packages which support NetCDF This means that there is no need to write and maintain code for manipulat
241. design now appears robust enough that future design changes are likely to be relatively small perturbations However it would be naive to expect that with time changes and improvements would not be sprinkled throughout On the other hand new parameterizations are likely to involve substan tial amounts of code but if existing options are used as guidelines this code should limited to a few contiguous code sections In any case the strategy for upgrading outlined in Section 19 15 will make elevating local modifications to future releases of the model relatively easy This method of upgrading is straightforward and has been in use for some time by researchers within GFDL who like to keep abreast of the latest development version Differences between MOM 1 and MOM 2 There are major architectural differences between MOM 1 and MOM 2 As a result there is no simple utility which will provide a meaningful upgrade path from MOM 1 to MOM 2 Migrating from MOM 1 to MOM 2 is a matter of biting the bullet and should only be attempted at the beginning of an experiment One of the first differences to notice is a change in naming variables To remove lack of uniformity and to provide guidance in choosing variable names for future parameterizations a naming convention has been adopted as described in Section 5 1 Not only variable names but details of subscripts and numerics within this documentation consistently match what is found in the model code Therefore
242. dional resolution was to be Ag 1 then the two previous bounding latitudes would need to be replaced by four one at 30 where A 1 one at 10 where Ay 1 35 one at 410 where Ay 1 3 and one at 30 where Ag 1 Poleward of 10 degrees meridional resolution would telescope from Ag 1 3 to Ag 1 over a span of 20 The average meridional resolution in this region is calculated as the average of the bounding resolutions which is DB 2 3 Therefore there would be We 30 additional grid cells in each hemisphere between latitudes 10 and 30 Example 3 Suppose it was desired to construct a square grid between latitude 60 S and 60 N with 1 resolution at the equator The bounding longitudes would be set as in Example 1 To keep the grid cells square the latitudinal resolution at 60 would be Ay 1 cos 60 0 5 Therefore two latitudinal regions are required The first is specified as being bounded by latitude 60 S where A 0 5 and latitude 0 S where Ay 1 0 the second is bounded by latitude 0 S where A 1 0 and latitude 60 N where Ay 0 5 Each region has a width of 60 and N 099059775 80 grid cells 1 Actually two extra boundary cells are added to the grid domain in the latitude and longitude dimensions but not in the vertical historical reasons Calculations range from i 2 to imt 1 in longitude jrow 2 to gmt 1 in latitude and k 1 to km in depth where domain size i
243. ds 7 1 1 T KL Tat x d dip Y At ek DG 1 ip k kr jli k j x kr 0 i k kr j 2 spi 14 3 i k kr j un 1 1 1 aeq cose yy jgdyuj t4ig X AGED Gi kt kr j ks j Tue iig X 4 cos dyt j 220 Kono 6 DUM 2 YF iktkr j 1 jq eterna 15 99 2P akg Z 627i t 1 i T Adat da ui 1 ip Y At ek Da 1 ip k kr jli k 3 be 1 ip ktkr j X 0 kr 0 i k kr j spi Lip keke i k kr j lk 1 1 1 i k kr j s eq qu cosp Y G kt ker P 1 jali k j by Tigger tig X 4 cos dyt j 220 i k kr by Pieter iia 15 100 i k kr j MEN Section 15 16 3 contributed by Stephen M Griffies smgQ g f dl gov Last revised October 1996 15 16 4 gent mcwilliams Option gent mcwilliams applies only when option isopycmix is enabled It calculates the effect of mesoscale eddies on isopycnals in terms of eddy induced transport advective velocities This section assumes familiarity with Section 15 16 3 and is based on the notes of Gokhan Danabasoglu which have been re written for the terminology and implementation in MOM 2 For a commentary on the general properties of tracer mixing refer to Appendix A Values required for this option are input through namelist Refer to Section 5 4 for information on namelist variables The eddy induced advective velocities as with the regular
244. ds be i k kr ik Pi ip k kr p k k Pi ik B 222 6 oy ipee vi Lip k kr With an average on the y derivative in the denominator these two terms can be identified as B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 303 the vertical difference T dytjdzt 1 dytjdztr Es XO k 1 kr i k 1 6 Se LET 4 Lip k 14 1 kr 0 i k 1 kr 2 k 1 kr sT k 162p Lis k 1 kr z Titip k thr Oz j k 1 4 k 1 4 kr 4 k 1 kr 7 2 k 1 kr 9 i k 100 5 i a k 1 kr j tia 6 1 Introducing the volume factor Vr and shifting the sum this difference becomes y mm 7 0 gt dau 14 Y Aat ik 1 1 ip k 1 kr i k U 1 6 9 UD as kr 0 t k 1ltkr t k 1I kr 6 7 p ep 1 ip k DNE s Ti 1 TN 1 B 223 i k 1 kr i k 1 kr i k 1 kr 5 k 1 kr EN t k 1 In the fourth term of equation 221 shift the ip sum to 0 1 and adjust the i label accordingly to have the third and fourth terms take the form dz kr Y Ag kli ip k x kr 1 1 0 i tp i ip ILI i ip TNNT iip k y yPi ip k zPi ip k kr ii 2 i 1 Fip Kk y i 1 ip k Y Ax 4 1 ki 1 ip k 4kr zp Ltip ktkr X kr 1 tp 0 vii k Supe y n 6 t 1 ip k y n 8 i 1 ip k
245. e presence of an average operator which arises from the recombination of terms and C The freedom to prescribe a different diffusion coefficient to each of the sub cells The assumption A was necessary in order to derive the traditional 3 point Laplacian starting from the functional These points in somewhat more elaborate forms will also arise in the discretization of the isopycnal diffusion operator B 2 2 Grid partitioning Using the functional in the form given in equation B 15 for the full tensor or equation B 16 for the small tensor motivates a discretization which projects separately onto the three planar slices x y y z and z x The only derivative in the orthogonal direction is within the Vp piece in the full tensor The discretization of the Ap VT term can be done using the traditional 5 point Laplacian and will not be discussed further Figures B 2 and B 3 show the projections for the x y and z x planes as defined on the MOM2 default grid The y z plane is similar Within a plane the central T cell is partitioned into 4 generally non equal squares with one corner being the T point and the other corners being the corners of the T cell The sides of these squares have dimensions 1 2 the relevant U cell distance since the T cell in the MOM2 default can generally be off centered There are an additional 8 quarter cells which surround the 4 central cells each of size determined by the 1 2 U cell distances and each of which has
246. e were two of the fundamental reasons that the Cox 1987 diffusion scheme was unstable and so required background horizontal diffusion Consult Griffies et al 1997 for complete details Section C contributed by Stephen M Griffies smg g fdl gov Last revised October 1996 Appendix D References This Appendix provides some references which might be of use to users MOM 2 Contained here are references which discuss issues ranging from numerical technicalities to coupled atmosphere ocean climate modeling This listing is not complete and the reader is encouraged to point out omissions or make suggestions for extending the list in order to make it more complete The references are categorized for easier referencing with some references crossing categories D 0 7 References used in the manual Adcroft A C Hill and J Marshall 1996 Representation of Topography by Shaved Cells in a Height Coordinate Ocean Model Submitted to Monthly Weather Review Aris R 1962 Vectors Tensors and the basic equations of Fluid Mechanics Dover publishing Boris J P D Book 1973 Flux corrected transport SHASTA A fluid transport algorithm that works Journal of Computational Physics 11 38 69 Brown J A K A Campana 1978 An economical time differencing system for numerical weather prediction Monthly Weather Review 106 1125 1136 Bryan F 1986 Maintenance and variability of the thermohaline circulation Geophysical
247. e 4096 of the total time in which case the CPU time of the ocean model with FCT will be 1 6 times larger than without Section 15 18 4 contributed by Ruediger Gerdes rgerdes AW I Bremerhaven DE 15 19 Miscellaneous This section contains various options which haven t been placed into other catagories 15 19 1 knudsen Option knudsen computes density coefficients according to the Knudsen formulation If this option is not enabled then density coefficients are computed according to the UNESCO for mulation Refer to Section 6 2 2 for details 15 19 2 pressure gradient average Option pressure gradient average implements the pressure gradient averaging technique of Brown and Campana 1978 which can allow the time step to be increased by up to a factor of two in certain circumstances This applies when the time step is limited by internal gravity waves The actual time step which should always be determined empirically will typically be some what less than the theoretical factor of two limit It should be noted that this is not a damping scheme The amplification factor A in the stability analysis given by Brown and Campana 1978 is unity within the region of stable solutions Basically the way it works is that instead of using p in the hydrostatic pressure gradient a semi implicit density given by p alpha pi 1 1 2a p 15 180 is used with alpha 1 4 Brown and Campana 1978 also discuss three computa
248. e and the time at the centers of the data records There are two memory buffers one to hold data from the disk record whose centered time precedes the model time the previous data and one to hold data from the disk record whose centered time has not yet been reached by the model time the next data Four alternative interpolation methods are supported as described in Section 10 2 6 2 8 timer F File timer F contains the timer module It can be exercised in a stand alone mode by executing script run timer which enables option test timer The module contains general purpose timing routines which are useful for optimizing any code The timing routines consist of calls to tic and toc routines which are placed around code to be timed Many levels of nesting are allowed as well as dividing times into categories and sub categories The driver which is overly complex simulates solving a tracer equation using various forms for calculating advection and diffusion Timing results are given for each case Experience shows there is no one form that is optimum on all computers so if one wants to optimize speed for a particular environment these routines will be useful In MOM 2 most code sections are outfitted with calls to these timing routines Enabling option timing in MOM 2 will give an indication of how much time is taken by various options and sections These routines take time themselves to execute and so should be disabled once results a
249. e are defined as Derivative operators Ojplkg alaiki GAN 11 6 oliki Eo 11 7 CO Pun TA 11 8 6 08 11 9 where grid distances measured in cm are determined by the distance between variables as indicated in Figures 7 1 7 2 and 7 3 and discussed in Chapter 5 When is defined at T k jrowgrid points then aAA dru a 6370 x 10 and when is defined at Ui k jrowgrid points then aAA dzt 41 Similarly dA jrow dytjrow when is defined at Tik jrowgrid points and aAgjrow dytjrowy1 when aj is defined at U k jrowgrid points Note the negative sign in the vertical derivative This is because z increases upwards while k increases downwards The negative sign in Equation 11 8 is usually absorbed by reversing the indexing to give A TERI IE 11 10 In the finite difference approximation to the time derivative Equation 11 9 is appropriate for the normal leapfrog time steps where 2A7 is in seconds As indicated in Section 11 1 on mixing time steps the denominator is replaced by Ar 11 2 1 Key to understanding finite difference equations The grid distances measured in cm are determined by the distance between variables as indicated in Figures 7 1 7 2 and 7 3 Before looking at any finite difference equations the reader should convince him herself of the following relations e If kjrow 18 defined at the T cell grid point given by Tik jrow th
250. e design continues to be motivated by a search for a better way to do science from the trenches of scientific programming The generality and flexibility within MOM 2 will make it well suited for use by the general oceanographic communityt Given the awarding of a computer contract in 1995 for a CRAY C90 at GFDL which was followed by a CRAY T90 in 1996 and a CRAY T3E expected in early 1997 most scientific work over the next five years will be done on vector machines with a few tens of processors rather than MPPs with thousands of processors The intent is for MOM 2 to take advantage of this environment without sacrificing scientific productivity to ideas that serve the needs of computational science at the expense of physical science The following factors are considered to be important in maximizing overall scientific productivity 1 1 1 Speed In the past speed was often thought of as being the equivalent of scientific productivity In an operational setting where a model is rarely changed it is justifiable to expend enormous effort to minimize wall clock time In a research environment it has become increasingly apparent that other considerations are important This is particularly noticeable when changes introduced to take advantage of speed make implementation of science thereafter more difficult What is needed are changes which increase speed but don t reduce clarity Ultimately speed should be Although optimized for the environment at G
251. e dissipative properties of the continuum operator For the Laplacian in an isotropic media it is trivial to produce Besides the unpublished notes of Dukowicz and Smith have only been able to find discussion of this approach for finite difference equations in the Soviet literature see Goloviznin et al 1977 Tishkin et al 1979 and Korshiya et al 1980 2 Consistent in that the discretization reduces to the correct continuum operator as the grid size goes to zero 215 216 APPENDIX B ISOPYCNAL DIFFUSION a dissipative numerical operator In the anisotropic case such as isopycnal diffusion it is nontrivial Indeed the original discretization of the isopycnal diffusion operator in the GFDL model is numerically consistent but not dissipative The approach taken in the derivation of the new discretization of this operator is to focus on discretizing the functional first and then to take the discrete version of the functional derivative in order to derive the discrete diffusion operator This approach ensures that the discretized operator is dissipative no matter how the functional is discretized B 0 2 Neutral directions The functional formalism provides a powerful framework to discretize the isopycnal diffusion operator Within this framework provision is made for a discretization of the diffusion fluxes which are aligned according to the best approximation of the neutral directions These con siderations imply that the densi
252. e expressions computational modes take the form of 2 delta X type waves i e the smallest resolvable lattice wave For higher order schemes we are exposed to computational modes of longer wavelength The presence of these waves often signal the ability for grid noise to manifest in the solution and so should be avoided As an example of the what is described above we highlight one part of a recent study of isopycnal diffusion in the GFDL model In Griffies et al 1997 see also Appendix B it was found that one source of grid noise in MOM is the original Cox 1987 discretization of the isopycnal diffusive flux For the small angle approximated diffusion tensor the Cox 1987 discretization of the flux in a two dimensional x z model is 0 2 3 6 us 4 Pik r 7 FR Sa C 2 di zPi k Lk In order to define the diffusive fluxes consistently on the B grid the x flux must be placed at the east face of the T cell i k and the z flux at the bottom of this cell With this placement the divergence of these fluxes across the T cell results in a diffusion operator R T Ji s FE 1 properly placed at the center of the cell at the location of the tracer 7 For the off diagonal terms the second terms of the fluxes a spatial averaging in the form of a double average O brings the z derivative terms appearing in the x flux onto the east fa
253. e gradient of the tracer and density are required The form for the grid difference operators are given here There are further details regarding the reference points to be used in determining the density gradient The reference point issues are discussed in Section B 2 6 The difference operator approximating a derivative will be written Tipi Links 6sT kj B 42 dzu cos oP diks E 43 j Tix T Tiki Abd B 44 dzWk Notice how the cos is absorbed into the 6 operator x y plane For the x y plane suppressing the k index the tracer gradient in the 12 boxes is given by VT 1 i6 T 14 Ey Ti ST B 45 VT 2 i6 T j T 6 7 B 46 VT 3 i T 15 6 1 1 B 47 VT 4 i6 T j6 T ja k6 T g B 48 VT 5 bT j 36 6 B 49 VT 6 i6 T j yTixa ja 6 B 50 VT T i6 T 4j 6 11 B 51 VT 8 i6 T 14 j LTi ji t ke Tia B 52 VT 9 i6 T jj j6 T 6 7 B 53 VT 10 67 6T EST 54 VT 1 7131 67 55 VT 12 i6 T 1 j6 Ti a k6 T 5 1 B 56 There is one thing to note regarding the z derivative in these expressions It is no longer centered on the 1 j plane and so presents a problem The only place this issue raises its head is in the Vp term for the full tensor in which all three derivatives are required A
254. e integration for the ocean model Contained within file setatm F in the MOM 2 SBC directories 8 within file atmos F in the SBC directories This is the subroutine that does the time integration for the atmosphere model The length of one time segment should be divisible by the length on one ocean time step to allow an integral number of calls to subroutine mom The same holds true for the atmosphere time step 1 f the diurnal cycle is included the coupling period needs to be reduced to allow adequately resolution in 95 96 CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE alternately integrated for each time segment while holding surface boundary conditions fixed Note that this may require multiple calls to each model In Figure 10 2 the loop variable ntspas stands for the number of time steps per atmosphere segment and the loop variable ntspos stands for the number of time steps per ocean segment Products of each atmosphere segment include surface boundary conditions for the ocean averaged over that segment These are held fixed and applied to mom while it integrates over the same segment Products of integrating mom include surface boundary conditions for the atmosphere which are also averaged over this seg ment Subsequently they are held fixed and applied to atmos on the following segment This process is represented schematically as a function of time in Figure 10 1 and continues until all time segmen
255. e m is the number of processors This leads to a memory explosion which effectively limits large models to unitasking e Three disks are required For instance if one processor were to write its 7 1 data to a row on the 7 1 disk before another processor read data from that row on the 7 1 disk the second processor would get 1 instead of 1 data 16 The rows on which prognostic variables are updated to time level 1 and written to disk 1 24 CHAPTER 3 DATAFLOW Memory windows are independent of each other and cannot access each other s memory Therefore in the limit where the number of processors approach the number of latitude rows there is a maximum amount of redundant calculations involving meridional gradients and averages on each latitude row Additionally each latitude must be read three times per time step from the 7 and 7 1 disks Calculations involving density adding external mode to internal mode velocities and generating land sea masks must also be done three times for each latitude row Latitude rows are not guaranteed to be processed sequentially from jrow 2 jmt which means that results may be written in random order to diagnostic and analysis files Each variable within the model needs to be defined as either shared or private Mistakes in defining variables are easy to make and difficult to find This situation limits flexibility and makes model development difficult The unfortunate fact
256. e minimum is three and the maximum is jmt e nt number of tracers in the model Usually set to two The first is for potential temperature and the second is for salinity as described in Section 5 2 8 Additional tracers when nt gt 2 are passive and initialized to 1 0 at level k 1 amd 0 0 for levels k gt 1 Some secondary ones are e mnisle maximum number of unconnected land masses islands e maxipp maximum number of island perimeter coastal points This includes coastlines from all land masses 5 2 4 T cells A complete description of grid cells is given in Chapter 7 For cells on the T grid given by Tik jrow the primary grid distances in longitude and latitude are given by e 11 longitudinal coordinate of grid point within cell T k jrow in degrees Index rincreases eastward with increasing longitude Y tirow latitudinal coordinate of grid point within cell T k jrow in degrees This is written in the equations of this manual as Index jrow increases northward with increasing latitude e drt longitudinal width of equatorial cell T in cm e dyjlj 4 latitudinal width of cell T in cm e cslj j cosine of latitude at the grid point within cell T k jrow This is written in the T equations of this manual as cos 46 CHAPTER 5 VARIABLES 5 2 5 U cells A complete description of grid cells is given in Chapter 7 For cells on the U grid given by Uik jrow the primary
257. e number of times while a physicist would be well aware that there is only a finite number of molecules involved so you can get your perfect drink with a finite mixing effort only you would have no way to tell whether you ve got it or not In any case the number of times you need to mix is very large and this is the problem of the standard convection scheme of the GFDL ocean model Cox 1984 which mixes two adjacent levels of the water column if they are statically unstable The model includes the option to repeat this mixing process a number of times at each time step as an iteration process towards complete removal of static instabilities The minimum number of iterations needed to mix some of the information from layer 1 down to layer n is n 1 To avoid this problem one needs to relax the condition that only two levels may be mixed at a time To achieve complete mixing a convection scheme is required that can mix the whole unstable part of the water column in one go I have been using such a scheme back in 1983 in a one dimensional mixing model for the Irish Sea and Pm sure many other people have been using similar ones Marotzke 1991 introduced such a scheme into the GFDL ocean model It appears that it hasn t been taken up as enthusiastically as it might have been and an implicit convection scheme which increases the vertical diffusivity at unstable parts of the water column has been preferred because of lower computational cost e g
258. e of any point on the geographic grid is still undefined To specify this last rotation choose a point on the geographic grid the globe to locate the rotated grid s prime meridian Set angle psir to zero and calculate the longitude of this point on the rotated grid This longitude is the final angle psir the angle needed to rotate the point back to the prime meridian The definition of psiris usually not very important since the new grid longitude is arbitrary but it does make a difference in defining exactly where the new grid starts This may be important if it is desirable to line up grids for nesting It may appear that all of the angle definitions are of the opposite sign to what they should be but this comes from thinking about rotating the axes rather than rotating the rigid body Generally the idea is to move the poles so that they are 90 degrees away from the area of interest For example to set up a model with an equatorial grid over the Arctic and North Atlantic the rotated grid north pole could be positioned at 0 N 110 W and a prime meridian point at 0 N O E This defines a grid rotation in which the new grid equator is along the 20 W and 160 E meridians The rotated grid longitude is east north of the geographic equator and west to the south On the rotated grid North America is in the north and Europe in the south and the geographic north pole is at 0 N 90 E It is more difficult if you want to specify an arbitrary grid rotation
259. e solved for the central memory window row j 2 updated values are written to latitude row jrow 2 on the 1 disk Subsequently the memory window is moved northward by copying 7 and 7 1 data from memory window row j 2 into memory window row j 1 followed by copying both time levels from memory window row j 3 into memory window row j 2 and reading latitude row jrow 4 from the tau and 1 disks into memory window row j 3 After all equations are solved for the central row in the memory window j 2 updated values are written to row jrow 4 on the 1 disk This process continues until latitude rows between jstask 1 1 and jetask 1 1 on the 7 1 disk have been updated in a sequential manner As indicated in Figure 3 9 the second processor simultaneously does the same operations described above using latitude rows jstask 2 through jetask 2 Note that there is some overlap between rows accessed by processor 1 and processor 2 Since the entire pool of disk space is accessible by any processor this presents no problem However in a distributed system where memory local to each processor is being used instead of disk communication between processors is required for latitude rows adjacent to the memory boundaries Refer to Section 3 5 3 for details Some consequences These are the consequences when multitasking with option coarse grained parallelism e Memory requirements increase as m times the size of the memory window wher
260. e the diffusion coefficients are generally nonconstant z level frame The orthogonal isopycnal frame allowed for a simple prescription of the isopycnal diffusion pro cess In order to describe such a diffusion process in other frames of reference the components of must be transformed Such rules of transformation are standard e g Aris 1962 The diagonal components from the orthogonal isopycnal frame are transformed to the z level frame through hK A 48 where the transformation matrix is given by equation A 44 Written as matrices with A having components this transformation takes the form K AKAT where K has the diagonal form given in equation A 45 Performing the matrix multiplication KS We Vines A 0 0 5 E 0 Km 5 0 A 0 gt I gt S sum 1157 I SV14S2 5 1 5 14 82 0 1 0 0 Ap 20 Tm VES V1rs2 V1 82 A 49 yields the components of the diffusion tensor in the z level system given by Redi 1982 D PER e e e 1 ee T km m oee i A 50 2 12x _ pex 2 c 1 e Da e 5 Since this frame is flat metric is the unit tensor there is no distinction between lower and upper labels on the components of a tensor In general the convention for tensors such as K when written as a matrix is that the first index indicates the row and the second index is for the column A 3 ISOPYCNAL DIFFUSION 271
261. e upper bound for the solution is Mar __ low low low low low low low Tr Marty js bet kine bik ine abba kie tikin 15 178 The additional computational load due to the three dimensional limiter is moderate because most of the needed maxima and minima have already been computed during the calculation of the one dimensional limiters Total advective fluxes are given by adv feiy anti fei adv fnij fni adv fbi kj fbr t C bi anti_fbikj 15 179 16Where is a small value O 107 to avoid division by zero 194 CHAPTER 15 GENERAL MODEL OPTIONS In comparing the program code with this description it will noticed that most quantities are computed for row j instead of row j The anti diffusive flux anti_fnj41 is needed to compute R 4 which enters Equation 15 176 for the meridional direction If option fct dlm2 is used the low order solution is needed in Equation 15 169 For economic reasons zonal and vertical fluxes for row j 1 are already calculated and delimited at row j The meridional flux anti_fnj41 is calculated but not yet limited at row j while anti_fn has already been calculated the row before and is now delimited at row j The scheme is expensive in terms of computer time The time spent in subroutine tracer increases by a factor 2 5 In a typical coarse resolution model with potential temperature and salinity subroutine tracer may requir
262. e which if any changes are needed and enter them in the USER INPUT section of module topog The kmt jrow field can also be viewed with option topog_netcdf which may be more convenient Recommendation When setting up a model for the first time use options idealized with flat bottom to generate a flat bottomed idealized geometry for the region of interest After becoming comfortable with the way the process works enable a more appropriate option e g option scripps_kmt 4 Select options from a list of available ones described in Chapter 15 Enable selected options by including them on the compile statement in script run mom to configure the model Diagnostics are the analysis tools used to help understand the model solution Select appropriate diagnostics from the ones described in Chapter 18 and enable them by including them on the compile statement in script run mom Recommendation When setting up new model use options idealized ic simple and restorst which will simplify initial conditions and boundary conditions Also choose the simplest mixing schemes using options consthmix and constvmix Only after verifying that results are as expected should consideration be given to moving on to more appro priate options In general progress by enabling and verifying one option at a time until the desired configuration is reached If problems occur simlify the configuration to help pinpoint the cause Note that it is no longer
263. ean data as given by Equation 15 3 in Section 15 9 7 15 9 5 time varying sbc data This option is used to supply monthly mean Hellerman and Rosenstein windstress and monthly mean Levitus 1982 sea surface temperature and salinity for use with option restorst Data is prepared for the resolution specified in module grids as described in Section 19 6 It is interpolated to the time step level in mom as described in Section 10 2 If option restorst is enabled surface temperature and salinity are damped back to this monthly mean data as given by Equation 15 3 in Section 15 9 7 15 9 6 coupled This option is used to couple mom to an atmospheric model assumed to have resolution differing from that of mom It allows for two way coupling as described in Section 10 1 15 9 7 restorst Ocean tracers are driven directly by surface tracer fluxes In some cases specification of surface tracer flux may lead to surface tracers drifting far away from observed data This may be due to errors in the data or in paramaterizations not capturing the proper physics When this happens it is desirable to restrict how closely sea surface tracers remain to prescribed data by use of a restoring term The prescribed data typically comes from options simple sbc time mean sbc data or time varying sbc data as described above Enabeling option restorst provides the restoring by means of Newtonian damping The damping is actually converted to a sea surface trac
264. ean models and the fundamental changes that the new scheme represents it is useful to provide the modelling community with complete details of the derivation Therefore it is hoped that those who are interested will carefully consider the discussion given in Griffies et al 1997 and in this appendix in order to expose any problems which may exist At this stage of numerically testing the scheme all appears with it Please note that in this Appendix diagonal diffusive fluxes are considered positive if they are down the tracer gradient The code in MOM 2 however employs the opposite convention The diffusion operator in MOM 2 picks up a minus sign which renders it the same as discussed in this Appendix B 0 1 Functional formalism The fundamental mathematical property that is exploited in this formalism is that the diffusion operator can be associated with a negative semi definite functional Courant and Hilbert For example Laplacian diffusion in an isotropic media R T V T is identified with the functional derivative R T 6S 6T where S f VT di lt 0 As shown in Section B 1 the negative semi definiteness of the functional S is related to the dissipative property of the diffusion operator i e one implies the other On the lattice not every consistent discrete diffusion operator corresponds to a negative semi definite discrete functional Therefore a consistent numerical diffusion operator does not necessarily possess th
265. ebugging Other features which are new to MOM 2 include the idea of a module which can be exercised alone or as part of a fully configured model and this is discussed in Chapter 6 An integrated DATABASE is described in Chapter 4 along with run scripts in Section 19 6 which will auto matically prepare this data for any of the configurations and arbitrary resolutions of MOM 2 Chapter 10 details a generalized surface boundary condition interface which handles all surface boundary conditions as if they come from a hierarchy of atmospheric models This includes simple datasets which are fixed in time through complicated atmospheric GCM s Mismatches in geometry and resolution between atmospheric GCM s and MOM 2 are automatically taken care of Elliptic equation solvers for the external mode have been re worked to be more accu rate and give speedier convergence as discussed in Section 11 13 The vertical velocity fields have been reformulated to prevent numerical separation in the presence of sharp topographic gradients as described in Section 11 5 The grid is constructed by a module which allows for a MOM 1 type construction with grid points always in the center of tracer cells on non uniform grids or a new way with grid points always in the center of velocity cells on a non uniform grids Both are second order accurate if the stretching function is analytic and are described in Chapter 7 All diagnostics have been re written to be more modular old ones ha
266. ecessary 11 5 ADV VEL COMPUTES ADVECTIVE VELOCITIES 113 Once the memory window has been loaded with variables the external mode velocity is added to the internal mode velocity to construct the full velocity as in Equations 2 13 and 2 14 The finite difference counterpart to the external mode given in Equations 2 15 and 2 16 is E 1 Ug row H i jrow 1 U 6X Pi irow r 11 21 H jrow COS ali 11 20 Ui jrow 2 The full velocity needs to be constructed for both time levels at this point because only the internal mode velocities are kept in the latitude rows on disk 1 Ui bidet qn 11 22 agrow 1 Ubki22 1 Hoo uL Al Vi irow r 1 11 23 1 270100 jrow 1 Ui kite F 66 Wijrow r 11 24 d jrow 1 _ 11 25 U H jrow COS where is the internal mode velocity 1 is the stream function and is the ocean depth defined over U cells by Equation 9 2 Finally the density rho is computed as a function of t 4 1 7 1i 4 5 2 and depth of level k based on a third order polynomial fit to the equation of state for sea water The density is actually a deviation from a reference density pi as detailed in Section 6 2 2 11 5 computes advective velocities Subroutine adv_vel constructs advective velocities on the north east and bottom faces of
267. ect of mesoscale eddies on isopycnals Only used when option gent mewilliams is enabled Units are in tracer units per second e ADV_Tziso the counterpart to ADV 2 k using the Gent McWilliams advective velocity which comes from parameterizing the effect of mesoscale eddies on isopycnals Only used when option gent mewilliams is enabled Units are in tracer units per second DIFF Tz the flux form of zonal x diffusion of tracer defined on the T k jrow grid point Units are in tracer units per second 5 4 NAMELIST VARIABLES 51 DIFF the flux form of the meridional y diffusion of tracer defined on the Ti k jrow grid point Units are in tracer units per second e DIFF Tz flux form of the vertical z diffusion of tracer defined on the T k jrow grid point Units are in tracer units per second e DIFF Tziso the flux form of the vertical component of isopycnal tracer diffusion defined on the T k jrow grid point Only used when option isopycmiz is enabled Units are in tracer units per second 5 3 2 Momentum Operators The details of the following operators used in solving the momentum equations are defined in file fdifm h e ADV Uz the flux form of the zonal x advection of momentum defined on the Ui jrow grid point Units are in em sec e ADV Uy i the flux form of the meridional y advection of momentum defined on the Ui jrow grid point Units are in em sec e ADV_
268. ed Uli 2AT ul 11 117 UL j2 rH Ui k j 2 T 1 T 2AT rU 11 118 Semi implicit Coriolis treatment If the Coriolis term is treated semi implicitly refer to Section 15 11 3 for a discussion of the semi implicit treatment and when it is warranted the equations are a n 4 x Ui iini 2 firow Wiki arti Wik gla 2AT 11 119 Ui k i241 2AT acor firow Uik jlr Uik j 2 1 T 2 uli i2 11 120 and the solution after a little algebra is given by 2 11 121 Uk dll u ksj l 1 T 1 4L 2Ar f 7 25 2 f acor u7 Ulgor 7 CAT S 11 122 wee 1 227 f acor The pure internal modes k 1 are then calculated by removing the incorrect vertical means km 1 s mu 5 5 dz ik in rl 11 123 GJTOW In the code 4 74118 stored in 1 The full velocity is actually not available until the next timestep when the external mode velocity is added in subroutine loadmw This completes the formal solution of the internal mode velocities 11 11 11 Filtering If the time step constraint imposed by convergence of meridians is to be relaxed the internal modes are filtered by one of two techniques Fourier filtering Bryan Manabe Pacanowski 1975 enabled by option fourfil or finite impulse r
269. eeman 1993 Multiple equilibria in a global ocean general circulation model Journal of Physical Oceanography 23 1670 1681 Power 5 B A M Moore D A Post N R Smith and R Kleeman 1994 Stability of North Atlantic Deep Water formation in a global ocean general circulation model Journal of Physical Oceanography 24 904 916 326 APPENDIX D REFERENCES Rahmstorf 5 1994 Rapid climate transitions in a coupled ocean atmosphere model Nature 372 82 85 Sarmiento J L and K Bryan 1982 n ocean transport model for the North Atlantic Journal of Geophysical Research 87 394 408 Treguier A M 1992 Kinetic energy analysis of an eddy resolving primitive equation model of the North Atlantic Journal of Geophysical Research 97 687 701 Tziperman E R Toggweiler Y Feliks and K Bryan 1994 Instability of the thermohaline circulation with respect to mixed boundary conditions Is it really a problem for realistic models Journal of Physical Oceanography 24 211 232 Weaver A J and E S Sarachik 1991 The role of mixed boundary conditions in numerical models of the ocean s climate Journal of Physical Oceanography 21 1470 1493 Weaver A J E S Sarachik and J Marotzke 1991 Freshwater flux forcing of decadal and interdecadal oceanic variability Nature 353 836 838 Weaver A J J Marotzke P F Cummins and E 5 Sarachik 1993 Stability and variability of the thermohaline circulatio
270. eferred to as DS This work is an extension of their earlier work described in Section 16 2 The rigid lid assumption is replaced by a free surface which exerts a surface pressure at 0 As in the rigid lid surface pressure approach an elliptic equation can be derived for the change in surface pressure Aps but the resulting equation is more diagonally dominant than the rigid lid surface pressure equation The implication is that the D method converges faster than the rigid lid surface pressure method As with the rigid lid surface pressure approach DS is well suited for SIMD parallel computers because it requires Neumann boundary conditions and thus needs no island integrals 16 3 1 The equations The equations are given as E1 E2 and E3 in DM and will be repeated here for convienence They are I o rB ut U g Gn 1 5 B 5 u u 36 40 2 n 1 n u orgGAm 16 42 where B is the Coriolis operator D is the divergence operator and G is the gradient operator The centering coefficients o y 357 0 and the quantities T 7 g and are as defined in DM This set of equations is very similar to the set in Dukowicz Smith and Malone 1992 except there is an extra divergence term and three centering coefficients needed to damp two computational modes Because of the similarities the surface pressure and implicit free surface methods share much of the same code in MOM 2 In the terminology of MOM
271. egions near areas of active deep convection e g Send and Marshall 1995 Therefore it may prove important to allow for a full realization of isopycnal diffusion for any slope T he discretization of the full Redi diffusion tensor provides a tool to help understand the physics of steep slope mixing of tracers without making any ad hoc assumptions about the strength of the along isopycnal diffusion Namely for certain grids the discretized full tensor allows for stable diffusion without slope checking For these reasons both the full and small angle isopycnal diffusion tensors have been implemented in MOM2 It is hoped that the discretization of both tensors will allow the physics of tracer mixing in regions of intermediate to steep isopycnal slopes to be accessible to rational numerical investigations with MOM2 B 1 Functional formalism in the continuum Before proceding to the discretization it is useful to discuss some functional calculus in the continuum B 1 FUNCTIONAL FORMALISM IN THE CONTINUUM 277 B 1 1 The functional for a general diffusion operator The diffusion operator can be written in two ways R T O K 0 T B 1 V F B 2 The first form emphasizes the symmetric positive semi definite diffusion tensor and the second emphasizes the diffusion fluxes F which are directed down the tracer gradient The corresponding functional is written S J di TK T B 3 a 8 lt Es B 4
272. ema in temperature at and 1 If ti k 1 7 1 exceeds this extrema by an amount which may be specified through namelist then there is numerical truncation at i k 7 Note that this statement can only be made because of the incompressibility condition If there are more than 100 locations exhibiting numerical truncation only the first 100 locations are shown 5 The locations are shown where predicted temperatures or salinities are outside the bounds of temperatures and salinities which were used for the construction of density coefficients If there are more than 100 locations where this occurs only the first 100 locations are shown 6 The location of maximum error in continuity is calculated considering all U cells and T cells separately 7 The maximum error in vertical velocity at the ocean bottom on T cells is computed This is the residual error from integrating Equation 11 32 vertically from the surface to the ocean bottom 8 The maximum vertical velocity at the ocean bottom on U cells from Equation 11 38 is computed This is non zero if the bottom has a slope since the bottom flow is required to parallel the bottom slope As described above if more than a specified number of CFL violations are found when this diagnostic is active only at times specified by the interval the integration will stop indicating where the most unstable locations are with matrix printouts of variables in the neighborhoods If a violation is
273. eme involving alternate mixing of odd and even pairs of levels is used Refer to Section 15 13 The mixing in the latter case may be incomplete and multiple passes through the scheme is allowed by variable ncon which is also input through namelist If explicit convection is active additional diagnostics are computed Refer to Section 6 2 1 for the details 11 10 12 Filtering If the time step constraint imposed by convergence of meridians is to be relaxed ti 4 1 18 filtered in longitude by one of two techniques Fourier filtering Bryan Manabe Pacanowski 1975 enabled by option fourfil or finite impulse response filtering enabled by option firfil Both should be used with caution and only when necessary at high latitudes firfil is much faster than fourfil 11 10 13 Accumulating sbcocn jrow m Finally if required as a surface boundary condition for the atmosphere t is accumulated and averaged over one time segment The result is stored in sbcocn jrowmWwhere m relates the ordering of n in the array of surface boundary conditions as discussed in Section 10 3 11 11 clinic computes internal mode velocities Subroutine clinic computes the baroclinic or internal mode velocities i k 1 for velocity components n 1 the zonal velocity and 2 the meridional velocity They are the finite difference counterparts of the velocities in Equations 2 1 and 2 2 after the vertical means have been removed The finite differ
274. en the operation 6A OE grow results in a quantity defined at the U cell grid point with index U e If 8 jrow is defined at the U cell grid point given by then the operation 6 Bi 1 k jrow 1 results in a quantity defined at the T cell grid point given by jrow These operations reflect the nature of the staggered B grid Once convinced of the above the second thing to be aware of is that it s not sufficient to only know what a quantity is anymore where it s defined is just as important The where information is usually built into the name of the variable by the naming convention described in Chapter 5 T here are a specific number of interesting places on the grid The grid point within a grid cell is one the east north and bottom face of a cell are others A quantity indexed by 1 amp 7 may be defined at the grid point in cell x or on the east north or bottom face of cell Note that if a variable 11 2 TIME AND SPACE DISCRETIZATIONS 111 Qik j is defined on the east face of cell its value on the west face of the cell is aj_1 4 Similarly if defined on the north face of cell j then its value on the south face of the cell is Qik j 1 Likewise if defined on the bottom face of cell k then its value on the top face of the cell is oj 1 5 Note that this convention is a departure from the indexing used in Bryan 1969 where the faces of cells were referenced by half indexes i e i 2 Half inde
275. ence equations given below are written in flux form to allow conservation of first and second moments as discussed in Chapter 12 The solution starts by computing the hydrostatic pressure gradient terms 11 11 1 Hydrostatic pressure gradient terms Both horizontal pressure gradient terms in Equations 2 1 and 2 2 are computed first The unknown barotropic surface pressure gradients exerted by the rigid lid at the ocean surface are not needed since only the internal mode velocities are being solved for 9 The discretized forms are given by 1 1 amp grada 11 77 COS 97 g p Kg COS QU X P 7 4 Ls Dany 11 78 po grad pik 42 d Pik poa j Ps j The discrete form of the hydrostatic Equation 2 6 is given by 6 Di k j grav Dpikj 11 79 25 Contained in file clinic F 26 Indeed lack of knowledge about these barotropic surface pressure gradients is the very reason the internal mode velocities are being solved for 124 CHAPTER 11 DISCRETE EQUATIONS with grav 980 6 cm sec and is used to eliminate p from Equations 11 77 and 11 78 Note that the hydrostatic pressure is an anomaly because is an anomaly as described in Section 6 2 2 The hydrostatic pressure gradient terms at the depth of the grid point in the first level are grav dzwo grad piij1 D cos dU D P 11 80 o COS Crow grav dzwg FERT
276. ened all the way to jmw jmt the appropriate number of processors for fine grained parallelism is num processors jmt 2 and disk space is not used Data for all three dimensional prognostic variables is retained in the memory window and it is not necessary to move the memory window northward After all rows have been updated to 1 values there is no need to copy data into proper locations for the next time step since time level pointers are recalculated to point correctly This situation is indicated schematically in Fig 3 8 Bear in mind that as the memory window is opened from minimum to maximum size details in the equations do not change All that is required to open the memory window is to specify parameter jmw in file size h The equations know nothing about the size of the memory window except for the range limits in the meridional do loops which surround all calculations 3 5 2 Coarse grained parallelism microtasking In the early 1990 s when MOM 1 was being developed it was decided that multitasking was a feature to take advantage of on the eight processor CRAY YMP at GFDL At the time there were two ways to go about this either the fine grained approach described in Section 3 5 1 or the coarse grained approach described here 14This can also be used with one processor although it takes more memory It is surprising at first that the memory required to run the test case with ymw gmt 61 is only about 2 5 times that
277. enetration of solar shortwave wouldn t matter However for the case where 21 1 10 meters the effect can be significant and may be particularly noticeable as warm SST in the summer hemisphere The divergence of the vertical penetration pen is calculated as Note that dampdz does not mean that depth over which tracers are restored is different than dztk 1 15 10 LATERAL BOUNDARY CONDITIONS 161 divpen penu i1 peny dzty for 1to km 15 6 and the sub surface heating due to the divergence is added to the temperature component of the tracer equation through a source term refer to Section 11 10 5 given by SOUP CE kj SOUTCE k j SbCOCN ipow m i jrow isw 15 7 where subscript isw points to the shortwave surface boundary condition In general since surface heatflux stf already contains a solar shortwave component the penetration func tion at the ocean surface is set to zero peno 0 to prevent the shortwave component from being added in twice once through the surface boundary condition stf 1 for vertical diffu sion given by Equation 11 46 and once through the source term given above For further information refer to Paulson and Simpson 1977 Jerlov 1968 and Rosati 1988 15 9 9 minimize sbc memory This option re dimensions buffer arrays used with option time varying sbc data for time inter polations Instead of being dimensioned as imt jmt these arrays are dimensioned as imt
278. ents are constant in space and time The down side of such a model is that maintaining 6 gt 1 2 might involve relatively small time steps Regardless the ability to run with the full isopycnal diffusion tensor without the ad hoc rescaling provides for a self consistent means of numerically investigating the issues of parameterizing tracer mixing for intermediate and large isopycnal slopes B 3 4 Vertical diffusion equation The ability to identify the 3 3 component of the Redi tensor is very useful since it enables the vertical diffusion equation to be solved implicitly in the same manner as with the old scheme B 3 5 Diabatic piece Full tensor The diffusion coefficients A n in the previous discussion of the full tensor corresponded to along isopycnal diffusion minus any explicit diapycnal diffusion e g see equations B 18 B 20 For modest slopes these two coefficients are very different with the along isopycnal diffusion roughly 107 larger When the full tensor needs rescaling for the intermediate slopes in which it is not stable the rescaled along isopycnal diffusivity is still roughly 10 10 larger than the diapycnal diffusivity Therefore the diffusion coefficient is essentially the along isopycnal diffusivity The discretization of diabatic diffusion therefore reduces to the discretization of B 3 GENERAL COMMENTS 307 T with the vertical piece done implicitly along with the piece of the isopycnal
279. er xi 19 80 80 87 8T 88 88 89 89 91 92 92 95 95 96 98 99 101 101 xii CONTENTS 11 10 9 Diagnostics 11 10 1 nd of tracer components 11 10 1 Explicit Convection 11 101 11 10 13 jrowm o e e e 11 11clinic computes internal mode velocities 11 11 1 Hydrostatic pressure gradient terms e 11 11 2Momentum components 11 11 3Advective and Diffusivefluxes 22s 11 11 4 0urce terms 11 11 5 Momentum operators 11 11 65olving for the time derivative of velocity 11 11 7 Diagnostics 11 11 8 Vertically averaged time derivatives of velocity 11 11 9 End of momentum components 11 11 1 omputing the internal modes of velocity 11 11 1Filtering 11 11 1A ccumulating sbeoenj jrowm e e e e 11 12End of computation within Memory Window 11 13tropic computes external mode 11 14 12 Discrete energetics 12 1 Non linear terms
280. er details refer to Appendix B 11 3 Start of computation within Memory Window Baroclinic velocities and tracers are solved for one group of latitudes at a time This group is contained within the memory window as detailed in Section 3 3 1 The number of memory windows or groups of latitude rows is controlled by a do loop loop wrapping around the following sections with a scope extending to Section 11 12 11 4 loadmw loads the memory window Subroutine loadmw begins by moving the memory window northward if necessary This operation involves copying data from the top two rows into the bottom two rows of the memory window as was described in Section 3 3 2 Next land sea masks tmask and umask k j are constructed from kmt jrow and kmui Their purpose is to promote vectorization throughout the calculations Note that when the memory window is fully opened jm jmt this calculation is only done once per run instead of redundantly every time step After building the land sea vectorization masks a group of latitude rows are read from the and 7 1 disks into the memory window Time level indices depend on whether it is a normal leapfrog time step or a mixing time step as described in Section 11 1 The grid distances must also be replaced accordingly 11 Contained in file loadmw F Tt is necessary for all but the first group of latitudes If the memory window is opened all the way when jmw jmt then no movement is n
281. er flux and enters the tracer equation as a top boundary condition for vertical diffusion The amount of damping is defined by a time scale dampts in days and thickness dampdz in cm which are input through namelist Refer to 160 CHAPTER 15 GENERAL MODEL OPTIONS Section 5 4 The thickness is redundant but its use is explained below Note that the damping time scale and thickness may by set differently for each tracer A Newtonian damping term applied to the first vertical level may be converted into a surface tracer flux by vertically summing as in km km 1 0 ra 15 2 2 2 dampis 86100 9 1 15 2 where t is temperature and 6 is the Kronecker delta 6 1 and 61 gt 0 The left hand side of Equation 15 2 equates to stf bmf where stf is the surface tracer flux and bmf is the bottom tracer flux which is taken as zero Applying the indexing terminology of MOM 2 the equation becomes dztk 1 t 4j stijn Tampis 861000 t 17 17 ijn time 15 3 where n time represents prescribed surface data for tracer n and dampts is the time scale However by introducing another factor dampdz the equation can be re written as dampdz 2 1 9 2 7 15 4 dampts 86400 inert 15 4 Sfi in dampit 74215 1 which gives a modified time scale of damptsn days The purpose of this awkward complication of re defining the time scale is to remind researchers that whe
282. er flux defined on the T grid for the latitude rows within the memory window n 1 is for heat flux in units of langley sec where 1 langley 1 cal cm n 2 is for salt flux in units of grams cm sec and n gt 2 is for additional tracers This field is dimensioned by the memory window size as stf imt jmw nt 5 2 13 2 D Workspace variables These two dimensional quantities are functions of geometry and topography Being independent of time they are computed only once and are dimensioned by imt jmt jrow number of T cells between the surface and bottom of the ocean defined at i jrow locations on the T grid It is constructed by module topog kmuj 4 number of T cells between the surface and bottom of the ocean defined at i jrow locations on the U grid It is given by Equation 9 1 mskhrj horizontal regional mask number used for certain diagnostics as described in Section 18 1 4 mskvr vertical regional mask number used for certain diagnostics as described in Section 18 1 4 This is only a function of k but is included here because of its close association with miskhr hi jrow depth from the surface to the bottom of the ocean defined at jrow locations on U grid in units of em In this manual hj jrow is written as jrow and is computed by Equation 9 2 hrijrow reciprocal of h jrow defined at i jrow locations on the U grid in units of 1 For masking purposes row
283. er for Atmospheric Research Boul der Colorado Oort A 1983 Global atmospheric circulation statistics 1958 1973 NOAA Prof Pap 14 180 U S Government Printing Office Washington D C Pacanowski R C and G Philander 1981 Parametrization of vertical mixing in numerical models of the tropical ocean Journal of Physical Oceanography 11 1442 1451 Pacanowski R C 1987 Effect of Equatorial Currents on Surface Stress Journal of Physical Oceanography Vol 17 No 6 318 APPENDIX D REFERENCES Pacanowski R C K Dixon and A Rosati 1991 The GFDL modular ocean model user guide The GFDL Ocean Group Technical Report No 2 Geophysical Fluid Dynamics Laboratory Princeton USA Pierrehumbert R T and H Yang 1993 Global chaotic mixing on isentropic surfaces Journal of Atmospheric Science 50 No 15 2462 2480 Philander G H and R C Pacanowski 1986 A model of the Seasonal Cycle in the Tropical Atlantic Ocean Journal of Geophysical Research 91 14192 14206 Plumb R A and J D Mahlman 1987 The zonally averaged transport characteristics of the GFDL general circulation transport model Journal of the Atmospheric Sciences 44 298 327 Press W H S A Teukolsky W T Vetterling B P Flannery 1992 Numerical Recipes in Fortran Second Edition Cambridge University Press Redi M H 1982 Oceanic isopycnal mixing by coordinate rotation Journal of Physical Oceanography 12 1154 1158
284. er with a simple traceback Basically three things are needed to prepare for writing each variable to a NetCDF data file 1 The axes information must be defined by making call to routine def_axzis which tem porarily stores the specified information One call to def_axis is required for each axis When all axes have been defined definitions are retrieved by making one call to rou tine get axes for each call to routine def axis This is typically done by one compact loop Ordering is important Retrieval must be done in the same order as definitions 2 All variables are defined by a set of properties name units etc Properties of each variable must be specified using a call to routine def var which temporarily stores the definition After all variables have been defined the definitions are retrieved by making one call to routine get_def for each call to routine def var Again this is done in one compact loop Ordering is important Retrieval must be done in the same order as definitions 232 CHAPTER 18 DIAGNOSTIC OPTIONS 3 The NetCDF file is opened with the specified information for variables and axes by a call to routine ncsetup This need be done only once Subsequent appending of data to the file only requires a re opening The above three steps need only be done once per diagnostic per run When writing variables must be written to the NetCDF file in the same order as they were defined This is done by one call to routine ncpu
285. ere Voz 2 Sz Sy 0 Ps Pz Py pz 0 is the isopycnal slope vector with magnitude S Since the transformation is between two orthonormal frames this transformation matrix is a rotation unit determinant and inverse given by the transpose and so can be interpreted in terms of Euler angles e g Redi 1982 270 APPENDIX A TRACER MIXING KINEMATICS Orthonormal isopycnal frame The relevance of the orthonormal isopycnal frame arises from the diagonal nature of diffusion within this frame as assumed by Redi 1982 In general diffusion is thought to occur pre dominantly along the two orthogonal directions and 65 which define the neutral directions that are tangent to the locally referenced isopycnal surface Diffusion in the diapycnal direc tion amp typically occurs with a diffusion coefficient which is on the order of 1077 times smaller Therefore in this frame the symmetric diffusion tensor takes on the diagonal form _ Ar 0 0 k 0 0 A 45 0 0 Ap where A are the along isopycnal diffusion coefficients and Ap z 1077 4 is the diapycnal diffusion coefficient The diffusion tensor written in terms of projection operators takes the form Km Ar Apezez A 46 with amp having the components 0 0 1 in the orthonormal isopycnal frame Explicitly the diffusion operator in these coordinates is R T T t Os ApOg T A 47 wher
286. erm in these expressions vanishes when the tracer is parallel to the isopycnal For most oceanographic cases the difference A Ap A to many orders of accuracy This assumption is made in the model implementation of the full isopycnal diffusion tensor Note the presence of the small diabatic pieces ApT and In the case of very steep isopycnals these terms become relevant The small angle result is F T 2 B 21 pz F T P B 22 pz pz F r Pep Puy pte B 23 2 Pz Pz These are the forms for the diffusive fluxes which will come out most naturally in the discretized case discussed in the next section B 2 Discretization of the diffusion operator In various iterations with this derivation it was found that the form of the functional given by equation B 15 is most convenient to discretize as it allows for projection onto two dimensional planar regions rather than having to consider a full three dimensional discretization as might be necessary for discretizing the full tensor Also the derivation of the full tensor s discretizaton turned out to be easier than the small tensor because of the higher degree of symmetry with the full tensor Therefore the derivation of the full tensor is presented in these notes with the small slope results obtained from the small slope limits of the full tensor An independent derivation starting from a discretization of the
287. ery useful UNIX utility is diff as described in Section 19 16 19 6 Directory Structure First refer to Figure 19 1 for a schematic view of how the directory structure of MOM_2 is organized at GFDL The structure is divided between two file systems the CRAY file system contains the data part and the workstation file system contains all code and run_scripts On the CRAY file system there is an ARCHIVE MOM_2 DATABASE directory The DATABASE contains Hellerman and Rosenstein 1983 monthly climatological wind stress on a 2 grid Oort 1983 Monthly Surface air temperature on a 5 grid Levitus 1982 monthly temperature and salinity on a 1 grid and Scripps topography on a 1 grid There is also an ARCHIVE MOM 2 EXP directory where interpolated data from the DATABASE and results from various experiments are stored each under their own sub directory The only sub directory included is EXP TEST CASE which after executing run scripts described below will contain an interpolated version of the DATABASE appropriate for the domain and reso lution of the test case which is described below On the workstation file system there is also 2 directory containing code run_scripts and four sub directories MOM 2 PREP DATA for preparing surface boundary conditions and initial conditions MOM 2 SBC for handling various types of surface boundary conditions 2 containing routines to interface to the netcdf library
288. es are set in subroutine setocn This option does a Fourier smoothing of prognostic variables in the longitudinal direction by knocking out wavenumbers larger than a critical one which is dependent on latitude The critical wavenumber is given as cos row cos rig where is the number of waves to retain im is the length of an ocean strip and 3 10 is a reference latitude row Because of geometry and topography each filtering latitude is composed of strips defined by starting and stopping longitudes and each strip is a function of latitude and depth Any variable a where i 1 m can be filtered by a discrete Fourier transform 15 13 N 2 N 2 1 271 Qril 5 A cos TI a 15 14 Z im Z im where is the filtered value composed of N wavenumbers given by Equation 15 13 and the even and odd Fourier coefficients A and B are given as 1 N Ao m 1 15 1 im 22 15 15 IA mL 2 X 2n if im Ag X a cos for 1 2 15 16 im 4 im 1 im Aim 2 x 20i cos im 15 17 1 1 lA aril im isin 1 2 lt 1l 15 18 Soa sin for Unless an aqua planet is being investigated When filtering velocities the reference latitude row is given by jfu0 15 11 FILTERING 165 Even Fourier coefficients are used to filter tracers because the boundary condition at edges of the strips is no flux Odd Fourier coefficients
289. es in the case of active open boundary conditions bj e decide if a new timestep of prescribed psi values has to be read from the disk based on sponge F e if a time interpolation has to be done then the values are prescribed cobc h Coefficient definitions are given for advective and phase velocities at open boundaries obc data h Definitions are given for open boundary data pointers and damping coefficients based on Sponge h Extra add in files The following files are included by preprocessor commands only if open boundary conditions are enabled They are kept in separate files to keep the structure of the model clear e clinic obc inc e loadmw obc inc e mom obc inc e setocn obc inc tracer obc inc tropici obc inc e tropic2 obc inc 13 4 CHANGES IN EXISTING SUBROUTINES 145 13 4 Changes in existing subroutines iounit h New units for open boundaries have been added size h e set parameters for options obctest and obctest2 e option obc is defined as a general ifdef for open boundary conditions e a minimum for the memory window is set as jmw 4 only zonal open boundary condi tions bcest F Define wind stress and tracer surface values for restoring with option obctest2 checks F Add consistency checks for allowed combinations of ifdefs clinic F Linearize velocity components at boundaries e at jrow 2 and jmt 2 add in clinic obc inc e at i 2 and i imt 2 add in clinic obc i
290. esponse filtering enabled by option firfil Both should be used with caution and only when necessary at high latitudes firfil is much faster than fourfil 11 11 12 Accumulating jrow m Finally if required as a surface boundary condition for the atmosphere Pacanowski 1987 surface velocity components Wii jn are accumulated and averaged over one time segment The result is stored in sbcocn jrow mWhere m relates the ordering of n in the array of surface boundary conditions as discussed in Section 10 3 1 Although the paper explored the affect on SST primarily through Ekman divergence there may also be an impact on evaporative flux in certain regions where the ocean surface velocities are large 130 CHAPTER 11 DISCRETE EQUATIONS 11 12 End of computation within Memory Window As each group of latitudes is solved within the memory window the updated baroclinic velocities and tracers are written to disk as explained in Section 3 3 1 and the next group issued in Section 11 3 is started After all memory windows have been solved the forcing for the barotropic velocity has been constructed in Section 11 11 8 and the external mode equations can now be solved 11 13 tropic computes external mode velocities After the baroclinic velocities have been computed for all latitude rows in the domain the barotropic or external mode velocity can be computed Subroutine tropic computes the barotropic velocity 4 4 41 for n 1 and 2 b
291. esulting equations are not Only the first brackets are being done here The implicit Coriolis terms stand no chance of being symmetric Note that remote island perimeter cells neither appear in the equation centered at o nor do they contain references to cell in their up to nine terms 16 2 RIGID LID SURFACE PRESSURE 201 symmetric The asymmetry between a mid ocean cell and a neighboring island perimeter is likely to be especially severe It is possible that some of the problems arising with the use of conjugate gradient solvers in MOM 1 may be attributed to MOM 1 s normalization of the elliptic equations and the resulting de symmetrization of the coefficient array Section 16 1 5 contributed by Charles Goldberg chgQ g f dl gov 16 2 rigid lid surface pressure Option rigid lid surface pressure enables the method developed by Dukowicz Smith and Mal one 1992 which is hereafter referred to as DSM Instead of taking the curl of the vertically integrated momentum equations to drop the surface pressure the divergence is taken which yields an elliptic equation for the surface pressure instead of a stream function Its main advan tage is that Neumann boundary conditions apply instead of Dirichlet boundary conditions and there is no need to solve island integrals which perform poorly on SIMD parallel computers However elliptic equation solvers converge very slowly using this method 16 2 1 The equations Basically the
292. etbcx extrapolate values onto open boundaries only with options obc west and obc_east 13 5 Data Preparation Routines obc F This routine is based on the PREP DATA routine sponge F and prepares the open boundary values for T and S For input it uses the standard Levitus data prepared by ic F or ASCII data written by FERRET Hankin and Denham 1994 The damping factors have to be specified search for USER INPUT T wo files obci mom for zonal and obc2 mom for meridional open boundaries are written Following ifdefs can be chosen 148 CHAPTER 13 STEVENS OPEN BOUNDARY CONDITIONS makeobc driver readferret use FERRET data as input formatted listing otherwise Levitus data are used obc north obc south obc west obc east write netcdf additional netCDF output obcpsi F This routine prepares open boundary values for v It uses output formatted listing of FERRET Alternatively values for psi must be given directly A file obcpsi mom is written Following ifdefs can be chosen makeobcpsi driver readferret use FERRET data as input formatted listing otherwise data must be given di rectly obc_north obc_south obc_west obc_east write_netcdf additional netCDF output 13 6 TO DO List How to set up open boundaries 1 Choose regions of open boundaries carefully at locations where the barotropic velocity is mostly perpendicular to the boundary Open the grid one cell further for open boundaries so the o
293. f Gokhan Danabasoglu Note that the requirement of zero vertical isopycnal advection velocity at the top face of cell 1 and bottom face of cell k bottom indicates that 5 and 5 must be zero at these surfaces k 1 adv 001180 kj coat 5 s advvetiso1m s adv vntiso j 1 dzt 15 107 1700 mol The eddy induced advection terms are discretized as 1 LIP i ki coset 6 adv_vetiso _1 1 1 3 t s adv vntisoik ji T E33 jrow 6 adv vbtiso y 4 jiki 15 108 where adv_vntiso 4 contains an embedded cosine factor as does adv vont Refer to Section 11 10 7 for a definition of the Gent McWilliams advective operators 15 16 5 held larichev This option calculates isopycnal mixing coefficients and Ayry based on vertically inte grated Richardson numbers as given in Held and Larichev 1995 This is experimental and as of this writing needs more work to restrict the mixing to the levels where baroclinic instability is possible T herefore this scheme is not suitable for use at this time Values required for this option are input through namelist Refer to Section 5 4 for information on namelist variables 15 17 EDDY INTERACTION PARAMETERIZATIONS 185 15 17 Eddy interaction parameterizations 15 17 1 neptune Option neptune implements the following Based on statistical mechanics arguments Holloway 1992 proposed that interaction between mesoscale eddies and topography re
294. f enti i COS 9 ow 6o del2i k jnt2 del2 p del2 2 1 2 1 7 2 cos Prou Lm dy Ujrow J l jemw 15 60 Using these fluxes in operators given by Equations 11 58 and 11 59 the biharmonic mixing terms are construced A similar process is repeated for velocity components n 1 2 using del2i k jn DIFF t DIFF Uyix t DIFF metrici y jn 15 61 where the northern and eastern fluxes of velocity have been computed using Equtaions 11 88 and 11 89 Fluxes of del2 on the eastern and northern sides of U cells along with the metric term are then computed using 176 CHAPTER 15 GENERAL MODEL OPTIONS k diff feik cos x del2i i js jrow del2 in Qj jsmw jemw 15 62 U COS toii diff f niki diff enuis 7 cos 5 aes del2i k jn del2 k 44 4 del2i k jn diff cnui i COS jj 1 jemw dyt jrow 1 15 63 1 tan D ow DIF F metrici kon Am dein Us radius _ 2sin OF ow del2 44 4 5 3 5 del2i 4k i 3 n radius cos Co ow det 15 64 Two extra boundary conditions are required and are taken from conditions on V at land boundaries Mixing coefficients are independent of space and time and the biharmonic option requires option consthmix to be enabled as well Note that since this is a fourth order scheme the minimum size of the memory window i
295. ffusive terms Turner 1973 In these terms p is replaced by p po Equivalently the vertical scale for variations in the vertical velocity is much less than the vertical scale for variations in po z and fluctuating density changes due to local pressure variations are negligible The latter implies that the fluid can be treated as incompressible which excludes sound and shock waves In addition to the Boussinesq approximation Bryan 1969 imposed the the hydrostatic approximation which implies that vertical pressure gradients are due only to density When horizontal scales are much greater than vertical scales the hydrostatic approximation is justi fied and in fact is identical to the long wave approximation for continuously stratified fluids According to Gill 1982 the ocean can be thought of as being composed of thin sheets of fluid in the sense that the horizontal extent is very much larger than the vertical extent It should therefore come as no surprise that most of the energy associated with motion lies in components with horizontal scales much larger than vertical scales Bryan 1969 also made the rigid lid approximation to filter out external gravity waves The speed of these waves places a severe limitation on economically solving the equations numerically As noted above surface displacements are relatively small Their affect on the solution is represented as a pressure against the rigid lid at the ocean surface First introduced
296. fication SST is prescribed outside the domain of mom as a constant which is obviously unrealistic and should be prescribed by the researcher as a function of space and time appropriately along with the width of the blending zone SST within the blending zone is a linear interpolation between the two regions Interpolations to atmos grid Each surface boundary condition is interpolated one at a time using essentially the following steps e For limited ocean domains prescribe SST in sbcatm outside the mom domain as described above When ocean and atmosphere domains match this is not necessary Extrapolate sbcocn jrow m into land areas on the mom grid This is done by solving V S ST jrow 0 over land cells using ocean 5 ST boundary conditions The idea is to get reasonable SST land adjacent to coastlines but not necessarily to produce accurate SST jrowin the middle of continents Where land and ocean areas on the ocean and atmosphere grids are mismatched this extrapolation will ameliorate the sensing of erroneous 5 9T by the atmosphere Such situations are common when coupling spectral atmospheres to MOM 2 which has an Arakawa B grid Interpolate sbeoen jrowm to sbcatmy jim The ocean resolution is typically higher than that of the atmosphere because the Rossby radius is larger in the atmosphere To prevent aliasing the interpolation is an area average of sbc0 N jrow m for those jrow cells which fall wi
297. for MOM 2 at GFDL Appendix A Tracer mixing kinematics In the process of arriving at a new formulation for the isopycnal diffusion scheme in MOM 2 it was useful to understand the basic kinematical properties of tracer mixing when parameterized by a second order mixing tensor This appendix serves to document certain of these properties which although perhaps well known by some were not found to be readily accessible in the literature In this appendix only continuum equations will be discussed and coordinates are referenced to a frame tangent to the geopotential i e 2 y 2 The MOM code uses spherical coordinates and the coordinate transformations are straightforward e g Haltiner and Williams Chapter 1 The basic equation to be considered here is the tracer mixing equation 0 4 i V T R T A 1 where the mixing operator R T is given in an orthogonal coordinate frame by R T Om J On T A 2 In these expressions the Einstein summation convention is assumed in which repeated indices m n are summed over the three spatial directions J is a second order tensor whose con travariant components are written as J The three dimensional velocity field is assumed to be divergence free V i 0 T represents any tracer such as potential temperature salinity Or passive tracer In general this equation represents a parameterization of mixing due to many different processes occurring over a wide range of sca
298. formatted data having a nc suffix as described in Chapter 18 There are some additional files The files document dta and restart dta also have a dta suffix but are not diagnostic files File document dta is a formatted file containing all namelist settings plus some additional information File restart dta contains data needed to restart the integration from the point where it last ended To write a restart variable restrt must be set to true in the namelist Within an actual integration pathnames would be changed so that these files would be copied to the experiment directory e g cp nc EXP ATLANTIC on the supercomputer archive Refer to Section 18 1 1 for post processing the results The script run mom is set to execute CASE 0 test cases have a heavy load of diag nostics enabled for demonstration purposes Look at the timing estimates at the end of the printout to see what they cost Turn off the ones not needed by removing them from the option list in script run mom 19 8 Sample printout files As mentioned previously there are four printout files corresponding to four test cases which were executed at GFDL on a CRAY T90 Results from CASE 0 are in file EXP TEST CASE printout 0 gfdl from CASE 1 are in file EXP TEST CASE printout 1 gfdl and so forth These cases are not intended to be scientifically meaningful Rather they are included as examples of how to use 258 CHAPTER 19 GETTING STARTED various types of su
299. g po 1 035 e 5ix variables are needed for fluxes through the faces of T cells and U cells Note that there is no explicit T or U cell suffix on these names because they are re calculated for each prognostic variable in T cells and U cells Note also that since these are re calculated for each prognostic variable they are not candidates for being moved as the memory window moves northward Units are in cgs and specific to the quantity being advected or diffused _ k advective flux on the east face of a cell adv fni advective flux on the north face of a cell adv fb advective flux on the bottom face of a cell diffusive flux on the east face of a cell diff fnij diffusive flux on the north face of a cell diff_fbi k diffusive flux on the bottom face of a cell cO oO e W e There are three coefficients for diffusion of tracers across T cells and another three for diffusion viscous transfer of momentum across U cells They may or may not be triply subscripted It depends on the physics parameterization For instance options consthmix andconstomix use coefficients which are constant throughout the grid and therefore require no subscripts Units are cm sec diff cet diffusive coefficient on the east face of cell T diff_cnt diffusive coefficient on the north face of cell T k jrow diff cbti k diffusive coefficient on the bottom face of cell T k jrow VISC_CeU
300. g to three spatial dimensions The index need only be dimensioned for the size of the memory window Refer to Chapter 1 for a description of the memory window and Section 5 2 for a description of jrow n 1 is the zonal and n 2 is the meridional velocity component Vertical velocity is not a prognostic variable It is a diagnostic variable defined as an advective velocity at the bottom face of cells Note that since there are T cells and U cells there are vertical velocities associated with each For diagnostic purposes the vertical velocity on the bottom of T cells is output n 1 is for potential temperature in units of degrees n 2 is for salinity in units of deviations from 0 035 grams of salt cm of water or parts per mill ppm 0 035 MOM 2 uses po 1 035 gm cm for the Boussinesq approximation These units can be converted to parts per thousand ppt by adding 0 035 grams cm and multiplying by 1000 n gt 2 is for additional passive tracers 48 CHAPTER 5 VARIABLES e Two variables are needed for density and hydrostatic pressure gradients 1 rhoj density defined at T cell grid points Units are in sigma units gm cm and represent departures from reference densities specific to each model level as described in Section 6 2 2 In this manual rho is written as 2 grad_p k jn hydrostatic pressure gradient 1 is for the zonal component and n 2 is for the meridional component Units are in cm sec assumin
301. g used in MOM The first form is Cartesian or horizontal vertical diffusion in which the principle axes are assumed to be defined by the local tangent to the geopotential surface i e the constant Eulerian 2 y 2 frame the term z level is used in the subsequent The tracer mixing tensor is diagonal in the 2 2 coordinate system and there is no anti symmetric component Additionally the components of the diffusion tensor in the horizontal directions are generally taken to be roughly 10 times larger than the vertical components This large anisotropy arises from the strong vertical stratification in most regions of the ocean which suppresses vertical mixing Isopycnal diffusion From the standpoint of tracer mixing the natural set of coordinates are those defined with respect to the isopycnal or neutral directions These coordinates define what is termed here The variance of the tracer is given by var T vo dz T vod dz T gt 0 with V faz the domain volume Reducing f d T is therefore equivalent to reducing var T A 3 ISOPYCNAL DIFFUSION 269 the orthonormal isopycnal frame Diffusion in this frame is assumed to be diagonal in the formulation of Redi 1982 The along isopycnal diffusion is on the order of 107 times greater than the diapycnal diffusion Refer to Redi 1982 McDougall 1987 Gent and McWilliams 1990 for discussions motivating such diffusive mixing This section presents some technical de
302. ges more quickly if the stream function values on all land masses are allowed to float Afterwards the entire solution is adjusted to make the stream function zero on the main continent Choosing a stream function value of zero on the main continent and on an island amounts to an over specification of the problem and should not be done Another approach Another approach suggested by Charles Goldberg leads to the same result Equation 17 12 indicates that the right hand side of Equation 16 13 centered at a land or ocean perimeter cell jrow contains values of zu jrow n on land that are not available In fact forc jrow is the line integral of 21 jrow n around the boundary of cell T The island equation for land mass m is formed by summing Equation 16 13 over all land and ocean perimeter T cells of land mass m Since each right hand side is a line integral around the boundary of one T cell in the sum of such line integrals over all of land mass m and its surrounding ocean perimeter cells all contributions from interior edges cancel leaving only known values of 20 jrow n at ocean U cells On the left side of an island equation Equations 17 9 and 17 10 and the fact that Vijrow Ym on all land and ocean perimeter T cells of land mass m imply that all contributions from land T cells are zero as follows At a land T cell all nine values of are the constant value so by pulling all terms that don t involve 7 or j
303. gnostic equations are solved only on row 2 In a second order window with jmw 4 they are solved for rows 2 and 3 For a further description of how this works refer to Section 3 3 3 Calculations always proceed up to latitude row jrow jmt 1 even with higher order schemes There are no out of bounds references because meridional indexing is limited to a maximum at latitude jrow jmt and a maximum corresponding memory window row given by j min j jof jmt jof f To accommodate higher order schemes when a fully open memory window jmw jmt is used meridional fluxes are set to zero at latitude jrow jmt which allows calculations to proceed through latitude row jrow jmt 1 15 19 4 implicitvmix Option implicitvmix allows the vertical diffusion of momentum and tracers to be solved implic itly under control of an implicit vertical diffusion factor aidif which is input through namelist Refer to Section 5 4 for information on namelist variables Setting aidif 1 0 gives full implicit treatment and setting aidif 0 gives full explicit treatment Pages 42 and 43 of Numerical Recipes 1992 recommend a setting of aidif 0 5 which is the Crank Nicholson scheme followed by a few fully implicit steps using aidif 1 0 The reason according to Anand Gnanadesikan is because when R K 6t Az gt 1 the explicit 196 CHAPTER 15 GENERAL MODEL OPTIONS treatment of diffusion produces wiggles in the solution which are the
304. grid distances in longitude and latitude are given by e zu longitudinal coordinate of grid point within cell U k jrow in degrees Index increases eastward with increasing longitude YUjrow latitudinal coordinate of grid point within cell U k jrow in degrees This is U Index jrow increases northward with written in the equations of this manual as 5 increasing latitude e dru longitudinal width of equatorial cell U k jrow in cm e dyUjrow latitudinal width of cell U k row in cm e C8Ujrow cosine of latitude at the grid point within cell This is written in the equations of this manual as cos 5 2 6 Vertical spacing A complete description of grid cells is given in Chapter 7 For T cells and U cells the primary grid distances in the vertical are given by e distance from the surface to the grid point in cell 7 jrow or Uik jrow in units of cm The T cells and U cells are not staggered vertically Note that although zt is positive downwards the coordinate z is positive upwards Index k increases downward zw distance from the surface to the bottom face of cell Ti k jrow or U jrow in cm The T cells and U cells are not staggered vertically e dzt vertical thickness of cell T k jrow or Ui k jrow in cm dzw vertical distance between the grid point within cell 7 k jrow and the grid point within cell T 441 jrow in cm It s the same for the U cells 5 2 7 Time level indices A
305. h a map of land masses and island perimeters followed by a map of kmt jrow Along with these maps is information on how to suppress their printing since they can take up lots of space The section finishes with a checksum for the topography and geometry After constructing a checksum over initial conditions various initializations are indicated The time manager module tmngr gives details on the calendar and time at initial conditions as well as information on the reference time for diagnostic switches This is followed by information on damping surface tracers back to data which is given when option restorst is enabled Since the test case is of global extent filtering of latitude rows is enabled by option fourfil or firfil and information is given as to which latitudes are filtered and by how much Refer to Section 15 11 for a discussion of filtering Next comes some statistics on regions which have been arbitrarily set for diagnostic purposes along with a map detailing where the regions are A detailed listing of filtering indices is suppressed but may be switched on as indicated The time step multipliers are all set to unity indicating that there is no timestep acceleration with depth If option time_averages has been enabled information on the grid over which data will be time averaged is given and if option 2015 is enabled the XBT station locations are given Depending on enabled options other initializations may give output here after whi
306. h the file can again be closed and the unit number released with another call to relunit nu Possible file keyword attributes include e sequential for sequential files or direct for direct access files or word note the blank at the end for CRAY word I O files formatted or unformatted rewind or append words for specifying record length in words for direct access files e sds for solid state disk on CRAY computers outfitted with solid state disk ieee for 32bit IEEE format on CRAY computers float for reading restart data written by a CRAY YMP or C90 but read on a CRAY T90 which has a 64bit IEEE native format Note that the argument lists are the same as in the older version but that abbreviations for file attributes are not allowed Fortran 90 When compiling under Fortran 90 option 90 must be enabled to handle differences between Fortran 77 and Fortran 90 These differences occur only in file F 6 2 5 poisson F poisson F contains the elliptic equation solver module It is exercised in a stand alone mode by using script run poisson which enables option test poisson Module poisson uses the grid defined by module grids and the topography and geometry defined by module topog Three methods of solution are provided and can be compared within module poisson se quential relaxation enabled by option oldrelax in MOM 2 sequential
307. he Sverdrup relation Thus the vertical shear of the current is free to adjust to local density gradients Heat and salt are advected out of the domain if the normal component of the velocity at the boundary is directed outward When the normal component of the velocity at the boundary is directed inward heat and salt are either restored to prescribed data active open boundary conditions or not passive open boundary conditions In contrast to the above described active open boundary conditions passive ones are characterized by not restoring tracers at inflow points Additionally a simple Orlanski radiation condition Orlanski 1976 is used for the streamfunction In what follows the northern and southern open boundaries are detailed Open boundaries at the eastern and western end of the domain are handled in a similar manner except where noted WARNING Tests for active and passive open boundary conditions are included as options and described below However open boundary conditions is not an option which can be simply enabled to see what it does Not only is data along the open boundaries needed in the case of active open boundaries but topography along open boundary points must be chosen carefully Additionally prescribing a net tranport along the open boundary via wy requires that changes be made in the stream function calculation Although open boundary Check the mailing list for e mail add
308. he T cell is given by Ui kd dYUjrow Ui 1 1 dA sp ow 1 ado vet y 12 15 1 5 3 2471 jou and the advective velocity on the northern face of the cell is given by Ui k j2 r dUi Uii kj 2r dtu adv vnt pj Uik j2 T Vidua OTU COS 12 16 2421 Note that the finite difference counterpart of the incompressibility Equation 2 5 is arrived at by using the advective velocities on the horizontal faces of T cells adv vet 4s kj advunt 1 vbt y 4 adv vbti kj 0 dat cos row dytjrow COS Ph now dat 12 17 Substituting Equation 12 17 into Equation 12 14 leads to 1 gmt 1 km imt 1 d _ bt _ m d _ bt 5 5 Pi k j dxt cos T os dyt jrowd Zt p Po jrow 2k 1 i 2 k 12 18 where the transformation of indices i 1 i and 7 1 j is used to center the kernal on Tik jrow Because the advective velocity at the surface adv vbt o bottom face of the deepest ocean cell adv vbt p kmt 15 zero Equation 12 18 can be re arranged to yield 1 jm 1 km imt 1 M a doticos Foy dytjow pi i Pik j 12 19 Po jrow 2k c2 i 2 where once again the limits have been adjusted to cover all cells in the vertical Using the discrete hydrostatic Equation 11 79 reduces Equation 12 19 to 1 jm 1l km imt 1 M M YS grav vbt 4 deticos dytjrowd
309. he include file is used for purposes of parallelization If it were not for this include file this module would be truly plug compatible and highly portable The following is a summary of subroutines within the utility module indp Function indp index of nearest data point searches an array to find which element is closest to a specified value and returns the index of that array element ftc 6 2 LIST OF MODULES 71 Subroutine ftc fine to coarse interpolates data defined on a fine resolution grid to a coarser resolution grid It does this by averaging together all cells on the fine grid which lie within each coarse cell Partial overlapping areas are taken into account ctf Subroutine ctf coarse to fine linearly interpolates data defined on a coarse resolution grid to a fine resolution grid extrap Subroutine extrap extrapolates data defined at ocean cells to land cells on the same grid The intent is to force oceanographic quantities into land areas to allow reasonable values for interpolations involving coastlines This is important in air sea coupled models where coastlines and resolution may not match between models setbcx Subroutine setbcx sets boundary conditions on arrays iplot Subroutine iplot plots an integer array with characters thereby giving a quick contour map of the data imatrix Subroutine imatrix prints values of an integer array in matrix format matrix Subroutine matriz prints values of a
310. he surface heat flux However solar short wave penetration into the ocean is a function of wavelength The clear water case assumes energy partitions between two exponentials as follows 58 of the energy decays with a 35 cm e folding scale 4296 of the energy decays with a 23 m e folding scale If the thickness of the first ocean level 021 1 50 meters then shortwave penetration wouldn t matter However for 021 1 10 meters the effect can be significant and may be particularly noticeable in the summer hemisphere See Paulson and Simpson 1977 Jerlov 1968 and Rosati 1988 ke t Jn tame using a Newtonian damping time scale dampts in units of days and a thickness dampdz in units of cm Both are input through a namelist Refer to Section 5 4 for information on namelist variables Note that damping time scale and thickness may by set differently for each surface tracer These are used to convert the Newtonian damping term into a surface tracer flux as described under option restorst in Section 15 9 7 These four surface boundary conditions for the atmosphere come from the ocean 1 2 mapsbc 6 references SST in units of degrees C mapsbc 7 references sea surface salinity which is typically used for damping surface salinity back to prescribed climatological values This is used to compute an effective salt flux mapsbc 8 references the zonal component of the velocity from the first level in the vertical in units of cm se
311. he three terms 13 19 21 combine to form dxuj_1 COs 4 s Tia p ep 6 o5 2 t 6p 2 pt 2 dxuj_1 COs 1 dyt 4 k i k amp 1 pU ik 1 k 1 k 1 D yo o py dzwy 4 dyt i k 4 13 0070 x i A 21 6 0 0D X 1 A 13 5 1 pea spi dzwy 4dyt i 1 k SEN p S x pP D M B 210 i l k 1 i l k spi P P The diffusion coefficient A 13 is chosen to make the x projection of the isopycnal slope k p aR pp _ _ k See i 1 kli k 1 SE B 211 ZFk 1 satisfy 5 Sa 9 i 1 k i D lt S B 212 if the grid parameter 0A GUN zp is 1 2 where one and only one of the grid spacing is in the vertical Otherwise no rescaling of the diffusion coefficient is necessary to maintain numerical stability To make explicit this association introduce the notation A 13 Ae i 1 k i k 1 B 214 Likewise let A 19 Azt i 1 ki 1 k 1 B 215 A 21 Ag D i 1 k 1i k 1 B 216 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 301 denote the other diffusion coefficients whose values are set according the value of their respective slopes Introducing summation notation the three terms 13 19 21 can
312. here are unexpected gains to be realized To integrate the equations detailed in Chapter 2 a volume of ocean is divided into a large number of rectangularly shaped cells within which equations are solved by finite difference tech niques Storage for each variable must be allocated for each cell If storage were to be allocated entirely within memory the maximum attainable resolution would be severely limited This restriction can be greatly relaxed by allocating total storage on a secondary device such as disk and allocating only enough memory to integrate equations for one slice of the ocean s volume at a time Successively reading integrating and writing slices back to disk allows equations to be solved for the entire volume of ocean with significantly less memory in comparison to total storage requirements 1At GFDL the eight processor CRAY YMP had 32MW of central memory which had been upgraded to 64MW within the last year of its lifetime Solid state disk space was 256MW The assumption is that memory is a precious resource which is to be conserved Historically this has been true and the expectation is that it will continue to be in the future The viability of this depends on disk access speed Solid State Disk on the CRAY YMP is fast enough to allow this to work well Slower disk access can also work if the reads from disk are buffered by the work involved in updating the slice In practice this is not difficult to implement as long a
313. here will always be mixing processes too small to resolve in ocean models there will always be a need to rationally parameterize these processes Determining the nature of mixing tensors relevant for these parameterizations if such objects exist is proving to be one of the most challenging problems in physical oceanography today Appendix A contributed by Stephen M Griffies smg g fdl gov Last revised October 31 1996 Appendix B Isopycnal diffusion This appendix provides details for the discretization of iso neutral or isopycnal diffusion of trac ers in MOM 2 Although some motivation is given here the reader is referred to a manuscript currently under preparation by Griffies Gnanadesikan Pacanowski and Larichev hereafter Griffies et al 1997 for a more complete discussion A draft of this manuscript will be made available sometime late Autumn 1996 In arriving at the formulation given here extensive benefit was derived from interactions with John Dukowicz and Rick Smith at Los Alamos They developed much of the Functional Formalism used here and applied it to the discretization of the small angle isopycnal diffusion tensor in the Los Alamos Parallel Ocean Program POP However there are some important differences between the POP implementation and that in MOM2 which have to do with the computation of the neutral directions and the discretization of the diffusion coefficients Given the importance of isopycnal diffusion in oc
314. high order scheme With this option the model should reproduce the results of the central differences scheme Option tst_fct_los forces a complete limitation of the anti diffusive fluxes thus realizing the upstream scheme However all intermediate steps of the algorithm are performed So for performance reasons it is not recommended to use tst fct los to implement an upstream scheme Option fct With option fct enabled the advective fluxes are calculated in subroutine fctflz The im plementation closely follows the algorithm as given by Zalesak 1979 The low order upstream fluxes are calculated first and a preliminary upstream solution is given by low tik jn r 1 2AI ADV TT ADV Thi kg ADV Tzikj 15 164 kan where the advective operator is defined by Equations 11 61 11 62 11 63 except that the fluxes are given by itin Ups jadv vetii il tins Gades 15 165 adv fnij spass adv vnti 15 166 enun 1400 00 ege sins 15 167 A forward time step over 2At is used because the usual forward time step turned out to be unstable in the ocean model For stability reasons discretization by Equation 15 164 is not allowed with option damp inertiaL oscillation which treats the Coriolis term implicitly Options fct 41 and fct 412 The next step involves limitation of anti diffusive fluxes u
315. his License shall be governed by the laws of United States as interpreted and applied by the Federal courts in the District of Columbia 3 Term of License This License shall remain in effect as long as USER uses the Product in accordance with Paragraphs 1 and 2 vill Contents 0 1 Introduction 4 44 4 e e Rss 1 Design Philosophy 5 Variables 1 1 Objective 1 1 1 Speed 1122 1 1 3 Modularity 1 1 4 Documentation sasaaa a 1 1 5 1 1 6 1 1 2 Ocean Primitive Equations 2 1 Continuous equations 2 2 Kinetic energy budget 2 2 1 Total budget 2 2 2 External and internal mode budgets 3 Dataflow 3 1 Memory management 3 2 Dataflow between Disk and Memory 3 3 The Memory Window 3 3 1 A 3 3 2 How it 3 3 3 Dataflow in higher 3 4 Data layout on disk 3 5
316. his option activates a driver for the I O manager module in file iomngr F Refer to Section subsection iomngr F for details 14 1 5 test poisson This option activates a driver for the poisson module in file poisson F For more details refer to Sectionsubsection poisson F It is no longer required to construct density coefficients before executing the model 151 152 CHAPTER 14 OPTIONS FOR TESTING MODULES 14 1 6 test ppmix This option activates a driver for the Richardson based vertical mixing module in file ppmix F Refer to Sectionsubsection ppmix F for details 14 1 7 test rotation The model grid may be rotated using a set of Euler angles for solid body rotation The Euler angles are computed by defining the geographic latitude and longitude of the rotated north pole and a point on the prime meridian This option activates the driver which gives results from a sample rotation of the model grid It indicates how scalars and vectors are interpolated and rotated before being used on the rotated model grid Refer to Section 15 6 1 for details 14 1 8 test timeinterp This option activates a driver for the the time interpolation module in file timeinterp F Refer to Sectionsubsection timeinterp F for details 14 1 9 test timer This option activates a driver for the timing module in file timer F For more details refer to Sectionsubsection timer F 14 1 10 test tmngr This option activates a driver for the time manager module
317. ic component to the tracer mixing tensor F 0 Therefore all moments of the tracer are conserved when there is no normal skew flux at the boundaries F4 0 or equivalently there is zero normal induced velocity 4 0 at the boundaries For example the skew flux associated with the Gent McWilliams effective transport velocity satisfies these conditions and so preserves all tracer moments Gent and McWilliams 1990 For the case with zero anti symmetric but nonzero symmetric tracer mixing tensor the first moment or the total tracer is conserved in source free regions where there is no tracer flux normal to the boundary i e if amp Fr AQK 9 T 0 at the domain boundaries In the absence of sources the tracer s second moment satisfies the evolution equation J dz T 2 d 0 T K T A 35 over the source free domain if the Therefore this mixing tensor dissipates the tracer variance tensor K is a positive semi definite tensor i e the right hand side is negative semi definite if is positive semi definite This property of diffusion is fundamental and is taken as the foundation for the numerical discretization of isopycnal diffusion in MOM 2 All higher moments of the tracer are also dissipated by diffusion assuming the usual case of a non negative tracer concentration A 2 Horizontal vertical diffusion The previous discussion is now specialized to particular forms of mixin
318. ice of the limiting step the results will be closer to those of either the upstream or the central differences scheme The amount of implicit mixing does therefore depend on a subjective choice With this limitation in mind the FCT algorithm may be regarded as a way to find the minimum mixing that is consistent with the thermodynamical constraint With the FCT scheme the model can be run without any explicit 15 18 ADVECTION SCHEMES 191 diffusion and the author suggests running a case with all tracer diffusion coefficients set to zero to appreciate the effects of the advection scheme This offers an opportunity to study cases where the tracer balance is advectively dominated everywhere Furthermore the scheme allows use of physically motivated mixing that will not be swamped by numerically necessary explicit diffusion or large implicit diffusion of the advection scheme The recommended options all of which should be specified for the FCT scheme are fet fet_dim1 and fet_3d An alternative option to fct dim1 is fct dlm2 which specifies the limiter as originally proposed by Zalesak 1979 Changes in tracer due to FCT ie FCT minus central differences are written in NetCDF format to file fct dta nc when the diagnostic op tion fct_netcdf is enabled Two additional options tst fct his and tst fct los were introduced mainly for debugging purposes Option tst fct his suppresses the limitation of the anti diffusive fluxes and thus results in the
319. ices indicating the dataflow from disk to memory window as MOM 2 executes Also indicated are the latitude rows being worked on by various subroutines in preparation for solving the equations on rows in the memory window As the memory window is moved northward a listing of which rows are copied where is given As new code is added to MOM 2 it is strongly recommended that this option be included as an aid in verifying that the code is correct When using this option disable all diagnostics and execute the model for only a limited number of time steps since the output can get voluminous Refer also to Section 14 1 13 18 2 23 tracer averages Option tracer averages constructs instantaneous spatial averages of tracers over regional areas described by mskhr in Section 18 1 4 This diagnostic is useful when trying to examine how the model equilibrates with area and depth The average of tracer n as a function of depth level k and region number m is constructed as imt 1 jmt 1 1 T Tkm n Areal lk inr Aj ke jrow 18 148 km i 2 jrow 2 m jrow 18 149 where the area element and area of each region at level k are given by Lk jrow tmask jrow dat cos Pr row lt dytjrow 18 150 imt 1 jmt 1 M M 18 151 1 2 jrow 2 18 152 and the relation between j and jrow are as described in Section 5 2 The average of tracer n over all regions as a function of depth is given by 18 2 LI
320. icount 1 imt istart 2 jrow icount 2 1 234 CHAPTER 18 DIAGNOSTIC OPTIONS istart 3 1 icount 3 km istart 4 num_conv icount 4 1 num_var 0 call ncput num var istart icount excnvi 1 1 timrec period 0 0 istart 1 num conv icount 1 1 call ncput num_var istart icount period timrec call release netcdf conv netcdf num num var When actually writing data information stating how much data is to be written along each axis must be given In the above code istart n is the starting location for axis n in the NetCDF file and icount n is how many elements are to be written along that axis starting at location istart n from array Note that array is dimensioned imt km in memory but the NetCDF data looks as if it were dimensioned imt jmt km time Each write accounts for a sub section in this four dimensional space Variable num convis the index for the time axis and represents the number of times this diagnostic was called while variable timrec is the corresponding time in years After all data is written the file is released Diagnostic output is typically written periodically Having been set up once there is no future need to re specify the setup information by calling ncsetup The file need only be re opened to be appended After collecting a number of NetCDF formatted diagnostic files which have been written by separate jobs the files cannot be concatenated with the
321. ield the x y cross terms and one of two pieces each for the x x and y y diagonal terms These terms are of no concern for the numerical stability issues see Griffies et al 1997 Therefore the diffusion coefficients in each sub cell in the x y plane will be set to their a priori value Af Finally in this section all reference to depth levels will be omitted except for dzt The terms from subcells 1 7 9 are cos oU ME a AT cos QU dztydyuj 4 ur i 1 1 1 1 1 Ae fdas 1dztj cos 6 OTT Y ya 6 08 A9 Sheu idit cos 6 x 1 MESI J 1 CoP TA E TaT B199 4 1p LIGUE B 199 Y Introducing summation allows these four terms to be combined into two terms A cos QU dzt dyu ok a i yP eee iip Hp Hp 1 amp pU E 5 s ETE A cos 6 x 5 r Ti B 200 gt ope Ljt sq TT G4 up QU LIE B 200 jq 0 6 Lita ty yp amp ja y The terms from subcells 2 5 10 are A cos QU dzt dyuj 5 UE 22m 296 APPENDIX B ISOPYCNAL DIFFUSION nn at Da 6 yli a U C cd e cos o 1 1 1 1 1 1 v PX urs ur Ti j by Tis jbop 1 1 7 1 1 1 6 Gt UP EJ t 6 po I druidzty cos d umm A 214 21 cos of
322. iki K B 123 where the arguments of the density partial derivatives indicate the value of the potential tem perature salinity and pressure reference level k for use in their computation MOM2 generally employs a cubic approximation to the UNESCO equation of state Once this approximation 288 APPENDIX B ISOPYCNAL DIFFUSION is determined the quadratic expressions for the partial derivatives pg and ps are found and tabulated along with the cubic equation of state The superscripts introduced on the density gradients allow for a compact notation which exposes the information about the referece point Parentheses are included in this notation to help distinguish it from the subscripts referring to explicit grid points Finally the discretization of the denominator is prescribed to be consistent with that determined by the numerator Note that only the x and y gradients are explicitly prescribed since the z gradient does not appear in the numerator This ambiguity will be settled at a later stage of the derivation For the present purposes let Vp 1 np T ype opt y B 124 UP akg Functional in the x y plane The x y plane functional is relevant only for the full tensor as it vanishes in the small angle limit The quadratic form which contains contributions from the T point 7 in the x y plane is given by the sum of the following 12 terms k index suppressed Li tiat 125 10
323. ility Journal of Physical Oceanography 25 2285 2297 Hellerman 5 and M Rosenstein 1983 Normal Monthly Stress over the World Ocean with Error Estimates Journal of Physical Oceanography 13 1093 1104 Holland W R 1975 Energetics of baroclinic oceans In Numerical Models of Ocean Circulation National Academy of Sciences Washington D C Holloway Greg 1992 Representing Topographic Stress for Large Scale Ocean Models Jour nal of Physical Oceanography 22 1033 1046 Killworth P D J M Smith A E Gill 1984 Speeding up ocean ciruclation models Ocean Modeling UNPUBLISHED MANUSCRIPT 56 1 5 Leonard B P 1979 A stable and accurate convective modelling procedure based on quadratic upstream interpolation Computer Methods in Applied Mechanics and Engineering 19 59 98 Levitus S 1982 Climatological atlas of the world ocean NOAA Prof Pap 13 173 pp U 5 Government Printing Office Washington D C Larichev V D and I M Held 1995 Eddy amplitudes and fluxes in a homogeneous model of fully developed baroclinic instability Journal of Physical Oceanography in press McDougall T J 1987 Neutral surfaces Journal of Physical Oceanography 17 1950 1964 Middleton J F and J W Loder 1989 Skew fluxes in polarized wave fields Journal of Physical Oceanography 19 68 76 NCAR 1996 The NCAR CSM Ocean Model NCAR Technical Note NCAR TN 423 STR Climate and Clobal Dynamics Division National Cent
324. ility compare each routine in OLD UPDATES with the corresponding one in MOM_2_OLD Do this using diff with the e option For example diff e MOM_2_0LD grids F OLD UPDATES grids F gt changes Inspect the changes file to view personal modifications Copy the new grids F from MOM 2 to NEW UPDATES Use an editor to view OLD UPDATES grids F changes and the new grids F in NEW UPDATES While viewing all three cut and paste from the changes file into NEW UPDATES grids F 19 16 BUG FIXES HOW TO GET THE LATEST MOM 2 263 19 16 Bug Fixes How to get the latest MOM 2 As changes bug fixes and new parameterizations are incorporated into MOM 2 a new file 2 2latesttar containing all changes to date use ls MOM2 2latesttar Z to see the date will be placed along side MOM2 2tar Z on the GFDL anonymous ftp server To upgrade to this latest version refer to Section 19 15 To inspect what changes have been made create a NEW directory then uncompress and extract the tar file MOM2 2latesttar Z from within this NEW directory to build the latest MOM 2 directory structure Differences between each pair of directories can be inspected using diff e MOM_2 NEW MOM 2 gt diffs mom2 diff e MOM_2 PREP_DATA NEW MOM_2 PREP_DATA gt diffs prep data diff e MOM_2 SBC TIME_MEAN NEW MOM 2 SBC TIME MEAN gt diffs time mean diff e MOM_2 SBC MONTHLY NEW MOM_2 SBC MONTHLY gt diffs monthly diff e MOM_2 SBC ATM
325. illebrand 1991 Multiple equilibria of the global thermohaline circula tion Journal of Physical Oceanography 21 1372 1385 McDougall T J 1987 Neutral surfaces Journal of Physical Oceanography 17 1950 1964 Pacanowski R C and G Philander 1981 Parametrization of vertical mixing in numerical models of the tropical ocean Journal of Physical Oceanography 11 1442 1451 Paulson and Simpson 1977 Irradiance measurements in the upper ocean Journal of Physical Oceanography T 952 956 Redi M H 1982 Oceanic isopycnal mixing by coordinate rotation Journal of Physical Oceanography 12 1154 1158 Rosati A and K Miyakoda 1988 A general circulation model for upper ocean simulation Journal of Physical Oceanography 18 1601 1626 Smagorinsky J 1963 General circulation experiments with the primitive equations I The basic experiment Monthly Weather Review 91 99 164 323 D 0 11 General Numerical Oceanography Eddy Resolving Beckmann A C W Boning B Briigge and D Stammer 1994 On the generation and role of eddy variability in the central North Atlantic Ocean Journal of Geophysical Research 99 20 381 20 391 Beckmann A C W Boning C K eberle and J Willebrand 1994 Effects of increased horizontal resolution in a simulation of the North Atlantic ocean Journal of Physical Oceanography 24 326 344 Boning C 1988 Particle disperson and mixing of conservative properties in an e
326. ime steps with the standard scheme the rate of vertical mixing depends on the time step length If acceleration techniques are used split time stepping Bryan 1984 the final equilibrium could differ from one without acceleration due to this unwanted time step dependence Marotzke 1991 reports a case where the choice of convective scheme had a decisive influence on the deep circulation The intention of this note is not to examine these problems any further it is to provide an efficient alternative Conclusion A convection scheme which completely removes static instability from the water column in one pass has been described and which is much faster than the implicit scheme of the GFDL model This scheme avoids possible problems resulting from the incomplete mixing in the standard scheme while only using as much computer time as 1 3 iterations of the standard scheme 15 14 Vertical sub grid scale mixing schemes The following options parameterize the way in which momentum and tracers are mixed vertically in the ocean One and only one of these options must be enabled Refer to Section 15 16 for additional hybrid mixing schemes ones that mix tracers but not momentum 15 14 1 constvmix This is a basic mixing scheme that uses constant values for vertical mixing coefficients km and amp j in Equations 2 1 2 2 2 3 and 2 4 which amounts to using the following form for mixing coefficients at the bottom of U and T cells diff c
327. in file size h jmw 6 for this example The minimum size of the memory window is jmw 3 which would mimic the slab architecture of MOM 1 and earlier versions of the model and the maximum size is jmw jmt Each prognostic variable within the window is dimensioned by indices i k j to denote longitude depth and latitude along with a fourth index to denote prognostic component e g for velocity an index of 1 would reference the zonal component of velocity and 2 would reference the meridional component For tracers a 1 would reference temperature and a 2 would reference salinity and a fifth index to denote time level e g either T l r orr 1 A work area is also shown in the memory window The size of this area varies depending on which options are enabled In general space is required to hold diffusive and advective fluxes of prognostic quantities defined on the faces of each cell These fluxes are also dimensioned by indices i k 7 but without a time index since they are recalculated for each prognostic variable to conserve memory Additionally some options require diffusive coefficients with spatial de pendence In this case three dimensional arrays are used for diffusive coefficients which are also defined on cell faces Within the memory window equations are solved for latitudes marked with a red color The latitudes marked with a blue color are used as boundary cells Figure 3 3c is a simplified schematic of the detailed window shown in
328. in file tmngr F Refer to Section subsection tmngr F for details 14 1 11 drive topog This option activates a driver for the topography and geometry module in file topog F Refer to Sectionsubsection topog F for details 14 1 12 test util This option activates a driver for the utility module in file util F Refer to Sectionsubsec tion util F for details 14 1 13 drive mwsim This option activates a driver which simulates how the memory window behaves using various combinations of processors and options when option coarse grained parallelism is enabled The run script is run mwsim and the source file is mwsim F which can be modified to investigate various scenarios Chapter 15 General Model Options MOM 2 is configured in various ways through the use of options which are enabled by setting preprocessor type directives The directives are usually placed on a preprocessor or compile statement in run script and take the form Doption1 Doption2 etc Note that the D must be used as a prefix to the option name For an example refer to script run mom Care should be exercised when enabling options because there is no check for mispelled options When enabled options eliminate or include portions of code thereby implementing desired features As MOM 2 executes a summary of all enabled options is given Some options are incompatible with others Subroutine checks looks for all conflicting options and if any are found writes all er
329. ing arrows indicate that 7 1 variables in the memory window are being filled with what was 7 disk data on the previous time step Likewise 7 variables in the memory window are being filled with what was 1 disk data on the previous time step The equation for a typical prognostic variable h indicates a central difference or leapfrog scheme in time Note that the forcing term F is a function of for advective processes and 1 for diffusive processes Before the leapfrog step disk indices are set as follows e taumldisk mod itt 1 2 1 e tau mod itt 2 1 e taupldisk taumldisk This formulation cyclically exchanges disk pointer indices every time step to assure that the correct disk data is read into and written from the proper memory window locations as described above Memory window indices are always as follows when the memory window is partially opened e tauml 1 e tau 2 e taupl 3 When the time step is complete 1 data is written back over the 1 disk area Looking to the fourth column the fully opened memory window has no arrows therefore no movement of data The disk pointers are not used and instead of being fixed in time the memory pointers are cyclicly updated according to e tauml mod itt 0 3 1 e tau mod itt 1 3 1 e taupl mod itt 2 3 1 which accomplishes renaming of areas within the memory window without moving data Com paring time step n with n 1 will clarify this
330. ing diagnostic data to visualize it NetCDF format also allows data to be passed between various computer platforms easily and is therefore the preferred method for sharing data The option for NetCDF format can be specified in two ways either by enabling the catch all option netcdf which makes all enabled diagnostics save their data in NetCDF format or by selectively enabling a NetCDF option for individual diagnostics as described under each diag nostic Refer to option netcdf or particular diagnostic options for more details For suggestions on executing in double precision on workstations and using NetCDF refer to Section 19 11 When data is written as unformatted 32 bit IEEE the output file is given the suffix dta to distinguish it from NetCDF format files which have the suffix dta nc 18 1 2 IEEE formatted data The preferred method of saving diagnostic data is NetCDF as described in Secton 18 1 1 Prior to NetCDF availibility diagnostic data was written using 32 bit IEEE format This section describes the record structure of data written with 32bit unformatted IEEE writes To access this data for visualization analysis code must be written In order to do this the record structure must be known When data is written as unformatted 32 bit IEEE the output file is given the suffix dta to distinguish it from NetCDF format files which have the suffix dta nc If NetCDF format is not specified then diagnostic output is written as 32 bit IEE
331. ing into 12 quarter cells The generally non constant grid spacing is indicated which implies an offset T point MOM z x plane and its partitioning into 12 quarter cells The generally non constant grid spacing is indicated which implies an offset T point xix XX LIST OF FIGURES B 4 Stencil in the x z plane for the isopycnal x flux The x ed points represent refer ence points used for computing the neutral directions 311 LIST OF FIGURES xxi Chapter 1 Design Philosophy 1 1 Objective The GFDL Modular Ocean Model MOM 2 was designed with one purpose in mind to maximize scientific productivity within the research environment at GFDL As indicated in the introduction the computational environment at GFDL has undergone change with each new computer procurement To keep pace efforts have focused on developing one model capable of taking advantage of scalar vector and multiple processors within this increasingly varied computational environment At the same time consideration has been given to organizing the model to allow a large number of options diagnostics and physics parameterizations to co exist in a way that is understandable extendable and easily accessible to scientists In one sense the design was strongly influenced by having CRAY platforms as the computational workhorses at GFDL since 1990 However the focus remains on factors that influence overall scientific productivity and th
332. ing technique of DSM which leads to a self adjoint elliptic equation and therefore a symmetric coefficient matrix which can be solved with efficient conjugate gradient techniques Multiplying Equations 16 27 and 16 28 by the total depth H and taking the divergence gives the second order elliptic equation for Aps in terms of known quantities and V S H row x Ma A psia jrow 2 y 64 Hi 1 jrow 1608 5 ow 166 ADSi 2 jrow 2 cos Erow 1 M6 wu i r sz AUI l jrow 1U 1 jrow 1 s cos Oo 1 Hi l jrow 1Vi 1 jrow 1 16 36 Equation 16 36 is solved using option conjugate gradient with option sf 9 point Note that the number of islands is set to zero nislsp 0 because no island equations are to be solved After solving for Aps a checkerboard null space and mean are removed after which the barotropic velocities at time level 7 1 are given by 2AT ow 6C psi groui 16 37 cos QU x PSi 1 jrow 1 V 2 60 16 38 and the predicted surface pressure is ps Throw ps Tow Aps J row 16 39 The above equations are written with a leapfrog time step in mind During mixing time steps forward or first pass of an Euler backward quantities at time level 7 1 are replaced by their values at and 2A7 is replaced by Ar The second pass of an Euler backward mixing time step is as described in Section 11 1 and indicated in Fig
333. ing the physical process of diffusion employing the isopycnal diffusive mixing hypothesis in the z level frame given here is the form of the diffusion tensor to be used In so doing the physics of diapycnal diffusion is isolated in the parameter The small angle approximation of Cox 1987 is an additional statement regarding the behavior of the bulk of the ocean that isopycnals have only a rather small slope except in convection regions This approximation recovers the form quoted in Gent and McWilliams 1990 1 0 1 1 0 1 S Kona Al 0 1 6 2 A 0 1 1 S c 1 52 1 52 e 5 1 65 1 85 8 A 56 Note that Cox 1987 originally retained the 1 2 2 1 elements equal to 5 S In the small angle approximation however this term is negligible Additionally and most crucially if this term is retained the small angle tensor will diffuse locally referenced potential density 272 APPENDIX A TRACER MIXING KINEMATICS whereas the full tensor will not Hence it is important to use the physically consistent form of the small angle approximation which drops the 1 2 and 2 1 elements As the small angle approximation is commonly used it is perhaps interesting to ask the following question Given the small angle approximation representation of the diffusion tensor in the z level frame what is the representation of this tensor in the orthonormal isopycnal frame This tensor cannot be the diagonal
334. into the additional boundary condition arrays only when ocean model time crosses the mid month boundary data is interpolated into sbcocn jrow m on every timestep There are four allowable methods for interpolating these datasets in time Method 0 is for no interpolation the average value is used for all times within the averaging period This is the simplest interpolation It preserves the integral over averaging periods but is discontinuous at period boundaries Method 1 is for linear interpolation between the middles of two adjacent averaging pe riods It is continuous but does not preserve integrals for unequal averaging periods Method 2 is for equal linear interpolation It assumes that the value on the boundary between two adjacent averaging periods is the unweighted average of the two average values Linearly interpolates between the midperiod and period boundary It is continuous but does not preserve integral for unequal periods Method 3 is for equal area midperiod to midperiod interpolation It chooses a value for the boundary between two adjacent periods such that linear interpolation between the two midperiods and this value will preserve the integral midperiod to midperiod To explore how time interpolation works in a very simple environment one can execute script run timeinterp which exercises timeinterp as a stand alone program As mentioned above two additional boundary condition arrays are needed for each surface bou
335. ion process can be useful The combination of two dimensional limiting in the horizontal and one dimensional limiting in the vertical is likely to generate less implicit diffusion than the implemented scheme 15 18 ADVECTION SCHEMES 193 Q7 Tre ue Qi Tnm 15 174 so that with the ratios QT ER T min 1 dk j P n z 24 n min 1 3 15 175 ik TE the limiters can be defined as C eiki min Riza kj Ry s for A eik gt 0 Ceikj min Ripp Riig for Aen lt 0 15 176 Option fct_3d Limitation of the anti diffusive fluxes in the coordinate directions separately does not guar antee that the solution stays in the permitted range To assure that no undershoots and over shoots appear a three dimensional limitation of the anti diffusive fluxes must be performed This is accomplished with option fct 3d This option is however not automatically enabled because the one dimensional limitation is sufficient in many cases and has slightly less implicit diffusion than the full scheme The one dimensional scheme shown above easily generalizes to multiple dimensions For instance the possible increase in the solution by anti diffusive fluxes into the grid cell becomes v maz 0 e 14 min 0 A ei x maz 0 A b min 0 Ab 1 max 0 min 0 15 177 where the A s are defined analogously to Equation 15 172 For option fct dim2 th
336. ional operators require meridional flux to be computed for j 1 which is why the lower limit of the 7 index is not identical for all fluxes Refer to Figures 3 3 and 3 7 for clarification of the latitude indexing limits adv f ei 2adv vet y faga liking d liano J Jsmw jemw 11 39 adv fni kj 2adv_vnt advonti Li ins litas J Ll jemw 11 40 adv fbi kj 2adv vbt k adv vbt li kan sj jsmw jemw 11 41 Contained in file setvbc F 118 CHAPTER 11 DISCRETE EQUATIONS diff_cet k difffeix Ota k inr cos ot jrow 1 likens diffeceti i bjs Eber ah J jsmw jemw 11 42 COS poy AT Ui diff fniy diff cntik i COS OS pow Salti kyinr 1 liki 1 likin r diff_cnt kj gt cos yyy trm To emt j d jemw 11 43 dYUjrow bellik jnr 1 1 diff_cbt i E J jsmw jemw 11 44 At the top and bottom boundary conditions are applied to the vertical fluxes where the bottom cell is at level kb jpow Also the advective flux through the bottom of the last level kb kit jrow 18 zero Note that the advective flux through the bottom of the last vertical cell k km is set to zero Also when option stream functionis enabled adv vbt 0 because of the rigid lid but adv vbt o Z 0 when option implicit free surface is enabled kb kmtijrow 1
337. ions is required to reduce or eliminate this problem The one dimensional advection diffusion equation OT 15 1 Ox or 15 157 discretized with central differences U A gua Toea 2Ti Tii 15 158 has solutions of the form T which when put into Equation 15 158 results in a quadratic equation with roots 1 and amp 2 Pe 2 Pe 15 159 where Pe UAx A is the P cl t number for the grid scale Az The second solution changes sign from grid point to grid point two grid point noise unless the grid P cl t number is less than two Simple estimates demonstrate that the required diffusion in a typical ocean model is rather large For a current of 10 cm s and a grid distance of 100 km a diffusion coefficient of 5x107 cm s is implied A moderate vertical velocity of 107 cm s and a grid distance of 100m would require a vertical diffusion coefficient of 0 25 cm s Note that in the deep ocean grid distances are usually much larger and vertical velocities can easily be one or two orders of magnitude larger In the standard case of constant diffusion coefficients the numerical requirements in regions of strong currents determine the magnitude of the coefficients In quiet regions this implies a diffusively dominated tracer balance that is not physically justified 190 CHAPTER 15 GENERAL MODEL OPTIONS The above analysis only consideres a one dimensional advective diffusive bal
338. is enabled mixing coefficients for tracers from other options such as constomiz ppomiz or bryan lewis vertical are used as background values and added to the vertical diffusion coefficient from option isopycmiz Also for use with option isopycmiz is option held larichev as Held Larichev 1995 which predicts variable isopycnal mixing coefficients As of this writing option held larichev is incom plete Its diffusion coefficient should be limited to regions of possible baroclinic instability All adjustable values are input through namelist Refer to Section 5 4 for information on namelist variables For details on specific schemes consult their options 11 8 hmixc computes horizontal mixing coefficients Subroutine hmizc computes horizontal mixing coefficients for momentum and diff_cnu and tracers diff cet and diff_cnt according to the scheme selected by op tions at compile time Currently options include consthmixz which use constant horizontal mix ing coefficients appropriate for V mixing biharmonic which use constant mixing coefficients appropriate for higher order V mixing and smagnlmiz for Smagorinsky nonlinear mixing co efficients after Smagorinsky 1963 As in Section 11 7 coefficients from hybrid schemes for mixing of tracers but not mixing of momentum are also allowed They are bryan lewis horizontal isopycmix and held larichev as referred to in Section 11 7 When option isopycmix i
339. is terms in Equation 17 10 the result is a proof of antisymmetry rather than symmetry First the diagonal coefficients in the implicit Coriolis terms are zero so this case need not be considered In the northern and southern terms i e when i i the evaluation points given by i jrow j i i j 1 j still remain the same but each term has one coefficient and cddy coefficient so the product of these two factors changes sign The antisymmetry of the eastern and western implicit Coriolis coefficients is proved similarly Since conjugate gradient solvers are derived under the assumption of symmetry of coeffi cients the larger the implicit Coriolis terms the less suitable a conjugate gradient solver is for the elliptic Equations 16 13 For large values of the implicit Coriolis parameter acor the conjugate gradient solver will not converge Island equations and symmetry If one of the cells a i jrow or 8 1 j is an island perimeter cell the arguments in the above section on symmetry of the explicit equations must be made more carefully since each island equation is a sum of Equations 16 13 Note that it cannot happen that both a and 8 are island perimeter T cells because islands must be separated by at least two ocean T cells Without loss of generality we may assume that D is an island perimeter cell and the a is not In this case 9 may not be the only island perimeter
340. is that code that works correctly when unitasked is not guaranteed to work correctly when multitasked The impact of this will be grossly under appreciated until experienced Parallelism can reach well past 9596 but parallel efficiency figures are degraded when 1 The number of latitude rows divided by the number of processors is not an integer This is a static imbalance condition which can be accounted for at model design time 2 There is a variable amount of work per latitude row This is a dynamic imbalance condition which may be dependent on space and time This condition is difficult to remedy and is brought about by filtering convection and some diagnostics 3 5 3 Parallelism on Distributed Systems Option distributed memory enables MOM 2 to execute on distributed memory systems with initial focus on the CRAY T3E Refer to Section 3 5 2 which describes the preliminaries Dis tributed systems such as the CRAY T3E have significant amounts of memory associated with each processor Access to disk is relatively slow so instead of using disk space to retain all three dimensional prognostic data the disk space is mapped to memory using option ramdrive Option ramdrive normally simulates two time levels of latitude data on disk by defining a huge array within memory However for multitasking three distinct time levels for data storage are required When option coarse grained parallelism is also enabled the two time levels are extended to
341. ision for this has not been implemented in MOM 2 The implicit free surface method uses a salt flux upper boundary condition as do the other methods The rigid lid approximation essentially makes the speed of all external gravity waves infinite and therefore equilibrates them at all scales This is reasonable in mid and high latitudes where there is a large time scale separation between gravity waves and Rossby waves However this separation of time scales is not the case in the equatorial domain The implicit free surface method resolves both Rossby and gravity waves within the equatorial region while equilibrating the higher frequency gravity waves at mid and high latitudes It remains to be shown if this difference between rigid lid and implicit free surface is significant Another point to be made is that Equation 16 36 contains a factor H jrow whereas the elliptic equation for the stream function contains the factor 1 H jrow Therefore the implicit free surface method should be less prone to stability problems than the stream function method when topography contains steep gradients This has yet to be verified It should also be noted that the barotropic velocities ULL and VM given by this method are not non divergent The degree of non divergence is related to how accurately Equation 16 36 is solved for the change in surface pressure Aps and the accuracy depends on the tol erance variable tolrfs which is input through namelist and typically
342. ist and is the same for all diagnostics Averaged data starts out being accumulated over all time steps within a specified interval It is then averaged and written out periodically at the end of the interval If the interval were 30 days results would be output every 30 days from the reference time and would represent 30 day averages It is possible to produce sub sampled averages by specifying an averaging period as less than an interval The averaging period is also input through namelist For example if the interval was set to 30 days and the averaging period was set to 2 0 days then 2 day averages would be written out every 30 days and the averaging would be over days 29 and 30 of each interval How often is it necessary to sample model generated data It should be sampled often enough to resolve the shortest time scale which is of interest Of course it follows that longer time scales will also be resolved For example if data is sampled at an interval of once per month the implicit assumption is that time scales with periods of four months and longer are being resolved What happens when the data has energy at periods of one week If data is sample in stantaneously once per month then sampled data will be aliased by the shorter period One way to remove this alias is to produce a monthly climatology This is done by saving data for many years and averaging all Januaries together all Februaries together and so forth to produce twelve climat
343. istributions of bomb produced Carbon 14 Journal of Geophysical Research 94 8243 8264 loggweiler J and B Samuels 1993 New radiocarbon constraints on the upwelling of abyssal water to the ocean s surface In The Global Carbon Cycle Edited by M Heimann NATO ASI Series Vol I 15 Veronis G 1975 The role of models in tracer studies In Numerical Models of Ocean Circulation National Academy of Sciences Washington D C 325 D 0 14 Atlantic and High Latitude Beckmann A C W Boning B Br gge and D Stammer 1994 On the generation and role of eddy variability in the central North Atlantic Ocean Journal of Geophysical Research 99 20 381 20 391 Beckmann A C W Boning C K oeberle and J Willebrand 1994 Effects of increased horizontal resolution in a simulation of the North Atlantic ocean Journal of Physical Oceanography 24 326 344 B ning C and R G Budich 1992 Eddy dynamics in a primitive equation model sensitivity to horizontal resolution and friction Journal of Physical Oceanography 22 361 381 Boning C W Holland O Bryan G Danabasoglu and J C McWilliams 1995 An overlooked problem in model simulations of the thermohaline circulation and heat transport in the Atlantic Ocean Journal of Climate 8 515 523 B ning C W and P Herrmann 1994 Annual cycle of poleward heat transport in the ocean results from high resolution modeling of the North and Equatorial Atl
344. itches are needed Switches based on the calendar or previously computed switches Suppose the intent was to compute 5 0 day averages of XBT s at the end of each month realizing that each month has a different number of days The following four variables would be added to the common block in file switch h Let test be the mnemonic then the naming convention used in switch h implies e testper an averaging period real 10 CHAPTER 6 MODULES AND MODULARITY e testts a switch logical corresponding to the end of month e testperts a switch logical corresponding to the averaging period e itestint internal variable needed by the time manager to support calculation of the logical switches The researcher specifies the averaging period e g testper in units of days through namelist and tmngr sets the corresponding logical switches e g testts testperts every time step They are set to true when within half a time step of the requested interval or averaging period otherwise they are false In this example testts will be true on the time step correspond ing to the end of the month and testperts will be true on all time steps within the last 5 0 days of the month The following statements placed inside the time manager in the section for switches based on calendar or previous switch and averaging period will calculate both switches testts avg alarm itestper ihalfstep 0 testper iref ieomon testperts on itestper
345. ity component at time level 1 The given quantities are which is the diffusion coefficient at the bottom of T or U cells Ar which is the time step aidif which is the implicit factor and 7 If is a tracer z is known from the solution of Equation 11 74 If is a horizontal component of velocity z is the solution from Equation 11 114 Equtation 15 183 is solved subject to flux boundary conditions at the top of the first cell at k 1 given as sflux and base of the bottom cell at k kz given as bfluz The solution follows from pages 42 and 43 of Numerical Recipes 1992 Note that when is a horizontal component of velocity smf and bflux bmf When is a tracer sflux stf and bflux Equation 15 183 can be written as Ek 1 k Ek Ski dif 2AT dcbg 1 2 15 184 Sk Sh andi f r deb 1421 dzwr_1 k Izt dew 15 184 which can be re arranged to Ak amp 1 Br amp Ck Ek 15 185 where aidif 2AT debp_4 Ak 15 1 k dzty dzwy 4 15 186 aidif 2Ar Cu ae 15 187 k dzty 210 B 1 4 0 15 188 At k 1 Ay 0 and at k kz Ck 0 Note that the last ocean level kz may be less than bottom level km to accommodate bottom topography The boundary conditions at the top k 1 and bottom k kz are imposed by setting 15 19 MISCELLANEOUS 197 sfluzx aidif 2AT eiit dzly 4
346. ive t Tracer point Flux diff Diffusive n North face p Pressure visc Viscous e East face c Coefficient psi Stream function b Bottom face v Velocity ps Surface pressure Variables described subsequently within this chapter are build in terms of these abbrevia tions All variables are positioned relative to the arrangement of grid cells discussed in Chapter 7 When an unknown variable is encountered in MOM 2 it may be possible to determine its meaning from context or the naming convention For example the variable adv vnt is an advective velocity on the north face of T cells If this fails it may be useful to search all include files for comments using the UNIX command grep as described in Section 19 5 Operators are used in MOM 2 to construct various terms in finite difference equations which are the counterpart to equations detailed in Chapter 2 Unlike arrays operators are build using expressions which relate variables but require no explicit memory The details of a particular operation are forced into the operator and buried from view which allows complicated equations to be written in terms of simple easy to understand pieces At the same time compilers can expand these pieces in line into an un intelligible mess by human standards and subsequently optimize it In fact there is no difference in speed on the CRAY or any mature compiler between writing an equation with operators and writing an equation with all terms exp
347. ix 2 5 if unstable Finally it will compare 1 amp 2 again since the density of 2 has changed in the mixing process so level 1 might have become statically unstable Only the density of 2 is recalculated for this Note that Marotzke s scheme handles the initial mixing of levels 2 4 more efficiently Prob ably my scheme could be made slightly faster still by including the marking feature from Marotzke s scheme the schemes were developed independently However in the typical con vection situation only levels 1 amp 2 are initially unstable due to surface cooling In this situation marking doesn t help My scheme saves time by remembering which parts of the water column we already know to be stable and rechecking only those levels necessary There is a subtlety that should be mentioned due to the non linear equation of state the task of removing all static instability from the water column may not have a unique solution In the example above mixing 2 amp 3 could yield a mixture with a lower density than level 4 in spite of 3 being denser than 4 and 2 being denser than 3 originally In this case my scheme would only mix 2 amp 3 while Marotzke s scheme would still mix 2 4 So both schemes are not strictly equivalent though for all practical purposes they almost certainly are I performed some test runs with the GFDL modular ocean model MOM in a two basin configuration the same as used by Marotzke and Willebrand 1991 The model h
348. ixing coefficient friemaz range from about 50 em sec to 100 em sec The Prandtl number is about 10 for stable regions and 1 for regions of strong mixing Choosing diff_cbt_back too large tends to erode the thermocline away Values of visc cbu back occur in regions of high Richardson number and have an affect on limiting the speed of the Equatorial Undercurrent lower higher values resulting in faster slower speeds To work reasonably well this scheme needs about 10 meter or finer resolution in the vertical It may not do well off the equator if shortwave penetration isn t taken into account because vertical shear may not be enough to overcome buoyancy when all the heat flux is absorbed within the first vertical cell In simulations maximum values for mixing coefficients occur in regions of low Richardson number such as surface mixed layers Philander speculates that fricmax should be a function of windspeed and this is being explored The windmir parameter is arbitrary and is meant to simulate the high frequency wind bursts that are absent due to the averaging process from climatological forcing Typically windmiz has been set at 15 em sec Various parameters for this option may be changed through namelist Refer to Section 5 4 for information on namelist variables 15 14 3 kppmix This is a basic scheme which supplies values for vertical mixing coefficients and based on Large et al 1994 The scheme is being implemented by Tony
349. jmw and there are two buffer fields for each surface boundary condition The resulting savings in memory is approximately 2 numobc imt jmt where numobc is the number of ocean surface boundary conditions However the price to be paid is increased disk access which will signifi cantly slow execution if conventional rotating disk is used The intent of this option is for very high resolution models which cannot fit into available memory and require a very conservative approach to memory usage l or additional space saving measures refer to Section 15 19 11 15 10 Lateral Boundary Conditions Neumann conditions are assumed for heat and salt on lateral boundaries no flux across bound aries For momentum a Dirichlet condition is assumed no slip There are some minor variations on these at the domain boundaries as described in the following sections Note that land cells are where kmt jrow 0 One and only one of the following options must be enabled 15 10 1 cyclic This makes a semi infinite domain It implements cyclic conditions in longitude Whatever flows out of the eastern western end of the basin enters the western eastern end Normally the computations in longitude proceed from i 2 to imt 1 after which cyclic conditions are imposed In latitude the computations proceed from jrow 2 to 7mt 1 The cyclic boundary condition is kmt jrow kmtimt 1 jrow kmtimt jrow kmt jrow 15 8 Note there is no option for
350. jrow m 18 loaded into the surface tracer flux array stf and the surface 100 CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE momentum flux array 8 jn This is done in subroutine setvbc for rows 7 jsmw jemw 22 in the memory window time varying sbc data uses an atmosphere dataset defined in SBC MONTHLY The test case prototype is described in Sections 19 6 and 19 7 as CASE 2 The dataset resides on disk as a series of records Each record is a climatological monthly mean surface boundary condition as a function of latitude and longitude This dataset should be prepared for the grid in mom using scripts in PREP DATA as described in Section 19 6 The complication is one of interpolating the monthly values to the model time in mom for each time step Basically the model time must be mapped into the dataset to find which two months data records straddle the current model time For the purpose of interpolation months are defined at the center of their averaging periods Both months are read into additional boundary condition arrays in atmos and used to interpolate to array SbCOEN jrow m for the current model time When the model time crosses the midpoint of a month the next month is read into a boundary condition array and the process continues indefinitely assuming the dataset is specified as periodic If it is not mom will stop when the ocean integration time reaches the end of the dataset Although data is read
351. k jn r 1 _ t s o 4 s u curo Un 9 tik jm 1 curv Ui 1 k jn7 1 LZ LZ 2 uw liga n roi Curd Uik jnr 15 126 where the coefficients are given by quickz 2 dzt 4A dat 44 dat 15 127 quick 2 421 421 dati 15 128 curv 2 dat x deti i dati ii 2 dat det dzt 41 15 129 2 drt dxti41 det det 15 130 The idea of a psuedo fourth order technique was taken from the GFDL SKYHI stratospheric GCM 188 CHAPTER 15 GENERAL MODEL OPTIONS cures 2 dat dti i dat i 2 dat dat 15 131 2 dat deti 1 dat 2 dzti 2 15 132 2 drt dzti41 dzti 1 dat dxt 41 15 133 curosa 2 dat x deti 1 dat 2 det dzt 41 15 134 In the meridional direction twice the advective flux out of the northern face of the T cell is given by vt l advvnti p 2 15 135 v adv_vnt 2 15 136 adv fniy advvnti ng quick ua tikjnr 1 quick uu tikjtinr 1 at YH ho 4 YF YE ho v CUTY row lk j l n r 1 CUT V row 2 CUTY ow 3 lik j 1 n T 1 p y hanc Z v curvis a o tik j 2m 7 1 CUT Us ow 2 lik jt
352. l advection of tracers and momentum than method 1 The reasoning behind these questions can be seen by referring to Figure 7 4 and noting the placement of T grid points within T cells Advective fluxes are constructed as the product of advective velocities and averages of quantities to be advected Ty Tras 2 When resolution is constant both advective velocity and averaged quantities lie on cell faces but when resolution is non uniform averaged quantities may lie off the cell faces Whether or not this happens depends on the placement of grid points within grid cells Method 2 defines tracer points off center in such a way that the averaged tracer given by Equation 7 3 is placed squarely on the cell faces Recall from Chapter 12 that defining the average operator differently than in Equation 7 3 will not conserve second moments Simple one dimensional tests using a constant advection velocity of 5 cm sec to advect a gaussian shaped waveform through a non uniform resolution varying from 2 to 4 degrees and advective flus Wy 7 4 Centered refers to the centering of the t grid point within the grid cell Of course this is not to be compared to the significant gains due to higher order advective schemes Although the argument is given for the vertical direction it applies in the horizontal as well 7 3 CONSTRUCTING A GRID 79 back to 2 degrees suggests that method 2 is better than method 1 Also a one dimensional thermocli
353. l mode dtsf and a third for the tracers dtts Each are input through namelist Basically asynchronous timestepping can be done because the three processes have different time scales Since the timescale for adjustment of density is much greater than that of velocity it is reasoned that integrations to equilibrium can be speeded up by taking a large time step on the tracer equations within CFL restrictions and letting the velocities come into geostrophic adjustment with the density If the problem is linear and only the equilibrium solution is sought the equilibrium solution is unique and it doesn t matter how the integration gets there However if the solution is non linear enough to have multiple equilibria or the transient response is of interest all three time steps should be synchronous A similar argument can be made for the adjustment time scale of the deep layers being much greater than that of the surface layers An acceleration with depth factor dtacel initialized to 1 0 for all levels is used to increase the length of the tracer time step with depth to reach equilibrium sooner Bryan 1984 Given the resolution defined by module grids a time step can be estimated from the linear CFL condition Amin At lt 2 where Amin is the minimum grid cell width and c is the fastest wavespeed The external gravity wave is the fastest wave with c grav but this has been filtered out of the equations by the rigid lid approximation Ne
354. l velocity is calculated diagnostically as the advective velocity at the bottom face of each cell 1 k advvbtik 5 6x Cadv veti a s j 6s adv vont m i4 dzim cos 1 1 Y adv vet 4 5 COS m 1 dati OEY nit det 11 32 dit jrow where Pirow refers to the latitude at point 7 jrow To calculate advective velocities on faces of U cells within the memory window the averaging approach indicated by Dukowicz and Smith 1994 and subsequently described by Webb 1995 is used which involves averaging the advective velocities from T cells onto U cells Their formulas are I lhis was the motivation for exploring grid construction by method 2 as detailed in Section 7 2 3 The old construction method 1 is enabled by option centered t Refer to Chapter 7 for a description of grid design 11 6 ISOPYC COMPUTES ISOPYCNAL MIXING TENSOR COMPONENTS 115 advveuj kj adv vel 11 33 adv vnujy adv vntir 11 34 advvbuikj adv obl 11 35 This works when the grid cells are square For MOM 2 a more general form is used to preserve fluxes when the grid resolution is non uniform The idea is to take a weighted average in a direction normal to the flow and a linear interpolation in a direction parallel to the flow Referring to Figure 11 3b and using the indicated grid distances gives 1 ditions deu advent sj duw adv vnt 1k due AUS jrow 1
355. le code and view the results with Ferret described above Alternatively the kmt jrow field is written to the results file and can be viewed with an editor Regions of jrow needing changes are easily identified and changes can be hard wired into the USER INPUT section of module topog Large areas of changes like blocking out areas can be handled easily using calls to subroutine setkmt Look at the way idealized topography is built within module topog 9 4 FINE TUNING KMT 93 Pothole minimum depth violatim b cells Ocean cells Figure 9 1 a A portion of the kmt field indicating ocean and land areas with potential problems b Topography along the slice indicated in a 94 CHAPTER 9 TOPOGRAPHY AND GEOMETRY Chapter 10 Generalized Surface Boundary Condition Interface The ocean is driven by surface boundary conditions which come from the atmosphere and the atmosphere is in turn driven by surface boundary conditions which come from the ocean The difficulty in understanding the coupled system is that each component influences the other For purposes of MOM 2 the atmosphere may be thought of as a hierarchy of models ranging from a simple idealized wind dataset fixed in time through a complicated atmospheric GCM Regardless of which is used MOM 2 is structured to accommodate both extremes as well as atmospheres of intermediate complexity as discussed in the following sections 10 1 Coupling to atmospheri
356. le with the particular vertical resolution Such a procedure was employed in the original Cox 1987 implementation of isopycnal diffusion Additionally the form for the discretization should reflect the need to have the adiabatic portion of the diffusion operator vanish for the case of a single active tracer This constraint motivates the discretization of the density gradient explicitly in terms of the thermal and saline partial derivatives of the density in which these derivatives are evaluated at the same pressure temperature and salinity for the density gradients appearing within a particular subcell component of the functional If this prescription is followed each term of the functional will identically vanish when density is a function of a single active tracer which means that the adiabatic diffusion operator will vanish in this case as well The two physical constraints regarding reference points can be implemented numerically in a number of ways For example in an earlier derivation of the discretized diffusion operator the issues of reference points were ignored until the very end of the derivation At that point reasonable choices were made for choosing the reference points which consisted of referencing on the various sides of the T cells consistent with the location of the diffusive fluxes However it was soon realized that the numerical constraint of defining a dissipative diffusion operator was not satisfied by this choice Rather
357. les Therefore the explicit form for the tensor J depends on the particular phenomenon being parametrized Two basic forms of mixing are considered here as distinguished by the symmetry of the tensor Either the process is purely dissipative as represented by a symmetric positive semi definite diffusion tensor or purely advective as represented by an anti symmetric tensor A 1 Basic properties Consider a mixing process governed by a tensor J This tensor in general contains both sym metric and anti symmetric components given by 1 1 l The anti symmetric component is sometimes called the skew symmetric component in the literature 265 266 APPENDIX A TRACER MIXING KINEMATICS where the symmetric part of the tensor is written and the antisymmetric part as A For diffusive or dissipative mixing is symmetric and positive semi definite Note that anti symmetry implies the diagonal terms A vanish Additionally anti symmetry is a frame invariant property of a tensor A 1 1 Kinematics of an anti symmetric tensor Anti symmetry introduces constraints on the form of mixing described by anti symmetric ten sors All these constraints originate from the property that the tensor contraction of a sym metric tensor with an anti symmetric tensor vanishes Explicitly consider a symmetric tensor 57 and its contraction under a flat Euclidean metric with an anti symmetric tensor Amm Ar
358. licitumix There are two choices for explicit convection If option fullconvect is enabled all instabilities in the water column are removed on every time step by the method of Rahmstorf which is described below Otherwise the old style convective adjustment takes multiple passes through the water column alternately looking for instability on odd and even model levels When an instability is found tracers are mixed preserving their means weighted by cell thickness This process may induce further instabil ity and therefore more than one pass through the water column may be needed to remove all instability The number of passes through the water column is controlled by variable ncon which is input through namelist Refer to Section 5 4 for information on namelist variables Both explicit convective schemes can be tested in a one dimensional model Refer to Section 6 2 1 for details Explicit convection takes place only when option implicitomir is not enabled When op tion implicitvmix is enabled instead of explicitly trying to remove a gravitational instability large vertical diffusion coefficients are used locally to eliminate it through vertical diffusion These large coefficients severly limit the time step and so vertical diffusion is solved implicitly to relax the restriction As implemented explicit convection operates only on tracers whrereas option implicitumiz affects both tracers and momentum Explicit vertical mixing schemes and op
359. ll routines in MOM_2 NETCDF are compiled in single precision 32bit word length and the option sgiis used To accomplish this mismatch in precision double precision data is converted to single precision just for the NetCDF routines in two places routines ncseti and ncput Look at script run mom sgi to see how the compile is done 19 13 Distributed memory systems Originally a CRAY T3E with 40 processors was scheduled to arrive at GFDL in November 1996 Latest word was that the system will not arrive until sometime in 1997 and work on extending MOM 2 for distributed systems will not be completed until the CRAY T3E has been installed However the groundwork has been done and it is anticipated that MOM 2 will be able to execute efficiently on the CRAY T90 and CRAY T3E without much change to the coding This feature is currently under development and is not yet stable Refer to Section 3 5 3 for details 19 14 MOM 1 and upgrading to MOM 2 MOM 1 included an upgrade script for incorporating changes Since there is a major architec tural difference between MOM 1 and MOM 2 there are too many changes to offer a meaningful upgrade approach from MOM 1 The only recourse is to bite the bullet and switch It should be obvious that the appropriate time for switching is at the beginning of an experiment but not in the middle of one 19 15 Upgrading from older to newer versions of MOM 2 MOM 2 version 1 0 included a script run upgrade sgi for incorp
360. llow for automatic reloading archiving of results and handling problems associated with long running experiments which may be site specific 19 11 Executing on 32 bit workstations If executing on a workstation with a 32 bit word length it is recommended that double precision usually a compiler option be used otherwise numerical truncation may significantly limit 19 12 NETCDF ON 32 BIT WORKSTATIONS 261 accuracy On an SGI Indigo 4000 workstation the options include O2 mips2 r8 align64 Olimit 2160 For test cases 1 and 2 recall that data in the DATABASE is in 32 bit IEEE format Routines for reading this data e g ic F and sbc F in PREP DATA and preparing it for the model can be compiled with 32 bit word length O2 and the write statements changed to output real 8 data This is left to the researcher 19 12 NetCDF on 32 bit workstations Generating NetCDF formatted output from MOM 2 is as easy as specifying an option Of course the UNIDATA NetCDF libraries must be installed Refer to Chapter 18 and Section 18 2 10 for specifics NetCDF routines are very platform dependent MOM 2 with NetCDF options works well on CRAY platforms 64bit word length and SGI platforms 32bit word length at GFDL Each platform uses its own NetCDF library However NetCDF will only work with double precision on SGI workstations when the model all files except those in MOM 2 NETCDE is compiled in double precision and the NetCDF libraries and a
361. loop all right hand terms in Equations 2 1 and 2 2 have been computed 11 11 10 Computing the internal modes of velocity The internal modes of velocity are solved using a variety of time differencing schemes leapfrog forward Euler backward as outlined in Section 11 1 When the time derivatives of both velocity components have been computed using Equations 11 110 through 11 115 the uncorrected velocities U ej ard are computed A complication arises due to the vertical diffusion term which may be solved explicitly or implicitly The implicit treatment is appropriate l he surface boundary condition smf should be at 1 but that value isn t known Instead the value is used In MOM 1 The Richardson number in ppmiz F was calculated at tau 1 in the implicit case It should be at 1 but that is unknown In MOM 2 the Richardson number can easily be changed to The effect of this on the solution should be small but has not been explored Velocities with incorrect vertical means due to the missing unknown surface pressure 11 11 CLINIC COMPUTES INTERNAL MODE VELOCITIES 129 when large vertical viscosity coefficients or small vertical grid spacing limit the time step The following discussion pertains to the leapfrog scheme The other schemes amount to changing 2At to At in what follows Explicit Coriolis treatment If the Coriolis term is treated explicitly the solution is given by Us kj l
362. lt er lt 0 for the southern boundary For northern open boundary conditions var1 is calculated in tracer F otherwise it would pointing outside of the memory window calculate quantities for vertical and lateral diffusion In either case a laplacian formu lation is used at the boundary is taken from the mixing namelist Therefore a new definition DIFF Ty obc i k j is introduced diff fe and dif f_fb are calculated explicitly calculate values for the meridional advection ADV T y_obc e new subroutine obcsponge only active obc similar to sponge but restoring holds only for flux into the domain vad calculate new tracer values at the boundaries using equation 13 1 144 CHAPTER 13 STEVENS OPEN BOUNDARY CONDITIONS e diagnostics as in tracer F cobc2 F This subroutine is used instead of tracer F at northern and southern open boundaries and is similar in most respects to cobc F e calculate advection velocity uad e calculate phase speed for tracer clw cle Introduce DIFF Ty obc i 3 dif f_fe and dif f_fb are calculated explicitly calculate values for the meridional advection ADV Tz new subroutine obcsponge2 only active open boundary conditions calculate new tracer values at the boundaries using a similar equation to 13 1 but for meridional boundaries diagnostic as in tracer F addobcpsi F This subroutine is used for prescribing values of at open boundari
363. lt 5 5 ti sk jn T A Ph jrow 18 139 jrow 2k 1 i 2 tracer variance lt E gt lt tikint gt 18 140 jmt l km imt 1 lt kam 1 t 1 lt sta vm EE AT jrow 18 141 jrow 2k 1 i 2 where 1 jmti l km imt 1 lt tirin gt 22 22 22 ke Mares 18 142 jrow 2k 1 i 2 and the volume elements for U cells and T cells are UMASKi k jrow dzu cos ME dztk 18 143 tmask k jrow dat cos row dzty 18 144 The masks umaski jrow and tmask k jrow are 1 0 on ocean U cells and T cells but 0 0 on land U cells and T cells Also the relation between j and jrow is as described in Section 5 2 The total volumes are constructed as jmt l km imt 1 Vo YD Aa 18 145 jrow 2k 1 1 2 jmi l km imt 1 Vo M M M 18 146 jrow 2k 1 i 2 In addition to the above quantities the iteration count from the elliptic solver is saved When option netcdf is enabled the output from this diagnostic has a NetCDF format and is written to file ts_integrals dta nc Otherwise the output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file ts integrals dta If option netcdf or time step monitor netcdf is enabled data is written in NetCDF format to file ts integrals dta nc rather than in unformatted IEEE The interval between output is specified by variable tstint and
364. ltitasking is used Basically there are two approaches to multitasking in MOM 2 e The fine grained approach where parallelism is defined at the level of each nested do loop Here all processors work simultaneously on each nested do loop for each group of latitudes This implies that there are many parallel regions The coarse grained approach where parallelism is defined at the level of latitude rows For instance all work associated with solving the equations for one latitude row is assigned to a single processor All work associated with solving the equations for another latitude row is assigned to a second processor and so forth Then all processors work simultaneously and independently This implies that there is only one parallel region Both of these approaches and their relative merits and deficiencies are discussed in the following sections 3 5 1 Fine grained parallelism autotasking This is the simplest form of multitasking Simplest means fewest things to do and no way to get into trouble It is equivalent to autotasking on CRAY PVP s parallel vector processors like the C90 How to do it There are no options needed to enable fine grained parallelism within MOM 2 All that is re quired is to set the desired number of processors and open the memory window up as described below Be sure to set the compiler options needed for multitasking On a CRAY C90 compil ing should be done with the parallel compiler option
365. lving this involves inverting a tri diagonal matrix and the technique is taken from pages 42 and 43 of Numerical Recipes in Fortran 1992 For details refer to Section 15 19 4 11 10 9 Diagnostics At this point diagnostics are computed for tracer component n For a description of the diagnostics refer to Chapter 18 11 10 10 End of tracer components At this point the do n 1 1 loop issued in Section 11 10 1 is ended and all tracers have been computed 11 10 11 Explicit Convection The condition for gravitational instability is given by pi lt 0 11 76 If option implicitvmix is enabled the instability is handled by implicit vertical diffusion using huge vertical diffusion coefficients dif f cbt limit input through namelist Refer to Section 5 4 for information on namelist variables Otherwise when option implicitumix is not enabled the temperature and salinity within each vertical column of T cells is stabilized where needed by one of two explicit convection methods These methods involve mixing predicted temperature 24These could have been added directly to the advective fluxes computed previously For now they are kept separately for diagnostic reasons 11 11 CLINIC COMPUTES INTERNAL MODE VELOCITIES 123 and salinity between two adjacent levels t 4 41 and tip41 j n 741 for n 1 2 If option full convect is enabled the convection scheme of Rahmstorf 1993 is used Otherwise the original sch
366. m from the boundary to the interior the calculation of the phase velocities would point into bottom and would deliver wrong values Actually a minimum depth is chosen e g kmt 2 kmt 3 kmt 4 min kmt 2 kmt kmt for option obc_south but the rearcher is free to change this subroutine kmtbc extrapolate kmt onto open boundaries e g kmt i 1 kmt i 2 or kmt i jmt kmt i jmt 1 tracer F include cobc h only with option bc north at jmt 2 calculate varl for cobc only with option bc north add in tracer obc inc before calculating new tracer values call cobc2 for i 2 option obc west add in tracer obc inc calculate new tracer values only for non boundary rows after calculating new tracer values call cobc2 for i imt 1 option obc_east add in tracer obc inc tropic F For the Orlanski 1976 radiation condition new stream function values at the open bound ary are calculated using 13 2 For active open boundaries values for 1 are prescribed for Orlanski radiation deliver dits include cobc h obc data h for Orlanski radiation calculate phase velocities cy clps clpn add in tropici obc inc calculate new w at jrow 1 2 and or jrow jmt 1 jmt with equation 13 2 passive open boundary conditions or prescribe active open boundary conditions addobcpsi F For second case psiwall south and or psiwall_north of obcpsi are used add in tropic2 obc inc util F Subroutine s
367. me step of the requested interval or averaging period otherwise it is set to false Also associated with each switch is an internal variable containing the time when the logical switch will next be true Adding Switches In principle any question regarding time can have a logical switch associated with it It is easy to add new switches following the examples in file switch h As a naming convention all logical switches end in One example is snapts which is the logical for determining whether a snapshot of the model solution is to be taken during the current time step Use the UNIX grep snapts Fh to see where the switch snapts is defined and calculated then replicate the form Before adding a new switch check through file switch h because the switch may already be there The following examples further indicate how to add a logical switch for various purposes in MOM 2 Switches based on an interval Suppose the intent was to compute global energetics every 15 0 days The following three variables would be added they are already there to the common block in file switch h Let glen be the desired mnemonic for global energetics then the naming convention used in switch h implies the following e glenint an interval real for diagnostic output e glents a switch logical corresponding to the interval e iglenint internal integer variable needed by the time manager to support calculation of the logical switch The rese
368. mentioned in Section 7 1 when specifying bounding coordinates and resolution there must be an integral number of cells contained between these coordinates in each of the coordinate directions The integral number of cells refers specifically to T cells In the horizontal plane bounding surfaces of constant longitude and latitude define the location of U grid points and resolution at those surfaces is given to the corresponding U cells Resolution varies continuously between bounding surfaces and is discretized using Equations 7 1 and 7 2 to cell widths and heights In the vertical plane bounding surfaces are at the top or bottom of cells and resolution is discretized to cell thicknesses as in the horizontal plane It should be noted that in the vertical allowance is made for a stretching factor in the last region to provide for a more drastic fall off of resolution to the bottom if desired 7 2 3 Non uniform resolution Within a region of constant resolution all T and U grid points are located at the centers of their respective cells When resolution is non uniform this is not the case Within MOM 2 there are two methods to discretize non uniform resolution onto T cells and U cells Based on Equations 7 1 and 7 2 in section 7 1 and the averaging operator given by TH On tnn 73 the two methods are AU AU AU_AU T _ B a B m 0 5 U _ AT 1 Aj Sy costr AL AL AULAUT U _
369. minated when this sum is within the requested tolerance This means that the solution differs from the true solution to within an error given by the tolerance The tolerance is given in the same units as the external mode prognostic variable In MOM 1 when the residual was smaller than crit the iteration was stopped This however did not mean that the solution was within crit of the true solution Before using one of these solvers it must be decided whether 5 point or 9 point numerics are to be used For the rigid lid surface pressure and implicit free surface method only the 9 point numerics are appropriate For the stream function either the 5 point option sf 5 point or the 9 point option sf 9 point numerics is appropriate The recommendation is to use option sf 9 point The generation of the coefficient matrix for the elliptic equation is described in Section 17 4 The resulting matrix is slightly different that the one calculated in previous versions of the model but presumed to be more accurate There are other differences besides the coefficient matrix when comparing the way the elliptic equation for the stream function was solved in MOM 1 and MOM 2 The result of the differences as measured in the conjugate gradient is that the solvers in MOM 2 converge faster and in less time than in MOM 1 How much is problem dependent but for the test cases measured the difference is about 10 to 2096 of the time taken by the external mode when solving t
370. model which describes the total heat content of one tremendously gigantic cell as a function of time 1 jm i 1 T lt 18107 jrow n gt Areal gt tfluzirow n AS row 18 65 where the area element is jm i 1 Area M AL 18 66 jrow 2 However this can only be done if the averaging period equals the interval for writing the output But when the averaging period equals the sampling interval this diagnostic is a significant time burner For most cases it may be adequate to specify a short averaging period at the end of the sampling interval e g in the limit a one time step average at the end of every sampling interval The terms in the above analysis may be further decomposed into regions based on mask msktmb jrow along the lines of Section 18 1 4 However msktmb jrow 1 and it is left to the researcher to define other regions if desired Note that the regional mask msktmbi jrow is also written to file tracer bud dta when the initialization boolean itmb is true It should be set true on the first run but false thereafter 18 2 10 netcdf When enabled this option saves diagnostic output in a NetCDF format instead of unformatted 32 bit IEEE format This is a catch all option which applies to all enabled diagnostics Many diagnostics also have an option for enabling NetCDF format independent of other diagnostics Refer to the particular diagnostic for further information For information on using double precision on sy
371. mply the total energy minus the external mode energy E Equivalently E p 2 lt i i gt and p 2 lt dd gt which is how MOM 2 computes the kinetic energy budgets Section 2 2 contributed by Stephen M Griffies smgQ g f dl gov 12 CHAPTER 2 OCEAN PRIMITIVE EQUATIONS Chapter 3 Dataflow 3 1 Memory management Productivity is related to total throughput of a computer system over time The throughput is limited by how well a mix of jobs fits into available storage memory and disk and how fast the mix executes At GFDL the job mix is a combination of production models analysis development and interactive work It is time dependent and is determined by guidelines in tended to optimize total throughput Any model ties up a certain amount of memory resource Although seemingly unimportant in low resolution studies it is crucial in high resolution ones where large domains can easily exceed the computational storage capacity of the system How much storageis enough To resolve most eddy structures adequately would require a resolution of about 1 12 which would take about 930MW for one time level of one variable assuming 100 vertical levels Even low resolution models that execute while wastefully using memory limit the number of jobs in the mix and therefore overall throughput Minimizing model memory requirements need not negatively impact factors affecting scientific productivity indicated in Chapter 1 In fact t
372. mponents so that the model s structure remains clear even when sub jected to a large number of additions MOM 2 assumes an underlying structure which orchestrates the dataflow between disk and memory the steps for solving prognostic equations and where each possible option comes into play This structure has enough generality to support many different parameterizations implemented as UNIX preprocessor ifdef options Conceptually modularity has to do with minimizing contact between options and this underlying structure and also eliminating contact among options It also implies something about how options are internally organized In general within each option code is organized into a minimum number of non contiguous segments This is an important point because use of UNIX preprocessor ifdefs tend to encourage writing many non contiguous code fragments resulting in spaghetti code which is best suited for land fill As Fortran 90 becomes more widely used the idea of a Fortran 90 module will be incorpo rated into MOM 2 In the meantime consider the construction of modules in MOM 2 as an approximation to the idea of a l ortran 90 module but which is compatible with Fortran 7T 6 1 What are modules Modules are a method of organization which allows a large number of things to be managed in a reasonable way T here are of course many ways to organize and the best one depends not only on the problem but on the perspective of the resear
373. much faster than fourfil The boundary condition is no slip on lateral boundaries This is expressed as 0 16 15 s 0 16 16 This filtering induces spurious vertical velocities 202 CHAPTER 16 EXTERNAL MODE OPTIONS which implies that Y jrow constant in space on boundaries In domains containing discon nected land masses islands if there is circulation around an island then the value of v jrow on the island is a different constant than the value of j o on the continent Refer to Appendix 16 1 4 for details relating to solving for 1 jrow on islands 16 1 2 The coefficient matrices Equation 16 13 involves nine values of A centered at jrow which may be written as 1 1 coeffi jrow ij MViti jrow4j Ztdi jrow 16 17 i 1 j 1 where the 3rd and 4th subscripts on the coefficient matrix refer to coefficients on neighboring cells For example i 1 and j 0 refers to the coefficient of Av the value on the western neighboring cell The coefficient of jrow41 on the northeast neighboring cell is given by 1 and j 1 When option sf 9 point is enabled MOM 2 calculates the coefficient matrix coeff jrow i j for Equation 16 17 using summation formulas given in Section 17 4 This nine point coefficient matrix differs slightly from the one in MOM 1 and is more accurate The elliptic solvers also converge in fewer iterations using this coefficient matrix
374. n derstood by looking at the small angle approximation to the isopycnal tensor equation 56 and setting A to zero in order to focus on the diapycnal piece 0 0 S Ay 0 mall Ap 0 0 Sy A 62 S 1 The off diagonal terms represent the difference between vertical mixing and diapycnal mixing These terms are down by a single factor of the slope To completely determine the error introduced by neglecting these terms it is useful to write the diffusion operator R T arising from this tensor and performing a scaling within the small slope approximation For this purpose consider the horizontal direction of steepest slope to be the x direction The y direction will therefore be ignored Also assume a constant diapycnal mixing coefficient Ap With these approximations the diffusion operator takes the form R T Ap 0 5 0 T 0 0 T A AT AT PNG T AS AT Apn D Az where the last approximation assumed Az lt lt Az Hence the off diagonal pieces in the diffusion tensor are quite negligible in the small slope approximation Therefore with this scaling the distinction between vertical and diapycnal mixing is negligible as well A 63 4 Symmetric and anti symmetric tensors The horizontal vertical and isopycnal mixing of the previous two sections employed symmetric positive semi definite tensors representing dissipative mixing processes The presence of an anti symmetric component to
375. n Journal of Physical Oceanography 23 39 60 D 0 15 Tropical Hirst A C and J 5 Godfrey 1993 The role of Indonesian throughflow in a global ocean GCM Journal of Physical Oceanography 23 1057 1086 Liu Z S Philander and C Pacanowski 1994 A GCM study of tropical subtropical upper ocean water exchange Journal of Physical Oceanography 24 2606 2623 Pacanowski R C and G Philander 1981 Parametrization of vertical mixing in numerical models of the tropical ocean Journal of Physical Oceanography 11 1442 1451 Philander 5 G and C Pacanowski 1980 The generation of equatorial currents Journal of Geophysical Research 85 1123 1136 Philander 5 G H and R C Pacanowski 1981 Response of equatorial oceans to periodic forcing Journal of Geophysical Research 86 1903 1916 Philander G H and R C Pacanowski 1986 model of the Seasonal Cycle in the Tropical Atlantic Ocean Journal of Geophysical Research 91 14192 14206 Philander S G and C Pacanowski 1986 Properties of Long Equatorial Waves in Models of the Seasonal Cycle in the Tropical Atlantic and Pacific Oceans Journal of Geophysical Research 91 14207 14211 Philander S G and C Pacanowski 1986 The Mass and Heat Budget in a Model of the Tropical Atlantic Ocean Journal of Geophysical Research 91 14212 14220 Pacanowski R C 1987 Effect of Equatorial Currents on Surface Stress Jour
376. n appropriate platform options are added for routines in MOM 2 NETCDF There is no makefile supplied for compiling MOM 2 If compile time is an issue then one can be constructed by the researcher In the compiling section of the script there is provision for enabling a bounds checker This is strongly recommended as standard operating practice for verifying that subscripts do not exceed array bounds in newly developed code Afterwards the bounds checker should not be used since it significantly slows execution The compiling and linking to an executable is done in one step under f90 If using refer to Section 19 2 and make the changes After compiling separate namelist files are constructed which contain specifications to reset various defaulted quantities Refer to Section 5 4 for a list These namelist files are read by subroutine setocn and other initialization subroutines specific to individual parameterizations which have been enabled Note that each namelist ends with a in compliance with Fortran 90 and is written to a separate file The ending should be changed to an amp end for use with Fortran 77 compilers At this point the executable is executed and output is redirected to file results which is later copied to the appropriate printout file Except for the printout file which is ASCII all diagnostic data is written to separate files as either TEEE 32 bit data having a dta suffix or NetCDF
377. n Hellerman and Rosen stein climatological winds along with monthly mean Levitus 1982 climatological SST and sea surface salinity which are used by the test case to compute effective monthly mean heat and salt fluxes given a damping time scale which can be input from a MOM 2 namelist Refer to Section 5 4 for information on namelist variables Note that the time scale and thickness can be different for restoring temperature and salinity All are assumed to have been created by scripts from PREP_DATA so they These are potential temperatures 19 6 DIRECTORY STRUCTURE 255 are monthly averages appropriately defined as functions of latitude and longitude on the domain and resolution specified by module grids Each dataset is defined by an averaging period and time stamp which marks the end of the averaging period As the model integrates the datasets are used to interpolate to the time correspond ing to each model time step It should be noted that there is enough generality to accommodate datasets with other periods daily hourly etc and treat them as cli matologies periodic or real data non periodic Also datasets with differing periods may be mixed example climatological monthly SST may be used with hourly winds from other datasets The option used to configure this type of surface boundary condition for MOM 2 is time varying sbc data which is described further in Chapter 10 There are four methods for interpolating these datasets
378. n a U cell 134 CHAPTER 11 DISCRETE EQUATIONS Chapter 12 Discrete energetics Bryan 1969 noted that it is desirable to conserve first and second moments in the absence of dissipative effects to prevent systematic errors that accumulate in time and to avoid non linear instability In Section 2 2 it was shown that energy is conserved by the non linear terms in the continuous equations In Section 12 1 the finite difference counterpart of that argument relating to the ideas of Bryan on conservation of first and second moments will be given The argument follows that given by Bryan 1969 and Semtner 1974 In addition to non linear terms conserving energy it must be shown that the work done by the pressure terms is equal to the work done by buoyancy This result is given in Section 12 3 12 1 Non linear terms Let q be any three dimensional prognostic quantity at the centers of grid cells q1 92 43 qN with volumes a1 2 03 ay respectively What will be shown is that the finite difference analogue of the advection equation lq V 64 0 12 1 will conserve the two quantities N N 12 2 n 1 n l in time Using Stokes theorem to change volume integrals into surface integrals the finite difference form of the volume integral of Equation 12 1 is N dqa Cn usus gt AV d 0 12 3 with Gn In 12 4 where qn is the value in the nth cell is the area of the ith face of tha
379. n computing diffusive fluxes which take the form am csudatr insi 15 52 for momentum and diff fei ah estdruri Ligas in eoi 15 53 for tracers where diff am csudztr Leeu __ 15 54 COS Q s dati 41 diff cet ah cstdazur ce 15 55 cos row There is a similar absorption of the mixing coefficients diff cnt diff cnu in the northward diffusion of tracers and momentum The coefficients A and are also independent of time and are input through namelist Refer to Section 5 4 for information on namelist variables Spatially varying mixing coefficients It may be desirable to set horizontal mixing coefficients as a function of grid size when the grid is non uniform This is useful when large mixing coefficients are needed for numerical To save memory although this results in complications with different numbers of subscripts being used for various mixing parameterizations 15 15 HORIZONTAL SUB GRID SCALE MIXING SCHEMES 175 stability in coarse regions outside the area of interest but are too large for regions of high resolution within the area of interest Currently there is no option for doing this For tracer diffusion coefficients the change is easy For example suppose the grid is stretched in latitude Adding a variable diffusion coefficient is a matter of substituting for dif f cet in Equation 15 53 where is a scale factor depending on gri
380. n contains little work it may be faster to compute redundantly In practice this depends on the computer and compiler optimizations This can be verified by executing script run_timer which exercises the timing utilities in module timer F by solving a tracer equation in various ways It is one measure of a mature compiler when the speed differences implied by solving the equations in various ways is relatively small On the CRAY YMP the differences are about 10 whereas on the SGI workstation it can reach 100 28 CHAPTER 3 DATAFLOW idle Parallel efficiency can reach well into the upper 90 region although it is sobering to realize that even with a parallel efficiency of 99 596 only about 49 out of 64 processors are used This is a result of Amdahl s law To see results for other combinations execute the command amlaw on any CRAY system In the fine grained approach MOM 2 coding a group of latitudes is solved within an expanded memory window An outer loop controls the number of these latitude groups and wraps around all of the dynamics and physics Again this work can be viewed as a succession of triply nested do loops However each triplet is now itself a parallel region with the scalar and vector region on the inside In contrast to coarse grained parallelism MOM 1 code all processors work in parallel on each triplet When one triplet is finished all processors synchronize and move on to the next triplet and so forth until all loo
381. n converting to a flux the flux is a function of vertical thickness of the first model level 021 1 For instance consider two models The first with 424 1 10x10 cm and the second with 421 1 50xl0 cm Specifying dampts 50 days and dampdz dzt in both models implies a very different tracer flux into each The tracer flux is only comparable if dampdz has the same value in each model but this means the damping time scales are different 15 9 8 shortwave Heatflux at the ocean surface is composed of latent sensible longwave and shortwave com ponents When applied as an upper boundary condition at the ocean surface all of the flux is absorbed within the first vertical model level If vertical resolution is less than 25m this may lead to too much heating within the first level resulting in SST that is too warm Op tion shortwave allows some of the solar shortwave energy to penetrate below the first level This penetration below the surface is a function of wavelength For the case of clear water it is assumed that energy partitions between two exponentials with a vertical dependency given by pen A ec khh 4 1 A e fork 110 km 15 5 Coefficients are set for the case of clear water using A 0 58 1 35 cm and 9 2300 cm This means that 58 of the energy decays with a 35 cm e folding scale and 42 of the energy decays with 23 m e folding scale If the thickness of the first ocean level dztk 1 50 meters then p
382. n real array in matrix format scope Subroutine scope interrogates an array for the minimum maximum and simple unweighted average It also list their positions within the array sumlst Subroutine sumist performs a simple sum on the first index of and array for each value of the second index plot Subroutine plot contours an array by dividing the array values into bins and assigning a character to each bin It then prints the characters to produce a quick contour map The array must be real print_checksum Subroutine print_checksum prints a checksum for a two dimensional array checksum 72 CHAPTER 6 MODULES AND MODULARITY Function checksum calculates a checksum for a two dimensional array and returns the value The value is not printed wrufio Subroutine wrufio writes an array as an unformatted fortran write The purpose is to speed up writing by eliminating the indexed list when writing sub sections of arrays rrufio Subroutine rrufio reads an array as an unformatted fortran read The purpose is to speed up reading by eliminating the indexed list when reading into sub sections of arrays tranlon Subroutine tranlon is only used in limited domain models to move the Greenwich meridian outside of the limited grid domain It translates data in longitude and redefines longitudes to accommodate interpolating data which starts and ends at the Greenwich meridian Recall that for interpolating data grid coordinates must be monotonic
383. n smoothed out by the implicit treatment Essentially using the fully implicit treatment gives more smoothing than may be realistic for R gt 1 However using a few fully implicit steps at the end of the integration allows for proper averaging in cases where R gt gt 1 In MOM however the interval of interest is each timestep and without a fully implicit treatement the wiggles produced by the explicit treatment are left In order for the most accurate solution of the diffusion term it is necessary to set aidif 1 0 for all cases where R gt 1 Option implicitemir solves both the vertical diffusion of tracers and vertical diffusion of hor izontal velocity components implicitly Otherwise the vertical diffusion of horizontal velocity components is always solved explicitly In the case where option implicitumiz is not enabled vertical diffusion of tracers may be solved implicitly or explicitly depending on whether op tion isopycmix is enabled or not When option isopycmiz is enabled the vertical diffusion of tracers is always solved implicitly Explicit convection of tracers as described in Section 15 13 is activated only when option im plicitumiz is not enabled or option isopycmix is enabled Assume that the one dimensional vertical diffusion equation to be solved implicitly is given by Ek amp aidif 2 6 6 1 15 183 for levels k 1 to k km where y is the vertical profile of a tracer or a horizontal veloc
384. n this n loop 11 11 3 Advective and Diffusive fluxes Advective and diffusive fluxes across the north east and bottom faces of U cells within the memory window are calculated for use by the advection and diffusion operators described in Section 11 11 5 These are the canonical forms The actual form for the diffusive flux may differ depending upon which option is enabled Note that advective flux is missing a factor of 1 which is incorporated in the advection operator for speed reasons Also for reasons of speed a cosine factor has been absorbed into the definition of k j Limits on 7 are usually jsmw 2 and jemw jmw 1 except for the last memory window which may be only partially full Meridional operators require meridional flux to be computed for j 1 which is why the lower limit of the 7 index is not identical for all fluxes Refer to Figures 3 3 and 3 7 This is the depth of the grid point within the first T cell and U cell 11 11 CLINIC COMPUTES INTERNAL MODE VELOCITIES 125 adv feiy 2adv veu Witkin kj Ui kin Width jn 7 oJ Jsmw jemw 11 84 2 Uka nuiki Uik jnr J l jemw 11 85 2adv vbuik Wiknc kj Uik jnr Uik jnr j jsmw jemw 11 86 k M 7 0 r iA Uik jnr cos Ui 1 k jn 7 1 Ui k 1 diff ceu pj 1 4 7 7 EJ
385. nal netcdf variables are set by the call to get_axis Finish up by getting the definition of axes into the proper NetCDF variables with the following do n 1 num call get axis n cart axis n ipositive n amp cdimnam n cdimlnam n cdimunits n enddo This particular diagnostic requires writing two variables periodically and their properties must be uniquely defined The first variable named convect will be defined to be organized in the NetCDF file by axes 1234 Given the above definition of axes this means that NetCDF views the data as if it were dimensioned by x y z t The second variable named period is defined on axis 4 so is only a function of time Actually this diagnostic only outputs 18 2 LIST OF DIAGNOSTIC OPTIONS 233 instantaneous data so the period is zero The following code accomplishes the definition of properties for these two variables num 0 call def_var num convect Rate of convection dec C sec amp 1234 0 0 1 e6 false 0 0 32 nvarsout call def_var num period Averaging period days amp 4 0 0 1 e20 false 0 0 32 nvarsout The arguments for def var are a variable for consistency checking a short name a long name units character string indicating which axes contain data smallest valid number for the data largest valid number for the data logical for special value special value used to signify missing data number of bits used for pre
386. nal of Physical Oceanography Vol 17 No 6 Rosati A and K Miyakoda 1988 A general circulation model for upper ocean simulation Journal of Physical Oceanography 18 1601 1626 327 D 0 16 Southern Ocean Gill A E and K Bryan 1971 Effects of geometry on the circulation of a three dimensional Southern Hemisphere ocean model Deep Sea Research 18 685 721 England M H 1992 On the formation of Antarctic Intermediate and Bottom Water in ocean general circulation models J Phys Oceanogr 22 918 926 England M H J 5 Godfrey A C Hirst and M Tomczak 1993 The mechanism for Antarctic Intermediate Water renewal in a World Ocean model J Phys Oceanogr 23 1553 1560 England M H and V C Garcon 1994 South Atlantic circulation in a World Ocean model Annales Geophysicae Special edition on the South Atlantic Ocean 12 812 825 Toggweiler J R and B Samuels 1993 Is the magnitude of the deep outflow from the Atlantic Ocean actually governed by the Southern Hemisphere winds In The Global Carbon Cycle Edited by M Heimann NATO ASI Series Vol I 15 lToggweiler J and B Samuels 1993 Effect of Drake Passage on the global thermohaline circulation Preprint Togeweiler J R and B Samuels 1993 Effect of sea ice on the salinity of Antarctic Bottom Waters Preprint D 0 17 Global Ocean Bryan K and M Cox 1967 A numerical investigation of the oceanic general circulation Tellus 19 5
387. nc grids F Set grid definitions for options obctest and obctest2 hmixc F Set ahc north ame north for obc north ahc south amc_south for obc south to zero at open boundaries This is done as a precaution to prevent diffusion beyond the open boundary isleperim F Set open boundary cells to land values for Poisson solver is calculated as for closed boundaries Values at jrow 1 2 jmt 1 and jmt are added later Similar handling for i 1 2 imt 1 and imt loadmw F e set velocity values at jrow 1 and jrow jmt 1 to prevent diffusion over the bound aries Ui ki Ui k 2n gt Ui k jmtyn Ui k jmt 1n Uik jmt 2n for and 1 add in loadmw_obc inc e set tracer values at jrow 1 and jrow jmt to prevent diffusion over the boundaries ti kan lik 2n likjmtn lik jmt 1 n for and 1 add in loadmw_obc inc e set rho values at jrow jmt to prevent errors in the calculation of the hydrostatic pres sure gradients at the northern boundary pik jmt Pi k jmt 1 n add in loadmw_obc inc 146 CHAPTER 13 STEVENS OPEN BOUNDARY CONDITIONS mom F e include cobc h e include calculations for boundaries add in mom obc inc first memory window example for options obc south and obc north for options obc west and obc_east changes are in the routines itself call clinic as before changes are in the subroutine itself cobc for jrow 2 tracer for the rest of the memory
388. nce free even if the solution for change in stream function Aw is not accurate The accuracy of the solution for Aw is governed by tolrsf which is input through namelist Typically the value is 105 em sec Remarks Use of polar filtering on the forcing term of the elliptic equation for the implicit free surface method has been shown to lead to problems Removing the filtering eliminates the problem Speculation is that the polar filering would not be needed on the forcing term of the elliptic equation for the stream function method either However this has not yet been investigated 16 1 1 The equation The stream function equation is generated by taking the curl of the vertically averaged mo mentum equations to knock out the unknown surface pressure terms This is done by vertically averaging the Equations 2 1 and 2 2 expressing the averaged velocities in terms of a stream function and taking the k Vx of these equations yielding H where J is the Jacobian acor is the implicit Coriolis factor the Coriolis term f 20 sin and F is the vertically averaged forcing computed in subroutine clinic The boundary condition E Vh cor Q k VxF 16 1 Worked out by Charles Goldberg The Jacobian is given as J A B cuz eg 9292 acor zero implies that the Coriolis term is handled explicitly Otherwise 0 5 lt acor lt 1 0 implies implicit handling of the Coriolis term This is useful for
389. ndary condition The memory increase may get excessive with large resolution models In that case option minimize sbc memory reduces these arrays from being dimensioned as imt jmt to being dimensioned as imt jmw The trade off is increased disk access which may be prohibitive if using rotating disk If efficiency is an issue asynchronous Refer to Chapters 1 and 5 In CASE 0 the surface boundary conditions are zonally averaged time means Since they are only functions of latitude array sbcocnj jrow m does not exist and surface boundary conditions are set directly into arrays stfi jn and 22 should be noted that there is enough generality to accommodate datasets with other periods such as daily hourly etc and treat them as climatologies periodic or real data non periodic Also datasets with differing periods may be mixed For example climatological monthly SST may be used with hourly winds he one which is no longer needed 25 Contained in file timeinterp F This is the subroutine that does interpolations in time 10 3 SURFACE BOUNDARY CONDITION DETAILS 101 reads with look ahead capability would be worth trying This look ahead feature has not been implemented 10 2 1 Bulk parameterizations Section 10 2 describes three simple atmospheres requiring very little computation In general the atmosphere is sensitive to SST but not sea surface salinity Since fresh water flux into the ocean is not known very accurately
390. nding latitudes to define one or more regions in latitude These coordinates mark the position on U points in latitude Variable z depth is dimensioned by parameter nzdepths which gives the number of bounding depth coordinates to define one or more regions in depth Units are in and mark where the position of the bases of T and U cells will be Note that the bottoms of T and U cells define where the vertical velocity points are located Associated with variables zx lon y_lat and z depth are variables which define the respective resolution dx lon dy_lat and dz depth of cells at the bounding coordinates Units are in degrees for dx lon and dy_lat but in cm for dz depth Note the variable stretch_z provides additional stretching for the last region in the vertical When stretch z 1 0 there is no additional stretching However when stretch z gt 1 0 additional stretching is applied To see how it works set stretch z 1 1 and gradually increase it It can be used to approximate an exponential fall off in the vertical 80 CHAPTER 7 GRIDS When executed script run grids creates a sub directory and compiles module grids using option drive grids to activate a driver as the main program After executing results are copied to a file in the directory from which script run grids was executed and the sub directory is eliminated View the file results grids with an editor When satisfied copy size h from the MOM 2 directory and change the parame
391. ne model employing a stretched vertical coordinate indicates again that method 2 is better than method 1 In both cases better means that the variance of the solution was closer to the variance of the analytic solution by a few percent In short integrations using MOM 2 the effect showed up as less spurious creation of tracer extrema in grids constructed with method 2 as compared to method 1 Whether this difference is robust in all integrations has not been demonstrated Nevertheless in light of these results the default grid construction in MOM 2 is method 2 Method 1 can be implemented by using option centered_t It should be stressed that regardless of which method of grid construction is used the equations don t change and first and second moments are conserved Of primary importance when constructing a grid is whether the physical scales are adequately resolved by the number of grid points Beyond this grid construction by method 1 or method 2 is of secondary importance 7 3 Constructing a grid The domain and resolution is constructed in MOM 2 by calling module grids to construct a grid system Executing MOM 2 to design a grid is similar to using a sledge hammer to work with tacks Instead module grids can be executed in a much simpler environment without the rest of MOM 2 by using script run_grids This is a UNIX C shell script which assumes an 77 compiler which allows the script to run on workstations To run on a CRAY change the 77
392. nents of the momentum Equation are contracted into regional volumes with the canonical forms given below One way to think of this is that all cells within a regional volume U nreg are replaced by one gigantic U cell and the value of all terms in the momentum equation are given for this one cell Subscript n refers to the zonal velocity component and n 2 refers to the meridional component ter MOMI aeg Te Ap 18 101 termbm2nnreg grad pog 9 18 102 termbms3nmreg ADV ang 160 18 103 termbmanmreg ADV Uyg O 18 104 240 CHAPTER 18 DIAGNOSTIC OPTIONS termbmsnnreg ADV Tr rey 18 105 termbmennreg DIFF Urg O 18 106 termbmrmreg DIFF ya O 18 107 termbmsnmreg DIFF C g 9 18 108 termbmonmreg DIFFanctri s ga 18 109 termbmionmreg CORIOLIS ng D 18 110 terMbMiinnreg e9 18 111 termbMi2n nreqg grad_p kin nreg 18 112 termbmyanmreg ADV O 18 113 18 114 In Equation 18 112 the quantity grad p n is calculated from Equations 18 13 and 18 14 The equation for the gigantic grid cell in each regional volume U nreg is given by 13 termbM1 termbmennreg 18 115 2 Note that terms 3 4 and 5 are the flux form of advection When summed up they represent the physical advection in the cell However when taken separately they do not represent the true advection 2 because they contain divergent components The true advection in
393. ng the part containing diff fbiso is solved explicitly with all other explicit components and the part containing the 23 Component is solved implicitly due to restrictions on stability Refer to Section 11 10 3 for details FR Tag diff ise Fry Ke Tus i ue X da ui 1Lip Y Aen l cip k kr jt k 3 64 X 0 kr 0 i k kr j i k kr j bx pj 1 ip k kr j kj i k kr j Gk kr 5 i k kr j T5 2 igo 4 1539 ii y l eer 1 T 2L E cos P AGD Ge krj 1e jalik D A Tusce X 4 cos dyt j 220 Koo yP i kkrj 1 jg 020 Gk kr 3 2 Gk kr 3 2 i kd kr 3 5 poa ePi itip kkr i i kTkrj 1454 where the the non negative K component of the Redi tensor is given by 6 y 15 97 1 S deu vain AGED l ip k kr jli k j vii 0 kr 0 i k kr j 2 4 1 3 dk kr ik kr j 6s pf TED 5 iq oa sk kr 1 1 U iden cos 145 UU Gi k kr j 1 jqli k j 4cos 9 dyt gt Pj 1 ja JUj 14jq x by Gk kr j jqli k j i k kr j k kr j TR 15 98 i k Fkr3 A9 5 ips 0 1 6 vi 00 k kr j tig 2Pi kj P 15 16 HYBRID MIXING SCHEMES 183 The small angle limit of these results yiel
394. no responsibility for problems or incorrect usage It is stressed that the researcher accepts full responsibility for verifying that their particular configuration is working correctly U S Department of Commerce DOC Software License for MOM 2 1 Scope of License Subject to all the terms and conditions of this license DOC grants USER the royalty free nonexclusive non transferable and worldwide rights to reproduce modify and distribute MOM 2 herein referred to as the Product 2 Conditions and Limitations of Use Warranties Neither the 0 5 Government nor any agency or employee thereof makes any warranties expressed or implied with respect to the Product provided under this License including but not limited to the implied warranties or merchantability and fitness for any particular purpose Liability In no event shall the 0 5 Government nor any agency or employee thereof be liable for any direct indirect or consequential damages flowing from the use of the Product provided under this License Non Assignment Neither this License nor any rights granted hereunder are transferable or assignable without the explicit prior written consent of DOC Names and Logos USER shall not substitute its name or logo for the name or logo of DOC or any of its agencies in identification of the Product Export of technology USER shall comply with all U S laws and regulations restricting the export of the Product to other countries Governing Law T
395. not found statistics will be printed indicating how close the integration is to violating the CFL condition along with other information described above The output from this diagnostic may only be written as ascii to the model printout The interval between output is specified by variable stabint 18 2 17 term balances Option term balances constructs instantaneous spatial averages of all terms in the prognostic equations over arbitrary regional volumes defined by horizontal and vertical region masks as described in Section 18 1 4 Regional volumes may be set up as indicated by the test case example in file setocn F They may not overlap one another This diagnostic is useful when trying to understand the dominant balances within regional volumes of the model domain Be aware that aliasing may occur because results are not averaged in time This diagnostic is relatively slow and can appreciably degrade the speed of MOM 2 The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted data to file term bal dta If option netcdf or term balances netedf is enabled data is written in NetCDF format to file term bal dta nc rather than in unformatted IEEE The interval between output is specified by variable trmbint and the control is specified by variable iotrmb Note that the regional masks mskhr jrowand mskvrgare also written to file term bal dta when the initialization boolean itrmb is true It should be
396. now be written 0 Lk krli k kr 1 COs of dyt 4 T k 16s pl Um Ti p ETE 7 t k kr i k kr Sep kt kr 6p 1 dr 0 Aal G1 klit ip k 169 x 1 6 Litip k DAN Er Tias pna i 6 6 t ip k y i ip k y vPFQ l k B 217 yPi ip k zPi ip k 1 Similar considerations for the three other triads lead to the subcells 14 17 22 becoming dzu cos oF dyt 0 k kr Aa ke keri k 1 6 x kr 1 6 CERA L CERT L FUE 2 20 ka kr yPi k kr zPik 1 dzwy 4 dyt lt 7 iti 197 LIS kit ip k 16 965 x 0 zPi ip k 1 B 218 i ip _ 6 yPi ip k zPitip k 1 the subcells 15 20 23 becoming 1 agg c Le i x kr 0 spi EEG 2P ik bT bno sk kr dzwydyt m iti 5 Ag HDA i _ 1 k i ip k p 7 x p P be Ti s pn CTUM ci B 219 vPi ik uP isin ZF i ip k and the subcells 16 18 24 becoming 1 dau dytj AGEN G k rji kbp TAI x kr 0 6 ik kr ik kr t k kr AE aes le uy 302 APPENDIX B ISOPYCNAL DIFFUSION dzwidut 2 2 ii QM APG klit ip Wb x 6 T pU PP Lom us Le om e eti B 220 20 uP i i
397. ns it should be noted that not all ideas having scientific merit are suitable candidates to be included The deciding factor is whether or not the implementation would compromise the design of MOM 2 or in some way add impediments to future model develop ment Constructs that compromise the design can sometimes be recast into a more appropriate form Those that bypass rather than incorporate the underlying data structure in MOM 2 and substitute their own are best thought of as a separate effort The current version of MOM 2 with its three dimensional array structure allows for lots of generality and is much closer to what was envisioned as the goal by developers of MOM For this effort to succeed collaborators are strongly encouraged to adhere to the underlying design principles and coding style which is used consistently throughout the model An easy to use document preparation system by Leslie Lamport published by Addison Wesley 1986 which is widely available and acts as a front end for TEX by Donald Knuth While MOM 2 was being developed adding new options sometimes lead to problems which were alleviated by tweaking the underlying design Consideration was given to how details of a parameterization affected overall coding structure and what the resulting changes in structure implied for details of parameterizations Iterating over this bottom up top down approach led to a design which required successively fewer modifications The fundamental
398. ntains approximately 160MB of IEEE 32bit data and the files are named as follows scripps top is the Scripps topography 265816 bytes hellerman tauis the Hellerman Rosenstein 1983 windstress climatology 1757496 bytes oorts air is the Oort 1983 1000mb air temperature climatology 294268 bytes levitus mask is the Levitus 1982 land sea mask 8680716 bytes ann temp is the Levitus 1982 annual mean potential temperatures 8682036 bytes ann saltis the Levitus 1982 annual mean salinities 8682036 bytes Then there are the Levitus 1982 monthly climatological potential temperatures There are twelve monthly files where the three letter suffix gives the month jan temp is the Levitus 1982 monthly mean potential temperatures 4998748 bytes The remaining eleven monthly temperature files are of the same size but use a different month as the suffix Then there are the Levitus 1982 monthly climatological salinities There are twelve monthly files where the three letter suffix gives the month jan saltis the Levitus 1982 monthly mean salinities 4998748 bytes The remaining eleven monthly salinity files are of the same size but use a different month as the suffix 41 42 CHAPTER 4 DATABASE Note that the file size for the monthly Levitus 1982 data is less than the file size for the annual means This is because seasonal effects only penetrate down to 1000m or so and the monthly data only extends to this depth Als
399. ntains the convection module It may be exercised in a stand alone mode by executing script run_convect which enables option test_convect The driver is intended to show what happens to two bubbles in a one dimensional column of fluid when acted on by the old style explicit convection used in previous versions of MOM and a newer explicit convection scheme enabled by option fullconvect Refer to Section 15 13 for details on both types of convection 6 2 2 denscoef F File denscoef F contains module denscoef which computes a set of coefficients used in a third order polynomial approximation to density given in Bryan and Cox 1972 as o T S 21 10 cp OT 2 5 cy a TY cy 6S 456765 cy el TP cp s 6S ET amp amp 5 ck 8S 6 1 where T and 65 are departures of temperatures and salinities from mean values which are dependent on depth In MOM 2 the polynomial can approximate either the Knudsen Formula option knudsen or UNESCO equation of state the default for sea water Generating the polynomial coefficients At each model depth zt density is divided into 50 points between minimum and maximum density The minimum density is specified by the minimum in situ temperature tmin and salinity smin and the maximum density is specified by the maximum in situ temperature and salinity smaa based on observations Levitus 1982 These temperature and salinity ranges are determined f
400. ntl Y ou 3 tik in r 1 15 137 where the coefficients are given by quick so 2 dytjrows1 dytjrowt Cytjrow 15 138 quick o 2 dytjrow dytjrow4i dytjrow 15 139 CUM row 2 dytjrow Ut jrowss Aytjrow 1 2 dytjrow dytjrow 1 dytjrow41 15 140 curve 2 dytjrowt1 dYtjrow dytjrow 1 dytjrow 15 141 curo 2 01 dytjrows1 dYtjrow 1 2 dytjrow Cytjrow41 dytjrow 1 dytjrow 15 142 2 dytjrow dytjrows1 dytjrow 2 dytjrow41 dytjrow42 dytjrow 1 dytjrow 2 15 143 CUTU wy 2 2 dytirow dYtirow 1 dytirow ytjrow42 dytjrow dytjrow 1 15 144 curo 2 01 yt jrows1 dYtjrow 2 dytjrows1 dytjrow42 dytjrow dytjrow 1 15 145 Note that the indices in the above expressions require that option fourth order memory window be enabled This is automatically done when option quicker is enabled Also for ocean cells next to land cells and the surface the correction term on the face parallel to the land boundary is dropped thereby reducing the flux to second order Normal flux on faces shared by land cells is set to zero Masking not shown is used to enfore this In the vertical direction twice the advective flux through the bottom face of the T cell is given by adv vbt t adv vbt 2 15 146 T advvbti kj adv vbt k
401. o salinity has been interpolated from four sea sonal values to twelve monthly values within this dataset All Levitus 1982 data as well as Hellerman Rosenstein 1983 and Oort 1983 data has been forced into land areas on their native grid resolutions by solving VE 0 4 1 over land areas using values of over ocean areas as boundaries values where i jrow represents the various types of data This method is similar to what was done with surface boundary conditions in Section 10 1 2 Chapter 5 Variables 5 1 Naming convention for variables Modern compilers no longer restrict variable names to 6 or fewer characters This 6 character restriction is also relaxed in MOM 2 although economy of characters in choosing names is always desirable In an attempt to unify naming of variables a convention is introduced which uses abbreviated forms of the fundamental conceptual pieces of the numerical oceanography This convention also gives guidance for building the names for variables in future parameterizations and keeps an overall consistency throughout the model Constructing names for variables is then a matter of assembling these abbreviations in various ways Note that when names of variables are spelled out the naming convention should not be applied However when names seem cryptic the convention is intended to help decipher their meaning list of abbreviations is given below u Velocity point d Delta adv lt Advect
402. o equivalent accuracy Refer to Section 16 1 4 for details of the island equations 6 2 6 ppmix F File ppmix F contains the module which calculates vertical mixing coefficients based on the scheme of Pacanowski Philander 1981 Script run ppmix exercises this module in stand alone mode by enabling option test_ppmix The driver uses a simplified 1 D equation configuration with Coriolis and vertical diffusion terms at a specific latitude to indicate how mixing penetrates vertically The 1 D equations are Ou fv OR 6 5 bw fu km 02 v 6 6 OT with values of and being predicted by the scheme of Pacanowski Philander 1981 Refer to Section 15 14 2 for details of the scheme 6 2 LIST OF MODULES 67 6 2 7 timeinterp F File timeinterp F contains the time interpolator module It is exercised in a stand alone mode using script run_timeinterp which enables option test timeinterp The output indicates how surface boundary condition data which may be monthly averages daily averages etc is interpolated to the current time step in a simulated model integration Keep in mind that interpolating surface boundary conditions in time only applies in the model when op tion time_varying_sbc_data is enabled Based on model time the time interpolator decides when to read data from disk into memory buffers When to read and which data to read is determined by the relation between the model tim
403. o other computer platforms since no data files need be considered scripps_kmt reads the scripps top 1 x 1 topography file from the MOM 2 DATABASE explained in Chapter 19 and interpolates to kmt jrow for the grid defined by module grids Subroutine scripp within module topog makes an educated guess as to whether resolution specified by module grids is coarser or finer than the native Scripps resolution If finer it does a linear interpolation from Scripps data otherwise it uses area averaging of Scripps data to estimate the value of j ow for the resolution required by module grids e ctopo kmt reads the file ETOPOS5 NGDCunformat iece which is a 1 12 x 1 12 topog raphy dataset It may be purchased from the Marine Geology and Geophysics Division of the National Geophysical Data Center and is not included in the MOM 2 DATABASE Depths are interpolated to a kMti jrow field for the grid defined by module grids Sub routine etopo within module topog does the interpolation If model resolution is finer than 1 12 a linear interpolation from the dataset is used otherwise area averaging over the dataset is used to estimate the value of kmt for the resolution required by module grids e read my kmt allows importing kmt jrow fields into MOM 2 which have been exported from module topog using option write my kmt kmt jrow field may be exported from module topog The purpose of importing is to provide a hook for reading
404. o pii fork 1 18 8 k d grav d2Wm1Pim tg 2tokm 18 9 ma2 The internal mode pressures in units of gm cm sec are given by removing the vertical mean 1 kmt i jrow pit pik _ Dij dztk 18 10 od UM ZWk kmt ijrow 2 UM The external mode pressure is available from diagnostic diagnostic surf height Note that output from this diagnostic is only available in NetCDF format in file density dta nc and the interval between output is specified by namelist variable densityint in units of days Refer to Section 5 4 for information on namelist variables 224 CHAPTER 18 DIAGNOSTIC OPTIONS 18 2 3 diagnostic surf height Option diagnostic surf height constructs an average sea surface elevation from the prognostic stream function It does this by accumulating a forcing term in time then averaging over a specified interval because this is a linear problem to produce an average forcing X and solving an elliptic equation of the form V HVp X 18 11 for average surface pressure p which is then converted into height using p d i jrow 18 12 Spi Do grav where the height dsp jrow is in units of em The process begins after solving for the external mode stream function The surface pressure gradient terms can then be reconstructed from Equations 16 2 and 16 3 as 1 1 1 6 6 3 6 A 1 6 A t jrow Pocos
405. ocean km jrow are set to level km If used with option cyclic it configures a zonally re entrant channel If used with option solid_walls then all boundary jrow cells are land cells 15 7 2 idealized kmt This produces an idealized map of the world s geometry with a bottom depth that is not realistic It requires no data and is highly portable This is also good for investigations where idealized geometries need to be constructed The geometry and topography are interpolated to the resolution specified by module grids 15 7 3 scripps_kmt This generates geometry and topography interpolated from SCRIPPS data in the DATABASE described in Section 19 6 to the resolution specified by module grids 15 7 4 etopo kmt This generates geometry and topography interpolated from a 1 12 x 1 12 dataset to the resolution specified by module grids 15 7 5 read my kmt This option imports a topography and geometry kMt jrow field from outside of the MOM 2 environment or one produced from option write my kmt This dataset may be purchased from the Marine Geology and Geophysics Division of the National Geophysical Data Center and is not included in the MOM 2 DATABASE 15 8 INITIAL CONDITIONS 157 15 7 6 write_my_kmt This option exports a topography and geometry kmt jrow field by writing it to disk 15 7 7 flat bottom To deepen all ocean jpow cells to the maximum number of levels given by level km enable this option It work
406. odel in A and z discussed below because of the short vector lengths in longitude A similar contraction can be performed in the latitudinal direction to end up with a two dimensional model in longitude and depth 2 Here again the minimum number of latitudes is jmt with jrow 2 and jrow 3 being ocean T cells and grow 1 and jrow 4 being land cells Note that there is only one latitude of ocean U cells If these U cells are placed at the equator with the two ocean T cell latitudes placed symmetrically about the equator and there is no meridional variation in initial conditions or forcing then the model is two dimensional in and z Again the scientific question being posed needs to be suited to this design Note that this type of model really flies computationally because of the long vectors in the longitude dimension The memory window should be opened to jmw jmt to make it as efficient as possible In the vertical the minimum number of ocean levels is 2 T herefore the bounding surfaces and resolutions can be set to yield km 2 Note that kmt jrow lt 2 is not allowed 7 4 Summary of options The following options are used by module grids and are enabled by compiling with options of the form Doption Doptionl e drive grids turns on a small driver which allows the module grids to be executed in a simple environment This is only used for designing grids with the script run grids It is not appropriate when executing MO
407. of how latitude rows are mapped into the ramdrive area of processor 1 and processor 2 of a num_processor processor system As indicated five latitudes are contained in each ramdrive area but only three of those latitude rows are updated with 7 1 data The others are needed as buffer rows The five latitude rows are arbitrary If the total number of rows jmt were larger then each processor would have more rows The important point is that each processor should contain the same number of computed rows Within each processor the memory window updates computed rows to time level 1 one row at a time until all computed rows are updated as indicated by the color red After all processors have updated their computed rows data from some of these rows must be copied into corresponding rows on other processors to prepare for the next time step Communication reading and or writing the memory of other processors is used to update these rows Figure 3 13 indicates a similar situation for a fourth order memory window This time two buffer rows are required on each side of a computed row and this requires additional communi cation Note that the minimum size of the memory window is jmw 5 rows as contrasted to jmw 4 when not multitasking The extra row is needed for boundary computations For all processors from n 2 num processors the following prescribes the communication for a second order memory window e copy all data from latitude
408. of modules by filename and a description of what they do The run scripts which activate these modules in a stand alone mode are all UNIX C shell scripts and should work on any workstation running UNIX They are amenable to change and are intended as prototypes Each module has a unique ifdef option which is given within the section which describes the module This is usually done in the run script Enabling options can also be done another way by hardwiring them into the code using define statements Sometimes by the module itself Other times by the judgement of the researcher based on output from the module When this is done the routine is termed plug compatible 9When code is being developed and constantly changing as in a research model Variables are commented and organized into groups that make sense physically 6 2 LIST OF MODULES 63 Recommendation When experiencing problems in MOM 2 relating to modules the recommendation is to run the module in isolation stand alone mode as described below in an attempt to reproduce the problem in a simpler environment For example if a problem is suspected with I O try to replicate it within the driver for the I O manager iomngr Or if a diagnostic is not being saved at the intended time try to replicate this in the driver for the time manager module tmngr For additional information refer to related options in Chapter 15 as indicated below 6 2 1 convect F File convect F co
409. ognostic data is updated to time level 1 26 CHAPTER 3 DATAFLOW per processor rather than multitask using more than one processor per job This works as long as individual processor speed is fast and there are enough jobs to keep all processors busy The situation dramatically changes when processors are slow or there are not enough jobs to keep all processors busy If processors are slow jobs don t turn around in reasonable time and if enough jobs are not available processors stand idle In either case the system is under utilized and multitasking increases overall throughput With eight processor on a CRAY YMP at GFDL there were enough jobs to keep all proces sors busy With sixteen processors on the CRAY C90 this was still the case and with twenty processors on the CRAY T90 this is still the case However at some point it is envisioned that this will no longer be the case and jobs will have to be multitasked This section describes advantages and disadvantages of the two approaches to parallelism available in MOM 2 Note that the coarse grained approach is essentially the method used in MOM 1 and comments apply there as well Consideration is given to memory and disk requirements redundant calculations array structure and parallel efficiency Memory requirements There is a substantial difference in the memory requirements between coarse and fine grained approach to parallelism way to see this is to refer to Figure 3 10
410. olland W R 1967 On the wind driven circulation in an ocean with bottom topography Tellus 29 582 600 Holland W R 1973 Baroclinic and topographic influences on the transport in western boundary currents Geophysical Fluid Dynamics 4 187 210 D 0 13 Tracers Boning C 1988 Particle disperson and mixing of conservative properties in an eddy resolving model Journal of Physical Oceanography 18 320 338 Danabasoglu G J C McWilliams and P R Gent 1994 The role of mesoscale tracer transports in the global ocean circulation Science 264 1123 1126 Duffy P B P Eltgroth A J Bourgeois and K Caldeira 1995 Effect of improved subgrid scale transport of tracers on uptake of bomb radiocarbon in the GFDL ocean general circulation model Geophysical Research Letters 22 1065 1068 Gent P R J Willebrand T McDougall and J C McWilliams 1995 Parameterizing eddy induced tracer transports in ocean circulation models Journal of Physical Oceanography 25 463 474 Holland W R 1971 ocean tracer distributions Part 1 preliminary numerical experiment Tellus 23 371 392 Togeweiler J R K Dixon and K Bryan 1989 Simulations of radiocarbon in a course resolution world ocean model 1 Steady state prebomb distribution Journal of Geo physical Research 94 8217 8242 Togeweiler J R K Dixon and K Bryan 1989 Simulations of radiocarbon in a course resolution world ocean model 2 D
411. ological or mean months The alias error reduces as more and more years are included in the climatology Sometimes only symbolically 222 CHAPTER 18 DIAGNOSTIC OPTIONS A better way is to filter out energy at periods of one week by constructing monthly averages which are then saved once per month A dataset of monthly averages represents estimates that are statistically more stable than a dataset of instantaneous values If there is little energy at periods shorter than the period of interest then saving instantaneous samples is essentially the same as saving monthly averages The averaging period need not always equal the interval at which results are saved This applies when frequencies are widely separated For instance suppose that the amplitude of a diurnal period one cycle per day is not negligible compared to the amplitude of an annual period one cycle per year The diurnal period can be effectively removed and the annual period resolved by saving a three or four day average at the end of every month 18 1 4 Regional masks For use with certain diagnostics calculations the model domain may be sub divided into a number of regions over which calculations are averaged An arbitrary number of non overlapping regions of areal extent are defined by setting a horizontal region mask number mskhrj jrow m where i jrow is in region m for m 1 nhreg and nhreg is the number of regions way to do this is to use the subroutine seth
412. olution can be specified as constant or non uniform along each of the coordinate directions Although non uniform resolution is permitted it is not allowed in the sense of generalized curvilinear coordinates Resolution along any coordinate is constrained to be a function of position along that coordinate For instance vertical thickness of grid cells may vary with depth but not with longitude or latitude 7 1 2 Resolution The resolution within a region is determined by the width of the region and resolution at the bounding coordinates Along any coordinate if resolution at the bounding coordinates is the same then resolution is constant across the region otherwise it varies continuously from one boundary to the other according to an analytic function Treguier Dukowicz and Bryan 1995 The function describing the variation is prescribed to be a cosine Although arbitrary this function has two important properties it allows the average resolution within any region to be calculated as an average of the two bounding resolutions and it insures that the first derivative of the resolution vanishes at the region s boundaries vanishing first derivative allows regions to be smoothly joined The only restriction is that there is an integral number of grid cells within a region 15 16 CHAPTER 7 GRIDS To formalize these ideas let a region be bounded along any coordinate direction latitude longitude or depth by two points a and B at which
413. olves the following equation by inverting a tri diagonal matrix as given in pages 42 and 43 of Numerical Recipes in Fortran 1992 79 Ur E inc UP kin 2Ar 6 aidif diff_chu elU k nri 11 114 The time derivative of velocity is then given by 6 UF incl Ui kj n r 1 11 115 T kn IAT The recommendation from Haltiner and Williams 1980 is for aidi f 0 5 which gives the Crank Nicholson implicit scheme which is always stable This setting is supposed to be the most accurate one However this is not the case when solving a time dependent problem as discussed in Section15 19 4 Note that in the model code is temporarily stored in Ui k jn r 1 aS a space saving measure until the internal modes are computed as indicated below 11 11 7 Diagnostics At this point diagnostics are computed for velocity component n using previously defined operators For a description of the diagnostics refer to Chapter 18 11 11 8 Vertically averaged time derivatives of velocity The vertical average of the time derivative of the velocity components is computed as the last item within the loop over velocity components The vertical averages are constructed as km 1 ZU jrow n 5 dzty 67 UF 11 116 jrow pay and later used to construct the forcing for the external mode 11 11 9 End of momentum components At this point the do n 1 2 loop issued in Section 11 11 2 is ended After completion of this
414. om currents respectively Each term in the previous budget admits an interpretation First the terms Pom uz Vz z zup Pof m uz vz z H Ac Gz V eds ids V pity nas 2 31 represent respectively the advective redistribution of kinetic energy through the boundary and the performance of mechanical work by pressure along the boundary Both of these terms vanish for domains whose only open boundary is the ocean surface since the normal velocity dig n vanishes on the boundary of such a domain The winds perform work on the system as represented by W Jas T Ting 2 32 Buoyancy effects perform work as represented by the term B lt pgw gt 2 33 Finally there is the viscous dissipation of energy in the interior walls and bottom D p lt F gt lt km 0 gt Jas T Tiottom 2 34 The budget for this volume therefore takes the form Ep A G4 W 4 B D 2 35 where again A G 0 for a closed domain such as the World Ocean guy 0 for rigid lid 10 CHAPTER 2 OCEAN PRIMITIVE EQUATIONS 2 2 2 External and internal mode budgets As discussed by Bryan 1969 the primitive equations are conveniently separated into two general modes of flow the external or barotropic mode which represents the depth averaged flow and the internal or baroclinic mode which is the depth dependent flow It is useful to consider the energetics of these two modes For this purpose introduce the depth averaging ope
415. on density netedf is enabled If the velocity field at cell T k jrowuis approximated as od L Viki Wako Weegee 524 advecta 18 4 then the instantaneous diapycnal D and along isopycnal A velocities are given by C dh Virje Sieg 18 5 Ving Dus 18 6 i Output in 32 bit IEEE unformatted data is not an option for this diagnostic The three veloc ity components zonal meridional and vertical of D and A are output only in NetCDF format to file cross dta nc and the interval between output is specified by namelist variable crossint in units of days Refer to Section 5 4 for information on namelist variables 18 2 2 density_netcdf It is useful to construct both a locally referenced potential density and potential density Gi k j referenced to a specific depth The superscript in is used to differentiate between potential density anomaly used throughout MOM 2 and the full potential density To construct the full density pli in units of gm cm at each T cell the mean reference density must be added to the deviation ull re pus PET 18 7 where pict is described in Section 6 2 2 When option potential_density is enabled oo referenced to the surface referenced to 1000m referenced to 2000m and referenced to 3000m are also constructed and saved Using pi x the hydrostatic pressure is given by integrating Equation 11 79 to yield Piaj grav dzw
416. on isopycmir is enabled If option gent_mcwilliams is also enabled the Gent McWilliams 1990 advection velocities are computed Refer to Sections 15 16 3 15 16 4 and 15 16 5 for the details 17 Contained in file isopyc F 116 CHAPTER 11 DISCRETE EQUATIONS 11 7 vmixc computes vertical mixing coefficients Subroutine vmixc computes vertical mixing coefficients for momentum diff cbu and trac ers diff_cbt kj according to the scheme selected by options at compile time Subscripts for the mixing coefficients depend on which option was enabled Options are constumix for constant vertical mixing coefficients ppvmix for Richardson dependent vertical mixing coefficients as in Pacanowski Philander 1981 and tcvmix for the second order turbulence closure of Mel lor Yamada as given in Rosati and Miyakoda 1988 However tcvmix is not available as of this writing but is being implemented by Rosati at GFDL One of these must be enabled and all adjustable values are input through namelist Refer to Section 5 4 for information on namelist variables Additionally there are two hybrid options allowed which supply mixing coefficients in the vertical for tracers but not momentum Option isopycmiz is for diffusion of tracers along isopy cnals as described in Sections 11 6 15 16 3 and option bryan lewis vertical Bryan Lewis 1979 sets constant values as a function of depth for the vertical mixing coefficient When op tion isopycmiz
417. ontributions to the corner points of the nine point op erator to produce a five point operator that has coefficients only in the center north east south and west places in the coefficient matrix for inverting the external mode elliptic equa tion This option can be used with option stream function but is not appropriate for op tions rigid lid surface pressure or implicit_free_surface because of energy leakage In Equation 17 9 corresponding to the first bracket of Equation 16 1 all 32 contribu tions to the elliptic operator are calculated as in the 9 point operator except that in the first group i e in the terms originating in a second difference in the direction the coefficient of the northeast variable jrow 1 1 18 averaged with the coefficient of the northwest variable A i jrow 1 1 and both are applied to the northern variable j ow o 1 This averaging centers the coefficient on the northern edge of the central T cell so that continuous derivatives in the direction are well approximated Similarly the southeast and southwest contributions from the first group are applied to the southern variable 54 0 1 The second group of terms originate in a second difference in the direction and here the northeastern and southeastern contributions are averaged and applied to the eastern variable jrow 1 0 and the northwestern and southwestern contributions are averaged and applied to the western variable j o
418. operator eliminates this reference When vertical gradients of density are needed both densities are referenced to the same local depth which again eliminates this reference The equations are T ref t tikit ref 8 tikj27 Sk Pisk Chat Chat Cuz 8 SF T Ck 8 s Ck 6 t t t Ck 2 k 5 Ck 9 8 8 KS 6 4 The reason for calculating potential density anomaly is accuracy since the anomaly p lt lt pi If this were not done three significant digits would be lost The pressure effect with depth is incorporated into the polynomial coefficients as a function of model level k When computing horizontal pressure gradients the potential density anomaly p is inte grated vertically using Equation 11 79 to construct pressure are level k As noted above it is of no consequence that the resulting pressure is an anomaly since horizontal derivatives elim inate pi However the effect of must be taken into account when constructing vertical derivatives This is done by referencing temperature and salinity at both levels t k jn and tik 1 jn 7 to the same pict Normally module denscoef is called from within a model execution to compute density coefficients However script run_denscoef enables option drive dencoef and executes denscoef F in a stand alone mode to produce a listing of the coefficients cp along with Tj s and py 6 2 3 grids F File grids F contains the g
419. opments for use by the entire community The vision is that if this can be done everyone will benefit In support of this effort collaborations with those who share this vision are welcomed The hope is that in time MOM 2 will become a repository for parameteriza tions and the documentation will grow into a storehouse of facts examples explanations and modeling information useful to all researchers In addition to contributions to this manual many people have contributed Fortran code to this effort For developers of future parameterizations old options can be used as prototypes for adding new ones This is particularly made straightforward since UNIX preprocessor ifdefs surround all options which makes easy work of identifying where to put new code Within the model each section of code is identified with an author and e mail address The intent is to identify code authors for the purpose of answering questions and resolving problems if a bug is found Questions or suspected problems should be directed accordingly New param eterizations to be submitted should be thoroughly tested well documented and cleanly coded with adherence to the style in MOM 2 A clearly written documentation explaining the details along with appropriate guidance for usage is also required It is highly recommended that this documentation be in alATpX form Although the design of MOM 2 is intended to allow a wide range of parameterizations to co exist as optio
420. option implicit free surface the ocean volume is allowed to change This allows for a fresh water flux to be used directly This has not been implemented as of this writing The recommendation is to set the salinity flux to zero and add fresh water flux directly to the free surface elevation 102 When option restorst is enabled surface tracers are restored to prescribed data t CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE rains salt must change since ocean volume cannot If the atmosphere model supplies a fresh water flux this should be converted to a salt flux P E R po Sper where P E R represents a precipitation minus evaporation plus runoff rate in cm sec po is taken to be 1 035 gm cm and is a reference salinity in units of grams of salt per gram of water units of parts per part such as 0 035 Depending upon the application of interest may be a constant over the entire model domain or the locally predicted salinity of the uppermost model level If the intent is for a global average P E R flux of zero to imply a zero trend in the ocean salt content then must be chosen as a constant A positive precipitation minus evaporation into the ocean means that fresh water is being added to the ocean which decreases the salinity This implies that the salt flux is negative mapsbc 5 references solar short wave flux in units of langley sec where 1 langley 1 cal cm Normally this effect is included in t
421. or n 1 Refer to Section 15 9 8 for more details about the divergence of shortwave penetration 11 10 7 Tracer operators Finite difference tracer operators as described in Section 5 1 are used for the various terms when solving for 1 1 and parallel those used in the solution of the internal mode velocities These operators are also used in diagnostics throughout MOM 2 They are defined in file fdift and their canonical forms are given by 120 CHAPTER 11 DISCRETE EQUATIONS DIFF 1 tmaskini tmaskiziki cos to dat jrow i DIFF Ty diff fni tmaski y i41 diff f nik ja tmaski y ja 11 59 d cos Ul irow i 4 diff f bik DIFF Tz 11 60 EVE adv fei A ADV Ti EET dat 11 61 ADV Typ Siki adv fnig gi 11 62 V R 3 2cos Ph oudyljrow dvo fb j dv fbi j ADV Tug SORIA 11 63 where the vertical diffusion operator needs no masking because the masking effect has been built into boundary conditions 87 and btf at the top and bottom of the column The finite difference counterpart to Equations 2 3 and 2 4 is given as ET tins ADV Ti ADV T yix ADV Tzix 11 64 Implicit vertical diffusion When option implicitumix is enabled the vertical diffusion operator in Equation 11 60 becomes 7 CIPD Pink DIFF 1 aidif 2 Zik 11 65 where the implicit factor aidif
422. or the world ocean but may be further tightened to give increased accuracy for limited domains The 50 densities are actually determined by dividing the range of specified in situ temperatures into 10 equi spaced temperatures and the range of specified salinities into 5 equi spaced salinities This yields 50 equations and 9 unknown polynomial coefficients at each model level The system of equations is over determined and a best fit for the coefficients in the least squares sense is given by Hanson and Lawson 1969 In MOM 2 the solution is by a Jet Propulsion Laboratory subroutine LSQL2 As a reality check the specified in situ temperature ranges are converted to potential temperature ranges for use within model diagnostics When diagnostic option stability tests is enabled any predicted temperature or salinity outside of these ranges will be flagged Calculating density The polynomial approximation to density at any depth zt is calculated by first removing a reference potential temperature T and reference salinity sr from the model potential temperature and salinity The references are the means of the specified ranges described earlier For the equations refer to Gill 1982 Appendix Three 64 CHAPTER 6 MODULES AND MODULARITY The result is a potential density anomaly pzz which is relative to a reference density pi implied by Tj gr and depth zt Only gradients of density are dynamically important and the horizontal gradient
423. orating local changes into newer versions of MOM 2 This approach has since been discarded in favor of a much better one reliance on the directory structure in MOM 2 and a new utility the graphical difference analyzer gdiff which exists on Silicon Graphics workstations and makes easy painless work out of what was once a difficult time consuming and complicated task Presumably similar software exists from other vendors If not an alternative method outlined below will still work 262 CHAPTER 19 GETTING STARTED only not as easily The gdiff utility has quickly become an indispensable tool for development work at GFDL Standard operating practice First and foremost as a matter of operating practice NEVER change a routine within the MOM 2 directory Copy it first into an UPDATES directory and make changes there A different UPDATES directory should be associated with each experiment Variants of routines within each UPDATES directory can be kept in sub directories e g UPDATES TESTI UPDATES TRIAL2 UPDATES TEST1 QX etc and in this way a hierarchy of changes can be maintained Selecting which sub directories to copy and in which order will allow any combination of updates to be combined and this should be done in the run script Before starting move the whole existing 2 directory structure to MOM 2 OLD using mv MOM_2 MOM_2_0LD Then install the newer MOM_2 directory by uncompressing and extracting the tar file after re
424. orcing e frcmz maximum mixing in cm sec e diff cbt back background diffusion coefficient in cm sec e visc cbu back background viscosity coefficient in cm sec e diff cbt limit limiting diffusion coefficient in cm sec This is to be used in regions of negative Richardson number e visc cbu limit limiting viscosity coefficient in cm sec This is to be used in regions of negative Richardson number 5 4 11 Smagorinsky mixing Namelist smagnl These variables are for use with option smagnimiz e diff c back background diffusion coefficient which is added to predicted diffusion coef ficient in cm sec 5 4 12 Bryan Lewis mixing Namelist blmiz These variables are for use with option bryan lewis vertical and bryan lewis horizontal e Ahv vertical diffusion coefficient for tracers as a function of depth in cm sec e Ahh horizontal diffusion coefficient for tracers as a function of depth in 5 4 13 Held Larichev mixing Namelist himiza These variables are for use with option held_larichev e hl depth integration depth in cm e hlback background diffusion coefficient in cm sec e hl maximum allowable diffusion coefficient in cm sec Chapter 6 Modules and Modularity Modularity has various meanings depending upon who is consulted For purposes of MOM 2 modules and modularity are key organizational tools used to minimize inter connectivity be tween various model co
425. ory which in many cases forced models into categories which allowed fewer job submissions and therefore fewer results Additionally researchers felt no incentive to multitask because their accounts were being charged by cp time rather than wall clock time Actually there was one class of job which would have benefited from multitasking the high resolution model because results were typically not back by morning Ironically these jobs could not be multitasked because their memory requirement exceeded what was available on the system How to do it For coarse grained parallelism option coarse grained parallelism must be enabled When en abled the memory window size is automatically set to the minimum size appropriate for enabled options On shared memory systems e g CRAY T90 the intent is to use this option with option crayio or fio which keeps all latitude rows on disk preferably solid state disk Use of option ramdrive is also possible but only as a stepping stone to allow simulations of distributed systems on shared systems The number of processors num processors is specified through namelist where it picks up the value of the environment variable NCPUS from the run script When using op tion coarse grained parallelism and ramdrive to simulate distributed systems the setting of num processors is changed to equal the value of parameter nprocessors which is required for dimensioning pur poses on distributed systems Note that num p
426. ory window and whether one a few or all latitude rows are being solved at once The details are given in Chapter 1 The memory window also allows flexibility in parallelization by multitasking as described in Section 3 5 When executing on multiple processors MOM 2 can make use of fine grained parallelism autotasking or the coarse grained parallelism microtasking Each method has its advantages and disadvantages Fine grained parallelism makes efficient use of available memory and offers a robust coding environment which is easy to use thereby keeping the researchers efforts focused on science as opposed to debugging It suffers from relatively low parallel efficiency which limits its use to multitasking with a small number of processors However the highest parallel efficiency may not be important when multitasking on systems j index has The efficiency is limited by how smart the parallelizing compiler is 0 1 INTRODUCTION with tens of processors and when the number of jobs in the system exceeds the number of processors Higher parallel efficiency which is necessary when executing in a dedicated system can be achieved through coarse grained parallelism The down side is that this approach uses significantly more memory than fine grained parallelism and is more prone to introducing errors The researcher who is intent on developing new parameterizations may find the tendency for the focus to shift from science to d
427. osity coefficients on the north face of U cells As 15 67 At i c D 15 68 15 15 HORIZONTAL SUB GRID SCALE MIXING SCHEMES 177 where the the brackets are only intended to isolate the subscripts The effective anisentropic wavenumbers for diffusing turbulence and total deformation are given by c 0 14 15 69 U 2 c cos Q5 dazu Qon E68 15 70 4 ce e dytijrow 15 71 ID 4fAX strain 4 strain p o 15 72 Rosati personal communication indicates that a value of c 0 14 leads to under diffused solutions and he has used c 0 28 When applied to the ocean it is unknown how well this number c is known or even to what extent it may be a function of resolution In terms of the above equations the viscous terms given by Equations 2 8 and 2 9 are formulated in discrete form as 1 FY d Ajy 4 straini kj cos aw ik ji 1 strainig a cos OF owt 15 73 cos 1 amp straini gga cos COS radius straini ji 15 74 The second term in Equation 15 73 is not in flux form To put it in flux form leads to more calculation than handling it as a metric term and so it is computed as one For diagnostic purposes the viscosity coefficients on the northern and eastern face of U cells can be estimated as VISCCNUL kj A 15 75 2 8 3
428. otmb control variable for writing output from option meridional tracer budget iotrmb control variable for writing output from option term balances ioglen control variable for writing output from option energy analysis iovmsf control variable for writing output from option meridional overturning iogyre control variable for writing output from option gyre components ioprzz control variable for writing output from option matriz sections toext control variable for writing output from option show external mode iodsp control variable for writing output from option diagnostic surf height 10151 control variable for writing output from option time step monitor iozmbc control variable for writing output from option show zonal mean of sbc totraj control variable for writing output from option trajectories toxbt control variable for writing output from option zbts 5 4 9 Isopycnal diffusion Namelist isopyc These variables are for use with option isopycmiz ahisop isopycnal diffusion coefficient in cm sec athkdf isopycnal thickness diffusion coefficient in cm sec This is only used with option gent_mcwilliams slmz maximum slope of isopycnals 60 CHAPTER 5 VARIABLES 5 4 10 Pacanowski Philander mixing Namelist ppmia These variables are for use with option ppvmi r wndmir min value for mixing at surface to simulate high frequency wind mixing in cm if absent in f
429. out of the and 7 summations Equation 17 9 reduces to U 1 1 jrow Tj 3 3 Hoe imo j o eddy ty j i jrowtj AYU dxujsj Cos i 1 j 1 etna H iil jrow j 7 dau Ln COS dYUjrow4j U Az Am 2 cddau 0 16 25 since the sum of the partial derivative coefficients cddzu and cddyu are zero Similarly at land points the contributions to the island equation from the implicit Coriolis terms is also zero because Equation 17 10 reduces to 16 1 STREAM FUNCTION 205 0 0 j 1 1 f ui 5 jn qI Atom 5 cddz uj i j 1 iih row j i 0 7 0 0 0 f 1 1 5 cddaxtjn jn Adm 5 cddyuj j i 1j 1 iti row 3 i 0 j 0 16 26 Because of these simplifications the island equation for land mass m may be calculated by summing Equations 16 13 only over the ocean perimeter T cells of land mass m In fact in the Fortran code of MOM 2 the full island equation never appears Instead each set of contributions to the island equation from an island perimeter cell T is stored in coeff The sum over the island perimeter is done in the elliptic solver 16 1 5 Symmetry in the stream function equation Conjugate gradient solvers work by transforming the system of equations Ax b into minimizing the quadratic form 1 Q x gx Ax b x Thi
430. p k zP i Lip k There are now a total of eight terms It is possible to combine the pairs appearing with the same summation into a total of four terms each with a double summation These four terms are cos dyt 2 59000 y 5 da uj Lip Y Aa HEP x 1 kr 1 kckr kckr Ti k t k kr ik kr 6 0557 6 pf Jahr yp 6 pf 1 dyt 2 5 da uj Lip Y Ag kthr 1 krli k x 1 kr 0 kckr kckr L ET E ik kr tk kr ik kr 6 0557 6 pf Jahr yp 0 90 5 dzWi i Y Ag tim k i ip k kr x kr 1 1 0 Tia 6 Titip eke Soper i ip Hp VEU spia Dy spp Y Oo as 0 dz kr 5 Aa tir k i ip k 4 kr x kr 1 1 yr 221 iJ ip tip VU qu pnm ya In the first term of equation B 221 let the kr sum run from 0 to 1 and adjust the labels appropriately to get the first and second terms into the form 2 9 Agk l hr i 1 1 Depli CP x 1 kr 0 t k 1 kr t k 1I kr T k r etri 1 DEAS 1 kr we qs T 0 mee dyt dewp Y o0 AnH cip Ke rli Oop REED 1 kr 0 6 T ik kr 6 T uio ki
431. part removes three significant digits of accuracy from the resulting density Since only gradients of density are dynamically important the constant is of no physical importance Also the values of T and sr refer to Section 6 2 2 are typically subtracted from temperature and salinity throughout the code so are set to zero 15 12 2 linearized_advection It is sometimes useful to linearize about a state of no motion as in Philander and Pacanowski 1980 The state of no motion is given by t tz 15 33 p p t 15 34 where is temperature and the density p is linearized as in option linearized_density If the advective velocities are thought of as being composed of a mean and deviation then linearizing about this state eliminates the advective terms in the momentum equations In the temperature equation only the advective term w 1 remains where f is an initial equatorial stratification given by Equation 15 1 Note that this stratification is the initial condition Options levi tus_ic and idealized_ic are therefore incompatible and must not be enabled with option lin earized_advection It is not necessary to enable option equatorialthermocline for linearized advection 15 13 Explicit Convection Convection in MOM 2 can happend in one of two ways either implicitly by enabling option im plicitumiz and using huge vertical mixing coefficients between ocean cells that are gravitationally unstable or explicitly by not enabling option imp
432. pen boundary conditions reside at the second row column in the domain The first row is only a dummy which is not real Topography is set automatically by subroutine topog similar to the open boundary conditions row If the researcher does not want the drastic preparation of setting the next three rows identically the corresponding lines in topog must be commented out and it is up to the researcher to insure that the bottom topography is not sloping upward within the next two rows away from the boundary The virtually row is set in any case Choose restoring time scale USER INPUT in obc F and create tracer values at the open boundaries either from Levitus or FERRET written data Choose values at the open boundaries in obcpsi F or read FERRET written data to create 1 values If values at the open boundaries indicate a net transport through the domain land masses have to be set to a non zero value In the following example open western and eastern boundaries are chosen transporting 130 Sv psimaz through the domain psiwall west and psiwall east rise from zero at the northern end to 130 Sv at the south ern end jpsimaz To guide the current through the domain all southern land masses must set to 130 Sv which can be done at the end of tropic2 obc inc do jrow 1 jpsimax do i 1 imt if map i jrow ne 0 then 13 6 TO DO LIST HOW TO SET UP OPEN BOUNDARIES 149 psi i jrow 1 130 e12 psi i jrow 2 130 e12 endif
433. perator through its functional derivative the functional S can be seen to be proportional to the tracer variance To see this connection consider the tendency for the squared tracer 1 391 V TF VT F B 10 mT K aT 2L B 11 278 APPENDIX B ISOPYCNAL DIFFUSION Integrating the squared tracer equation over a source free domain yields an expression for the time tendency of the tracer variance a f a T 48 lt 0 B 12 Hence 4S is the sink of tracer variance arising from the effects of downgradient diffusion It is this reduction of tracer variance which is a fundamental property of dissipative tracer mixing i e of diffusion The discrete analog to this result says that by ensuring that the discretization of the functional S is negative semi definite the corresponding tracer variance will be reduced in source free regions of the lattice By then taking the functional derivative of the discrete functional S it is ensured that the discrete diffusion operator R T has the desired dissipative properties This result provides the motivation for the formalism B 1 3 The functional for isopycnal diffusion The diffusion tensor representing along and across isopycnal mixing is given in the projection operator form as km A 6r _ p p App p Ar Ap 6 Aps B 13 with 6 the Kronecker delta and Vp Vp the unit vector normal to the isopycnal The along or adiabatic and across o
434. point B 3 GENERAL COMMENTS 311 Ti k 1 Ti 1 k Ti 1 k Ti k Ti k 1 Ti 1 k 1 Figure B 4 Stencil in the x z plane for the isopycnal x flux The x ed points represent reference points used for computing the neutral directions 312 APPENDIX B ISOPYCNAL DIFFUSION Appendix C A note about computational modes Fundamental to the discretization of MOM is the discretization of fluxes advective fluxes diffusive fluxes etc Working with fluxes provides for a useful way to preserve the internal consistency of the transport of momentum and tracers which means for example that we should have no false sources or sinks assuming we have a sound numerical scheme Since we are fundamentally interested in the divergence of fluxes the fluxes must be defined on the boundaries of the relevant grid cell diffusive fluxes at the boundary of the T cell and advective fluxes at the boundary of the U cell To achieve this placement of fluxes often requires some creative discretization in the form of averaging operations see Section 11 2 1 for more details of finite difference operators When introducing average operators however it is important to be aware of the potential to introduce computational modes computational mode is basically a configuration of the discretized field which is invisible to the object which is being discretized With nearest neighbor discretization on the respective T and U grid which is done in MOM for second order accurat
435. pplies averages over a product or ratio of fields rather than individually as done in the original scheme The new procedure provides for a scheme that has no computational modes Indeed this discretization might be an inspired guess by one motivated by the desire to eliminate computational modes It is unclear how one could be inspired to guess the details of the grid weights and the reference points Appendix B contributed by Stephen M Griffies smgQ g f dl gov Last revised October 31 1996 308 APPENDIX B ISOPYCNAL DIFFUSION dxui 1 dxui E 7 1 WR Ti 1 ui 1 Ti ui Ti 1 dxti Figure B 1 One dimensional grid with subcells 7 1 2 5 corresponding to the x axis cells in the x y plane shown in the next figure B 3 GENERAL COMMENTS 309 Ti 1 j 1 Ti j 1 Ti 1 j 1 Ti 1 ij Ti 1 j yt j yu j 1 Sh en Xe Ne hy put dte Te Ti 1 j 1 Ti j 1 Ti 1 j 1 dxu i 1 dxu i SJ S R E dxt i Figure B 2 MOM2 x y plane and its partitioning into 12 quarter cells The generally noncon stant grid spacing is indicated which implies an offset T point 310 APPENDIX B ISOPYCNAL DIFFUSION Ti 1 k 1 Ti k 1 Ti 1 k 1 zw k 1 Ti 1 k zt k zw k Ti 1 k 1 Ti k 1 Ti 1 k 1 ixu i 1 xu dxt i Figure B 3 MOM2 z x plane and its partitioning into 12 quarter cells The generally noncon stant grid spacing is indicated which implies an offset T
436. pproach can be expected to increase However it is difficult to imagine that efficiencies will approach the coarse grained parallelism approach To illustrate the problem of too little work consider a memory window of size jmw 5 Calculations would normally be thought of as involving a latitude loop index ranging from j jsmw jemw where jsmw 2 and jemw 4 and so the appropriate number of processors would be m 3 However the latitude loop index for calculating meridional fluxes would range from j jsmw 1 jemw because meridional fluxes are needed on the northern and southern faces of all cells on latitude rows 2 through 4 This means that all processors will first busy themselves by calculating meridional fluxes for the northern faces of cells on rows 1 through 3 When done one processor calculates the flux for the northern face of cells on row 4 and the other two processors stand idle because they do not advance to the next triplet until all are synchronized at the bottom of the loop Since all parallel loops do not have the same range of indices there must necessarily be idle processors regardless of the amount of work inside the loops 1 Or equivalently the number of times the memory window is moved northward to solve for all latitudes 3 5 PARALLELIZATION 29 a T 1 Disk T Disk Rows in Memory b T I Disk T Disk Rows in Memory E a RP Figure 3 2 a Loading the memory from disk b up
437. pproach used on the CRAY T90 is being extended for distributed architectures with particular focus on the CRAY T3E as discussed in Section 3 5 3 Delivery of the CRAY T3E at GFDL is not expected until early next year and parallelization efforts can not be completed until after the CRAY T3E arrives Anticipation is that one version of MOM 2 will execute efficiently at GFDL on both the CRAY T90 and CRAY T3E with machine specific code being kept to a minimum Also a nonlocal K profile param eterization KPP of Large et al 1994 is being added Rosati and a version of Killworth s explicit free surface method Schmidt An additional feature under serious consideration for inclusion in MOM 2 at GFDL is a partial step method which will allow the bottom levels to have variable thickness as in Adcroft et al 1996 World Wide Web access Because of its size only the introduction and table of contents of this manual are available on the World Wide Web htpp www gfdl gov The manual in its entirety may be obtained by anonymous ftp from GFDL using ftp ftp gfdl gov use ftp as your login name and your e mail address as the password cd pub GFDL MOM2 Change to the pub GFDL_MOM2 directory get manual2 2 ps Z Copy the manual to your directory quit disconnect from the ftp uncompress manual2 2 ps Z Expand to manual2 2 ps File manual2 2 ps Z is about 1MB and the uncompressed postscript version manual2 2 ps is a about 3MB The printed manual is about
438. ps within the group of latitudes are finished Then the next group of latitudes is solved in a similar manner until all rows are solved Using ATExpert on GFDL s CRAY C90 with fortran 77 MOM 2 with 1 horizontal resolu tion and 15 vertical levels TEST CASE 0 was estimated to have 80 parallel efficiency This means that on an 8 processor system only about 3 processors will be saturated Equivalently about 3 such jobs would be required to saturate the system On a 32 processor system about 4 4 processors would be occupied which implies about 8 such jobs are needed to saturate the system This is clearly not desirable in a dedicated environment or one with hundreds of pro cessors However it may be tolerable in a multiprogramming environment where the number of jobs significantly exceeds the number of processors The important consideration is that the job mix should not dry up to the point of leaving fewer jobs than processors In general the fine grained approach has lower parallel efficiency than the coarse grained approach The reason is basically due to not enough work within the many parallel regions and the fact that the range on the parallel loop index is not the same for all loops Increasing the model resolution can somewhat address the first problem but not the second The result is that processors occasionally stand idle As compilers get smarter and are better able to fuse parallel regions the efficiency of the fine grained a
439. pt run mom must be changed to cf77 with appropriate options contained in file checks F 153 154 CHAPTER 15 GENERAL MODEL OPTIONS 15 1 3 cray t90 This option configures MOM 2 for the CRAY T90 which is the current computational workhorse at GFDL The operating system is Unicos 9 1 0 1 which does not have a cf77 compiler Therefore all scripts which execute on this platform use the Fortran 90 compiler f90 15 1 4 sgi This option configures MOM 2 for Silicon graphics workstations at GFDL This should work on any system whose Fortran open statement conforms to Fortran 77 and whose extensions are in compliance with Fortran 90 15 1 5 distributed memory This option is to be used in conjunction with options ramdrive and coarse grained parallelism to configure MOM 2 for distributed systems This is an experimental option which has not yet been completed It will most likely be changing until the Cray T3E is installed at GFDL Refer to Section 3 5 3 for further details 15 2 Compilers Run scripts which are typically executed on SGI workstations use a 77 command Run scripts which typically execute on the CRAY T90 at GFDL use a f90 command On other platforms the appropriate compiler command should be used 15 2 1 90 When compiling under a Fortran 90 the option f90 must be enabled to handle differences between Fortran 77 and Fortran 90 This option only affects the I O manager and should not be en
440. r contracts the tracer equation into a one dimensional equation in latitude by averaging over longitude and depth cells Using operators described in Section 11 10 7 this yields 18 2 LIST OF DIAGNOSTIC OPTIONS 229 imi l km vu 5 NN i kjrow T dk Jn 7 ADV Ttiki ADV ADV P2345 jrow 1 2 k 1 DIFF Tt DIFF Tyix DIFF Tiki source x 18 52 where n is the tracer and the relation between j and jrow is as described in Section 5 2 The volume element and total volume as a function of latitude are given by AT tmask jrow dat cos row dzty 18 53 k jrow km imt 1 ow 3A i row 18 54 k 1 i 2 The quantity tmask k jrow 15 1 for ocean cells and 0 for land cells Applying boundary conditions in depth and longitude to Equation 18 52 yields lt 6 7 ik jn gt lt ADV TY k kj gt Ave lt Sti in gt lt DIFF 2 T lt source gt A 18 55 where lt gt indicates an average over all and z Each term in Equation 18 55 is then aver aged in time to produce stable estimates which can indicate the dominant meridional balances as a function of time The meridional tracer equation becomes L 1 GU jnr gt lt ADV Dying 2 lt stfi jn gt lt DIFF gt 1 source gt 18 56 where is the time step counter and L is the number of time steps in the averaging perio
441. r diabatic diffusion coefficients Ay and Ap are non negative and can in general be functions of space time When acting on a vector the adiabatic piece of the diffusion tensor projects the vector onto the local isopycnal direction and the diabatic piece projects the vector into the diabatic direction Given this diffusion tensor the functional for isopycnal diffusion is written VT 1 S 5 dz z f ee As DWP 1 Ap VT B 14 or more explicitly Tzpy Type Trp Pz pi 1 Ap T2 2 T2 15 1 s 5 d Ar The small slope approximation amounts to taking the limit of p py lt lt p and dropping terms of order slope Ap Ar with slope the small isopycnal slope The resulting functional 1 2 Trpz 1 gsmall faz AL CE ISP 5 ae Ap T B 16 is B 1 4 Continuum diffusive fluxes For comparison with the results in the discrete case it is useful to obtain the continuum diffusion operator using the relation gt L R T VT F B 17 B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 219 With the quadratic form defined in equation B 15 the diffusive fluxes are given by e IH Ar Tate eT EP apr B 18 L 2 1 z y po Ar apr B 19 y r A Ay Tee CS Pi TP Apr B 20 The first t
442. r the elements of the first term to the west side of the T cell 7 k j take an average over z of the z derivative squared in the denominator This prescription will also bring the second term to the east side which allows for a zonal difference operator across the T cell to be identified This averaging in the denominator does not disturb any of the numerical or B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 299 physical properties of the scheme and it allows for an unambiguous placement of these terms without introducing computational modes With this prescription these two terms become Afdxt dzty i 1 ip j 4 5 Y dy j4 jq COS F ig Y by Pi l ip jtiq X jq 1 ip 0 i 1 ip j i 1 ip j eli 1j6yPi 1 ip jtig Pi 1 7 by Ti 1 ip jd 3d 2 1 i 1 ip j 1 2p k j 6 1 _ dip dq 5 coi 6 2 1 ip k 1 6 It is convenient to shift the jg sum and to introduce the volume of the T cell Vr d tidyt cos o dat which yields AGVr I Tikj i 1 p j T Y 1 COS oj 1 9 Y 1 ip j 1 jq X Adyt cos 1 jq 0 0 i 1 ip j 2 1 ip 7 eli 1 76 0 1 1 7 1 79 20 by 2 1 2 7 2 i 1 p J i CURE 62 1 3 6pi 1 ip j 1 4 T5 oa zi 1 ip k 1 0 Now let jq run from 0 to 1 in the third term of equation B 207 and shift 7 accordingly to bring the third and fourth terms to 421 1 1
443. r which assigns mskhri jrowto a region number within a rectangular region Regions may be built up from calls to sethr but in general need not be simply rectangular In a similar fashion the vertical region mask number mskur where k is in vertical region for 1 nvreg and nvreg is the number of vertical regions Unlike mskhr j o which may contain a region which is multiply connected the k indices within a vertical region must be contiguous Regional volumes are constructed in subroutine setocn by the union of mskhr jrowand mskvrysuch that the regional volume numbers are given by nreg nhreg 1 mskhri jrow 18 1 18 2 List of diagnostic options 18 2 1 cross flow netcdf How much of the flow is along isopycnal surfaces and how much cuts across isopycnal surfaces Option cross flow netcdf computes the projection of a flow field into an along isopycnal compo nent and a cross isopycnal diapycnal component Let the unit vector normal to the isopycnal surface at cell T k jrowbe given by gt Sik iki vgl 18 2 Sik sl where 0 Sisi caso Picus Os pukj i 9 Piki 2 18 3 jrow and is the local in situ density which is used to approximate the isopycnal surface at time level and 7 and 2 are local unit vectors in longitude latitude and depth Note that both 18 2 LIST OF DIAGNOSTIC OPTIONS 223 in situ and potential density fields are saved when diagnostic opti
444. raphy 25 463 474 Gough W A and W J Welch 1994 Parameter space exploration of an ocean general circulation model using isopycnal mixing parameterization Journal of Marine Research 52 773 796 Gough W A and C A Lin 1995 Isopycnal mixing and the Veronis effect in an ocean general circulation model Journal of Marine Research 53 189 199 Hirst A C and T McDougall 1996 Deep water properties and surface buoyancy flux as simulated by a z coordinate model including eddy flux advection Journal of Physical Oceanography 26 1320 1343 Holland W R 1989 Experiences with various parameterizations of sub grid scale dissipation and diffusion in numerical models of ocean circulation In Parameterization of Small Scale Processes Proceedings of the Fourth Aha Huliko a Hawaiian Winter Workshop edited by P M ller and G Holloway University of Hawaii at Manoa 1 9 Hirst A C and W Cai 1994 Sensitivity of a World Ocean GCM to changes in subsurface mixing parameterization Journal of Physical Oceanography 24 1256 1279 Jerlov 1968 Optical oceanography Elsevier Larichev V D and I M Held 1995 Eddy amplitudes and fluxes in a homogeneous model of fully developed baroclinic instability Journal of Physical Oceanography in press Marotzke J 1987 Influence of convective adjustment on the stability of the thermohaline circulation Journal of Physical Oceanography 21 903 907 Marotzke J and J W
445. rations chiefly the desire to reference data sections along constant circles of latitude and the ease and speed of performing zonal integrals The reason that slices are dimensioned as Array imt km instead of as km imt is largely historical and based on speed issues the inner dimension is the vector dimension and longer vectors execute faster than shorter ones on vector computers Essentially these ideas led to dimensioning of arrays as Array imt km slices along constant circles of latitude Looking toward the future indications are that size of cache fast memory will have sig nificant impact on speed Smaller sized arrays are more likely to fit within available cache than larger sized arrays resulting in speed improvements In fact when multitasking fitting arrays into available cache is the reason for observed super linear speed ups as the number of processors are increased 3 2 Dataflow between Disk and Memory The idea of slicing volumes of data along lines of constant latitude was outlined in Section 3 1 Refer to Figure 3 2 and note that there are two disks one for holding latitude rows Sectioning arrays this way severely limits the size of high resolution designs It also leads to fewer jobs in the job mix with correspondingly lower total throughput Vector startup time can be significant for short vectors In general two dimensional variables will not collapse to one long vector on the CRAY YMP because operation
446. rator dz 2 36 02 Oc 2 36 Denote deviations from the vertical average by The horizontal velocity components are split into the two terms u v 9 7 0 0 2 37 The external mode s kinetic energy is given by p 2 u u v v note that p 2 d The budget for is derived by taking the scalar product of p with the depth averaged momentum equations 2 18 and 2 19 an operation which yields o u Vu D po 1075 a po tan d T wv v S Et Uz 2 38 n T gil gt ET S az The surface and bottom boundary conditions 2 29 and 2 30 bring this expression to the form S 00 T p 2 39 gil gt Next consider the volume average lt gt as defined in the previous section This averaging defines the volume averaged external mode kinetic energy a f d sin d H a f d sin d H 2 40 Taking this volume average on equation 2 39 yields E po lt u Vutvu Vot twu ap V sino d d H 32 p cd Fo el wo gt lt Vp gt y asin d H T Tuina V7 asin 6 d H T 241 These terms represent respectively the work done per unit volume on the external mode from certain nonlinear terms Ne lt T Vu T U wu 000 gt 2 42 pre
447. re obtained 6 2 9 tmngr F File tmngr F contains the time manager module It can be exercised in stand alone mode by script run tmngr which enables option test Based on settings outlined in the driver clock and calendar are defined and used to decide when specific events will take place To illustrate this the driver sets a time step and specifies intervals for certain events It then integrates time forward one time step at a time and indicates when the requested events take place In MOM 2 time is integrated in units of density time steps dtts The input to the time manager is this density time step in seconds which is supplied as the sole explicit argument The internal representation of time is kept as two integers one for the number of whole days since December 31 1899 at the start of the day at 00 00 00 and the other for the number of milliseconds within the last day The benefit of doing it this way is no roundoff At first this may not seem important but if not attended to this will result in events happening unexpectedly Time as tracked by the time manager is accurate to within one millisecond Date and time defined at the center of the data record For instance if the record was January 31 days long the centered time would be at day 15 5 which is the center 10 This time is accounted for in the timer routines The calendar may be realistic Julian or Gregorian or idealized 68 CHAPTER 6 MODULES AND MOD
448. rent eddies Journal of Physical Oceanog raphy 9 311 326 Cox M D 1987 An eddy resolving numerical model of the ventilated thermocline Journal of Physical Oceanography 15 1312 1324 Cox M D 1987 An eddy resolving numerical model of the ventilated thermocline time dependence Journal of Physical Oceanography 17 1044 1056 Orlanski I 1976 A simple boundary condition for unbounded hyperbolic flows J Comp Phys 21 251 269 Orlanski I and M D Cox 1973 Baroclinic instability in ocean currents Geophysical Fluid Dynamics 4 297 332 Semtner Jr A J and R M Chervin 1988 A simulation of the Global Ocean circulation with resolved eddies Journal of Geophysical Research 93 15502 15522 324 APPENDIX D REFERENCES Treguier A M 1992 Kinetic energy analysis of an eddy resolving primitive equation model of the North Atlantic Journal of Geophysical Research 97 687 701 D 0 12 General Numerical Oceanography Non eddy resolving Bryan K 1962 A numerical investigation of a nonlinear model of a wind driven ocean Journal of Atmospheric Sciences 20 594 606 Cox M D and K Bryan 1984 numerical model of the ventilated thermocline Journal of Physical Oceanography 14 674 687 Gerdes R 1993 A primitive equation ocean circulation model using a general vertical co ordinate transformation 2 Application to an overflow problem Journal of Geophysical Research 98 14703 14726 H
449. required when using option ramdrive and ymw 3 Instead of copying data indices could be used to point to the proper location within the memory window The down side is that equations become unreadable when mod functions are used to construct indices like j 1 In addition if the value of these mod functions is stored in subscripted variables extra computation is incurred for indirect addressing in addition to degrading readability even more Assigning their value to un subscripted variables represents a loss of generality when trying to implement higher order schemes On the CRAY YMP the copy operation is very efficient 22 CHAPTER 3 DATAFLOW It was decided to follow the coarse grained approach pioneered by Bert Semtner on CRAY XMPs in the 1980 s After substantial effort a multitasking option was installed in MOM 1 Surprisingly it turned out that no one at GFDL used it Looking back the reason was clear The benefit from multitasking is reduced wall clock time which meant faster model turn around which sounded like a good thing However when a researcher submitted a production model at the end of the day that researcher didn t care if it sat on the computer for 4 wall clock hours or 8 wall clock hours What the researcher did care about was that the results were back in the morning and that the model execution time was a minimum Instead it was noticed that model execution time measured by cp time increased and the model required more mem
450. ress Dept Theoretical Oceanography Institut f r Meereskunde D sternbrooker Weg 20 24105 Kiel Germany Check the mailing list for e mail address 141 142 CHAPTER 13 STEVENS OPEN BOUNDARY CONDITIONS conditions have been tested in simple cases attention must be given to details to insure that specific configurations are working properly For more details the reader is referred to Stevens 1990 and a TO DO list given at the end of this chapter 13 1 Boundary specifications Geographically open boundaries are defined at latitude rows jrow 2 and jrow jmt 1 or at longitudes given by i 2 and i imt 1 This is in contrast to Stevens 1990 where the open boundaries reside directly at the sides of the domain The advantage of this definition made here is that memory management diagnostics and the external mode Poisson solver remain unchanged During outflow conditions new tracer values are calculated on the boundaries using OT Vad ter OT _ T wt a d 13 1 where T represents the tracer vag meridional velocity cr phase speed of tracer a radius of the Earth and latitude During inflow conditions nothing is done unless the open boundary is active If active tracer values at the boundary are set using a Newtonian restoring condition on a time scale defined by the researcher The baroclinic velocity components at jrow 2 and jrow jmt 2 are calculated by a linearized momentum equ
451. rface boundary conditions This is the counterpart of gasbc All of the surface boundary conditions are two dimensional fields as described in Section 10 1 1 In the atmosphere all quantities which are to be used as surface boundary conditions for MOM 2 are defined on the Ay p grid in array sbcatmij where subscript m again refers to the ordering described in Section 10 3 Typically they are quantities like windstress components heatflux and precipitation minus evaporation These must be accumulated in sbcatm within the atmosphere model and averaged at the end of each time segment Basically what needs to be done in gosbcis to interpolate the time averaged sbcatmjg jim to sbcocn jrow m Which is defined on the ocean grid Interpolations to ocean grid Unlike in Section 10 1 1 there are no complications since the ocean domain is assumed to be contained within the atmosphere domain as shown in Figure 10 4 Each surface boundary condition is interpolated one at a time with the essential steps being e Set cyclic conditions of sbeatm This assumes a global atmosphere domain e Extrapolate sbcatm m into land areas on the atmosphere grid This is done as in Section 10 1 1 by solving V 0 over land areas using values of j over non land areas as boundaries where j represents windstress components heatflux etc The idea as on the ocean grid is to get reasonable adjacent to coastlines while not trying to produce ac
452. rface boundary conditions and provide a means of checking that MOM 2 is behaving as intended The following is a brief tour of file printout 0 gfdl File EXP TEST_CASE printout 0 gfdl begins by listing various surface boundary condition names and units followed by the version number of MOM 2 and the values of namelist variables If any variable was not included in the run mom script namelist section then it retains its initialized value Otherwise the new value is given Immediately below there is the file sizes in megawords needed for two dimensional fields kflds and the three dimensional fields latdisk1 and latdisk2 where the latitude rows reside If option ramdisk is enabled these files are actually stored in memory but behave as if stored on disk Next there is output from the grids module detailing everything relevant to grid cells All this is summarized by a checksum which is essentially a sum over all grid cell information Fol lowing this is a summary of temperature and salinity ranges used to compute density coefficients and a checksum of the coefficients Afterwards output from the topography module topog sup plies information about the kmt jrow field Changes to the kmt jrow field are best done in a stand alone mode using script run topog Checking for violations is done iteratively so this sec tion rambles on for awhile If everything is as it should be then some basic statistics relating to geometry and topography are given wit
453. rid points within T cells as in MOM 1 Also details of the Fortran coding may change in an attempt to reduce memory requirements and increase computational speed Zonal Flux The isopycnal component of the diffusive flux through the eastern face of a cell diff fet m for the full Redi tensor is given by 1 diff fete 4dyt cos oF x 14 jg C08 05 14 49 X AT X OMNE ME MN Uy CORN tja 5520 ux x dk kr xat UE k ji ip k 1 kr j x LM j 2 E BY coa ePi This discretization should be compared to the continuum version in equation B 18 The convergence of the discrete form in the continuum limit is manifest It is not possible to identify the off diagonal components of the Redi tensor independently of the tracers However it is possible to identify the non negative diagonal component K1 1 1 1 zlil _ 7 Kiki 22 0 10 008 aug AT 4401 cos 220 m i ip k J 2 1 1 1 1 1 1 k P p t opt 2 bia 5 0 1 LL 1 dz x dzWwg kr Y J i k ji ip k 14 kr 3 0 t ip k J 2 141 3 i ip k i ip k i ip k j k ya t5 2 jg oa ip SD Lig RAD iy which brings the x flux to the form ki Wik be 1 1 X dyu cos bY 6 T x T JU 1 ja j 14jq I itip k j 1tiq Adyt
454. rids module Script run_grids uses option drive_grids to execute the module in a stand alone mode which is the recommended way to design a domain and grid resolution for MOM 2 The grid is specified in the USER INPUT section of file grids F When option drive grids is not enabled module grids is used by the model to install the specified grid information Refer to Chapter 7 for a description of how to construct a grid 6 2 4 iomngr F This is one of those places where the old code was overly complex with too many options but questionable gain There is a newer shorter simpler and easier to use version of the I O manager tucked in at the top of file iomngr F This newer I O manager works on SGI and CRAY platforms at GFDL It can be tested by setting the appropriate computer PLATFORM variable in script run_iomngr_new and executing For non CRAY platforms use PLATFORM option sgi If executing on a Fortran 90 compiler change the compile statement and add option f90 To access the newer I O manager in other run scripts just add option new iomngr The purpose of the I O manager is two fold first to find unit numbers which are not already attached to other files and second to account for differences in the Fortran open statement depending on computer platform Fortran 77 and Fortran 90 The older I O manager will eventually become extinct and be replaced by the newer one However for now the older one is still the default To get the ne
455. riod timavgper may be set less than timavgint for shorter averages but the output is still every timavgint days The only restriction is that timavgint divided into the integration time for each job should work out to be an in tegral number because this diagnostic is an average over time If not then timavgint is reset internally to insure this condition refinit Boolean used to specify that the time and date to be used for calculating diagnostic switches is the time and date of the initial conditions For example if term balances are desired every 20 days trmbint 20 0 then they will be calculated and written out every 20 days starting from initial condition time refuser Boolean used to specify that the time and date to be used for calculating diagnostic switches is a user specified time and date given by ryear rmonth rday rhour rmin rsec described above for comparing diagnostics from various experiments with dif ferent initial condition times refuser true is appropriate Note that setting refuser true and choosing the reference time to be the initial condition time is the same as specifying refinit true Note that one of these reference time Booleans must be set true and the other two set false 5 4 NAMELIST VARIABLES 53 e eqyear Boolean which forces all years to have the same number of days no leap years If false then a Julian calendar is used e egmon Boolean which forces all months to have the
456. rivative of these z x plane gradients is given by aVT 13 i BENE B 81 OT j cos fdzu dyu dzwy i d 3 k B 82 OT cos 7 deu dyu dzwy 4 aVT 15 i BEEN B 83 OT cos oF dui dyu B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 285 E wg du dn B 84 A Ug B 85 DS ugs b 86 a eld B 87 a PETER B 88 ee E 89 Z a B 92 y z plane For the y z plane suppressing the i index the tracer gradient in the 12 boxes is given by VT 25 aTr jy jae k6 Tua B 93 VT 26 i6 T i j6 T B 94 27 67 j6 Tj iac 6 1 B 95 VT 28 sT j T beT x B 96 VT 29 i T ia 6 7 6 B 97 VT 30 6 Ty 41 4 6 7 k6 TS B 98 VT 31 i6 T ia 6 71 bb Tj aea B 99 VT 32 Tjik 6 71 6 T 4 B 100 VT 33 i6 T i 6 6 101 VT 34 16 7 EET B 102 VT 35 16 7 j yTj aga T x B 103 VT 36 6 7 Joy i pga EET k B 104 The functional derivative of these y z plane gradients is given by AVT 25 i j k a cos 9T dru UM dzwr_ 1 B 105 26 k OT i cos oF dau dyu 286 APPENDIX B ISOPYCNAL DIFFUSION i j ne ugs dpa E B 107 a Tog t em B 108 _ uL B 109 _ uL B 110 M _ UTE B 111 A _ UTER B 112 m X
457. rive grids is not appropriate when executing a model because the model itself becomes the driver 15 5 2 generate a grid This option is used for generating a grid domain and resolution as opposed to importing one Either this one or option read my grid must be enabled 15 5 3 read my grid This is the option to use when importing a domain and resolution generated from outside of the MOM 2 environment Either this one or option generate a grid must be enabled 15 5 4 write my grid For exporting a domain and resolution generated by module grids 156 CHAPTER 15 GENERAL MODEL OPTIONS 15 5 5 centered t This is for constructing a grid by method 1 as described in Chapter 7 If this option is not enabled grid construction is by method 2 which is the default method for MOM 2 15 6 Grid Transformations 15 6 1 rot grid Option rot grid allows the grid system defined by module grids to be rotated so that the pole is outside the area of interest Refer to Chapter 8 for details 15 7 Topography and geometry generation The options available for constructing topography and geometry are covered in detail in Chapter 9 and summarized below One and only one of the following options must be enabled rectan gular_box idealized scripps kmt etopo_kmt or read my All others are optional 15 7 1 rectangular box This constructs a flat bottomed rectangular domain on the grid resolution specified by mod ule grids All interior
458. rizations 10 3 Surface boundary condition details Discrete equations 11 1 Time Stepping Schemes 11 1 4 11 1 2 11 1 3 Euler 11 1 4 Others 4 2 2l ee ee 11 2 Time and Space discretizations 11 2 1 Key to understanding finite difference equations 11 3 Start of computation within Memory 11 4 loadmw loads the memory window 11 5 adv vel computes advective velocities ee 11 6 isopyc computes isopycnal mixing tensor 11 7 vmixc computes vertical mixing coeffients 11 8 hmixc computes horizontal mixing coefficients lle 11 9 setvbc set vertical boundary 11 10tracer computes tracers 11 10 1 Tracer components lh 11 10 2Advective and Diffusivefluxes 22e 11 10 3Isopycnal 11 10 4Source terms 11 10 55ponge boundaries 11 10 6 Shortwave solar penetration en 11 10 7 Tracer operators 11 10 8 Solving for the trac
459. rocessor Disk requirements As indicated in Figure 3 10c 1 data can be written to the 7 1 disk without conflict when using fine grained parallelism Therefore only two disks are required However as indicated in Figure 3 9 coarse grained parallelism required three disks Therefore coarse grained parallelism requires 5096 more disk space than fine grained parallelism Additionally since calculations for rows within the memory window proceed sequentially there is no problem with components of diagnostic files being written in random order in fine grained parallelism Redundant calculations Referring to Figure 3 9 since memory windows are independent of each other there must be redundant calculations involving latitude rows on either side of the boundary line separating 3 5 PARALLELIZATION 27 the logical sections on the disks All meridional gradients and averages need to be computed redundantly for these latitude rows Also each latitude must be read three times per time step from the 7 and 7 1 disks Calculations involving density adding external mode to internal mode velocities and generating land sea masks must also be done three times for these latitude rows As the number of processors increases so do the number of logical sections on the disk and in the limit of one processor per latitude redundancy takes place on all latitude rows This results in coarse grained parallelism with lots of processors taking 15 more
460. rocessors is the maximum number of processors to be used On time steps where conflicts arise between diagnostics and coarse grained paral lelism the number of processors used is automatically reduced to one to avoid these problems In principle most of the problems involve diagnostic I O from within the parallel region Note that the standard test case with jmt 61 will typically lead to a static load imbalance for any reasonable power of two number of processors However setting up the domain in mod ule grids to yield jmt 66 latitude rows will remove the imbalance condition for 2 4 8 16 and 32 processors Be sure to set the compiler options needed for multitasking For instance on a CRAY C90 compiling with the parallel compiler option Zp is also necessary How it works Dataflow for coarse grained parallelism is similar to what was described in Sections 3 2 and 3 3 2 although there are differences To actually see a working example execute script run mawsim This script indicates how data is cycled between a memory window and disk along with showing which latitude rows are updated by which processor for the case of jmt 8 rows and various numbers of processors Refer to Figure 3 9 which demonstrates the case for two processors In comparison to the fine grained approach illustrated in Figure 3 2 note that there are now three disks with the new disk allotted for latitude rows at time level 7 1 Using only two disks will not work
461. ror messages to the printout file before stopping Various additional checking is done and warning messages may also be issued These are less serious than error messages and allow MOM 2 to continue This does not mean they should be ignored They often give information about possibly inappropriate values being used In fact it is a good idea to search the printout file to locate any warning messages and verify they are harmless before continuing Refer to Section 19 5 for details on how to perform searches In the rest of this chapter allowable options will be grouped into catagories and given brief explanations aloong with guidelines for useage Diagnostic options are discussed separately in Chapter 18 15 1 Computer platform Options are used to invoke minor changes in MOM 2 which are computer platform specific thereby enabling MOM 2 to execute on various platforms These changes tend to be concen trated in the I O manager timing and NetCDF routines Only one platform must be specified 15 1 1 cray_ymp This option configures MOM 2 for the CRAY YMP which no longer exists at GFDL If us ing a CRAY YMP with an operating system prior to Unicos 9 then the f90 command in script run mom must be changed to cf77 with appropriate options 15 1 2 cray_c90 This option configures MOM 2 for the CRAY C90 which no longer exists at GFDL If us ing a CRAY YMP with an operating system prior to Unicos 9 then the f90 command in scri
462. row jstask n 1 on processor n to latitude row jetask n 1 on processor n 1 e copy all data from latitude row jetask n 1 1 on processor n 1 to latitude row js task n on processor When MOM 2 is configured with options which require a fourth order memory window then the following communication is required e copy all data from latitude row jstask n 3 on processor to latitude row jetask n 1 on processor n 1 e copy all data from latitude row jstask n 2 on processor n to latitude row jetask n 1 1 on processor n 1 e copy all data from latitude row jetask n 1 3 on processor n 1 to latitude row js task n on processor e copy all data from latitude row jetask n 1 2 on processor n 1 to latitude row js task n 1 on processor n For the above communication to work on a fourth order memory window there must be at least two computed rows per processor The CRAY T3E processors can be divided up more or less arbitrarily so that a particular job is not constrained to a number of processors that is a power of two 3 5 4 Comparing Coarse and Fine Grained Parallelism In the past it turned out that the best way to maximize overall computational efficiency and throughput on multiple processors at GFDL was to multi program having one or more jobs 17A computed row is one where pr
463. row 2 cos Pjrow 1 cos Po now apgr 2 7 grav 1 _ Jo M apgr DAT Us l jrow 1U 1 jrow 1 65 cos Oo 1 Hi l jrow 1Vi 1 jrow 1 16 52 T cos Poy dt Note that the piece _ 805 iron is included only when the implicit free surface method is pgr 2AT grav used Also the coefficient apgr is set to alph for leapfrog time steps and theta for mixing time steps Equation 16 52 is solved using option conjugate gradient with option sf 9 point with the number of islands nislsp set to zero because no island equations are being solved After solving for Aps the barotropic velocities at time level 7 1 are given by apgr AT 4 row Ui jrow T cos 5 1 1 U UF 16 53 grow gt TN Vi Vi jrow apgr AT S psi A jrow 1 16 54 where the terms 72 and V7 are included only in the implicit free surface method The agrow agrow predicted surface pressure is given by row PST pow APSi jrow 16 55 and the free surface elevation at time level 7 1 is 2 1 Mi jrow TAY PS jrow 16 56 but 7 is not explicitly needed in the code and so is not calculated The vertical velocity at the top of the free surface is adv vbt pst l fau M gAT 16 57 PS jrow PS jrow The following setting are needed on various types of time steps Leapfrog time steps The equa
464. rtheless limit the length of the time step Convergence of meridians Because the model is formulated in spherical coordinates convergence of meridians near the earth s poles reduces the effective grid size in longitude At high latitude the solution may start to become unstable because of too large a time step Instead of decreasing the time step an alternative is to filter the solution at high latitudes to remove high wavenumber components There are two filtering methods described below for suppressing these components Option fourfil uses l ourier filtering and option firfil uses a symmetric finite impulse response filter to accomplish the same thing Either one of these is typically applied polward of a critical latitude determined by the researcher An alternative to filtering is to rotate the grid so that the convergence of meridians takes place outside to the model domain Refer to Section 15 6 1 for details Inertial period Another component involves the inertial period The time step for coarse global models is severly restricted by having to resolve the inertial period near the poles Option damp inertial oscillation described below filters the Coriolis term and removes this restriction 15 11 1 fourfil Due to the convergence of meridians on a sphere longitudinal grid resolution decreases to zero as the poles are approached For global domains this may severely limit the length of the time step due to the CFL constraint A
465. s Increases in speed can be realized when opening up the memory window even on a single processor This is the case when lots of diagnostic options are enabled The reason is less redundant computations are needed Substantial amounts of memory and disk space can be saved when multitasking with fine grained parallelism as compared to the coarse grained parallelism used in MOM 1 However it should be noted that the memory window can duplicate the coarse grained approach to multitasking used in MOM 1 Also when the memory window is fully opened there is no dataflow between memory and disks because disks are not needed All data is retained within the memory window 6 Referring to spatial dimensions 16 CHAPTER 3 DATAFLOW 3 3 1 A description Refer to Figure 3 3a which schematically shows the arrangement of all three dimensional prog nostic data on a 7 1 and 7 disk Each disk contains two components of velocity and two tracers but others may be added In general only two time levels are required on disk because tau 1 data can usually be written over the tau 1 disk area Consider a longitudinal slice through all data on both disks indicated by the colored section in Figure 3 3a When this data is read into memory it is stored in the memory window shown in Figure 3 3b For purposes of an example it is opened wide enough to hold six latitudes The size of the memory window is arbitrary and is controlled by setting parameter jmw
466. s e Option dm taper enables the hyperbolic tangent re scaling for steep slopes by Danabasoglu and McWilliams NCAR 1996 Where isopycnal slopes exceed the critical slope slmz the re scaling factor is S del scaling 0 5 1 tanh Jam 15 86 where 5 is the local isopycnal slope and del and 5 namelist input parameters Refer to Section 5 4 for information on namelist variables If option dm taper is not enabled the re scaling of Gerdes et al 1991 is used l scaling Cup 15 87 Neither of these ad hoc re scalings apply to option full tensor which is re scaled as given in Section B 3 3 e Option gent mcwilliams enables the Gent McWilliams parameterization for the effect of mesoscale eddies on isopycnals as given in Section 15 16 4 Option held larichev enables a higher order scheme for prediciting the isopycnal mixing coefficient as explained in Section 15 16 5 However this one is not ready yet 180 CHAPTER 15 GENERAL MODEL OPTIONS Details This section presents a summary of the discretization of the isopycnal diffusion fluxes The full details for the derivation and explanation of the labels are presented in Appendix B Further reference should be made to the manuscript in preparation by Griffies et al 1997 The discretization for the isopycnal mixing tensor given below assumes the default grid construction used in MOM 2 It is not correct for the grid option centered t which always centers g
467. s imt x jmt x km cells 7 2 GRID CELL ARRANGEMENT 7 2 Grid cell arrangement The grid system is a rectangular Arakawa staggered B grid Bryan 1969 containing T cells and U cells In order to visualize this arrangement it will be helpful to refer to Figs 7 1 7 2 and 7 3 which depict grid cells within horizontal and vertical surfaces Within each T cell is a T grid point which defines the location of tracer quantities Similarly each U cell contains a U grid point which defines the location of the zonal and meridional velocity components 7 21 Relation between T and U cells Within a horizontal surface at depth level k grid points and cells are arranged such that a grid point U k jrow where subscript i is the longitude index jrow is the latitude index and kis the depth index is located at the northeast vertex of cell k jrow Conversely the grid point T k jrow is located at the southwest vertex of cell Ti 1 k jrow 1 is the southwestern most T cell and Ti imt k jrow jmt is the northeastern most T cell within the grid This horizontally staggered grid system is replicated and distributed vertically between the ocean surface and bottom of the domain T k 1 jrow is the first cell below the surface and Tik km jrow 18 the deepest cell Unlike in the horizontal T cells and U cells are not staggered vertically so all T cells and U cells with index amp are at the same depth 7 2 2 Regional and domain boundaries As
468. s along the first dimension typically do not include boundary cells 1 and 1 imt In the k dimension limits are sometimes a function of and j 3 3 THE MEMORY WINDOW 15 slices at time level 1 and another for holding latitude rows slices at time level Each disk contains jmt latitudes stacked from southernmost row 1 at the bottom to northernmost row jmt at the top and each latitude row corresponds to a slice through the volume of all three dimensional prognostic variables along a line of constant latitude Assuming one processor enough processor memory is assigned to hold three latitudes worth of prognostic variables at two time levels plus a work area The size of the work area varies according to which options are enabled In general space is required to hold fluxes of quantities defined at cell faces Depending on options space for diffusive coefficients defined at cell faces may also be needed Solving the equations by second order finite difference techniques necessitates accessing nearest neighbors in space and time which requires this amount of memory The process starts by reading data from the first three adjacent latitudes slices on ther 1 disk into the processor s memory followed by data from the three corresponding latitude rows on the disk Using boundary rows j 1 and 7 3 equations physics and dynamics are solved for cells in the central latitude row 7 2 and written back to latitude row jrow 2
469. s enabled mixing coefficients for tracers from consthmir smagnimix or bryan lewis vertical are used as background values and added to the horizontal diffusion coefficients from option isopycmiz For details on specific schemes consult their options 18 Contained in file vmixc F This is effectively done by adding diffusive fluxes from the basic scheme to the isopycnal flux across the bottom face of the T cell 20 Contained in file hmixc F l lhis is effectively done by adding diffusive fluxes from the basic scheme to the isopycnal flux across the northern and eastern face of the T cell 11 9 SETVBC SET VERTICAL BOUNDARY CONDITIONS 117 11 9 setvbc set vertical boundary conditions Subroutine setvbc sets vertical boundary conditions for momentum sm fijn and tracers st fijn at the ocean surface and their counterparts defined at the ocean bottom bm fijn and Also bm fijn can be set to zero free slip or a linear bottom drag condition with the drag coefficient being input through namelist Refer to Section 5 4 for information on namelist variables Refer to Chapter 10 for further discussion on surface boundary conditions 11 10 tracer computes tracers Subroutine tracer is contained in file tracer F and computes tracers given by ti k 4 1 for n 1 to nt where nt is the number of tracers Index n 1 corresponds to potential temperature in Equation 2 3 and index n 2 is for salinity in Equation 2 4 These first
470. s explained in Section 11 1 indices are used to point to various time levels on disk and in the memory window Note that all of these indices are integers The indices which point to time levels within the memory window are e taumi1 which points to data at time level 1 e tau which points to data at time level e 1 which points to data at time level 1 The indices which point to time levels on disk are e taumidisk which points to data at time level 1 e taudisk which points to data at time level e taupidisk which points to data at time level 1 Note that typically there are only two disks needed unless multitasking with the coarse grained parallel approach In this typical case the taupldisk takes on the value of taumldisk 5 2 THE MAIN VARIABLES AT 5 2 8 3 D Prognostic variables The three dimensional prognostic variables are Uis horizontal velocity components located at grid points within cell U k jrow liii tracer components located at grid points within cell T k jrow Here subscript i is the longitude index of the cell from i 1 westernmost cell to i imt easternmost cell subscript k is the depth index of the cells from k 1 surface cell to k km bottom cell and subscript 7 is the latitude index of the cells from j 1 southernmost cell to j jmw northernmost cell With regard to U cells subscript n is the velocity component in units of cm sec
471. s jmw 4 instead of jm 3 required for second order differences As with all fourth order schemes option fourth order memory window must be enabled to handle this option This is automatically done when option biharmonicis enabled Mixing coefficients are input through namelist Refer to Section 5 4 for information on namelist variables 15 15 3 smagnlmix This is a basic mixing scheme that formulates the mixing of momentum and tracers in terms of functions of local stress and strain in Equations 2 8 2 9 2 3 and 2 4 The mixing coefficients are functions of space and time as given in Smagorinsky 1963 and Deardorff 1973 The method is summarized in Rosati and Miyakoda 1988 and the additional viscous terms of Wajsowicz 1993 are accounted for Values required for this option are input through namelist Refer to Section 5 4 for information on namelist variables In this formulation the momentum mixing terms given by Equations 2 8 and 2 9 are replaced by the finite difference forms for Equations 2 18 and 2 19 given in Rosati and Miyakoda 1988 To solve these finite difference equations tension strain and shearing strain k j2 rates of strain are computed on the northern face of U cells as 1 gt Ui kj 2 7 1 strainikji pO eat 605 Pirow 5 15 65 cos P row 1 COS Pj row 1 _ Ui kj 1 r 1 strainikj2 Cos Prom 4166 7 15 66 cos Pirow 1 cos Pj row and used to compute visc
472. s not strongest near bottom topog raphy Instead the flow implied by only approximates a maximum entropy system given eddies and topography Since this approximation is admittedly crude further refinements are open to researchers There is legitimate concern about the stepwise resolution of bottom topography in level models such as MOM 2 and its predecessors Option neptune is an attempt to instruct the model about physical consequences due to topography and eddies which are nearly unachievable even at the most ambitious resolutions The hope is that if the model can be suitably informed about the effect of topography it matters little if that topography is only approximately represented 15 18 Advection schemes The advection of momentum always uses second order accurate center differencing in space and time which conserves first and second moments In addition to this second order accurate scheme others schemes are available for the advection of tracers If none are enabled then the second order accurate scheme is also used for tracers Which is missing or at best poorly represented in numerical models at any resolution This is referred to as the Neptune effect because when Greg Holloway described coastal currents that per sistantly flow againgst both wind forcing and pressure gradient the response was that it must be due to King Neptune Who else 186 CHAPTER 15 GENERAL MODEL OPTIONS 15 18 1 second order tracer advection
473. s the slices are to be accessed in a predetermined way 13 14 CHAPTER 3 DATAFLOW Disk storage for a three dimesgianal variable IagitrEes i l imt Depths kcl mm k Tatitudes jowl Memory requirements for various slices Array imt km Array jmt km Array int jmt Figure 3 1 Various ways to slice a three dimensional volume of data on disk and the corre sponding dimensions of the slice in memory There are various ways to slice through a volume of data on disk As an example refer to Figure 3 1 and consider the disk storage needed to contain a three dimensional block of cells arranged such that there are i 1 imt longitudes jrow 1 jmt latitudes and k 1 km depth levels As indicated slicing the volume in various ways and reading the data into memory implies that in memory the slice can be dimensioned as Array imt km Array jmt km or Array imt jmt Perhaps the most intuitive way of dimensioning arrays is Array imt jmt However in general the number of model latitudes is comparable to the number of longitudes but the number of depth levels is typically 1 5 to 1 10 the number of longitudes This eliminates dimensioning slices as Array imt jmt because it is too wasteful of memory Memory requirements for dimensioning slices as Array jmt km are comparable to those for dimensioning as Array imt km However dimensioning as Array jmt km is less favorable based on other conside
474. s transformation is justified as long as A is symmetric that is Ag for all a and B Symmetry of the explicit equations In Equation 16 13 the three major brackets are expanded into summation notation as given by Equations 17 9 17 10 and 17 12 Interpreting these equations in the formalism given above the vector is AV jrow at all mid ocean points and island values the linear operator A is the array coeff jrow i j 4j and the subscripts are a i jrow and B i5 j where i i 4 i i and j jrow j j for some values of i j 0 1 and i j 1 0 More simply 8 i j is one of the eight nearest neighbors of a i jrow and a i jrow is one of the eight nearest neighbors of 8 7 7 This section shows that the contributions to the coefficients arising from the first brackets Equation 17 9 are symmetric If i i then and i must both be at their upper limits or both must be at their lower limits In either case 7 i 1 Similarly if j Z j then 7 j 1 If both are unequal that is if i jrow and 7 j are diagonal neighbors then i i iit Ei i i i 1 1 and similarly jrow j j F 1 j Note that the expressions 75 1 2 JY 2 1 j i 2 1 i and j 2 1 j describe the transition in the opposite direction so the relations i i i E 1 i and jrow j j 1 j
475. s with option idealized_kmt or scripps kmt 15 7 8 filLisolated cells This option converts all isolated ocean T cells into land cells 15 7 9 fill_shallow This option converts ocean cells to land cells in regions where the ocean depth is shallower than what is allowed 15 7 10 deepen shallow This option increases the number of ocean cells in regions where the ocean depth is shallower than what is allowed 15 7 11 round shallow This option rounds the number of ocean cells to zero or the minimum number of allowable ocean levels in regions where the ocean depth is shallower than what is allowed 15 7 12 fill perimeter violations This option builds a land bridge between two distinct land masses which are seperated only by a distance of one ocean T cell There must be at least two ocean T cells separating distinct land masses 15 7 13 widen perimeter violations This option removes land cells between two distinct land masses which are seperated only by a distance of one ocean T cell There must be at least two ocean T cells separating distinct land masses 15 8 Initial Conditions Typically at initial condition time the model is at rest with a specified density distribution This is accomplished by zeroing all velocities internal and external mode and setting potential temperature and salinity at each grid cell using one of the options described below All passive tracers are initialized to unity in the first level k
476. sa 19 9 How to set up model As an example assume an Atlantic model is to be set up Once familiar with the directory structure as outlined in Section 19 6 and illustrated in Fig 19 1 the following steps may be used 1 Add a sub directory under EXP with two additional sub directories for containing updates or changes which when applied to the base code in MOM 2 will defined the new model For example the new experiment might be named EXP ATLANTIC and the two additional sub directories EXP ATLANTIC MOM_UPDATES and EXP ATLANTIC PREP_UPDATES 2 Copy file grids F and script run_grids from MOM 2 into EXP ATLANTIC MOM_UPDATES If not executing on a CRAY T90 add option sgi to script run_grids Specify a domain and grid resolution by entering changes in the USER INPUT of module grids as described in Chapter 7 Execute script run_grids Examine the output and when satisfied copy size h from MOM 2 into the EXP ATLANTIC MOM_UPDATES directory and make the indi cated parameter changes This domain and grid resolution will now be available to other modules and MOM 2 3 Copy file topog F and script run_topog from 2 into EXP ATLANTIC MOM_UPDATES The model geometry and topography will be generated by executing script run_topog with options outlined in Chapter 9 If not executing on a CRAY T90 add option sgi to script run_topog The domain and resolution will be defined from module grids Note that the kmt jrow field is printed out Decid
477. sak 1979 The upstream solution at all neighbouring points enters the version given by Equation 15 169 which requires additional storage for the meridional direction With the version given by Equation 15 168 the current values of the tracers at neighbouring points are used instead of the upstream solution that enters only at the central point Experimentally the author has found that differences in solutions using Equations 15 168 and 15 169 are very small and thus option fet_dml1 is recommended in general Obviously Equations 15 168 and 15 169 are not the only possible choices for upper and lower bounds on the solution Narrower bounds will make the solution more diffusive Specification of Tr and Tr can be used to keep the solution within a certain range always positive for example To calculate the limiters the possible change of the solution in either direction is determined by considering the sum of anti diffusive fluxes into and out of the grid cell For the x direction kj maz 0 A e 4 min 0 15 170 0 min 0 15 171 where tifex A ik j par Pik 15 172 UT 2cos 5 dat and anti feik j adv feikj adv ferr 15 173 is the anti diffusive flux at the eastern edge of the tracer cell The maximum permitted positive or negative changes in the solution due to the divergence of the delimited anti diffusive fluxes are Experimentation with the limitat
478. sbc reads unformatted climatological monthly Hellerman stress 1983 and Oort 1983 surface air temperature and interpolates to the grid defined by module grids Look for the USER INPUT section to choose the type of interpolation appropriate for the grid resolution This script uses file sbc F which is included run ic reads unformatted monthly Levitus 1982 temperature and salinity data and generates monthly climatological initial conditions along with surface tempera ture and salinity for the grid defined by module grids Look for the USER INPUT section to choose the type of interpolation appropriate for the grid resolution This script uses file ic F which is included run_sponge reads output files produced by run icto construct sponge rows for damp ing model predicted temperature and salinity back to these data near northern and southern artificial walls This is only appropriate for use in limited domain models and is the poor mans open boundary condition This script uses file sponge F which is included The width of the sponge layers and the variation of Newtonian damping time scale within the sponge layer may be set within file sponge F run read levitus is a simple workstation script showing how to read the Levitus 1982 data with Levitus land sea masks on a workstation It assumes the Levitus 1982 data has been copied to the workstation s local disk run_obe is a run script which uses file obc F for constructing data needed
479. scale water masses in ocean general circulation models Journal of Physical Oceanography 23 1523 1552 England M H V C Garcon and J F Minster 1994 Chlorofluorocarbon uptake in a World Ocean model 1 Sensitivity to the surface gas forcing J Geophys Res 99 25215 25233 England M H 1995 Using chlorofluorocarbons to assess ocean climate models Geophys Res Letters in press England M H 1995 The age of water and ventilation time scales in a global ocean model J Phys Oceanogr in press Holland W R 1979 The general circulation of the ocean and its modeling Dynamics of Atmospheres and Oceans 3 111 142 McWilliams J C 1996 Modeling the oceanic general circulation Annual Review of Fluid Mechanics 28 215 248 Pond 5 and Bryan 1976 Numerical models of the ocean circulation Reviews of Geo physics and Space Physics 14 243 263 Semtner Jr A J and R M Chervin 1988 A simulation of the Global Ocean circulation with resolved eddies Journal of Geophysical Research 93 15502 15522 D 0 18 Coupled Atmosphere Ocean Bryan K F G Komro Manabe and M C Spelman 1982 Transient climate response to increasing atmospheric Carbon Dioxide Science 215 56 58 Bryan K 5 Manabe and R C Pacanowski 1975 A global ocean atmosphere climate model Part II The oceanic circulation Journal of Physical Oceanography 5 30 46 Manabe S Bryan and M J Spelman 197
480. set true on the first run but false thereafter Partial sums are taken over all i k jrow within the domain to contract quantities into regional volumes given as Plus a few extra ones 18 2 LIST OF DIAGNOSTIC OPTIONS 239 nreg mskvr y 1 nhreg mskhri 18 91 where masks mskur and mskhr are defined as in Section 18 1 4 and the range of nreg is from 0 to nhreg nvreg Two operators are defined to perform these contractions separately for quantities defined on T cells and U cells They are given by jmi l km imt 1 2 CM mre Vo are nreg gt gt gt 18 92 jrow 2k 1 1 2 n l jmti l km imt 1 2 T Vo Ge nreg gt gt 3 Bie AT ik jrow 18 93 jrow 2k 1 i 2 n 1 18 94 where a is defined on U cells 8 x is defined on T cells and the respective volume elements and total volumes for each region are U UMaski k jrow dau cos QU dYUjrow dzty 18 95 jrow jmt l km imt 1 vore y AY 18 96 jrow 2k 1 1 2 nhreg VoU volld nreg 18 97 nreg l ATi tmask jrow dat cos ow dzty 18 98 jm l km imt 1 Vol E NT ATL 18 99 jrow 2k 1 i 2 nhreg VolT vares 18 100 nreg 1 with the relation between j and jrow as described in Section 5 2 Term balance for Momentum Equations Using arrays and operators described in Section 11 11 5 all compo
481. shkin V F Favorskii A P and M Y Shashkov 1979 Variational difference schemes for the heat conduction equation on nonregular grids Sov Phys Dokl 24 446 448 Weaver A J and E Sarachik 1990 On the importance of vertical resolution in certain ocean general circulation models Journal of Physical Oceanography 20 600 609 Zalesak 5 T 1979 Fully multidimensional flux corrected transport algorithms for fluid Journal of Computational Physics 31 335 362 D 0 10 Sub Grid Scale Parameterization Bryan F O 1987 Parameter sensitivity of primitive equation ocean general circulation models Journal of Physical Oceanography 17 970 985 Cox M D 1987 Isopycnal diffusion in a z coordinate ocean model Ocean modeling T4 1 5 Cummins P F G Holloway and A E Gargett 1990 Sensitivity of the GFDL ocean general circulation model to a parameterization of vertical diffusion Journal of Physical Oceanography 20 811 830 322 APPENDIX D REFERENCES Danabasoglu G J C McWilliams and P R Gent 1994 The role of mesoscale tracer transports in the global ocean circulation Science 264 1123 1126 Gent P R and J C McWilliams 1990 Isopycnal mixing in ocean circulation models Journal of Physical Oceanography 20 150 155 Gent P R J Willebrand T McDougall and J C McWilliams 1995 Parameterizing eddy induced tracer transports in ocean circulation models Journal of Physical Oceanog
482. sing options fet_dlm1 fct dlm2 The anti diffusive fluxes are limited for each coordinate direction separately Flux limitation in three dimensions is optionally done afterwards This procedure was recommended by Zalesak 1979 in the case that a tracer is transported in a direction perpendicular to a large gradient in the tracer In ocean models the possible range of the solution is frequently given by a large variation in the vertical direction while the largest anti diffusive fluxes occur in the horizontal 192 CHAPTER 15 GENERAL MODEL OPTIONS direction Experience shows that using only three dimensional limiting results in very noisy fields although the solution is free from overshoots and undershoots As an example the following presents details of the algorithm for the one dimensional limiter in the x direction The procedure is the same for the other coordinate directions Assume that the solution is required to stay within bounds given by Tr7 and There are currently two different ways to calculate these bounds and are selected by options fet_dim1 and fct_dlm2 For option fct dim1 these bounds are specified as Mar i EJ RT UKJ T tK T t 1 k j n 7 low Tr mag oe r eia ads tin tik t Men i EJ RT UK J T tK T El j nT low while option fct dim2 employs mar __ low low low TrP maz U Ls sa min __ low low low Tr Mint ticki ns lun 15 169 which is the original formula of Zale
483. sj jsmw jemw 11 87 COS ow J J J diff fring aeg Ui 1 1 Ui k jn r 1 COS 1 jemw 11 88 daft je ow 6 ui jnr Ui kj 1 1 Ui k l j 1 1 Soe Qj jsmw jemw 11 89 k The top and bottom boundary conditions are applied to the vertical fluxes where the bottom cell is at level kb Also the advective flux through the bottom of the last level k km is set to zero since there can be no bottom slope at the bottom of the deepest level kb kmujjrow 11 90 difffbio 11 91 difffbix 11 92 adv_fbioj adv Uia n e Uil jnr 11 93 0 0 11 94 11 11 4 Source terms There is the possibility of introducing sources into the momentum equation by enabling op tion source ierm If this option is enabled the source term is initialized to zero for each component of the momentum equations source 0 0 11 95 Adding new sources or sinks to the momentum equations is a matter of calculating new terms and adding them to source For instance suppose it was desirable to add a Rayleigh damping in some region of the domain The damping could be calculated as rayleighig ik n 1 ray maski jrow 11 96 126 CHAPTER 11 DISCRETE EQUATIONS Where ray mask jrow 18 a mask of ones and zeros to limit the region of damping and
484. small slope version of the functional equation B 16 verifies the validity of the small slope limit from the full tensor Additionally the derivation is presented for the MOM2 default grid in which for nonuniform grids the T point is not in the center of the T cell The form of the discretized operator is dependent on this choice of T cell placement As of this writing only the MOM default grid discretization of the diffusion operator has been implemented Therefore it is recommended that one not use the option t_center As seen in the discussion from Section B 1 the discretization of the diffusion operator at a particular grid point is derived from the functional derivative of the discretized functional 1 OS T kz Jiki VT pg Tiki B 24 It is necessary to divide out the volume of the T cell in the discrete case since with finite cell volumes the appropriate delta function which occurs in the derivative is the dimensionless 280 APPENDIX B ISOPYCNAL DIFFUSION Kronecker delta rather than the dimensionful dimensions 1 volume Dirac delta which appears in the continuum case The procedure therefore is to identify those pieces of the discretized functional which contain contributions from the discretized tracer value T as these are the pieces which contribute to the diffusion operator for this T cell This enumeration depends on the particular discretization of the functional One overriding principle used
485. solid state disk and 370 Gbytes of rotating disk Later that year the system was replaced by a Cray T90 having 20 processors 512 Mword central memory and a 2 Gword solid state disk The Cray T90 is scheduled for upgrades to 24 and then 30 processors by 1998 Additionally a Cray T3E with 40 processors and 640 Mwords of memory is due in 1997 To take advantage of this environment and in anticipation that in the near future parallelization will be needed to keep overall system efficiency high some attention has been given to multitasking These and other changes described below are included in the latest version known as MOM 2 version 2 Throughout these developments the intent has been to construct a flexible research tool useful for ocean and coupled air sea modeling applications over a wide range of space and time scales Documentation There has been no serious attempt at ocean model documentation at GFDL since the technical report of Cox 1984 Since the release of MOM 1 1990 there have been He was stationed at GFDL in the early 1970 s as a commissioned officer in the NOAA CORPS n the later half of the 1980s SUN 3 50 workstations were introduced which ushered in a new era of model development Before this code development was done without the aid of editors or utilities like UNIX grep 0 1 INTRODUCTION many requests for updated documentation This manual was written to satisfy that need by Ron Pacanowski and can be referenced
486. spheric turbulence Journal of Fluid Eng Sep 429 438 D scher R and Redler R 1995 The relative influence of North Atlantic overflow and subpolar deep convection on the thermohaline circulation in an OGCM submitted to J Phys Oceanogr DYNAMO groups at IMG Grenoble JRC Southampton and IfM Kiel 1994 1994 scientific report EC MAST DYNAMO contract no MAS2 CT93 0060 Dukowicz J K and R D Smith 1994 Implicit free surface method for the Bryan Cox Semtner ocean model Journal of Geophysical Research 99 7991 8014 Farrow D E D P Stevens 1995 A new tracer advection scheme for Bryan and Cox type ocean general circulation models Journal of Physical Oceanography 25 1731 1741 Fiadeiro M E G Veronis 1977 On weighted mean schemes for the finite difference approx imation to the advection diffusion equation Tellus 29 512 522 Gent P R and J C McWilliams 1990 Isopycnal mixing in ocean circulation models Journal of Physical Oceanography 20 150 155 Gent P R J Willebrand T McDougall and J C McWilliams 1995 Parameterizing eddy induced tracer transports in ocean circulation models Journal of Physical Oceanography 25 463 474 Gerdes R C K berle and J Willebrand 1991 T he influence of numerical advection schemes on the results of ocean general circulation models Climate Dynamics 5 211 226 Gill A E 1982 Atmosphere Ocean Dynamics Academic Press Inc Goddard L 1
487. sponding to the interval e xbtper an averaging period real e xbtperts a switch logical corresponding to the averaging period e ixbtint internal variable needed by the time manager to support calculation of the logical switches The researcher specifies the interval e g xbtint for diagnostic output and averaging pe riod e g xbtper in units of days through namelist and tmngr sets the corresponding logical switches e g xbtts xbtperts every time step They are set to true when within half a time step of the requested interval or averaging period otherwise they are false In this example 20115 will be true on the time step corresponding to day 30 0 and zbtperts will be true on all time steps within days 26 0 through 30 0 On the next interval 20115 will be true on the time step corresponding to day 60 0 and zbtperts will be true on all time steps within days 56 0 through 60 0 The following statements placed inside the time manager in the section for switches based on interval and averaging period will calculate both switches xbtts avg alarm ixbtint ihalfstep xbtint xbtper iref 0 xbtperts on ixbtint In the above variables ihalfstep and iref are calculated internally by the time manager Func tionavg alarm is internal to the time manager as well as array on Switches xbtts and xbtperts are updated every time step and are available anywhere in MOM 2 by including file switch h in the routine where the sw
488. ssure work Be lt Vp gt 2 43 a nonlinear term associated with the spherical metric Me tf singd d H uv 0 Wt 2 44 2 2 KINETIC ENERGY BUDGET 11 viscous dissipation plus bottom topography De lt ain 4 H T 2 45 and wind forcing W v7 J d sin d H T 2 46 The external mode kinetic energy equation thus takes the form Ei Ne Be Me De We 2 47 For a flat bottom rigid lid ocean which is a common idealized model domain pressure forces can do no work on the external mode To prove this property it is useful to start with the identity 0 Vp V a dz p H PV ln H Pbottom V In H Vp Vp Pbottom p V in H 2 48 where 18 the pressure at z The second term vanishes for a flat bottom domain V H 0 and so the pressure work Be defined in equation 2 43 becomes Be lt t Vp gt lt t Vp gt 2 49 The continuity equation V i w 0 implies V w z H w z zup where w z Zup 0 for a rigid lid and w z H 0 fora flat bottom Therefore i Vp V p which vanishes when averaged over a closed domain on which the normal velocity vanishes The total kinetic energy E discussed in the previous section is given by the sum of the external and internal mode energies E since lt d v 0 gt 0 Therefore the domain averaged internal mode kinetic energy is si
489. st set up using option idealized_ic to eliminate problems which could potentially come from more realistic initial conditions Only after the model sucessfully executes and the solution is judged reasonable should more realistic initial conditions be considered 15 8 3 levitus_ic This option accesses three dimensional temperature and salinity data which have previously been prepared by scripts in PREP DATA for the resolution specified by module grids as dis cussed in Section 19 6 The particular month from the Levitus 1982 climatology which is to be used as initial conditions must be accessed by pathname from within script run mom The researcher should supply the pathname 15 9 Surface Boundary Conditions As detailed in Chapter 10 surface boundary conditions are viewed as comming from hier archy of atmospheric models the simplest of which are datasets of varying complexity and the most complicated ones are the GCM s The following is a summary of the various options relating to surface boundary conditions with further details being left to Chapter 10 One and only one option of the following options must be enabled simple sbc time mean_sbc_data time varying sbc data or coupled 15 9 1 simple sbc These are based on zonal averages of Hellerman and Rosenstein annual mean windstress 1983 If option restorst is enabled the surface temperature and salinity are damped back to initial conditions on a time scale given by dampts in
490. st for beta testers 252 19 4 Accessing MOM 2 252 19 5 How to find things in 2 253 19 6 Directory Structure aoaaa 253 19 7 The MOM 2 Test Cases 256 19 7 1 The and mom sgi scripts eee 256 19 8 Sample printout files 257 19 9 How to set up model les 259 19 10Executing the model 260 19 11 Executing on 32 bit workstations 260 19 12NetCDF on 32 bit 261 19 13Distributed memory systems 261 19 14MOM 1 and upgrading to MOM 2 261 19 15Upgrading from older to newer versions of MOM 2 261 19 16Bug Fixes How to get the latest MOM 2 263 19 17 Registration for 2 263 A Tracer mixing kinematics 265 A l 265 A 1 1 Kinematics of an anti symmetric tensor lees 266 A 1 2 Tracer moments 267 2 Horizontal vertical diffusion 268 Isopycnal diffusion 268 A 4 Symmetric and anti symmetric tensors 22e 273 5 Summary
491. stems with 32 bit word length refer to Sections 19 11 and 19 12 Note that early versions of the NetCDF libraries at GFDL were very inefficient Newer versions reduce previous wall clock time by over two orders of magnitude Routines used in MOM 2 require use of the UNIDATA NetCDF library If not already in place this will have to be built using information available from 18 2 LIST OF DIAGNOSTIC OPTIONS 231 http www unidata ucar edu Note that the directory MOM_2 NETCDF contains utility routines written by John Sheldon at GFDL for purposes other than MOM 2 to provide an intermediate level interface to the low level netcdf library routines Also the file netcdf inc within MOM_2 NETCDF is platform specific At GFDL this file is referenced by pathname usr local include netcdf inc If platforms other than these are used get the proper netcdf inc from the address given above Typically routines in MOM NETCDF do not have to be explicitly used or understood when writing diagnostics in MOM 2 There are higher level interface routines in file util netcdf which are described below and used to facilitate writing diagnostic output in NetCDF format All diagnostics within MOM 2 use these higher level interface routines to provide uniformity between diagnostics and to minimize the amount of coding needed in what otherwise would be a long tedious process Once the idea is grasped any diagnostic can be used as a template to add NetC
492. sults in a stress on the ocean with two important consequences first the ocean is not driven towards a state of rest and secondly the resulting motion may have scales much larger than the scale of the eddies Somewhat suprisingly this interaction can generate coherent mean flows on the scale of the topography The magnitude of this topographic stress is dependent on the correlation between pressure p and topographic gradients which is largely unknown but even if the correlation is 0 1 the resulting topographic stress would be comparable in magnitude to that of the surface wind If the view is taken that equations of motion are solved for moments of probable flow because of imperfect resolution then those moments are forced in part by derivatives of the distribution entropy with respect to the realized moments The entropy gradient is estimated as begin proportional to a departure of the realized moments from a state in which the entropy gradient is weak This latter state is approximated by a transport streamfunction and maximum entropy velocity u given by uv fLH 15 109 u x Vw 15 110 where f is the Coriolis term H is depth and Z is 10 km If model resolution is coarse relative to the first deformation radius u is independent of depth Instead of eddy viscos ity driving flow towards rest flow is driven towards u using an eddy viscosity of the form AV u Note that topographic influence on flowt i
493. t a cosine factor has been absorbed within adv vntiso to mimic the regular merid ional advective velocity The horizontal components are treated differently than the vertical component to save memory at the expense of speed If memory is not a problem the advective flux across the north and east face of the T cell can be computed separately to eliminate the redundancy The total advection becomes the regular advection plus the Gent McWilliams advection given as ETT tik iri 11 71 where the Gent McWilliams advective operator is LI ti in r 1 ADV T tiso ADV T yisoi kj t ADV T2180 kj 11 72 It should be noted that when option fct is enabled Equation 11 72 is not used in tracer Instead the Gent McWilliams advection velocities are added to the regular advective velocities within the flux corrected transport calculations 11 10 8 Solving for the tracer The tracer equation is solved using a variety of time differencing schemes leapfrog forward Euler backward as outlined in Section 11 1 A complication arises due to the vertical diffusion term which may be solved explicitly or implicitly The implicit treatment is appropriate when large vertical diffusion coefficients or small vertical grid spacing limit the time step The following discussion pertains to the leapfrog scheme The other schemes amount to changing 2At to At in what follows Explicit vertical diffusion Using the above opera
494. t cell V is the velocity normal to the ith face and 7 is the average value of q on the ith face with qi being the value in the other cell that shares that face Using Equations 12 3 and 12 4 the time change of the volume integral of qn when integrated over all cells can be written as 135 136 CHAPTER 12 DISCRETE ENERGETICS ya Sa den _ 3 y avi _ 12 5 di 2 Un n l n 1 n 1 1 1 To obtain this result the normal velocity V must be zero at land boundaries Note that V is anti symmetric on the common face between adjacent cells due to the change in sign of the normal vector whereas the average Ji is symmetric with respect to adjacent cells This result indicates that integrals of first moments are conserved by Equation 12 4 It should be further noted that constructing 7 by any linear interpolation of and will also conserve first moments Using similar techniques the time change of the volume integral of q is given by N 6 d N N dq N 6 di 2 anda 2 2 On dn 2 AVI 12 6 n l 1 The third term in Equation 12 6 vanishes because the fluid is incompressible and continuity applies at each cell The fourth term vanishes because is symmetric and V is anti symmetric for pairs of adjacent cells again due to the change in sign of the normal vector and Vi 0 on all land boundaries It should be noted here that in particular constructing 7 as B qd 7 di where
495. t for each variable After all variables have been written the NetCDF file is closed Subsequently it may be reopened by a call to routine ncreof and appended to As an example consider the save convection diagnostic The following code defines four axes longitude latitude depth time and numbers them as 1 2 3 4 num 0 call caller id conv netcdf call def axis 1 num X 1 xt i Longitude of T points amp degrees E xt imt dimvals lendims mxdimout ndimsout call def axis 2 num Y 1 yt j Latitude of T points amp degrees yt jmt dimvals lendims mxdimout ndimsout call def_axis 3 num Z 1 zt Depth of T points amp zt km dimvals lendims mxdimout ndimsout call timestr netcdf time since call def axis 4 num T 1 Time Time since initial cond amp years 0 0 0 dimvals lendims mxdimout ndimsout If additional axes were required they could be added The arguments for the call to axis are a number to associate with the axis a counter for checking consistency a label a direction for which way is positive a short name a long name units an array defining points along the axis the number of points along the axis an internal netcdf array which will be set within def_azis an internal netcdf variable which will be set within def axis max length of any axis and the maximum number of axes The inter
496. tails related to representing the isopycnal diffusion tensor which is diagonal and thus simple in the orthogonal isopycnal frame in the Eulerian y z frame which is relevant for MOM Some of these results are derived by Redi 1982 but using a different formalism Basis vectors Consider a first order tensor or a vector V This object has any number of representations determined by the particular frame of reference For example a basis for two frames of interest yield the representations V V e A 36 V e A 37 where the space time dependent functions V and are the coordinates for the vector as represented in the respective frame There are two sets of basis vectors which define the frames considered here amp A 38 amp A 39 A 40 which is the familiar Cartesian unit basis for the z level frame and zxWVp 41 i E x Vol Vp lt A 43 3 Vol which defines the orthonormal isopycnal frame determined by the fluctuating geometry of a locally referenced isopycnal surface Transforming from the z level frame to the orthonormal isopycnal frame requires a linear transformation As a tensor equation the transformation is written ez For the purposes of organizing the components of the transformation this equation can be written as Sy 5 0 5 SVIS 1 5 p 5 amp amp 8 SES VE A 44 0 Jas VOS wh
497. ted data to file particles dta If option netcdf or trajectories netcdfis enabled data is written in NetCDF format to file particles dta nc rather than in unformatted IEEE The interval between output is specified by variable trajint and the control is specified by variable iotraj 18 2 26 xbts Originally option 2015 sampled temperatures and salinities at various latitude and longitude locations on the model grid down to some prescribed level and produced time averages of these quantities In time it grew to construct time averages of all terms in the prognostic equations at each model level down to a specified depth for a set of stations Station locations and depth at each station can be specified by looking at the USER INPUT section of zbt F and following the examples This diagnostic is useful when trying to understand the time evolution of dominant balances at specific locations in MOM 2 For instance deploying a group of XBTs can elucidate how waves propagate or currents meander It is also useful for planning where to deploy instrumented arrays or moorings in ship based experiments 2015 is similar to term balances but instead of averaging over space in various regions of the domain it averages over time at specific stations to prevents aliasing Unlike term balances this diagnostic is fast although it can get expensive in memory The output from this diagnostic may be written as ascii to the model printout or as 32 bit IEEE unformatted d
498. tering coefficient gcor 0 For implicit treatment of the Coriolis term acor is reset to theta Also dili ou cos TH on the second pass of an Euler backward time step the term argh PS i PS must be added to the right hand side of Equation 16 52 e rigid lid surface pressure method Centering coefficient apgr theta Centering coeffi cient gcor 1 when the Coriolis term is handled explicitly but gcor 0 when the Coriolis term is handled implicitly 16 3 2 Remarks It should be noted that Equation 16 36 only requires a Neumann boundary condition at the boundaries instead of the Direchlet boundary condition required for the elliptic equation of the stream function method The implication is that there are no island equations to be solved and hence this method should be faster than the stream function method on massively par allel computers Also this method does not have a checkerboard null space as does the rigid 212 CHAPTER 16 EXTERNAL MODE OPTIONS lid surface pressure method Whether the improved stream function approach or the im plicit free surface approach is fastest is likely to be problem and computer platform dependent This has yet to be explored The implicit free surface allows for prescription of a fresh water flux surface boundary condition on salinity rather than a salt flux which is required with the stream function or rigid lid surface pressure approach However prov
499. term in Hj jrow Hi 1 5 o Other differences arise on nonuniform grid The second bracket the implicit Coriolis terms may be seen to already be in five point form because each corner coefficient consists of two terms of equal magnitude but opposite sign 0 0 n Jjrow 4j gt j eddytin jn _ 1 i 0 j 20 i 1 j ii row j Firow 4j cddaui j cddztin jn mum Lir Lin j 1j 17 16 ate jrowt ty The right hand side of Equation 16 13 also remains the same in the five point equations as in the nine point equations 1 1 U fore jrow j FULL row jt o COS Pino 1 0 7 0 teddxty j 200040 jrowtj 2 7 AYU 17 17 Although the five point operator approximates the continuous differential equation 16 1 well its solutions are not exact solutions of the finite difference momentum equations 16 2 and 16 3 Moreover the time saved by calculating a five point operator instead of a nine point operator in two places per iteration in a conjugate gradient solver is not large and the nine point equations usually take fewer iterations to converge Section 17 5 contributed by Charles Goldberg chgQ g fdl gov Chapter 18 Diagnostic Options 18 1 Design MOM 2 is instrumented with a variety of diagnostic options Some are useful for diagnosing model problems while others are aimed towards providing informa
500. ters according to the indicated directions Any com ponent of MOM 2 which accesses the updated module grids and size h will get the new grid All components of MOM 2 which use module grids and size h perform a consistency check If there is an inconsistency MOM 2 will give an error message and stop 7 31 Grids in two dimensions When the grid system is contracted to a minimum along one dimension MOM 2 is essentially reduced to a two dimensional model For instance if it is desirable to have a two dimensional model that is a function of latitude and depth z then setting nzlons 2 and specifying dz dz lona such that there are two grid cells between bounding surfaces x_lon x_lon will generate imt 4 grid cells in the longitudinal direction Two T cells i 2 and i 3 will be calculated and the two extra T cells i 1 and 4 are for boundaries Only one U cell 2 is not in the boundary If option cyclic is enabled then the domain is zonally re entrant If the forcing and initial conditions are independent of longitude A then the solution is independent of A and the model is two dimensional in and z Obviously the relevance of this model depends on the scientific question being posed This is just to demonstrate how the longitudinal dimension can be contracted to a minimum of imt 4 cells The memory window should be opened to jmw jmt to make it as efficient as possible but this will not be as fast as the two dimensional m
501. than the Fourier filter A symmetric filter can be written as M uai 15 20 f M and its transfer function is M H w cos w forw 0 15 21 1 A very simple one is used with M 1 with weights 7 1 1 1 101 z qo 15 22 and the transfer function is 1 H w 501 cos w 15 23 The effect of multiple applications or passes with this filter can be easily calculated If the filter is applied num flt times then the transfer function is 71 Strips for the vorticity do not include coastal ocean cells because of the island integrals When filtering velocities the reference latitude is given by jfud 166 CHAPTER 15 GENERAL MODEL OPTIONS 15 11 3 damp oscillation Option damp inertial oscillation damps inertial oscillations by treating the Coriolis term semi implicitly Why treat the Coriolis terms semi implicitly It only makes sense in coarse resolution gt 5 global models where the time step allowed by the CFL condition does not resolve the inertial period which is 1 2 day at the poles Treating the Coriolis term semi implicitly damps the inertial oscillation and allows a longer time step For global models with A lt 2 the time step allowed by the CFL condition is typically small enough less than 2 hours to resolve the inertial period at the poles and so semi implicit treatment is not needed Consider the simple system for inertial oscillations u fv
502. the coefficients there in the code of MOM 1 and MOM 2 Recall from Equation 16 14 that ztd jrow contains sums and differences involving zu 1 jrow 1 ZUi 1 jrowns ZUi jrow 1 5 and 210 jrown It is in fact the finite difference version of the curl of ZUijrown The details of what is inside of zu jrown are unimportant By Stokes theorem summing this curl over any area leaves only values of zu jrown at the outer boundary These 204 CHAPTER 16 EXTERNAL MODE OPTIONS outer boundary cells are by definition exterior to the island perimeter and contain only known values of 21 The island stream function po can be expressed as a linear combination of all v 2 jrow immediately outside the island perimeter L L L do std 3 C e Ch 16 24 f 1 1 1 In the code of MOM 2 Zui is set to zero on land cells so that XL ztd picks up contributions only from values of zu jrow n in the ocean The solution of Equation 16 1 is determined only to within an arbitrary additive constant null mode If the domain is multiply connected by two or more distinct land masses islands the value of the stream function can be chosen arbitrarily on one of the land masses In MOM 1 the value on the main continent is held fixed at zero and each iteration involved calculating an integral around each other island In MOM 2 this option is retained but it has been determined that the solution conver
503. the grid point within T 1 k jrow These results easily extend to two and three dimensions Mixed double operators such as ark results in a quantity defined on the grid point within cell U k jrow Formal manipulations There is no ambiguity in manipulating finite difference objects As noted in Bryan 1969 there are formal rules and some are given below They can be verified by substituting the basic This is the the longitude of the grid point within U k jrow 112 CHAPTER 11 DISCRETE EQUATIONS finite difference derivative and averaging operators and expanding the terms For illustrative purposes consider one dimensional quantities a and 7 defined on longitudes of T cell grid points and defined on longitudes of U cell grid points ay TPT Tdowd6 a 6 1 11 15 Salai T 6a 11 16 dtji 6 GP B Bi deu az aii 11 17 Da oca T detis bi Ro deui s 02 11 18 These expressions also hold along other dimensions In particular if is substituted for or if z is substituted for A Consider further the two dimensional case where o is defined at T cell grid points and 8 is defined at U cell grid points The following rule may be derived by combining Equations 11 17 and 11 18 gy Qik j dati 6 1 1 Dici j 1dtuica Qi caesi drl 1 6 7 1 1 4 a I irowbe Bias dij ou 169 da uj 16 0 1 5 j 1 11 19 For furth
504. the subcells relevant for each T cell In particular the four terms containing a contribution from 7 are given by 2517 A 7 V 7 6 T 1 AQQV DGST 4 A 2V 2 5 1 A V 5 6 T B 26 where the tracer derivative is assumed the same for the two subcells 7 and 1 and the two subcells 2 and 5 The volumes of the subcells are vos ve TS vo vo ZE B 28 and the derivatives are E B 29 6 0 M B 30 The derivative of the functional is 5 ADV uo AV uL QVO AGO uan OT dazu 4 T1 LU dau B 2 DISCRETIZATION OF THE DIFFUSION OPERATOR 281 which can be rearranged to 5 aT AQ amp T A T amp T a B 32 dart 6 AC 6s Tia B 33 yielding the discretized diffusion operator acting on 7 1 s dat OT R T 6 AG 644 B 34 The averaging operation for the diffusion coefficient is given by AQ AQ AG B 35 A 7 AD AUD B 36 It is this averaging which is the only difference from the discretization derived using more traditional approaches In the isopycnal case the freedom to define the diffusion coefficient differently for each of the subcells will be an important element in ensuring stability of the scheme for large isopycnal slopes The main points to be taken from this example are A The assumption that the tracer gradient is the same across the two adjacent subcells 1 amp 7 and 2 amp 5 respectively B Th
505. thin each Ay grid cell The interpolation is carried out using subroutine ftc which can easily be replaced by subroutine ctf or something else if ocean resolution is less than atmosphere resolution e Set cyclic conditions on sbcatm and convert to units expected by the atmosphere Grid locations given by abcgr and This method is arbitrary However when solving this equation iteratively it is important not to zero out SST from previous solutions over land areas Their purpose is to act as a good initial guess to limit the iterations needed for subsequent solutions 17Partial ocean cells are accounted for to conserve the interpolated value 15 Acronym for fine to coarse resolution It is an interpolation utility in module util 1 Acronym for coarse to fine resolution It is an interpolation utility in module util 98 CHAPTER 10 GENERALIZED SURFACE BOUNDARY CONDITION INTERFACE e Compute global mean of sbcatm j jim The structure of gasbc is arranged such that components can be removed or replaced with more appropriate ones if desired Caveat In the process of constructing sbeatmy jm no attempt has been made at removing small scale spatial features from the grid which could potentially be a source of noise for the atmosphere model 10 1 2 GOSBC Getting surface boundary conditions for the ocean model defined on the grid of mom is the purpose of subroutine gosbc which is an acronym for get ocean su
506. til FE 70 7 Grids 75 7 1 Domain and Resolution 15 7 1 1 Regions 15 7 1 2 15 7 1 3 Describing a domain and resolution 16 7 2 Grid cell arrangement 77 CONTENTS 10 11 7 2 1 Relation between T and U cells lens 7 2 2 Regional and domain boundaries 7 2 3 Non uniform resolution 7 3 Constructing 7 3 1 Grids in two 5 7 4 Summary 8 Grid Rotation 8 1 Defining 8 2 Rotating Scalars and Vectors 8 9 Considerations Topography and geometry 9 1 Constructing the field 2A 9 2 Modifications to KMT 9 3 Viewing results 9 4 Fine tuning Generalized Surface Boundary Condition Interface 10 1 Coupling to atmospheric models 10 1 1 GASBC 10 1 2 5 10 2 Coupling to datasets 10 2 1 Bulk paramete
507. time ago Contained in file mom Contained in file tmngr F Assuming these diagnostics have been enabled by their options at compile time 107 108 CHAPTER 11 DISCRETE EQUATIONS The following description assumes that the idea of a memory window as outlined in Section 3 3 1 is understood Refer to Figure 11 2 and note the four columns Time Step Type of Time Step a partially opened memory window with two disk areas indicated bu column jmw lt jmt and a fully opened memory window with no disk area indicated by column jmw jmt Two sets of indices are required to act as pointers to specific areas on disk and in the memory window one set points to 1 and 1 locations on disk and these indices are named taumldisk taudisk and taupldisk the other set points to 7 1 and 1 locations within the memory window and these indices are named tauml tau and taupl At the beginning of each time step memory window indices are updated as shown schemat ically in the Type of Time Step column The whole idea is to get data positioned properly inside the memory window so that the equations can be solved for various types of time steps with only minimal changes To actually see how disk indices are cycled for various types of time steps enable op tion trace_indices as described in Chapter 18 11 1 1 Leapfrog Consider the partially opened memory window shown in the third column On leapfrog time steps the updat
508. tion can be specified by defining three solid body rotations The angles which define the rotations are usually referred to as Euler angles see Classical Mechanics by Goldstein 1950 or a similar text First define the Z axis to be through the poles such that the X Y plane defines the equator and the X axis runs through the prime meridian In the routines in rotation F the rotation angles are called phir thetar and psir The angle phir is defined as a rotation about the original Z axis Angle thetar is defined as a rotation about the new X axis after the first rotation and angle phir is defined as a rotation about the final Z axis It is helpful to have a globe to look at when thinking about this Imagine that the globe has a clear sphere surrounding it with only grid lines of latitude and longitude By moving the outer sphere the grid poles can be moved to line up with different points on the globe Once the new poles are located two of the rotation angles can be defined as follows The definition for phir is 90 degrees minus the geographic longitude of the new north pole This rotates the Y axis under the new pole To move the Z axis down thetar is defined to be 90 degrees minus the geographic latitude of the new north pole This places the original Z axis though the new north pole position 8T 88 CHAPTER 8 GRID ROTATION To completely define the grid a third rotation about the new Z axis must be specified The rotated grid longitud
509. tion for passive open boundary conditions test from Chap 5 of Stevens 1990 Requires obc north obc south and orlanski The new option no_sbe no surface boundary conditions must also be enabled obctest2 configuration for active open boundary conditions test from Chap 6 of Stevens 1990 Requires obc_south Data for the southern boundary is taken from a run with a larger domain without obc south enabled The following options have been tested with open boundary conditions cray ymp generate a grid read my grid generate a kmt read my kmt flat bottom rectangular box timing restorst source term sponges simple sbc constvmix consthmix biharmonic fullconvect stream function sf 9 point conjugate gradient The following options do not work symmetry with obc north obc south cyclic with obc west obc east 13 3 New Files cobc F This subroutine is used instead of tracer F at eastern and western open boundaries At boundary cells new tracer values are calculated using 13 1 for outflow conditions and restored for inflow conditions only for active open boundary conditions calculate advection velocity vad If there is flow into the region vad is set to zero which indicates restoring only for active open boundary conditions calculate phase speed for tracer cls cln For phase speed into the region cr is set to zero A maximum for is limited by the CFL Criterion e g aA
510. tion implicitumix are mutually exclusive In the following discussion the assumption is that option implicitemir is not enabled When active explicit convection happens in one of two ways If option fullconvect is enabled the scheme of Rahmstorf is used otherwise the older style explicit convection is used In either case when option save_convection is enabled the results of explicit convection can be subsequently analyzed Both explicit convection schemes are explained below 168 CHAPTER 15 GENERAL MODEL OPTIONS 15 13 1 fullconvect The following is taken from notes received from Stefan Rahmstorf on A fast and complete convection scheme for ocean models Imagine having three half filled glasses of wine lined up in front of you On the left a German Riesling in the middle a French Burgundy and on the right a Chardonnay from New Zealand Imagine further that you re not much of a connoisseur so you want to mix the three together to a refreshing drink with exactly the same mixture in each glass The trouble is you can only mix the contents of two adjacent glasses at a time 5o you start off by mixing the Riesling with the Burgundy then you mix this mixture with the Chardonnay then How often do you need to repeat this process until you get an identical mix in all glasses Incidentally putting this question to a friend is a good test to see whether she or he is a mathematician or a physicist A mathematician would answer an infinit
511. tion to help resolve questions of a more scientific nature All are independent of each other and each is activated with its own option at compile time For added flexibility each diagnostic has an associated interval control and possibly an averaging period variable which are input through namelist To see all namelist variables refer to Section 5 4 When not enabled a diagnostic requires neither memory nor computational time When enabled some require large amounts of memory disk or cpu time so it is important to use them cautiously with specific goals in mind The amount of time generally depends on the particular configuration of MOM 2 which diagnostics are enabled the interval between diagnostic output and the averaging period if applicable An assessment of the computational time can easily be made by enabling the required diagnostics along with option timing in a short model execution In addition to the diagnostics listed in the following sections there are numerous debug options in critical areas of the source code which can be enabled to give more information for debugging purposes An example of one of these options would be debug_adv_vel near the bottom of file adv_vel F which computes advective velocities When enabled debug adv vel gives the components of the divergence of advective velocities for all T cells and U cells in the vertical at any i jrow location These debug options can also be found using UNIX grep as
512. tional modes which are introduced by this technique They are handled by either reducing alpha slightly or applying additional time averaging to other prognostic variables Both methods sharply reduce the maximum allowable time step In MOM 2 the Euler backward mixing time step damps the computational modes lor a discussion on when a semi implicit pressure gradient is applicable refer to Killworth Smith and Gill 1984 Their analysis indicates that a semi implicit pressure gradient is applicable for coarse and medium resolution 7 1 deg studies but may not be applicable for high resolution lt 30 km ones In order to apply this scheme for one or more rows within the memory window there must be one additional row of tracers calculated before the internal modes of velocity can be 15 19 MISCELLANEOUS 195 calculated This is because the pressure gradient which is defined on U cell latitude rows requires an average of four surrounding densities which are defined on adjacent T cell latitude rows Although strictly not a fourth order option this extra computed tracer row requires that option fourth order window must also be enabled This is automatically done when op tion pressure gradient average is enabled For the minimum fourth order window configuration with jmw 4 tracers are computed for rows 2 and 3 while velocities are only computed on row 2 To accommodate this starting and ending rows for tracer calculations are given by 2
513. tions are as given above and the centering coefficients are given as e implicit free surface method Centering coefficient apgr alph If solving the Coriolis term explicitly acor 0 then centering coefficient gcor 1 If solving the Coriolis term implicitly acor 0 then acor is reset to acor alph and centering coefficient gcor gam 16 8 IMPLICIT FREE SURFACE 211 e rigid lid surface pressure method Centering coefficient apgr alph If solving the Coriolis term explicitly acor 0 then centering coefficient gcor 1 otherwise gcor 0 Mixing time steps Forward and Euler backward The equations for forward mixing time steps and the first step of an Euler backward are modified to 1 Tap row UF ow 16 58 lo Vijrow oga row Tue unm 16 59 Usjrow 2AT 2Uijrowa 16 60 TUM 7 Vi jrow 2AT ZU jrow 2 871 jrow 1 16 61 The equations for the second step of an Euler backward are modified to iirow OV ise Uf iow 16 62 Vijrow ease VIL 16 63 i 2AT 2Uijrowa xor A o theta SI suc theta 16 64 Vijrow 2AT 2Uj jrow 2 A theta Ds theta 16 65 In both cases of mixing time steps the time step factor 2A7 is replaced by Ar also in w and the centering coefficients are given as e implicit free surface method Centering coefficient apgr theta Cen
514. tity explicit convection comes from solving Equation 18 122 before and after explicit convection The equation for the kth grid cell in station m is given by 9 t bti gt tebteknmth 18 197 2 Note that terms 2 3 and 4 are the flux form of advection When summed up they represent the physical advection in the cell However when taken separately they do not represent the physical advection in A z because they contain divergent components The physical advection in A 2 is given below by terms 11 12 and 13 L 1 ado vet adv vet 4A tebtiiknmth T Y lius L ADV 18 198 Lo drt COS L 1 ado g adv k i i FY tiene 1 ADV 18 199 L 2 J dytjrow COS Pr row j L 1 ado vbt 4 adv k t bti3 k nmth M ADV 18 200 L 21 21 L 1 tebtis k nmth T 18 201 1 L 1 tzbts f Sl fj in 18 202 Pn th I gt fij When options isopycmiz and gent mcwilliams are enabled Equations 18 198 18 199 and 18 200 also include the advective or transport velocities from option gent mcwilliams given by adv adv vntiso and adv vbtiso p j respectively Term 15 represents the average tracer within the cell and term tzbtsf represents the surface tracer flux acting on the top of the surface cells Chapter 19 Getting Started This chapter describes what is needed to start using MOM 2
515. to cf77 f90 if a Fortran 90 compiler is used Although the script can be executed from the MOM 2 directory it s a safer practice to use MOM_UPDATES directory for each experiment as described in Section 19 6 Copy both run_grids and file grids F into the MOM_UPDATES directory and make changes there To define a grid go to the USER INPUT section of module grids After reading the information in this chapter and looking at the examples given in module grids implementing a grid design should be straightforward About the only potential problem might be that a particular specification leads to a non integral number of T cells within a region Recall that the number of T cells can be found by dividing the span of the region by the average resolution Either the position of the bounding coordinates or the resolution at these coordinates may be changed to resolve the problem In the USER INPUT section the bounding coordinates are specified by variables lat and z depth Variable x lon is dimensioned by parameter nzlons which gives the number of bounding longitudes to define one or more regions in longitude Units are in degrees of longitude measured at the equator and these points define the longitude of U grid points Refer to Figs 7 1 7 2 and 7 3 which indicate U grid points on bounding coordinates with an integral number of T cells inbetween Similarly variable y latis dimensioned by parameter nylats which gives the number of bou
516. to than the older one Refer to Section 6 2 4 for a description and details It can be tested in a stand alone mode by setting the PLATFORM variable in script run iomngr new and executing The older I O manager is marked for extinction so it is important to test this newer one on various platforms which do not exist at GFDL 19 4 Accessing MOM 2 MOM 2 is kept on the anonymous ftp at GFDL It can be accessed with the following steps ftp ftp gfdl gov To reach GFDL s anon ftp use ftp as your login name and your e mail address as your password cd pub GFDL MOM2 Change to the pub GFDL_MOM2 directory get MOM2 2tar Z Copy the version of MOM 2 to a directory at your site quit disconnect from the ftp uncompress MOM2 2tar Z Expand to MOM2 2tar tar xvf MOM2 2tar Extract and build the 2 directory structure on your disk MOM 2 2tar Z is the code file and takes approximately 1 5MB of diskspace The uncompressed version takes approximately 5MB Note that directory MOM 2 not MOM 2 2 will be built when the tar file is extracted A database is also included as part of MOM 2 While in the pub GFDL MOM directory do a cd DATABASE to get into the DATABASE directory This DATABASE directory contains approximately 160M B of IEEE 32bit data files which are described in Chapter 4 Either selected files or all files can be retrieved with the get command as in the anonymous ftp example given above It is best to copy the files one at a time The amount of
517. to the time step level required by MOM 2 as described in Section 10 2 3 ATMOS contains subroutines that prototype what must be done to couple MOM 2 to an atmosphere model for the general case of two way coupling when resolution and land sea areas do not match The atmosphere model is unrealistic It is intended only to show that essentially two things must be done a boundary condition grid must be defined to match the atmospheric grid which is assumed to be different from the MOM 2 grid resolution and boundary conditions such as winds and heat flux must be accumulated in arrays as indicated The option used to configure this type of surface boundary condition for MOM 2 is coupled which is explained further in Section 10 1 e NETCDF contains fortran routines written by John Sheldon at GFDL for interfacing to lower level netcdf routines These lower level routines are resolved by linking to the appropriate NetCDF libraries which will be site specific The proper linking to these libraries at GFDL is given in script run mom For other sites the appropriate links will have to be made by the researcher MOM 2 uses wrapper utilities of its own which access Sheldon s files to further simplify and unify writing NetCDF related code These utilities are in file util netcdf within the MOM 2 directory The NetCDF section of any diagnostic can be used as a template to add NetCDF capability to new diagnostics For further information refer to Section 18 2
518. tors the tracer is computed directly as lk 1 2AT DIFF Tx kj DIFF T yiki DIFF ADV ADV ADV source k tmask kj 11 73 122 CHAPTER 11 DISCRETE EQUATIONS When options isopycmir and gent mewilliams are enabled the right hand side of Equation 11 73 also includes the flux form of the advection terms given by Equations 11 67 11 68 and 11 69 In effect combining Equations 11 64 and 11 72 gives the total advection as in Equation 11 71 Implicit vertical diffusion In general vertical diffusion is handled implicitly when using option implicitumix or op tion isopycmiz In either case Equation 11 73 is solved in two steps The first calculates an explicit piece I a using all terms except the portion of vertical diffusion which is to be solved implicitly The equation is likdn g id 2AT DIFF Tx kj DIFF 1 aidif DIFF Tiki ADV Ti ADV ADV source k j tmaski kj 11 74 U kin where aidif is the implicit vertical diffusion factor Setting aidif 1 0 gives full implicit treatment and setting aidif 0 gives full explicit treatment for the vertical diffusion term Intermediate values give semi implicit treatment The second step involves solving the implicit equation lk I dan 2Ar 6 aidif diff_cht z tik jnr 1 11 75 Notice that ti k 7 1 appears on both sides of the equation So
519. ts are completed Using asynchronous time segments is possible with a small code modification but this is left to the researcher y as un ni un uui mm e EM time segment 2 time segment 3 Time _ Figure 10 1 Schematic of two way coupling between an atmosphere model ATMOS and an ocean model MOM showing time segments In MOM 2 and in the descriptions that follow index 7 refers to any variable dimensioned by the number of rows in the memory window and index jrow refers to any variable dimensioned by the total number of latitude rows They are related by an offset jrow j joff which indicates how far the memory window has moved northward Refer to Section 5 2 and also 3 3 2 with Figure 3 4 for a more complete description 10 1 1 GASBC Getting surface boundary conditions for the atmosphere model defined on the atmosphere grid is the purpose of subroutine gasbe which is an acronym for get atmosphere surface boundary conditions All of the surface boundary conditions are two dimensional fields defined in longitude and latitude at model grid points In the ocean all quantities which are to be used as surface boundary conditions for the atmosphere are defined on the T jrow grid in array SDCOCTu grow mn time The first set of surface boundary conditions for the atmosphere are products of setocn Where for example an ocean segment is much longer than an atmosphere segment This assumes the couple
520. ty gradients must be evaluated in terms of the active tracer gradients in order to provide for a zero along isopycnal flux of locally referenced potential density Special care must be taken when choosing the reference points for evaluating these gradients and the details are given in Section B 2 6 As shown in Griffies etal 1997 without a proper discretization which guarantees a zero flux of locally referenced potential density the isopycnal diffusion operator will be unstable even if it ensures variance does not increase 5o both properties are essential B 0 3 Full isopycnal diffusion tensor Traditionally the implementation of isopycnal diffusion has been with the small slope approx imation made to the full tensor Cox 1987 Gent and McWilliams 1990 This approximation is justified in a large part of the world ocean since slopes larger than 1 100 are thought to be uncommon However the restrictions placed on the numerical realization of slopes larger than 1 100 are ad hoc and do affect the solution s integrity In particular the assumptions one makes about the slope checking can significantly influence the rates of ventilation As models become more advectively dominant as can now be realized with advection schemes such as FCT the slopes associated with strong currents can reach greater than 1 100 in many reagions not asso ciated with convection Additionally recent studies indicate that the effects of mesoscale eddies are important in r
521. ude filtering in global grid point models Monthly Weather Review 111 2005 2015 Treguier A M 1992 Kinetic energy analysis of an eddy resolving primitive equation model of the North Atlantic Journal of Geophysical Research 97 687 701 319 Treguier A M J K Dukowicz and K Bryan Properties of nonuniform grids used in ocean general circulation models Submitted to Journal of Geophysical Research 1995 Turner J 1963 General circulation experiments with the primitive equations I The basic experiment Monthly Weather Review 91 99 164 Turner J 1973 Buoyancy effects in fluids Cambridge University Press Weaver A J and E 5 Sarachik 1990 On the importance of vertical resolution in certain ocean general circulation models Journal of Physical Oceanography 20 600 609 Wajsowicz R C 1993 A consistent formulation of the anisotropic stress tensor for use in models of the large scale ocean circulation Journal of Computational Physics 105 333 338 Webb D J 1995 The Vertical Advection of Momentum in Bryan Cox Semtner OCean General Circulation Models Journal of Physical Oceanography 25 3186 3195 Zalesak 5 T 1979 Fully multidimensional flux corrected transport algorithms for fluid Journal of Computational Physics 31 335 362 D 0 8 Numerical Arakawa A 1966 Computational design for long term numerical integration of the equations of fluid flow Two dimensional incompressible flow
522. ude index jrow ocean depth is discretized into the number of vertical grid cell thicknesses levels that most nearly approximates the ocean depth The resulting field of model levels is the base kmt j ow field To specify geometry and topography one and only one of the options described below must be enabled e rectangular box constructs a flat bottomed rectangular box with kmt jrow km deepest level for all interior points on the grid i 2 imt 1 and jrow 2 jmt 1 while setting 89 90 CHAPTER 9 TOPOGRAPHY AND GEOMETRY kmt jrow 0 on all boundary cells Enabling option cyclic turns the box into a zonally re entrant channel idealized_kmt constructs an idealized version of the earth s geometry Continental features are very coarse but map onto whatever grid resolution is specified by module grids They are built with the aid of subroutine setkmt which approximates continental shapes by filling in trapezoidal areas of kmt jrow with zero The bottom topography has sinusoidal variation which is totally unrealistic It is intended only to provide a test for the numerics of MOM 2 Since this option generates geometry and topography internally no external data is required and therefore the DATABASE explained in Chapter 19 is not needed Typically this option is useful when researching idealized geometries and topographies since arbitrary ones can be easily constructed Also this is useful when porting MOM 2 t
523. ude rows within the memory window The group may be as few as one or as many as jmt 2 latitudes The number of groups depends on the size of the memory window and each group is solved one at a time until all groups have been solved The subroutines called for each group of latitudes as outlined in Figure 11 1 are explained in the following sections The reader is referred to Chapter 5 for a description of the variables Chapter 7 for a description of the grid system and Chapter 3 for a description of the memory window The following finite difference averaging and derivative operators are used to discretize equations on the grid system Before going further the grid system should be firmly in mind Averaging operators A T Ck 5 11 3 e Aik jt T Aik j OKJ E EE 11 4 Qi ktl j T Cg au 5 11 5 5 can be eliminated by recalculating the pointers differently on the time step after the Euler backward step However the calculation gets tricky and has complications Requiring three rows in the memory window Requiring jmt rows in the memory window T he subscript jin the operators is replaced by jrow when is dimensioned by the total number of latitudes 110 CHAPTER 11 DISCRETE EQUATIONS where a is any variable defined on grid points within T cells or U cells It should be noted that the average is defined midway between the variables being averaged The derivative operators in space and tim
524. umix is enabled then it is the explicit part of the vertical diffusion This is a non standard Fortran 77 feature that is very useful Most compilers support it Refer to any Fortran manual for usage 52 5 4 1 CHAPTER 5 VARIABLES Time and date Namelist ictime These variables are for use setting the time and date for initial conditions referencing diagnostic calculations and related items year year of initial conditions integer monthO month of initial conditions integer day day of initial conditions integer hour hour of initial conditions integer 0 minute of initial conditions integer 0 second of initial conditions integer ryear user specified reference year integer rmonth user specified reference month integer rday user specified reference day integer rhour user specified reference hour integer rmin user specified reference min integer rsec user specified reference sec integer refrun Boolean used to specify that the time and date to be used for calculating diag nostic switches is the starting time and date of each submitted job For example suppose each job submission integrates for one month starting at the beginning of a month but the number of days per month changes Setting refrun true and setting timavgint days in month 3 will give 3 averaged outputs per month at intervals of approxi mately 10 days each The averaging pe
525. understanding this documentation will allow the researcher to take a big step towards gaining a working knowledge of MOM 2 Apart from renaming of variables the next thing to notice is that a latitude been added to expose all indices of arrays in MOM 2 Although the organization of the code bears similarity to MOM 1 this added j index results in fewer variable names being required and triply nested do loops replacing the doubly nested loop structure in MOM 1 It also allows the slab architecture of MOM 1 to be extended to a more general memory window structure which permits solving equations on one or more latitude rows at a time This has implications for parallelization and simplifies incorporating parameterizations such as fourth order accurate schemes flux corrected transport schemes etc which require referencing data from more than one grid point away For such parameterizations the memory window is simply opened up to contain four latitude rows as opposed to the usual three In the limit when enough central memory is available the memory window can be opened all the way to contain all latitude rows in which case all data is entirely within central memory there is not disk and therefore no movement of data between central memory and disk Also in contrast to a partially opened memory window there are no redundant computations necessary The main point is that all arrays and equations look the same regardless of the size of the mem
526. ure 11 2 16 2 2 Remarks It should be noted that Equation 16 36 only requires a Neumann boundary condition at the boundaries instead of the Direchlet boundary condition required for the elliptic equation of the stream function method The implication is that there are no island equations to be solved and hence this method should be faster than the stream function method on massively parallel computers The second point to be made is that Equation 16 36 contains a factor H jrow whereas the elliptic equation for the stream function contains the factor 1 H jrow which should make this method less prone to stability problems than the stream function equation when topography contains steep slopes The third point to be noted is that the barotropic velocities UT don and VS given by this method are not non divergent The degree of non divergence is related to how accu rately Equation 16 36 is solved for the change in surface pressure Aps and the accuracy depends on the tolerance variable tolrsp which is input through namelist and typically set to 107 gram cm sec Refer to Section 5 4 for information on namelist variables Use of polar filtering on and V leads to a problem Removing the filtering eliminates the problem So the filtering has been removed for this method 16 8 IMPLICIT FREE SURFACE 209 16 3 implicit free surface Option implicit free surface enables the method developed by Dukowicz and Smith 1994 which is hereafter r
527. ure 3 6 Example of dataflow between disk and memory for one timestep with a memory window size of jmw 5 and the biharmonic option in MOM 2 34 CHAPTER 3 DATAFLOW E epe jron disk Read from disk to MW Memory to memory Calculated Row j in the MW b Offset between jrow and j written back to T 1 jrow ROP Figure 3 7 Schematic of dataflow between disk and memory for one timestep with a memory window size of jmw 5 in MOM 2 3 5 PARALLELIZATION 35 Read writes between disk and MW 5 R C P Figure 3 8 Schematic indicating that disk space reads writes and memory to memory copies are not needed when the memory window size is jmw jmt in MOM 2 36 CHAPTER 3 DATAFLOW T 1 Disk Processor 2 Memory 7 1 Disk ia Figure 3 9 Loading the memory from disk updating the central row and writing results back to disk Note that disks are logically divided into two sections 3 5 PARALLELIZATION 37 MOM 1 design MOM 2 design Processor 1 Slab Window 2 b IB we we and D wc c ML m 20400 148 M2 M1 amp 1 3 1 2 3 4 5 10 100 m D 1 0 1 5 15 gt T1 Disk Figure 3 10 a Redundant rows in coarse grained windows b Comparing memory requirements between fine and coarse grained approaches c Dataflow for fine grained approach 38 CHAPTER 3 DATAFLOW Code Structure
528. used instead of data prepared in PREP_DATA The meridional width of the sponge layer spng width is hard wired to 3 degrees and the reciprocal of the damping time scale spng damp is hard wired to 1 5 days Their purpose is to damp Kelvin waves in idealzed equatorial models As indicated in Section 19 5 use UNIX grep to find their location if changes are to be made The current implementation uses data defined at the latitude of the northern and southern walls as the data to which the solution is damped This data varies monthly but the annual mean values can be used instead by setting variable annlev in the namelist Refer to Section 5 4 for information on namelist variables The width of the sponge layers is determined by a Newtonain damping time scale that is a function of latitude and set in subroutine sponge which is executed by script run_sponge If a more realistic sponge layer is desired data from latitude rows within the sponge layers needs to be saved instead of just the data at the latitude of the walls This is a bit more I O intensive and is not an option as of this writing Refer to Sections 19 6 and 11 10 5 for further details Note that this script can only be run after script run_ic which prepares temperature and salinity data for all latitude rows 15 11 FILTERING 163 15 10 5 obc Open boundary conditions are based on the methodology of Stevens 1990 There are two types of open boundary conditions active in which the
529. ut not modules Nevertheless it is desirable to make modules where reasonable and an example of one is grids described in Chapter 7 Refer to Figure 6 1 for a schematic of the anatomy of a module in MOM 2 As an example consider this imaginary module named example which is contained within an imaginary file named example F Enabling a specific ifdef option at compile time would allow the module to run in stand alone mode This means that one of its internal subroutines becomes a driver composed of code fragments and calls to the remaining internal subroutines in the module The driver exercises these internal subroutines in a simplified environment by supplying a set of inputs and producing output that can be verified If the specific ifdef option were not enabled the code for the driver would not be compiled and would add nothing to the load module In this case MOM 2 would assume the role of driver by supplying necessary input As indicated subroutines may have an input output list In practice this may be an argu ment list include files containing common blocks or a combination of both Deciding which one is best is a matter of judgement When the input output list is short it makes sense to implement items as an argument list since this allows great portability However when the input output list is long passing variables through many levels of subroutines is awkward at best and a nightmare at worst Common blocks allow easy access to varia
530. vated on the current time step and which are not Each event has an associated logical switch which is kept in file switch h An event might be something like writing a particular diagnostic for analysis or doing a mixing time step etc After determining all logical switches call is made to the diagnostic initialization subroutine diagi which performs initializations for various diagnostics when required 11 1 Time Stepping Schemes Numerically there are three types of time step schemes used within mom The normal one is a leapfrog scheme which is centered in time The others are mixing schemes intended to damp time splitting characteristic of schemes centered in time Whether it s a mixing time step or not is determined by a logical switch mizts set within module tmngr The type of mixing scheme is input through namelist as logical variable eb which if true indicates an Euler backward mixing time step otherwise a forward mixing time step will be used Refer to Section 5 4 for information on namelist variables Of the two mixing schemes the Euler backward is more diffusive than the forward It also damps spatial scales whereas the forward scheme does not Haltiner and Williams 1980 The focus here will be to explain how these schemes are implemented within mom Mixing timesteps in the predecessors of MOM have been set at multiples of 17 since prehistoric times This number seems to satisfy most people and has been empirically established long
531. ve been improved many new ones added such as reconstructing the surface pressure from the stream function calculating particle trajectories time averaged fields xbt s etc and all are described in Chapter 18 The prognostic surface pressure and implicit free surface methods of Dukowicz and Smith 1993 1994 and the isopycnal thickness diffusion of Gent and McWilliams 1990 are part of MOM 2 There are also more options for configuring MOM 2 as described in Chapter 15 and many other little features and code improvements too numerous to summarize here but covered in this manual Newest features Some of the differences between MOM 2 version 1 and version 2 are as follows All diagnostics have been given an interface to generate NetCDF formatted output as described in Chapter 18 The NetCDF format allows easy access to results without writing intermediate analysis code good way to visualize results is to use Ferret which is a graphical analysis tool developed by Steve Hankin 1994 at NOAA PMEL email ferret amp pmel noaa gov URL http www pmel noaa gov ferret home html An option for coarse grained parallelism mi crotasking has been added which makes more efficient use of multiple processors than the fine grained autotasking approach as discussed in Chapter 3 This has relevance on platforms such as the CRAY T90 when using tens of processors n improved isopycnal mixing formulation based on a functional approach employing a new approxim
532. w 3 This is the minimum sized memory window appropriate for one processor and is represented by a schematic of the form given in Figure 3 3d As indicated in Figure 3 4 two time levels of three dimensional prognostic data reside on disk in latitude rows from the southernmost jrow 1 to the northernmost jrow jmt Initially the first three latitude rows for two time levels are read into the memory window the central row is updated to 1 and written to the second row on the 1 disk The memory window is moved northward one row by copying the top two rows and 1 into the bottom two rows and reading latitude row jrow 4 from the and 1 disks into row 7 3 in the memory window The ordering of the copies is important otherwise the second copy will destroy results from the first copy The process is repeated calculating central row j 2 and writing it to the 1 disk The circled number represents the offset joff relating the latitude row jrow on disk to the local row j in the memory window The value of joff is an indication of how far the memory window has been moved northward Refer to Section 5 2 for a description of how joff relates to variables To actually see how the memory window operates for various values of jmw disable all diagnostics in script run mom enable option trace indices set the integration time to a few time steps and execute run mom as described in Section 15 19 Alternatively
533. w 1 0 giving good approximations to the continuous derivatives in the A direction The resulting summations are 1 0 0 cos QU H jrow j PILLS jn E iU jrowt 3 YU 0 j 0 i j 0 0 Mea M i Aiti jrow d jrow y ae jn 7 2 0 j 0 i j iti jrow y dau in cos EY E 17 13 Bryan 1969 uses a five point approximation to E which as implemented in MOM 1 takes the form 1 cos dyt jrow U cos Pjrow 1 gt Hi 4 jrow 1 dYUjrow 1 1 vt dYUjrow 1 fases dytjrow dat by dau 4 6x AVi 1 jrow Hi 4 jrow 1 COS Pirow dau 17 14 In this notation the five point approximation used in MOM 2 takes the form d 97 LUj_1 COS 1 dul 110 row date a e Ea ND a 2AT Yojrow zu YUjrow 1 WPi jrow 1 E E dYUjrow 1 dat 6 dry AAi row Hi 4 jrow 1 COS Pj row 1 da uia 17 15 218 CHAPTER 17 ELLIPTIC EQUATION SOLVER OPTIONS For comparison with MOM 2 Bryan s form must be multiplied by cos 4 det dytjrow 2AT jrow The principal differences between these two forms arise from Bryan s use of averages of recip 2 1 rocals of the form where MOM 2 uses These differ Hi jrow 1 2 Hra Hoo by a factor of two in the second order
534. wards gaining a working knowledge of MOM 2 1 1 5 Coding efficiency Inevitably the size of a research model increases with time However economy of code is always desirable Voluminous coding to support issues which are not central to science accumulates 15 levels Changes in the external mode of MOM 1 were necessary to assure the same accuracy as in MOM 2 and there were no diagnostics enabled MOM 2 ranged from 3 slower to 6 faster depending on size of the memory window than MOM 1 Minimum memory configuration in MOM 2 was 1 greater than in MOM 1 1 1 OBJECTIVE 3 and if not restrained starts to account for the bulk of model code This practice is to be discouraged although there is fine line to be drawn and the answers are not always unambigu ous The question to be asked is How much code is this idea worth and can it be justified with respect to the prevailing level of scientific approximations being made Some areas within MOM 2 have become overly large and complex but with questionable gain As time permits simplifications will follow 1 1 6 Ability to upgrade It is vitaly important for researchers to be able to incorporate code changes which may be of interest personally but not appropriate for general dissemination into newer versions of a model It is in this way that researchers are able to take advantage of new parameterizations while retaining local personal changes Also of importance is the ability to incorporate
535. wer one in the model add option new iomngr to script run mom 6 2 LIST OF MODULES 65 If the newer I O manager does not work properly on a particular platform supply the needed fix and report what change was necessary Enabling option debug will help pinpoint a problem if it arises If changes can be kept simple and clear they will be incorporated at GFDL for all to use Only useful basic file attributes used within MOM 2 are allowed in this newer I O manager and should be built into the driver for testing with script run iomngr new When the older version is eliminated file iomngr F will be reduced in size and file iomngr h will go away The interface to subroutines is much the same as in the older version except that no abbre viations are allowed As an example consider writing data to a file named test dta which is to be a sequential unformatted file The following call call getunit nu test dta sequential unformatted rewind finds a unit number nu which is not attached to any other opened file assigns it to file test dta and performs an open statement with the requested file attributes After writing data to unit nu the unit can be closed and the unit number released with the following call call relunit nu The file may subsequently be opened with an append attribute using call getunit nu test dta sequential unformatted append to append data after whic
536. xamining the results file indicates that everything is as intended copy file timeavgs h from MOM 2 to EXP ATLANTIC MOM UPDATES and make the indicated parameter changes 19 10 Executing the model Once the steps in Section 19 9 have been taken make a copy of script run mom or script run mom sgi if executing on a workstation change pathnames to point appropriately and add the desired options from Chapter 15 Any options used in scripts run_grids and run_topog must also be in cluded in the run mom script If not executing on a CRAY T90 use option sgi option cray_ymp or option cray_c90 in script run mom To keep things simple make a short test run with op tions time step monitor snapshots and netcdf to produce a snapshot of the data Have a look at the data using Ferret Section 18 1 After a successful test run enable the desired diagnostic options and disable option timing As mentioned previously this script was written for a CRAY T90 at GFDL which assumes an f90 compiler If not using an f90 compiler refer to Section 19 2 Changes required to run on a workstation are relatively few Script run mom sgi is included as an example of a script which runs on SGI Indigo workstations using a Fortran 77 compiler at GFDL Compare run mom and run mom sgi to see the differences Production scripts Production scripts are left to the researcher although they can be modeled after run mom At the minimum commands must be added to a
537. xes do not map well into Fortran and are not used in this manual The idea is that by looking at this manual it should be possible to determine if the code is wrong or vice versa Rules for using operators In general finite difference derivative and average operators don t commute unless the grid resolution is constant Also the finite difference derivative operator doesn t distribute unless the grid resolution is constant Assuming that is defined at grid points within T cells then the above conditions are illustrated as J aE aus 11 11 Ou T 11 12 How is a term like evaluated It can be expanded from the inside out as L Ok T 0041 6 Oipnkg TOdp2k Vik yg TOig 2 2 dzt i41 Qit2 k j Qi k j 11 13 2 datis4 or from the outside in as EN OL Ok Make Ss Oiplkg EAit2 kj Orig _ 2 1 E2 k j Qi ki 11 14 2 datis4 however evaluating from the outside in requires careful attention to where quantities are de fined This is particularly true for grid distances note the use of dzt 1 Also it is worth remembering that the results of operators are displaced by the distance of a half cell width For example the single operator results in a quantity defined on the eastern face of cell T k jrow and the double operator 6 6 a 4 results in a quantity defined at
538. xt fastest are the low frequency external mode barotropic Rossby basin scale waves with c pr where k 7 and 27 zonal and meridional wavenumbers These might be expected to limit the time step but will not if sufficiently resolved by the grid as they arein most resolutions Actually Equation 5 1 applies only at the smallest grid scales 2Az and the eastward traveling short Rossby waves travel much slower The next fastest waves to contend with are the high wavenumber internal mode gravity waves and the non dispersive Kelvin wave They are the appropriate wavespeeds for calculating timesteps The fastest internal gravity wave speed is c 3 m sec Note that the speed of the fluid is also dependent on subgrid scale parameters In some models wavespeed is not the limiting factor for determining timestep length In models with vertical resolution of approximately 10 meters thick the time step may be limited 5 1 5 4 NAMELIST VARIABLES 55 by vertical velocity near the surface in regions such as the equator In any event it is recom mended that diagnostic option stability tests be enabled to show how close the model is to the local CFL condition and where that position is located Large vertical diffusion coefficients can also limit the timestep length and when this is the case option implicitemix should be enabled to solve the vertical diffusion components implicitly Here are some rough examples from models run at GFDL
539. y i 1 Fip t 1 p k 6T a abs p 1ip ES 6 T _14ip krkr t 1 7ip k 20 1 ip k kr which becomes the zonal difference upon averaging the y difference in the denominator dxt cos 1 dyt 5 0 1 1 5 dz kr 5 Aa r9 1 Ale kr 1 L ip k ip 0 6 71 6 0 M y BY coa OP gl y i 1 ip k vPi 14ip k j uj 6 224 20 1 ip k kr Introducing the volume factor Vr and shifting the kr sum this difference becomes t i tP t 1 uu x dzwi ik EE Gi 1 ip ko 1 1 1 i 1 ip 1 1 us NES zTi Lip k 14kr e p 1 i p i 1 ip i 1 ip k i 1 ip Sep Lk n a 5 j9 0 1 6 Gite es y 6 i Lip y B 225 VP i 1 ip k j 14 jq zPi 1 ip k 1 kr 304 APPENDIX B ISOPYCNAL DIFFUSION Recombination of terms in the y z plane The y z plane is done similarly to the z x plane Its solution can be read from the z x solution with the appropriate index and cos changes The result is Vr 1 1 6 cos oU 4 iu dyuj 14 kr j 14 jalk 1 9 4 p dyt p 1 ckr j k 1 kr LUN 1457 ES y Tk 1er j TED E 1j T j 1 F3q 4 k 1 4 kr j k 1 kr j k 1 kr j 5 Z ip 0 1 6 vi pes 1 0 lckr 1 5 1 7 VT dzw r Ay Eita k j 1 k 1 kr j 1 j 4421 cos u x mi
540. y this is only one of many ways to do the discretization Instead of averaging Richardson numbers another way is to compute Richardson numbers viscosity and diffusivity coefficients at the base of U cells and then average the diffusivity coefficients onto T cells A third way is to compute separate Richardson numbers at the base of cells and U cells after which the mixing coefficients are computed However all three approaches have a a computational null mode and are therefore discarded as potentially troublesome Refer to Appendix C for a discussion of null modes Two remaining approaches are as follows The first involves computing Richardson numbers at the base of T cells averaging to the base of U cells then computing mixing coefficients at the base of T cells and U cells The second involves computing Richardson numbers at the base of T cells computing both mixing coefficients at the base of T cells and then averaging the viscosity coefficients onto U cells Based on a combination of analytic and numerical results at GFDL by Anand Gnanadesikan the latter way is most accurate has no computational null mode and is therefore the approach that is followed below When option ppumiz is enabled module ppmiz is called to compute the vertical mixing coefficients The Richardson numbers and mixing coefficients are calculated at the bottom of T cells grav 6 pi i 1 rt s M _ 15 40 6 ui 1 5 j 1 7 1
541. y and therefore the DATABASE is not needed This is similar to the test case for MOM 1 The results are in file EXP TEST CASE printout 0 gfdl e CASE 1 is similar to CASE 0 except uses time mean surface boundary conditions from SBC TIME MEAN which are assumed to have been prepared using scripts run sbc and run_ic in PREP_DATA These surface boundary conditions are a function of longitude and latitude but independent of time The results are in file EXP TEST_CASE printout 1 gfdl e CASE 2 is similar to CASE 0 except uses time varying surface boundary conditions from SBC MONTHLY as described in Section 19 6 which are assumed to have been prepared using scripts run_sbe and run ic in PREP_DATA The surface boundary conditions are linearly interpolated to each time step as the integration proceeds The results are in file EXP TEST_CASE printout 2 gfdl e CASE 3 is similar to CASE 0 except uses surface boundary conditions supplied by an idealized atmospheric model as described in Section 19 6 This illustrates coupling MOM 2 to an atmospheric GCM The results are in file EXP TEST_CASE printout 3 gfdl 19 7 1 The run mom and run mom sgi scripts As mentioned previously script run mom is a UNIX C shell script which executes the MOM 2 four test cases 0 1 2 and 3 on the CRAY T90 at GFDL A corresponding script run mom sgi is included for SGI workstations Near the beginning of script run mom pathnames point to where all required dire
542. y being interpolated is constant over the entire atmospheric grid cell For exact conservation the value in each ocean cell is just an integral of the atmospheric quantity over the area of the ocean cell It would be a matter of writing a subroutine to do it and substituting this subroutine for the call to ctf e Set cyclic conditions on sbc0enj jrow m and convert to units expected by the ocean MOM 2 expects units of cgs e Compute global mean of sbcocn jrow m Caveat In the process of constructing sbcocn jrow m no attempt has been made at removing small scale spatial features from the grid which could potentially be a source of noise for the ocean model 10 2 Coupling to datasets In Section 10 1 the general case of two way coupling to an atmospheric GCM was consid ered It is also useful to drive mom with atmospheric datasets representing simpler idealized atmospheres One problem with doing this is that datasets act as infinite reservoirs of heat capable of masking shortcomings in parameterizations which only become apparent when two way coupling is allowed Nevertheless driving ocean models with surface boundary conditions derived from datasets is useful These datasets can be thought of as simple atmospheres prepared a priori such that data is defined at grid locations expected by mom for surface boundary conditions All spatial interpolations are done beforehand as described in Section 19 6 In this case subroutines gasbc and goab
543. y one of three options stream function described in Section 16 1 prognostic surface pressure described in Section 16 2 or implicit free surface described in Section 16 3 Refer to the above sections for details 11 14 diago After the external mode has been solved the remaining diagnostics can be calculated and written out This is done in subroutine diago and described in Chapter 18 32 Contained in file tropic F 33 Contained in file diago F 11 14 DIAGO 131 eeeeeeTncrement time by timestep eeeeeeTritialize diagnostics do mw 1 maxmw eeefolve eguatians far each group of latitudes cad MW with latitude rows from disk eeeeeeCcmpute advective velocities eeeeeeCcimpute isopycnal mixing tensor eeeeeeCcimpute vertical mixing coefficients eeeeeeCcimpute horizontal mixing coefficients eeeeeeSct vertical boundary conditions eeeeeeSo ve the tracer equations eeeeeeSo ve the baroclinic equations eeeeeeCCcmpute diagnostics eeeeeeWrite computed MW latitudes back to disk end do eeeeeeSo ve barotropic equations eeeeeeOutput diagnostics Figure 11 1 Flowchart for subroutine mom F showing order of components 132 CHAPTER 11 DISCRETE EQUATIONS Figure 11 2 Time discretization used in MOM 2 when memory window is partially opened and fully opened components 11 14 DIAGO 133 dyu Bi dyu d das dyu row Figure 11 3 a Advective velocities on a T cell b Advective velocities o
544. y or implicitly The implicit treatment is appropriate when large diffusion coefficients or small vertical grid spacing limit the time step Explicit vertical diffusion Using the above operators and flux terms calculated previously the time derivative of velocity is computed by including all terms except the unknown surface pressure gradients exerted by the rigid lid at the ocean surface If the vertical diffusion term is handled explicitly then the time derivative of velocity is given by Ukin DIFF Uy gj DIFF DIFF metric pj ADV Ut y ADV ADV U zipi ADV metric grad pi jn TCORIOLIS source p umask kj 11 110 Implicit vertical diffusion When solving the vertical diffusion implicitly option implicitemix must be enabled and the implicit diffusion factor aidif is used The vertical diffusion operator in Equation 11 100 is replaced by DIFF Uziy 1 L Zik 11 111 and the time derivative of velocity is computed in two steps The first computes the derivative as Upin DIFF DIFF DIFF metric pj ADV Ux x ADV metric grad pi jn TCORIOLIS source p umask kj 11 112 128 CHAPTER 11 DISCRETE EQUATIONS Dd 18 constructed as and an intermediate velocity u UD s Ui k 1 2AT 11 113 The next step s
545. y setup to do the test case Typically though only run scripts need be copied into this directory to alter pathnames near the beginning of the scripts which point to where interpolated initial conditions and surface boundary conditions are to be written The scripts are then executed from this directory on the CRAY T90 to build the interpolated DATABASE appropriate for the resolution specified by module grids 19 7 The MOM 2 Test Cases MOM 2 is executed by a CRAY T90 script run mom which is in directory MOM 2 on the workstation A corresponding script run mom sgi is included for SGI workstations The script executes a test case global domain with 4 longitude by 3 latitude by 15 vertical level resolution using idealized geometry and topography and exercises only a few of the available options for MOM 2 Test cases 0 1 2 and 3 use various types of surface boundary conditions and are selected by setting the CASE variable within run mom as follows e CASE 0 uses idealized surface boundary conditions which are a function of latitude only and independent of time zonally averaged annual mean Hellerman and Rosenstein 1983 wind stress with surface temperature and salinity damped back to initial condi tions on a time scale of 50 days using a thickness of about 25 meters Initial conditions are no motion and an idealized temperature function of latitude and depth and salin ity constant structure required data is generated internall

Download Pdf Manuals

image

Related Search

Related Contents

Avaya IP Softphone Release 6.0 User Reference  Performo RW HW HWF ME      Manual de instrucciones - vitroteclabs, productos sanitarios  Manual_HD6-15C_11506090  SignalTEK II - Electrocomponents  2 - Securitex Electronic Systems Engineering  Corsair HX650  

Copyright © All rights reserved.
Failed to retrieve file