/*AddOTSLin add local destruction of lines to ots field */ #include "cddefines.h" #include "opac.h" #include "rfield.h" #include "addotslin.h" void AddOTSLin(float ots, /* pointer on the f scale */ long int ip ) { # ifdef DEBUG_FUN fputs( "<+>AddOTSLin()\n", debug_fp ); # endif /* add ots due to line destruction to radiation field */ /* return if outside bounds of this continuum source, ip > rfield.nflux * first case ip==0 happens when called with dummy line */ if( ip==0 || ip > rfield.nflux ) { # ifdef DEBUG_FUN fputs( " <->AddOTSLin()\n", debug_fp ); # endif return; } /*the local ots rate must be non-negative */ assert( ots >= 0. ); /* continuum pointer must be positive */ assert( ip > 0 ); /* add locally destroyed flux of photons to line OTS array */ if( opac.opac[ip-1] > 0. ) { rfield.otslinNew[ip-1] += (float)(ots/opac.opac[ip-1]); } # ifdef DEBUG_FUN fputs( " <->AddOTSLin()\n", debug_fp ); # endif return; }