# Cold start initial velocity at nest boundary

**URL:** <https://nemo-ocean.discourse.group/t/cold-start-initial-velocity-at-nest-boundary/716>\
**Category:** v4.2.x\
**Tags:** AGRIF\
**Created:** [27 June 2024 14:18 UTC](https://nemo-ocean.discourse.group/t/cold-start-initial-velocity-at-nest-boundary/716 "2024-06-27T14:18:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhilt](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mhilt](https://nemo-ocean.discourse.group/u/mhilt)\
**Post date:** [27 June 2024 14:18 UTC](https://nemo-ocean.discourse.group/t/cold-start-initial-velocity-at-nest-boundary/716/1 "2024-06-27T14:18:43Z")

</div>

Hello Nemo community,

I am starting to run 2-way nested simulations with Nemo4.2.1-Agrif, I’ve started with a simple test in my regional configuration of a nest with no temporal nor spatial refinement. Child is initialized from parent who in turn is initialized from a TS field only, so initial velocity in the domain is 0.  
However comparing this run with a no nest one, even though I set rn\_sponge\_tra , rn\_sponge\_dyn , rn\_trelax\_tra , rn\_trelax\_dyn all to 0, I see a difference in the signal of velocity and sea level at the boundaries in the first few timesteps.

I dugged a bit in the code and eventually found that while the nest correctly starts with initial velocities at 0, velocities appear during the first barotropic timestep :  
-In `dynspg_ts.F90` line 364 , the subroutine `Agrif_dta_ts` is called just before the loop for barotropic time integration, in that subroutine (in `agrif_oce_interp.F90`) the variables ubdy and vbdy are modified by taking velocity from the parent (call routine `Agrif_Bc_variable`), however when I do a sum of one of this variable in the code, it is nonzero at the first call (ie, start of first baroclinic timestep).  
-This leads to nonzero values during the first barotropic timestep for zhU,zhV (after the call to subroutine `agrif_dyn_ts_flux` , line 514 of `dynspg_ts.F90`). For the parent, those variables are correctly 0 during the first barotropic timestep.

So my question is, when Agrif\_dta\_ts is called by the child in `dynspg_ts.F90`, has the parent already started its barotropic integration ? Otherwise I don’t understand where it gets nonzero values to fill ubdy…

> **Some more info**
>
> Here is the code I use to sum ubdy :
> 
> ```auto
> $diff agrif_oce_interp.F90 ../../../src/NST/agrif_oce_interp.F90
> 61,62d60
> < # include "do_loop_substitute.h90"
> < !^TST
> 682,683d679
> < REAL(wp) :: tvel ! TST
> < INTEGER :: ji, jj!TST
> [...]
> 736,744d714
> < IF(lwp) WRITE(numout,*) '-----TSTagrdtats2----ts=',kt
> < tvel=0._wp
> < DO_2D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )
> < tvel=tvel+ ubdy(ji,jj)
> < END_2D
> < CALL mpp_sum( 'trdglo', tvel)
> < IF(lwp) WRITE(numout,*) 'sum DO(ubdy) = ',tvel
> < IF(lwp) WRITE(numout,*) '-----------------'
> 
> ```
> 
> Since the nemo agrif testcase (ORCA2 with 3 nests) also has a nest without refinement (1st one), I looked there too and get the same behaviour. From 1\_ocean.output:
> 
> ```auto
> dyn:hpg_sco : hydrostatic pressure gradient trend
> ~~~~~~~~~~~ s-coordinate case, OCE original scheme used
> 
> dyn_spg_ts : surface pressure gradient trend
> ~~~~~~~~~~ free surface with time splitting
> 
> -----TSTagrdtats2----ts= 1
> sum DO(ubdy) = -484270105.158229
> -----------------
> 
> ```

Thanks,  
Margaux
