[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 |
---|
[3294] | 23 | USE obcdta ! open boundary condition data (bdy_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 |
---|
[3294] | 30 | USE timing ! Timing |
---|
[358] | 31 | |
---|
[3294] | 32 | |
---|
[358] | 33 | IMPLICIT NONE |
---|
| 34 | PRIVATE |
---|
| 35 | |
---|
[1438] | 36 | PUBLIC dyn_spg_exp ! routine called by step.F90 |
---|
[358] | 37 | |
---|
| 38 | !! * Substitutions |
---|
| 39 | # include "domzgr_substitute.h90" |
---|
| 40 | # include "vectopt_loop_substitute.h90" |
---|
| 41 | !!---------------------------------------------------------------------- |
---|
[2528] | 42 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[888] | 43 | !! $Id$ |
---|
[2715] | 44 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[358] | 45 | !!---------------------------------------------------------------------- |
---|
| 46 | CONTAINS |
---|
| 47 | |
---|
| 48 | SUBROUTINE dyn_spg_exp( kt ) |
---|
| 49 | !!---------------------------------------------------------------------- |
---|
| 50 | !! *** routine dyn_spg_exp *** |
---|
| 51 | !! |
---|
| 52 | !! ** Purpose : Compute the now trend due to the surface pressure |
---|
[1505] | 53 | !! gradient in case of explicit free surface formulation and |
---|
| 54 | !! add it to the general trend of momentum equation. |
---|
[358] | 55 | !! |
---|
[1505] | 56 | !! ** Method : Explicit free surface formulation. Add to the general |
---|
| 57 | !! momentum trend the surface pressure gradient : |
---|
| 58 | !! (ua,va) = (ua,va) + (spgu,spgv) |
---|
| 59 | !! where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn ) |
---|
| 60 | !! spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn ) |
---|
[358] | 61 | !! |
---|
[1505] | 62 | !! ** Action : (ua,va) trend of horizontal velocity increased by |
---|
| 63 | !! the surf. pressure gradient trend |
---|
[358] | 64 | !!--------------------------------------------------------------------- |
---|
[2715] | 65 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
[1438] | 66 | !! |
---|
[2715] | 67 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
[358] | 68 | !!---------------------------------------------------------------------- |
---|
[3294] | 69 | ! |
---|
| 70 | IF( nn_timing == 1 ) CALL timing_start('dyn_spg_exp') |
---|
| 71 | ! |
---|
[358] | 72 | IF( kt == nit000 ) THEN |
---|
| 73 | IF(lwp) WRITE(numout,*) |
---|
| 74 | IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend' |
---|
| 75 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ (explicit free surface)' |
---|
[1505] | 76 | ! |
---|
[2715] | 77 | spgu(:,:) = 0._wp ; spgv(:,:) = 0._wp |
---|
[1505] | 78 | ! |
---|
| 79 | IF( lk_vvl .AND. lwp ) WRITE(numout,*) ' lk_vvl=T : spg is included in dynhpg' |
---|
[358] | 80 | ENDIF |
---|
| 81 | |
---|
| 82 | |
---|
[1505] | 83 | !!gm bug ?? Rachid we have to discuss of the call below. I don't understand why it is here and not in ssh_wzv |
---|
| 84 | IF( lk_obc ) CALL obc_dta_bt( kt, 0 ) ! OBC: read or estimate ssh and vertically integrated velocities |
---|
| 85 | !!gm |
---|
[358] | 86 | |
---|
[1505] | 87 | IF( .NOT. lk_vvl ) THEN !* fixed volume : add the surface pressure gradient trend |
---|
| 88 | ! |
---|
| 89 | DO jj = 2, jpjm1 ! now surface pressure gradient |
---|
[358] | 90 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[1505] | 91 | spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj) |
---|
| 92 | spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj) |
---|
| 93 | END DO |
---|
| 94 | END DO |
---|
| 95 | DO jk = 1, jpkm1 ! Add it to the general trend |
---|
| 96 | DO jj = 2, jpjm1 |
---|
| 97 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 98 | ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) |
---|
| 99 | va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) |
---|
| 100 | END DO |
---|
[358] | 101 | END DO |
---|
| 102 | END DO |
---|
[1505] | 103 | ! |
---|
| 104 | ENDIF |
---|
| 105 | ! |
---|
[3294] | 106 | IF( nn_timing == 1 ) CALL timing_stop('dyn_spg_exp') |
---|
| 107 | ! |
---|
[358] | 108 | END SUBROUTINE dyn_spg_exp |
---|
| 109 | |
---|
| 110 | #else |
---|
| 111 | !!---------------------------------------------------------------------- |
---|
| 112 | !! Default case : Empty module No standart explicit free surface |
---|
| 113 | !!---------------------------------------------------------------------- |
---|
| 114 | CONTAINS |
---|
| 115 | SUBROUTINE dyn_spg_exp( kt ) ! Empty routine |
---|
| 116 | WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt |
---|
| 117 | END SUBROUTINE dyn_spg_exp |
---|
| 118 | #endif |
---|
[1438] | 119 | |
---|
[358] | 120 | !!====================================================================== |
---|
| 121 | END MODULE dynspg_exp |
---|