Initial Conditions and Climatology Scripts: Difference between revisions
From WikiROMS
Jump to navigationJump to search
Created page with "<div class="title">Matlab: Initial Conditions and Climatology Scripts</div>__NOTOC__ This page describes several Matlab scripts to process ROMS initial conditions and climatolog…" (change visibility) |
No edit summary (change visibility) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
This page describes several Matlab scripts to process ROMS initial conditions and climatology data. | This page describes several Matlab scripts to process ROMS initial conditions and climatology data. | ||
<!-- Edit Template:Matlab_Scripts_TOC to modify this Table of Contents--> | |||
<div style="float: left;margin: 0 20px 0 0;">{{Matlab Scripts TOC}}</div>__NOTOC__ | |||
<div style="clear: both"></div> | |||
<section begin=roms2roms.m />;;<span id="roms2roms"></span><span class="blue">roms2roms.m</span> | <section begin=roms2roms.m />;;<span id="roms2roms"></span><span class="blue">roms2roms.m</span> | ||
:Interpolates requested 2D or 3D variable between two ROMS application grids. The receiver grid must be inside of the donor grid. This function is intended for down-scaling or nesting applications. The horizontal/vertical coordinates for the donor and the | :Interpolates requested 2D or 3D variable between two ROMS application grids. The receiver grid must be inside of the donor grid. This function is intended for down-scaling or nesting applications. The horizontal/vertical coordinates for the donor and the receiver grids are specified with array structures <span class="green">D</span> and <span class="green">R</span>, which are built elsewhere using the script [[Grid_Processing_Scripts#get_roms_grid|get_roms_grid.m]] for efficiency and functionality. <br /> | ||
::<span class="green">V</span> = <span class="red">roms2roms</span> (<span class="green">ncname</span>, <span class="green">D</span>, <span class="green">R</span>, <span class="green">Vname</span>, <span class="green">Tindex</span>, <span class="green">Rvector</span>, <span class="green">method</span>, <span class="green">offset</span>, <span class="green">RemoveNaN</span>) | ::<span class="green">V</span> = <span class="red">roms2roms</span> (<span class="green">ncname</span>, <span class="green">D</span>, <span class="green">R</span>, <span class="green">Vname</span>, <span class="green">Tindex</span>, <span class="green">Rvector</span>, <span class="green">method</span>, <span class="green">offset</span>, <span class="green">RemoveNaN</span>) | ||
:'''On Input:''' | :'''On Input:''' | ||
::<span class="green">ncname</span>: | ::{| class="matlab" | ||
|- | |||
|<span class="green">ncname</span>: | |||
|Donor grid NetCDF file name containing variable to process (string) | |||
|- | |||
|<span class="green">D</span>: | |||
|Donor grid structure containing all horizontal and vertical variables (struct array) | |||
:::<span class=" | |- | ||
|<span class="green">R</span>: | |||
|Receiver grid structure containing all horizontal and vertical variables (struct array) | |||
::<span class="green">offset</span>: | |- | ||
|<span class="green">Vname</span>: | |||
|Field variable name to process (string) | |||
|- | |||
|<span class="green">Tindex</span>: | |||
|Time record index to process (scalar) | |||
|- | |||
|<span class="green">Rvector</span>: | |||
|Switch to Interpolate U- and V-points variables to RHO-points to facilitate rotation in curvilinear grid applications elsewhere (logical) | |||
|- | |||
|<span class="green">method</span>: | |||
|Interpolation method in <span class="blue">TriScatteredInterp</span> (string): | |||
|- | |||
|} | |||
:::{| class="matlab" | |||
|- | |||
|<span class="twilightBlue">natural</span> | |||
|natural neighbor interpolation | |||
|- | |||
|<span class="twilightBlue">linear</span> | |||
|linear interpolation (default) | |||
|- | |||
|<span class="twilightBlue">nearest</span> | |||
|nearest-neighbor interpolation | |||
|- | |||
|} | |||
::{| class="matlab" | |||
|- | |||
|<span class="green">offset</span>: | |||
|Number of extra points to use when sampling the donor grid so it is large enough to contain the receiver grid (default 5) | |||
|- | |||
|<span class="green">RemoveNaN</span>: | |||
|Switch to remove '''NaN''' values from the interpolated variable with a second interpolation step using the nearest-neighbor method (default false) | |||
|- | |||
|} | |||
:'''On Output:''' | :'''On Output:''' | ||
::<span class="green">V</span>: | ::{| class="matlab" | ||
|- | |||
|<span class="green">V</span>: | |||
|Interpolated requested 2D or 3D variable | |||
|- | |||
|}<section end=roms2roms.m /> |
Latest revision as of 12:49, 4 May 2012
Matlab: Initial Conditions and Climatology Scripts
This page describes several Matlab scripts to process ROMS initial conditions and climatology data.
- roms2roms.m
- Interpolates requested 2D or 3D variable between two ROMS application grids. The receiver grid must be inside of the donor grid. This function is intended for down-scaling or nesting applications. The horizontal/vertical coordinates for the donor and the receiver grids are specified with array structures D and R, which are built elsewhere using the script get_roms_grid.m for efficiency and functionality.
- V = roms2roms (ncname, D, R, Vname, Tindex, Rvector, method, offset, RemoveNaN)
- On Input:
ncname: Donor grid NetCDF file name containing variable to process (string) D: Donor grid structure containing all horizontal and vertical variables (struct array) R: Receiver grid structure containing all horizontal and vertical variables (struct array) Vname: Field variable name to process (string) Tindex: Time record index to process (scalar) Rvector: Switch to Interpolate U- and V-points variables to RHO-points to facilitate rotation in curvilinear grid applications elsewhere (logical) method: Interpolation method in TriScatteredInterp (string):
natural natural neighbor interpolation linear linear interpolation (default) nearest nearest-neighbor interpolation
offset: Number of extra points to use when sampling the donor grid so it is large enough to contain the receiver grid (default 5) RemoveNaN: Switch to remove NaN values from the interpolated variable with a second interpolation step using the nearest-neighbor method (default false)
- On Output:
V: Interpolated requested 2D or 3D variable