-
Notifications
You must be signed in to change notification settings - Fork 0
/
getdir_defl.c
75 lines (65 loc) · 2.63 KB
/
getdir_defl.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// %P%
// ----- constants ---------------------------------------------------
static const char SCCSID[]="$Id: getdir_defl.c 108234 2019-02-28 14:22:09Z bruce.tran $ 20$Date: 2010/02/22 14:29:39 $ NGS";
// ----- standard library --------------------------------------------
#include <stdio.h>
#include <string.h>
// ----- classes, structs, types -------------------------------------
// ----- functions ---------------------------------------------------
#include "getdir_defl.h"
int getdir_defl(int imodel, char* dirnam) {
/*******************************************************************************
* For PC network system, returns the directory location
* where vertical deflection binary model grid files are located.
* in - imodel : user selected geoid model int
* in - dirnam : char vector, empty character*256
* out- dirnam : char vector, filled
*******************************************************************************/
#ifdef NGS_PC_ENV
strncpy(dirnam, "\0", 256);
printf("\n\
What is the **FULL** directory name (including trailing slashes) \n\
where the vertical deflection (*.bin) files may be found? \n\
(Unix Example: /export/home/deflec12/) \n\
(PC Example: C:\\DEFLEC12\\) \n\
Hit <RETURN> to default to this directory \n\
-> ");
fgets(dirnam, 256, stdin);
#else
/*******************************************************************************
* For the NGS unix network system, returns the directory location
* where geoid binary model grid files are located.
* in - imodel : user selected geoid model int
* in - dirnam : char vector, empty character*256 dirnam
* out- dirnam : char vector, filled
*******************************************************************************/
switch (imodel) {
case 1:
strcpy(dirnam, "/ngslib/data/Deflec/Deflec99/");
break;
case 2:
strcpy(dirnam, "/ngslib/data/Deflec/Usdov2009/Format_unix/");
break;
case 3:
strcpy(dirnam, "/ngslib/data/Deflec/Deflec09/Format_unix/");
break;
case 4:
strcpy(dirnam, "/ngslib/data/Deflec/Usdov2012/Format_unix/");
break;
case 5:
strcpy(dirnam, "/ngslib/data/Deflec/Deflec12A/Format_unix/");
break;
case 6:
strcpy(dirnam, "/ngslib/data/Deflec/Deflec12B/Format_unix/");
break;
case 7:
strcpy(dirnam, "/ngslib/data/Deflec/Deflec18/Format_unix/");
break;
default:
fprintf(stderr, "ERROR: in file getdir_deflux, invalid option %d\n",
imodel);
break;
}//~switch
#endif
return(0);
}//~getdir_deflpc