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 1976 for branches/DEV_r1784_mid_year_merge_2010/NEMO/OPA_SRC/SBC/sbcfwb.F90 – NEMO

Ignore:
Timestamp:
2010-06-29T17:41:10+02:00 (14 years ago)
Author:
acc
Message:

ticket #684 step 6: Add in changes between the head of the DEV_r1879_mpp_rep branch and the trunk@1879.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1784_mid_year_merge_2010/NEMO/OPA_SRC/SBC/sbcfwb.F90

    r1970 r1976  
    2323   USE lib_mpp         ! distribued memory computing library 
    2424   USE lbclnk          ! ocean lateral boundary conditions 
     25   USE lib_fortran 
    2526 
    2627   IMPLICIT NONE 
     
    6566      INTEGER  ::   inum                  ! temporary logical unit 
    6667      INTEGER  ::   ikty, iyear           !  
    67       REAL(wp) ::   z_emp, z_emp_nsrf, zsum_emp, zsum_erp       ! temporary scalars 
     68      REAL(wp) ::   z_emp, z_emp_nsrf       ! temporary scalars 
    6869      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread 
    6970      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_pos, ztmsk_tospread 
     
    8788         ! 
    8889         e1e2_i(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:) 
    89          area = SUM( e1e2_i(:,:) ) 
    90          IF( lk_mpp )   CALL  mpp_sum( area    )   ! sum over the global domain 
     90         area = glob_sum( e1e2_i(:,:) )   ! sum over the global domain 
    9191         ! 
    9292      ENDIF 
     
    103103      CASE ( 1 )                               ! global mean emp set to zero 
    104104         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    105             z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
    106             IF( lk_mpp )   CALL  mpp_sum( z_emp    )   ! sum over the global domain 
     105            z_emp = glob_sum( e1e2_i(:,:) * emp(:,:) ) / area   ! sum over the global domain 
    107106            emp (:,:) = emp (:,:) - z_emp 
    108107            emps(:,:) = emps(:,:) - z_emp 
     
    128127         IF( MOD( kt, ikty ) == 0 ) THEN 
    129128            a_fwb_b = a_fwb 
    130             a_fwb   = SUM( e1e2_i(:,:) * sshn(:,:) ) 
    131             IF( lk_mpp )   CALL  mpp_sum( a_fwb    )   ! sum over the global domain 
     129            a_fwb   = glob_sum( e1e2_i(:,:) * sshn(:,:) )   ! sum over the global domain 
    132130            a_fwb   = a_fwb * 1.e+3 / ( area * 86400. * 365. )     ! convert in Kg/m3/s = mm/s 
    133131!!gm        !                                                      !!bug 365d year  
     
    162160         
    163161            ! emp global mean  
    164             z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area 
     162            z_emp = glob_sum( e1e2_i(:,:) * emp(:,:) ) / area 
    165163            ! 
    166             IF( lk_mpp )   CALL  mpp_sum( z_emp ) 
    167             IF( lk_mpp )   CALL  mpp_sum( zsurf_neg ) 
    168             IF( lk_mpp )   CALL  mpp_sum( zsurf_pos ) 
    169164             
    170165            IF( z_emp < 0.e0 ) THEN 
     
    179174 
    180175            ! emp global mean over <0 or >0 erp area 
    181             zsum_emp = SUM( e1e2_i(:,:) * z_emp ) 
    182             IF( lk_mpp )   CALL  mpp_sum( zsum_emp ) 
    183             z_emp_nsrf =  zsum_emp / ( zsurf_tospread + rsmall ) 
     176            z_emp_nsrf = SUM( e1e2_i(:,:) * z_emp ) / ( zsurf_tospread + rsmall ) 
    184177            ! weight to respect erp field 2D structure  
    185             zsum_erp = SUM( ztmsk_tospread(:,:) * erp(:,:) * e1e2_i(:,:) ) 
    186             IF( lk_mpp )   CALL  mpp_sum( zsum_erp ) 
    187             z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( zsum_erp + rsmall ) 
    188  
     178            z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( SUM( ztmsk_tospread(:,:) * erp(:,:) * e1e2_i(:,:) ) + rsmall ) 
    189179            ! final correction term to apply 
    190180            zerp_cor(:,:) = -1. * z_emp_nsrf * zsurf_tospread * z_wgt(:,:) 
Note: See TracChangeset for help on using the changeset viewer.