contrib/natgrid/Src/natgridmodule.c
void write_float(int size, char *title, FILE *fp, float *data)
{

  int n;               /* data counter */
  int line;            /* counter to insert a line after each six numbers */
  float *d;            /* pointer to increment through data */

  d = data;
  line = 0;

  fprintf(fp, "\n%s\n", title);

  for(n=0; n<size; n++) {
    fprintf(fp, "%10.3e", *d);
    d++;
    line++;

    if(line == 8) {          /* add newline after writing 8 numbers */
      fprintf(fp, "\n");
      line = 0;
    }
  }
}
/********************************************************************************
* Function:   write_float.c
*
*  Procedure: Uses 10.3e format to write 6 numbers per line
*  Purpose:   write ascii data for one horizontal field or one cross section
*
*  Passed:    Data, pointer to start of data
********************************************************************************/
write_float.c
Procedure: Uses 10.3e format to write 6 numbers per line
Purpose:   write ascii data for one horizontal field or one cross section

Data, pointer to start of data
write_float . c Procedure : Uses 10 . 3e format to write 6 numbers per line Purpose : write ascii data for one horizontal field or one cross section Data pointer to start of data
void write_float(int size, char *title, FILE *fp, float *data)
{
  int n;               
  int line;            
  float *d;            
  d = data;
  line = 0;
  fprintf(fp, "\n%s\n", title);
  for(n=0; n<size; n++) {
    fprintf(fp, "%10.3e", *d);
    d++;
    line++;
    if(line == 8) {          
      fprintf(fp, "\n");
      line = 0;
    }
  }
}
void write_float ( int size , char * title , FILE * fp , float * data ) { int n ; int line ; float * d ; d = data ; line = 0 ; fprintf ( fp , " \n \n " , title ) ; for ( n = 0 ; n < size ; n ++ ) { fprintf ( fp , " " , * d ) ; d ++ ; line ++ ; if ( line == 8 ) { fprintf ( fp , " \n " ) ; line = 0 ; } } }
Function:   write_float.c
Procedure: Uses 10.3e format to write 6 numbers per line
Purpose:   write ascii data for one horizontal field or one cross section
Function : write_float . c Procedure : Uses 10 . 3e format to write 6 numbers per line Purpose : write ascii data for one horizontal field or one cross section
/* data counter */ /* counter to insert a line after each six numbers */ /* pointer to increment through data */ /* add newline after writing 8 numbers */