source: lmdz_wrf/WRFV3/tools/gen_model_data_ord.c @ 1

Last change on this file since 1 was 1, checked in by lfita, 10 years ago
  • -- --- Opening of the WRF+LMDZ coupling repository --- -- -

WRF: version v3.3
LMDZ: version v1818

More details in:

File size: 1.0 KB
Line 
1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#ifndef _WIN32
5# include <strings.h>
6#endif
7
8#include "protos.h"
9#include "registry.h"
10#include "data.h"
11
12int
13gen_model_data_ord ( char * dirname )
14{
15  FILE * fp ;
16  char  fname[NAMELEN] ;
17  char * fn = "model_data_order.inc" ;
18  int i ;
19
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++ )
27  {
28    switch ( model_order[i] )
29    {
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 ;
34    }
35  }
36  fprintf(fp,"\n") ;
37  close_the_file( fp ) ;
38  return(0) ;
39}
40
Note: See TracBrowser for help on using the repository browser.