#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Options

# Ocean modelling for beginners

There's an energetic undergraduate in my differential equations course who is fascinated by ocean modelling. He wants to work on this with me. His plan is to work through the book:

He claims to like the idea of doing projects in this book and writing blog articles based on them; he says he likes to write. So, I'm going to try to get him to do this. The book explains things like how to make animated GIFs of simulations, so that could be cool. And, I hope I learn a bit about ocean modelling.

The book's exercises apparently use FORTRAN. This is presumably what climate modellers use, or at least what they used in 2008. One question is whether I can or should get him to do the exercises in some other language. Of course the problem is that I can't really teach him that other language... certainly not in my spare time, anyway!

• Options
1.

I added a reference to the above book to:

which is the best page I could find for this. Btw, I did so as 'Anonymous Coward', since I had some trouble getting the system to accept me on my new computer....

Comment Source:I added a reference to the above book to: * [[Atmospheric and ocean dynamics]] which is the best page I could find for this. Btw, I did so as 'Anonymous Coward', since I had some trouble getting the system to accept me on my new computer....
• Options
2.
edited November 2012

The book’s exercises apparently use FORTRAN. This is presumably what climate modellers use, or at least what they used in 2008. One question is whether I can or should get him to do the exercises in some other language. Of course the problem is that I can’t really teach him that other language… certainly not in my spare time, anyway!

If it's in FORTRAN, let it be FORTRAN (unless your student really wants to use another language himself). I'm not a computer scientist (who may have valid reasons for not liking it for their specific domain) but I've met quite a few respectable scientists who say FORTRAN is still a good language for what it is mainly used for, i.e. high-performance scientific computing, and I consider their opinion to be valuable too, even if they're not computer scientists either, because they also do programming and some of them are also fluent in other languages. Although these exercises probably don't need very high performance, I guess.

A disadvantage of FORTRAN may be that some non-public compilers seem to give better compilation than e.g. the GNU compiler (in some sense a computer language is void without a compiler).

PS if the book's exercises would be written in F77 (which I doubt) it would be good to encourage your student to rewrite them in F90/F95, F77 style is kind of deprecated.

Comment Source:> The book’s exercises apparently use FORTRAN. This is presumably what climate modellers use, or at least what they used in 2008. One question is whether I can or should get him to do the exercises in some other language. Of course the problem is that I can’t really teach him that other language… certainly not in my spare time, anyway! If it's in FORTRAN, let it be FORTRAN (unless your student really wants to use another language himself). I'm not a computer scientist (who may have valid reasons for not liking it for their specific domain) but I've met quite a few respectable scientists who say FORTRAN is still a good language for what it is mainly used for, i.e. high-performance scientific computing, and I consider their opinion to be valuable too, even if they're not computer scientists either, because they also do programming and some of them are also fluent in other languages. Although these exercises probably don't need very high performance, I guess. A disadvantage of FORTRAN may be that some non-public compilers seem to give better compilation than e.g. the GNU compiler (in some sense a computer language is void without a compiler). PS if the book's exercises would be written in F77 (which I doubt) it would be good to encourage your student to rewrite them in F90/F95, F77 style is kind of deprecated.
• Options
3.

I second Frederik's view. Fortran 95/2003 uses lower case and expects documented functions.The ocean modelling book is free online.

Comment Source:I second Frederik's view. Fortran 95/2003 uses lower case and expects documented functions.The [ocean modelling book](http://goo.gl/Wshia) is free online.
• Options
4.

I also had this book on loan but as i'm not into FORTRAN since I took one class at my University I deferred to read it or use it right now.

Comment Source:I also had this book on loan but as i'm not into FORTRAN since I took one class at my University I deferred to read it or use it right now.
• Options
5.
edited November 2012

Ocean Modelling for Beginners uses FORTRAN 95. Thanks for your advice, guys! And thanks for the link to Advanced Ocean Modelling, Jim. It's by the same guy, clearly a continuation of the same story. David Hincapie lent me another more advanced book:

• Stephen M. Griffies, Fundamentals of Ocean Climate Models, Princeton U. Press, Princeton, 2004.

A lot of it is standard math that I know (there's even an appendix on tensor calculus and manifolds!), but a lot is new to me, like 'neutral physics', 'Arakawa grids', the 'Bossinesq approximation' and so on. So, if we get this far I will have lots of fun.

Comment Source:_Ocean Modelling for Beginners_ uses FORTRAN 95. Thanks for your advice, guys! And thanks for the link to _Advanced Ocean Modelling_, Jim. It's by the same guy, clearly a continuation of the same story. David Hincapie lent me another more advanced book: * Stephen M. Griffies, _Fundamentals of Ocean Climate Models_, Princeton U. Press, Princeton, 2004. A lot of it is standard math that I know (there's even an appendix on tensor calculus and manifolds!), but a lot is new to me, like 'neutral physics', 'Arakawa grids', the 'Bossinesq approximation' and so on. So, if we get this far I will have lots of fun.
• Options
6.
edited November 2012

I will have lots of fun

It's not so spectacular:

• It's Boussinesq approximation: $\rho(p,T) \rightarrow \rho_0$ except for the terms in the Navier-Stokes equation where $\rho$ is accompanied by $g$, and there then usually $\rho(T)$, and mostly only to first order in $T$. In this way the Navier-Stokes equations become incompressible, the trade-off is a buoyancy term (the linear dependence of the density on temperature).

• The Arakawa grids define, in a finite difference numerical scheme, at which points the discretized vectors and scalars are defined with respect to each other. Usually the equations become more "efficient" when they're not defined at the same point.

Comment Source:> I will have lots of fun It's not so spectacular: * It's Bo**u**ssinesq approximation: $\rho(p,T) \rightarrow \rho_0$ except for the terms in the Navier-Stokes equation where $\rho$ is accompanied by $g$, and there then usually $\rho(T)$, and mostly only to first order in $T$. In this way the Navier-Stokes equations become incompressible, the trade-off is a buoyancy term (the linear dependence of the density on temperature). * The Arakawa grids define, in a finite difference numerical scheme, at which points the discretized vectors and scalars are defined with respect to each other. Usually the equations become more "efficient" when they're not defined at the same point.
• Options
7.

Your alert student and others might like to look a the Princeton Ocean Model. I'm waiting for a registration to download mpiPOM. the parallel implementation of POM using Fortran MPI. MPI Fortan is already installed on the Azimuth server. The Taiwan site has a really cool animated gif of the 1988 El Nino.

Comment Source:Your alert student and others might like to look a the [Princeton Ocean Model](http://www.aos.princeton.edu/WWWPUBLIC/htdocs.pom/). I'm waiting for a registration to download [mpiPOM](http://mpipom.ihs.ncu.edu.tw/index.php). the parallel implementation of POM using [Fortran MPI](https://computing.llnl.gov/tutorials/mpi/). MPI Fortan is already installed on the Azimuth server. The Taiwan site has a really cool animated gif of the 1988 El Nino.
• Options
8.

Sounds like a fun idea. I work next door to some ocean modelers, so I might be able to ask them a dumb question or two if needed.

Yes, ocean modelers universally use Fortran. Other software can be used to visualize the model's output. It might be fun to write some kind of interactive version of a simple ocean model in some modern visualization language like Processing; see also this simplified fluid dynamics library for video games. But I'd probably just start with Fortran, because it's fast (therefore can diagnose bugs quickly) and the book uses it.

Speaking of tensor calculus, the aforementioned ocean modelers next door are working on an unstructured grid model, that works with arbitrary curvilinear coordinate systems (in 2D) discretized onto arbitrary meshes (given by a Voronoi diagram on the sphere). They're having fun (or not) working out how to discretize all their equations ... it gets a little messy once you get to tensors (matrices, really).

Comment Source:Sounds like a fun idea. I work next door to some ocean modelers, so I might be able to ask them a dumb question or two if needed. Yes, ocean modelers universally use Fortran. Other software can be used to visualize the model's output. It might be fun to write some kind of interactive version of a simple ocean model in some modern visualization language like [Processing](http://www.processing.org/); see also [this simplified fluid dynamics library for video games](http://www.memo.tv/msafluid/). But I'd probably just start with Fortran, because it's fast (therefore can diagnose bugs quickly) and the book uses it. Speaking of tensor calculus, the aforementioned ocean modelers next door are working on an unstructured grid model, that works with arbitrary curvilinear coordinate systems (in 2D) discretized onto arbitrary meshes (given by a Voronoi diagram on the sphere). They're having fun (or not) working out how to discretize all their equations ... it gets a little messy once you get to tensors (matrices, really).