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 5972 for branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90 – NEMO

Ignore:
Timestamp:
2015-12-02T09:52:20+01:00 (8 years ago)
Author:
timgraham
Message:

Upgraded to head of trunk (r5936)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO14.5_SST_BIAS_CORRECTION/NEMOGCM/NEMO/OPA_SRC/BDY/bdyvol.F90

    r5967 r5972  
    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 
    1816   USE oce             ! ocean dynamics and tracers  
    19    USE sbcisf          ! ice shelf 
     17   USE bdy_oce         ! ocean open boundary conditions 
     18   USE sbc_oce         ! ocean surface boundary conditions 
    2019   USE dom_oce         ! ocean space and time domain  
    2120   USE phycst          ! physical constants 
    22    USE bdy_oce         ! ocean open boundary conditions 
     21   USE sbcisf          ! ice shelf 
     22   ! 
     23   USE in_out_manager  ! I/O manager 
    2324   USE lib_mpp         ! for mppsum 
    24    USE in_out_manager  ! I/O manager 
    25    USE sbc_oce         ! ocean surface boundary conditions 
     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       
    3132 
    3233   !! * Substitutions 
    3334#  include "domzgr_substitute.h90" 
    3435   !!---------------------------------------------------------------------- 
    35    !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     36   !! NEMO/OPA 3.6 , NEMO Consortium (2014) 
    3637   !! $Id$ 
    3738   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     
    4344      !!                      ***  ROUTINE bdyvol  *** 
    4445      !! 
    45       !! ** Purpose :   This routine is called in dynspg_flt to control  
    46       !!      the volume of the system. A correction velocity is calculated 
     46      !! ** Purpose :   This routine controls the volume of the system.  
     47      !!      A correction velocity is calculated 
    4748      !!      to correct the total transport through the unstructured OBC.  
    4849      !!      The total depth used is constant (H0) to be consistent with the  
     
    7879      TYPE(OBC_INDEX), POINTER :: idx 
    7980      !!----------------------------------------------------------------------------- 
    80  
    81       IF( nn_timing == 1 ) CALL timing_start('bdy_vol') 
    82  
     81      ! 
     82      IF( nn_timing == 1 )   CALL timing_start('bdy_vol') 
     83      ! 
    8384      IF( ln_vol ) THEN 
    84  
     85      ! 
    8586      IF( kt == nit000 ) THEN  
    8687         IF(lwp) WRITE(numout,*) 
     
    9192      ! Calculate the cumulate surface Flux z_cflxemp (m3/s) over all the domain 
    9293      ! ----------------------------------------------------------------------- 
    93       z_cflxemp = SUM ( ( emp(:,:)-rnf(:,:)+rdivisf*fwfisf(:,:) ) * bdytmask(:,:) * e1t(:,:) * e2t(:,:) ) / rau0 
     94!!gm replace these lines : 
     95      z_cflxemp = SUM ( ( emp(:,:)-rnf(:,:)+fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:) ) / rau0 
    9496      IF( lk_mpp )   CALL mpp_sum( z_cflxemp )     ! sum over the global domain 
     97!!gm   by : 
     98!!gm      z_cflxemp = glob_sum(  ( emp(:,:)-rnf(:,:)+fwfisf(:,:) ) * bdytmask(:,:) * e1e2t(:,:)  ) / rau0 
     99!!gm 
    95100 
    96101      ! Transport through the unstructured open boundary 
    97102      ! ------------------------------------------------ 
    98       zubtpecor = 0.e0 
     103      zubtpecor = 0._wp 
    99104      DO ib_bdy = 1, nb_bdy 
    100105         idx => idx_bdy(ib_bdy) 
    101  
     106         ! 
    102107         jgrd = 2                               ! cumulate u component contribution first  
    103108         DO jb = 1, idx%nblenrim(jgrd) 
     
    116121            END DO 
    117122         END DO 
    118  
     123         ! 
    119124      END DO 
    120125      IF( lk_mpp )   CALL mpp_sum( zubtpecor )   ! sum over the global domain 
     
    123128      ! ------------------------------ 
    124129      IF( nn_volctl==1 ) THEN   ;   zubtpecor = ( zubtpecor - z_cflxemp) / bdysurftot  
    125       ELSE                   ;   zubtpecor =   zubtpecor             / bdysurftot 
     130      ELSE                      ;   zubtpecor =   zubtpecor             / bdysurftot 
    126131      END IF 
    127132 
    128133      ! Correction of the total velocity on the unstructured boundary to respect the mass flux conservation 
    129134      ! ------------------------------------------------------------- 
    130       ztranst = 0.e0 
     135      ztranst = 0._wp 
    131136      DO ib_bdy = 1, nb_bdy 
    132137         idx => idx_bdy(ib_bdy) 
    133  
     138         ! 
    134139         jgrd = 2                               ! correct u component 
    135140         DO jb = 1, idx%nblenrim(jgrd) 
     
    150155            END DO 
    151156         END DO 
    152  
     157         ! 
    153158      END DO 
    154159      IF( lk_mpp )   CALL mpp_sum( ztranst )   ! sum over the global domain 
     
    169174      ! 
    170175      END IF ! ln_vol 
    171  
     176      ! 
    172177   END SUBROUTINE bdy_vol 
    173178 
Note: See TracChangeset for help on using the changeset viewer.