[358] | 1 | MODULE dynspg_exp |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE dynspg_exp *** |
---|
| 4 | !! Ocean dynamics: surface pressure gradient trend |
---|
| 5 | !!====================================================================== |
---|
[1505] | 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 |
---|
[1438] | 8 | !!---------------------------------------------------------------------- |
---|
[575] | 9 | #if defined key_dynspg_exp || defined key_esopa |
---|
[358] | 10 | !!---------------------------------------------------------------------- |
---|
[1505] | 11 | !! 'key_dynspg_exp' explicit free surface |
---|
[358] | 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 |
---|
[888] | 19 | USE sbc_oce ! surface boundary condition: ocean |
---|
| 20 | USE obc_oce ! Lateral open boundary condition |
---|
[719] | 21 | USE phycst ! physical constants |
---|
[371] | 22 | USE obc_par ! open boundary condition parameters |
---|
[367] | 23 | USE obcdta ! open boundary condition data (obc_dta_bt routine) |
---|
[888] | 24 | USE in_out_manager ! I/O manager |
---|
[358] | 25 | USE lib_mpp ! distributed memory computing library |
---|
| 26 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 27 | USE prtctl ! Print control |
---|
[575] | 28 | USE iom ! I/O library |
---|
| 29 | USE restart ! only for lrst_oce |
---|
[358] | 30 | |
---|
| 31 | IMPLICIT NONE |
---|
| 32 | PRIVATE |
---|
| 33 | |
---|
[1438] | 34 | PUBLIC dyn_spg_exp ! routine called by step.F90 |
---|
[358] | 35 | |
---|
| 36 | !! * Substitutions |
---|
| 37 | # include "domzgr_substitute.h90" |
---|
| 38 | # include "vectopt_loop_substitute.h90" |
---|
| 39 | !!---------------------------------------------------------------------- |
---|
[1438] | 40 | !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) |
---|
[888] | 41 | !! $Id$ |
---|
[1438] | 42 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
[358] | 43 | !!---------------------------------------------------------------------- |
---|
| 44 | |
---|
| 45 | CONTAINS |
---|
| 46 | |
---|
| 47 | SUBROUTINE dyn_spg_exp( kt ) |
---|
| 48 | !!---------------------------------------------------------------------- |
---|
| 49 | !! *** routine dyn_spg_exp *** |
---|
| 50 | !! |
---|
| 51 | !! ** Purpose : Compute the now trend due to the surface pressure |
---|
[1505] | 52 | !! gradient in case of explicit free surface formulation and |
---|
| 53 | !! add it to the general trend of momentum equation. |
---|
[358] | 54 | !! |
---|
[1505] | 55 | !! ** Method : Explicit free surface formulation. Add to the general |
---|
| 56 | !! momentum trend the surface pressure gradient : |
---|
| 57 | !! (ua,va) = (ua,va) + (spgu,spgv) |
---|
| 58 | !! where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn ) |
---|
| 59 | !! spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn ) |
---|
[358] | 60 | !! |
---|
[1505] | 61 | !! ** Action : (ua,va) trend of horizontal velocity increased by |
---|
| 62 | !! the surf. pressure gradient trend |
---|
[358] | 63 | !!--------------------------------------------------------------------- |
---|
| 64 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
[1438] | 65 | !! |
---|
[358] | 66 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 67 | !!---------------------------------------------------------------------- |
---|
| 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)' |
---|
[1505] | 73 | ! |
---|
| 74 | spgu(:,:) = 0.e0 ; spgv(:,:) = 0.e0 |
---|
| 75 | ! |
---|
| 76 | IF( lk_vvl .AND. lwp ) WRITE(numout,*) ' lk_vvl=T : spg is included in dynhpg' |
---|
[358] | 77 | ENDIF |
---|
| 78 | |
---|
| 79 | |
---|
[1505] | 80 | !!gm bug ?? Rachid we have to discuss of the call below. I don't understand why it is here and not in ssh_wzv |
---|
| 81 | IF( lk_obc ) CALL obc_dta_bt( kt, 0 ) ! OBC: read or estimate ssh and vertically integrated velocities |
---|
| 82 | !!gm |
---|
[358] | 83 | |
---|
[1505] | 84 | IF( .NOT. lk_vvl ) THEN !* fixed volume : add the surface pressure gradient trend |
---|
| 85 | ! |
---|
| 86 | DO jj = 2, jpjm1 ! now surface pressure gradient |
---|
[358] | 87 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[1505] | 88 | spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj) |
---|
| 89 | spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj) |
---|
| 90 | END DO |
---|
| 91 | END DO |
---|
| 92 | DO jk = 1, jpkm1 ! Add it to the general trend |
---|
| 93 | DO jj = 2, jpjm1 |
---|
| 94 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 95 | ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) |
---|
| 96 | va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) |
---|
| 97 | END DO |
---|
[358] | 98 | END DO |
---|
| 99 | END DO |
---|
[1505] | 100 | ! |
---|
| 101 | ENDIF |
---|
| 102 | ! |
---|
[358] | 103 | END SUBROUTINE dyn_spg_exp |
---|
| 104 | |
---|
| 105 | #else |
---|
| 106 | !!---------------------------------------------------------------------- |
---|
| 107 | !! Default case : Empty module No standart explicit free surface |
---|
| 108 | !!---------------------------------------------------------------------- |
---|
| 109 | CONTAINS |
---|
| 110 | SUBROUTINE dyn_spg_exp( kt ) ! Empty routine |
---|
| 111 | WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt |
---|
| 112 | END SUBROUTINE dyn_spg_exp |
---|
| 113 | #endif |
---|
[1438] | 114 | |
---|
[358] | 115 | !!====================================================================== |
---|
| 116 | END MODULE dynspg_exp |
---|