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.
Changeset 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90

    r4990 r6808  
    1010   !!            3.4  !  2011     (D. Storkey) rewrite in preparation for OBC-BDY merge 
    1111   !!---------------------------------------------------------------------- 
    12 #if   defined key_bdy   &&   defined key_dynspg_flt 
     12#if defined key_bdy 
    1313   !!---------------------------------------------------------------------- 
    14    !!   'key_bdy'            AND      unstructured open boundary conditions 
    15    !!   'key_dynspg_flt'                              filtered free surface 
     14   !!   'key_bdy'                     unstructured open boundary conditions 
    1615   !!---------------------------------------------------------------------- 
    17    USE timing          ! Timing 
    18    USE oce             ! ocean dynamics and tracers  
    19    USE sbcisf          ! ice shelf 
    20    USE dom_oce         ! ocean space and time domain  
    21    USE phycst          ! physical constants 
    22    USE bdy_oce         ! ocean open boundary conditions 
    23    USE lib_mpp         ! for mppsum 
    24    USE in_out_manager  ! I/O manager 
    25    USE sbc_oce         ! ocean surface boundary conditions 
     16   USE oce            ! ocean dynamics and tracers  
     17   USE bdy_oce        ! ocean open boundary conditions 
     18   USE sbc_oce        ! ocean surface boundary conditions 
     19   USE dom_oce        ! ocean space and time domain  
     20   USE phycst         ! physical constants 
     21   USE sbcisf         ! ice shelf 
     22   ! 
     23   USE in_out_manager ! I/O manager 
     24   USE lib_mpp        ! for mppsum 
     25   USE timing         ! Timing 
     26   USE lib_fortran    ! Fortran routines library 
    2627 
    2728   IMPLICIT NONE 
    2829   PRIVATE 
    2930 
    30    PUBLIC bdy_vol        ! routine called by dynspg_flt.h90 
     31   PUBLIC   bdy_vol    ! called by ??? 
    3132 
    32    !! * Substitutions 
    33 #  include "domzgr_substitute.h90" 
    3433   !!---------------------------------------------------------------------- 
    35    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     34   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
    3635   !! $Id$  
    3736   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    4342      !!                      ***  ROUTINE bdyvol  *** 
    4443      !! 
    45       !! ** Purpose :   This routine is called in dynspg_flt to control  
    46       !!      the volume of the system. A correction velocity is calculated 
    47       !!      to correct the total transport through the unstructured OBC.  
     44      !! ** Purpose :   This routine controls the volume of the system.  
     45      !!      A correction velocity is calculated to correct the total transport  
     46      !!      through the unstructured OBC.  
    4847      !!      The total depth used is constant (H0) to be consistent with the  
    49       !!      linear free surface coded in OPA 8.2 
     48      !!      linear free surface coded in OPA 8.2    <<<=== !!gm  ???? true ???? 
    5049      !! 
    5150      !! ** Method  :   The correction velocity (zubtpecor here) is defined calculating 
     
    7170      !!            (set nn_volctl to 1 in tne namelist for this option) 
    7271      !!---------------------------------------------------------------------- 
    73       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    74       !! 
     72      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     73      ! 
    7574      INTEGER  ::   ji, jj, jk, jb, jgrd 
    7675      INTEGER  ::   ib_bdy, ii, ij 
     
    7877      TYPE(OBC_INDEX), POINTER :: idx 
    7978      !!----------------------------------------------------------------------------- 
    80  
    81       IF( nn_timing == 1 ) CALL timing_start('bdy_vol') 
    82  
     79      ! 
     80      IF( nn_timing == 1 )   CALL timing_start('bdy_vol') 
     81      ! 
    8382      IF( ln_vol ) THEN 
    84  
     83      ! 
    8584      IF( kt == nit000 ) THEN  
    8685         IF(lwp) WRITE(numout,*) 
     
    9190      ! Calculate the cumulate surface Flux z_cflxemp (m3/s) over all the domain 
    9291      ! ----------------------------------------------------------------------- 
    93       z_cflxemp = SUM ( ( emp(:,:)-rnf(:,:)+rdivisf*fwfisf(:,:) ) * bdytmask(:,:) * e1t(:,:) * e2t(:,:) ) / rau0 
     92!!gm replace these lines : 
     93      z_cflxemp = SUM ( ( emp(:,:) - rnf(:,:) + fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:) ) / rau0 
    9494      IF( lk_mpp )   CALL mpp_sum( z_cflxemp )     ! sum over the global domain 
     95!!gm   by : 
     96!!gm      z_cflxemp = glob_sum(  ( emp(:,:)-rnf(:,:)+fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:)  ) / rau0 
     97!!gm 
    9598 
    9699      ! Transport through the unstructured open boundary 
    97100      ! ------------------------------------------------ 
    98       zubtpecor = 0.e0 
     101      zubtpecor = 0._wp 
    99102      DO ib_bdy = 1, nb_bdy 
    100103         idx => idx_bdy(ib_bdy) 
    101  
     104         ! 
    102105         jgrd = 2                               ! cumulate u component contribution first  
    103106         DO jb = 1, idx%nblenrim(jgrd) 
     
    105108               ii = idx%nbi(jb,jgrd) 
    106109               ij = idx%nbj(jb,jgrd) 
    107                zubtpecor = zubtpecor + idx%flagu(jb,jgrd) * ua(ii,ij, jk) * e2u(ii,ij) * fse3u(ii,ij,jk) 
     110               zubtpecor = zubtpecor + idx%flagu(jb,jgrd) * ua(ii,ij, jk) * e2u(ii,ij) * e3u_n(ii,ij,jk) 
    108111            END DO 
    109112         END DO 
     
    113116               ii = idx%nbi(jb,jgrd) 
    114117               ij = idx%nbj(jb,jgrd) 
    115                zubtpecor = zubtpecor + idx%flagv(jb,jgrd) * va(ii,ij, jk) * e1v(ii,ij) * fse3v(ii,ij,jk)  
     118               zubtpecor = zubtpecor + idx%flagv(jb,jgrd) * va(ii,ij, jk) * e1v(ii,ij) * e3v_n(ii,ij,jk)  
    116119            END DO 
    117120         END DO 
    118  
     121         ! 
    119122      END DO 
    120123      IF( lk_mpp )   CALL mpp_sum( zubtpecor )   ! sum over the global domain 
     
    122125      ! The normal velocity correction 
    123126      ! ------------------------------ 
    124       IF( nn_volctl==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp) / bdysurftot  
    125       ELSE                   ;   zubtpecor =   zubtpecor             / bdysurftot 
     127      IF( nn_volctl==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp ) / bdysurftot  
     128      ELSE                      ;   zubtpecor =   zubtpecor               / bdysurftot 
    126129      END IF 
    127130 
    128131      ! Correction of the total velocity on the unstructured boundary to respect the mass flux conservation 
    129132      ! ------------------------------------------------------------- 
    130       ztranst = 0.e0 
     133      ztranst = 0._wp 
    131134      DO ib_bdy = 1, nb_bdy 
    132135         idx => idx_bdy(ib_bdy) 
    133  
     136         ! 
    134137         jgrd = 2                               ! correct u component 
    135138         DO jb = 1, idx%nblenrim(jgrd) 
     
    138141               ij = idx%nbj(jb,jgrd) 
    139142               ua(ii,ij,jk) = ua(ii,ij,jk) - idx%flagu(jb,jgrd) * zubtpecor * umask(ii,ij,jk) 
    140                ztranst = ztranst + idx%flagu(jb,jgrd) * ua(ii,ij,jk) * e2u(ii,ij) * fse3u(ii,ij,jk) 
     143               ztranst = ztranst + idx%flagu(jb,jgrd) * ua(ii,ij,jk) * e2u(ii,ij) * e3u_n(ii,ij,jk) 
    141144            END DO 
    142145         END DO 
     
    147150               ij = idx%nbj(jb,jgrd) 
    148151               va(ii,ij,jk) = va(ii,ij,jk) -idx%flagv(jb,jgrd) * zubtpecor * vmask(ii,ij,jk) 
    149                ztranst = ztranst + idx%flagv(jb,jgrd) * va(ii,ij,jk) * e1v(ii,ij) * fse3v(ii,ij,jk) 
     152               ztranst = ztranst + idx%flagv(jb,jgrd) * va(ii,ij,jk) * e1v(ii,ij) * e3v_n(ii,ij,jk) 
    150153            END DO 
    151154         END DO 
    152  
     155         ! 
    153156      END DO 
    154157      IF( lk_mpp )   CALL mpp_sum( ztranst )   ! sum over the global domain 
     
    156159      ! Check the cumulated transport through unstructured OBC once barotropic velocities corrected 
    157160      ! ------------------------------------------------------ 
    158       IF( lwp .AND. MOD( kt, nwrite ) == 0) THEN 
     161      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
    159162         IF(lwp) WRITE(numout,*) 
    160163         IF(lwp) WRITE(numout,*)'bdy_vol : time step :', kt 
     
    166169      END IF  
    167170      ! 
    168       IF( nn_timing == 1 ) CALL timing_stop('bdy_vol') 
     171      IF( nn_timing == 1 )   CALL timing_stop('bdy_vol') 
    169172      ! 
    170173      END IF ! ln_vol 
    171  
     174      ! 
    172175   END SUBROUTINE bdy_vol 
    173176 
Note: See TracChangeset for help on using the changeset viewer.