OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
afrt_nc4.cpp
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * NAME: afrt_nc4.cpp
4 *
5 * DESCRIPTION: Source file to run Ahmad Frazier Radiative Transfer calculation
6 *
7 * REFERENCES:
8 *
9 * REVISION HISTORY:
10 * DATE: PR# AUTHOR Description
11 * -------- ------ -------- -----------------
12 * 05-02-2018 S. Anderson
13 *
14 * NOTES (MISCELLANEOUS) SECTION:
15 * none
16 *
17 **************************************************************************/
18 
19 #include <genutils.h>
20 #include <AfrtOptions.h>
21 #include <AfrtProcess.h>
22 #include <afrt_input.h>
23 
24 //-----------------------------------------------------------------------------
25 //
26 // Main Function
27 //
28 //-----------------------------------------------------------------------------
29 
30 int main(int argc, char* argv[])
31 {
32  int status = 0;
33 
36 
37  //char softwareVersion[200];
38  //sprintf(softwareVersion, "%d.%d.%d-r%d", L3MAPGEN_VERSION_MAJOR, L3MAPGEN_VERSION_MINOR,
39  // L3MAPGEN_VERSION_PATCH_LEVEL, SVN_REVISION);
40  afrt_init_options(list, "2.1");
41  if(argc == 1) {
43  exit(1);
44  }
45  afrt_read_options(list, argc, argv);
46 
47  if(clo_getBool(list, "verbose"))
48  want_verbose = 1;
49  else
50  want_verbose = 0;
51 
52  AfrtProcessNC4* generator = new AfrtProcessNC4();
53  generator->setHistory(afrt_get_history(argc, argv));
54 
55  status = generator->initialize();
56 
57  if ( status != RT_SUCCESS ) {
58  std::cerr << "ERROR!!! Initialization failure." << std::endl;
59  return(status);
60  }
61 
62 #ifdef WITH_MPI
63  status = generator->process_mpi();
64 #else
65  status = generator->process();
66 #endif
67 
68  if ( status != RT_SUCCESS ) {
69  std::cerr << "ERROR!!! Process failure." << std::endl;
70  return(status);
71  }
72 
73  delete generator;
74 
75  if ( status != RT_SUCCESS ) {
76  std::cerr << "WARNING!!! RT tables NOT created" << std::endl;
77  } else {
78  std::cerr << "RT2 NetCDF4 tables created: " << std::endl;
79  }
80 
81  return(status);
82 }
83 
int status
Definition: l1_czcs_hdf.c:32
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
Definition: CMakeLists.txt:7
void clo_setEnablePositionOptions(int val)
Definition: clo.c:1685
clo_optionList_t * clo_createList()
Definition: clo.c:532
void clo_printUsage(clo_optionList_t *list)
Definition: clo.c:1988
const int RT_SUCCESS
Definition: AfrtConstants.h:34
int want_verbose
void afrt_read_options(clo_optionList_t *list, int argc, char *argv[])
Definition: afrt_input.cpp:54
void afrt_init_options(clo_optionList_t *list, const char *softwareVersion)
Definition: afrt_input.cpp:20
string afrt_get_history(int argc, char *argv[])
int main(int argc, char *argv[])
Definition: afrt_nc4.cpp:30
int clo_getBool(clo_optionList_t *list, const char *key)
Definition: clo.c:1375
void setHistory(std::string history)
Definition: AfrtProcess.h:516