Skip to content

Commit

Permalink
fix windows compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
sigrimm committed Jun 22, 2020
1 parent bf87a7b commit 0c35cf0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion define.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#define _USE_MATH_DEFINES //for Windows
#endif

#ifndef DEFINE_H
#define DEFINE_H


//Build Data

#ifndef GIT_DESCRIBE
Expand All @@ -26,7 +30,7 @@
#endif


#define VERSION 2.01
#define VERSION 2.02


#define def_T0 296.0 //Reference Temperature in K
Expand Down Expand Up @@ -201,3 +205,4 @@ struct Line{
long long int *iiLimitsCT_m, *iiLimitsCT_d; //limits for all blocks, mapped memory

};
#endif
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Atomic Opacities plots

.. toctree::
:maxdepth: 1

helios_k/atoms.rst


Citations
~~~~~~~~~

Expand Down
10 changes: 7 additions & 3 deletions heliosk.cu
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "define.h" //must be on top for Windows compilation

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <thrust/sort.h>
#include <thrust/device_ptr.h>

#include "define.h"

#include "host.h"
#include "ISO.h"
Expand Down Expand Up @@ -482,8 +482,12 @@ printf("%g %g %g %g\n", param.numax, param.numin, param.dnu, (param.numax - para
}
//Allocate Species array
double *SpeciesA_h; //abundance
SpeciesA_h = (double*)malloc((param.nSpecies) * sizeof(double));
char SpeciesN_h[param.nSpecies][160];
char **SpeciesN_h;
SpeciesA_h = (double*)malloc(param.nSpecies * sizeof(double));
SpeciesN_h = (char**)malloc(param.nSpecies * sizeof(char*));
for(int i = 0; i < param.nSpecies; ++i){
SpeciesN_h[i] = (char*)malloc(160 * sizeof(char));
}
if(param.useSpeciesFile == 1){
er = readSpeciesFile(param, SpeciesN_h, SpeciesA_h);
if(er == 0) return 0;
Expand Down
2 changes: 1 addition & 1 deletion host.h
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ __host__ int readPFile(Param &param, double *P_h){
return 1;
}

__host__ int readSpeciesFile(Param &param, char (*SpeciesN_h)[160], double *SpeciesA_h){
__host__ int readSpeciesFile(Param &param, char **SpeciesN_h, double *SpeciesA_h){
FILE *Speciesfile;
Speciesfile = fopen(param.SpeciesFilename, "r");
int er;
Expand Down
1 change: 0 additions & 1 deletion voigt.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// *********************************************
//This function calculates the Series Sigma1. Sigma2 and Sigma3 (Equations 27, 28, and 29) from Alg 916
//The parameter def_TOL sets a tolerance where to truncate the series
Expand Down

0 comments on commit 0c35cf0

Please sign in to comment.