12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in...
Transcript of 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in...
![Page 1: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/1.jpg)
1
![Page 2: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/2.jpg)
2
![Page 3: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/3.jpg)
3
![Page 4: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/4.jpg)
4
These slides forward have been moved to lec04 (did not get to).
![Page 5: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/5.jpg)
5
![Page 6: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/6.jpg)
6
![Page 7: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/7.jpg)
7
![Page 8: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/8.jpg)
8
The difference between a standard object module (the result of compiling with the -c option) and a library (such as libraries.a above) is that only the modules that are needed are loaded from the library. When on object module (.o extent) or a Fortran module (.f extent) is included all the routines from these are linked to the program even if they are not needed.
![Page 9: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/9.jpg)
9
![Page 10: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/10.jpg)
10
![Page 11: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/11.jpg)
11
![Page 12: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/12.jpg)
12
Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option when f77 is run to force this behavior. The option is often -static. In g77, -fno-automatic is the option. (used info g77 to get information on linux machines; on athena % add fortran % g77 -v --help (lists all options)
![Page 13: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/13.jpg)
13
![Page 14: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/14.jpg)
14
![Page 15: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/15.jpg)
15
![Page 16: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/16.jpg)
16
![Page 17: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/17.jpg)
17
![Page 18: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/18.jpg)
18
![Page 19: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/19.jpg)
19
![Page 20: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/20.jpg)
20
![Page 21: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/21.jpg)
21
![Page 22: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/22.jpg)
22
![Page 23: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/23.jpg)
23
![Page 24: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/24.jpg)
24
![Page 25: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/25.jpg)
25
![Page 26: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/26.jpg)
26
![Page 27: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/27.jpg)
27
poly_area.f and vars.f should be stored in text files. If they are displayed in a web browser window and the the page saved, they should appear as text files on your system. The reason that the files sometimes do not display correctly is the way that the “end-of-line” is denoted on different OS types. In Unix, a new-line character (ASCII Octal 12 or ^J) is used, on Windows a carriage return/new-line and on MacOSX, a simple carriage return is used (ASCII octal 15, ^M).
![Page 28: 12.010.Lec04tah/12.010/12.010.Lec04.pdf · 12! Loss of the values stored in variables in subroutines is not universal. Some compilers will retain values and often there is an option](https://reader035.fdocuments.net/reader035/viewer/2022071015/5fce3fd194aa547057033a75/html5/thumbnails/28.jpg)
28
We will be able to try these programs with g77, and fort77 on Mac OSX plus using gfortran on linerva,mit,edu