1 | MODULE dynspg_exp |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE dynspg_exp *** |
---|
4 | !! Ocean dynamics: surface pressure gradient trend |
---|
5 | !!====================================================================== |
---|
6 | !! History : 2.0 ! 2005-11 (V. Garnier, G. Madec, L. Bessieres) Original code |
---|
7 | !! 3.2 ! 2009-06 (G. Madec, M. Leclair, R. Benshila) introduce sshwzv module |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | #if defined key_dynspg_exp || defined key_esopa |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_dynspg_exp' explicit free surface |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! dyn_spg_exp : update the momentum trend with the surface |
---|
14 | !! pressure gradient in the free surface constant |
---|
15 | !! volume case with vector optimization |
---|
16 | !!---------------------------------------------------------------------- |
---|
17 | USE oce ! ocean dynamics and tracers |
---|
18 | USE dom_oce ! ocean space and time domain |
---|
19 | USE sbc_oce ! surface boundary condition: ocean |
---|
20 | USE phycst ! physical constants |
---|
21 | ! |
---|
22 | USE in_out_manager ! I/O manager |
---|
23 | USE lib_mpp ! distributed memory computing library |
---|
24 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
25 | USE prtctl ! Print control |
---|
26 | USE iom ! I/O library |
---|
27 | USE timing ! Timing |
---|
28 | |
---|
29 | |
---|
30 | IMPLICIT NONE |
---|
31 | PRIVATE |
---|
32 | |
---|
33 | PUBLIC dyn_spg_exp ! routine called by step.F90 |
---|
34 | |
---|
35 | !! * Substitutions |
---|
36 | # include "domzgr_substitute.h90" |
---|
37 | # include "vectopt_loop_substitute.h90" |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
40 | !! $Id$ |
---|
41 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | CONTAINS |
---|
44 | |
---|
45 | SUBROUTINE dyn_spg_exp( kt ) |
---|
46 | !!---------------------------------------------------------------------- |
---|
47 | !! *** routine dyn_spg_exp *** |
---|
48 | !! |
---|
49 | !! ** Purpose : Compute the now trend due to the surface pressure |
---|
50 | !! gradient in case of explicit free surface formulation and |
---|
51 | !! add it to the general trend of momentum equation. |
---|
52 | !! |
---|
53 | !! ** Method : Explicit free surface formulation. Add to the general |
---|
54 | !! momentum trend the surface pressure gradient : |
---|
55 | !! (ua,va) = (ua,va) + (spgu,spgv) |
---|
56 | !! where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn ) |
---|
57 | !! spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn ) |
---|
58 | !! |
---|
59 | !! ** Action : (ua,va) trend of horizontal velocity increased by |
---|
60 | !! the surf. pressure gradient trend |
---|
61 | !!--------------------------------------------------------------------- |
---|
62 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
63 | !! |
---|
64 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
65 | !!---------------------------------------------------------------------- |
---|
66 | ! |
---|
67 | IF( nn_timing == 1 ) CALL timing_start('dyn_spg_exp') |
---|
68 | ! |
---|
69 | IF( kt == nit000 ) THEN |
---|
70 | IF(lwp) WRITE(numout,*) |
---|
71 | IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend' |
---|
72 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ (explicit free surface)' |
---|
73 | ! |
---|
74 | spgu(:,:) = 0._wp ; spgv(:,:) = 0._wp |
---|
75 | ! |
---|
76 | IF( lk_vvl .AND. lwp ) WRITE(numout,*) ' lk_vvl=T : spg is included in dynhpg' |
---|
77 | ENDIF |
---|
78 | |
---|
79 | IF( .NOT. lk_vvl ) THEN !* fixed volume : add the surface pressure gradient trend |
---|
80 | ! |
---|
81 | DO jj = 2, jpjm1 ! now surface pressure gradient |
---|
82 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
83 | spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj) |
---|
84 | spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj) |
---|
85 | END DO |
---|
86 | END DO |
---|
87 | ! |
---|
88 | DO jk = 1, jpkm1 ! Add it to the general trend |
---|
89 | DO jj = 2, jpjm1 |
---|
90 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
91 | ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) |
---|
92 | va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) |
---|
93 | END DO |
---|
94 | END DO |
---|
95 | END DO |
---|
96 | ! |
---|
97 | ENDIF |
---|
98 | ! |
---|
99 | IF( nn_timing == 1 ) CALL timing_stop('dyn_spg_exp') |
---|
100 | ! |
---|
101 | END SUBROUTINE dyn_spg_exp |
---|
102 | |
---|
103 | #else |
---|
104 | !!---------------------------------------------------------------------- |
---|
105 | !! Default case : Empty module No standart explicit free surface |
---|
106 | !!---------------------------------------------------------------------- |
---|
107 | CONTAINS |
---|
108 | SUBROUTINE dyn_spg_exp( kt ) ! Empty routine |
---|
109 | WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt |
---|
110 | END SUBROUTINE dyn_spg_exp |
---|
111 | #endif |
---|
112 | |
---|
113 | !!====================================================================== |
---|
114 | END MODULE dynspg_exp |
---|