Version 24 (modified by gm, 5 years ago) (diff) |
---|

Last edited Timestamp?

**Author** : Gurvan Madec, Florian Lemarié, George Nurser

**ticket** : #1593

**Branch** : 2015/dev_r5721_CNRS9_NOC3_LDF

**WP2015 Action** : CNRS-9 and NOC-3

### Description

Development branch related to CNRS-9 and NOC-3 actions of 2015 work plan :

• simplify and improve the tracer advection and the lateral diffusion and dissipation in NEMO/OPA

• generalization of the use of surface scale factors (e1e2 at T, U, V, F points)

NB: This development consists in merging the current trunk with the last year work on that subject (see ticket #1260, and the associated branch 2014/dev_CNRS0_NOC1_LDF and wiki page 1260_CNRS0_NOC1_LDF.

*Simplification*:

(1) define bilaplacian operators on dynamics and tracers as re-entrant laplacian ;

(2) change the way the eddy diffusivity and viscosity are specified and controlled by the user ; add a new choice (read the coeff. in a file) ;

(3) generalize of the use of surface scale factors and their inverse ;

(4) add a optional read of surface scale factors in coordinate file in case of reduction of the scale factors in some straits (allows to suppress hard coded ORCA staff in domhgr.F90).

(5) suppress some CPP keys : key_ldfslp ; ley_ldftra_eiv ; key_traldf_ano ; key_traldf_c1d, _c2d, c3d ; key_dynldf_c1d, _c2d, c3d ; key_esopa (from traldf and traadv routines) ;

*Improvements*:

(1) introduce Beckers et al. (2000) compact stencil in the cross-isoneutral direction in triads formalism ;

(2) introduce in both iso-neutral operator the Method of Stabilizing Correction (Lemarié et al. (2012) (it minimizes numerical errors, and allows the implementation of bilaplacian iso-neutral operator)** **;

(3) implement bilaplacian iso-neutral operators (Lemarié et al. (2012).

### Strategy

Three steps:

I. Phasing of horizontal scale factors==⇒>> OK seerevision 5737+ minor correctionrevision 5737 (SETTE OK)

** (I.1)** standardisation of the name of quantities derived from horizontal scale factors (many modules of NEMO)

The chosen names of quantities derived from horizontal scale factors are:

- inverse of scale factors : r1_e1t, r1_e2t, r1_e1u, r1_e2u, r1_e1v, r1_e2v, r1_e1f, r1_e2f ;

- surfaces and their inverse: e1e2t, e1e2u , e1e2v, e1e2f and, r1_e1e2t , r1_e1e2u , r1_e1e2v, r1_e1e2f ;

- ratio (used in traldf…) : e2_e1u , e1_e2v(I.1) generalize of the use of surface scale factors ;

These quantities are defined in memory in dom_oce.F90, and set to their proper value in domhgr.F90

** (I.2)** add a optional read of surface scale factors at velocity points in coordinate file (domhgr.F90)

The input coordinate file have to include e1e2u and e1e2v in case of reduction of the scale factors in some straits.

When e1u or e2v are reduced in some straits, the surface at u- and v-points remains unchanged.

This allows to suppress the dom_vvl_orca_fix routine from dlmvvl.F90 module.*Note that this change modifies the model results*, as it contains a better handling of reduced strait width (i.e. reduced surface between 2 adjacent U or V points, but unchanged U and V points volume).

The implementation performed here is a first step to the full simplification of domhgr.F90. We kept here the hard coded reduction of scale factor in some straits for some given ORCA configuration.

A last step (see IV) will be to suppress the hard coded reduction of some scale factor as it will be always given in the coordinates.nc file together with the e1e2u & e1e2v surfaces. ==⇒>> OK see **revision 5755**

II. Phasing of the advective/diffusive trends on tracers

**II.1 —** **LDF on tracers** (both TRA & TRC) - Diffusive trends : ** **==⇒>> OK see **revision 5758 & 5759 and 5760 with SETTE OK**

** ===⇒>>> Bug in triad operator TO BE CHECKED**

triad operator is neither restartable not repro in the branche (it was the case in v3.6 stable)

*operator*:

- laplacian operator: re-entrant laplacian for iso-level, standard iso-neutral, and triad iso-neutral operators ;

- bilaplacian operator: traldf_blp.F90 module: use of the re-entrant laplacian

- both standard and triad iso-neutral operators includes the Method of Stabilizing Correction (Lemarié et al. (2012) which allows bilaplacian along iso-neutral surfaces ;

- triad operator: introduce Beckers et al. (2000) compact stencil in the cross-isoneutral direction ; make the triad operator available in TOP

- change name: traldf_iso_grif.F90 becomes traldf_iso_triad.F90

- suppression of traadv_eiv.F90 ; traldf_bilap.F90 ; traldf_bilapg.F90 ;

- remove the possibility to compute the lateral diffusion from T-S anomalies (key_traldf_ano)

*lateral mixing coefficient*:

- new user interface (namelist) :

!---------------------------------------------------------------------------------- &namtra_ldf ! lateral diffusion scheme for tracers !---------------------------------------------------------------------------------- ! ! Operator type: ln_traldf_lap = .true. ! laplacian operator ln_traldf_blp = .false. ! bilaplacian operator ! ! Direction of action: ln_traldf_lev = .false. ! iso-level ln_traldf_hor = .false. ! horizontal (geopotential) ln_traldf_iso = .true. ! iso-neutral ln_traldf_triad = .false. ! iso-neutral using Griffies triads ! ! ! iso-neutral options: ln_traldf_msc = .true. ! Method of Stabilizing Correction (both operators) rn_slpmax = 0.01 ! slope limit (both operators) ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only) rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only) ln_botmix_triad = .false. ! lateral mixing on bottom (triad only) ! ! ! Coefficients: nn_aht_ijk_t = 21 ! space/time variation of eddy coef ! ! =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file ! ! = 0 constant ! ! = 10 F(k) =ldf_c1d ! ! = 20 F(i,j) =ldf_c2d ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d ! ! = 31 F(i,j,k,t)=F(local velocity) rn_aht_0 = 2000. ! lateral eddy diffusivity (lap. operator) [m2/s] rn_bht_0 = 1.e+12 ! lateral eddy diffusivity (bilap. operator) [m4/s] / !---------------------------------------------------------------------------------- &namtra_ldfeiv ! eddy induced velocity param. !---------------------------------------------------------------------------------- ln_ldfeiv =.true. ! use eddy induced velocity parameterization ln_ldfeiv_dia =.true. ! diagnose eiv stream function and velocities rn_aeiv_0 = 2000. ! eddy induced velocity coefficient [m2/s] nn_aei_ijk_t = 21 ! space/time variation of the eiv coeficient ! ! =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file ! ! = 0 constant ! ! = 10 F(k) =ldf_c1d ! ! = 20 F(i,j) =ldf_c2d ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation ! ! = 30 F(i,j,k) =ldf_c2d + ldf_c1d /

- ln_traldf_lap=traldf_blp=0 No lateral diffusion applied on tracers

- bi-laplacian eddy coefficient defined as SQRT(bhm)

- ah and bh coefficients defined only at u- and v-points.

- redesign the management of eddy induced velocity and its associated diagnostics. In particular ldfeiv.F90 and ldfeiv_substitute.h90 has been suppressed (ldf_eiv routine is now included in ldftra.F90)

- redesign of space variation of the eddy diffusivity: suppression of: ldftra_substitute.h90 ; ldftra_c1d.h90 , ldftra_c2d.h90 and ldftra_c3d.h90 (replaced by ldfc1d_c2d.F90) ; ldftra_oce.F90 (now included in ldftra.F90)

- remove ldftra_smag.F90 (suppression of smagorinski option) **=⇒>> TO BE re-add in the new framework by someone…**- suppression of cpp keys : key_ldfslp ;

*key_traldf_c1d ; key_traldf_c2d ; key_traldf_c3d ;*key_diaeiv ; key_traldf_eiv ; key_traldf_eiv ; key_traldf_ano

- suppression of key_esopa in traldf.F90

- zpshde.F90 correct an issue with position of optional argument in zps_hde_isf routine

*passive tracers*

- all changes in the management of diffusive coefficients and operator has been taken into account in TOP

**Pending issues**:

- verify diaptr.F90 : not sure it is OK

- add the max grid size in the coordinate file and use it to compute grid dependent diffusivity. This will solve an issue with regional and AGRIF configurations

- test all 6 operators.

- change default option in the namelist !

- In field_def.xml add a comment to say where is the routine calling the corresponding iom_put

- in the documentation, add a change in the DOCTOR norm: np_ is now a prefix used for PARAMETER

**II.2 —** **Advective trends** :TRA/traadv…. ==⇒>> OK see **revision 5770 & 5771**

- traadv_muscl2.F90 removed

- traadv_muscl.F90 renamed traadv_mus.F90

- traadv_cen2.F90 replaced by traadv_cen which provides 2nd and 4th order centered scheme on both horizontal and vertical directions.

- name TVD has been changed to the more commonly used FCT (Flux Correction Transport)

- FCT offers now 2nd and 4th order centered scheme on both horizontal and vertical directions.

- UBS offers now in option either a 2nd order FCT or a 4th order COMPACT scheme in the vertical direction

- NB in case of 4th order in the vertical, CEN, UBS and FCT use a compact 4th order scheme

- key_esopa removed from traadv.F90

- Surface boundary condition in ISF case has been added in all cases (except 4th order COMPACT scheme which currently don't work with ISF)

!----------------------------------------------------------------------- &namtra_adv ! advection scheme for tracer !----------------------------------------------------------------------- ln_traadv_cen = .false. ! 2nd order centered scheme nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT ln_traadv_fct = .false. ! FCT scheme nn_fct_h = 2 ! =2/4, horizontal 2nd / 4th order nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order nn_fct_zts = 0 ! > 1 , 2nd order FCT scheme with vertical sub-timestepping ! ! (number of sub-timestep = nn_fct_zts) ln_traadv_mus = .false. ! MUSCL scheme ln_mus_ups = .false. ! use upstream scheme near river mouths ln_traadv_ubs = .false. ! UBS scheme nn_ubs_v = 2 ! =2 , vertical 2nd order FCT ln_traadv_qck = .false. ! QUICKEST scheme /

**Unresolved issues/improvement** on TRAADV:

- QCK: cross terms are missing. alternate direction should be added….

- Bug in FCT with sub-time-stepping and key_vvl. The change in e3 should be taken into account in the sub-timesteps.

- traadv_mus.F90 some rather simple optimization can be added…

- traadv_qck.F90 : possibility to add a 4th order COMPACT scheme on the vertical.

- 4th order COMPACT doesn't work with ISF the routine have to be modified

**(II.X)** ..Miscellaneous :

- Atmospheric pressure forcing: change to a systematic call of sbc_apr in step.F90 (with or without BDY) and remove its call from sbcmod

- remove key_ldftra_smag and associated module (ldftra_smag.F90)

- remove key_vectopt_loop from all the code except in domzgr_substitute.h90 (it is an obsolescent feature only adapted to vector computers)

- remove all "!CDIR " lines = NEC vector compiler instructions

:

III. Phasing of viscous trends

** (III.1) LDF on dynamics**

- rotb and rotn arrays suppressed (even from the restart file)

- hdivn and hdivb removed from restart too

- divcur.F90 becomes divhor and only computes the horizontal divergence

…

IV. Solve the pending issues

(IV.1)specification of eddy viscosity/diffusivity coefficients in case of grid-size dependency.

Issue: define the grid-size dependency in such a way that does not require the Equator being inside the domain.

Solution: add a scalar in the coordinate file which is equal to the grid-size at the equator even if Equator is not in the domain

and use this scalar to compute the grid-size dependency of the coefficients.(IV.2)specification of lateral friction at the coast.

Issue: the different values of fmask at the coast have been removed so that this lateral boundary condition doesn't affect the advective term (double check that!). fmask is still used for laplacian and bilaplacian viscosities. Nevertheless, the magnitude of lateral friction depends on the magnitude of ahm (bhm, reap.). It seems better to define this magnitude

Solution: add a scalar in the coordinate file which is equal to the grid-size at the equator even if Equator is not in the domain

and use this scalar to compute the grid-size dependency of the coefficients.

…

**remaining to do :**

- management of no-slip boundary condition as fmask no more used in dynvor.F90 ….
- create the 2D ahtu and ahtv file for ORCA_R2 (and also for ORCA_R1)
- In case of variation of the 2D coeff. as a function of the grid size, use a reference to a 1 degree grid size for ah on both tracers and momentum
- suppress Smagorinsky option which does not work any more. Can be re-introduce in a consistent way with the re-design LDF if decided…
- test with SETTE (especially restartability and reproducibility )

V. Finalize the simplification

(V.1) addin NEMOGCM/TOOLS a directory a program that read a coordinates.nc file apply a reduction of scale factors in some straits, and create the associated extended coordinates file (coordinates_e1e2u_v.nc).

create the extended coordinates files form ORCA 2°, 1°, and 0.5°. ==⇒>> Done for ORCA 2° and 1°,½° and ¼° missing…

…

**To be CHECKED** (not necessary associated with this branch

- check that task_i use ssmask, i.e. that it takes into account the under ice shelf seas.

- CRS : the new arrays derived from horizontal scale factors MUST be added in CRS.

- Bug in diawri.F90 when NOT using key_iomput (OK =⇒> see ticket #1596)

- Idea for finalization of domhgr.F90 :
**add**2 modules (from domhgr.F90), domhgr_read.F90 and domhgr_ana.F90, which contains:

- domhgr_read.F90: the CASE jphgr_msh=0 of domhgr.F90 (i.e. read the coordinates file)

- domhgr_ana.F90: the CASE jphgr_msh=5 of domhgr.F90 (i.e. the GYRE analytical definition of the coordinates)**add**in NEMOGCM/TOOLS a directory containing 3 domhgr_ana.F90 modules associated with (1) a geographical mesh on the sphere with regular (in degree) grid-spacing (jphgr_msh=1) ; (2) f- or beta-plane with regular grid-spacing (jphgr_msh=2 or 3)) ; (3) geographical mesh on the sphere, isotropic MERCATOR type (jphgr_msh=4)**remove**from the namelist_ref/namdom all variable related to the horizontal mesh, and add a flag, ln_mesh_read, =T read the coordinates.nc file ; =F analytical mesh (by default GYRE mesh).

…

**Testing**

Testing could consider (where appropriate) other configurations in addition to NVTK].

NVTK Tested | '''YES/NO''' |

Other model configurations | '''YES/NO''' |

Processor configurations tested | [ Enter processor configs tested here ] |

If adding new functionality please confirm that the New code doesn't change results when it is switched off and ''works'' when switched on | '''YES/NO/NA''' |

(Answering UNSURE is likely to generate further questions from reviewers.)

'Please add further summary details here'

- Processor configurations tested
- etc——

### Bit Comparability

Does this change preserve answers in your tested standard configurations (to the last bit) ? | '''YES/NO ''' |

Does this change bit compare across various processor configurations. (1xM, Nx1 and MxN are recommended) | '''YES/NO''' |

Is this change expected to preserve answers in all possible model configurations? | '''YES/NO''' |

Is this change expected to preserve all diagnostics? ,,''Preserving answers in model runs does not necessarily imply preserved diagnostics. '' | '''YES/NO''' |

If you answered '''NO''' to any of the above, please provide further details:

- Which routine(s) are causing the difference?
- Why the changes are not protected by a logical switch or new section-version
- What is needed to achieve regression with the previous model release (e.g. a regression branch, hand-edits etc). If this is not possible, explain why not.
- What do you expect to see occur in the test harness jobs?
- Which diagnostics have you altered and why have they changed?Please add details here……..

### System Changes

Does your change alter namelists? | '''YES/NO ''' |

Does your change require a change in compiler options? | '''YES/NO ''' |

If any of these apply, please document the changes required here…….

### Resources

''Please ''summarize'' any changes in runtime or memory use caused by this change……''

### IPR issues

Has the code been wholly (100%) produced by NEMO developers staff working exclusively on NEMO? | '''YES/ NO ''' |

If No:

- Identify the collaboration agreement details
- Ensure the code routine header is in accordance with the agreement, (Copyright/Redistribution? etc).Add further details here if required……….