New URL for NEMO forge!

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2311 (minor bug in code to do Euler timestep in dyn_nxt) – NEMO

Opened 5 years ago

Closed 4 years ago

Last modified 2 years ago

#2311 closed Bug (fixed)

minor bug in code to do Euler timestep in dyn_nxt

Reported by: davestorkey Owned by: davestorkey
Priority: low Milestone: Unscheduled
Component: DYN Version: v4.0
Severity: minor Keywords: v4.0
Cc: acc


BE CAREFUL !!! Due to dynamic behaviour of this ticket creation page, it is highly recommend to set first all other fields before writing the ticket description below.
If you have lost your draft after an unwanted reload, you can click on the link 'Restore Form' in the contextual menu upper right to recover it.
Remove these lines after reading.


If we use an Euler forward timestep at the beginning of the integration then we don't need to time-filter the fields and so we just swap them in the following lines in dyn_nxt:

! Time filter and swap of dynamics arrays
! ------------------------------------------
IF( neuler == 0 .AND. kt == nit000 ) THEN !* Euler at first time-step: only swap

DO jk = 1, jpkm1

un(:,:,jk) = ua(:,:,jk) ! un <-- ua
vn(:,:,jk) = va(:,:,jk)


For the velocity fields we just swap "after" to "now", not "now" to "before" because the "now" and "before" fields are initialised to be the same in istate_init. But with the time-split solution for the free surface the "now" field does in fact get updated in dyn_spg_ts to be consistent with the barotropic solution:

! Correct velocities so that the barotropic velocity equals (un_adv, vn_adv) (in all cases)
DO jk = 1, jpkm1

un(:,:,jk) = ( un(:,:,jk) + un_adv(:,:)*r1_hu_n(:,:) - un_b(:,:) ) * umask(:,:,jk)
vn(:,:,jk) = ( vn(:,:,jk) + vn_adv(:,:)*r1_hv_n(:,:) - vn_b(:,:) ) * vmask(:,:,jk)


So in fact the "now" velocity is different to the "before" velocity on an Euler timestep and we should swap "now" to "before" velocities in dyn_nxt.

(This is a very minor bug but it prevents me from obtaining bit comparison with the new version of the code with a time-dimension in the prognostic fields).





Commit History (2)


Small bug fixes to to initial Euler timestep and OFF timestepping to ensure bit comparison the IMMERSE_first_steps branch with the trunk. Tickets #2310, #2311, #2343 apply.


2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : Merge in changes from branch of branch. Main changes:

  1. "nxt" modules renamed as "atf" and now just do Asselin time filtering. The time level swapping is achieved by swapping indices.
  2. Some additional prognostic grid variables changed to use a time dimension.


  1. This merged branch passes SETTE tests but does not identical results to the SETTE tests with the trunk@10721 unless minor bugs to do with Euler timestepping and the OFF timestepping are fixed in the trunk (NEMO tickets #2310 and #2311).
  2. The nn_dttrc > 1 option for TOP (TOP has a different timestep to OCE) doesn't work. But it doesn't work in the trunk or NEMO 4.0 release either.

Change History (5)

comment:1 Changed 5 years ago by jchanut

Removing the conditional statement at line 128 of dynnxt.F90 should work:

 IF( .NOT.ln_bt_fw ) THEN
	            ! Remove advective velocity from "now velocities"
	            ! prior to asselin filtering

Generally speaking: I think that barotropic fluxes correction should be implemented in the code as for ztilde diffusive fluxes (un_td, vn_td): Baroclinic velocities should remain unchanged during the time stepping, fluxes should be updated only when doing tracer advection and in the continuity equation.

comment:2 Changed 5 years ago by davestorkey

In 11480:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:3 Changed 4 years ago by davestorkey

In 12026:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:4 Changed 4 years ago by davestorkey

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in trunk @ 12026.

comment:5 Changed 2 years ago by nemo

  • Keywords v4.0 added
Note: See TracTickets for help on using tickets.