CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler



Similar documents
Software: Systems and Application Software

Programming Languages & Tools

Chapter 7A. Functions of Operating Systems. Types of Operating Systems. Operating System Basics

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

Tutorial 0A Programming on the command line

NorthClark Computing, Inc. Bill of Material and Parts Master Maintenance. Administrator s Guide

Chapter 2 System Structures

Chapter 13: Program Development and Programming Languages

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Operating System Structures

EUROPEAN UNIVERSITY OF LEFKE MANAGEMENT INFORMATION SYSTEMS DEPARTMENT COURSE DESCRIPTION

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

CURRICULUM VITAE EDUCATION:

1/20/2016 INTRODUCTION

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

Operating System Software

Functions of NOS Overview of NOS Characteristics Differences Between PC and a NOS Multiuser, Multitasking, and Multiprocessor Systems NOS Server

Chapter 12 Programming Concepts and Languages

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Network operating systems typically are used to run computers that act as servers. They provide the capabilities required for network operation.

McGraw-Hill The McGraw-Hill Companies, Inc.,

Software. Programming Language. Software. Instructor Özgür ZEYDAN. Bülent Ecevit University Department of Environmental Engineering

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

System Structures. Services Interface Structure

LONG BEACH CITY COLLEGE MEMORANDUM

Intro to Web Development

Engineering Problem Solving

Chapter 5: System Software: Operating Systems and Utility Programs

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

What is a programming language?

Hypercosm. Studio.

ASSOCIATE IN APPLIED SCIENCE DEGREES AND CERTIFICATES

A Real Time, Object Oriented Fieldbus Management System

Computers: Tools for an Information Age

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

DIABLO VALLEY COLLEGE CATALOG

SPSS for Windows importing and exporting data

UCINET Quick Start Guide

Technical White Paper The Excel Reporting Solution for Java

Chapter 4. System Software. What You Will Learn... Computers Are Your Future. System Software. What You Will Learn... Starting the Computer

HPC Wales Skills Academy Course Catalogue 2015

:Introducing Star-P. The Open Platform for Parallel Application Development. Yoel Jacobsen E&M Computing LTD

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

GAUSS 9.0. Quick-Start Guide

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Chapter 13: Program Development and Programming Languages

Unit 4 Objectives. System Software. Component 4: Introduction to Information and Computer Science. Unit 4: Application and System Software Lecture 2

Chapter 3: Operating-System Structures. Common System Components

Using Example Projects, Code and Scripts to Jump-Start Customers With Code Composer Studio 2.0

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

MicroStrategy Desktop

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 2 Introducing Operating Systems

OPERATING SYSTEMS Software in the Background. Chapter 2

Applying Internet Technology to Production Environment Monitoring

Discovering Computers

An Introduction to Open Source Geospatial Tools

How is EnSight Uniquely Suited to FLOW-3D Data?

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

QUICK START GUIDE. Draft twice the documents in half the time starting now.

Vendor: Brio Software Product: Brio Performance Suite

CPS221 Lecture: Operating System Structure; Virtual Machines

Applying a circular load. Immediate and consolidation settlement. Deformed contours. Query points and query lines. Graph query.

Example of Standard API

For Introduction to Java Programming, 5E By Y. Daniel Liang

CHAPTER 15: Operating Systems: An Overview

Upon completion of this chapter, you will able to answer the following questions:

CS420: Operating Systems OS Services & System Calls

Operating System Today s Operating Systems File Basics File Management Application Software

RIC 2007 SNAP: Symbolic Nuclear Analysis Package. Chester Gingrich USNRC/RES 3/13/07

Integrated Open-Source Geophysical Processing and Visualization

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Excel Companion. (Profit Embedded PHD) User's Guide

CS3600 SYSTEMS AND NETWORKS

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Quick Start Using DASYLab with your Measurement Computing USB device

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

THUM - Temperature Humidity USB Monitor

DEGREE PLAN INSTRUCTIONS FOR COMPUTER ENGINEERING

Components of a Computing System. What is an Operating System? Resources. Abstract Resources. Goals of an OS. System Software

Computational Mathematics with Python

COURSE DESCRIPTIONS. Computer Information Systems

Today's Topics. COMP 388/441: Human-Computer Interaction. simple 2D plotting. 1D techniques. Ancient plotting techniques. Data Visualization:

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Building Applications Using Micro Focus COBOL

Using Excel for Handling, Graphing, and Analyzing Scientific Data:

SAP HANA Client Installation and Update Guide

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

How To Import A File Into The Raise S Edge

Multi-DNC. by Spectrum CNC Technologies

Terminal Server Software and Hardware Requirements. Terminal Server. Software and Hardware Requirements. Datacolor Match Pigment Datacolor Tools

Virtual Machines.

THE CERN/SL XDATAVIEWER: AN INTERACTIVE GRAPHICAL TOOL FOR DATA VISUALIZATION AND EDITING

AQA GCSE in Computer Science Computer Science Microsoft IT Academy Mapping

MeasurLink V7. Measurement Data Network System. MeasurLink provides total support from production line to production management and beyond.

Doors User Data File Export/Import

Transcription:

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler 1) Operating systems a) Windows b) Unix and Linux c) Macintosh 2) Data manipulation tools a) Text Editors b) Spreadsheets c) Visualization 3) Programming languages and environments a) Languages b) Environments c) Building a program This document is intended to be a review, and may also provide some helpful tips. Students in Computational Hydrology are expected to be fairly proficient computer users and have some familiarity with programming. To accommodate a wide variety of student backgrounds, there are generally no specific requirements with respect to hardware or software used in this class (there may be some models that everyone is required to use, but detailed instructions will be provided). Operating Systems An operating system manages the computer system s hardware and software. It provides a means for allocating resources (CPU, bandwidth, memory, etc.). It also provides an interface between applications and the system hardware, allowing software to operate with the software needing to know the hardware details. Operating systems are often grouped according to the type of machine: real-time control (e.g., computer numerical control or CNC machines), hand-held devices, desktop computers, workstations, servers, and supercomputers all have significantly different operating systems. The operating systems familiar to most people are Windows, Unix/Linux, and Macintosh. There are multiple flavors of each of these. Windows operating systems were initially based on MS-DOS, developed by Microsoft. The three most recent (and useful) versions are Windows NT, Windows 2000, and Windows XP, and are widely installed desktops, workstations, and servers. Each run on machines with Intel-type processors. The relatively easy to use graphical interface (compared with command-line input) made Windows popular with people with little computer experience. Unix is not a single operating system, rather it is a type of operating system with many variations. It was initially developed by AT&T, but released as open source code for academic use. The University of California at Berkeley improved upon the initial version, resulting in the Berkeley Standard Distribution (BSD) of Unix. Both free and proprietary versions exist. Original Unix systems were command-line driven, but

graphical interfaces are more recently available. Linux is a free variation of Unix, and has recently become very popular. Linux graphical interfaces are becoming more sophisticated (the KDE and Gnome interfaces are good), and are beginning to rival Windows system in terms of ease of use but with much better performance. The classic Macintosh OS is made by Apple Computer and runs on Motorola or IBM PowerPC processors. The newer Macintosh OS X is based on the BSD Unix, but is still proprietary. It reportedly combines the power and stability of Unix with a familiar graphical user interface. Data Manipulation Tools Both model input and output data need to be manipulated in various ways. Input to the models may include climate forcing (precipitation, temperature, etc.), watershed geometry (area, stream network, topography, etc.), and physical characteristics (soil type, vegetation, etc.). Output includes hydrographs, water levels (groundwater or surface water), and soil moisture. Data may represent one, two, or three dimensions. Many sophisticated commercial models have either integrated or third-party (external) data manipulation utilities. Hydrologic models integrated with Geographic Information Systems (GIS) are becoming more popular. GIS facilitates landscape analysis and provides an interface to common spatial data formats, thus is also useful as a general tool. There are numerous general tools available to handle input and output data, some of which are described in the following paragraphs. There are also many specific tools available to translate one format to another. It is often necessary to write your own! Text Editors Text editors are essential to hydrologic data manipulation. Most data available to the public are in text (ASCII) files (though the internal format varies, of course). Model output is often text as well. Models source code is stored in text files. While not always the most efficient method of manipulating data, text editors are often the most reliable method of examining the contents of a file. Note that word processors and spreadsheets can be used to edit text documents, but the files are difficult to correctly save in text format. There are several features desirable in a text editor: Ability to handle large files Search and replace functions Row/column indicator Support syntax highlighting (if used for coding) Column mode (very useful but not common) Every OS comes with a text editor. In Windows, notepad is the default text editor. Unix and Linux systems usually have a variety of text editors, including the old standby vi, and Emacs. TextEdit is available on Macintosh systems. Several third-party software packages exist that expand upon the capabilities of these editors. Notepad is particularly weak. An excellent, inexpensive Windows text editor is UltraEdit. This program is used as an example herein. Figure 1 is a screen capture of the UltraEdit (version 7) interface. Note the integrated directory structure (left window), multiple open files (three files are open,

Gen.inp is on top), and highlighted current line. On the bottom, note the location of the cursor. In Figure 2, a Fortran program is open with syntax highlighting in effect; note that keywords and symbols are colored. In Figure 3, a column is highlighted; in column mode, columns are manipulated as rows would be. Figure 1. UltraEdit screen capture.

Figure 2. UltraEdit with syntax highlighting. Figure 3. UltraEdit in column mode.

Spreadsheets Spreadsheets are used extensively in data manipulation, and are very useful for creating 2-D plots. Since most people routinely use Microsoft Excel, this is the only spreadsheet that will be mentioned here. Also, only select aspects pertinent to manipulating text files are covered. Excel will recognize a text file and offer options to parse the data into the spreadsheet cells. The two basic options are delimited or fixed width (Figure 4). The delimited option is useful when the values are not uniformly spaced, but are separated by spaces, tabs, or other characters. Fixed works well when the data form uniform columns, and does not require there to be spaces between the values. Figure 5 shows the text output options, where *.prn refers to space-delimited files, and *.txt to tab-delimited files. The number of spaces Excel puts between the values is related to how wide the columns are in the spreadsheet. Experimentation may be required to get the desired results, and creating input text files with specific internal format this way is not recommended. Figure 4. Excel text import options.

Figure 5. Excel text file export options. Visualization Due to the typically large amounts of data involved in hydrologic modeling, visualization is essential. Of course, methods of visualization vary widely in complexity, and a whole course could be devoted to this subject. Only a very brief discussion is included here. It is convenient to think of visualization in terms of data dimensions, i.e., one, two, three, and four. (Mental Exercise: think of specific hydrologic data that correspond to each of these dimensionalities.) Bar charts, histograms, and scatter plots, are common ways to explore one- and two-dimensional data. Contour and image maps are used for spatial data. Three- and four-dimensional data usually require the use of some means to compress the higher dimensions (using coloring or shading, for example) into two dimensions. An example of this is shown in Figure 6 is a color-filled contour map of the Paradise Creek watershed in Idaho. Other variables, such as areal extent of snow or precipitation depth, can be overlaid on such maps as well; the stream network and gage locations are shown on Figure 6. Animation can also be used, and is particularly useful for showing how spatial data (e.g., soil moisture) changes over time. There are some nice (large) animations located here (go to the bottom of the page for the animations).

Figure 6. Color-filled contour map of the Paradise Creek watershed, Idaho. Programming Languages and Environments A programming language is a formalized set of rules for syntax and semantics. Syntax refers to the ways in which the symbols that comprise the language are combined, and semantics defines the meaning of the strings of symbols. One way to characterize a programming language is by its level, where low-level languages are closer to what the computer can read directly (e.g., machine code and assembly language), and high-level languages are closer to what humans can read (e.g., Fortran and C++). To transform higher-level languages into something the computer can understand, programs are compiled into machine-readable code before the program is executed (run), or interpreted by the operating system or interpreter at run time. Scripting languages, such as Sed and Awk used in Unix/Linux environments, are often thought of as interpreted languages. While these are often useful for data manipulation and simple programs, they are generally not used in developing sophisticated hydrologic models. Compiled code usually is much faster. Each computer language is designed based on some philosophy or particular approach to programming. Three of the basic approaches are: Procedural Programming. Each module of a procedural code is made up of procedures, or sub-programs. Fortran was developed as a procedural language. Structured Programming. Typically this method refers to breaking the program into sub-programs, as with procedural programs, but with each subprogram having only one entry and exit mechanism. Pascal is a structured programming language.

Object-Oriented Programming. In this approach, emphasis is placed on the items (objects) manipulated as opposed to the actions taken by the computer. Objects are described by classes. A CAD drawing that describes a bicycle could be considered a class, and a bicycle an object. An object can be composed of both data and methods. C++ is a common object-oriented language, and many modern languages at least have some object-oriented capabilities. Programming environments are software packages and tools that facilitate code development. Text editors (with syntax highlighting), debuggers, compilers, code optimization utilities (profilers), and data visualization tools may be combined using one graphical user interface into an integrated development environment (IDE). If an integrated environment is not used, the individual tools used in program development comprise the programming environment. While there is some learning involved in using an IDE for the first time, they are very convenient once familiar. Figure 7 shows the Microsoft Developer Studio interface. This IDE integrates a text editor, compiler, debugger (being selected in Figure 7), and in later versions, a 2-D array visualizer. Debuggers provide a means to march through a program line by line and see the value of variables at each step. Figure 8 shows the Python IDLE interface. Python is an open source interpreted language. Another class of programming environment is inherent in mathematical software packages such as Matlab and Mathcad. These packages support scripting languages unique to each, and allow for symbolic representation of operations and data structures. They are integrated with libraries of optimized code. For example, if the inverse of a matrix A were required, one would simply write A -1 and the package would call the appropriate routine to compute the inverse without the user needing to know how it is done. It should be noted that libraries are also available for all popular compiled languages. The first steps in building a program have nothing to do with computers. First, the problem must be defined. What is the desired end result? Is the modeling being done to make a prediction or to learn something about the physical system? What are the important processes, with respect to the end result, of the physical system being simulated? What data are available? With these questions in mind, the equations that represent the physical system and appropriate solution techniques can be identified. Also, the general order of computations can be specified. The specific order may be a function of the computer language. With the problem, solution method and data well defined, the computer code can be written. It is generally a good idea to follow the general concept of modularity, both with respect to data and function. This applies to both the object-oriented and structured/procedural approaches. There are two general paths to executing your code, depending on if you are using a compiled or interpreted language: Compiled: source code compiler executable code run Interpreted: source code run (interpreted at runtime)

Figure 7. Microsoft Developer Studio. Figure 8. IDLE for use with the Python language.