RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP
Transcript of RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP
![Page 1: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/1.jpg)
RegCM-ROMS Tutorial: Introduction to ROMS Ocean Model Ufuk Utku Turuncoglu ICTP (International Center for Theoretical Physics) Earth System Physics Section
![Page 2: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/2.jpg)
Outline • Introduction • Grid generation and smoothing • Input files
• Forcing, initial, boundary conditions etc.
• Getting ROMS code • Configuration of the model • Installation • Namelist file and running in standalone mode
- Outline
![Page 3: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/3.jpg)
- Introduction (1/2)
• Basics of the ROMS ocean model
ROMS • Primitive equations with potential temperature, salinity, and an
equation of state • Hydrostatic and Boussinesq approximations • It supports different advection and mixing schemes • It supports point sources and sinks (i.e. river discharge) • It has version that is coupled with ice model Horizontal Grid • Arakawa C • Orthogonal-curvilinear coordinates (with masking of land areas) • Support for closed basins (like lakes, inland waters etc.) and domains
with periodic and also open boundary conditions Vertical Grid • Terrain following sigma coordinate • Free surface
![Page 4: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/4.jpg)
- Introduction (2/2)
• Steps to create an application (standalone ROMS)
Create input files (also can be generated analytically by Fortran code) • Grid • Forcing (atmospheric, river etc.) • Boundary Condition (BC) - if domain has open boundaries • Initial Condition (IC) • Climatology - if nudging and/or relaxation are activated Create configuration file (*.h) • A set of CPP option must be defined such as advection, mixing, flux
calculation etc. Create namelist file (*.in) • User needs to edit namelist file based on the created application
(additional namelist file exist for ICE model). Run • Edit machine specific definitions (Build/*.mk and build.sh) • Run the model
Independent from vertical coordinates
create these files after vertical coordinates changed
![Page 5: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/5.jpg)
- Grid Generation (1/7)
• Grid Generation Tools
Matlab (w and w/o GUI) • SEAGRID, GRIDGEN, EASYGRID etc. • More info: https://www.myroms.org/wiki/index.php/Grid_Generation Python • pyroms: https://github.com/kshedstrom • has several different versions. It can be also used to create input files
complex grid Simpler grid
![Page 6: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/6.jpg)
- Grid Generation (2/7)
• Grid Generation Example (with pyroms)
Caspian Sea Grid • There is no open boundary • ETOPO-1 is used for bathymetry • Horizontal resolution is ~10 km with 32 sigma layers (theta-s = 7.0,
theta-b = 0.2, hmin = 5 m)
![Page 7: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/7.jpg)
- Grid Generation (3/7)
• Grid Generation Example (with pyroms)
![Page 8: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/8.jpg)
- Grid Generation (4/7)
• Grid Generation Example (with pyroms)
![Page 9: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/9.jpg)
- Grid Generation (5/7)
• Grid Generation Example (with pyroms)
Grid Stiffness Ratios (indicator for PGE and CFL error) • Beckman & Haidvogel Number (1993)
• Haney Number (1991)
rx1 =maxzi, j,k − zi−1, j,k + zi, j,k−1 − zi−1, j,k−1zi, j,k + zi−1, j,k − zi, j,k−1 − zi−1, j,k−1
"
#$$
%
&''
rxo =maxΔh2h"
#$
%
&'=max
hi − hi−1hi + hi−1)
"
#$
%
&'
Reduced by smoothing. The value should be < 0.25
Reduced by smoothing and vertical coordinate mod. The value should be < 6.0
![Page 10: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/10.jpg)
- Grid Generation (6/7)
• Grid Generation Example (with pyroms)
• The Matlab smoothing toolbox (LP_Bathymetry) can be also used to fix the bathymetry
• http://drobilica.irb.hr/~mathieu/Bathymetry/
![Page 11: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/11.jpg)
- Grid Generation (7/7)
• Grid Generation Example (with pyroms)
Vertical Coordinates • Vertical Transformation (opt: 1-2)
• Vertical Stretching Functions (opt: 1-4) 2 – higher resolution at the surface 3 – for shallow applications 4 – default in current version of ROMS, user can control stretching both in surface and bottom
h x, y( )→ z x, y,σ , t( )
https://www.myroms.org/wiki/index.php/Vertical_S-coordinate
![Page 12: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/12.jpg)
- Creating Forcing, Initial and Boundary Condition (1/6)
• ROMS Input Requirements
Atmospheric Forcing • Surface atmospheric conditions are needed to drive the ocean model • These variables are used to calculate heat, momentum and
momentum fluxes over the ROMS domain • Fields must be interpolated into ROMS grid. The wind components
must be rotated to destination grid (in this case ROMS). Unit conversion might be needed
Initial Conditions (IC) • Initial condition (T,S,U,V) must be given to ocean model. The model
can be started from simple vertical temperature and salinity profile with no motion (spin-up run needed and length depends on the application)
Boundary Conditions (BC) • If domain has open boundary conditions like Mediterranean Sea Input for nudging and/or relaxation • Temperature and salinity observations must be interpolated into ROMS
ocean model grid. The model try to minimize the difference !!!
![Page 13: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/13.jpg)
- Creating Forcing, Initial and Boundary Condition (2/6)
• ROMS Input Requirements Input files and the required fields can change based on selected CPP options in *.h file. • LONGWAVE_OUT: net shortwave flux, downwelling longwave flux,
surface temperature, mixing ratio and pressure, wind components, rain • LONGWAVE: net longwave flux rather than downwelling longwave flux • w/o BULK_FLUXES: wind stress, net heat fluxes, fresh water flux • ALBEDO and/or CLOUD: needs cloud fraction as input • *_TIDES: needs tidal forcing file with point sources (i.e. rivers) • UV_PSOURCE, Q_PSOURCE: needs extra NetCDF forcing files with RegCM coupling • BULK_FLUXES+LONGWAVE_OUT+REGCM_COUPLING must be
defined for coupled mode (RegCM+ROMS). with nudging and/or relaxation • Needs four-dimensional (x,y,z,t) temperature and salinity fields
![Page 14: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/14.jpg)
- Creating Forcing, Initial and Boundary Condition (3/6)
• Tools to create input files
Matlab • ROMS Matlab Package: http://www.myroms.org/software/Processing/ Python • pyroms: https://github.com/kshedstrom • ESMF Python Interface: http://earthsystemcog.org/projects/esmp/ NCL (now supports ESMF offline re-gridding)
2d interpolation
3d interpolation
![Page 15: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/15.jpg)
- Creating Forcing, Initial and Boundary Condition (4/6)
• Initial condition file (with pyroms)
3d interpolation 2d interpolation
• The original pyroms python module does not support AGrid (but it could be generated using logic of the BGrid python files)
• The interpolation weight files are created by SCRIP toolbox (it has a Python wrapper) but it can be modified to use ESMP
• Info about SCRIP toolbox: http://climate.lanl.gov/Software/SCRIP/
Image - Arakawa Grid Types - http://trac.mcs.anl.gov/projects/parvis/wiki/Discretizations
![Page 16: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/16.jpg)
- Creating Forcing, Initial and Boundary Condition (5/6)
• Initial condition file (with pyroms)
• It basically creates the NCO commands to merge the variables into a single file.
• NCO must be installed before using this method to merge data !!! • More information about NCO: http://nco.sourceforge.net/
![Page 17: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/17.jpg)
- Creating Forcing, Initial and Boundary Condition (6/6)
• Creating interpolation weight matrix (with pyroms)
• It creates the interpolation weight matrix. This can be done outside of the pyroms but in this case grid definition netcdf files must be created by user.
![Page 18: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/18.jpg)
- Getting ROMS Code (1/1)
• Getting ROMS code
Register • New users must be register via following web site.
https://www.myroms.org/index.php?page=login Download Source Code via SVN • SVN is a version control system • SVN must be installed • List of tagged versions: svn ls https://www.myroms.org/svn/src/tags • Checkout: svn co --username [YOUR_USER_NAME] https://
www.myroms.org/svn/src/tags/roms-3.5 roms-3.5 • Ice branch is in the https://github.com/kshedstrom but there is no
tagged version. Notes • The coupled modeling system currently uses ROMS version 3.5 and
user needs to apply small patch to enable coupling. • The same patch can be used to create patch for ice version of ROMS
![Page 19: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/19.jpg)
- Configuration of the Model (1/1)
• Header file (*.h) cas.h
• The file includes set of preprocessor (CPP) flag to activate specific part of the code.
• The whole list of the available CPP options - ROMS/Include/cppdefs.h
Ice model related definitions
No open boundary E/N/S/W closed
![Page 20: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/20.jpg)
- Installation (1/2)
• Steps
Edit machine specific file (*.mk) • Files is in the Compilers/ directory
Create case directory • This directory is used to run the model • The required files *.h (header file) • Copy build script (build.sh) from ROMS/Bin directory to case directory • Edit build.sh (specify source path, case name, compiler and MPI types
etc.) • Install ROMS using ./build.sh command (this will create oceanM file, if
debug option is specified the file name will be oceanG) • Create input and output directories under case directory • Copy grid, forcing, initial and boundary forcing files to input directory
Linux+Intel Fortran Compiler
![Page 21: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/21.jpg)
- Installation (2/2)
• build.sh
![Page 22: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/22.jpg)
- Running ROMS (1/3)
• Editing namelist file (*.in) cas.in
domain size and number of vertical layer
Domain decomposition parameters, must be consistent with job submission script !!!
option for restart, NRREC = -1 is fresh run
option for output interval
![Page 23: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/23.jpg)
- Running ROMS (2/3)
• Editing namelist file (*.in) cas.in
Height of surface atmospheric data
Jerlow water type. Related with turbidity and shortwave rad. penetration. 5 is more turbid
Vertical grid definition, it must be consistent with input files !!!
• There are options for input files • Options for horizontal and vertical mixing coefficents • Options for output fields • Options for open boundary conditions • …
![Page 24: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/24.jpg)
- Running ROMS (1/1)
• Creating run script
PBS
• Job can be submitted via “qsub roms.job” command LSF
• Job can be submitted via “bsub < roms.lsf” command
roms.job
roms.lsf
![Page 25: RegCM-ROMS Tutorial: Introduction to ROMS Ocean - gforge - ICTP](https://reader031.fdocuments.us/reader031/viewer/2022021022/620495404b1be21e4726f17a/html5/thumbnails/25.jpg)
- End of ROMS Tutorial
• Last words … “ROMS is one of the most advanced and complex numerical models in the world. The learning Curve is very steep but it is our experience that the model grows on the user when he/she realizes its capabilities.”
from user registration form
Facts and Suggestions: • There is no single tool to create all the input files and setup an
application. This needs an additional learning curve and everybody has its own way.
• Some nice tools are available and can be used but you might need to modify them !!!
• The ROMS code getting very complex and user needs some experience about ocean modeling.
• Run the application in standalone mode (only ocean model) and tune it. Do some long run and check the drift !!! After that you can go one step further and couple RegCM-ROMS.