Changeset 784 for trunk/NEMO/OPA_SRC/SOL/solsor.F90
- Timestamp:
- 2008-01-08T12:05:25+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/SOL/solsor.F90
r719 r784 43 43 !! as well as islands) while in the latter the boundary condition 44 44 !! 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 !! 46 48 !! ** Method : Successive-over-relaxation method using the red-black 47 49 !! technique. The former technique used was not compatible with 48 50 !! 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 !! 50 56 !! References : 51 57 !! Madec et al. 1988, Ocean Modelling, issue 78, 1-6. 58 !! Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377 52 59 !! 53 60 !! History : … … 58 65 !! ! 96-11 (A. Weaver) correction to preconditioning 59 66 !! 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 60 68 !!---------------------------------------------------------------------- 61 69 !! * Arguments … … 66 74 !! * Local declarations 67 75 INTEGER :: ji, jj, jn ! dummy loop indices 68 INTEGER :: ishift 76 INTEGER :: ishift, icount 69 77 REAL(wp) :: ztmp, zres, zres2 70 78 71 79 INTEGER :: ijmppodd, ijmppeven 80 INTEGER :: ijpr2d 72 81 !!---------------------------------------------------------------------- 73 82 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 76 87 ! ! ============== 77 88 DO jn = 1, nmax ! Iterative loop 78 89 ! ! ============== 79 90 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 82 94 ! Residus 83 95 ! ------- 84 96 85 97 ! Guess black update 86 DO jj = 2 , jpjm187 ishift = MOD( jj-ijmppodd , 2 )88 DO ji = 2 +ishift, jpim1, 298 DO jj = 2-jpr2dj, nlcj-1+jpr2dj 99 ishift = MOD( jj-ijmppodd-jpr2dj, 2 ) 100 DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 89 101 ztmp = gcb(ji ,jj ) & 90 102 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & … … 99 111 END DO 100 112 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. ) 103 117 104 118 ! Guess red update 105 DO jj = 2 , jpjm1106 ishift = MOD( jj-ijmppeven , 2 )107 DO ji = 2 +ishift, jpim1, 2119 DO jj = 2-jpr2dj, nlcj-1+jpr2dj 120 ishift = MOD( jj-ijmppeven-jpr2dj, 2 ) 121 DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2 108 122 ztmp = gcb(ji ,jj ) & 109 123 & - gcp(ji,jj,1) * gcx(ji ,jj-1) & … … 118 132 END DO 119 133 END DO 134 icount = icount + 1 120 135 121 136 ! test of convergence … … 124 139 SELECT CASE ( nsol_arp ) 125 140 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) ) 127 142 IF( lk_mpp ) CALL mpp_max( zres2 ) ! max over the global domain 128 143 ! test of convergence … … 133 148 ENDIF 134 149 CASE ( 1 ) ! relative precision 135 rnorme = SUM( gcr(2: jpim1,2:jpjm1) )150 rnorme = SUM( gcr(2:nlci-1,2:nlcj-1) ) 136 151 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 137 152 ! test of convergence … … 163 178 ! ------------- 164 179 165 CALL lbc_lnk ( gcx, c_solver_pt, 1. ) ! boundary conditions180 CALL lbc_lnk_e( gcx, c_solver_pt, 1. ) ! boundary conditions 166 181 167 182
Note: See TracChangeset
for help on using the changeset viewer.