Dear Community,

I would like to rotate the velocity components to the regular lat lon grid.

I think I need to use this expression

However, I am not sure how to compute the rotation angle from the model grid variables

Dear Community,

I would like to rotate the velocity components to the regular lat lon grid.

I think I need to use this expression

u_{latlon} = u_{rot} \cos \alpha - v_{rot} \sin \alpha \\
v_{latlon} = u_{rot} \sin \alpha + v_{rot} \cos \alpha

However, I am not sure how to compute the rotation angle from the model grid variables

1 Like

I basically agree with the expression you propose however, as nemo use a staggered grid (arakawa c-grid), u_{rot} and v_{rot} are not located at the same place (so you cannot add them directly) and the angle \alpha will won’t be the same for u_{rot} and v_{rot}.

One solution could be to first compute u_{rot} and v_{rot} on a common T point

```
u_rot_T(ji,jj) = 0.5 * ( u_rot_U(ji,jj) + u_rot_U(ji-1,jj) )
v_rot_T(ji,jj) = 0.5 * ( v_rot_V(ji,jj) + v_rot_V(ji,jj-1) )
```

and next apply your expression

```
u_latlon_T = u_rot_T cos(alpha_T) - v_rot_T sin(alpha_T)
v_latlon_T = u_rot_T sin(alpha_T) + v_rot_T cos(alpha_T)
```

The angle `cos(alpha_T)`

and `sin(alpha_T)`

are computed in the subroutine `angle`

in the file *src/OCE/SBC/geo2oce.F90*. It is variables `gsint`

and `gcost`

.

The vector rotation itself is coded in the subroutine `rot_rep`

in the same file *src/OCE/SBC/geo2oce.F90*. What you want to do correspond to the cases 'ij->e’ and 'ij->n’.

You can find example of the use of `rot_rep`

in the subroutine `sbc_cpl_snd`

in the file *src/OCE/SBC/sbccpl.F90*

I hope this helps,

Sébastien

1 Like

Hi Sébastien,

thank so much for your reply. I am going to take a careful to these subroutines.

Kind regards,

Estanislao