!-------------------------------------- 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 --------------------------------------
#if defined (DOC)
*
*revisions
* v2_10 - Lee V.                 - added MAXBUS
* v2_20 - Pellerin P.            - added geobus,entry bus
* v3_12 - Bilodeau B.            - 16-character names
* v3_30 - Bilodeau B.            - mosaic
*
***comdeck p_bus.cdk
*
*______________________________________________________________________
*                                                                      |
*  VARIABLES ASSOCIATED WITH THE SIZES OF PHYSICS BUSES (p_config)     |
*______________________________________________________________________|
*                    |                                                 |
* NAME               | DESCRIPTION                                     |
*--------------------|-------------------------------------------------|
* MAXBUS             | maximum number of elements allowed in a bus     |
* p_bdyn_top         | number of variables in the dynamic bus          |
* p_bdyn_siz         | memory size (words) of the dynamic bus          |
* p_bper_top         | number of variables in the permanent bus        |
* p_bper_siz         | memory size (words) of the permanent bus        |
* p_bvol_top         | number of variables in the volatile  bus        |
* p_bvol_siz         | memory size (words) of the volatile  bus        |
* p_bphy_top         | total amount of different variables from physic |
* p_bent_top         | number of variables in the entry     bus        |
* p_bent_siz         | memory size (words) of the entry     bus        |
* p_bgeo_top         | number of variables in the geo       bus        |
* p_bgeo_siz         | memory size (words) of the geo       bus        |
* p_nslice           | number of physics slices (set in p_busper)      |
* Phy_useit          | vector to indicate whether the physics variable |
*                    | from the physics buses would be outputted       |
* Phy_xnbits         | vector to indicate whether the physics variable |
*                    | requires a different compaction other than the  |
*----------------------------------------------------------------------
*       
*
#endif
      integer MAXBUS
      parameter (MAXBUS = 1000)
      integer p_bdyn_top,p_bper_top,p_bvol_top,p_bent_top,
     $        p_bdyn_siz,p_bper_siz,p_bvol_siz,p_bent_siz,
     $        p_bphy_top,p_nmp,p_ni,p_nj,p_offi,p_offj,
     $        p_bdyn_out,p_bper_out,p_bvol_out,p_bent_out,
     $        p_bent_idx(maxbus),p_bper_idx(maxbus),
     $        p_bdyn_idx(maxbus),p_bvol_idx(maxbus)
      integer entpar(maxbus,8),dynpar(maxbus,8),
     $        perpar(maxbus,8),volpar(maxbus,8)
      common / p_bus / 
     $        p_bdyn_top,p_bper_top,p_bvol_top,p_bent_top,
     $        p_bdyn_siz,p_bper_siz,p_bvol_siz,p_bent_siz,
     $        p_bphy_top,p_nmp,p_ni,p_nj,p_offi,p_offj,
     $        p_bdyn_out,p_bper_out,p_bvol_out,p_bent_out,
     $        entpar,dynpar,perpar,volpar,
     $        p_bent_idx,p_bper_idx,
     $        p_bdyn_idx,p_bvol_idx
*
      character*1  p_outbus_s(maxbus)
      character*16  entnm(maxbus),dynnm(maxbus),
     $              pernm(maxbus),volnm(maxbus)
      character*8   enton(maxbus),dynon(maxbus),
     $              peron(maxbus),volon(maxbus)
      character*60  entdc(maxbus),dyndc(maxbus),
     $              perdc(maxbus),voldc(maxbus)
      common /busdync/ entnm, dynnm, pernm, volnm, 
     $                 entdc, dyndc, perdc, voldc,
     $                 enton, dynon, peron, volon,p_outbus_s
*
      real, dimension(:), pointer :: Phy_busper3D, Phy_busper3D_digf
      common/ Phy_busper /   Phy_busper3D, Phy_busper3D_digf
*
      integer MAXGEO
      parameter (MAXGEO=1000)
*
      character*16 geonm(MAXGEO,6)
      common /busgeoc/ geonm
*
      integer p_bgeo_top,p_bgeo_siz,geopar(MAXGEO,3)
      common /busgeoi/ p_bgeo_top,p_bgeo_siz,geopar
*
      real, dimension(:), pointer ::  geobus, geofld
      common /busgeor/ geobus, geofld