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 – NEMO

Changeset 120 for trunk/NEMO/OPA_SRC/SOL


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

Location:
trunk/NEMO/OPA_SRC/SOL
Files:
3 edited

Legend:

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

    r111 r120  
    2323   INTEGER , PUBLIC ::      & !!: namsol   elliptic solver / island / free surface 
    2424      nsolv    =    1 ,     &  !: = 1/2/3 type of elliptic solver 
    25       nsol_arp =    1 ,     &  !: = 1/0  absolute/relative precision convergence test 
    26       nmin     =  300 ,     &  !: minimum of iterations for the solver 
    27       nmax     =  800 ,     &  !: maximum of iterations for the solver 
    28       nmod     =   10 ,     &  !: frequency of test for the solver 
     25      nsol_arp =    0 ,     &  !: = 0/1 absolute/relative precision convergence test 
     26      nmin     =  300 ,     &  !: minimum of iterations for the SOR solver 
     27      nmax     =  800 ,     &  !: maximum of iterations for the SOR solver 
     28      nmod     =   10 ,     &  !: frequency of test for the SOR solver 
    2929      nmisl    = 4000          !: maximum pcg iterations for island 
    3030      
    3131   REAL(wp), PUBLIC ::      & !!: namsol   elliptic solver / island / free surface 
    32       eps    = 1.e-6_wp ,   &  !: absolute precision of the solver 
    33       sor    = 1.92_wp  ,   &  !: optimal coefficient for sor solver 
    34       epsisl = 1.e-10_wp,   &  !: absolute precision on stream function solver 
    35       rnu    = 1.0_wp          !: strength of the additional force used in free surface 
     32      eps    =  1.e-6_wp ,  &  !: absolute precision of the solver 
     33      resmax = 1.e-14_wp ,  &  !: absolute precision for the SOR solver 
     34      sor    =   1.92_wp ,  &  !: optimal coefficient for the SOR solver 
     35      epsisl = 1.e-10_wp ,  &  !: absolute precision on stream function solver 
     36      rnu    =    1.0_wp       !: strength of the additional force used in free surface 
    3637 
    3738   CHARACTER(len=1), PUBLIC ::   &  !: 
    3839      c_solver_pt = 'T'        !: nature of grid-points T (S) for free surface case 
    39       !                        !                       F (G) for rigid-lid case 
     40      !                        !                        F (G) for rigid-lid case 
    4041 
    4142   INTEGER , PUBLIC ::   &  !: 
  • 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 
  • trunk/NEMO/OPA_SRC/SOL/solver.F90

    r111 r120  
    7979      INTEGER :: ji, jj   ! dummy loop indices 
    8080 
    81       NAMELIST/namsol/ nsolv, nsol_arp, nmin, nmax, nmod, eps, sor, epsisl, nmisl, rnu 
     81      NAMELIST/namsol/ nsolv, nsol_arp, nmin, nmax, nmod, eps, resmax, sor, epsisl, nmisl, rnu 
    8282      !!---------------------------------------------------------------------- 
    8383 
     
    111111      IF(lwp) THEN 
    112112         WRITE(numout,*) '             type of elliptic solver            nsolv    = ', nsolv 
    113          WRITE(numout,*) '             absolute/relative (1/0) precision  nsol_arp = ', nsol_arp 
     113         WRITE(numout,*) '             absolute/relative (0/1) precision  nsol_arp = ', nsol_arp 
    114114         WRITE(numout,*) '             minimum iterations for solver      nmin     = ', nmin 
    115115         WRITE(numout,*) '             maximum iterations for solver      nmax     = ', nmax 
    116116         WRITE(numout,*) '             frequency for test                 nmod     = ', nmod 
    117117         WRITE(numout,*) '             absolute precision of solver       eps      = ', eps 
     118         WRITE(numout,*) '             absolute precision for SOR solver  resmax   = ', resmax 
    118119         WRITE(numout,*) '             optimal coefficient of sor         sor      = ', sor 
    119120         IF(lk_isl) WRITE(numout,*) '             absolute precision stream fct    epsisl   = ', epsisl 
Note: See TracChangeset for help on using the changeset viewer.