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 2007 for branches/DEV_r1879_FCM/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90 – NEMO

Ignore:
Timestamp:
2010-07-13T17:14:39+02:00 (14 years ago)
Author:
smasson
Message:

update branches/DEV_r1879_FCM/NEMOGCM/NEMO with tags/nemo_v3_2_1/NEMO

File:
1 edited

Legend:

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

    r1715 r2007  
    6565      INTEGER  ::   inum                  ! temporary logical unit 
    6666      INTEGER  ::   ikty, iyear           !  
    67       REAL(wp) ::   z_emp, z_emp_nsrf       ! temporary scalars 
     67      REAL(wp) ::   z_emp, z_emp_nsrf, zsum_emp, zsum_erp       ! temporary scalars 
    6868      REAL(wp) ::   zsurf_neg, zsurf_pos, zsurf_tospread 
    6969      REAL(wp), DIMENSION(jpi,jpj) ::   ztmsk_neg, ztmsk_pos, ztmsk_tospread 
     
    165165            ! 
    166166            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 ) 
    167169             
    168170            IF( z_emp < 0.e0 ) THEN 
     
    177179 
    178180            ! emp global mean over <0 or >0 erp area 
    179             z_emp_nsrf = SUM( e1e2_i(:,:) * z_emp ) / ( zsurf_tospread + rsmall ) 
     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 ) 
    180184            ! weight to respect erp field 2D structure  
    181             z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( SUM( ztmsk_tospread(:,:) * erp(:,:) * e1e2_i(:,:) ) + rsmall ) 
     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 
    182189            ! final correction term to apply 
    183190            zerp_cor(:,:) = -1. * z_emp_nsrf * zsurf_tospread * z_wgt(:,:) 
Note: See TracChangeset for help on using the changeset viewer.