Lateral Boundary Conditions Scripts: Difference between revisions

From WikiROMS
Jump to navigationJump to search
No edit summary   (change visibility)
No edit summary   (change visibility)
 
(One intermediate revision by the same user not shown)
Line 14: Line 14:
::<span class="green">B</span> = <span class="red">obc_roms2roms</span> &nbsp;(<span class="green">ncname</span>, <span class="green">D</span>, <span class="green">R</span>, <span class="green">VarList</span>, <span class="green">Tindex</span>, <span class="green">boundary</span>, <span class="green">method</span>, <span class="green">offset</span>, <span class="green">RemoveNaN</span>)
::<span class="green">B</span> = <span class="red">obc_roms2roms</span> &nbsp;(<span class="green">ncname</span>, <span class="green">D</span>, <span class="green">R</span>, <span class="green">VarList</span>, <span class="green">Tindex</span>, <span class="green">boundary</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>: &nbsp;  Donor grid NetCDF file name containing variables to process (string)
::{| class="matlab"
::<span class="green">D</span>: &nbsp;  Donor grid structure containing all horizontal and vertical variables (struct array)
|-
::<span class="green">R</span>: &nbsp;  Receiver grid structure containing all horizontal and vertical variables (struct array)
|<span class="green">ncname</span>:
::<span class="green">VarList</span>: &nbsp;  List of variable names to process (cell array)
|Donor grid NetCDF file name containing variables to process (string)
::<span class="green">Tindex</span>: &nbsp;  Time record index to process (scalar)
|-
::<span class="green">boundary</span>: &nbsp;  Lateral boundary condition switches (logicals) of the grid edges to process (struct array):
|<span class="green">D</span>:
:::<span class="red">boundary.west </span> - Western  edge
|Donor grid structure containing all horizontal and vertical variables (struct array)
:::<span class="red">boundary.east </span> - Eastern  edge
|-
:::<span class="red">boundary.south</span> - Southern edge
|<span class="green">R</span>:
:::<span class="red">boundary.north</span> - Northern edge
|Receiver grid structure containing all horizontal and vertical variables (struct array)
::<span class="green">method</span>: &nbsp;  Interpolation method in <span class="blue">TriScatteredInterp</span> (string):
|-
:::<span class="red">natural</span> - &nbsp;  natural neighbor interpolation
|<span class="green">VarList</span>:
:::<span class="red">linear </span> - &nbsp;  linear interpolation (default)
|List of variable names to process (cell array)
:::<span class="red">nearest</span> - &nbsp;  nearest-neighbor interpolation
|-
::<span class="green">offset</span>: &nbsp;  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">Tindex</span>:
::<span class="green">RemoveNaN</span>: &nbsp;  Switch to remove '''NaN''' values from interpolated variable with a second interpolation step using the nearest-neighbor method (default false)
|Time record index to process (scalar)
|-
|<span class="green">boundary</span>:
|Lateral boundary condition switches (logicals) of the grid edges to process (struct array):
|-
|}
:::{| class="matlab"
|-
|<span class="green">boundary.west</span>
|Western  edge
|-
|<span class="green">boundary.east</span>
|Eastern  edge
|-
|<span class="green">boundary.south</span>
|Southern edge
|-
|<span class="green">boundary.north</span>
|Northern edge
|-
|}
::{| class="matlab"
|-
|<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 interpolated variable with a second interpolation step using the nearest-neighbor method (default false)
|-
|}
:'''On Output:'''
:'''On Output:'''
::<span class="green">B</span>: &nbsp; Interpolated requested 2D or 3D lateral boundary variables (struct array)<section end=obc_roms2roms.m />
::{| class="matlab"
|-
|<span class="green">B</span>:
|Interpolated requested 2D or 3D lateral boundary variables (struct array)
|-
|}<section end=obc_roms2roms.m />

Latest revision as of 13:13, 4 May 2012

Matlab: Lateral Boundary Conditions Scripts

This page describes several Matlab scripts to process ROMS lateral boundary conditions data.



obc_roms2roms.m
Interpolates requested 2D or 3D lateral boundary conditions variables 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 and receiver grids are specified with array structures D and R, which are built elsewhere using script get_roms_grid.m for efficiency and functionality.
B = obc_roms2roms  (ncname, D, R, VarList, Tindex, boundary, method, offset, RemoveNaN)
On Input:
ncname: Donor grid NetCDF file name containing variables 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)
VarList: List of variable names to process (cell array)
Tindex: Time record index to process (scalar)
boundary: Lateral boundary condition switches (logicals) of the grid edges to process (struct array):
boundary.west Western edge
boundary.east Eastern edge
boundary.south Southern edge
boundary.north Northern edge
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 interpolated variable with a second interpolation step using the nearest-neighbor method (default false)
On Output:
B: Interpolated requested 2D or 3D lateral boundary variables (struct array)