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 2587 for branches/TAM_V3_0/NEMOTAM/OPATAM_SRC/SOL/sol_oce_tam.F90 – NEMO

Ignore:
Timestamp:
2011-02-15T12:58:59+01:00 (13 years ago)
Author:
vidard
Message:

refer to ticket #798

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TAM_V3_0/NEMOTAM/OPATAM_SRC/SOL/sol_oce_tam.F90

    r1885 r2587  
    3131      & nmax_fs 
    3232!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
     33   USE sol_oce       , ONLY: & 
     34      & nmin 
     35#if defined key_dynspg_flt 
    3336   USE solver        , ONLY: & ! Solver 
    3437      & solver_init 
    35  
     38#endif 
    3639   !! * Routine accessibility 
    3740    
     
    4144   PUBLIC & 
    4245      & sol_oce_tam_init, & !: routine called by nemovar.F90 
     46      & sol_oce_tam_deallocate, & 
    4347                    ! 
    4448      & gcx_tl,   & !: Tangent of now solution of the elliptic equation 
     
    4852      & gcx_ad,   & !: Adjoint of solution of the elliptic equation 
    4953      & gcxb_ad,  & !: Adjoint of before solution of the elliptic equation 
    50       & gcb_ad     !: Adjoint of 2nd member of barotropic linear system 
    51  
     54      & gcb_ad ,  & !: Adjoint of 2nd member of barotropic linear system 
     55      & nitsor 
    5256   !! * Module variables 
    5357   INTEGER, DIMENSION(:), ALLOCATABLE :: & 
     
    8993         & kindic        ! indicate which variables to allocate/initialize 
    9094 
     95#if defined key_dynspg_flt 
    9196      IF ( kindic == 0 .OR. kindic == 1 ) THEN 
    9297 
     98         IF ( kindic == 0 ) CALL solver_init( nit000 ) 
     99 
    93100         IF ( .NOT. ALLOCATED(nitsor) ) THEN 
    94101 
    95102            ALLOCATE( nitsor( nitend - nit000 + 1 ) ) 
    96  
    97          ENDIF 
    98  
    99          nitsor(:) = nmax_fs 
    100  
    101       IF ( kindic == 0 ) CALL solver_init( nit000 ) 
     103            nitsor(:) = nmin 
     104 
     105         ENDIF 
     106 
    102107 
    103108      ENDIF 
     
    162167 
    163168      ENDIF 
    164  
     169#endif 
    165170   END SUBROUTINE sol_oce_tam_init 
    166  
     171   SUBROUTINE sol_oce_tam_deallocate(kindic) 
     172      !!----------------------------------------------------------------------- 
     173      !! 
     174      !!                  ***  ROUTINE sol_oce_tam_deallocate  *** 
     175      !! 
     176      !! ** Purpose :  
     177      !! 
     178      !! ** Method  : kindic = 0  deallocate both tl and ad variables 
     179      !!              kindic = 1  deallocate only tl variables 
     180      !!              kindic = 2  deallocate only ad variables 
     181      !! 
     182      !! ** Action  : 
     183      !!                    
     184      !! References :  
     185      !! 
     186      !! History : 
     187      !!         ! 2010-06 (A. Vidard) Initial version 
     188      !!----------------------------------------------------------------------- 
     189      !! * Arguments 
     190      INTEGER, INTENT(IN) :: & 
     191         & kindic        ! indicate which variables to allocate/initialize 
     192#if defined key_dynspg_flt 
     193      IF ( kindic == 0 ) THEN 
     194         IF ( ALLOCATED(nitsor) )  DEALLOCATE( nitsor ) 
     195      END IF 
     196 
     197      IF ( kindic == 0 .OR. kindic == 1 ) THEN 
     198 
     199         IF ( ALLOCATED(gcx_tl) )  DEALLOCATE( gcx_tl  ) 
     200 
     201         IF ( ALLOCATED(gcxb_tl) ) DEALLOCATE( gcxb_tl ) 
     202 
     203         IF ( ALLOCATED(gcb_tl) )  DEALLOCATE( gcb_tl  ) 
     204 
     205         IF ( ALLOCATED(gcr_tl) )  DEALLOCATE( gcr_tl  ) 
     206 
     207      ENDIF 
     208 
     209      IF ( kindic == 0 .OR. kindic == 2 ) THEN 
     210 
     211         IF ( ALLOCATED(gcx_ad) )  DEALLOCATE( gcx_ad  ) 
     212 
     213         IF ( ALLOCATED(gcxb_ad) ) DEALLOCATE( gcxb_ad ) 
     214 
     215         IF ( ALLOCATED(gcb_ad) )  DEALLOCATE( gcb_ad  ) 
     216 
     217      ENDIF 
     218       
     219#endif 
     220   END SUBROUTINE sol_oce_tam_deallocate 
    167221END MODULE sol_oce_tam 
Note: See TracChangeset for help on using the changeset viewer.