def write_LEAFS_model(self,nzn=<NUM_LIT>,dr=<NUM_LIT>,<EOL>rhostrip=<NUM_LIT>):
from scipy import interpolate<EOL>ye = self.get('<STR_LIT>')<EOL>newye=[]<EOL>rho = <NUM_LIT>**self.get('<STR_LIT>')[::-<NUM_LIT:1>] <EOL>idx = np.abs(rho - rhostrip).argmin() + <NUM_LIT:1><EOL>rho = rho[:idx]<EOL>rhoc = rho[<NUM_LIT:0>]<EOL>rad  = <NUM_LIT>**self.get('<STR_LIT>') * ast.rsun_cm<EOL>rad = rad[::-<NUM_LIT:1>][:idx]<EOL>ye = ye[::-<NUM_LIT:1>][:idx]<EOL>print('<STR_LIT>',old_div(rad[-<NUM_LIT:1>], dr), '<STR_LIT>')<EOL>rad = np.insert(rad,<NUM_LIT:0>,<NUM_LIT:0>)<EOL>ye  = np.insert(ye,<NUM_LIT:0>,ye[<NUM_LIT:0>])<EOL>rho = np.insert(rho,<NUM_LIT:0>,rho[<NUM_LIT:0>])<EOL>print(rad)<EOL>fye  = interpolate.interp1d(rad,ye)<EOL>frho = interpolate.interp1d(rad,rho)<EOL>newye = []<EOL>newrho = []<EOL>newrad = []<EOL>Tc   = <NUM_LIT>**self.get('<STR_LIT>')[-<NUM_LIT:1>]<EOL>for i in range(nzn):<EOL><INDENT>if i * dr > rad[-<NUM_LIT:1>]: break<EOL>newye.append(fye( i * dr ))<EOL>newrho.append(frho( i * dr ))<EOL>newrad.append( i * dr )<EOL><DEDENT>f = open('<STR_LIT>','<STR_LIT:w>')<EOL>f.write(str(Tc)+'<STR_LIT>')<EOL>f.write(str(rhoc)+'<STR_LIT>')<EOL>for i in range(len(newye)):<EOL><INDENT>f.write(str(i+<NUM_LIT:1>)+'<STR_LIT:U+0020>'+str(newrad[i])+'<STR_LIT:U+0020>'+str(newrho[i])+'<STR_LIT:U+0020>'+str(newye[i])+'<STR_LIT>')<EOL><DEDENT>f.close()<EOL>
write an ascii file that will be read by Sam's version of
inimod.F90 in order to make an initial model for LEAFS