/*LimitSh sets upper energy limit to subshell integrations */ #include "cddefines.h" #include "opacpoint.h" #include "kshllenr.h" #include "limitsh.h" long LimitSh(long int ion, long int nshell, long int nelem) { long int LimitSh_v; # ifdef DEBUG_FUN fputs( "<+>LimitSh()\n", debug_fp ); # endif /* this routine returns the high energy limit to the energy range * for photoionizatin of a given shell * */ if( nshell == 1 ) { /* this limit is high energy limit to code unless changed with set kshell */ LimitSh_v = KshllEnr.KshellLimit; } else if( nshell == 2 ) { /* this is 2s shell, upper limit is 1s * >>chng 96 oct 8, up to high energy limit * LimitSh = ipElement(nelem,ion , 1,1)-1 */ LimitSh_v = KshllEnr.KshellLimit; } else if( nshell == 3 ) { /* this is 2p shell, upper limit is 1s * >>chng 96 oct 8, up to high energy limit * LimitSh = ipElement(nelem,ion , 1,1)-1 */ LimitSh_v = KshllEnr.KshellLimit; } else if( nshell == 4 ) { /* this is 3s shell, upper limit is 2p * >>chng 96 oct 8, up to K-shell edge * LimitSh = ipElement(nelem,ion , 3,1)-1 */ LimitSh_v = OpacPoint.ipElement[0][0][ion-1][nelem-1] - 1; } else if( nshell == 5 ) { /* this is 3p shell, upper limit is 2p * >>chng 96 oct 8, up to K-shell edge * LimitSh = ipElement(nelem,ion , 3,1)-1 */ LimitSh_v = OpacPoint.ipElement[0][0][ion-1][nelem-1] - 1; } else if( nshell == 6 ) { /* this is 3d shell, upper limit is 2p * >>chng 96 oct 8, up to K-shell edge * LimitSh = ipElement(nelem,ion , 3,1)-1 */ LimitSh_v = OpacPoint.ipElement[0][0][ion-1][nelem-1] - 1; } else if( nshell == 7 ) { /* this is 4s shell, upper limit is 3d */ if( OpacPoint.ipElement[0][5][ion-1][nelem-1] < 3 ) { /* this is check for empty shell 6, 3d * if so then set to 3p instead */ LimitSh_v = OpacPoint.ipElement[0][4][ion-1][nelem-1] - 1; } else { LimitSh_v = OpacPoint.ipElement[0][5][ion-1][nelem-1] - 1; } /* >>chng 96 sep 26, set upper limit down to 2s */ LimitSh_v = OpacPoint.ipElement[0][2][ion-1][nelem-1] - 1; } else { fprintf( ioQQQ, " LimitSh cannot handle nshell as large as%4ld\n", nshell ); puts( "[Stop in limitsh]" ); exit(1); } # ifdef DEBUG_FUN fputs( " <->LimitSh()\n", debug_fp ); # endif return( LimitSh_v ); }