module var 
    use const
implicit real*8 (a-h,o-z)

    ! double precision sevp ellipti! solver arrays
    real*8 rinv,rinv1,dum0,dum1,dum2,dumg,x,h,rho
    real*8 cgr,cgrh,cgp,cgv,cgs,cgt,cgph,cgsh
    real*8 a,t1,s1
    ! real*8 al,ar,ab,at,ac,cl,cb,cc,cr,ct,s
    ! lower precision logical depth and masking arrays
    integer*2 kb,iu0,iv0,in,iu,iv,iw
    integer*2 ibred
    
    integer*2 infx,infy
    integer n360,nyr,itf,itff,it0,itfday,nocn
    integer nopt
    integer nld
  
    ! "a" grid arrays
    common/bglo/rho(i0,j0,k1),px(i0,j0),py(i0,j0), &
    u1(i0,j0,k1),u2(i0,j0,k1),v1(i0,j0,k1),v2(i0,j0,k1), &
    s1(i0,j0,k1),s2(i0,j0,k1),t1(i0,j0,k1),t2(i0,j0,k1), &
    p0(i0,j0),p(i0,j0,k1),ulf(i0,j0,k1),vlf(i0,j0,k1),slf(i0,j0,k1), &
    tlf(i0,j0,k1),ev(i2,j2,k2),hv(i2,j2,k2),f(j2), &
    tanphi(j2),sumin(k1),c1(i0,j0,k1),c2(i0,j0,k1),clf(i0,j0,k1)

    real*8 westdeg

    ! logical depth kb and associated masking arrays
    common/bathyglo/kb(i0,j0),iu0(0:i01,j0),iv0(i0,0:j0), &
    in(i0,j0,k1),iu(0:i01,j0,k1),iv(i0,0:j0,k1),iw(i0,j0,k0)

    !c-grid arrays
    common/cgridglo/u(i0,j0,k1),v(i0,j0,k1),w(i0,j0,k0)
    common/tavgglo/pbar(i0,j0),pvar(i0,j0),xbar(i0,j0),sbar(i0,j0,k1), &
    tbar(i0,j0,k1),ucli(i0,j0),vcli(i0,j0),rmsv(i0,j0)
    common/klimatglo/fnew,fold,new,nld
    ! user-defined scalar control parameters
    common/controglo/evap,qsum,olde,oldq, &
    dt,tlz,b,g,dm0,de0,dmz0,rzmx,drag,fltw,av,avn,navg,daodt, &
    taudt,taudtn,ktrm,mvi,mxit,isav, &
    mxsav,lrstrt,lopen,lturb,lwind,lheat,lsol,lmovi,lfsrf,lsolver, &
    rawf,lprecon

    common/metricglo/a(k1),y(j0),yv(j0),yvdeg(j0),ydeg(j0),xdeg(i0), &
    cs(j0),csv(j1),ocs(j0),ocsv(j1),dx(j0),dxv(j1),odx(j0),odxv(j1), &
    dy(j0),dyv(j1),ody(j0),odyv(j1)

    ! derived scalars
    common/scaglo/ odt,prn,days,orzmx,ofltw,watts,n360,nyr,itf,it0,itfday,nocn

    ! scratch arrays
    common/scratchglo/scr(i0,j0,k0+1)

    ! sevp elliptic solver arrays
    ! sevp subregion boundary array "ie" is a user-defined array

    common/sevp/rinv(ibir,i0,nbg0),rinv1(ibir,i0,nbg1),dum0(i0,nb0), &
    dum1(ibir),dum2(i0),dumg(i2t),x(i0,j0),al(i2,j2),ab(i2,j2), &
    ac(i2,j2),ar(i2,j2),at(i2,0:j2),s(i2,j2),ie(nb0), &
    cl(i2,j2),cb(i2,j2),cc(i2,j2),cr(i2,j2),ct(i2,j2)
    common/bicg/cgr(i0,j0),cgrh(i0,j0),cgp(i0,j0),cgv(i0,j0),cgs(i0,j0),cgt(i0,j0),cgph(i0,j0),cgsh(i0,j0)

    ! vertical grid arrays
    ! "z" array contains cell center and interface depths
    common/zfsglo/z(k0+k1),odz(k1),odzw(k0)
    
    common/bred/lbred,ibred(i2,j2),bf1,bf2,bflf

    character grd*7,filename*16
    common/grdglo/grd

    common/fullopt/nopt,wopt

    common/filterglo/ dmx(i0,j0,k1),dmy(i0,j0,k1),infx(i0,j0,k1),infy(i0,j0,k1)

    dimension ule(i0,j0,k1),vle(i0,j0,k1),tle(i0,j0,k1),sle(i0,j0,k1),ple(i0,j0,k1),wle(i0,j0,k1),pot(i0,j0,k1)

    real*8 dtmp,dsum
    real*8 timer
    integer ijlo(2),ijhi(2)
    common/timer/timer(10)

    common/nudging/hmean_nudge(i0,j0,k0),t_nudge(i0,j0),s_nudge(i0,j0)

    character sys1*30,sys2*22

    integer ::   lbred=0

    !climate data for winter
    common/climatglo/tnudge(i2,j2),qavg(i2,j2,12),tclis(i0,j0,k1,12),sclis(i0,j0,k1,12),nsombo(12),tclim(i0,j0,k1),sclim(i0,j0,k1)
    
    character case*5,dscrib*63

    common/title/case,dscrib
    common/windsglo/taux(i2,j2,12),tauy(i2,j2,12)
    common/windmxglo/vbk(k2),hbk(k2)
    common/xymeansglo/sxy(k1),txy(k1),sxycli(k1,12),txycli(k1,12)
    common/tauglo/add(i2,j2,k2)

    common/blank/xp(0:i0,j0),yp(i0,0:j0),pe(2,j0),ype(i0,2),qprof(k1),dhx(i1,j0),dhy(i0,j1),plf(i0,j0,k1)

    common/flxglo/ ux(i1,j2),uy(i2,j1),uz(i2,j2,2),vx(i1,j2),vy(i2,j1),vz(i2,j2,2),sx(i1,j2),sy(i2,j1),sz(i2,j2,2),&
                  tx(i1,j2),ty(i2,j1),tz(i2,j2,2),cfcx(i1,j2),cfcy(i2,j1),cfcz(i2,j2,2)



end module
