source: NEMO/trunk/src/OCE/DYN/dynadv.F90 @ 12377

Last change on this file since 12377 was 12377, checked in by acc, 8 months ago

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge —ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The —ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

  • Property svn:keywords set to Id
File size: 8.2 KB
Line 
1MODULE dynadv
2   !!==============================================================================
3   !!                       ***  MODULE  dynadv  ***
4   !! Ocean active tracers:  advection scheme control
5   !!==============================================================================
6   !! History :  1.0  !  2006-11  (G. Madec)  Original code
7   !!            3.3  !  2010-10  (C. Ethe, G. Madec)  reorganisation of initialisation phase
8   !!            3.6  !  2015-05  (N. Ducousso, G. Madec)  add Hollingsworth scheme as an option
9   !!            4.0  !  2017-07  (G. Madec)  add a linear dynamics option
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   dyn_adv      : compute the momentum advection trend
14   !!   dyn_adv_init : control the different options of advection scheme
15   !!----------------------------------------------------------------------
16   USE dom_oce         ! ocean space and time domain
17   USE dynadv_cen2     ! centred flux form advection      (dyn_adv_cen2 routine)
18   USE dynadv_ubs      ! UBS flux form advection          (dyn_adv_ubs  routine)
19   USE dynkeg          ! kinetic energy gradient          (dyn_keg      routine)
20   USE dynzad          ! vertical advection               (dyn_zad      routine)
21   !
22   USE in_out_manager  ! I/O manager
23   USE lib_mpp         ! MPP library
24   USE timing          ! Timing
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC dyn_adv       ! routine called by step module
30   PUBLIC dyn_adv_init  ! routine called by opa  module
31 
32   !                                   !!* namdyn_adv namelist *
33   LOGICAL, PUBLIC ::   ln_dynadv_OFF   !: linear dynamics (no momentum advection)
34   LOGICAL, PUBLIC ::   ln_dynadv_vec   !: vector form
35   INTEGER, PUBLIC ::      nn_dynkeg       !: scheme of grad(KE): =0 C2 ; =1 Hollingsworth
36   LOGICAL, PUBLIC ::   ln_dynadv_cen2  !: flux form - 2nd order centered scheme flag
37   LOGICAL, PUBLIC ::   ln_dynadv_ubs   !: flux form - 3rd order UBS scheme flag
38   
39   INTEGER, PUBLIC ::   n_dynadv   !: choice of the formulation and scheme for momentum advection
40   !                               !  associated indices:
41   INTEGER, PUBLIC, PARAMETER ::   np_LIN_dyn = 0   ! no advection: linear dynamics
42   INTEGER, PUBLIC, PARAMETER ::   np_VEC_c2  = 1   ! vector form : 2nd order centered scheme
43   INTEGER, PUBLIC, PARAMETER ::   np_FLX_c2  = 2   ! flux   form : 2nd order centered scheme
44   INTEGER, PUBLIC, PARAMETER ::   np_FLX_ubs = 3   ! flux   form : 3rd order Upstream Biased Scheme
45
46   !!----------------------------------------------------------------------
47   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
48   !! $Id$
49   !! Software governed by the CeCILL license (see ./LICENSE)
50   !!----------------------------------------------------------------------
51CONTAINS
52
53   SUBROUTINE dyn_adv( kt, Kbb, Kmm, puu, pvv, Krhs )
54      !!---------------------------------------------------------------------
55      !!                  ***  ROUTINE dyn_adv  ***
56      !!               
57      !! ** Purpose :   compute the ocean momentum advection trend.
58      !!
59      !! ** Method  : - Update (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) with the advection term following n_dynadv
60      !!
61      !!      NB: in flux form advection (ln_dynadv_cen2 or ln_dynadv_ubs=T)
62      !!      a metric term is add to the coriolis term while in vector form
63      !!      it is the relative vorticity which is added to coriolis term
64      !!      (see dynvor module).
65      !!----------------------------------------------------------------------
66      INTEGER                             , INTENT( in )  ::  kt               ! ocean time-step index
67      INTEGER                             , INTENT( in )  ::  Kbb, Kmm, Krhs   ! ocean time level indices
68      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv         ! ocean velocities and RHS of momentum equation
69      !!----------------------------------------------------------------------
70      !
71      IF( ln_timing )   CALL timing_start( 'dyn_adv' )
72      !
73      SELECT CASE( n_dynadv )    !==  compute advection trend and add it to general trend  ==!
74      CASE( np_VEC_c2  )     
75         CALL dyn_keg     ( kt, nn_dynkeg,      Kmm, puu, pvv, Krhs )    ! vector form : horizontal gradient of kinetic energy
76         CALL dyn_zad     ( kt,                 Kmm, puu, pvv, Krhs )    ! vector form : vertical advection
77      CASE( np_FLX_c2  ) 
78         CALL dyn_adv_cen2( kt,                 Kmm, puu, pvv, Krhs )    ! 2nd order centered scheme
79      CASE( np_FLX_ubs )   
80         CALL dyn_adv_ubs ( kt,            Kbb, Kmm, puu, pvv, Krhs )    ! 3rd order UBS      scheme (UP3)
81      END SELECT
82      !
83      IF( ln_timing )   CALL timing_stop( 'dyn_adv' )
84      !
85   END SUBROUTINE dyn_adv
86
87   
88   SUBROUTINE dyn_adv_init
89      !!---------------------------------------------------------------------
90      !!                  ***  ROUTINE dyn_adv_init  ***
91      !!               
92      !! ** Purpose :   Control the consistency between namelist options for
93      !!              momentum advection formulation & scheme and set n_dynadv
94      !!----------------------------------------------------------------------
95      INTEGER ::   ioptio, ios   ! Local integer
96      !
97      NAMELIST/namdyn_adv/ ln_dynadv_OFF, ln_dynadv_vec, nn_dynkeg, ln_dynadv_cen2, ln_dynadv_ubs
98      !!----------------------------------------------------------------------
99      !
100      IF(lwp) THEN
101         WRITE(numout,*)
102         WRITE(numout,*) 'dyn_adv_init : choice/control of the momentum advection scheme'
103         WRITE(numout,*) '~~~~~~~~~~~~'
104      ENDIF
105      !
106      READ  ( numnam_ref, namdyn_adv, IOSTAT = ios, ERR = 901)
107901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namdyn_adv in reference namelist' )
108      READ  ( numnam_cfg, namdyn_adv, IOSTAT = ios, ERR = 902 )
109902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namdyn_adv in configuration namelist' )
110      IF(lwm) WRITE ( numond, namdyn_adv )
111
112      IF(lwp) THEN                    ! Namelist print
113         WRITE(numout,*) '   Namelist namdyn_adv : chose a advection formulation & scheme for momentum'
114         WRITE(numout,*) '      linear dynamics : no momentum advection          ln_dynadv_OFF  = ', ln_dynadv_OFF
115         WRITE(numout,*) '      Vector form: 2nd order centered scheme           ln_dynadv_vec  = ', ln_dynadv_vec
116         WRITE(numout,*) '         with Hollingsworth scheme (=1) or not (=0)       nn_dynkeg   = ', nn_dynkeg
117         WRITE(numout,*) '      flux form: 2nd order centred scheme              ln_dynadv_cen2 = ', ln_dynadv_cen2
118         WRITE(numout,*) '                 3rd order UBS scheme                  ln_dynadv_ubs  = ', ln_dynadv_ubs
119      ENDIF
120
121      ioptio = 0                      ! parameter control and set n_dynadv
122      IF( ln_dynadv_OFF  ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_LIN_dyn   ;   ENDIF
123      IF( ln_dynadv_vec  ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_VEC_c2    ;   ENDIF
124      IF( ln_dynadv_cen2 ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_FLX_c2    ;   ENDIF
125      IF( ln_dynadv_ubs  ) THEN   ;   ioptio = ioptio + 1   ;   n_dynadv = np_FLX_ubs   ;   ENDIF
126
127      IF( ioptio /= 1 )   CALL ctl_stop( 'choose ONE and only ONE advection scheme' )
128      IF( nn_dynkeg /= nkeg_C2 .AND. nn_dynkeg /= nkeg_HW )   CALL ctl_stop( 'KEG scheme wrong value of nn_dynkeg' )
129
130
131      IF(lwp) THEN                    ! Print the choice
132         WRITE(numout,*)
133         SELECT CASE( n_dynadv )
134         CASE( np_LIN_dyn )   ;   WRITE(numout,*) '   ==>>>   linear dynamics : no momentum advection used'
135         CASE( np_VEC_c2  )   ;   WRITE(numout,*) '   ==>>>   vector form : keg + zad + vor is used' 
136            IF( nn_dynkeg == nkeg_C2  )   WRITE(numout,*) '              with Centered standard keg scheme'
137            IF( nn_dynkeg == nkeg_HW  )   WRITE(numout,*) '              with Hollingsworth keg scheme'
138         CASE( np_FLX_c2  )   ;   WRITE(numout,*) '   ==>>>   flux form   : 2nd order scheme is used'
139         CASE( np_FLX_ubs )   ;   WRITE(numout,*) '   ==>>>   flux form   : UBS       scheme is used'
140         END SELECT
141      ENDIF
142      !
143   END SUBROUTINE dyn_adv_init
144
145  !!======================================================================
146END MODULE dynadv
Note: See TracBrowser for help on using the repository browser.