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

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

  d = data;
  line = 0;

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

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

    if(line == 4) {          /* add newline after writing 8 numbers */
      fprintf(fp, "\n");
      line = 0;
    }
  }
}
/********************************************************************************
* Function:   write_double.c
*
*  Procedure: Uses 21.15lf format to write 4 numbers per line
*  Purpose:   write ascii data for one horizontal field or one cross section
*
*  Passed:    data,  pointer to start of data
*             size,  length of data
*             title, label
*             fp,    file pointer
********************************************************************************/
write_double.c
Procedure: Uses 21.15lf format to write 4 numbers per line
Purpose:   write ascii data for one horizontal field or one cross section

data,  pointer to start of data
size,  length of data
title, label
fp,    file pointer
write_double . c Procedure : Uses 21 . 15lf format to write 4 numbers per line Purpose : write ascii data for one horizontal field or one cross section data pointer to start of data size length of data title label fp file pointer
void write_double(int size, char *title, FILE *fp, double *data)
{
  int n;               
  int line;            
  double *d;           
  d = data;
  line = 0;
  fprintf(fp, "\n%s\n", title);
  for(n=0; n<size; n++) {
    fprintf(fp, "%21.15lf", *d);
    d++;
    line++;
    if(line == 4) {          
      fprintf(fp, "\n");
      line = 0;
    }
  }
}
void write_double ( int size , char * title , FILE * fp , double * data ) { int n ; int line ; double * d ; d = data ; line = 0 ; fprintf ( fp , " \n \n " , title ) ; for ( n = 0 ; n < size ; n ++ ) { fprintf ( fp , " " , * d ) ; d ++ ; line ++ ; if ( line == 4 ) { fprintf ( fp , " \n " ) ; line = 0 ; } } }
Function:   write_double.c
Procedure: Uses 21.15lf format to write 4 numbers per line
Purpose:   write ascii data for one horizontal field or one cross section
Function : write_double . c Procedure : Uses 21 . 15lf format to write 4 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 */