1 | MODULE dynzad |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE dynzad *** |
---|
4 | !! Ocean dynamics : vertical advection trend |
---|
5 | !!====================================================================== |
---|
6 | !! History : OPA ! 1991-01 (G. Madec) Original code |
---|
7 | !! 7.0 ! 1991-11 (G. Madec) |
---|
8 | !! 7.5 ! 1996-01 (G. Madec) statement function for e3 |
---|
9 | !! NEMO 0.5 ! 2002-07 (G. Madec) Free form, F90 |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! dyn_zad : vertical advection momentum trend |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE oce ! ocean dynamics and tracers |
---|
16 | USE dom_oce ! ocean space and time domain |
---|
17 | USE sbc_oce ! surface boundary condition: ocean |
---|
18 | USE trdmod_oce ! ocean variables trends |
---|
19 | USE trdmod ! ocean dynamics trends |
---|
20 | USE in_out_manager ! I/O manager |
---|
21 | USE lib_mpp ! MPP library |
---|
22 | USE prtctl ! Print control |
---|
23 | |
---|
24 | IMPLICIT NONE |
---|
25 | PRIVATE |
---|
26 | |
---|
27 | PUBLIC dyn_zad ! routine called by step.F90 |
---|
28 | |
---|
29 | !! * Substitutions |
---|
30 | # include "domzgr_substitute.h90" |
---|
31 | # include "vectopt_loop_substitute.h90" |
---|
32 | !!---------------------------------------------------------------------- |
---|
33 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
34 | !! $Id$ |
---|
35 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
36 | !!---------------------------------------------------------------------- |
---|
37 | CONTAINS |
---|
38 | |
---|
39 | SUBROUTINE dyn_zad ( kt ) |
---|
40 | !!---------------------------------------------------------------------- |
---|
41 | !! *** ROUTINE dynzad *** |
---|
42 | !! |
---|
43 | !! ** Purpose : Compute the now vertical momentum advection trend and |
---|
44 | !! add it to the general trend of momentum equation. |
---|
45 | !! |
---|
46 | !! ** Method : The now vertical advection of momentum is given by: |
---|
47 | !! w dz(u) = ua + 1/(e1u*e2u*e3u) mk+1[ mi(e1t*e2t*wn) dk(un) ] |
---|
48 | !! w dz(v) = va + 1/(e1v*e2v*e3v) mk+1[ mj(e1t*e2t*wn) dk(vn) ] |
---|
49 | !! Add this trend to the general trend (ua,va): |
---|
50 | !! (ua,va) = (ua,va) + w dz(u,v) |
---|
51 | !! |
---|
52 | !! ** Action : - Update (ua,va) with the vert. momentum adv. trends |
---|
53 | !! - Save the trends in (ztrdu,ztrdv) ('key_trddyn') |
---|
54 | !!---------------------------------------------------------------------- |
---|
55 | USE wrk_nemo, ONLY: wrk_in_use, wrk_not_released |
---|
56 | USE wrk_nemo, ONLY: zww => wrk_2d_1 ! 2D workspace |
---|
57 | USE oce , ONLY: zwuw => ta , zwvw => sa ! (ta,sa) used as 3D workspace |
---|
58 | USE wrk_nemo, ONLY: ztrdu => wrk_3d_1 , ztrdv => wrk_3d_2 ! 3D workspace |
---|
59 | ! |
---|
60 | INTEGER, INTENT(in) :: kt ! ocean time-step inedx |
---|
61 | ! |
---|
62 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
63 | REAL(wp) :: zua, zva ! temporary scalars |
---|
64 | !!---------------------------------------------------------------------- |
---|
65 | |
---|
66 | IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1,2) ) THEN |
---|
67 | CALL ctl_stop('dyn_zad: requested workspace arrays unavailable') ; RETURN |
---|
68 | ENDIF |
---|
69 | |
---|
70 | IF( kt == nit000 ) THEN |
---|
71 | IF(lwp)WRITE(numout,*) |
---|
72 | IF(lwp)WRITE(numout,*) 'dyn_zad : arakawa advection scheme' |
---|
73 | ENDIF |
---|
74 | |
---|
75 | IF( l_trddyn ) THEN ! Save ua and va trends |
---|
76 | ztrdu(:,:,:) = ua(:,:,:) |
---|
77 | ztrdv(:,:,:) = va(:,:,:) |
---|
78 | ENDIF |
---|
79 | |
---|
80 | DO jk = 2, jpkm1 ! Vertical momentum advection at level w and u- and v- vertical |
---|
81 | DO jj = 2, jpj ! vertical fluxes |
---|
82 | DO ji = fs_2, jpi ! vector opt. |
---|
83 | zww(ji,jj) = 0.25 * e1t(ji,jj) * e2t(ji,jj) * wn(ji,jj,jk) |
---|
84 | END DO |
---|
85 | END DO |
---|
86 | DO jj = 2, jpjm1 ! vertical momentum advection at w-point |
---|
87 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
88 | zwuw(ji,jj,jk) = ( zww(ji+1,jj ) + zww(ji,jj) ) * ( un(ji,jj,jk-1)-un(ji,jj,jk) ) |
---|
89 | zwvw(ji,jj,jk) = ( zww(ji ,jj+1) + zww(ji,jj) ) * ( vn(ji,jj,jk-1)-vn(ji,jj,jk) ) |
---|
90 | END DO |
---|
91 | END DO |
---|
92 | END DO |
---|
93 | DO jj = 2, jpjm1 ! Surface and bottom values set to zero |
---|
94 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
95 | zwuw(ji,jj, 1 ) = 0.e0 |
---|
96 | zwvw(ji,jj, 1 ) = 0.e0 |
---|
97 | zwuw(ji,jj,jpk) = 0.e0 |
---|
98 | zwvw(ji,jj,jpk) = 0.e0 |
---|
99 | END DO |
---|
100 | END DO |
---|
101 | |
---|
102 | DO jk = 1, jpkm1 ! Vertical momentum advection at u- and v-points |
---|
103 | DO jj = 2, jpjm1 |
---|
104 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
105 | ! ! vertical momentum advective trends |
---|
106 | zua = - ( zwuw(ji,jj,jk) + zwuw(ji,jj,jk+1) ) / ( e1u(ji,jj) * e2u(ji,jj) * fse3u(ji,jj,jk) ) |
---|
107 | zva = - ( zwvw(ji,jj,jk) + zwvw(ji,jj,jk+1) ) / ( e1v(ji,jj) * e2v(ji,jj) * fse3v(ji,jj,jk) ) |
---|
108 | ! ! add the trends to the general momentum trends |
---|
109 | ua(ji,jj,jk) = ua(ji,jj,jk) + zua |
---|
110 | va(ji,jj,jk) = va(ji,jj,jk) + zva |
---|
111 | END DO |
---|
112 | END DO |
---|
113 | END DO |
---|
114 | |
---|
115 | IF( l_trddyn ) THEN ! save the vertical advection trends for diagnostic |
---|
116 | ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) |
---|
117 | ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) |
---|
118 | CALL trd_mod(ztrdu, ztrdv, jpdyn_trd_zad, 'DYN', kt) |
---|
119 | ENDIF |
---|
120 | ! ! Control print |
---|
121 | IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' zad - Ua: ', mask1=umask, & |
---|
122 | & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) |
---|
123 | ! |
---|
124 | IF( wrk_not_released(2, 1) .OR. & |
---|
125 | wrk_not_released(3, 1,2) ) CALL ctl_stop('dyn_zad: failed to release workspace arrays') |
---|
126 | ! |
---|
127 | END SUBROUTINE dyn_zad |
---|
128 | |
---|
129 | !!====================================================================== |
---|
130 | END MODULE dynzad |
---|