Changeset 2034 for branches/c08_branch/source/atmdat_chianti.cpp
- Timestamp:
- 05/10/08 09:03:02 (2 months ago)
- Files:
-
- branches/c08_branch/source/atmdat_chianti.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/c08_branch/source/atmdat_chianti.cpp
r1815 r2034 18 18 /* type is set to 0 for non chianti and 1 for chianti*/ 19 19 long int i,j,nMolLevs,intCollTran,intcollindex,ipLo,ipHi; 20 FILE *atmolLevDATA , *atmolTraDATA=NULL,*atmolEleColDATA=NULL ;20 FILE *atmolLevDATA , *atmolTraDATA=NULL,*atmolEleColDATA=NULL,*atmolProColDATA=NULL; 21 21 realnum fstatwt,fenergyK,fenergyWN,fWLAng,fenergy,feinsteina; 22 22 double fScalingParam,fEnergyDiff,fGF,*xs,*spl,*spl2; … … 40 40 long int *intNewIndex=NULL,*intOldIndex=NULL; 41 41 int interror; 42 bool lg EneLevOrder;42 bool lgProtonData=false,lgEneLevOrder; 43 43 44 44 /*This is to identify where the fields start */ … … 99 99 if( trace.lgTrace ) 100 100 fprintf( ioQQQ," moldat_readin opening %s:",chProColFilename); 101 /*We will set a flag here to indicate if the proton collision strengths are available */ 102 if( ( atmolProColDATA = fopen( chProColFilename , "r" ) ) != NULL ) 103 { 104 lgProtonData = true; 105 } 106 else 107 { 108 lgProtonData = false; 109 } 101 110 102 111 nMolLevs = 0; … … 146 155 for( intcollindex = 0; intcollindex<NUM_COLLIDERS; intcollindex++ ) 147 156 { 148 CollRatesArray[intNS][intcollindex] = (double**)MALLOC((nMolLevs)*sizeof(double*)); 157 CollRatesArray[intNS][intcollindex] = NULL; 158 } 159 /*Allocating space just for the electron*/ 160 CollRatesArray[intNS][0] = (double**)MALLOC((nMolLevs)*sizeof(double*)); 161 for( ipHi = 0; ipHi<nMolLevs; ipHi++ ) 162 { 163 CollRatesArray[intNS][0][ipHi] = (double*)MALLOC((unsigned long)(nMolLevs)*sizeof(double)); 164 for( ipLo = 0; ipLo<nMolLevs; ipLo++) 165 { 166 CollRatesArray[intNS][0][ipHi][ipLo] = 0.0; 167 } 168 } 169 /*Allocating space for the proton*/ 170 if(lgProtonData) 171 { 172 CollRatesArray[intNS][1] = (double**)MALLOC((nMolLevs)*sizeof(double*)); 149 173 for( ipHi = 0; ipHi<nMolLevs; ipHi++ ) 150 174 { 151 CollRatesArray[intNS][ intcollindex][ipHi] = (double*)MALLOC((unsigned long)(nMolLevs)*sizeof(double));175 CollRatesArray[intNS][1][ipHi] = (double*)MALLOC((unsigned long)(nMolLevs)*sizeof(double)); 152 176 for( ipLo = 0; ipLo<nMolLevs; ipLo++) 153 177 { 154 CollRatesArray[intNS][intcollindex][ipHi][ipLo] = 0.0; 155 } 156 } 157 } 158 178 CollRatesArray[intNS][1][ipHi][ipLo] = 0.0; 179 } 180 } 181 } 159 182 /*Rewind the energy levels files*/ 160 183 if( fseek( atmolLevDATA , 0 , SEEK_SET ) != 0 )
