Download presentation
Presentation is loading. Please wait.
Published byRandolf McCarthy Modified over 8 years ago
1
MET4750 Techniques for Earth System Modeling MET 5990 Techniques for Earth System Modeling and Research (http://vortex.ihrc.fiu.edu/MET4570/MET4570.htm) (http://vortex.ihrc.fiu.edu/MET5990/MET5990.htm)
2
Governing Equations of Geophysical Fluid 1. Equation of state 2. Mass conservation 3. Momentum equation, Newton law 4. Equation of energy conservation, first law of thermodynamics 5. Conservation of moisture We have total nine equations for nine unknowns System is closed!
3
Issues with numerical forecasts Initial value problem British scientist L. F. Richardson Weather Prediction by Numerical Process, 1922 American meteorologist J. G. Charney Quasi-geostrophic model, 1950 Incompressible
4
Mean variables in observations and simulations
5
The average could be temporal, spatial, or ensemble average depending on specific dataset. Mean and perturbation 1. Mean equation of state 2. Mean mass conservation equation 3. Mean momentum equation
6
4. Mean equation of energy conservation 5. Mean equation of moisture conservation Closure a. First-order closure
7
What is Computer Science? It is not the study of computers! “Computers are to computer science what telescopes are to astronomy.” The question really is, “What can be computed?” What is a computer program? –A detailed, step-by-step set of instructions telling a computer what to do. –If we change the program, the computer performs a different set of actions or a different task. –The machine stays the same, but the program changes!
8
Programming Languages Natural language has ambiguity and imprecision problems when used to describe complex algorithms. Every structure in programming language has a precise form, called its syntax Every structure in programming language has a precise meaning, called its semantics. Programmers will often refer to their program as computer code. Process of writing an algorithm in a programming language often called coding.
9
High-level computer languages –Designed to be used and understood by humans Low-level language –Computer hardware can only understand a very low level language known as machine language High-level language c = a + b This needs to be translated into machine language that the computer can execute. Compilers convert programs written in a high- level language into the machine language of some computer. For example, FORTRAN compiler converts FORTRAN codes to machine language, which is binary (0, 1).
10
Interpreters simulate a computer that understands a high-level language. The source program is not translated into machine language all at once. An interpreter analyses and executes the source code instruction by instruction. Interpreter Compiling vs. Interpreting –Once program is compiled, it can be executed over and over without the source code or compiler. If it is interpreted, the source code and interpreter are needed each time the program runs –Compiled programs generally run faster since the translation of the source code happens only once.
11
–Interpreted languages are part of a more flexible programming environment since they can be developed and run interactively –Interpreted programs are more portable, meaning the executable code produced from a compiler for a Pentium won’t run on a Mac, without recompiling. However, if a suitable interpreter already exists, the interpreted code can be run with no modifications.
12
What is Python and why Python? Python is an interpreted programming language. It is named after the BBC show “Monty Python’s Flying Circus”. Python offers much more structure and support for large programs than shell scripts or batch files can offer, and it is much easier to check error than C. Being a very high-level language, Python has high-level data types built in, such as flexible arrays and dictionaries. Python allows you to split your program into modules that can be reused in other Python programs. It comes with a large collection of standard modules that you can use as the basis of your programs. Some of these modules provide things like I/O, system calls, and even interfaces to graphical user interface (GUI). Python is simple to use and is free!
13
Downloading and Installing Python Python can be downloaded at http://python.org/downloads/. We are using Python3.5.2 version.http://python.org/downloads/ There are installers for 64-bit and 32-bit computers. If your computer was bought in 2007 or later, it is most likely a 64-bit system. To find out, On Windows, select Start > Control Panel > System and Security > System On OS X, go to the apple menu, select About This Mac > More Info > System Report > Hardware. If you see Core Solo or Core Duo, then, it is a 32-bit machine. If it says something else including Intel Core 2 Duo, you have a 64-bit machine. On Ubuntu Linux, open a terminal and run command uname –m. A response of i686 means 32-bit, and x86_64 means 64- bit.
14
Downloading and Installing Python On Windows, download the Python installer (ending with.msi) and double-click it and follow the instructions. On Mac OS X, download the.dmg file that is right for your version of OS X and follow the instructions. On Ubuntu Linux, open a terminal and run following commands, sudo apt-get install python3. sudo apt-get install idle3. sudo apt-get install python3-pip. Python is ready to use!
15
Starting IDLE On Windows 7, click the Start icon and enter IDLE in the search box, and select IDLE. On Mac OS X, open the Finder window, click Applications, click Python 3.5, and then click IDLE icon. On Ubuntu Linux, open a terminal and then enter idle3. You may also be able to click Applications, select Programming, and then, click IDLE 3. On Windows XP, click the Start icon and then select Programs > Python 3.5 > IDLE. You will see something like Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>>
16
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> This window is called the interactive shell. This is where you enter instructions for the Python interpreter software to run. The computer reads the instructions you enter and runs them immediately. For example. >>> print(‘Hello world!’) Hello world! How to Find Help Most help can be obtained from the error message. Python gives detailed error message if your issued commands are wrong. Most of the time, error message can help you fix the problem. Search online.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.