2016WP SIMPLIF-5_ACC Re-implementation of Smagorinsky

This is the color code for the fulfilment of this form:




The PI is responsible to closely follow the progress of the action, and especially to contact NEMO project manager if the delay on preview (or review) are longer than the 2 weeks expected.


This section should be completed before starting to develop the code, in order to find agreement on the method beforehand.
To enabling the !ticket and the source links in the Trac environment, those have to be hardcoded in the form









Initial plan (before preview)

Part 1: Description

Part 2: Implementation

Part 3: Reference manual updates

Updated on 03/03/2016 18:45:51 by acc

Once the PI has completed this section, he should send a mail to the previewer(s) asking them to preview the work within two weeks.

Jointly agreed plan (after preview)


This task reimplements a spatially varying eddy viscosity coefficient proportional to the local deformation rate and grid scale (Smagorinsky 1993). This reimplementation takes advantage of the recently reorganised and simplified LDF modules which means the scheme can be implemented as a simple alternative to the existing scheme for a space and time varying coefficient (nn_aht_ijk_t=31). This will provide a much cleaner implementation than the version which was removed from v3.6_STABLE and requires very few additional arrays and no preprocessor keys


The changes will occur primarily in ldfdyn.F90.

Firstly, in MODULE ldfdyn which will acquire the following name list additions:

                                         !! If nn_ahm_ijk_t = 32 a time and space varying Smagorinsky viscosity
                                         !! will be computed. 
   REAL(wp), PUBLIC ::   rn_csmc         !: Smagorinsky constant of proportionality 
   REAL(wp), PUBLIC ::   rn_cfacmin      !: Multiplicative factor of theorectical minimum Smagorinsky viscosity
   REAL(wp), PUBLIC ::   rn_cfacmax      !: Multiplicative factor of theorectical maximum Smagorinsky viscosity

The majority of code changes then occur in ldf_dyn where the CASE statement is extended to respond to CASE 32 by setting coefficients according to the Smagorinsky scheme as revisited in Griffies and Hallberg (2000). For efficiency it is useful to define module-private 2D arrays to store some calculated terms:

   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   dtensq       !: horizontal tension squared         (Smagorinsky only)
   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   dshesq       !: horizontal shearing strain squared (Smagorinsky only)
   REAL(wp),         ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   esqt, esqf   !: Square of the local gridscale (e1e2/(e1+e2))**2

The length-squared terms (L2) are geometric invariants that can be calculated once at start (ldf_dyn_init). The horizontal tension (DT= du/dx - dv/y) is calculated at T-points using the before velocities. The horizontal shearing strain (DS = du/dy + dv/dx) is calculated at F-points using the same velocities. Storing the squares of these terms means that computing viscosity coefficients at T & F points is merely a case of combining different averages of these arrays.

Using the relationship given by Griffies and Hallberg (2000); namely:

     B_smag = A_smag * L^2 / 8

means that the biharmonic coefficients (if required) can be computed from a simple scaling of the harmonic values. Note that the new implementation of the biharmonic operator as a re-rentrant laplacian means that the square root of the biharmonic coefficient should be returned by this routine.

Reference manual

The description of the Smagorinsky scheme in the current reference will be altered to reflect the new method of activation. At this stage there are no plans to implement the additional experimental options in the previous implementation (i.e. the ability to control the contribution of the sheer term with an additional name list parameter and the option to apply a Smagorinsky type criterion to a space a time varying diffusion coefficient.

Details of the new implementation will be added and will include both the continuous and discrete forms of the operators used.

Griffies, S., M., and W. Hallberg, R , Biharmonic friction with a Smagorinsky-like viscosity for use in large-scale eddy-permitting ocean models, Mon. Wea. Rev., 128(8), 2935-2946, 2000.


Since the preview step must be completed before the PI starts the coding, the previewer(s) answers are expected to be completed within the two weeks after the PI has sent his request.
For each question, an iterative process should take place between PI and previewer(s) in order to reach a "YES" answer for each of the following questions.

Questions Answer Comment
Does the previewer agree with the proposed methodology?
Does the previewer agree with the proposed flowchart and list of routines to be changed?
Does the previewer agree with the proposed new list of variables, including agreement with coding rules?
Does the previewer agree with the proposed summary of updates in reference manual?
… … …

Updated on 03/10/2016 11:14:43 by acc

Once all "YES" have been reached, the PI can start the development into his development branch.


Once the development is done, the PI should complete this section below and ask the reviewers to start their review in the lower section.

Questions Answer Comment
Can this change be shown to produce expected impact? (if option activated)?
Can this change be shown to have a null impact? (if option not activated)
Detailed results of restartability and reproducibility when the option is activated. Please indicate the configuration used for this test
Detailed results of SETTE tests (restartability and reproducibility for each of the reference configuration)
Results of the required bit comparability tests been run: Are there no differences when activating the development?
If some differences appear, is reason for the change valid/understood?
If some differences appear, is the !ticket describing in detail the impact this change will have on model configurations?
Is this change expected to preserve all diagnostics?
If no, is reason for the change valid/understood?
Are there significant changes in run time/memory?
… … …

Updated on 05/09/2021 09:13:31 by anonymous


A successful review is needed to schedule the merge of this development into the future NEMO release during next Merge Party (usually in November).

Code changes and documentation

Question Answer Comment
Is the proposed methodology now implemented?
Are the code changes in agreement with the flowchart defined at Preview step?
Are the code changes in agreement with list of routines and variables as proposed at Preview step?
If not, are the discrepancies acceptable?
Is the in-line documentation accurate and sufficient?
Do the code changes comply with NEMO coding standards?
Is the !ticket of development documented with sufficient details for others to understand the impact of the change?
Are the reference manual tex files now updated following the proposed summary in preview section?
Is there a need for some documentation on the web pages (in addition to in-line and reference manual)?
If yes, please describe and ask PI. A yes answer must include all documentation available.
… … …

Review Summary Is the review fully successful?
Updated on 05/09/2021 09:13:31 by anonymous

Once review is successful, the development must be scheduled for merge during next Merge Party Meeting.

Last modified 5 years ago Last modified on 2016-03-10T14:31:24+01:00