Skip to content

Commit

Permalink
move definitions into header file
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Jun 3, 2021
1 parent 2c7c1f1 commit 6778a1c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 54 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CXXLD = $(F77)
lib_LTLIBRARIES = libsme.la
libsme_la_SOURCES = \
src/sme/platform.h \
src/sme/sme_synth_faster.h \
src/sme/sme_synth_faster.cpp \
src/eos/eos.f \
src/eos/eos_eqns.f \
Expand Down
55 changes: 1 addition & 54 deletions src/sme/sme_synth_faster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,10 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "export.h"
#include <ctype.h>
#include <time.h>
#include "platform.h"

/* DLL export defintion */

#ifdef BUILDING_SME_WIN_DLL
#define SME_DLL __declspec(dllexport)
#else
#define SME_DLL
#endif

// The SME library version (and compilation date)
#ifndef VERSION
#define VERSION "6.03, July 2019"
#endif

/* Datafile locations */
// DATA_DIR is defined in platform.h

#define DATAFILE_FE "Fe1_Bautista2017.dat.INTEL"
#define DATAFILE_NH "NH_Stancil2018.dat.INTEL"
#define DATAFILE_STEHLE "stehle_long.dat.INTEL"
#define DATAFILE_BPO "bpo_self.grid.INTEL"
#define DATAFILE_VCS "vcsbalmer.dat"
#include "sme_synth_faster.h"

/* Constants */

Expand Down Expand Up @@ -249,37 +227,6 @@ extern "C" void hlinprof_(double &, double &, float &, float &, int &, int &,
float &, float &, float &, float &, char *, int *,
int *);

/* IDL entry points */

extern "C" char const *SME_DLL SMELibraryVersion(int n, void *arg[]); /* Return SME library version */
extern "C" char const *SME_DLL GetDataFiles(int n, void *arg[]); /* Return the required data files */
extern "C" char const *SME_DLL GetLibraryPath(int n, void *arg[]); /* Return the current data file directory */
extern "C" char const *SME_DLL SetLibraryPath(int n, void *arg[]); /* Set the data file directory */
extern "C" char const *SME_DLL InputWaveRange(int n, void *arg[]); /* Read in Wavelength range */
extern "C" char const *SME_DLL SetVWscale(int n, void *arg[]); /* Set van der Waals scaling factor */
extern "C" char const *SME_DLL SetH2broad(int n, void *arg[]); /* Set flag for H2 molecule */
extern "C" char const *SME_DLL ClearH2broad(int n, void *arg[]); /* Clear flag for H2 molecule */
extern "C" char const *SME_DLL InputLineList(int n, void *arg[]); /* Read in line list */
extern "C" char const *SME_DLL OutputLineList(int n, void *arg[]); /* Return line list */
extern "C" char const *SME_DLL UpdateLineList(int n, void *arg[]); /* Change line list parameters */
extern "C" char const *SME_DLL InputModel(int n, void *arg[]); /* Read in model atmosphere */
extern "C" char const *SME_DLL InputDepartureCoefficients(int n, void *arg[]);
extern "C" char const *SME_DLL GetDepartureCoefficients(int n, void *arg[]); /* Get NLTE b's for
specific line */
extern "C" char const *SME_DLL GetNLTEflags(int n, void *arg[]); /* Get line list NLTE flags */
extern "C" char const *SME_DLL ResetDepartureCoefficients(int n, void *arg[]); /* Reset LTE */
extern "C" char const *SME_DLL InputAbund(int n, void *arg[]); /* Read in abundances */
extern "C" char const *SME_DLL Opacity(int n, void *arg[]); /* Calculate opacities */
extern "C" char const *SME_DLL GetOpacity(int n, void *arg[]); /* Returns specific cont. opacity */
extern "C" char const *SME_DLL Ionization(int n, void *arg[]); /* Perfrom EOS calculations */
extern "C" char const *SME_DLL GetDensity(int n, void *arg[]); /* Returns density in g/cm^3 */
extern "C" char const *SME_DLL GetNatom(int n, void *arg[]); /* Returns atomic number density */
extern "C" char const *SME_DLL GetNelec(int n, void *arg[]); /* Returns electron number density */
extern "C" char const *SME_DLL Transf(int n, void *arg[]); /* Computes spectral synthesis */
extern "C" char const *SME_DLL CentralDepth(int n, void *arg[]); /* Computes line central depths */
extern "C" char const *SME_DLL GetLineOpacity(int n, void *arg[]); /* Returns specific line opacity */
extern "C" char const *SME_DLL GetLineRange(int n, void *arg[]); /* Get validity range for every line */

/* Code */

char *ByteSwap(char *s, int n)
Expand Down
60 changes: 60 additions & 0 deletions src/sme/sme_synth_faster.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

#ifdef BUILDING_SME_WIN_DLL
#define SME_DLL __declspec(dllexport)
#else
#define SME_DLL
#endif

// The SME library version (and compilation date)
#ifndef VERSION
#define VERSION "6.03, July 2019"
#endif

/* Datafile locations */
// DATA_DIR is defined in platform.h

#define DATAFILE_FE "Fe1_Bautista2017.dat.INTEL"
#define DATAFILE_NH "NH_Stancil2018.dat.INTEL"
#define DATAFILE_STEHLE "stehle_long.dat.INTEL"
#define DATAFILE_BPO "bpo_self.grid.INTEL"
#define DATAFILE_VCS "vcsbalmer.dat"

// Define IDL String
typedef int IDL_STRING_SLEN_T;
#define IDL_STRING_MAX_SLEN 2147483647

typedef struct { /* Define string descriptor */
IDL_STRING_SLEN_T slen; /* Length of string, 0 for null */
short stype; /* type of string, static or dynamic */
char *s; /* Addr of string */
} IDL_STRING;

// define the external methods
extern "C" char const *SME_DLL SMELibraryVersion(int n, void *arg[]); /* Return SME library version */
extern "C" char const *SME_DLL GetDataFiles(int n, void *arg[]); /* Return the required data files */
extern "C" char const *SME_DLL GetLibraryPath(int n, void *arg[]); /* Return the current data file directory */
extern "C" char const *SME_DLL SetLibraryPath(int n, void *arg[]); /* Set the data file directory */
extern "C" char const *SME_DLL InputWaveRange(int n, void *arg[]); /* Read in Wavelength range */
extern "C" char const *SME_DLL SetVWscale(int n, void *arg[]); /* Set van der Waals scaling factor */
extern "C" char const *SME_DLL SetH2broad(int n, void *arg[]); /* Set flag for H2 molecule */
extern "C" char const *SME_DLL ClearH2broad(int n, void *arg[]); /* Clear flag for H2 molecule */
extern "C" char const *SME_DLL InputLineList(int n, void *arg[]); /* Read in line list */
extern "C" char const *SME_DLL OutputLineList(int n, void *arg[]); /* Return line list */
extern "C" char const *SME_DLL UpdateLineList(int n, void *arg[]); /* Change line list parameters */
extern "C" char const *SME_DLL InputModel(int n, void *arg[]); /* Read in model atmosphere */
extern "C" char const *SME_DLL InputDepartureCoefficients(int n, void *arg[]);
extern "C" char const *SME_DLL GetDepartureCoefficients(int n, void *arg[]); /* Get NLTE b's for
specific line */
extern "C" char const *SME_DLL GetNLTEflags(int n, void *arg[]); /* Get line list NLTE flags */
extern "C" char const *SME_DLL ResetDepartureCoefficients(int n, void *arg[]); /* Reset LTE */
extern "C" char const *SME_DLL InputAbund(int n, void *arg[]); /* Read in abundances */
extern "C" char const *SME_DLL Opacity(int n, void *arg[]); /* Calculate opacities */
extern "C" char const *SME_DLL GetOpacity(int n, void *arg[]); /* Returns specific cont. opacity */
extern "C" char const *SME_DLL Ionization(int n, void *arg[]); /* Perfrom EOS calculations */
extern "C" char const *SME_DLL GetDensity(int n, void *arg[]); /* Returns density in g/cm^3 */
extern "C" char const *SME_DLL GetNatom(int n, void *arg[]); /* Returns atomic number density */
extern "C" char const *SME_DLL GetNelec(int n, void *arg[]); /* Returns electron number density */
extern "C" char const *SME_DLL Transf(int n, void *arg[]); /* Computes spectral synthesis */
extern "C" char const *SME_DLL CentralDepth(int n, void *arg[]); /* Computes line central depths */
extern "C" char const *SME_DLL GetLineOpacity(int n, void *arg[]); /* Returns specific line opacity */
extern "C" char const *SME_DLL GetLineRange(int n, void *arg[]); /* Get validity range for every line */

0 comments on commit 6778a1c

Please sign in to comment.