1 | MODULE trazdf_exp |
---|
2 | !!============================================================================== |
---|
3 | !! *** MODULE trazdf_exp *** |
---|
4 | !! Ocean tracers: vertical component of the tracer mixing trend using |
---|
5 | !! a split-explicit time-stepping |
---|
6 | !!============================================================================== |
---|
7 | !! History : OPA ! 1990-10 (B. Blanke) Original code |
---|
8 | !! 7.0 ! 1991-11 (G. Madec) |
---|
9 | !! ! 1992-06 (M. Imbard) correction on tracer trend loops |
---|
10 | !! ! 1996-01 (G. Madec) statement function for e3 |
---|
11 | !! ! 1997-05 (G. Madec) vertical component of isopycnal |
---|
12 | !! ! 1997-07 (G. Madec) geopotential diffusion in s-coord |
---|
13 | !! ! 2000-08 (G. Madec) double diffusive mixing |
---|
14 | !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and module |
---|
15 | !! - ! 2004-08 (C. Talandier) New trends organisation |
---|
16 | !! - ! 2005-11 (G. Madec) New organisation |
---|
17 | !! 3.0 ! 2008-04 (G. Madec) leap-frog time stepping done in trazdf |
---|
18 | !! 3.3 ! 2010-06 (C. Ethe, G. Madec) Merge TRA-TRC |
---|
19 | !!---------------------------------------------------------------------- |
---|
20 | |
---|
21 | !!---------------------------------------------------------------------- |
---|
22 | !! tra_zdf_exp : compute the tracer the vertical diffusion trend using a |
---|
23 | !! split-explicit time stepping and provide the after tracer |
---|
24 | !!---------------------------------------------------------------------- |
---|
25 | USE oce ! ocean dynamics and active tracers |
---|
26 | USE dom_oce ! ocean space and time domain |
---|
27 | USE domvvl ! variable volume levels |
---|
28 | USE zdf_oce ! ocean vertical physics |
---|
29 | USE zdfddm ! ocean vertical physics: double diffusion |
---|
30 | USE trc_oce ! share passive tracers/Ocean variables |
---|
31 | ! |
---|
32 | USE in_out_manager ! I/O manager |
---|
33 | USE lib_mpp ! MPP library |
---|
34 | USE wrk_nemo ! Memory Allocation |
---|
35 | USE timing ! Timing |
---|
36 | |
---|
37 | IMPLICIT NONE |
---|
38 | PRIVATE |
---|
39 | |
---|
40 | PUBLIC tra_zdf_exp ! routine called by step.F90 |
---|
41 | |
---|
42 | !! * Substitutions |
---|
43 | # include "zdfddm_substitute.h90" |
---|
44 | # include "vectopt_loop_substitute.h90" |
---|
45 | !!---------------------------------------------------------------------- |
---|
46 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
47 | !! $Id$ |
---|
48 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
49 | !!---------------------------------------------------------------------- |
---|
50 | CONTAINS |
---|
51 | |
---|
52 | SUBROUTINE tra_zdf_exp( kt, kit000, cdtype, p2dt, ksts, & |
---|
53 | & ptb , pta , kjpt ) |
---|
54 | !!---------------------------------------------------------------------- |
---|
55 | !! *** ROUTINE tra_zdf_exp *** |
---|
56 | !! |
---|
57 | !! ** Purpose : Compute the after tracer fields due to the vertical |
---|
58 | !! tracer mixing alone, and then due to the whole tracer trend. |
---|
59 | !! |
---|
60 | !! ** Method : - The after tracer fields due to the vertical diffusion |
---|
61 | !! of tracers alone is given by: |
---|
62 | !! ztb = ptb + p2dt difft |
---|
63 | !! where difft = dz( avt dz(ptb) ) = 1/e3t dk+1( avt/e3w dk(ptb) ) |
---|
64 | !! (if lk_zdfddm=T use avs on salinity and passive tracers instead of avt) |
---|
65 | !! difft is evaluated with an Euler split-explit scheme using a |
---|
66 | !! no flux boundary condition at both surface and bottomi boundaries. |
---|
67 | !! (N.B. bottom condition is applied through the masked field avt). |
---|
68 | !! - the after tracer fields due to the whole trend is |
---|
69 | !! obtained in leap-frog environment applied on thickness weighted tracer by : |
---|
70 | !! pta = [ ptb*e3tb + e3tn*( ztb - ptb + p2dt pta ) ] / e3tn |
---|
71 | !! |
---|
72 | !! ** Action : - after tracer fields pta |
---|
73 | !!--------------------------------------------------------------------- |
---|
74 | INTEGER , INTENT(in ) :: kt ! ocean time-step index |
---|
75 | INTEGER , INTENT(in ) :: kit000 ! first time step index |
---|
76 | CHARACTER(len=3) , INTENT(in ) :: cdtype ! =TRA or TRC (tracer indicator) |
---|
77 | INTEGER , INTENT(in ) :: kjpt ! number of tracers |
---|
78 | INTEGER , INTENT(in ) :: ksts ! number of sub-time step |
---|
79 | REAL(wp) , INTENT(in ) :: p2dt ! vertical profile of tracer time-step |
---|
80 | REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in ) :: ptb ! before and now tracer fields |
---|
81 | REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) :: pta ! in: tracer trend ; out: after tracer field |
---|
82 | ! |
---|
83 | INTEGER :: ji, jj, jk, jn, jl ! dummy loop indices |
---|
84 | REAL(wp) :: z1_ksts, ze3tr ! local scalars |
---|
85 | REAL(wp) :: ztra, ze3tb ! - - |
---|
86 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztb, zwf |
---|
87 | !!--------------------------------------------------------------------- |
---|
88 | ! |
---|
89 | IF( nn_timing == 1 ) CALL timing_start('tra_zdf_exp') |
---|
90 | ! |
---|
91 | CALL wrk_alloc( jpi,jpj,jpk, ztb, zwf ) |
---|
92 | ! |
---|
93 | IF( kt == kit000 ) THEN |
---|
94 | IF(lwp) WRITE(numout,*) |
---|
95 | IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing on ', cdtype |
---|
96 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' |
---|
97 | ENDIF |
---|
98 | |
---|
99 | ! Initializations |
---|
100 | ! --------------- |
---|
101 | z1_ksts = 1._wp / REAL( ksts, wp ) |
---|
102 | zwf(:,:, 1 ) = 0._wp ! no flux at the surface and at bottom level |
---|
103 | zwf(:,:,jpk) = 0._wp |
---|
104 | ! |
---|
105 | ! |
---|
106 | DO jn = 1, kjpt !== loop over tracers ==! |
---|
107 | ! |
---|
108 | ztb(:,:,:) = ptb(:,:,:,jn) ! initial before value for tracer |
---|
109 | ! |
---|
110 | DO jl = 1, ksts !== Split-explicit loop ==! |
---|
111 | ! |
---|
112 | DO jk = 2, jpk ! 1st vertical derivative (w-flux) |
---|
113 | DO jj = 2, jpjm1 |
---|
114 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
115 | IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN ! temperature : use of avt |
---|
116 | zwf(ji,jj,jk) = avt(ji,jj,jk) * ( ztb(ji,jj,jk-1) - ztb(ji,jj,jk) ) / e3w_b(ji,jj,jk) |
---|
117 | ELSE ! salinity or pass. tracer : use of avs |
---|
118 | zwf(ji,jj,jk) = fsavs(ji,jj,jk) * ( ztb(ji,jj,jk-1) - ztb(ji,jj,jk) ) / e3w_b(ji,jj,jk) |
---|
119 | END IF |
---|
120 | END DO |
---|
121 | END DO |
---|
122 | END DO |
---|
123 | ! |
---|
124 | DO jk = 1, jpkm1 ! 2nd vertical derivative ==> tracer at kt+l*2*rdt/nn_zdfexp |
---|
125 | DO jj = 2, jpjm1 |
---|
126 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
127 | ztb(ji,jj,jk) = ztb(ji,jj,jk) + p2dt * ( zwf(ji,jj,jk) - zwf(ji,jj,jk+1) ) / e3t_n(ji,jj,jk) |
---|
128 | END DO |
---|
129 | END DO |
---|
130 | END DO |
---|
131 | ! |
---|
132 | END DO ! end sub-time stepping |
---|
133 | |
---|
134 | DO jk = 1, jpkm1 !== After tracer due to all trends |
---|
135 | DO jj = 2, jpjm1 |
---|
136 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
137 | ze3tb = e3t_b(ji,jj,jk) / e3t_n(ji,jj,jk) |
---|
138 | ztra = ( ztb(ji,jj,jk) - ptb(ji,jj,jk,jn) ) + p2dt * pta(ji,jj,jk,jn) ! total trend * 2dt |
---|
139 | pta(ji,jj,jk,jn) = ( ze3tb * ptb(ji,jj,jk,jn) + ztra ) * tmask(ji,jj,jk) ! after tracer |
---|
140 | END DO |
---|
141 | END DO |
---|
142 | END DO |
---|
143 | ! |
---|
144 | END DO ! end of tracer loop |
---|
145 | ! |
---|
146 | CALL wrk_dealloc( jpi,jpj,jpk, ztb, zwf ) |
---|
147 | ! |
---|
148 | IF( nn_timing == 1 ) CALL timing_stop('tra_zdf_exp') |
---|
149 | ! |
---|
150 | END SUBROUTINE tra_zdf_exp |
---|
151 | |
---|
152 | !!============================================================================== |
---|
153 | END MODULE trazdf_exp |
---|