MS 698: 2014 Implementing a Hydrodynamic Model - Part 2 Julia Moriarty 14 February 2014.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Lab III – Linux at UMBC.
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Utilizing the GDB debugger to analyze programs Background and application.
Understanding Correlation In HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Preparation for working in the CSIL Basic LINUX operations.
THE UNIX SYSTEM Ashish Gupta TA, Intro to Networking Jan Recital 2 Introduction to Networking, Instructor: Prof. Yan Chen.
Linux+ Guide to Linux Certification, Second Edition
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Editing Java programs with the BlueJ IDE. Working environments to develop (= write) programs There are 2 ways to develop (write) computer programs: 1.Using.
Codesoft Label Creation. Codesoft Edition Overview Editions of Codesoft include: Codesoft Print Only – open and print files created in other versions.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Advanced File Processing
Configuring ROMS for South of Java Kate Hedstrom, ARSC/UAF October, 2007.
CFT Offline Monitoring Michael Friedman. Contents Procedure  About the executable  Notes on how to run Results  What output there is and how to access.
A First Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington Credits: a significant part of.
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Agenda Chapter 1: Linux (Unix) Features Commands (Chapters 2 & 3) Command Structure / Command line editing man, passwd, cal, date, whereis, which Working.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
Linux+ Guide to Linux Certification, Third Edition
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Lesson 2 How To Create a MOHID Project 19 Março 2013
Copyright © The McGraw-Hill Companies, Inc. Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 1 An Overview of MATLAB.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Week 3 Exploring Linux Filesystems. Objectives  Understand and navigate the Linux directory structure using relative and absolute pathnames  Describe.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
A Brief introduction to MatLAB ($50 - $99 for students)
Excel Workshop CHEM 2001, FALL Make some calculations Always begin a function with ‘=‘ Multiply X and Y Multiply X by 50 (2 methods) – Absolute.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Web Access. Overview  Purpose  Prerequisites  Install Components  Enable Virtual Directories  IIS Configuration & Security  Troubleshooting.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
Modeling of Power Converters using Matlab and Simulink
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
An Overview of ROMS Code Kate Hedstrom, ARSC April 2007.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
Vi editor Pronounced: `vee eye‘’. Agenda Describe the background of vi Editor Use vi editor to: create text files edit text files Our Goal is to create.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part B Shell Commands Professional Training.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
12. MODULES Rocky K. C. Chang November 6, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and William F. Punch and.
 Simple UNIX commands  I/O techniques in C++  Solutions to Lab#0 problems  Solutions to Lab#1 problems 1.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
Learning Unix/Linux Based on slides from: Eric Bishop.
Linux CSE 1222 CSE1222: Lecture 1BThe Ohio State University1.
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
LINGO TUTORIAL.
Matlab Training Session 4: Control, Flow and Functions
Some Linux Commands.
Introduction to MATLAB for Engineers, Third Edition
Python I/O.
Guide To UNIX Using Linux Third Edition
Linux Shell Script Programming
CARA MENGINSTALL MS DOS
Review of Previous Lesson
Presentation transcript:

MS 698: 2014 Implementing a Hydrodynamic Model - Part 2 Julia Moriarty 14 February 2014

Previously… Governing Equations Horizontal and Vertical Grid Time-Stepping (Mode-splitting) Compiling and Running 1D Test Case Basic plots in MATLAB This Week Changing Inputs, Outputs Practice Plotting

Types of Input  What types of input did we change last class?

Types of Input 1.Header file: sed_toy.h 2.Analytical files: ana_smflux.h, etc. 3.NetCDF files: boundary_conditions.nc, etc.  Not in SED_TOY 4.‘The’ input file: ocean_sed_toy.in

The Header File: ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Examples of header files for test cases Header file for model run: sed_toy.h

The Header File: sed_toy.h ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … …

What does the header file do? Defines or undefines options, usually related to the model setup and parameterizations Model Code: e.g. *.h, *.F

What does the header file do? Defines or undefines options, usually related to the model setup and parameterizations Model Code: e.g. *.h, *.F Model Code used for your model run: PROJECT/Build/*.f90 Compile

What does the header file do? Defines or undefines options, usually related to the model setup and parameterizations Model Code: e.g. *.h, *.F Model Code used for your model run: PROJECT/Build/*.f90 Compile

What options are available for header files? ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … cppdefs.h lists all options for header files -also see ROMS wiki: ki/index.php/Documentation _Portal

Model Forcing: Analytical files vs. NetCDF files Both analytical and NetCDF files provide ways to force your model (e.g. winds, model bathymetry, boundary information) – Only use one at a time for a particular forcing NetCDF files provide timeseries of data, more complicated model grids Analytical files are useful for simple forcing functions, e.g. constant or sinusoidal wind forcing, constant water depth, etc.

Analytical Files: e.g. ana_smflux.h ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … …

Analytical Files: ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Original copies of analytical files: ana_*.h Edited copies of analytical files stored in one of these directories

Analytical Files: ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Original copies of analytical files: ana_*.h Edited copies of analytical files stored in one of these directories Steps: 1.Specify directory for edited analytical files in build.bash (In this class, we used Include, not Functionals) 2.Copy original ana_*.h file to your PROJECT/Functionals or Include directory 3.Edit ana_*.h file(s) 4.(Re)compile code

NetCDF Files: ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … …

NetCDF Files: ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Examples of NetCDF forcing files (and *.in files) NetCDF forcing files may be stored anywhere, but are often stored here.

‘The’ Input Files Main input file: ocean.in Ocean.in calls other input files – sediment.in, floats.in, stations.in, …

‘Input Files’: ocean.in, sediment.in ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Examples of input files (and NetCDF forcing files) Input files may be stored anywhere, but it are often stored here.

What’s in ocean.in? Timesteps Open boundary conditions Basic horizontal and vertical grid information Directions for output files Paths for other input and output files (e.g. NetCDF files, sediment_sed_toy.in, ocean_his.nc) … and much more … The second half of the ocean.in file is a glossary explaining all of the different parameters in ocean.in

Editing Code and Input Files

Useful Linux Tools for Editing Code: Be creative: *,..,., ‘|more’, ‘> outfile.txt’ work with most commands CommandDescription diff file1.txt file2.txtPrints out a line-by-line comparison of file1.txt and file2.txt to the command line. diff file1.txt file2.txt > file1_vs_file2.txtCreates file1_vs_file2.txt, which is a line-by-line comparison of file1.txt and file2.txt grep SED_TOY ana_smflux.hPrints out line numbers of all occurrences of “SED_TOY” in ana_smflux.h to the command line grep SED_TOY ana_*.hPrints out line numbers of all occurrences of “SED_TOY” in all files starting with “ana_” and ending in (“.h”) to the command line grep SED_TOY * |morePrints out line numbers of all occurrences of “SED_TOY” in all files in this directory in the command line. The “|more” makes Linux print out only one page’s worth of text at a time. Press the spacebar or Enter to scroll through results. From within Emacs: Ctrl-s When prompted (at the bottom of the window) enter a string to search for, e.g. ‘SED_TOY’ Searches for “SED_TOY” within the file you have open in Emacs. This is case sensitive. Emacs begins searching from wherever your cursor is, moving downward in the document. To search upwards, use ‘Ctrl-r’ instead of ‘Ctrl-s’.

Other Useful Linux Tools: Be creative: ‘*’, ‘..’, ‘|more’, ‘> outfile.txt’ work with most commands Be careful with case-sensitive commands CommandDescription more file.txtScroll through file.txt in the command line ls */*/*.inList any file ending in “.in” that is located two directories below the current working directory. ls../../ana_*List all files starting with “ana_” that are located two directories above the current working directory ls../../trunk/ROMS/Functionals/ana_*List all files starting with “ana_” that are located two directories up, and then within the trunk/ROMS/Functionals directory tail ocean_sed_toy.logPrint out the last few lines of the file ocean_sed_toy.log tail –f ocean_sed_toy.logPrint out the lines of the file ocean_sed_toy.log as the file is written From within ROMS model code: write(6,*) ‘text’ variable Prints out “ text value_of_variable” to the log file in ROMS.

Is ROMS doing what you think its doing? ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Check output files *.f90 files are human- readable versions of the compiled code

Is ROMS doing what you think its doing? ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Check, then check again -Is the model code correct? -Does the model produce reasonable output? -Trouble shoot: -Look at *.f90’s, log file -Use write statements

Overview of Output Files History Files: ocean_his.nc – Stores time-series of instantaneous output. Time-Averaged Results: ocean_avg.nc – Stores time-series of time averaged values. Restart File: ocean_rst.nc – Used to restart a model run from exactly where it ended. Log File: ocean_sed_toy.log – Text file with information on model configuration, error messages, and much more. – Only created if specified in the oceanS command: oceanS Results/ocean_sed_toy.log &

ROMS Output ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … … Output files may be stored anywhere, but are often stored here.

ROMS Output: Location specified in ocean.in ROMS_OneD trunk PROJECT Results Build External ROMS Include Functionals External Include Functionals … …

Manipulating Output Files “Directions” for output files in ocean_*.in: – NHIS – number of time-steps between writing fields into history file – NDEFHIS – number of time-steps between the creation of a new history file. NDEFHIS = 0 creates a single history file. – HISNAME – name and path for history file – Hout(*) – Tells model if it should prints out each variable to the history file

Questions? >> Start lab activity

Manipulating Time Steps DT – Time-step (baroclinic) in seconds NDTFAST – number of barotropic time-steps between each baroclinic time step NTIMES – Total number of baroclinic timesteps. DSTART – First Timestamp of model “Δt in history file” = DT * NHIS “Total Model Time” = DT*NTIMES