Fortran

Guide To Learn

Minimal working app

Declaring the data to use in our app

Now that you have an idea of how to declare a variable of a specific numeric type, let’s declare some variables, constants, and arrays that we’ll use in the tsunami simulator. Declaring variables What kinds of variables will we need? As a reminder, based on our implementation strategy in section 2.3.1, we’ll need the following: […]

Numeric data types

Fortran provides three numerical data types out of the box: integer, real, and complex. Integer numbers The integer is the simplest numeric type in Fortran. Here are some examples of integer literals: You declare one or more integers like this: This statement instructs the compiler to reserve the space in memory for integer variables i and n. It’s made of the […]

Declaring and initializing variables

Explicit is better than implicit.   –Tim Peters The first part of any program unit is the declaration section. Fortran employs a static, manifest, strong typing system: Implicit typing Fortran has a historical feature called implicit typing, which allows variable types to be inferred by the compiler based on the first letter of the variable. Yes, you read that right. Implicit […]

Scroll to top