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/SBC/sbc_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/SBC/sbc_oce_tam.F90

    r1885 r2587  
    2828   PUBLIC & 
    2929      & sbc_oce_tam_init, & !: Initialize the TAM fields 
     30      & sbc_oce_tam_deallocate, & !: Deallocate the TAM fields 
    3031   !!---------------------------------------------------------------------- 
    3132   !!              Ocean Surface Boundary Condition fields 
     
    295296 
    296297   END SUBROUTINE sbc_oce_tam_init 
     298   SUBROUTINE sbc_oce_tam_deallocate( kindic ) 
     299      !!----------------------------------------------------------------------- 
     300      !! 
     301      !!                  ***  ROUTINE sbc_oce_tam_init  *** 
     302      !! 
     303      !! ** Purpose : Allocate and initialize the tangent linear and  
     304      !!              adjoint arrays 
     305      !! 
     306      !! ** Method  : kindic = 0  deallocate both tl and ad variables 
     307      !!              kindic = 1  deallocate only tl variables 
     308      !!              kindic = 2  deallocate only ad variables 
     309      !! 
     310      !! ** Action  : 
     311      !!                    
     312      !! References :  
     313      !! 
     314      !! History : 
     315      !!        ! 2010-06 (A. Vidard) Initial version  
     316      !!----------------------------------------------------------------------- 
     317      !! * Arguments 
     318      INTEGER, INTENT(IN) :: & 
     319         & kindic        ! indicate which variables to deallocate 
     320 
     321      !! * Local declarations 
     322       
     323      ! Deallocate tangent linear variable arrays 
     324      ! --------------------------------------- 
     325       
     326      IF ( kindic == 0 .OR. kindic == 1 ) THEN 
     327 
     328         IF ( ALLOCATED(utau_tl) )    DEALLOCATE( utau_tl ) 
     329         IF ( ALLOCATED(vtau_tl) )    DEALLOCATE( vtau_tl ) 
     330         IF ( ALLOCATED(wndm_tl) )    DEALLOCATE( wndm_tl ) 
     331         IF ( ALLOCATED(qns_tl) )     DEALLOCATE( qns_tl ) 
     332         IF ( ALLOCATED(qsr_tl) )     DEALLOCATE( qsr_tl ) 
     333         IF ( ALLOCATED(emp_tl) )     DEALLOCATE( emp_tl ) 
     334         IF ( ALLOCATED(emps_tl) )    DEALLOCATE( emps_tl ) 
     335         IF ( ALLOCATED(fr_i_tl) )    DEALLOCATE( fr_i_tl ) 
     336         IF ( ALLOCATED(ssu_m_tl) )   DEALLOCATE( ssu_m_tl ) 
     337         IF ( ALLOCATED(ssv_m_tl) )   DEALLOCATE( ssv_m_tl ) 
     338         IF ( ALLOCATED(sst_m_tl) )   DEALLOCATE( sst_m_tl ) 
     339         IF ( ALLOCATED(sss_m_tl) )   DEALLOCATE( sss_m_tl ) 
     340 
     341 
     342      ENDIF 
     343 
     344      IF ( kindic == 0 .OR. kindic == 2 ) THEN 
     345 
     346         ! Deallocate adjoint variable arrays 
     347         ! -------------------------------- 
     348       
     349         IF ( ALLOCATED(utau_ad) )    DEALLOCATE( utau_ad ) 
     350         IF ( ALLOCATED(vtau_ad) )    DEALLOCATE( vtau_ad ) 
     351         IF ( ALLOCATED(wndm_ad) )    DEALLOCATE( wndm_ad ) 
     352         IF ( ALLOCATED(qns_ad) )     DEALLOCATE( qns_ad ) 
     353         IF ( ALLOCATED(qsr_ad) )     DEALLOCATE( qsr_ad ) 
     354         IF ( ALLOCATED(emp_ad) )     DEALLOCATE( emp_ad ) 
     355         IF ( ALLOCATED(emps_ad) )    DEALLOCATE( emps_ad ) 
     356         IF ( ALLOCATED(fr_i_ad) )    DEALLOCATE( fr_i_ad ) 
     357         IF ( ALLOCATED(ssu_m_ad) )   DEALLOCATE( ssu_m_ad ) 
     358         IF ( ALLOCATED(ssv_m_ad) )   DEALLOCATE( ssv_m_ad ) 
     359         IF ( ALLOCATED(sst_m_ad) )   DEALLOCATE( sst_m_ad ) 
     360         IF ( ALLOCATED(sss_m_ad) )   DEALLOCATE( sss_m_ad ) 
     361          
     362      ENDIF 
     363 
     364   END SUBROUTINE sbc_oce_tam_deallocate 
    297365#endif 
    298366 
Note: See TracChangeset for help on using the changeset viewer.