Opened 12 years ago

Closed 12 years ago

#535 closed upgrade (Done)

IMPORTANT: Added new Matlab scripts to process data for ROMS

Reported by: arango Owned by: arango
Priority: major Milestone: Matlab Processing Scripts
Component: Matlab Version: 3.6
Keywords: Cc:

Description

Added several new scripts to process initial conditions and boundary conditions for ROMS. In particular, processing ROMS to ROMS datasets. This is somewhat tricky. These scripts can be used for down-scaling and nesting applications. I expect to modify this scripts in the future as the ROMS nesting capabities evolve.

What Is New:

  • boundary/obc_roms2roms.m: Interpolates requested variable open boundary conditions from ROMS to ROMS grids. This is a generic and very complex script. It provides capabilities for rotation of vector components. It uses TriScatteredInterp for interpolation.
  • boundary/d_obc_roms2roms.m: Driver to extract open boundary conditions from a ROMS dataset. It creates open boundary conditions NetCDF file, interpolates data to application grid, and writes out data. It is a template showing how to use the obc_roms2roms script.
  • grid/get_roms_grid.m: Builds or updates a ROMS grid structure array for a particular ROMS application. This is an important script that will be used extensively from now on. It can be used in various modes. A full structure contains the following fields:
        G =
              grid_name: 'gom_grid_a.nc'
             TimeRecord: 'Computing unperturbed depths, zeta=0'
                     Lm: 256
                     Mm: 128
                      N: 40
             Vtransform: 2
            Vstretching: 4
                theta_s: 7
                theta_b: 2
                 Tcline: 250
                     hc: 250
                  s_rho: [1x40 double]
                   Cs_r: [1x40 double]
                    s_w: [1x41 double]
                   Cs_w: [1x41 double]
              spherical: 1
            curvilinear: 1
        vector_rotation: 0
                  x_rho: [258x130 double]
                  y_rho: [258x130 double]
                  x_psi: [257x129 double]
                  y_psi: [257x129 double]
                    x_u: [257x130 double]
                    y_u: [257x130 double]
                    x_v: [258x129 double]
                    y_v: [258x129 double]
                lon_rho: [258x130 double]
                lat_rho: [258x130 double]
                lon_psi: [257x129 double]
                lat_psi: [257x129 double]
                  lon_u: [257x130 double]
                  lat_u: [257x130 double]
                  lon_v: [258x129 double]
                  lat_v: [258x129 double]
           lon_rho_west: [1x130 double]
           lat_rho_west: [1x130 double]
           lon_rho_east: [1x130 double]
           lat_rho_east: [1x130 double]
          lon_rho_south: [258x1 double]
          lat_rho_south: [258x1 double]
          lon_rho_north: [258x1 double]
          lat_rho_north: [258x1 double]
             lon_u_west: [1x130 double]
             lat_u_west: [1x130 double]
             lon_u_east: [1x130 double]
             lat_u_east: [1x130 double]
            lon_u_south: [257x1 double]
            lat_u_south: [257x1 double]
            lon_u_north: [257x1 double]
            lat_u_north: [257x1 double]
             lon_v_west: [1x129 double]
             lat_v_west: [1x129 double]
             lon_v_east: [1x129 double]
             lat_v_east: [1x129 double]
            lon_v_south: [258x1 double]
            lat_v_south: [258x1 double]
            lon_v_north: [258x1 double]
            lat_v_north: [258x1 double]
               mask_rho: [258x130 double]
               mask_psi: [257x129 double]
                 mask_u: [257x130 double]
                 mask_v: [258x129 double]
                  angle: [258x130 double]
                     pm: [258x130 double]
                     pn: [258x130 double]
                      h: [258x130 double]
                      f: [258x130 double]
                    z_r: [258x130x40 double]
                    z_u: [257x130x40 double]
                    z_v: [258x129x40 double]
                    z_w: [258x130x41 double]
                     Hz: [258x130x40 double]
    
  • initial/roms2roms.m: Interpolates requested variable data from ROMS to ROMS grids. This is a generic and complex script. It uses TriScatteredInterp for interpolation.
  • initial/d_roms2roms.m: Driver template to process ROMS initial conditions using the roms2roms script.
  • initial/d_mercator2roms.m: Driver template to process ROMS initial conditions using the mercator2roms script.
  • utility/nanland.m: Mask Land points to NaN to facilitate plotting. For example, we can have:
         pcolor(rlon, rlat, nanland(salt(:,:,20),'my_grid.nc') )
    or
         pcolor(G.lon_rho, G.lat_rho, nanland(salt(:,:,20),G) )
    or
         pcolor(G.lon_rho, G.lat_rho, nanland(salt(:,:,20),G.mask_rho) )
    
  • utility/rotate_vec.m: Rotates vector components from TRUE East and North to curvilinear coordinates (XI,ETA) orientation or viceversa. Input vector components may be located at the center of the cell (RHO-points) or at staggered Arakawa's C-grid locations.
  • utility/sample_grid.m: Gets Parent grid indices range of the polygon that tightly contains the Target Grid.

Recall that all the Matlab scripts in this repository can process input files on an OpenDAP server. See src:ticket:531

Change History (1)

comment:1 by arango, 12 years ago

Resolution: Done
Status: newclosed
Note: See TracTickets for help on using tickets.