code: def write_grid_tpl(self,name,tpl_file,zn_array):
          
          parnme,x,y = [],[],[]
          with open(os.path.join(self.m.model_ws,tpl_file),'w') as f:
              f.write("ptf ~\n")
              for i in range(self.m.nrow):
                  for j in range(self.m.ncol):
                      if zn_array[i,j] < 1:
                          pname = ' 1.0 '
                      else:
                          pname = "{0}{1:03d}{2:03d}".format(name,i,j)
                          if len(pname) > 12:
                              self.logger.lraise("grid pname too long:{0}".\
                                                 format(pname))
                          parnme.append(pname)
                          pname = ' ~     {0}   ~ '.format(pname)
                          x.append(self.m.sr.xcentergrid[i,j])
                          y.append(self.m.sr.ycentergrid[i,j])
                      f.write(pname)
                  f.write("\n")
          df = pd.DataFrame({"parnme":parnme,"x":x,"y":y},index=parnme)
          df.loc[:,"pargp"] = "{0}{1}".format(self.gr_suffix.replace('_',''),name)
          df.loc[:,"tpl"] = tpl_file
          return df
docs: write a template file a for grid-based multiplier parameters
  
          Parameters
          ----------
          name : str
              the base parameter name
          tpl_file : str
              the template file to write
          zn_array : numpy.ndarray
              an array used to skip inactive cells
  
          Returns
          -------
          df : pandas.DataFrame
              a dataframe with parameter information