Array HTML version. Declaration in Main Program 2 ways to declare a real array A of rank N : DIMENSION A( start_index1 : end_index1, …, start_indexN :

Slides:



Advertisements
Similar presentations
Software development process. Explanation of the iterative nature of the software development process.
Advertisements

MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 29.
Need for Arrays Exercise Read the IDs and the grades for all ICS 101 students. Compute and print the average of the students. Print the grades and IDs.
Application of Fortran 90 to ocean model codes Mark Hadfield National Institute of Water and Atmospheric Research New Zealand.
Chapter 10 Additional Features of Arrays Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
Functions & Subroutines HTML version DFMain.chm. Types of subprograms Internal External Module Pure Elemental Recursive Optional arguments Generic Defined.
1 11/27/06CS150 Introduction to Computer Science 1 Searching Arrays.
18 April, 2000 CS1001 Lecture 23 Quiz 5 Multi-Dimensional Array.
Fortran 9x HTML version. New F90 features Free source form Modules User-defined data types and operators Generic user-defined procedures Interface blocks.
Chapter 10 Modules and programming with subroutines.
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
© Alan Burns and Andy Wellings, 2001 Programming in the Small Aim: to remind you how to read/write programs in Ada 95, Java and ANSI C.
Basic PRAM algorithms Problem 1. Min of n numbers Problem 2. Computing a position of the first one in the sequence of 0’s and 1’s.
C programming---Arrays scalar: capable of holding a single data item aggregate variables: capable of holding a collections of values. Two kinds of aggregates.
Fortran- Subprograms Chapters 6, 7 in your Fortran book.
Fortran: Specification Statements Session Six ICoCSIS.
Introduction to FORTRAN
Fortran: Program Units and Procedures Session Four ICoCSIS.
Week 8. Today’s program n New stuff: –Recursion in F –Procedures as arguments –User-defined data types n Quiz #3.
Week 8 Improving on building blocks Recursive procedures.
Thursday, April 3, 2014MAT 312. Thursday, April 3, 2014MAT 312.
Tuesday, April 22, 2014MAT 312. Tuesday, April 22, 2014MAT 312.
MATLAB Tips for Simulation Parinya Sanguansat. Version Selection  X86  Faster  Smaller  X64  Slower  Bigger.
11 - 2/4/2000AME 150 L Program Control Subroutines and Functions.
Arrays. An array is a group of like-typed variables that are referred to by a common name. Arrays of any type can be created and may have one or more.
Procedures and Modular Programming Part # 2. Interface Block ► Functions do not have to be internal to main program ► They can be stand-alone ► In this.
Arrays Introduction In scientific and engineering computing, it is very common to need to manipulate ordered sets of values, such as vectors and matrices.
Духовні символи Голосіївського району
Fortran MATTHEW CARSON. History of FORTRAN FORTRAN ; First High Level Language FORTRAN I 1957; First Compiled Language FORTRAN II ; Independent.
Beginning Fortran Introduction 13 October 2009 *Black text on white background provided for easy printing.
JavaScript: An Analysis Michael Owen. Brief History Founded at NetScape by Brendan Eich Mocha, LiveScript, then JavaScript No apparent relation to Java.
Arrays.
Introduction to Fortran95 Programming Part II By Deniz Savas, CiCS, 2007
Simplify Radical Expressions Using Properties of Radicals.
為巴基斯坦禱告短片: 更多亞洲國家禱告資訊,請瀏覽:
Multiplication With Base 10 Blocks Allan, Huellmantel, Scott.
Simplify Radical Expressions Using Properties of Radicals
Procedures and Modular Programming
العدد تذكيره وتأنيثه مقدمة
Using local variable without initialization is an error.
Subroutine Comp 208 Yi Lin.
Section 3.2 The Exponential, Trigonometric, and Hyperbolic Functions
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
Accessing Variables in your project
Templates Generic Programming.
Presentation transcript:

Array HTML version

Declaration in Main Program 2 ways to declare a real array A of rank N : DIMENSION A( start_index1 : end_index1, …, start_indexN : end_indexN ) REAL A( start_index1 : end_index1, …, start_indexN : end_indexN ) DIMENSION A(10, 20), M(-5:4, 1:20), C(2, 3:9, 4, 5

Declaration in Sub-Program Same as in the main program. With variable dimensions. –SUBROUTINE MA( N1, N2, A, B ) DIMENSION A(N1, N2), B(N1+N2) –DIMENSION X(3, 4), Y(7) CALL MA( 3, 4, X, Y ) With assumed dimensions. –SUBROUTINE MAT( N, A, B, M ) DIMENSION A(N, *), B(N), M(*) –DIMENSION X(5, -9:10), Y(5) ), K(30) CALL MAT( 5, X, Y, K )

Initialization DIMENSION M(2,3) DATA M / 1, 2, 3, 4, 5, 6 / DATA ( (M(I,J), I=1,2 ), J=1,3) / 1, 2, 3, 4, 5, 6 / DATA ( M(I,1), I=1,2 ) / 1, 2 /, ( M(I,2), I=1,2 ) / 3, 4/, ( M(I,3), I=1,2 ) / 5, 6/ DATA ( M(1,J), I=1,3 ) / 1, 3, 5 /, ( M(2,J), I=1,3 ) / 2, 4, 6 /

BLOCK DATA Arrays in common blocks can only be initialized in a BLOCK DATA. BLOCK DATA MA COMMON / MAT / M(2,3) DATA M / 1, 2, 3, 4, 5, 6 / END PROGRAM TS COMMON / MAT / M(2,3) WRITE(*, '(3I7)') ( (M(I,J), J=1,3 ), I=1,2) END