-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.c
56 lines (48 loc) · 1.58 KB
/
map.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* map.c
*
* routines to output XPLOR MAPS
*
*/
/*
* copyright 1993,1994,1995 Robert W. Harrison
*
* This notice may not be removed
* This program may be copied for scientific use
* It may not be sold for profit without explicit
* permission of the author(s) who retain any
* commercial rights including the right to modify
* this notice
*/
/* do the map */
int dump_xmap( where,what,xmin,xmax,ymin,ymax,zmin,zmax,nx,ny,nz)
FILE *where;
float (*what)[];
float xmin,xmax,ymin,ymax,zmin,xmax;
int nx,ny,nz;
{
int irow;
int imin,imax,jmin,jmax,kmin,kmax;
imin = 0; imax = nx;
jmin = 0; jmax = ny;
kmin = 0; kmax = nz;
/* write the header */
fprintf(where,"\n 2 !NTITLE\nREMARKS AMMP xplor map \nREMARKS \n");
fprintf(where,"%8i%8i%8i%8i%8i%8i%8i%8i%8i\n",
nx,imin,imax,ny,jmin,jmax,nz,kmin,kmax);
fprintf(where,"%12.5e%12.5e%12.5e%12.5e%12.5e%12.5e\nZXY",
xmax-xmin,ymax-ymin,zmax-zmin,90.,90.,90.);
/* now do the work we loop with z outer then x then y
* and fake a FORTRAN implied do */
for( k=0; k<= nz; k++)
{
fprintf(where,"\n%8d\n",k);
irow = 0;
for( j=0; j<= ny; j++)
for( i=0; i<= nx; i++)
{
if(irow ==6) {fprintf(where,"\n"); irow = 0;}
fprintf(where,"%12.5e",(*what)[]);
irow ++;
}}
dscf_map_setup(0==1);
}/* end of routine */