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 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SOL/solpcg.F90

    • Property svn:eol-style deleted
    r1601 r2528  
    1414   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    1515   USE in_out_manager  ! I/O manager 
     16   USE lib_fortran 
    1617 
    1718   IMPLICIT NONE 
     
    2324#  include "vectopt_loop_substitute.h90" 
    2425   !!---------------------------------------------------------------------- 
    25    !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
     26   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    2627   !! $Id$  
    27    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
     28   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
    2829   !!---------------------------------------------------------------------- 
    2930CONTAINS 
     
    9596      ! Initialization of the algorithm with standard PCG 
    9697      ! ------------------------------------------------- 
     98      zgcr = 0.e0  
     99      gcr  = 0.e0  
    97100 
    98101      CALL lbc_lnk( gcx, c_solver_pt, 1. )   ! lateral boundary condition 
     
    100103      ! gcr   = gcb-a.gcx 
    101104      ! gcdes = gcr 
    102  
    103105      DO jj = 2, jpjm1 
    104106         DO ji = fs_2, fs_jpim1   ! vector opt. 
     
    114116 
    115117      ! rnorme = (gcr,gcr) 
    116       rnorme = SUM(  gcr(:,:) * gcdmat(:,:) * gcr(:,:)  ) 
    117       IF( lk_mpp )   CALL mpp_sum( rnorme )   ! sum over the global domain 
     118      rnorme = glob_sum(  gcr(:,:) * gcdmat(:,:) * gcr(:,:)  ) 
    118119 
    119120      CALL lbc_lnk( gcdes, c_solver_pt, 1. )   ! lateral boundary condition 
     
    129130 
    130131      ! alph = (gcr,gcr)/(gcdes,gccd) 
    131       radd = SUM(  gcdes(:,:) * gcdmat(:,:) * gccd(:,:)  ) 
    132       IF( lk_mpp )   CALL mpp_sum( radd )   ! sum over the global domain 
     132      radd = glob_sum(  gcdes(:,:) * gcdmat(:,:) * gccd(:,:)  ) 
    133133      alph = rnorme /radd 
    134134 
     
    162162         ! rnorme = (gcr,gcr) 
    163163         rr = rnorme 
    164          zsum(1) = SUM(  gcr(:,:) * gcdmat(:,:) * gcr(:,:)  ) 
    165164 
    166165         ! zgcad = (zgcr,gcr)  
    167          zsum(2) = SUM( gcr(2:jpim1,2:jpjm1) * gcdmat(2:jpim1,2:jpjm1) * zgcr(2:jpim1,2:jpjm1) ) 
    168  
    169          IF( lk_mpp )   CALL mpp_sum( zsum, 2 )   ! sum over the global domain 
     166         zsum(1) = glob_sum(gcr(:,:) * gcdmat(:,:) * gcr(:,:)) 
     167         zsum(2) = glob_sum(gcr(:,:) * gcdmat(:,:) * zgcr(:,:) * bmask(:,:)) 
     168 
     169         !!RB we should gather the 2 glob_sum 
    170170         rnorme = zsum(1)   
    171171         zgcad  = zsum(2) 
    172  
    173172         ! test of convergence 
    174173         IF( rnorme < epsr .OR. jn == nn_nmax ) THEN 
Note: See TracChangeset for help on using the changeset viewer.