c----------------------------------------------------------------------- c c Name: c FUNCTION MASRAD c c Purpose: c Compute response weighted Planck radiance for a MAS IR band given c brightness temperature. c c Usage: c RESULT = MASRAD( BAND, TEM ) c c Input: c BAND MAS IR band number (26-50) c TEM Brightness temperature (Kelvin) c c Output: c RESULT Planck radiance (Watts per square meter per c steradian per micron) c c Revised: c Liam.Gumley@ssec.wisc.edu c $Id: masrad.f,v 1.3 1999/11/11 20:04:45 gumley Exp $ c c Notes: c SUBROUTINE INITCF must be called before calling MASRAD or MASBRT c c----------------------------------------------------------------------- real function masrad( band, tem ) implicit none c ... arguments integer band real tem c ... local variables real t, w, planck external planck c ... common block of coefficients which is initialized in INITCF c ... (INITCF must be called before MASRAD or MASBRT) integer init real wc( 50 ), tcs( 50 ), tci( 50 ) common / mascof / init, wc, tcs, tci c ... check that coefficients were created by INITCF if( init .ne. 1 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Subroutine INITCF must be called before MASRAD' stop endif c ... check input arguments if( band .lt. 26 .or. band .gt. 50 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Input argument BAND was out of the range [26,50]' write(*,*) 'Offending value was ', band stop endif if( tem .le. 100.0 .or. tem .ge. 1000.0 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Input argument TEM was out of the range [100,1000]' write(*,*) 'Offending value was ', tem stop endif c ... check the coefficients just to be sure if( wc( band ) .le. 600.0 .or. wc( band ) .gt. 3500.0 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Variable WC was out of the range [600,3500]' write(*,*) 'Offending value was at element', band, & ', value was ', wc( band ) stop endif if( tcs( band ) .le. 0.98 .or. tcs( band ) .gt. 1.02 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Variable TCS was out of the range [0.98,1.02]' write(*,*) 'Offending value was at element', band, & ', value was ', tcs( band ) stop endif if( tci( band ) .le. -2.0 .or. tci( band ) .gt. 2.0 ) then write(*,*) 'Fatal Error in subroutine MASRAD' write(*,*) 'Variable TCI was out of the range [-2.0,2.0]' write(*,*) 'Offending value was at element', band, & ', value was ', tci( band ) stop endif c ... apply temperature correction t = tem * tcs( band ) + tci( band ) c ... convert effective central wavenumber to wavelength in microns w = 1.0e4 / wc( band ) c ... compute Planck radiance masrad = planck( w, t ) end