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 6225 for branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90 – NEMO

Ignore:
Timestamp:
2016-01-08T10:35:19+01:00 (8 years ago)
Author:
jamesharle
Message:

Update MPP_BDY_UPDATE branch to be consistent with head of trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90

    r4292 r6225  
    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 dom_oce         ! ocean space and time domain  
    20    USE phycst          ! physical constants 
    21    USE bdy_oce         ! ocean open boundary conditions 
    22    USE lib_mpp         ! for mppsum 
    23    USE in_out_manager  ! I/O manager 
    24    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 
    2527 
    2628   IMPLICIT NONE 
    2729   PRIVATE 
    2830 
    29    PUBLIC bdy_vol        ! routine called by dynspg_flt.h90 
     31   PUBLIC   bdy_vol    ! called by ??? 
    3032 
    31    !! * Substitutions 
    32 #  include "domzgr_substitute.h90" 
    3333   !!---------------------------------------------------------------------- 
    34    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     34   !! NEMO/OPA 3.7 , NEMO Consortium (2015) 
    3535   !! $Id$  
    3636   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    4242      !!                      ***  ROUTINE bdyvol  *** 
    4343      !! 
    44       !! ** Purpose :   This routine is called in dynspg_flt to control  
    45       !!      the volume of the system. A correction velocity is calculated 
    46       !!      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.  
    4747      !!      The total depth used is constant (H0) to be consistent with the  
    48       !!      linear free surface coded in OPA 8.2 
     48      !!      linear free surface coded in OPA 8.2    <<<=== !!gm  ???? true ???? 
    4949      !! 
    5050      !! ** Method  :   The correction velocity (zubtpecor here) is defined calculating 
     
    7070      !!            (set nn_volctl to 1 in tne namelist for this option) 
    7171      !!---------------------------------------------------------------------- 
    72       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index 
    73       !! 
     72      INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     73      ! 
    7474      INTEGER  ::   ji, jj, jk, jb, jgrd 
    7575      INTEGER  ::   ib_bdy, ii, ij 
     
    7777      TYPE(OBC_INDEX), POINTER :: idx 
    7878      !!----------------------------------------------------------------------------- 
    79  
    80       IF( nn_timing == 1 ) CALL timing_start('bdy_vol') 
    81  
     79      ! 
     80      IF( nn_timing == 1 )   CALL timing_start('bdy_vol') 
     81      ! 
    8282      IF( ln_vol ) THEN 
    83  
     83      ! 
    8484      IF( kt == nit000 ) THEN  
    8585         IF(lwp) WRITE(numout,*) 
     
    9090      ! Calculate the cumulate surface Flux z_cflxemp (m3/s) over all the domain 
    9191      ! ----------------------------------------------------------------------- 
    92       z_cflxemp = SUM ( ( emp(:,:)-rnf(:,:) ) * bdytmask(:,:) * e1t(:,:) * e2t(:,:) ) / rau0 
     92!!gm replace these lines : 
     93      z_cflxemp = SUM ( ( emp(:,:) - rnf(:,:) + fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:) ) / rau0 
    9394      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 
    9498 
    9599      ! Transport through the unstructured open boundary 
    96100      ! ------------------------------------------------ 
    97       zubtpecor = 0.e0 
     101      zubtpecor = 0._wp 
    98102      DO ib_bdy = 1, nb_bdy 
    99103         idx => idx_bdy(ib_bdy) 
    100  
     104         ! 
    101105         jgrd = 2                               ! cumulate u component contribution first  
    102106         DO jb = 1, idx%nblenrim(jgrd) 
     
    104108               ii = idx%nbi(jb,jgrd) 
    105109               ij = idx%nbj(jb,jgrd) 
    106                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) 
    107111            END DO 
    108112         END DO 
     
    112116               ii = idx%nbi(jb,jgrd) 
    113117               ij = idx%nbj(jb,jgrd) 
    114                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)  
    115119            END DO 
    116120         END DO 
    117  
     121         ! 
    118122      END DO 
    119123      IF( lk_mpp )   CALL mpp_sum( zubtpecor )   ! sum over the global domain 
     
    121125      ! The normal velocity correction 
    122126      ! ------------------------------ 
    123       IF( nn_volctl==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp) / bdysurftot  
    124       ELSE                   ;   zubtpecor =   zubtpecor             / bdysurftot 
     127      IF( nn_volctl==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp ) / bdysurftot  
     128      ELSE                      ;   zubtpecor =   zubtpecor               / bdysurftot 
    125129      END IF 
    126130 
    127131      ! Correction of the total velocity on the unstructured boundary to respect the mass flux conservation 
    128132      ! ------------------------------------------------------------- 
    129       ztranst = 0.e0 
     133      ztranst = 0._wp 
    130134      DO ib_bdy = 1, nb_bdy 
    131135         idx => idx_bdy(ib_bdy) 
    132  
     136         ! 
    133137         jgrd = 2                               ! correct u component 
    134138         DO jb = 1, idx%nblenrim(jgrd) 
     
    137141               ij = idx%nbj(jb,jgrd) 
    138142               ua(ii,ij,jk) = ua(ii,ij,jk) - idx%flagu(jb,jgrd) * zubtpecor * umask(ii,ij,jk) 
    139                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) 
    140144            END DO 
    141145         END DO 
     
    146150               ij = idx%nbj(jb,jgrd) 
    147151               va(ii,ij,jk) = va(ii,ij,jk) -idx%flagv(jb,jgrd) * zubtpecor * vmask(ii,ij,jk) 
    148                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) 
    149153            END DO 
    150154         END DO 
    151  
     155         ! 
    152156      END DO 
    153157      IF( lk_mpp )   CALL mpp_sum( ztranst )   ! sum over the global domain 
     
    155159      ! Check the cumulated transport through unstructured OBC once barotropic velocities corrected 
    156160      ! ------------------------------------------------------ 
    157       IF( lwp .AND. MOD( kt, nwrite ) == 0) THEN 
     161      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
    158162         IF(lwp) WRITE(numout,*) 
    159163         IF(lwp) WRITE(numout,*)'bdy_vol : time step :', kt 
     
    165169      END IF  
    166170      ! 
    167       IF( nn_timing == 1 ) CALL timing_stop('bdy_vol') 
     171      IF( nn_timing == 1 )   CALL timing_stop('bdy_vol') 
    168172      ! 
    169173      END IF ! ln_vol 
    170  
     174      ! 
    171175   END SUBROUTINE bdy_vol 
    172176 
Note: See TracChangeset for help on using the changeset viewer.