/[MITgcm]/MITgcm_contrib/darwinview/src/darwin.c
ViewVC logotype

Diff of /MITgcm_contrib/darwinview/src/darwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5 by marissa, Mon Jul 16 19:16:26 2007 UTC revision 1.6 by marissa, Tue Jul 24 16:53:55 2007 UTC
# Line 23  int win[MAX], ilev=1, howmany, sets, cou Line 23  int win[MAX], ilev=1, howmany, sets, cou
23  int xmax, ymax, yoffset=0, xoffset=0, yz=0;  int xmax, ymax, yoffset=0, xoffset=0, yz=0;
24  char initfns[MAX][MAX], fns[MAX][MAX][MAX];  char initfns[MAX][MAX], fns[MAX][MAX][MAX];
25    
26  void menu(int value){           // called when menu is opened on right click  void menu( int value ){           // called when menu is opened on right click
27    
28   switch( value ){   switch( value ){
29    case 1: usr=glo=0;            // unset glo & usr, sets local max/min    case 1: usr=glo=0;            // unset glo & usr, sets local max/min
# Line 149  void display(){                 // calle Line 149  void display(){                 // calle
149    bitmap( str, xmax+2, 1 );    bitmap( str, xmax+2, 1 );
150    
151    if( xz )    if( xz )
152     sprintf( str, "Y-coordinate=%d", yoffset+1);     sprintf( str, "N-S slice %d", yoffset+1);
153    else{    else{
154     if( yz )     if( yz )
155      sprintf( str, "X-coordinate=%d", xoffset+1);      sprintf( str, "E-W slice %d", xoffset+1);
156     else     else
157      sprintf( str, "Level %d", ilev ); // labels current level      sprintf( str, "Level %d", ilev ); // labels current level
158    }    }
# Line 382  void readjet(){               //reads in Line 382  void readjet(){               //reads in
382   FILE* fp;   FILE* fp;
383   int i, j;   int i, j;
384        
385   fp=fopen( "jet.dat", "r" );  // opens file containing values   fp=fopen( ".darwinview/jet.h", "r" );  // opens file containing values
386   for( i=0; i<64; i++ )        // reads in 64 sets of r, g, b values   for( i=0; i<64; i++ )        // reads in 64 sets of r, g, b values
387    for( j=0; j<3; j++ )    for( j=0; j<3; j++ )
388     fscanf( fp, "%f", &jet[i][j] );     fscanf( fp, "%f", &jet[i][j] );
# Line 470  void do_byteswap_f32( float arr[], int n Line 470  void do_byteswap_f32( float arr[], int n
470   }   }
471  }  }
472    
473  void black(){  void black( ){
474   glClear( GL_COLOR_BUFFER_BIT );   glClear( GL_COLOR_BUFFER_BIT );
475   glutSwapBuffers();   glutSwapBuffers();
476   glFlush();   glFlush();
477  }  }
478    
479    
480  int main( int argc, char *argv[] ){  int main( int argc, char *argv[] ){
481   int i, setsx, setsy, tmpx, tmpy, winx, winy, parent;   int i, setsx, setsy, tmpx, tmpy, winx, winy, parent;
482   char filename[MAX];   char str[MAX], filename[MAX];
483     FILE* fp;
484    
485     if( strcmp(argv[1], "binary") == 0 )
486      fp=fopen( ".darwinview/binconfig", "r" );
487     else
488      if( strcmp(argv[1],"netcdf") == 0 )
489       fp=fopen( ".darwinview/ncconfig", "r" );
490    
491   sscanf( argv[1], "%dx%d", &winx, &winy );  // reads screen resolution from command line   fscanf( fp, "%dx%d ", &winx, &winy );
492   winy-=60;  winx-=20;                     // adjusts resolution so edges won't get cut off               winy-=60;  winx-=20;                     // adjusts resolution so edges won't get cut off            
493     fscanf( fp, "%d %d %d ", &NX, &NY, &NZ );
494   printf( "Please enter x, y and z dimensions.\n" );     fscanf( fp, "%dx%d ", &setsx, &setsy );                // prompts user for dimensions of subwindows
495   scanf( "%d %d %d", &NX, &NY, &NZ );           // prompts user for NX, NY, NZ   fscanf( fp, "%s", filename );
496   printf( "Please enter filename.\n" );  
497   scanf( "%s", filename );                         // prompts user for initial filenames   fclose( fp );
  printf( "Please enter dimensions of data sets.\n" );  
  scanf( "%dx%d", &setsx, &setsy );                 // prompts user for dimensions of subwindows  
498    
499   xmax=NX; ymax=NY;   xmax=NX; ymax=NY;
500    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22