Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocean currents variable change from C-grid to A-grid and vice versa #43

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

hga007
Copy link
Collaborator

@hga007 hga007 commented Nov 17, 2024

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):

    Urho(i,j,k) = 0.5 * ( u(i,j,k,ninp) + u(i+1,j,k,ninp) )   i=Istr:Iend 
    Vrho(i,j,k) = 0.5 * ( v(i,j,k,ninp) + v(i,j+1,k,ninp) )   j=Jstr:Jend

Apply lateral boundary conditions (gradient) via 'bc_r3d_tile' and rotate:

    ua(i,j,k) = Urho(i,j,k) * CosAngler(i,j) - Vrho(i,j,k) * SinAngler(i,j)
    va(i,j,k) = Vrho(i,j,k) * CosAngler(i,j) + Urho(i,j,k) * SinAngler(i,j)
  • If vector components are transformed from A-grid to C-grid, rotate to computational $\xi$ and $\eta$ directions (PUBLIC routines: uv_A2C_grid, ad_uv_A2C_grid, tl_uv_A2C_grid):
    Urot(i,j,k) = ua(i,j,k) * CosAngler(i,j) + va(i,j,k) * SinAngler(i,j)
    Vrot(i,j,k) = va(i,j,k) * CosAngler(i,j) - ua(i,j,k) * SinAngler(i,j)

 Thus

    u(i,j,k,nout) = 0.5 * ( Urot(i-1,j,k) + Urot(i,j,k) )      i=Istr:IendR
    v(i,j,k,nout) = 0.5 * ( Vrot(i,j-1,k) + Vrot(i,j,k) )      j=Jstr:JendR
  • 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.

@hga007 hga007 added the enhancement New feature or request label Nov 17, 2024
@hga007 hga007 self-assigned this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant