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 784 for trunk/NEMO – NEMO

Changeset 784 for trunk/NEMO


Ignore:
Timestamp:
2008-01-08T12:05:25+01:00 (16 years ago)
Author:
rblod
Message:

merge solsor and solsor_e, see ticket #45

Location:
trunk/NEMO/OPA_SRC
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90

    r746 r784  
    3333   USE solsor          ! Successive Over-relaxation solver 
    3434   USE solfet          ! FETI solver 
    35    USE solsor_e        ! Successive Over-relaxation solver with MPP optimization 
    3635   USE obc_oce         ! Lateral open boundary condition 
    3736   USE obcdyn          ! ocean open boundary condition (obc_dyn routines) 
     
    316315      END DO 
    317316      ! applied the lateral boundary conditions 
    318       IF( nsolv == 4 )  CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
     317      IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
    319318 
    320319#if defined key_agrif 
     
    361360         ELSEIF( nsolv == 3 ) THEN     ! FETI solver 
    362361            CALL sol_fet( kindic ) 
    363          ELSEIF( nsolv == 4 ) THEN     ! successive-over-relaxation with extra outer halo 
    364             CALL sol_sor_e( kindic ) 
    365362         ELSE                          ! e r r o r in nsolv namelist parameter 
    366363            WRITE(ctmp1,*) ' ~~~~~~~~~~~                not = ', nsolv 
    367             CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1, 2 ,3 or 4', ctmp1 ) 
     364            CALL ctl_stop( ' dyn_spg_flt : e r r o r, nsolv = 1, 2 or 3', ctmp1 ) 
    368365         ENDIF 
    369366      ENDIF 
  • trunk/NEMO/OPA_SRC/DYN/dynspg_flt_jki.F90

    r719 r784  
    2323   USE solsor          ! Successive Over-relaxation solver 
    2424   USE solfet          ! FETI solver 
    25    USE solsor_e        ! Successive Over-relaxation solver with MPP optimization 
    2625   USE solver 
    2726   USE obc_oce         ! Lateral open boundary condition 
     
    232231      END DO 
    233232      ! applied the lateral boundary conditions 
    234       IF( nsolv == 4)  CALL lbc_lnk_e( gcb, c_solver_pt, 1. )   
     233      IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. )   
    235234 
    236235#if defined key_agrif 
     
    285284         ELSEIF( nsolv == 3 ) THEN     ! FETI solver 
    286285            CALL sol_fet( kindic ) 
    287          ELSEIF( nsolv == 4 ) THEN     ! successive-over-relaxation with extra outer halo 
    288             CALL sol_sor_e( kindic ) 
    289286         ELSE                          ! e r r o r in nsolv namelist parameter 
    290287            WRITE(ctmp1,*) ' ~~~~~~~~~~~~~~~~                not = ', nsolv 
    291             CALL ctl_stop( ' dyn_spg_flt_jki : e r r o r, nsolv = 1, 2, 3 or 4', ctmp1 ) 
     288            CALL ctl_stop( ' dyn_spg_flt_jki : e r r o r, nsolv = 1, 2 or 3', ctmp1 ) 
    292289         ENDIF 
    293290      ENDIF 
  • trunk/NEMO/OPA_SRC/DYN/dynspg_rl.F90

    r746 r784  
    3636   USE solsor          ! Successive Over-relaxation solver 
    3737   USE solfet          ! FETI solver 
    38    USE solsor_e        ! Successive Over-relaxation solver with MPP optimization 
    3938   USE solisl          ! ??? 
    4039   USE obc_oce         ! Lateral open boundary condition 
     
    177176      END DO 
    178177      ! applied the lateral boundary conditions 
    179       IF( nsolv == 4)  CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
     178      IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0 ) CALL lbc_lnk_e( gcb, c_solver_pt, 1. )    
    180179 
    181180      ! Relative precision (computation on one processor) 
     
    204203         CASE( 3 )                     ! FETI solver 
    205204            CALL sol_fet( kindic ) 
    206          CASE( 4 )                     ! successive-over-relaxation with extra outer halo 
    207             CALL sol_sor_e( kindic ) 
    208205         CASE DEFAULT                  ! e r r o r in nsolv namelist parameter 
    209206            WRITE(ctmp1,*) ' ~~~~~~~~~~                not = ', nsolv 
    210             CALL ctl_stop( ' dyn_spg_rl : e r r o r, nsolv = 1, 2 ,3 or 4', ctmp1 ) 
     207            CALL ctl_stop( ' dyn_spg_rl : e r r o r, nsolv = 1, 2 or 3', ctmp1 ) 
    211208         END SELECT 
    212209      ENDIF 
  • trunk/NEMO/OPA_SRC/SOL/sol_oce.F90

    r719 r784  
    2424   !! ---------------------------------- 
    2525   INTEGER , PUBLIC ::      & !!: namsol   elliptic solver / island / free surface 
    26       nsolv    =    1 ,     &  !: = 1/2/3/4 type of elliptic solver 
     26      nsolv    =    1 ,     &  !: = 1/2/3 type of elliptic solver 
    2727      nsol_arp =    0 ,     &  !: = 0/1 absolute/relative precision convergence test 
    2828      nmin     =  300 ,     &  !: minimum of iterations for the SOR solver 
  • trunk/NEMO/OPA_SRC/SOL/solmat.F90

    r719 r784  
    291291         gcp(:,:,3) = gcp(:,:,3) * gcdprc(:,:) 
    292292         gcp(:,:,4) = gcp(:,:,4) * gcdprc(:,:) 
    293          IF( ( nsolv == 2 ) .OR. ( nsolv == 4 ) )  gccd(:,:) = sor * gcp(:,:,2) 
    294  
    295          IF( nsolv == 4 ) THEN 
     293         IF( nsolv == 2 )  gccd(:,:) = sor * gcp(:,:,2) 
     294 
     295         IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0) THEN 
    296296            CALL lbc_lnk_e( gcp   (:,:,1), c_solver_pt, 1. )   ! lateral boundary conditions 
    297297            CALL lbc_lnk_e( gcp   (:,:,2), c_solver_pt, 1. )   ! lateral boundary conditions 
  • trunk/NEMO/OPA_SRC/SOL/solsor.F90

    r719 r784  
    4343      !!     as well as islands) while in the latter the boundary condition 
    4444      !!     specification is not required. 
    45       !! 
     45      !!       This routine provides a MPI optimization to the existing solsor 
     46      !!     by reducing the number of call to lbc. 
     47      !!  
    4648      !! ** Method  :   Successive-over-relaxation method using the red-black  
    4749      !!      technique. The former technique used was not compatible with  
    4850      !!      the north-fold boundary condition used in orca configurations. 
    49       !! 
     51      !!      Compared to the classical sol_sor, this routine provides a  
     52      !!      mpp optimization by reducing the number of calls to lnc_lnk 
     53      !!      The solution is computed on a larger area and the boudary 
     54      !!      conditions only when the inside domain is reached. 
     55      !!  
    5056      !! References : 
    5157      !!      Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 
     58      !!      Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 
    5259      !! 
    5360      !! History : 
     
    5865      !!        !  96-11  (A. Weaver)  correction to preconditioning 
    5966      !!   9.0  !  03-04  (C. Deltel, G. Madec)  Red-Black SOR in free form 
     67      !!   9.0  !  05-09  (R. Benshila, G. Madec)  MPI optimization 
    6068      !!---------------------------------------------------------------------- 
    6169      !! * Arguments 
     
    6674      !! * Local declarations 
    6775      INTEGER  ::   ji, jj, jn               ! dummy loop indices 
    68       INTEGER  ::   ishift 
     76      INTEGER  ::   ishift, icount 
    6977      REAL(wp) ::   ztmp, zres, zres2 
    7078 
    7179      INTEGER  ::   ijmppodd, ijmppeven 
     80      INTEGER  ::   ijpr2d 
    7281      !!---------------------------------------------------------------------- 
    7382       
    74       ijmppeven = MOD(nimpp+njmpp  ,2) 
    75       ijmppodd  = MOD(nimpp+njmpp+1,2) 
     83      ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj,2) 
     84      ijmppodd  = MOD(nimpp+njmpp+jpr2di+jpr2dj+1,2) 
     85      ijpr2d = MAX(jpr2di,jpr2dj) 
     86      icount = 0 
    7687      !                                                       ! ============== 
    7788      DO jn = 1, nmax                                         ! Iterative loop  
    7889         !                                                    ! ============== 
    7990 
    80          CALL lbc_lnk( gcx, c_solver_pt, 1. )   ! applied the lateral boundary conditions 
    81           
     91         ! applied the lateral boundary conditions 
     92         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. )    
     93         
    8294         ! Residus 
    8395         ! ------- 
    8496 
    8597         ! Guess black update 
    86          DO jj = 2, jpjm1 
    87             ishift = MOD( jj-ijmppodd, 2 ) 
    88             DO ji = 2+ishift, jpim1, 2 
     98         DO jj = 2-jpr2dj, nlcj-1+jpr2dj 
     99            ishift = MOD( jj-ijmppodd-jpr2dj, 2 ) 
     100            DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 
    89101               ztmp =                  gcb(ji  ,jj  )   & 
    90102                  &   - gcp(ji,jj,1) * gcx(ji  ,jj-1)   & 
     
    99111            END DO 
    100112         END DO 
    101  
    102          CALL lbc_lnk( gcx, c_solver_pt, 1. )   ! applied the lateral boubary conditions 
     113         icount = icount + 1  
     114  
     115         ! applied the lateral boundary conditions 
     116         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx, c_solver_pt, 1. )   
    103117 
    104118         ! Guess red update 
    105          DO jj = 2, jpjm1 
    106             ishift = MOD( jj-ijmppeven, 2 ) 
    107             DO ji = 2+ishift, jpim1, 2 
     119         DO jj = 2-jpr2dj, nlcj-1+jpr2dj 
     120            ishift = MOD( jj-ijmppeven-jpr2dj, 2 ) 
     121            DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 
    108122               ztmp =                  gcb(ji  ,jj  )   & 
    109123                  &   - gcp(ji,jj,1) * gcx(ji  ,jj-1)   & 
     
    118132            END DO 
    119133         END DO 
     134         icount = icount + 1 
    120135 
    121136         ! test of convergence 
     
    124139            SELECT CASE ( nsol_arp ) 
    125140            CASE ( 0 )                 ! absolute precision (maximum value of the residual) 
    126                zres2 = MAXVAL( gcr(2:jpim1,2:jpjm1) ) 
     141               zres2 = MAXVAL( gcr(2:nlci-1,2:nlcj-1) ) 
    127142               IF( lk_mpp )   CALL mpp_max( zres2 )   ! max over the global domain 
    128143               ! test of convergence 
     
    133148               ENDIF 
    134149            CASE ( 1 )                 ! relative precision 
    135                rnorme = SUM( gcr(2:jpim1,2:jpjm1) ) 
     150               rnorme = SUM( gcr(2:nlci-1,2:nlcj-1) ) 
    136151               IF( lk_mpp )   CALL mpp_sum( rnorme )   ! sum over the global domain 
    137152               ! test of convergence 
     
    163178      !  ------------- 
    164179 
    165       CALL lbc_lnk( gcx, c_solver_pt, 1. )    ! boundary conditions 
     180      CALL lbc_lnk_e( gcx, c_solver_pt, 1. )    ! boundary conditions 
    166181 
    167182       
  • trunk/NEMO/OPA_SRC/SOL/solver.F90

    r719 r784  
    152152 
    153153      CASE ( 2 )                ! successive-over-relaxation solver 
    154          IF(lwp) WRITE(numout,*) '          a successive-over-relaxation solver is used' 
    155          IF( jpr2di /= 0 .AND. jpr2dj /= 0 ) & 
    156              CALL ctl_stop( ' jpr2di and jpr2dj should be equal to zero' ) 
     154         IF(lwp) WRITE(numout,*) '          a successive-over-relaxation solver with extra outer halo is used' 
     155         IF(lwp) WRITE(numout,*) '          with jpr2di =', jpr2di, ' and  jpr2dj =', jpr2dj 
     156         IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN 
     157             CALL ctl_stop( ' jpr2di and jpr2dj are not equal to zero',   & 
     158             &              ' In this case this algorithm should be used only with the key_mpp_... option' ) 
     159         ELSE 
     160            IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) & 
     161              &  .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( '          jpr2di should be equal to jpr2dj' ) 
     162         ENDIF 
    157163 
    158164      CASE ( 3 )                ! FETI solver 
     
    169175         ENDIF 
    170176          
    171       CASE ( 4 )                ! successive-over-relaxation solver with extra outer halo 
    172          IF(lwp) WRITE(numout,*) '          a successive-over-relaxation solver with extra outer halo is used' 
    173          IF(lwp) WRITE(numout,*) '          with jpr2di =', jpr2di, ' and  jpr2dj =', jpr2dj 
    174          IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN 
    175              CALL ctl_stop( ' jpr2di and jpr2dj are not equal to zero',   & 
    176              &              ' In this case this algorithm should be used only with the key_mpp_... option' ) 
    177          ELSE 
    178             IF( ( ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 ) .OR. ( jpni /= 1 ) ) & 
    179               &  .AND. ( jpr2di /= jpr2dj ) ) CALL ctl_stop( '          jpr2di should be equal to jpr2dj' ) 
    180          ENDIF 
    181  
    182177      CASE DEFAULT 
    183178         WRITE(ctmp1,*) '          bad flag value for nsolv = ', nsolv 
     
    186181      END SELECT 
    187182 
    188       IF( nbit_cmp == 1 .AND. nsolv /= 2 ) THEN 
    189          CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nsolv = 2' ) 
     183      IF( nbit_cmp == 1 ) THEN 
     184         IF( nsolv /= 2 ) THEN 
     185            CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require the SOR solver: nsolv = 2' ) 
     186         ELSE IF( MAX( jpr2di, jpr2dj ) > 0 ) THEN 
     187            CALL ctl_stop( ' Reproductibility tests (nbit_cmp=1) require jpr2di = jpr2dj = 0' ) 
     188         END IF  
    190189      END IF 
    191190 
Note: See TracChangeset for help on using the changeset viewer.