!-------------------------------------- LICENCE BEGIN ------------------------------------
!Environment Canada - Atmospheric Science and Technology License/Disclaimer, 
!                     version 3; Last Modified: May 7, 2008.
!This is free but copyrighted software; you can use/redistribute/modify it under the terms 
!of the Environment Canada - Atmospheric Science and Technology License/Disclaimer 
!version 3 or (at your option) any later version that should be found at: 
!http://collaboration.cmc.ec.gc.ca/science/rpn.comm/license.html 
!
!This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
!without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
!See the above mentioned License/Disclaimer for more details.
!You should have received a copy of the License/Disclaimer along with this software; 
!if not, you can write to: EC-RPN COMM Group, 2121 TransCanada, suite 500, Dorval (Quebec), 
!CANADA, H9P 1J3; or send e-mail to service.rpn@ec.gc.ca
!-------------------------------------- LICENCE END --------------------------------------
***s/r set_vta - Initialization of the commons for digital filter
*		 variables. Virtual Memory manager initialisation.
*
#define SPY_VMM_CREATE spy_vmm_create
#include "model_macros_f.h"
*

      subroutine set_vta 1
*
      implicit none
*
*author
*     alain patoine - march 1994
*
*revision
* v2_00 - Desgagne/Lee   - initial MPI version (from setvta v1_03)
* v2_21 - J. P. Toviessi - rename some model output variables
* v2_30 - Edouard S.     - remove pi' at the top
* v2_31 - Desgagne M.    - re-introduce 3D tracers*
* v3_31 - McTaggart-Cowan R.- correction for Vtopo mode in digflt
*object
*	This subroutine initializes the commons containing the
*	keys used by the Virtual Memory Manager to identify the
*	digital filter variables
*	
*arguments
*	none
*
*implicits
#include "glb_ld.cdk"
#include "lun.cdk"
#include "schm.cdk"
#include "vta.cdk"
#include "tr3d.cdk"
*
*modules
      integer  vmmcre,vmmlod,vmmget,vmmuld
      external vmmcre,vmmlod,vmmget,vmmuld
*
**
      character*80 attri_S,attrit_S
      integer i
*
*     ---------------------------------------------------------------
*
*
      if (Lun_out.gt.0) write(Lun_out,1000)
*
      COMMON_INIT(vta,-100)
*
*
*C       1.    Create digital filter variables
*              -------------------------------
*
*	Assign the names of the variables
*
      VMM_NAM(uta  ) = 'UTA'
      VMM_NAM(vta  ) = 'VTA'
      VMM_NAM(wta  ) = 'WTA'
      VMM_NAM(tdta ) = 'TDTA'
      VMM_NAM(tta  ) = 'TTA'
      VMM_NAM(fita ) = 'FITA'
      VMM_NAM(qta  ) = 'QTA'
      VMM_NAM(tpta ) = 'TPTA'
      VMM_NAM(fipta) = 'FIPA'
      VMM_NAM(qpta ) = 'QPTA'
      VMM_NAM(pipta) = 'PIPA'
      VMM_NAM(tplta) = 'TPLA'
      VMM_NAM(muta)  = 'MUTA'
      VMM_NAM(psdta) = 'PSDA'
      VMM_NAM(sta  ) = 'STA'
      VMM_NAM(gpta ) = 'GPTA'
      VMM_NAM(multa) = 'MULA'
      VMM_NAM(huta ) = 'HUTA'
      VMM_NAM(qcta ) = 'QCTA'
      VMM_NAM(topoa) = 'TOPA'
      VMM_NAM(trta ) = 'TRTA'
*
*	Set the attributes of the variables
*
      attri_S  = 'SAVE=Y,CL=2,W=5,INIT=0,MUSTEXIST'
      attrit_S = 'SAVE=Y,CL=3,W=5,INIT=0,MUSTEXIST'
*
      VMM_CREATE(uta  , LARRAY3D, 1, attri_S)
      VMM_CREATE(vta  , LARRAY3D, 1, attri_S)
      VMM_CREATE(wta  , LARRAY3D, 1, attri_S)
      VMM_CREATE(tdta , LARRAY3D, 1, attri_S)
      VMM_CREATE(tta  , LARRAY3D, 1, attri_S)
      VMM_CREATE(fita , LARRAY3D, 1, attri_S)
      VMM_CREATE(qta  , LARRAY3D, 1, attri_S)
      VMM_CREATE(tpta , LARRAY3D, 1, attri_S)
      VMM_CREATE(fipta, LARRAY3D, 1, attri_S)
      VMM_CREATE(qpta , LARRAY3D, 1, attri_S)
      VMM_CREATE(pipta, LARRAY3D, 1, attri_S)
      VMM_CREATE(tplta, LARRAY3D, 1, attri_S)
      VMM_CREATE(psdta, LARRAY3D, 1, attri_S)
      VMM_CREATE(sta  , LARRAY2D, 1, attri_S)
      VMM_CREATE(gpta , LARRAY3D, 1, attri_S)
      VMM_CREATE(huta , LARRAY3D, 1, attri_S)
      VMM_CREATE(topoa, LARRAY2D, 1, attri_S)
      VMM_CREATE(qcta , LARRAY3D, 1, attri_S)
*
      if (.not. Schm_hydro_L) then
         VMM_CREATE(  muta, LARRAY3D, 1, attri_S )
         VMM_CREATE( multa, LARRAY3D, 1, attri_S )
      endif
      if ( Tr3d_ntr .gt. 0 ) then
         VMM_CREATE(trta, LARRAY3D, Tr3d_ntr, attrit_S)
      endif
*
 1000 format(
     +/,'INITIALIZATION OF DIGITAL FILTER COMDECKS (S/R SET_VTA)',
     +/,'=======================================================')
*
*     ---------------------------------------------------------------
*
      return
      end