Configuring ROMS for South of Java Kate Hedstrom, ARSC/UAF October, 2007.

Slides:



Advertisements
Similar presentations
Chapter 11 Introduction to Programming in C
Advertisements

Weather Research & Forecasting: A General Overview
Building CCSM2.0 Brian Kauffman CCSM Software Engineering Group
NCAS Unified Model Introduction Part 1b: Running the UM University of Reading, 3-5 December 2014.
Utilizing the GDB debugger to analyze programs Background and application.
Creating Shareable Models By: Eric Hutton CSDMS - Community Surface Dynamics Modeling System (pronounced ˈ s ɪ stəms) Image by Flickr user Let There Be.
Lecture 9: SHELL PROGRAMMING (continued) Creating shell scripts!
FORTRAN Short Course Week 4 Kate Thayer-Calder March 10, 2009.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction.
Guide To UNIX Using Linux Third Edition
 2000 Prentice Hall, Inc. All rights reserved. Chapter 13 - The Preprocessor Outline 13.1Introduction 13.2The #include Preprocessor Directive 13.3The.
1 CSC103: Introduction to Computer and Programming Lecture No 26.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
Enabling the ARM Learning in INDIA ARM DEVELOPMENT TOOL SETUP.
July 29, 2003Serguei Mokhov, 1 Makefile Brief Reference COMP 229, 346, 444, 5201 Revision 1.2 Date: July 18, 2004.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Unix Talk #2 (sed). 2 You have learned…  Regular expressions, grep, & egrep  grep & egrep are tools used to search for text in a file  AWK -- powerful.
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
Macros. There are three basic phases for C programming. preprocessing, compiling, and linking. C input file is first passed to a preprocessing program.
Makefiles CISC/QCSE 810. BeamApp and Tests in C++ 5 source code files After any modification, changed source needs to be recompiled all object files need.
The Structure of a C++ Program. Outline 1. Separate Compilation 2. The # Preprocessor 3. Declarations and Definitions 4. Organizing Decls & Defs into.
Old Chapter 10: Programming Tools A Developer’s Candy Store.
Introduction to C Programming CE Lecture 7 Compiler options and makefiles.
Introduction to Programming Using C Modularity. 2 Contents Modularity Functions Preprocessor Comments Global variables.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
MS 698: 2014 Implementing a Hydrodynamic Model - Part 2 Julia Moriarty 14 February 2014.
The european ITM Task Force data structure F. Imbeaux.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
GNU Make Computer Organization II 1 © McQuain What is make ? make is a system utility for managing the build process (compilation/linking/etc).
ROMS in Alaska Waters Kate Hedstrom, ARSC/UAF Enrique Curchitser, IMCS/Rutgers August, 2007.
ROMS as a Component of the Community Climate System Model (CCSM) Enrique Curchitser, IMCS/Rutgers Kate Hedstrom, ARSC/UAF Bill Large, Mariana Vertenstein,
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Beginning Fortran Fortran (77) Advanced 29 October 2009 *Black text on white background provided for easy printing.
Grid Generation with SeaGrid
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
An Overview of ROMS Code Kate Hedstrom, ARSC April 2007.
Compiler Directives. The C Preprocessor u The C preprocessor (cpp) changes your source code based on instructions, or preprocessor directives, embedded.
Report on POP & CICE of RACM components Jaromir Jakacki, IO PAS.
Report on POP & CICE of RACM components Jaromir Jakacki, IO PAS Boulder, CO, 2010.
NCAS Computational Modelling Service (CMS) Group providing services to the UK academic modelling community Output of UM Diagnostics Directly in CF NetCDF;
___________________________________________________________________________WRF-SI ___________________________________________________Community Modeling.
Emacs, Compilation, and Makefile C151 Multi-User Operating Systems.
Slide 1 NEMOVAR-LEFE Workshop 22/ Slide 1 Current status of NEMOVAR Kristian Mogensen.
1 Object-Oriented Programming -- Using C++ Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Object Oriented Programming COP3330 / CGS5409.  Compiling with g++  Using Makefiles  Debugging.
ENG College of Engineering Engineering Education Innovation Center 1 Functions 2 in MATLAB Topics Covered: 1.Functions in Script Files Inline Functions.
GNU Make Computer Organization II 1 © McQuain What is make ? make is a system utility for managing the build process (compilation/linking/etc).
UNIX Development: g++ and make CS 2204 Class meeting 8 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
Lecture 3 Translation.
ROMS Framework: Kernel
Separate Compilation and Namespaces
Chapter 13 - The Preprocessor
Introduction to Programming the WWW I
Makefile Tutorial CIS5027 Prof: Dr. Shu-Ching Chen
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
What is make? make is a system utility for managing the build process (compilation/linking/etc). There are various versions of make; these notes discuss.
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Chapter 11 Introduction to Programming in C
(Chapter 2) John Carelli, Instructor Kutztown University
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
C Preprocessor(CPP).
Unix Talk #2 (sed).
C Preprocessor Seema Chandak.
SPL – PS1 Introduction to C++.
The COAWST Toolbox COAWST Workshop 2019 NCSU ONR.
Presentation transcript:

Configuring ROMS for South of Java Kate Hedstrom, ARSC/UAF October, 2007

Requirements Input files –Grid –Initial conditions –Boundary conditions –Forcing Code changes –JAVA_1 cpp flag –ocean_java.in –makefile

Define Grid Coordinate System Provide a coastline file and point to it with XCOASTDATA Run xcoast Set the map projection

Specify the Grid Boundary

Save and Recompute Corners to Make a Rectangular Grid

Find lat,lon of Each Point, then Bathymetry

Land Mask The bathymetry finder will optionally set the land mask based on sea level The land mask might not be quite how you want it, so run editmask Interactive matlab tool needing a matlab coastline file too

Editmask

Smooth the Bathymetry

Another View

Bathymetric Slopes

Bathymetric Steepness Ratio of |h1-h2| / (h1+h2)

Grid Metrics on a Sphere

Initial and Boundary Files Matlab scripts to create them from the North Pacific run Requires matlab-netcdf interface Requires rnt toolbox from Emanuelle di Lorenzo Tell rnt_gridinfo about both grids - location of the files, vertical grid information

North Pacific at 18 km Run with CCSM CORE forcing and POP boundary conditions CORE files from 1958 through 2004 NPAC was run through 1976 so far Pick a file from 1976 to use as initial conditions 100 days before the end Enrique saved four-day averages

Southern Boundary v

Initial Zeta

Forcing Files ROMS can now internally interpolate from coarse forcing files to the ROMS grid Liz Dobbins prepared the CORE (Large and Yeager) forcing files in a format that ROMS can use This saves a lot of time, effort, and disk space

ROMS Code Outline of the code cpp cppdefs.h Modules ocean.in Note: understanding gnu make is important, but not covered in this talk

ls roms Atmosphere/ Lib/ User/ Build/ makefile Waves/ Compilers/ Master/ Data/ ROMS/ I also have an Apps directory here for my applications.

ls ROMS Adjoint/ License_ROMS.txt Bin/ Modules/ SeaIce/ Drivers/ Nonlinear/ Tangent/ External/ Obsolete/ Utility/ Functionals/ Programs/ Version Include/ Representer/

Most Important Drivers –Various model main programs Nonlinear –The regular ocean physics (forward model) Modules –Ocean model data types, with allocation and initialization routines Utility –File reading and writing routines and other files common to the various models

Support Include –Include files, including cppdefs.h Bin –Perl and shell scripts Compilers –System-dependent parts of the makefile Lib –ARPACK and MCT libraries (optional) External –ASCII input files

Other Data Assimilation –Adjoint –Representer –Tangent SeaIce Functionals –Analytic expressions for initial conditions, etc. Obsolete Programs

cpp The C preprocessor, cpp, comes with some C compilers, or the functionality can be built into a C compiler Very simple macro processor Used in ROMS primarily for conditional compilation We probably won’t switch to coco when it becomes widely available

cpp Versions People started using the C preprocessor before there was a C standard - the Standard cpp isn’t quite the version we want Gnu “cpp -traditional” does the right thing for Fortran

File Inclusion In Fortran, you can include files with: include ‘file.h’ In cpp, the equivalent is: #include “file.h” We use the cpp version to make sure the #defines in the include files are seen

Macro Substitution A macro definition has the form: #define text replacement text This is done in ROMS: #define WESTERN_EDGE Istr.eq.1 and used in: if (WESTERN_EDGE) then …. Safe as long as the replacement text is not much longer than the original

More on Macros Another type of macro substitution is like statement functions in Fortran Statement functions and the more modern inlined functions are better because the compiler can do type checking

Logical Macros A third kind of macro is something like: #define MASKING or #define MASKING 1 These can be tested like: #ifdef MASKING (first case) #if MASKING (second case) We use the first style for historical reasons, gnu has officially gone to the second

Conditional Compilation ROMS uses conditional code everywhere. #ifdef ICE ! Stuff having to do with sea ice #endif If you want to find out about (say) sediment code, do a search on SEDIMENT

More on Conditionals When setting up a problem of your own, it’s best to surround code you add with a unique cpp flag: #define LOMBOK_STRAIT : #ifdef LOMBOK_STRAIT ! My code #endif

Still More The #define for our case is now happening in the makefile, passed in with a -DMY_CASE flag The name of our case is used in the search for an include file, -DROMS_HEADER=my_case.h

Even More The ROMS Makefile will take our.F files and run them through cpp for us before passing them to the compiler The intermediate files have a.f90 extension The compiler errors will refer to line numbers in the.f90 file, not the original source file Fix the.F file, but feel free to look at the.f90 files to see what happened

cppdefs.h Every ROMS source file starts with: #include “cppdefs.h” This file has been changed to contain #if defined ROMS_HEADER # include ROMS_HEADER #endif The ROMS_HEADER variable comes from the makefile

Modules The model variables are stored in Fortran 90 modules defining specific types You no longer have to modify mod_param.F for your domain

Input file ROMS has an ascii input file which it reads during initialization The file is not a namelist, but similar in intent It specifies things like: –Number of timesteps –Number of gridpoints (Lm, Mm, N) –Parallel grid partitioning –Other input filenames, output options –Many others

Code Changes makefile - ROMS_APPLICATION := JAVA_1 Create User/Include/java_1.h file with cpp options Specify grid dimensions in ocean_java.in User/Functionals/ana_hmixcoef.h - add sponge layer with #ifdef JAVA_1

Horizontal Viscosity

ocean_java.in ASCII input file for ROMS Tells number of gridpoints Provide the paths to the grid, forcing, etc. files Specify the timestep and timestep ratio, viscosity values, etc. Which fields do you want to output and how often?

makefile Check the name of the compiler Set Debug/MPI/OpenMP/Large as needed Set name of application: JAVA_1 Provide number of grids (usually 1) Check “uname -s” on your computer Check location of netcdf library and set it in the Compilers/system-compiler.mk fragment Type “make”

Run it! Create a working directory with: oceanS External/ –ocean_java.in –varinfo.dat Run the thing:./oceanS < External/ocean_java.in

It should spit out a lot of text You can redirect this with:./oceanS ocean.out If successful, you will also obtain some other output files in NetCDF format

Get bold and try it in parallel! –Change the makefile (MPI or OpenMP) –The executable will be called OceanM or OceanO –If using MPI, run it with the input file as an argument, not standard in:./oceanM External/ocean_java.in