|
Preface |
5 |
|
|
Contents |
7 |
|
|
The Problem |
19 |
|
|
Physical Interpretation |
19 |
|
|
Example |
20 |
|
|
How to Produce a Simple Graph with SciLab |
21 |
|
|
Finite Time Step and Time Level |
22 |
|
|
Explicit Time-Forward Iteration |
22 |
|
|
Condition of Numerical Stability for Explicit Scheme |
22 |
|
|
Implicit Time-Forward Iteration |
23 |
|
|
Hybrid Schemes |
23 |
|
|
Other Schemes |
23 |
|
|
Condition of Consistency |
24 |
|
|
Condition of Accuracy |
24 |
|
|
Condition of Efficiency |
24 |
|
|
How Model Codes Work |
24 |
|
|
The First FORTRAN Code |
25 |
|
|
How to Compile and Run FORTRAN Codes |
25 |
|
|
A Quick Start to FORTRAN |
25 |
|
|
Aim |
27 |
|
|
Task Description |
28 |
|
|
Instructions |
28 |
|
|
Sample Code |
28 |
|
|
Results |
28 |
|
|
Additional Exercise for the Reader |
28 |
|
|
Detection and Elimination of Errors |
29 |
|
|
Error Messages |
29 |
|
|
Correct Errors One by One |
29 |
|
|
Ignore Error Message Text |
29 |
|
|
Frequent Errors |
30 |
|
|
Trust Your Compiler |
30 |
|
|
Display Warnings |
30 |
|
|
Units |
31 |
|
|
Scalars and Vectors |
31 |
|
|
Difference Between Scalars and Vectors |
31 |
|
|
Contours and Contour Interval |
32 |
|
|
Location and Velocity |
32 |
|
|
Location and Distance |
32 |
|
|
Calculation of Distances with SciLab |
33 |
|
|
Velocity |
33 |
|
|
Types of Motion |
34 |
|
|
Steady-State Motions |
34 |
|
|
Waves |
34 |
|
|
The Sinusoidal Waveform |
34 |
|
|
Visualisation of a Wave Using SciLab |
35 |
|
|
A Simple Wave Made of Vertically Moving Bars |
35 |
|
|
Sample Script |
35 |
|
|
The First SciLab Script |
36 |
|
|
A Quick-Start to SciLab |
36 |
|
|
The First GIF Animation |
37 |
|
|
Modified Animation Script |
37 |
|
|
Creation of an Animated GIF File |
38 |
|
|
Phase Speed |
38 |
|
|
Dispersion Relation |
38 |
|
|
Superposition of Waves |
39 |
|
|
Exercise 2: Wave Interference |
39 |
|
|
Aim |
39 |
|
|
Task Description |
39 |
|
|
Sample Script |
40 |
|
|
A Glimpse of Results |
40 |
|
|
A Rule of Thumb |
40 |
|
|
Forces |
41 |
|
|
What Forces Do |
41 |
|
|
Newton's Laws of Motion |
42 |
|
|
Apparent Forces |
42 |
|
|
Lagrangian Trajectories |
42 |
|
|
Eulerian Frame of Reference and Advection |
42 |
|
|
Interpretation of the Advection Equation |
43 |
|
|
The Nonlinear Terms |
43 |
|
|
Impacts of the Nonlinear Terms |
44 |
|
|
Fundamental Conservation Principles |
44 |
|
|
A List of Principles |
44 |
|
|
Conservation of Momentum |
44 |
|
|
Conservation of Volume -- The Continuity Equation |
44 |
|
|
Vertically Integrated Form of the Continuity Equation |
46 |
|
|
Divergence or Convergence? |
46 |
|
|
The Continuity Equation for Streamflows |
47 |
|
|
Density |
48 |
|
|
The Equation of State for Seawater |
48 |
|
|
Gravity and the Buoyancy Force |
48 |
|
|
Archimedes' Principle |
48 |
|
|
Reduced Gravity |
49 |
|
|
Stability Frequency |
49 |
|
|
Stable, Neutral and Unstable Conditions |
50 |
|
|
Exercise 3: Oscillations of a Buoyant Object |
50 |
|
|
Aim |
50 |
|
|
Task Description |
50 |
|
|
Momentum Equations |
50 |
|
|
Code Structure |
51 |
|
|
Finite-Difference Equations |
51 |
|
|
Initial and Boundary Conditions |
51 |
|
|
Sample Code and Animation Script |
52 |
|
|
Discussion of Results |
52 |
|
|
Analytical Solution |
53 |
|
|
Inclusion of Friction |
53 |
|
|
Additional Exercises for the Reader |
55 |
|
|
The Pressure-Gradient Force |
55 |
|
|
The Hydrostatic Balance |
55 |
|
|
Which Processes are Hydrostatic? |
55 |
|
|
The Hydrostatic Pressure Field in the Ocean |
55 |
|
|
Dynamic Pressure in the Ocean |
56 |
|
|
The Horizontal Pressure-Gradient Force |
56 |
|
|
The Boussinesq Approximation |
56 |
|
|
The Case of Uniform Density |
57 |
|
|
The Coriolis Force |
57 |
|
|
Apparent Forces |
57 |
|
|
The Centripetal Force and the Centrifugal Force |
58 |
|
|
Derivation of the Centripetal Force |
59 |
|
|
The Centrifugal Force in a Rotating Fluid |
60 |
|
|
Motion in a Rotating Fluid as Seen in the Fixed Frameof Reference |
61 |
|
|
Parcel Trajectory |
61 |
|
|
Numerical Code |
62 |
|
|
Analytical Solution |
63 |
|
|
The Coriolis Force |
63 |
|
|
The Coriolis Force on Earth |
64 |
|
|
The Local Vertical |
64 |
|
|
The Coriolis Parameter |
65 |
|
|
The f-Plane Approximation |
66 |
|
|
The Beta-Plane Approximation |
66 |
|
|
Exercise 4: The Coriolis Force in Action |
67 |
|
|
Aim |
67 |
|
|
First Attempt |
67 |
|
|
Improved Scheme 1: the Semi-Implicit Approach |
67 |
|
|
Improved Scheme 2: The Local-Rotation Approach |
69 |
|
|
Yes! |
69 |
|
|
Sample Code and Animation Script |
69 |
|
|
Inertial Oscillations |
70 |
|
|
Sample Code and Animation Script |
71 |
|
|
Turbulence |
71 |
|
|
Laminar and Turbulent Flow |
71 |
|
|
The Reynolds Approach |
71 |
|
|
What Causes Turbulence? |
72 |
|
|
The Richardson Number |
72 |
|
|
Turbulence Closure and Turbulent Diffusion |
73 |
|
|
Prandtl's Mixing Length |
73 |
|
|
Interpretation of the Diffusion Equation |
73 |
|
|
The Navier--Stokes Equations |
74 |
|
|
Complete Set of Equations |
74 |
|
|
Boundary Conditions for Oceanic Applications |
75 |
|
|
Scaling |
75 |
|
|
The Idea |
75 |
|
|
Example of Scaling |
76 |
|
|
More on Finite Differences |
78 |
|
|
Taylor Series |
78 |
|
|
Forward, Backward and Centred Differences |
79 |
|
|
Scheme for the Second Derivative |
79 |
|
|
Truncation Error |
80 |
|
|
Long Surface Gravity Waves |
81 |
|
|
Extraction of Individual Processes |
81 |
|
|
Shallow-Water Processes |
81 |
|
|
The Shallow-Water Model |
81 |
|
|
The Governing Equations |
82 |
|
|
Analytical Wave Solution |
82 |
|
|
Animation Script |
83 |
|
|
Numerical Grid |
84 |
|
|
Finite-Difference Scheme |
84 |
|
|
Stability Criterion |
85 |
|
|
First-Order Shapiro Filter |
86 |
|
|
Land and Coastlines |
86 |
|
|
Lateral Boundary Conditions |
86 |
|
|
Modular FORTRAN Scripting |
87 |
|
|
Structure of the Following FORTRAN Codes |
88 |
|
|
Exercise 5: Long Waves in a Channel |
89 |
|
|
Aim |
89 |
|
|
Instructions |
89 |
|
|
Sample Code and Animation Script |
90 |
|
|
Results |
90 |
|
|
Exercise 6: The Flooding Algorithm |
90 |
|
|
Aim |
90 |
|
|
Redefinition of Wet and Dry |
92 |
|
|
Enabling Flooding of Dry Grid Cells |
92 |
|
|
Flooding of Sloping Beaches |
92 |
|
|
Ultimate Crash Tests |
93 |
|
|
Sample Code and Animation Script |
93 |
|
|
Results |
94 |
|
|
The Multi-Layer Shallow-Water Model |
95 |
|
|
Basics |
95 |
|
|
Exercise 7: Long Waves in a Layered Fluid |
97 |
|
|
Aim |
97 |
|
|
Task Description |
97 |
|
|
Sample Code and Animation Script |
98 |
|
|
Results |
98 |
|
|
Phase Speed of Long Internal Waves |
99 |
|
|
Natural Oscillations in Closed Bodies of Fluid |
99 |
|
|
Merian's Formula |
100 |
|
|
Co-oscillations in Bays |
101 |
|
|
Additional Exercise for the Reader |
101 |
|
|
Long Waves in a Shallow Lake |
103 |
|
|
The 2D Shallow-Water Wave Equations |
103 |
|
|
Arakawa C-grid |
103 |
|
|
Finite-Difference Equations |
104 |
|
|
Inclusion of Land and Coastlines |
105 |
|
|
Stability Criterion |
106 |
|
|
Exercise 8: Long Waves in a Shallow Lake |
106 |
|
|
Aim |
106 |
|
|
Task Description |
106 |
|
|
Sample Code and Animation Script |
106 |
|
|
Snapshot Results |
107 |
|
|
Additional Exercise for the Reader |
107 |
|
|
Exercise 9: Wave Refraction |
107 |
|
|
Aim |
107 |
|
|
Background |
107 |
|
|
Task Description |
108 |
|
|
Lateral Boundary Conditions |
108 |
|
|
Sample Code and Animation Script |
110 |
|
|
Results |
110 |
|
|
Additional Exercise for the Reader |
110 |
|
|
The Wind-Forced Shallow-Water Model |
111 |
|
|
The Governing Equations |
111 |
|
|
Semi-implicit Approach for Bottom Friction |
111 |
|
|
Finite-Difference Equations |
112 |
|
|
Exercise 10: Wind-Driven Flow in a Lake |
113 |
|
|
Aim |
113 |
|
|
Creation of Variable Bathymetry |
113 |
|
|
Sample Code |
113 |
|
|
Task Description |
113 |
|
|
Tricks for Long Model Simulations |
114 |
|
|
Results |
114 |
|
|
Sample Code and Animation Script |
115 |
|
|
Caution |
115 |
|
|
Additional Exercise for the Reader |
116 |
|
|
Movement of Tracers |
116 |
|
|
Lagrangian Versus Eulerian Tracers |
116 |
|
|
A Difficult Task |
116 |
|
|
Eulerian Advection Schemes |
116 |
|
|
Stability Criterion for the Advection Equation |
118 |
|
|
Exercise 11: Eulerian Advection |
118 |
|
|
Aim |
118 |
|
|
Task Description |
119 |
|
|
Results |
119 |
|
|
Recommendation |
121 |
|
|
Sample Code and Animation Script |
121 |
|
|
Exercise 12: Trajectories |
121 |
|
|
Aim |
121 |
|
|
Task Description |
121 |
|
|
Results |
121 |
|
|
Sample Code and Animation Script |
123 |
|
|
Exercise 13: Inclusion of Nonlinear Terms |
123 |
|
|
Aim |
123 |
|
|
Formulation of the Nonlinear Terms |
123 |
|
|
Sample Code |
123 |
|
|
Results |
124 |
|
|
Exercise 14: Island Wakes |
124 |
|
|
Aim |
124 |
|
|
The Reynolds Number |
125 |
|
|
Inclusion of Lateral Friction and Momentum Diffusion |
125 |
|
|
Stability Criterion for Diffusion Terms |
127 |
|
|
Full-Slip, Semi-Slip and No-Slip Conditions |
127 |
|
|
Task Description |
128 |
|
|
Sample Code |
129 |
|
|
Results |
129 |
|
|
Additional Exercises for the Reader |
130 |
|
|
The Complete Shallow-Water Equations |
131 |
|
|
Description |
131 |
|
|
Implementation of the Coriolis Force |
131 |
|
|
Coastal Kelvin Waves |
132 |
|
|
Theory |
132 |
|
|
Exercise 15: Coastal Kelvin Waves |
133 |
|
|
Aim |
133 |
|
|
Task Description |
133 |
|
|
Results |
134 |
|
|
Sample Codes and Animation Script |
134 |
|
|
Additional Exercise for the Reader |
134 |
|
|
Geostrophic Flow |
134 |
|
|
Scaling |
134 |
|
|
The Geostrophic Balance |
135 |
|
|
Geostrophic Equations |
135 |
|
|
Vorticity |
136 |
|
|
Conservation of Potential Vorticity |
138 |
|
|
Topographic Steering |
139 |
|
|
Rossby Waves |
139 |
|
|
Exercise 16: Topographic Steering |
141 |
|
|
Aim |
141 |
|
|
Model Equations |
141 |
|
|
Task Description |
141 |
|
|
Caution |
142 |
|
|
Sample Code |
142 |
|
|
Results |
142 |
|
|
Additional Exercise for the Reader |
144 |
|
|
Instability of Lateral Shear Flows |
144 |
|
|
Theory |
144 |
|
|
Instability to Long Waves |
146 |
|
|
Exercise 17: Barotropic Instability |
146 |
|
|
Aim |
146 |
|
|
Model Equations |
146 |
|
|
Task Description |
146 |
|
|
Results |
147 |
|
|
Sample Code and Animation Script |
148 |
|
|
Additional Exercise for the Reader |
149 |
|
|
The Wind-Driven Circulation of the Ocean |
149 |
|
|
The Dynamical Structure of the Ocean |
149 |
|
|
Steady-State Dynamics and Volume Transport |
149 |
|
|
A Simplified Model of the Wind-driven Circulation |
150 |
|
|
The Surface Ekman Layer |
151 |
|
|
Ekman-layer Transport |
151 |
|
|
Ekman Pumping |
152 |
|
|
The Sverdrup Balance |
153 |
|
|
Interpretation of the Sverdrup Relation |
153 |
|
|
The Bottom Ekman Layer |
154 |
|
|
Western Boundary Currents |
155 |
|
|
The Role of Lateral Momentum Diffusion |
156 |
|
|
Exercise 18: The Wind-Driven Circulation |
156 |
|
|
Aim |
156 |
|
|
Task Description |
156 |
|
|
Results |
158 |
|
|
Sample Code and Animation Script |
159 |
|
|
Additional Exercises for the Reader |
159 |
|
|
Exercise 19: Baroclinic Compensation |
160 |
|
|
Background |
160 |
|
|
Aim |
160 |
|
|
Task Description |
160 |
|
|
Results |
161 |
|
|
Sample Code and Scilab Animation Script |
161 |
|
|
Additional Exercise for the Reader |
161 |
|
|
The Reduced-Gravity Concept |
161 |
|
|
Background |
161 |
|
|
The Rigid-lid Approximation |
162 |
|
|
Geostrophic Adjustment of a Density Front |
163 |
|
|
Background |
163 |
|
|
How Does It Work? |
164 |
|
|
Theory |
165 |
|
|
Exercise 20: Geostrophic Adjustment |
167 |
|
|
Aim |
167 |
|
|
Task Description |
167 |
|
|
Results |
168 |
|
|
Sample Code and Animation Script |
169 |
|
|
Additional Exercise for the Reader |
169 |
|
|
Baroclinic Instability |
169 |
|
|
Brief Description |
169 |
|
|
Exercise 21: Frontal Instability |
170 |
|
|
Aim |
170 |
|
|
Task Description |
170 |
|
|
Results |
171 |
|
|
Sample Code and Animation Script |
173 |
|
|
Additional Exercise for the Reader |
174 |
|
|
Density-Driven Flows |
174 |
|
|
Background |
174 |
|
|
Exercise 22: Reduced-Gravity Plumes |
175 |
|
|
Aim |
175 |
|
|
Task Description |
175 |
|
|
Write a New Simulation Code? |
176 |
|
|
Results |
176 |
|
|
Sample Code and Animation Script |
178 |
|
|
Additional Exercise for the Reader |
179 |
|
|
Technical Information |
179 |
|