Changeset 111 for trunk/NEMO/OPA_SRC/SOL/solsor.F90
- Timestamp:
- 2004-06-28T15:22:55+02:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMO/OPA_SRC/SOL/solsor.F90
r95 r111 76 76 ! ! ============== 77 77 78 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! applied the lateral bou bary conditions78 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! applied the lateral boundary conditions 79 79 80 80 ! Residus 81 81 ! ------- 82 82 83 zres2 = 0.e084 85 83 ! Guess black update 86 DO jj = 2, jpjm184 DO jj = 2, jpjm1 87 85 ishift = MOD( jj-ijmppodd, 2 ) 88 86 DO ji = 2+ishift, jpim1, 2 … … 93 91 & - gcp(ji,jj,4) * gcx(ji ,jj+1) 94 92 ! Estimate of the residual 95 zres = ztmp - gcx(ji,jj) 96 zres2 = zres2 + zres * gcdmat(ji,jj) * zres 93 zres = ztmp - gcx(ji,jj) 97 94 gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 98 95 ! Guess update … … 113 110 & - gcp(ji,jj,4) * gcx(ji ,jj+1) 114 111 ! Estimate of the residual 115 zres = ztmp - gcx(ji,jj) 116 zres2 = zres2 + zres * gcdmat(ji,jj) * zres 112 zres = ztmp - gcx(ji,jj) 117 113 gcr(ji,jj) = zres * gcdmat(ji,jj) * zres 118 114 ! Guess update 119 gcx(ji,jj) = sor * ztmp +(1-sor) * gcx(ji,jj)115 gcx(ji,jj) = sor * ztmp + (1-sor) * gcx(ji,jj) 120 116 END DO 121 117 END DO … … 123 119 CALL lbc_lnk( gcx, c_solver_pt, 1. ) ! applied the lateral boubary conditions 124 120 125 ! relative precision 126 rnorme = zres2 127 !!!! IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 128 !i 129 zres2 = MAXVAL( gcr(2:jpim1,2:jpjm1) ) 121 ! test of convergence 122 IF ( jn > nmin .AND. MOD( jn-nmin, nmod ) == 0 ) then 130 123 131 IF( lk_mpp ) CALL mpp_max( zres2 ) ! sum over the global domain 132 !i 133 ! test of convergence 134 ! old test (either res<resmax or jn=nmax) 135 ! IF( res < resmax .OR. jn == nmax ) THEN 136 IF( zres2 < 1.e-10 .OR. jn == nmax ) THEN 137 ! relative precision 138 ! IF( rnorme < epsr .OR. jn == nmax ) THEN 139 ! res = SQRT( rnorme ) 140 res = SQRT( zres2 ) 141 niter = jn 142 ncut = 999 143 ! write(numout,*) 'solsor : res max = ', zres2, 'niter= ', niter 144 ENDIF 124 SELECT CASE ( nsol_arp ) 125 CASE ( 1 ) ! relative precision 126 rnorme = SUM( gcr(2:jpim1,2:jpjm1) ) 127 IF( lk_mpp ) CALL mpp_sum( rnorme ) ! sum over the global domain 128 ! test of convergence 129 IF( rnorme < epsr .OR. jn == nmax ) THEN 130 res = SQRT( rnorme ) 131 niter = jn 132 ncut = 999 133 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 145 144 146 145 !**** … … 149 148 !**** 150 149 150 ENDIF 151 151 ! indicator of non-convergence or explosion 152 152 IF( jn == nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2
Note: See TracChangeset
for help on using the changeset viewer.