Ocean currents variable change from C-grid to A-grid and vice versa #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR considers the ROMS 3D horizontal currents de-staggering variables change from C-grid to A-grid and vice versa from A-grid to C-grid. It is done to avoid complicated nonlinear and linear Variable changes in the ROMS-JEDI interface.
We define additional variables in the
OCEAN(ng)
structure: ua, va, tl_ua, tl_va, ad_ua, and ad_va. Here, the subscript a indicates A-grid.Creates a new module
uv_var_change.F
in ROMS that converts the u to ua and v to va, and vice versa.If vector components are transformed from C-grid to A-grid, rotate to geographically Eastward and Northward directions (PUBLIC routines:
uv_C2A_grid
,ad_uv_C2A_grid
,tl_uv_C2A_grid
):uv_A2C_grid
,ad_uv_A2C_grid
,tl_uv_A2C_grid
):The data assimilation minimization state vector X becomes zeta, ua, va, and t. Notice that the background error covariance, B, convolutions must be operated on ua and va. This will simplify the normalization coefficients and modeling of B.
We must build the ensembles in ua and va for flow-dependent error covariance, Be.
The new state vector simplifies the observation operator for ocean currents measured simultaneously (lon, lat, z) in the cell center A-grid. Also, rotating ($\xi$ , $\eta$ ) components to geographical Eastward and Northward velocities are trivial since the rotation angle is defined in the A-grid for both ROMS and current instruments.
It also simplifies the new observation operator object-oriented module we want to code for ROMS, facilitating the latest developments with spatial and temporal filters.
It will clean ROMS I/O logic for writing u_eastward and v_northward into output NetCDF files.
Notice that the background trajectory for linearizing the TLM and ADM kernel still needs u and v. But, we will still have access to ua and va when computing$\rm{H^{T}(X)}$ , which is needed to force the adjoint model at the observation locations.