  SUBROUTINE DEALLOC

!&E---------------------------------------------------------------------
!&E                 ***  ROUTINE DEALLOC  ***
!&E
!&E ** Purpose :
!&E
!&E ** Description :
!&E
!&E ** Called by :
!&E
!&E ** External calls :
!&E
!&E ** Used ij-arrays :
!&E
!&E ** Modified variables :
!&E
!&E ** Reference :
!&E
!&E ** History :
!&E       ! 2010-02 (G. Simon) add wave module
!&E
!&E---------------------------------------------------------------------
!! * Modules used
   USE comvars2d, ONLY : l_modele2d,dealloc_comvars2d,hex,hey,htx,hty
   USE comfluxdo, ONLY : dealloc_comfluxdo,dealloc_comfluxdo3d,dealloc_fsalxy
   USE comvars3d, ONLY : dealloc_comvars3d,wz
   USE cometemp,  ONLY : dealloc_cometemp,dealloc_ftempxy
   USE comdem,    ONLY : dealloc_comdem
   USE output,    ONLY : output_dealloc
   USE sflxatm,   ONLY : dealloc_sflxatm
   USE cometdyn,  ONLY : dealloc_cometdyn
   USE obccombine,ONLY : dealloc_obc
   USE comvarp2d, ONLY : sal,temp,u,v,ssh

   USE comvarp2d, ONLY : sal2,temp2

   USE comvarp3d, ONLY : boz,uz,vz,ect,psi


   USE comturb,   ONLY : dealloc_comturb
   USE comaree,   ONLY : dealloc_comaree
   USE comvarp2d, ONLY : dealloc_comvarp2d
   USE comsiggen, ONLY : dealloc_comsiggen

   USE comfluvert,ONLY : dealloc_comfluvert


   USE wave,      ONLY : wave_dealloc


   USE comsubstance, ONLY : dealloc_fxfyfz





!! * Arguments

!! * Local declarations

!!----------------------------------------------------------------------
!! * Executable part
   CALL output_dealloc
   CALL dealloc_comdem
   CALL dealloc_cometemp
   CALL dealloc_cometdyn

   CALL wave_dealloc

   CALL dealloc_comfluxdo
   CALL dealloc_comvars2d
   CALL dealloc_comvars3d
   CALL dealloc_sflxatm
   CALL dealloc_obc
   CALL dealloc_ftempxy
   CALL dealloc_fsalxy
   CALL dealloc_comturb
   CALL dealloc_comaree
   CALL dealloc_comvarp2d

   CALL dealloc_comfluvert

   IF(.NOT.l_modele2d) CALL dealloc_comfluxdo3d

   CALL dealloc_fxfyfz      !deallocating fxfy



   DEALLOCATE(boz,hex,hey,htx,hty,ect,psi,u,v,uz,vz,wz,ssh,sal,temp,sal2,temp2)









  END SUBROUTINE DEALLOC
