adding spinup to detect_fit_level2.m
[wrffire.git] / wrfv2_fire / tools / gen_model_data_ord.c
blob85b35b81a42dce45311fbe45348f6f3b9c7062ac
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #ifndef _WIN32
5 # include <strings.h>
6 #endif
8 #include "protos.h"
9 #include "registry.h"
10 #include "data.h"
12 int
13 gen_model_data_ord ( char * dirname )
15 FILE * fp ;
16 char fname[NAMELEN] ;
17 char * fn = "model_data_order.inc" ;
18 int i ;
20 if ( dirname == NULL ) return(1) ;
21 if ( strlen(dirname) > 0 ) { sprintf(fname,"%s/%s",dirname,fn) ; }
22 else { sprintf(fname,"%s",fn) ; }
23 if ((fp = fopen( fname , "w" )) == NULL ) return(1) ;
24 print_warning(fp,fname) ;
25 fprintf(fp,"INTEGER , PARAMETER :: model_data_order = DATA_ORDER_") ;
26 for ( i = 0 ; i < 3 ; i++ )
28 switch ( model_order[i] )
30 case ( COORD_X ) : fprintf(fp,"X") ; break ;
31 case ( COORD_Y ) : fprintf(fp,"Y") ; break ;
32 case ( COORD_Z ) : fprintf(fp,"Z") ; break ;
33 default : fprintf(stderr,"Model data order ambiguous. Is there a dimspec for all three coordinate axes?\n") ; break ;
36 fprintf(fp,"\n") ;
37 close_the_file( fp ) ;
38 return(0) ;