source: trunk/crs97/molcodes.c @ 1

Last change on this file since 1 was 1, checked in by cbipsl, 18 years ago

Geisa inital import

File size: 1.3 KB
Line 
1#include <stdio.h>
2#define NMBNAME "/usr/local/datageisa/crs97/nmb.dat"
3#define NMBLINES 108
4void molcodes_(void)
5{
6static char tpchar[NMBLINES][17]; /* room for max=15 + LF + 0 */
7register FILE *fp;
8register int i;
9/* type Molecules */
10struct molecules
11{
12char name[10];
13int mcode; /* code of molecule */
14int ntp; /* n of datasets */
15int n1[4]; /* from */
16int n2[4]; /* to */
17};
18/* type (Molecules) ListofMol(30) */
19/* common /Reg4/ Wvmin,Wvmax */
20/* common /Reg7/ Lepremier,NumSel,NbofMol */
21/* common /Reg9/ ListofMol */ 
22extern struct reg4 {float wvmin,wvmax;};
23extern struct reg4 reg4_;
24extern struct reg7 {float lepremier;int numsel,nbofmol;};
25extern struct reg7 reg7_;
26extern struct reg9 {struct molecules listofmol[30];};
27extern struct reg9 reg9_;
28
29fp=fopen(NMBNAME,"r");
30i=0; while(fseek(fp,5,SEEK_CUR),fgets(tpchar[i],17,fp))
31{
32/* tpchar[i][strlen(tpchar[i])-2]=0; erase last & LF */
33tpchar[i][strlen(tpchar[i])-1]=0; /* erase LF */
34tpchar[i][14]=0; /* erase 15th */
35i++;
36}
37
38printf("%9.3f %9.3f\n",reg4_.wvmin,reg4_.wvmax);
39for(i=0;i<reg7_.nbofmol-1;i++)
40{
41register int j,k;
42if(!strncmp(reg9_.listofmol[i].name,"all",3)) continue;
43printf(" %s %d",reg9_.listofmol[i].name,reg9_.listofmol[i].mcode);
44for(j=0;j<reg9_.listofmol[i].ntp;j++)
45for(k=reg9_.listofmol[i].n1[j]-1;k<reg9_.listofmol[i].n2[j];k++)
46printf(" %-15s",tpchar[k]); printf("\n");
47}
48}
Note: See TracBrowser for help on using the repository browser.