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 120 for trunk/NEMO/OPA_SRC/SOL/solsor.F90 – NEMO

Ignore:
Timestamp:
2004-06-29T17:39:08+02:00 (20 years ago)
Author:
opalod
Message:

CT : UPDATE070 : Optimisation of the Red-Black SOR algorithm convergence

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/SOL/solsor.F90

    r111 r120  
    117117         END DO 
    118118 
    119          CALL lbc_lnk( gcx, c_solver_pt, 1. )   ! applied the lateral boubary conditions 
    120  
    121119         ! test of convergence 
    122120         IF ( jn > nmin .AND. MOD( jn-nmin, nmod ) == 0 ) then 
    123121 
    124122            SELECT CASE ( nsol_arp ) 
     123            CASE ( 0 )                 ! absolute precision (maximum value of the residual) 
     124               zres2 = MAXVAL( gcr(2:jpim1,2:jpjm1) ) 
     125               IF( lk_mpp )   CALL mpp_max( zres2 )   ! max over the global domain 
     126               ! test of convergence 
     127               IF( zres2 < resmax .OR. jn == nmax ) THEN 
     128                  res = SQRT( zres2 ) 
     129                  niter = jn 
     130                  ncut = 999 
     131               ENDIF 
    125132            CASE ( 1 )                 ! relative precision 
    126133               rnorme = SUM( gcr(2:jpim1,2:jpjm1) ) 
     
    132139                  ncut = 999 
    133140               ENDIF 
    134             CASE ( 0 )                 ! absolute precision (maximum value of the residual) 
    135                zres2 = MAXVAL( gcr(2:jpim1,2:jpjm1) ) 
    136                IF( lk_mpp )   CALL mpp_max( zres2 )   ! max over the global domain 
    137                ! test of convergence 
    138                IF( zres2 < resmax .OR. jn == nmax ) THEN 
    139                   res = SQRT( zres2 ) 
    140                   niter = jn 
    141                   ncut = 999 
    142                ENDIF 
    143             END CASE 
     141            END SELECT 
    144142          
    145143         !**** 
     
    162160      !  Output in gcx 
    163161      !  ------------- 
    164        
    165       CALL lbc_lnk( gcx, c_solver_pt, 1. )    ! boundary conditions (est-ce necessaire? je ne crois pas!!!!) 
     162 
     163      CALL lbc_lnk( gcx, c_solver_pt, 1. )    ! boundary conditions 
     164 
    166165       
    167166   END SUBROUTINE sol_sor 
Note: See TracChangeset for help on using the changeset viewer.