USE Type_Kinds USE Error_HandlerAccess to the IRSSE model is achieved by the following USE statement,
USE IRSSE_Model
Simple, no?
This step is very important as it initialises the model by loading the emissivity model coefficients from an "EmisCoeff" datafile into memory. Before going much further I recommend you have look at the documentation related to the EmisCoeff datasets, particular the EmisCoeff_NC2BIN and Combine_EmisCoeff programs. The reasons for this are,
So, once you've got that all sorted out, the initialisation is a simple call,
! -- Initialize the IRSSE model
Error_Status = Initialize_IRSSE_Model( EmisCoeff_File = EmisCoeff_Filename )
IF ( Error_Status /= SUCCESS ) THEN
CALL display_message( PROGRAM_NAME, &
'Error initialising IRSSE model from '//&
TRIM( EmisCoeff_Filename ), &
Error_Status )
STOP
END IF
Let's say you have an array of view angles and wind speeds for which you want to compute the sea surface emissivities for a HIRS instrument (19 channels) but only for channels 7, 8, 9, and 10 for a predetermined set of wind speeds and view angles. Suppose the data definitions are something like,
INTEGER, PARAMETER :: N_CHANNELS = 4
INTEGER, PARAMETER :: N_WIND_SPEEDS = 2
INTEGER, PARAMETER :: N_VIEW_ANGLES = 3
INTEGER :: n, i
INTEGER, DIMENSION( N_CHANNELS ) :: Channel_List = (/ 7, 8, 9, 10 /)
REAL( fp_kind ), DIMENSION( N_WIND_SPEEDS ) :: Wind_Speed = (/ 0.0_fp_kind, &
5.0_fp_kind /)
REAL( fp_kind ), DIMENSION( N_VIEW_ANGLES ) :: View_Angle = (/ 13.4_fp_kind, &
25.7_fp_kind, &
37.4_fp_kind /)
REAL( fp_kind ), DIMENSION( N_CHANNELS, N_WIND_SPEEDS, N_VIEW_ANGLES ) :: Emissivity
then, after initialisation with the NOAA-17 HIRS EmisCoeff file, the emissivities would be calculated for each wind speed/view angle combination simply by,
DO i = 1, N_VIEW_ANGLES
DO n = 1, N_WIND_SPEEDS
Error_Status = Forward_IRSSE( View_Angle(i), & ! Input, scalar
Wind_Speed(n), & ! Input, scalar
Channel_List, & ! Input, vector
Emissivity(:,n,i) ) ! Output
IF ( Error_Status /= SUCCESS ) THEN
....handle the error....
END IF
END DO
END DO
The above is a very simple example. The way you set up the calling sequence, i.e. the channle list and wind speed/view angles values, is dependent on your calling program.
For a more complicated example of how I call the IRSSE model for a number of different sensors, tale a look at the IRSSE_Model_Test program. In it you'll see how I use the SensorInfo modules for definitions of various sensors.
! -- Destroy the emissivity model
Error_Status = Destroy_IRSSE_Model()
IF ( Error_Status /= SUCCESS ) THEN
CALL display_message( PROGRAM_NAME, &
'Error destroying IRSSE model.', &
WARNING )
END IF