New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
dynspg_exp.F90 in branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/UKMO/dev_r5518_GO6_package/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90 @ 11101

Last change on this file since 11101 was 11101, checked in by frrh, 5 years ago

Merge changes from Met Office GMED ticket 450 to reduce unnecessary
text output from NEMO.
This output, which is typically not switchable, is rarely of interest
in normal (non-debugging) runs and simply redunantley consumes extra
file space.
Further, the presence of this text output has been shown to
significantly degrade performance of models which are run during
Met Office HPC RAID (disk) checks.
The new code introduces switches which are configurable via the
changes made in the associated Met Office MOCI ticket 399.

File size: 5.2 KB
RevLine 
[358]1MODULE 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
[719]20   USE phycst          ! physical constants
[4990]21   !
[888]22   USE in_out_manager  ! I/O manager
[358]23   USE lib_mpp         ! distributed memory computing library
24   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
25   USE prtctl          ! Print control
[575]26   USE iom             ! I/O library
[3294]27   USE timing          ! Timing
[358]28
[3294]29
[358]30   IMPLICIT NONE
31   PRIVATE
32
[1438]33   PUBLIC   dyn_spg_exp   ! routine called by step.F90
[358]34
35   !! * Substitutions
36#  include "domzgr_substitute.h90"
37#  include "vectopt_loop_substitute.h90"
38   !!----------------------------------------------------------------------
[2528]39   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[888]40   !! $Id$
[2715]41   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[358]42   !!----------------------------------------------------------------------
43CONTAINS
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
[1505]50      !!              gradient in case of explicit free surface formulation and
51      !!              add it to the general trend of momentum equation.
[358]52      !!
[1505]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 )
[358]58      !!
[1505]59      !! ** Action :   (ua,va)   trend of horizontal velocity increased by
60      !!                         the surf. pressure gradient trend
[358]61      !!---------------------------------------------------------------------
[2715]62      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
[1438]63      !!
[2715]64      INTEGER ::   ji, jj, jk   ! dummy loop indices
[358]65      !!----------------------------------------------------------------------
[3294]66      !
67      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_exp')
68      !
[358]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         !
[2715]74         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
[1505]75         !
76         IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg'
[11101]77         IF(lflush) CALL flush(numout)
[358]78      ENDIF
79
[1505]80      IF( .NOT. lk_vvl ) THEN          !* fixed volume : add the surface pressure gradient trend
81         !
82         DO jj = 2, jpjm1                    ! now surface pressure gradient
[358]83            DO ji = fs_2, fs_jpim1   ! vector opt.
[1505]84               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj)
85               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj)
86            END DO
[4292]87         END DO
88         !
[1505]89         DO jk = 1, jpkm1                    ! Add it to the general trend
90            DO jj = 2, jpjm1
91               DO ji = fs_2, fs_jpim1   ! vector opt.
92                  ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj)
93                  va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj)
94               END DO
[358]95            END DO
96         END DO
[1505]97         !
98      ENDIF
99      !
[3294]100      IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_exp')
101      !
[358]102   END SUBROUTINE dyn_spg_exp
103
104#else
105   !!----------------------------------------------------------------------
106   !!   Default case :   Empty module   No standart explicit free surface
107   !!----------------------------------------------------------------------
108CONTAINS
109   SUBROUTINE dyn_spg_exp( kt )       ! Empty routine
[9583]110   IMPLICIT NONE
111      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index 
[358]112      WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt
113   END SUBROUTINE dyn_spg_exp
114#endif
[1438]115
[358]116   !!======================================================================
117END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.