1 | MODULE 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 | !!---------------------------------------------------------------------- |
---|
10 | |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | !! dyn_adv : compute the momentum advection trend |
---|
13 | !! dyn_adv_init : control the different options of advection scheme |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE dom_oce ! ocean space and time domain |
---|
16 | USE dynadv_cen2 ! centred flux form advection (dyn_adv_cen2 routine) |
---|
17 | USE dynadv_ubs ! UBS flux form advection (dyn_adv_ubs routine) |
---|
18 | USE dynkeg ! kinetic energy gradient (dyn_keg routine) |
---|
19 | USE dynzad ! vertical advection (dyn_zad routine) |
---|
20 | ! |
---|
21 | USE in_out_manager ! I/O manager |
---|
22 | USE lib_mpp ! MPP library |
---|
23 | USE timing ! Timing |
---|
24 | |
---|
25 | IMPLICIT NONE |
---|
26 | PRIVATE |
---|
27 | |
---|
28 | PUBLIC dyn_adv ! routine called by step module |
---|
29 | PUBLIC dyn_adv_init ! routine called by opa module |
---|
30 | |
---|
31 | ! !* namdyn_adv namelist * |
---|
32 | LOGICAL, PUBLIC :: ln_dynadv_vec !: vector form flag |
---|
33 | INTEGER, PUBLIC :: nn_dynkeg !: scheme of kinetic energy gradient: =0 C2 ; =1 Hollingsworth |
---|
34 | LOGICAL, PUBLIC :: ln_dynadv_cen2 !: flux form - 2nd order centered scheme flag |
---|
35 | LOGICAL, PUBLIC :: ln_dynadv_ubs !: flux form - 3rd order UBS scheme flag |
---|
36 | LOGICAL, PUBLIC :: ln_dynzad_zts !: vertical advection with sub-timestepping (requires vector form) |
---|
37 | |
---|
38 | INTEGER :: nadv ! choice of the formulation and scheme for the advection |
---|
39 | |
---|
40 | !! * Substitutions |
---|
41 | # include "domzgr_substitute.h90" |
---|
42 | # include "vectopt_loop_substitute.h90" |
---|
43 | !!---------------------------------------------------------------------- |
---|
44 | !! NEMO/OPA 3.6 , NEMO Consortium (2015) |
---|
45 | !! $Id$ |
---|
46 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
47 | !!---------------------------------------------------------------------- |
---|
48 | CONTAINS |
---|
49 | |
---|
50 | SUBROUTINE dyn_adv( kt ) |
---|
51 | !!--------------------------------------------------------------------- |
---|
52 | !! *** ROUTINE dyn_adv *** |
---|
53 | !! |
---|
54 | !! ** Purpose : compute the ocean momentum advection trend. |
---|
55 | !! |
---|
56 | !! ** Method : - Update (ua,va) with the advection term following nadv |
---|
57 | !! NB: in flux form advection (ln_dynadv_cen2 or ln_dynadv_ubs=T) |
---|
58 | !! a metric term is add to the coriolis term while in vector form |
---|
59 | !! it is the relative vorticity which is added to coriolis term |
---|
60 | !! (see dynvor module). |
---|
61 | !!---------------------------------------------------------------------- |
---|
62 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
63 | !!---------------------------------------------------------------------- |
---|
64 | ! |
---|
65 | IF( nn_timing == 1 ) CALL timing_start('dyn_adv') |
---|
66 | ! |
---|
67 | SELECT CASE ( nadv ) ! compute advection trend and add it to general trend |
---|
68 | CASE ( 0 ) |
---|
69 | CALL dyn_keg ( kt, nn_dynkeg ) ! vector form : horizontal gradient of kinetic energy |
---|
70 | CALL dyn_zad ( kt ) ! vector form : vertical advection |
---|
71 | CASE ( 1 ) |
---|
72 | CALL dyn_keg ( kt, nn_dynkeg ) ! vector form : horizontal gradient of kinetic energy |
---|
73 | CALL dyn_zad_zts ( kt ) ! vector form : vertical advection with sub-timestepping |
---|
74 | CASE ( 2 ) |
---|
75 | CALL dyn_adv_cen2( kt ) ! 2nd order centered scheme |
---|
76 | CASE ( 3 ) |
---|
77 | CALL dyn_adv_ubs ( kt ) ! 3rd order UBS scheme |
---|
78 | ! |
---|
79 | CASE (-1 ) ! esopa: test all possibility with control print |
---|
80 | CALL dyn_keg ( kt, nn_dynkeg ) |
---|
81 | CALL dyn_zad ( kt ) |
---|
82 | CALL dyn_adv_cen2( kt ) |
---|
83 | CALL dyn_adv_ubs ( kt ) |
---|
84 | END SELECT |
---|
85 | ! |
---|
86 | IF( nn_timing == 1 ) CALL timing_stop('dyn_adv') |
---|
87 | ! |
---|
88 | END SUBROUTINE dyn_adv |
---|
89 | |
---|
90 | |
---|
91 | SUBROUTINE dyn_adv_init |
---|
92 | !!--------------------------------------------------------------------- |
---|
93 | !! *** ROUTINE dyn_adv_init *** |
---|
94 | !! |
---|
95 | !! ** Purpose : Control the consistency between namelist options for |
---|
96 | !! momentum advection formulation & scheme and set nadv |
---|
97 | !!---------------------------------------------------------------------- |
---|
98 | INTEGER :: ioptio, ios ! Local integer |
---|
99 | ! |
---|
100 | NAMELIST/namdyn_adv/ ln_dynadv_vec, nn_dynkeg, ln_dynadv_cen2 , ln_dynadv_ubs, ln_dynzad_zts |
---|
101 | !!---------------------------------------------------------------------- |
---|
102 | ! |
---|
103 | REWIND( numnam_ref ) ! Namelist namdyn_adv in reference namelist : Momentum advection scheme |
---|
104 | READ ( numnam_ref, namdyn_adv, IOSTAT = ios, ERR = 901) |
---|
105 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_adv in reference namelist', lwp ) |
---|
106 | |
---|
107 | REWIND( numnam_cfg ) ! Namelist namdyn_adv in configuration namelist : Momentum advection scheme |
---|
108 | READ ( numnam_cfg, namdyn_adv, IOSTAT = ios, ERR = 902 ) |
---|
109 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_adv in configuration namelist', lwp ) |
---|
110 | IF(lwm) WRITE ( numond, namdyn_adv ) |
---|
111 | |
---|
112 | IF(lwp) THEN ! Namelist print |
---|
113 | WRITE(numout,*) |
---|
114 | WRITE(numout,*) 'dyn_adv_init : choice/control of the momentum advection scheme' |
---|
115 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
116 | WRITE(numout,*) ' Namelist namdyn_adv : chose a advection formulation & scheme for momentum' |
---|
117 | WRITE(numout,*) ' Vector/flux form (T/F) ln_dynadv_vec = ', ln_dynadv_vec |
---|
118 | WRITE(numout,*) ' = 0 standard scheme ; =1 Hollingsworth scheme nn_dynkeg = ', nn_dynkeg |
---|
119 | WRITE(numout,*) ' 2nd order centred advection scheme ln_dynadv_cen2 = ', ln_dynadv_cen2 |
---|
120 | WRITE(numout,*) ' 3rd order UBS advection scheme ln_dynadv_ubs = ', ln_dynadv_ubs |
---|
121 | WRITE(numout,*) ' Sub timestepping of vertical advection ln_dynzad_zts = ', ln_dynzad_zts |
---|
122 | ENDIF |
---|
123 | |
---|
124 | ioptio = 0 ! Parameter control |
---|
125 | IF( ln_dynadv_vec ) ioptio = ioptio + 1 |
---|
126 | IF( ln_dynadv_cen2 ) ioptio = ioptio + 1 |
---|
127 | IF( ln_dynadv_ubs ) ioptio = ioptio + 1 |
---|
128 | IF( lk_esopa ) ioptio = 1 |
---|
129 | |
---|
130 | IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE advection scheme in namelist namdyn_adv' ) |
---|
131 | IF( ln_dynzad_zts .AND. .NOT. ln_dynadv_vec ) & |
---|
132 | CALL ctl_stop( 'Sub timestepping of vertical advection requires vector form; set ln_dynadv_vec = .TRUE.' ) |
---|
133 | IF( nn_dynkeg /= nkeg_C2 .AND. nn_dynkeg /= nkeg_HW ) & |
---|
134 | CALL ctl_stop( 'KEG scheme wrong value of nn_dynkeg' ) |
---|
135 | |
---|
136 | ! ! Set nadv |
---|
137 | IF( ln_dynadv_vec ) nadv = 0 |
---|
138 | IF( ln_dynzad_zts ) nadv = 1 |
---|
139 | IF( ln_dynadv_cen2 ) nadv = 2 |
---|
140 | IF( ln_dynadv_ubs ) nadv = 3 |
---|
141 | IF( lk_esopa ) nadv = -1 |
---|
142 | |
---|
143 | IF(lwp) THEN ! Print the choice |
---|
144 | WRITE(numout,*) |
---|
145 | IF( nadv == 0 ) WRITE(numout,*) ' vector form : keg + zad + vor is used' |
---|
146 | IF( nadv == 1 ) WRITE(numout,*) ' vector form : keg + zad_zts + vor is used' |
---|
147 | IF( nadv == 0 .OR. nadv == 1 ) THEN |
---|
148 | IF( nn_dynkeg == nkeg_C2 ) WRITE(numout,*) 'with Centered standard keg scheme' |
---|
149 | IF( nn_dynkeg == nkeg_HW ) WRITE(numout,*) 'with Hollingsworth keg scheme' |
---|
150 | ENDIF |
---|
151 | IF( nadv == 2 ) WRITE(numout,*) ' flux form : 2nd order scheme is used' |
---|
152 | IF( nadv == 3 ) WRITE(numout,*) ' flux form : UBS scheme is used' |
---|
153 | IF( nadv == -1 ) WRITE(numout,*) ' esopa test: use all advection formulation' |
---|
154 | ENDIF |
---|
155 | ! |
---|
156 | END SUBROUTINE dyn_adv_init |
---|
157 | |
---|
158 | !!====================================================================== |
---|
159 | END MODULE dynadv |
---|