# Rotate u and v model grid to regular lat lon grid

**URL:** <https://nemo-ocean.discourse.group/t/rotate-u-and-v-model-grid-to-regular-lat-lon-grid/384>\
**Category:** Global\
**Tags:** orca\
**Created:** [26 October 2022 03:56 UTC](https://nemo-ocean.discourse.group/t/rotate-u-and-v-model-grid-to-regular-lat-lon-grid/384 "2022-10-26T03:56:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dramauh](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@dramauh](https://nemo-ocean.discourse.group/u/dramauh)\
**Post date:** [26 October 2022 03:56 UTC](https://nemo-ocean.discourse.group/t/rotate-u-and-v-model-grid-to-regular-lat-lon-grid/384/1 "2022-10-26T03:56:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![smasson](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@smasson](https://nemo-ocean.discourse.group/u/smasson)\
**Post date:** [28 October 2022 09:31 UTC](https://nemo-ocean.discourse.group/t/rotate-u-and-v-model-grid-to-regular-lat-lon-grid/384/2 "2022-10-28T09:31:58Z")

</div>

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

```fortran
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

```fortran
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

---

<div class="post-metadata">

**Author:** ![dramauh](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@dramauh](https://nemo-ocean.discourse.group/u/dramauh)\
**Post date:** [29 October 2022 06:02 UTC](https://nemo-ocean.discourse.group/t/rotate-u-and-v-model-grid-to-regular-lat-lon-grid/384/3 "2022-10-29T06:02:29Z")

</div>

Hi Sébastien,

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

Kind regards,

Estanislao
