SUBROUTINE CONV_FOV_ATM_SUN_old( & nl, layers, layere, & appang, trueang, lockdown, tau, & fovdat, fov_elev, numfov, & sldc, el_sol, numsol, & sim_exo, conv_tau ) IMPLICIT NONE c c $Log: conv_fov_atm_sun.f,v $ c Revision 1.2 2008/02/11 19:06:42 deaver c commented save statement c c Revision 1.1 2008/02/07 13:53:16 deaver c Initial revision c c Revision 1.1 2007/06/26 19:48:59 deaver c Initial Checkin c c Revision 5.1 2000/01/18 21:25:30 deaver c Modified to handle calls when NUMFOV=0. Routine will now c compute Solar*tran at the lock down and normalize by sim_exo c which is the SLDC value at the exo atmospheric lockdown c c Revision 5.0 1998/08/31 14:21:58 deaver c Changed conv_tau and sim_exo to real*8. c c Revision 1.3 1997/08/25 14:52:41 deaver c Changed to 2nd order interpolation c c Revision 1.2 1996/09/20 16:33:17 deaver c Added return when numfov = 0 c c Revision 1.1 1994/02/24 01:36:20 deaver c Initial revision c c c description c this subroutine convolves the instrument FOV with the atmosphere c and the SLDC to derive a convolved Tran profile c c externals c liner Linear interpolation subroutine c intrinsics c real c constants C INCLUDE 'hal_src:haloretlib_parameters.inc' !VAX c INCLUDE 'haloretlib_parameters.inc' !IBM include 'f77parameters.inc' c input INTEGER*4 & nl, !Number of levels & layers, !Beginning level to calculate & layere, !Ending level to calculate & numfov, !Number of points in FOVDAT & numsol !Number of points in SLDC c & itran REAL*8 & appang(nl), !App zenith angle for each level (radians) & trueang(nl), !True zenith angle for each level (radians) & lockdown(nl), !Boresight lockdown position relative to the ! top edge of Sun for each level (radians) & fovdat(numfov), !Vertical FOV data & fov_elev(numfov), !FOV elevation (radians) & sldc(numsol), !Solar limb darkening curve & EL_SOL(numsol), !Position of each SLDC data point relative ! to the top edge (radians) & tau(nl), !Infintesimal transmission for each level & sim_exo !Simulated exo atmospheric signal ! Output REAL*8 & CONV_TAU(nl) !Transmission profile convolved with FOV and C Local variables ! the SLDC INTEGER*4 & I, ILEV !Loop variables real*8 & APP_TOP_EDGE, !App zenith angle of the top edge of Sun (radians) & TRUE_TOP_EDGE, !True zenith angle of the top edge of Sun (radians) & ZEN_FOV(MAXFOV), !App zenith angle for each FOV data point (radians) & TOTAL_SIG, !Result of FOV convolved with SLDC and TRAN & TRAN(MAXFOV), !Transmission at each ZEN_FOV data point c & appang2(ML), !Apparent angle of transmittance c & trueang2(ML), !True zenith angle for each level (radians) c & sldc2(MAXSOL), !Solar limb darkening curve c & EL_SOL2(MAXSOL), !Position of each SLDC data point relative & FOVPOS(MAXFOV), !Position of each FOV data point on the solar disk ! relative to the top edge. (radians) & SOLAR(MAXFOV) !SLDC value at each FOVPOS data point c character *80 interp_comment logical interp_error_flag cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc if(numfov .gt. maxfov) then write(*,*) "number of fov points exceed maxfov ", numfov, maxfov stop "error in conv_fov_atm_sun" endif c c do i=1,nl c appang2(i)=appang(i) c trueang2(i)=trueang(i) c enddo c c do i=1,numsol c el_sol2(i)=el_sol(i) c sldc2(i)=sldc(i) c enddo c if(numfov .eq. 0) then !Use the center value do ilev=layers,layere zen_fov(1)=APPANG(ILEV) !Center of FOV APP_TOP_EDGE=APPANG(ILEV)-LOCKDOWN(ILEV) call linerd(appang,trueang,app_top_edge, & true_top_edge,nl,1) !Determine True Top Edge call linerd(appang,trueang,zen_fov,fovpos,nl,1) FOVPOS(1)=FOVPOS(1)-TRUE_TOP_EDGE call linerd(el_sol,sldc,fovpos,solar,numsol,1) call interpolate_12d(zen_fov,tran,appang,tau(1), & 1, nl, 2, interp_error_flag, interp_comment) if(interp_error_flag) then print*, interp_comment stop "error in conv_atm_sun" endif CONV_TAU(ILEV)=solar(1)*tran(1)/sim_exo ! c if(itran.eq.2) then c call interpolate_12d(zen_fov,tran,appang2,tau(1,2), c & 1, nl, 2, interp_error_flag, interp_comment) c CONV_TAU(ILEV,2)=solar(1)*tran(1)/sim_exo c endif enddo else DO 100 ILEV=layers,layere ! c ZEN_FOV(1)=APPANG(ILEV)+FOVSTART DO 20 I=1,NUMFOV ZEN_FOV(I)=APPANG(ILEV)+ fov_elev(i) 20 CONTINUE ! APP_TOP_EDGE=APPANG(ILEV)-LOCKDOWN(ILEV) call linerd(appang,trueang,app_top_edge,true_top_edge, & nl,1) c if(layere-layers .gt. 10) then c print*, ilev, app_top_edge, true_top_edge, appang(ilev), c & trueang(ilev), lockdown(ilev) c stop c endif call linerd(appang,trueang,zen_fov,fovpos,nl,numfov) DO 30 I=1,NUMFOV FOVPOS(I)=FOVPOS(I)-TRUE_TOP_EDGE 30 CONTINUE call linerd(el_sol,sldc,fovpos,solar,numsol,numfov) ! call interpolate_12d(zen_fov,tran,appang,tau(1),numfov, & nl, 2, interp_error_flag, interp_comment) if(interp_error_flag) then print*, interp_comment stop "error in conv_atm_sun" endif c TOTAL_SIG=0.0D+00 DO 40 I=1,NUMFOV TOTAL_SIG=TOTAL_SIG+FOVDAT(I)*SOLAR(I)*TRAN(I) 40 CONTINUE CONV_TAU(ILEV)=TOTAL_SIG/sim_exo ! c if(itran.eq.2) then c call interpolate_12d(zen_fov,tran,appang2,tau(1,2),numfov, c & nl, 2, interp_error_flag, interp_comment) c TOTAL_SIG=0.0D+00 c DO 70 I=1,NUMFOV c TOTAL_SIG=TOTAL_SIG+FOVDAT(I)*SOLAR(I)*TRAN(I) c 70 CONTINUE c CONV_TAU(ILEV,2)=TOTAL_SIG/sim_exo c endif 100 CONTINUE endif ! RETURN END