def _windcalc(self, first, totalmass, nsteps, niso, ypssurf, ypsinit,X_i, E_i, cycles):
if first == True:<EOL><INDENT>X_i = np.zeros([niso], float)<EOL>E_i = np.zeros([niso], float)<EOL>ypsinit = ypssurf[<NUM_LIT:0>]<EOL>for m in range(niso):<EOL><INDENT>for n in range(nsteps):<EOL><INDENT>X_i[m] = X_i[m] + ((totalmass[n] - totalmass[n+<NUM_LIT:1>]) *(<NUM_LIT:0.5> * (ypssurf[n][m] + ypssurf[n+<NUM_LIT:1>][m]) - ypsinit[m]))<EOL>E_i[m] = E_i[m] + ((totalmass[n] - totalmass[n+<NUM_LIT:1>]) *(<NUM_LIT:0.5> * (ypssurf[n][m] + ypssurf[n+<NUM_LIT:1>][m])))<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for m in range(niso):<EOL><INDENT>for n in range(nsteps):<EOL><INDENT>X_i[m] = X_i[m] + ((totalmass[n] - totalmass[n+<NUM_LIT:1>]) *(<NUM_LIT:0.5> * (ypssurf[n][m] + ypssurf[n+<NUM_LIT:1>][m]) - ypsinit[m]))<EOL>E_i[m] = E_i[m] + ((totalmass[n] - totalmass[n+<NUM_LIT:1>]) *(<NUM_LIT:0.5> * (ypssurf[n][m] + ypssurf[n+<NUM_LIT:1>][m])))<EOL><DEDENT><DEDENT><DEDENT>return X_i, E_i<EOL>
This function calculates the windyields and ejected masses as called from
windyields().  It uses a summation version of the formulae used in Hirschi
et al. 2005, "Yields of rotating stars at solar metallicity".

If it is the first file, the arrays need to be created and the initial
abundances set