c----------------------------------------------------------------------- c c Name: c FUNCTION MASBRT c c Purpose: c Compute brightness temperature for a MAS IR band given response c weighted Planck radiance. c c Usage: c RESULT = MASBRT( BAND, RAD ) c c Input: c BAND MAS IR band number (26-50) c RAD Planck radiance (Watts per square meter per c steradian per micron) c c Output: c RESULT Brightness temperature (Kelvin) c c Revised: c Liam.Gumley@ssec.wisc.edu c $Id: masbrt.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 masbrt( band, rad ) implicit none c ... arguments integer band real rad c ... local variables real t, w, bright external bright 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 MASBRT' write(*,*) 'Subroutine INITCF must be called before MASBRT' stop endif c ... check input arguments if( band .lt. 26 .or. band .gt. 50 ) then write(*,*) 'Fatal Error in subroutine MASBRT' write(*,*) 'Input argument BAND was out of the range [26,50]' write(*,*) 'Offending value was ', band stop endif if( rad .lt. 0.0 .or. rad .ge. 20.0 ) then write(*,*) 'Fatal Error in subroutine MASBRT' write(*,*) 'Input argument RAD was out of the range [0.0,20.0]' write(*,*) 'Offending value was ', rad 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 MASBRT' 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 MASBRT' 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 MASBRT' 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 ... convert effective central wavenumber to wavelength in microns w = 1.0e4 / wc( band ) c ... compute brightness temperature t = bright( w, rad ) c ... apply temperature correction masbrt = ( t - tci( band ) ) / tcs( band ) end