Based on Monte Carlo simulation we study the coercivity of iron nanowire deposited in chemically widened anodic aluminum oxide films. The coercivity is found to depend on the diameter and aspect ratio of the nanowire, and it decreases with increasing nanowire diameter, which is consistent with the experimental result. Two kinds of discretization cells regular global-shaped and regular cubic-shaped are used as minimum element. The simulation result reveals that the regular global-shaped discretization cell allows for more accurate calculated result while comparing to the experimental result than the cubic-shaped discretization cell does. The simulated coercivity as a function of temperature with different diameters shows that the data can be described well by the T-c power-law, and the diameter dependence of the exponent c displays a maximum peak.