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 4586 for branches – NEMO

Changeset 4586 for branches


Ignore:
Timestamp:
2014-03-26T11:12:07+01:00 (10 years ago)
Author:
pabouttier
Message:

Fix relative precision norme computing in sol_sor_tan, using zta, see Ticket #1279

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_v3_4_STABLE_2012/NEMOGCM/NEMO/OPATAM_SRC/SOL/solsor_tam.F90

    r3611 r4586  
    1919   USE in_out_manager 
    2020   USE sol_oce 
     21   USE solmat 
    2122   USE lib_mpp 
    2223   USE lbclnk 
     
    9899      INTEGER  ::   ijmppodd, ijmppeven 
    99100      INTEGER  ::   ijpr2d 
     101      REAL(wp), POINTER, DIMENSION(:,:) ::   ztab                 ! 2D workspace 
    100102      !!---------------------------------------------------------------------- 
    101103      ! 
    102104      IF( nn_timing == 1 )  CALL timing_start('sol_sor_tan') 
     105      ! 
     106      CALL wrk_alloc( jpi, jpj, ztab ) 
    103107      ! 
    104108      ijmppeven = MOD(nimpp+njmpp+jpr2di+jpr2dj  ,2) 
     
    157161               IF( lk_mpp )  CALL mpp_max( zres2 ) ! max over the global domain 
    158162               ! test of convergence 
     163               res = SQRT( zres2 ) 
    159164               IF( zres2 < rn_resmax .OR. jn == nn_nmax ) THEN 
    160                   res = SQRT( zres2 ) 
    161165                  niter = jn 
    162166                  ncut = 999 
     
    166170               ENDIF 
    167171            CASE ( 1 )                 ! relative precision 
    168                rnorme = glob_sum(gcr_tl(2:nlci - 1, 2:nlcj - 1)) 
     172               ztab(:,:) = 0.0_wp 
     173               ztab(2:nlci-1,2:nlcj-1) = gcr_tl(2:nlci-1,2:nlcj-1) 
     174               rnorme = glob_sum(ztab) 
    169175               ! test of convergence 
     176               res = SQRT( rnorme ) 
    170177               IF( rnorme < epsr .OR. jn == nn_nmax ) THEN 
    171                   res = SQRT( rnorme ) 
    172178                  niter = jn 
    173179                  ncut = 999 
     
    194200      CALL lbc_lnk_e( gcx_tl, c_solver_pt, 1.0_wp )    ! Lateral BCs 
    195201      ! 
     202      CALL wrk_dealloc( jpi, jpj, ztab ) 
     203      ! 
    196204      IF( nn_timing == 1 )  CALL timing_stop('sol_sor_tan') 
    197205      ! 
     
    387395         & zr(        jpi,jpj)      & 
    388396         & ) 
     397 
     398      ! Initialize the matrix of the elliptic equation 
     399 
     400      CALL sol_mat( nit000 + 1 ) 
     401 
    389402      !================================================================== 
    390403      ! 1) dx = ( un_tl, vn_tl, hdivn_tl ) and 
     
    459472      CALL prntst_adj( cl_name, kumadt, zsp1, zsp2 ) 
    460473!      nn_nmod = kmod  ! restore initial frequency of test for the SOR solver 
     474 
     475      nitsor(:) = jp_it0adj 
    461476 
    462477      DEALLOCATE(      & 
Note: See TracChangeset for help on using the changeset viewer.