Changeset 784 for trunk/NEMO
- Timestamp:
- 2008-01-08T12:05:25+01:00 (16 years ago)
- Location:
- trunk/NEMO/OPA_SRC
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/DYN/dynspg_flt.F90
r746 r784 33 33 USE solsor ! Successive Over-relaxation solver 34 34 USE solfet ! FETI solver 35 USE solsor_e ! Successive Over-relaxation solver with MPP optimization36 35 USE obc_oce ! Lateral open boundary condition 37 36 USE obcdyn ! ocean open boundary condition (obc_dyn routines) … … 316 315 END DO 317 316 ! 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. ) 319 318 320 319 #if defined key_agrif … … 361 360 ELSEIF( nsolv == 3 ) THEN ! FETI solver 362 361 CALL sol_fet( kindic ) 363 ELSEIF( nsolv == 4 ) THEN ! successive-over-relaxation with extra outer halo364 CALL sol_sor_e( kindic )365 362 ELSE ! e r r o r in nsolv namelist parameter 366 363 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 ) 368 365 ENDIF 369 366 ENDIF -
trunk/NEMO/OPA_SRC/DYN/dynspg_flt_jki.F90
r719 r784 23 23 USE solsor ! Successive Over-relaxation solver 24 24 USE solfet ! FETI solver 25 USE solsor_e ! Successive Over-relaxation solver with MPP optimization26 25 USE solver 27 26 USE obc_oce ! Lateral open boundary condition … … 232 231 END DO 233 232 ! 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. ) 235 234 236 235 #if defined key_agrif … … 285 284 ELSEIF( nsolv == 3 ) THEN ! FETI solver 286 285 CALL sol_fet( kindic ) 287 ELSEIF( nsolv == 4 ) THEN ! successive-over-relaxation with extra outer halo288 CALL sol_sor_e( kindic )289 286 ELSE ! e r r o r in nsolv namelist parameter 290 287 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 ) 292 289 ENDIF 293 290 ENDIF -
trunk/NEMO/OPA_SRC/DYN/dynspg_rl.F90
r746 r784 36 36 USE solsor ! Successive Over-relaxation solver 37 37 USE solfet ! FETI solver 38 USE solsor_e ! Successive Over-relaxation solver with MPP optimization39 38 USE solisl ! ??? 40 39 USE obc_oce ! Lateral open boundary condition … … 177 176 END DO 178 177 ! 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. ) 180 179 181 180 ! Relative precision (computation on one processor) … … 204 203 CASE( 3 ) ! FETI solver 205 204 CALL sol_fet( kindic ) 206 CASE( 4 ) ! successive-over-relaxation with extra outer halo207 CALL sol_sor_e( kindic )208 205 CASE DEFAULT ! e r r o r in nsolv namelist parameter 209 206 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 ) 211 208 END SELECT 212 209 ENDIF -
trunk/NEMO/OPA_SRC/SOL/sol_oce.F90
r719 r784 24 24 !! ---------------------------------- 25 25 INTEGER , PUBLIC :: & !!: namsol elliptic solver / island / free surface 26 nsolv = 1 , & !: = 1/2/3 /4type of elliptic solver26 nsolv = 1 , & !: = 1/2/3 type of elliptic solver 27 27 nsol_arp = 0 , & !: = 0/1 absolute/relative precision convergence test 28 28 nmin = 300 , & !: minimum of iterations for the SOR solver -
trunk/NEMO/OPA_SRC/SOL/solmat.F90
r719 r784 291 291 gcp(:,:,3) = gcp(:,:,3) * gcdprc(:,:) 292 292 gcp(:,:,4) = gcp(:,:,4) * gcdprc(:,:) 293 IF( ( nsolv == 2 ) .OR. ( nsolv == 4 )) gccd(:,:) = sor * gcp(:,:,2)294 295 IF( nsolv == 4) THEN293 IF( nsolv == 2 ) gccd(:,:) = sor * gcp(:,:,2) 294 295 IF( nsolv == 2 .AND. MAX( jpr2di, jpr2dj ) > 0) THEN 296 296 CALL lbc_lnk_e( gcp (:,:,1), c_solver_pt, 1. ) ! lateral boundary conditions 297 297 CALL lbc_lnk_e( gcp (:,:,2), c_solver_pt, 1. ) ! lateral boundary conditions -
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 -
trunk/NEMO/OPA_SRC/SOL/solver.F90
r719 r784 152 152 153 153 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 157 163 158 164 CASE ( 3 ) ! FETI solver … … 169 175 ENDIF 170 176 171 CASE ( 4 ) ! successive-over-relaxation solver with extra outer halo172 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 =', jpr2dj174 IF( .NOT. lk_mpp .AND. jpr2di /= 0 .AND. jpr2dj /= 0 ) THEN175 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 ELSE178 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 ENDIF181 182 177 CASE DEFAULT 183 178 WRITE(ctmp1,*) ' bad flag value for nsolv = ', nsolv … … 186 181 END SELECT 187 182 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 190 189 END IF 191 190
Note: See TracChangeset
for help on using the changeset viewer.