I have a conditional in Python script from GRASS but I can not get it to work. No matter if I set m to 1 or 0 it always prints "m must be 1 or 0." like it won't enter the conditional.
Here's the script:
m=options['m']
if m==1:
grass.mapcalc("up=$c+tan($phy)*(($gamma*$z*(cos(slope)^2))-($k*$gamma*$z*sin(slope)*cos(slope))-($z*$gammaw))",
z = options['z'],
c = options['c'],
gamma = options['gamma'],
phy = options['phy'],
k = options['k'],
gammaw = 9.81)
print ('m is 1')
elif m==0:
grass.mapcalc("up=$c+tan($phy)*(($gamma*$z*(cos(slope)^2))-($k*$gamma*$z*sin(slope)*cos(slope)))",
z = options['z'],
c = options['c'],
gamma = options['gamma'],
phy = options['phy'],
k = options['k'])
print ('m is 0')
else:
print("m must be 1 or 0.")