Opened 14 years ago

Closed 14 years ago

#461 closed upgrade (Done)

Updated several matlab/4dvar scripts

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

Description (last modified by arango)

Several scripts were updated in the matlab/4dvar repository. All the changes take into account the feedback that we got from users at the ROMS 4D-Var data assimilation workshop at UCSC last week.

  • 4dvar/balance_driver.m: substantially changed this driver to use dynamical field names in the structure.
  • 4dvar/balance_4dvar.m: changed the output field names in the K structure (see below) for clarity and to facilitate dynamical fields when using the working structures. This is an elegant and compact way to compute the balanced and unbalanced operators. I added the logic to compute the balanced free-surface contribution by integrating the hydrostatic equation from the level of no motion (LNM_depth) to the surface.
  • 4dvar/obs_depth.m: using dynamical field names in the structure.
  • 4dvar/obs_ijpos.m: the inside function is replaced with the intrinsic function inpolygon. This is a much better function since it give us the observations inside and on the edge of the application grid. I also improved the curvilinear/spherical correction when computing the fractional x- and y-grid locations. This now works for very large number of observations. A new input argument switch obc_edge is added to the function to process observation at the open boundary edges of the application grid.
  • 4dvar/super_obs.m: a new field (Sout.std) is added to the output structure containing the standard deviation of the binning which can be used as observation error. You may choose to assign this value as observation error before writing to NetCDF file:
    Sout.error = max(Sout.error, Sout.std)
    
    That is, the larger observation variance is chosen. A zero value for Sout.std indicates that the observation did not required binning.
  • 4dvar/zeta_balance.m: added option to integrating the hydrostatic equation (elliptic = 0, LNM_depth > 0) from the level of no motion to the surface. This option was missing. Notice that the integration is done in an efficient and elegant way (very tricky).
  • boundary/extract_bry.m: a new function to read requested variable from a ROMS NetCDF file at the specified time record and extracts the lateral boundary edges. No interpolation is carried out.

The obsolete function 4dvar/inside.m is removed. It is too inefficient and inpolygon is far superior.

The drivers to compute standard deviation (d_std.m, d_std_bry.m, d_std_frc.m, and d_std_unbalanced.m) were substantially improved to separate user preamble with generic code. It now uses dynamical field names in the structures. This made the scripts simpler and compact.

The drivers d_ssh_obs.m and d_sst_obs.m were slightly modified to include new parameters to the obs_ijpos.m function call.

Warning: the field names in the structure K were changed to facilitate dynamical field names:

  new               old

K.temp_bal        K.deltaT
K.salt_bal        K.deltaS_b
K.u_bal           K.deltaU_b
K.v_bal           K.deltaV_b
K.zeta_bal        K.zeta_b
K.ubar_val
K.vbar_bal
K.rho_ano

For completeness, the K.ubar_bal and K.vbar_bal is computed by vertically integrating K.u_bal and K.v_bal. This is just for diagnostic purposes since they are not used in ROMS.

I am very happy about the functionality of obs_ijpos.m and super_obs.m. These functions are critical when processing the observations.

Many thanks to all you who gave me feedback in these processing scripts.

Change History (1)

comment:1 by arango, 14 years ago

Description: modified (diff)
Resolution: Done
Status: newclosed
Note: See TracTickets for help on using tickets.