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

Ignore:
Timestamp:
2009-08-11T12:09:19+02:00 (15 years ago)
Author:
ctlod
Message:

Doctor naming of OPA namelist variables , see ticket: #526

File:
1 edited

Legend:

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

    r1528 r1601  
    44   !! Ocean solver :  Successive Over-Relaxation solver 
    55   !!===================================================================== 
     6   !! History :  OPA  ! 1990-10  (G. Madec)  Original code 
     7   !!            7.1  ! 1993-04  (G. Madec)  time filter 
     8   !!                 ! 1996-05  (G. Madec)  merge sor and pcg formulations 
     9   !!                 ! 1996-11  (A. Weaver)  correction to preconditioning 
     10   !!   NEMO     1.0  ! 2003-04  (C. Deltel, G. Madec)  Red-Black SOR in free form 
     11   !!            2.0  ! 2005-09  (R. Benshila, G. Madec)  MPI optimization 
     12   !!---------------------------------------------------------------------- 
    613 
    714   !!---------------------------------------------------------------------- 
    815   !!   sol_sor     : Red-Black Successive Over-Relaxation solver 
    916   !!---------------------------------------------------------------------- 
    10    !! * Modules used 
    1117   USE oce             ! ocean dynamics and tracers variables 
    1218   USE dom_oce         ! ocean space and time domain variables  
     
    2026   PRIVATE 
    2127 
    22    !! * Routine accessibility 
    23    PUBLIC sol_sor              ! ??? 
     28   PUBLIC   sol_sor    !  
    2429 
    2530   !!---------------------------------------------------------------------- 
    26    !!   OPA 9.0 , LOCEAN-IPSL (2005)  
     31   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)  
    2732   !! $Id$  
    28    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     33   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    2934   !!---------------------------------------------------------------------- 
    3035 
     
    4954      !!      conditions only when the inside domain is reached. 
    5055      !!  
    51       !! References : 
    52       !!      Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 
    53       !!      Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 
     56      !! References :   Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 
     57      !!                Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 
     58      !!---------------------------------------------------------------------- 
     59      INTEGER, INTENT(inout) ::   kindic   ! solver indicator, < 0 if the convergence is not reached: 
     60      !                                    ! the model is stopped in step (set to zero before the call of solsor) 
    5461      !! 
    55       !! History : 
    56       !!        !  90-10  (G. Madec)  Original code 
    57       !!        !  91-11  (G. Madec) 
    58       !!   7.1  !  93-04  (G. Madec)  time filter 
    59       !!        !  96-05  (G. Madec)  merge sor and pcg formulations 
    60       !!        !  96-11  (A. Weaver)  correction to preconditioning 
    61       !!   9.0  !  03-04  (C. Deltel, G. Madec)  Red-Black SOR in free form 
    62       !!   9.0  !  05-09  (R. Benshila, G. Madec)  MPI optimization 
    63       !!---------------------------------------------------------------------- 
    64       !! * Arguments 
    65       INTEGER, INTENT( inout ) ::   kindic   ! solver indicator, < 0 if the conver- 
    66       !                                      ! gence is not reached: the model is 
    67       !                                      ! stopped in step 
    68       !                                      ! set to zero before the call of solsor 
    69       !! * Local declarations 
    7062      INTEGER  ::   ji, jj, jn               ! dummy loop indices 
    7163      INTEGER  ::   ishift, icount 
     64      INTEGER  ::   ijmppodd, ijmppeven, ijpr2d 
    7265      REAL(wp) ::   ztmp, zres, zres2 
    73  
    74       INTEGER  ::   ijmppodd, ijmppeven 
    75       INTEGER  ::   ijpr2d 
    7666      !!---------------------------------------------------------------------- 
    7767       
    78       ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj,2) 
    79       ijmppodd  = MOD(nimpp+njmpp+jpr2di+jpr2dj+1,2) 
    80       ijpr2d = MAX(jpr2di,jpr2dj) 
     68      ijmppeven = MOD( nimpp+njmpp+jpr2di+jpr2dj   , 2 ) 
     69      ijmppodd  = MOD( nimpp+njmpp+jpr2di+jpr2dj+1 , 2 ) 
     70      ijpr2d    = MAX( jpr2di , jpr2dj ) 
    8171      icount = 0 
    8272      !                                                       ! ============== 
    83       DO jn = 1, nmax                                         ! Iterative loop  
     73      DO jn = 1, nn_nmax                                      ! Iterative loop  
    8474         !                                                    ! ============== 
    8575 
    86          ! applied the lateral boundary conditions 
    87          IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. )    
     76         IF( MOD(icount,ijpr2d+1) == 0 )   CALL lbc_lnk_e( gcx, c_solver_pt, 1. )   ! lateral boundary conditions 
    8877         
    8978         ! Residus 
     
    10392               gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 
    10493               ! Guess update 
    105                gcx(ji,jj) = sor * ztmp + (1-sor) * gcx(ji,jj) 
     94               gcx(ji,jj) = rn_sor * ztmp + (1-rn_sor) * gcx(ji,jj) 
    10695            END DO 
    10796         END DO 
    10897         icount = icount + 1  
    10998  
    110          ! applied the lateral boundary conditions 
    111          IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. )   
     99         IF( MOD(icount,ijpr2d+1) == 0 )   CALL lbc_lnk_e( gcx, c_solver_pt, 1. )   ! lateral boundary conditions 
    112100 
    113101         ! Guess red update 
     
    124112               gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 
    125113               ! Guess update 
    126                gcx(ji,jj) = sor * ztmp + (1-sor) * gcx(ji,jj) 
     114               gcx(ji,jj) = rn_sor * ztmp + (1-rn_sor) * gcx(ji,jj) 
    127115            END DO 
    128116         END DO 
     
    130118 
    131119         ! test of convergence 
    132          IF ( jn > nmin .AND. MOD( jn-nmin, nmod ) == 0 ) then 
     120         IF ( jn > nn_nmin .AND. MOD( jn-nn_nmin, nn_nmod ) == 0 ) THEN 
    133121 
    134             SELECT CASE ( nsol_arp ) 
     122            SELECT CASE ( nn_sol_arp ) 
    135123            CASE ( 0 )                 ! absolute precision (maximum value of the residual) 
    136124               zres2 = MAXVAL( gcr(2:nlci-1,2:nlcj-1) ) 
    137125               IF( lk_mpp )   CALL mpp_max( zres2 )   ! max over the global domain 
    138126               ! test of convergence 
    139                IF( zres2 < resmax .OR. jn == nmax ) THEN 
     127               IF( zres2 < rn_resmax .OR. jn == nn_nmax ) THEN 
    140128                  res = SQRT( zres2 ) 
    141129                  niter = jn 
     
    146134               IF( lk_mpp )   CALL mpp_sum( rnorme )   ! sum over the global domain 
    147135               ! test of convergence 
    148                IF( rnorme < epsr .OR. jn == nmax ) THEN 
     136               IF( rnorme < epsr .OR. jn == nn_nmax ) THEN 
    149137                  res = SQRT( rnorme ) 
    150138                  niter = jn 
     
    160148         ENDIF 
    161149         ! indicator of non-convergence or explosion 
    162          IF( jn == nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2 
     150         IF( jn == nn_nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2 
    163151         IF( ncut == 999 ) GOTO 999 
    164152          
     
    169157999   CONTINUE 
    170158       
    171        
    172159      !  Output in gcx 
    173160      !  ------------- 
    174  
    175161      CALL lbc_lnk_e( gcx, c_solver_pt, 1. )    ! boundary conditions 
    176  
    177        
     162      ! 
    178163   END SUBROUTINE sol_sor 
    179164 
Note: See TracChangeset for help on using the changeset viewer.