subroutine crop_allocate(mb, mcrdb, meap, ms, nbyr)
integer, intent(in) :: mb, mcrdb, meap, ms, nbyr
allocate(aryld(mb, ms, mcrdb))
allocate(arylda(nbyr, mcrdb))
allocate(aryldc(mcrdb))
allocate(aryldrot(23, mcrdb))
allocate(arylds(ms, mcrdb))
allocate(avyld(mb, ms, mcrdb))
allocate(avylda(nbyr, mcrdb))
allocate(avyldc(mcrdb))
allocate(avyldrot(23, mcrdb))
allocate(avylds(ms, mcrdb))
allocate(be(mcrdb))
allocate(cnam(mcrdb)) ! crop name (4 letters)
allocate(cnyld(mcrdb))
allocate(cpyld(mcrdb))
allocate(cva(mb, meap))
allocate(fen(mfe))
allocate(feno(mfe))
allocate(fep(mfe))
allocate(fon(mb, meap, 2))
allocate(fop(mb, meap, 2))
allocate(hi(mcrdb))
allocate(hia(mb, meap))
allocate(hiad(mb, meap))
allocate(huharv(mb, meap))
allocate(hun(mcrdb))
allocate(iccup(mb, meap))
allocate(icnum(mcrdb))
allocate(idfe(mfe))
allocate(idop(mop))
allocate(igro(mb, meap))
allocate(ihydFert(mb * meap))
allocate(ihydRot(mb * meap))
allocate(ihydRotCrp(mb * meap))
allocate(iopc(mop))
allocate(irotup(mb, meap))
allocate(mgt_fen(mgt_tot, mop))
allocate(mgt_feno(mgt_tot, mop))
allocate(mgt_fep(mgt_tot, mop))
allocate(mgt_idfe(mgt_tot, mop))
allocate(mgt_idop(mgt_tot, mop))
allocate(mgt_iopc(mgt_tot, mop))
allocate(mgt_ncrp(mgt_tot, mop))
allocate(mgt_nop(mgt_tot))
allocate(nclc(mb, meap))
allocate(ncrp(mop))
allocate(nucr(mb, meap))
allocate(pt2(mcrdb))
allocate(rdmx(mcrdb))
allocate(rwt(mb, meap))
allocate(snup(mb, meap))
allocate(spup(mb, meap))
allocate(swh(mb, meap))
allocate(swp(mb, meap))
allocate(yld(mb, meap))
allocate(ylda(mb, ms))
allocate(mgt_id(mgt_tot))
allocate(mgt_lu_id(mgt_tot))
allocate(mgt_yr(mgt_tot))
aryld = 0.
arylda = 0.
arylda = 0.
aryldc = 0.
aryldrot = 0
arylds = 0.
avyld = 0.
avylda = 0.
avylda = 0.
avyldc = 0.
avyldrot = 0
avylds = 0.
be = 0.
cnyld = 0.
cnyld = 0.
cpyld = 0.
cpyld = 0.
cva = 0.
fen = 0.
feno = 0.
fep = 0.
fon = 0.
fop = 0.
hi = 0.
hia = 0.
hiad = 0.
huharv = 0.
hun = 0
iccup = 0
icnum = 0
idfe = 0
idop = 0
igro = 0
ihydRot = 0
ihydRot = 0
ihydRot = 0
iopc = 0
irotup = 0
mgt_fen = 0.
mgt_fen = 0.
mgt_feno = 0.
mgt_feno = 0.
mgt_fep = 0.
mgt_fep = 0.
mgt_idfe = 0
mgt_idfe = 0
mgt_idop = 0
mgt_idop = 0
mgt_iopc = 0
mgt_iopc = 0
mgt_ncrp = 0
mgt_ncrp = 0
mgt_nop = 0
nclc = 0
ncrp = 0
nucr = 0
pt2 = 0.
rdmx = 0.
rwt = 0.
snup = 0.
spup = 0.
swh = 0.
swp = 0.
yld = 0.
ylda = 0.
mgt_id = 0
mgt_lu_id = 0
mgt_yr = 0
end subroutine crop_allocate