subroutine soil_allocate(mb, meap)
integer, intent(in) :: mb, meap
allocate(abd(ms))
allocate(al(mb))
allocate(amp(mb))
allocate(ap(ml, ms))
allocate(avt(mb))
allocate(awc(ml, ms))
allocate(bd(ms))
allocate(bden(ml, ms))
allocate(cbn(ml, ms))
allocate(cla(ml, ms))
allocate(clay(1, ms))
allocate(cn2(mb, meap))
allocate(cv(mb))
allocate(ek(ms))
allocate(fc(ml, ms))
allocate(ffc(mb))
allocate(flate(mb, meap, ml))
allocate(hk(ml, ms))
allocate(hrtc(mb, meap, ml))
allocate(hum(ml, ms))
allocate(hwss(2, mb, meap))
allocate(ns(ms)) ! can be deleted if nslayers is fully implemented
allocate(nsa(ms))
allocate(nsolgr(ms))
allocate(op(ml, ms))
allocate(pmn(ml, ms))
allocate(poe(mb, meap, ml))
allocate(por(ml, ms))
allocate(poros(ml, ms))
allocate(psz(5, ms))
allocate(san(ml, ms))
allocate(sand(1, ms))
allocate(sc(ml, ms))
allocate(sccor(mb))
allocate(sil(ml, ms))
allocate(silt(1, ms))
allocate(smx(mb, meap))
allocate(snum(ms))
allocate(soil_filenames(msdb))
allocate(ste(mb, meap, ml))
allocate(stin(ml, ms))
allocate(sumfc(ms))
allocate(sumul(ms))
allocate(swin(ms))
allocate(tc(mb))
allocate(te(mb, meap, ml))
allocate(te0(mb, meap))
allocate(ul(ml, ms))
allocate(up(ml, ms))
allocate(wf(2, mb, meap))
allocate(wft(12, mb))
allocate(wi(12, mb))
allocate(wmn(ml, ms))
allocate(wn(ml, ms))
allocate(wno3(ml, ms))
allocate(wp(ml, ms))
allocate(wpo(ml, ms))
allocate(z(ml, ms))
allocate(cncor(mb))
cncor = 0.
abd = 0.
abd = 0.
al = 0.
amp = 0.
ap = 0.
avt = 0.
awc = 0.
bd = 0.
bden = 0.
cbn = 0.
cla = 0.
clay = 0.
cn2 = 0.
cv = 0.01
ek = 0.
fc = 0.
ffc = 0.
flate = 0.
flate = 0.
hk = 0.
hrtc = 0.
hrtc = 0.
hum = 0.
hwss = 0.
ns = 0
nsa = 0
nsolgr = 0
op = 0.
pmn = 0.
poe = 0.
por = 0.
poros = 0.
psz = 0.
psz = 0.
san = 0.
sand = 0.
sc = 0.
sccor = sccor0
sil = 0.
silt = 0.
smx = 0.
snum = 0
ste = 0.
ste = 0.
stin = 0.
sumfc = 0.
sumfc = 0.
sumul = 0.
sumul = 0.
swin = 0.
tc = 0.
te = 0.
te0 = 0.
ul = 0.
up = 0.
wf = 0.
wft = 0.
wi = 0.
wmn = 0.
wn = 0.
wno3 = 0.
wp = 0.
wpo = 0.
z = 0.
end subroutine soil_allocate