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.
solsor_tam.F90 in NEMO/branches/NERC/dev_release-3.4_NEMOTAM_consolidated/NEMOGCM/NEMO/OPATAM_SRC/SOL – NEMO

source: NEMO/branches/NERC/dev_release-3.4_NEMOTAM_consolidated/NEMOGCM/NEMO/OPATAM_SRC/SOL/solsor_tam.F90

Last change on this file was 13432, checked in by smueller, 4 years ago

Fixing of the number of iterations carried out by the tangent-linear SOR solver to the default number of iterations carried out by its adjoint

  • Property svn:executable set to *
File size: 21.6 KB
Line 
1MODULE solsor_tam
2   !!======================================================================
3   !!                     ***  MODULE  solsor  ***
4   !! Ocean solver :  Tangent linear and Adjoint of Successive Over-Relaxation solver
5   !!=====================================================================
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   !!----------------------------------------------------------------------
13   !!
14   !!----------------------------------------------------------------------
15   !!   sol_sor     : Red-Black Successive Over-Relaxation solver
16   !!----------------------------------------------------------------------
17   !! * Modules used
18   USE par_oce
19   USE in_out_manager
20   USE sol_oce
21   USE solmat
22   USE lib_mpp
23   USE lbclnk
24   USE lbclnk_tam
25   USE sol_oce_tam
26   USE dom_oce
27   USE gridrandom
28   USE dotprodfld
29   USE tstool_tam
30   USE lib_fortran
31   USE wrk_nemo
32   USE timing
33   !
34   IMPLICIT NONE
35   PRIVATE
36   !
37   !! * Routine accessibility
38   PUBLIC sol_sor_adj          !
39   PUBLIC sol_sor_tan          !
40   PUBLIC sol_sor_adj_tst      ! called by tamtst.F90
41   !!----------------------------------------------------------------------
42   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
43   !! $Id$
44   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
45   !!----------------------------------------------------------------------
46CONTAINS
47
48   SUBROUTINE sol_sor_tan( kt, kindic )
49      !!----------------------------------------------------------------------
50      !!                  ***  ROUTINE sol_sor_tan : TL of sol_sor  ***
51      !!
52      !! ** Purpose :   Solve the ellipic equation for the barotropic stream
53      !!      function system (lk_dynspg_rl=T) or the transport divergence
54      !!      system (lk_dynspg_flt=T) using a red-black successive-over-
55      !!      relaxation method.
56      !!       In the former case, the barotropic stream function trend has a
57      !!     zero boundary condition along all coastlines (i.e. continent
58      !!     as well as islands) while in the latter the boundary condition
59      !!     specification is not required.
60      !!       This routine provides a MPI optimization to the existing solsor
61      !!     by reducing the number of call to lbc.
62      !!
63      !! ** Method  :   Successive-over-relaxation method using the red-black
64      !!      technique. The former technique used was not compatible with
65      !!      the north-fold boundary condition used in orca configurations.
66      !!      Compared to the classical sol_sor, this routine provides a
67      !!      mpp optimization by reducing the number of calls to lnc_lnk
68      !!      The solution is computed on a larger area and the boudary
69      !!      conditions only when the inside domain is reached.
70      !!
71      !! References :
72      !!      Madec et al. 1988, Ocean Modelling, issue 78, 1-6.
73      !!      Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377
74      !!
75      !! History of the direct routine:
76      !!        !  90-10  (G. Madec)  Original code
77      !!        !  91-11  (G. Madec)
78      !!   7.1  !  93-04  (G. Madec)  time filter
79      !!        !  96-05  (G. Madec)  merge sor and pcg formulations
80      !!   9.0  !  03-04  (C. Deltel, G. Madec)  Red-Black SOR in free form
81      !!   9.0  !  05-09  (R. Benshila, G. Madec)  MPI optimization
82      !! History of the  T&A routine:
83      !!        !  96-11  (A. Weaver)  correction to preconditioning
84      !!   8.2  !  03-02  (C. Deltel) OPAVAR tangent-linear version
85      !!   9.0  !  07-09  (K. Mogensen) tangent of the 03-04 version
86      !!   9.0  !  09-02  (A. Vidard)   tangent of the 05-09 version
87      !!----------------------------------------------------------------------
88      !! * Arguments
89      INTEGER, INTENT( in    ) ::   kt       ! Current timestep.
90      INTEGER, INTENT( inout ) ::   kindic   ! solver indicator, < 0 if the conver-
91      !                                      ! gence is not reached: the model is
92      !                                      ! stopped in step
93      !                                      ! set to zero before the call of solsor
94      !! * Local declarations
95      INTEGER  ::   ji, jj, jn               ! dummy loop indices
96      INTEGER  ::   ishift, icount, istp
97      REAL(wp) ::   ztmp, zres, zres2
98
99      INTEGER  ::   ijmppodd, ijmppeven
100      INTEGER  ::   ijpr2d
101      REAL(wp), POINTER, DIMENSION(:,:) ::   ztab                 ! 2D workspace
102      !!----------------------------------------------------------------------
103      !
104      IF( nn_timing == 1 )  CALL timing_start('sol_sor_tan')
105      !
106      CALL wrk_alloc( jpi, jpj, ztab )
107      !
108      ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj  ,2)
109      ijmppodd  = MOD(nimpp+njmpp+jpr2di+jpr2dj+1,2)
110      ijpr2d = MAX(jpr2di,jpr2dj)
111      icount = 0
112      !                                                       ! ==============
113      DO jn = 1,  nitsor(kt - nit000 + 1)                     ! Iterative loop
114         !                                                    ! ==============
115         ! applied the lateral boundary conditions
116         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx_tl, c_solver_pt, 1.0_wp )
117         ! Residuals
118         ! ---------
119         ! Guess black update
120         DO jj = 2-jpr2dj, nlcj - 1 + jpr2dj
121            ishift = MOD( jj-ijmppodd-jpr2dj, 2 )
122            DO ji = 2-jpr2di+ishift, nlci - 1 + jpr2di, 2
123               ztmp =                  gcb_tl(ji  ,jj  )   &
124                  &   - gcp(ji,jj,1) * gcx_tl(ji  ,jj-1)   &
125                  &   - gcp(ji,jj,2) * gcx_tl(ji-1,jj  )   &
126                  &   - gcp(ji,jj,3) * gcx_tl(ji+1,jj  )   &
127                  &   - gcp(ji,jj,4) * gcx_tl(ji  ,jj+1)
128               ! Estimate of the residual
129               zres = ztmp - gcx_tl(ji,jj)
130               gcr_tl(ji,jj) = zres * gcdmat(ji,jj) * zres
131               ! Guess update
132               gcx_tl(ji,jj) = rn_sor * ztmp + ( 1.0_wp - rn_sor ) * gcx_tl(ji,jj)
133            END DO
134         END DO
135         icount = icount + 1
136         ! applied the lateral boundary conditions
137         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e( gcx_tl, c_solver_pt, 1.0_wp )
138         ! Guess red update
139         DO jj = 2-jpr2dj, nlcj-1+jpr2dj
140            ishift = MOD( jj-ijmppeven-jpr2dj, 2 )
141            DO ji = 2-jpr2di+ishift, nlci-1+jpr2di, 2
142               ztmp =                  gcb_tl(ji  ,jj  )   &
143                  &   - gcp(ji,jj,1) * gcx_tl(ji  ,jj-1)   &
144                  &   - gcp(ji,jj,2) * gcx_tl(ji-1,jj  )   &
145                  &   - gcp(ji,jj,3) * gcx_tl(ji+1,jj  )   &
146                  &   - gcp(ji,jj,4) * gcx_tl(ji  ,jj+1)
147               ! Estimate of the residual
148               zres = ztmp - gcx_tl(ji,jj)
149               gcr_tl(ji,jj) = zres * gcdmat(ji,jj) * zres
150               ! Guess update
151               gcx_tl(ji,jj) = rn_sor * ztmp + ( 1.0_wp - rn_sor ) * gcx_tl(ji,jj)
152            END DO
153         END DO
154         icount = icount + 1
155         ! ! test of convergence
156         ! IF ( (jn > nn_nmin .AND. MOD( jn-nn_nmin, nn_nmod ) == 0) .OR. jn==nn_nmax ) THEN
157         IF ( jn == nitsor(kt - nit000 + 1) ) THEN
158            SELECT CASE ( nn_sol_arp )
159            CASE ( 0 )
160               ! absolute precision (maximum value of the residual)
161               zres2 = MAXVAL( gcr_tl(2:nlci - 1,2:nlcj - 1) )
162               IF( lk_mpp )  CALL mpp_max( zres2 ) ! max over the global domain
163               ! ! test of convergence
164               res = SQRT( zres2 )
165               ! IF( zres2 < rn_resmax .OR. jn == nn_nmax ) THEN
166               !    niter = jn
167               !    ncut = 999
168               !    ! Store number of iterations for adjoint computation
169               !    istp = kt - nit000 + 1
170               !    nitsor(istp) = niter
171               ! ENDIF
172            CASE ( 1 )                 ! relative precision
173               ztab(:,:) = 0.0_wp
174               ztab(2:nlci-1,2:nlcj-1) = gcr_tl(2:nlci-1,2:nlcj-1)
175               rnorme = glob_sum(ztab)
176               ! ! test of convergence
177               res = SQRT( rnorme )
178               ! IF( rnorme < epsr .OR. jn == nn_nmax ) THEN
179               !    niter = jn
180               !    ncut = 999
181               !    ! Store number of iterations for adjoint computation
182               !    istp = kt - nit000 + 1
183               !    nitsor(istp) = niter
184               ! ENDIF
185            END SELECT
186            !****
187            IF(lwp)WRITE(numsol,9300) jn, res, sqrt( epsr ) / eps
1889300        FORMAT('          niter :',i6,' res :',e20.10,' b :',e20.10)
189            !****
190         ENDIF
191         ! ! indicator of non-convergence or explosion
192         !      IF( jn == nn_nmax ) nitsor(istp) = jn
193         ! IF( jn == nn_nmax .OR. SQRT(epsr)/eps > 1.e+20 ) kindic = -2
194         ! IF( ncut == 999 ) GOTO 999
195         !                                              ! =====================
196      END DO                                            ! END of iterative loop
197      !                                                 ! =====================
198999   CONTINUE
199      !  Output in gcx_tl
200      !  ----------------
201      CALL lbc_lnk_e( gcx_tl, c_solver_pt, 1.0_wp )    ! Lateral BCs
202      !
203      CALL wrk_dealloc( jpi, jpj, ztab )
204      !
205      IF( nn_timing == 1 )  CALL timing_stop('sol_sor_tan')
206      !
207   END SUBROUTINE sol_sor_tan
208   SUBROUTINE sol_sor_adj( kt, kindic )
209      !!----------------------------------------------------------------------
210      !!                  ***  ROUTINE sol_sor_adj : adjoint of sol_sor  ***
211      !!
212      !! ** Purpose :   Solve the ellipic equation for the barotropic stream
213      !!      function system (lk_dynspg_rl=T) or the transport divergence
214      !!      system (lk_dynspg_flt=T) using a red-black successive-over-
215      !!      relaxation method.
216      !!       In the former case, the barotropic stream function trend has a
217      !!     zero boundary condition along all coastlines (i.e. continent
218      !!     as well as islands) while in the latter the boundary condition
219      !!     specification is not required.
220      !!       This routine provides a MPI optimization to the existing solsor
221      !!     by reducing the number of call to lbc.
222      !!
223      !! ** Method  :   Successive-over-relaxation method using the red-black
224      !!      technique. The former technique used was not compatible with
225      !!      the north-fold boundary condition used in orca configurations.
226      !!      Compared to the classical sol_sor, this routine provides a
227      !!      mpp optimization by reducing the number of calls to lbc_lnk
228      !!      The solution is computed on a larger area and the boudary
229      !!      conditions only when the inside domain is reached.
230      !! ** Comments on adjoint routine :
231      !!      When the step in a tangent-linear DO loop is an arbitrary
232      !!      integer then care must be taken in computing the lower bound
233      !!      of the adjoint DO loop; i.e.,
234      !!
235      !!      If the tangent-linear DO loop is:  low_tl, up_tl, step
236      !!
237      !!      then the adjoint DO loop is:  low_ad, up_ad, -step
238      !!
239      !!      where  low_ad = low_tl + step * INT( ( up_tl - low_tl ) / step )
240      !!             up_ad  = low_tl
241      !!
242      !!      NB. If step = 1 then low_ad = up_tl
243      !!
244      !! References :
245      !!      Madec et al. 1988, Ocean Modelling, issue 78, 1-6.
246      !!      Beare and Stevens 1997 Ann. Geophysicae 15, 1369-1377
247      !!
248      !! History of the direct routine:
249      !!        !  90-10  (G. Madec)  Original code
250      !!        !  91-11  (G. Madec)
251      !!   7.1  !  93-04  (G. Madec)  time filter
252      !!        !  96-05  (G. Madec)  merge sor and pcg formulations
253      !!   9.0  !  03-04  (C. Deltel, G. Madec)  Red-Black SOR in free form
254      !!   9.0  !  05-09  (R. Benshila, G. Madec)  MPI optimization
255      !! History of the  T&A routine:
256      !!        !  96-11  (A. Weaver)  correction to preconditioning
257      !!   8.2  !  03-02  (C. Deltel) OPAVAR tangent-linear version
258      !!   9.0  !  07-09  (K. Mogensen, A. Weaver) adjoint of the 03-04 version
259      !!   9.0  !  09-02  (A. Vidard)  adjoint of the 05-09 version
260      !!----------------------------------------------------------------------
261      !! * Arguments
262      INTEGER, INTENT( in    ) ::   kt       ! Current timestep.
263      INTEGER, INTENT( inout ) ::   kindic   ! solver indicator, < 0 if the conver-
264      !                                      ! gence is not reached: the model is
265      !                                      ! stopped in step
266      !                                      ! set to zero before the call of solsor
267      !! * Local declarations
268      INTEGER  ::   ji, jj, jn               ! dummy loop indices
269      INTEGER  ::   ishift, icount, istp, iter, ilower
270      REAL(wp) ::   ztmpad
271
272      INTEGER  ::   ijmppodd, ijmppeven
273      INTEGER  ::   ijpr2d
274      !!----------------------------------------------------------------------
275      IF( nn_timing == 1 )  CALL timing_start('sol_sor_adj')
276      !
277      ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj,2)
278      ijmppodd  = MOD(nimpp+njmpp+jpr2di+jpr2dj+1,2)
279      ijpr2d = MAX(jpr2di,jpr2dj)
280      !
281      ! Fixed number of iterations
282      istp = kt - nit000 + 1
283      iter = nitsor(istp)
284      icount = iter * 2
285      !  Output in gcx_ad
286      !  ----------------
287      CALL lbc_lnk_e_adj( gcx_ad, c_solver_pt, 1.0_wp )    ! Lateral BCs
288      !                                                    ! ==============
289      DO jn = iter, 1, -1                                  ! Iterative loop
290         !                                                 ! ==============
291         ! Guess red update
292         DO jj =  nlcj-1+jpr2dj, 2-jpr2dj, -1
293            ishift = MOD( jj-ijmppeven-jpr2dj, 2 )
294            ! this weird computation is to cope with odd end of loop in the tangent
295            ilower = 2-jpr2dj+ishift + 2 * INT( ( ( nlci-1+jpr2dj )-( 2-jpr2dj+ishift ) ) / 2 )
296            DO ji = ilower, 2-jpr2dj+ishift, -2
297               ! Guess update
298               ztmpad = rn_sor * gcx_ad(ji,jj)
299               gcx_ad(ji  ,jj  ) = gcx_ad(ji  ,jj  ) * ( 1.0_wp - rn_sor )
300
301               gcb_ad(ji  ,jj  ) = gcb_ad(ji  ,jj  ) + ztmpad
302               gcx_ad(ji  ,jj-1) = gcx_ad(ji  ,jj-1) - ztmpad * gcp(ji,jj,1)
303               gcx_ad(ji-1,jj  ) = gcx_ad(ji-1,jj  ) - ztmpad * gcp(ji,jj,2)
304               gcx_ad(ji+1,jj  ) = gcx_ad(ji+1,jj  ) - ztmpad * gcp(ji,jj,3)
305               gcx_ad(ji  ,jj+1) = gcx_ad(ji  ,jj+1) - ztmpad * gcp(ji,jj,4)
306            END DO
307         END DO
308         icount = icount - 1
309         ! applied the lateral boundary conditions
310         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e_adj( gcx_ad, c_solver_pt, 1.0_wp )   ! Lateral BCs
311         ! Residus
312         ! -------
313         ! Guess black update
314         DO jj = nlcj-1+jpr2dj, 2-jpr2dj, -1
315            ishift = MOD( jj-ijmppodd-jpr2dj, 2 )
316            ilower = 2-jpr2dj+ishift + 2 * INT( ( ( nlci-1+jpr2dj )-( 2-jpr2dj+ishift ) ) / 2 )
317            DO ji = ilower, 2-jpr2dj+ishift, -2
318               ! Guess update
319               ztmpad = rn_sor * gcx_ad(ji,jj)
320               gcx_ad(ji  ,jj  ) = gcx_ad(ji  ,jj  ) * ( 1.0_wp - rn_sor )
321
322               gcb_ad(ji  ,jj  ) = gcb_ad(ji  ,jj  ) + ztmpad
323               gcx_ad(ji  ,jj-1) = gcx_ad(ji  ,jj-1) - ztmpad * gcp(ji,jj,1)
324               gcx_ad(ji-1,jj  ) = gcx_ad(ji-1,jj  ) - ztmpad * gcp(ji,jj,2)
325               gcx_ad(ji+1,jj  ) = gcx_ad(ji+1,jj  ) - ztmpad * gcp(ji,jj,3)
326               gcx_ad(ji  ,jj+1) = gcx_ad(ji  ,jj+1) - ztmpad * gcp(ji,jj,4)
327            END DO
328         END DO
329        icount = icount - 1
330         ! applied the lateral boundary conditions
331         IF( MOD(icount,ijpr2d+1) == 0 ) CALL lbc_lnk_e_adj( gcx_ad, c_solver_pt, 1.0_wp )   ! Lateral BCs
332         !                                              ! =====================
333      END DO                                            ! END of iterative loop
334      !                                                 ! =====================
335      IF( nn_timing == 1 )  CALL timing_stop('sol_sor_adj')
336
337   END SUBROUTINE sol_sor_adj
338   SUBROUTINE sol_sor_adj_tst( kumadt )
339      !!-----------------------------------------------------------------------
340      !!
341      !!                  ***  ROUTINE example_adj_tst ***
342      !!
343      !! ** Purpose : Test the adjoint routine.
344      !!
345      !! ** Method  : Verify the scalar product
346      !!
347      !!                 ( L dx )^T W dy  =  dx^T L^T W dy
348      !!
349      !!              where  L   = tangent routine
350      !!                     L^T = adjoint routine
351      !!                     W   = diagonal matrix of scale factors
352      !!                     dx  = input perturbation (random field)
353      !!                     dy  = L dx
354      !!
355      !!
356      !! History :
357      !!        ! 08-08 (A. Vidard)
358      !!-----------------------------------------------------------------------
359      !! * Modules used
360
361      !! * Arguments
362      INTEGER, INTENT(IN) :: &
363         & kumadt             ! Output unit
364
365      !! * Local declarations
366      INTEGER ::  &
367         & ji,    &        ! dummy loop indices
368         & jj,    &
369         & jn,    &
370         & jk,    &
371         & kindic,&        ! flags fo solver convergence
372         & kmod,  &        ! frequency of test for the SOR solver
373         & kt              ! number of iteration
374      REAL(KIND=wp) :: &
375         & zsp1,         & ! scalar product involving the tangent routine
376         & zsp2            ! scalar product involving the adjoint routine
377      REAL(KIND=wp), DIMENSION(:,:), ALLOCATABLE :: &
378         & zgcb_tlin ,     & ! Tangent input
379         & zgcx_tlin ,     & ! Tangent input
380         & zgcx_tlout,     & ! Tangent output
381         & zgcx_adin ,     & ! Adjoint input
382         & zgcb_adout,     & ! Adjoint output
383         & zgcx_adout,     & ! Adjoint output
384         & zr             ! 3D random field
385      CHARACTER(LEN=14) :: cl_name
386      ! Allocate memory
387
388
389      ALLOCATE( &
390         & zgcb_tlin( jpi,jpj),     &
391         & zgcx_tlin( jpi,jpj),     &
392         & zgcx_tlout(jpi,jpj),     &
393         & zgcx_adin( jpi,jpj),     &
394         & zgcx_adout(jpi,jpj),     &
395         & zgcb_adout(jpi,jpj),     &
396         & zr(        jpi,jpj)      &
397         & )
398
399      ! Initialize the matrix of the elliptic equation
400
401      CALL sol_mat( nit000 + 1 )
402
403      !==================================================================
404      ! 1) dx = ( un_tl, vn_tl, hdivn_tl ) and
405      !    dy = ( hdivb_tl, hdivn_tl )
406      !==================================================================
407
408      !--------------------------------------------------------------------
409      ! Reset the tangent and adjoint variables
410      !--------------------------------------------------------------------
411      zgcb_tlin( :,:) = 0.0_wp
412      zgcx_tlin( :,:) = 0.0_wp
413      zgcx_tlout(:,:) = 0.0_wp
414      zgcx_adin( :,:) = 0.0_wp
415      zgcx_adout(:,:) = 0.0_wp
416      zgcb_adout(:,:) = 0.0_wp
417      zr(        :,:) = 0.0_wp
418      !--------------------------------------------------------------------
419      ! Initialize the tangent input with random noise: dx
420      !--------------------------------------------------------------------
421      kt=nit000
422      kindic=0
423!      kmod = nn_nmod  ! store frequency of test for the SOR solver
424!      nn_nmod = 1     ! force frequency to one (remove adj_tst dependancy to nn_nmin)
425
426      CALL grid_random( zr, c_solver_pt, 0.0_wp, stdgc )
427      DO jj = nldj, nlej
428         DO ji = nldi, nlei
429            zgcb_tlin(ji,jj) = zr(ji,jj)
430         END DO
431      END DO
432      CALL grid_random( zr, c_solver_pt, 0.0_wp, stdgc )
433      DO jj = nldj, nlej
434         DO ji = nldi, nlei
435            zgcx_tlin(ji,jj) = zr(ji,jj)
436         END DO
437      END DO
438      ncut = 1 ! reinitialize the solver convergence flag
439      gcr_tl(:,:) = 0.0_wp
440      gcb_tl(:,:) = zgcb_tlin(:,:)
441      gcx_tl(:,:) = zgcx_tlin(:,:)
442      CALL sol_sor_tan(kt, kindic)
443      zgcx_tlout(:,:) = gcx_tl(:,:)
444
445      !--------------------------------------------------------------------
446      ! Initialize the adjoint variables: dy^* = W dy
447      !--------------------------------------------------------------------
448
449      DO jj = nldj, nlej
450         DO ji = nldi, nlei
451            zgcx_adin(ji,jj) = zgcx_tlout(ji,jj)         &
452               &               * e1t(ji,jj) * e2t(ji,jj) &
453               &               * tmask(ji,jj,1)
454         END DO
455      END DO
456      !--------------------------------------------------------------------
457      ! Compute the scalar product: ( L dx )^T W dy
458      !--------------------------------------------------------------------
459      zsp1 = DOT_PRODUCT( zgcx_tlout, zgcx_adin )
460      !--------------------------------------------------------------------
461      ! Call the adjoint routine: dx^* = L^T dy^*
462      !--------------------------------------------------------------------
463      gcb_ad(:,:) = 0.0_wp
464      gcx_ad(:,:) = zgcx_adin(:,:)
465      CALL sol_sor_adj(kt, kindic)
466      zgcx_adout(:,:) = gcx_ad(:,:)
467      zgcb_adout(:,:) = gcb_ad(:,:)
468
469      zsp2 =  DOT_PRODUCT( zgcx_tlin, zgcx_adout ) &
470         & + DOT_PRODUCT( zgcb_tlin, zgcb_adout )
471
472      cl_name = 'sol_sor_adj  '
473      CALL prntst_adj( cl_name, kumadt, zsp1, zsp2 )
474!      nn_nmod = kmod  ! restore initial frequency of test for the SOR solver
475
476      nitsor(:) = jp_it0adj
477
478      DEALLOCATE(      &
479         & zgcb_tlin,  &
480         & zgcx_tlin,  &
481         & zgcx_tlout, &
482         & zgcx_adin,  &
483         & zgcx_adout, &
484         & zgcb_adout, &
485         & zr          &
486         & )
487   END SUBROUTINE sol_sor_adj_tst
488END MODULE solsor_tam
489
Note: See TracBrowser for help on using the repository browser.