# New URL for NEMO forge! http://forge.nemo-ocean.eu

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.
#2318 (bug in Smagorinsky formulation at 4.0) – NEMO

Opened 5 years ago

Closed 5 years ago

# bug in Smagorinsky formulation at 4.0

Reported by: Owned by: davestorkey davestorkey normal Unscheduled LDF v4.0 minor v4.0

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.

#### Context

The bilaplacian Smagorinsky formulation at 4.0 gives much smaller viscosity values than the bilaplacian Smagorinsky formulation at 3.6 for same "C" value and the same velocity field in tests with ORCA025 and GYRE. There is about an order of magnitude difference.

#### Analysis

The main issue appears to be a missing factor of 2 in the definition of esqt and esqf in ldf_dyn_init:

```      DO jj = 1, jpj             ! Set local gridscale values
DO ji = 1, jpi
esqt(ji,jj) = ( e1e2t(ji,jj) / ( e1t(ji,jj) + e2t(ji,jj) ) )**2
esqf(ji,jj) = ( e1e2f(ji,jj) / ( e1f(ji,jj) + e2f(ji,jj) ) )**2
END DO
END DO
```

```      DO jj = 1, jpj             ! Set local gridscale values
DO ji = 1, jpi
esqt(ji,jj) = ( 2._wp * e1e2t(ji,jj) / ( e1t(ji,jj) + e2t(ji,jj) ) )**2
esqf(ji,jj) = ( 2._wp * e1e2f(ji,jj) / ( e1f(ji,jj) + e2f(ji,jj) ) )**2
END DO
END DO
```

Then for the special case e1t = e2t = dx we have esqt = dx^2 and esqt corresponds to Delta^2 in the Griffies and Hallberg (2000) MWR paper. This length scale is raised to the power of 4 in the definition of the bilaplacian viscosity, so a missing factor of 2 would give a bilaplacian viscosity 16x smaller at 4.0 than at 3.6 which is roughly what I see in my tests.

#### Fix

I have tested this change and the values at 3.6 and 4.0 are now the same order of magnitude but it seems that the 4.0 values are still systematically a bit smaller than the 3.6 values.

### Commit History (2)

ChangesetTimeChangeLog
11653davestorkey2019-10-04T14:34:02+02:00

Fix for bug in Smagorinsky scheme #2318.

11651davestorkey2019-10-04T12:07:53+02:00

UKMO/NEMO_4.0_GO8_package : Apply Smagorinsky bug fix (#2318) in GO8 package branch as temporary measure before we pick it up from trunk.

### comment:1 Changed 5 years ago by davestorkey

• Description modified (diff)

### comment:2 Changed 5 years ago by davestorkey

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

In 11651:

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

### comment:3 Changed 5 years ago by smasson

Should we report this bugfix in the trunk (alias NEMO 4.0.1)?
It looks like a good and strait forward solution, no?

### comment:4 Changed 5 years ago by davestorkey

In 11653:

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

### comment:5 Changed 5 years ago by smasson

Thank you!
Last on before 4.0.1? :-)

### comment:6 Changed 5 years ago by davestorkey

The system is too clever (or not clever enough). It closed the ticket when I only committed the fix to a branch. Fix now in trunk @ 11653.