!-------------------------------------- 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 --------------------------------------
#include "hybdim.cdk"
#include "glb_ld.cdk"
#include "glb_pil.cdk"
#include "hgc.cdk"
#include "grd.cdk"
#include "lam.cdk"
#include "hblen.cdk"
#include "tr3d.cdk"
#include "lun.cdk"
#include "out3.cdk"
#include "lctl.cdk"
#include "theo.cdk"
#include "geomg.cdk"
#include "step.cdk"
#include "pres.cdk"
#include "schm.cdk"
#include "adw.cdk"
#include "cstv.cdk"
#include "hzd.cdk"
#include "eigv.cdk"
#include "vspng.cdk"
#include "init.cdk"
#include "offc.cdk"
#include "bubble.cdk"
#include "mtn.cdk"
#include "zblen.cdk"
#include "vtopo.cdk"
*
      namelist /theo_cfgs/
     $     Theo_case_S, Theo_nivdist_S, 
     $     Out3_etik_S, Lctl_debug_L, Lam_runstrt_S

      namelist /bubble_cfgs/
     $     Grd_ni, Grd_nj, G_nk, Grd_nila, Grd_njla, 
     $     Grd_dx, Grd_dy, G_halox, G_haloy,
     $     Tr3d_userntr, Lam_ctebcs_L,Lam_nesdt,
     $     Hblen_x,Hblen_y,
     $     Step_total, Step_rsti, Step_gstat,
     $     Hyb, Grd_rcoef, Pres_ptop,
     $     Init_balgm_L, Init_dfwin_L, Init_dfnp, Init_dfpl_8, 
     $     Init_dftr_L, Offc_a0_8, Offc_a1_8, Offc_b0_8, Offc_b1_8,
     %     Schm_hydro_L, Schm_nonhy_8, 
     %     Schm_phyms_L, Schm_itcn, Schm_modcn, Schm_xwvt3,
     %     Schm_itnlh, Schm_itraj, Schm_hdlast_L,
     %     Schm_adcub_L, Schm_psadj_L,  Schm_difqp_L, Schm_sfix_L,
     %     Adw_nkbz_L, Adw_exdg_L, Adw_mono_L, Adw_interp_type_S,
     $     Adw_ckbd_L, Adw_halox, Adw_haloy, 
     $     Cstv_dt_8, Cstv_uvdf_8, Cstv_phidf_8, 
     $     Cstv_pitop_8, Cstv_pisrf_8, Cstv_tstr_8,
     $     Hzd_type_S, Hzd_pwr, Hzd_lnr, Hzd_uvwdt_L,
     $     Eigv_parity_L,
     $     Vspng_nk,Vspng_mf,Vspng_nutop,Vspng_uvwdt_L,Vspng_rwnd_L,
     $     bb_dpth,  bb_radius,  bb_xcntr,  bb_zcntr,
     $     bb_dpth2, bb_radius2, bb_xcntr2, bb_zcntr2,
     $     bb_isoth, Zblen_L, Zblen_spngthick, Zblen_spngtt_L,
     $     Vtopo_start, Vtopo_ndt, Out3_etik_S, Out3_flipit_L,Out3_closestep

      namelist /mtn_cfgs/
     $     Grd_ni, Grd_nj, G_nk, Grd_nila, Grd_njla, 
     $     Grd_dx, Grd_dy, G_halox, G_haloy,
     $     Tr3d_userntr, Lam_ctebcs_L,
     $     Hblen_x,Hblen_y,
     $     Step_total, Step_rsti, Step_gstat,
     $     Hyb, Grd_rcoef, Pres_ptop,
     $     Init_balgm_L, Init_dfwin_L, Init_dfnp, Init_dfpl_8, 
     $     Init_dftr_L, Offc_a0_8, Offc_a1_8, Offc_b0_8, Offc_b1_8,
     %     Schm_hydro_L, Schm_nonhy_8, 
     %     Schm_phyms_L, Schm_itcn, Schm_modcn, Schm_xwvt3,
     %     Schm_itnlh, Schm_itraj, Schm_hdlast_L,
     %     Schm_adcub_L, Schm_psadj_L,  Schm_difqp_L, Schm_sfix_L,
     %     Adw_nkbz_L, Adw_exdg_L, Adw_mono_L, Adw_interp_type_S,
     $     Adw_ckbd_L, Adw_halox, Adw_haloy, 
     $     Cstv_dt_8, Cstv_uvdf_8, Cstv_phidf_8, 
     $     Cstv_pitop_8, Cstv_pisrf_8, Cstv_tstr_8,
     $     Hzd_type_S, Hzd_pwr, Hzd_lnr, Hzd_uvwdt_L,
     $     Eigv_parity_L,
     $     Vspng_nk,Vspng_mf,Vspng_nutop,Vspng_uvwdt_L,Vspng_rwnd_L,
     $     mtn_tzero,mtn_nstar,mtn_flo,mtn_hwx,
     $     mtn_hwx1, mtn_hght, Zblen_L, Zblen_spngthick, Zblen_spngtt_L,
     $     Vtopo_start, Vtopo_ndt, Out3_etik_S,Out3_flipit_L,Out3_closestep