IRSSE Model How to Use

This is a (hopefully) simple step-by-step guide showing how to use the IRSSE model.


Module Use Definitions

The first thing to do if you use any of my code is to include the modules that define the various variable types (Type_Kinds) and the function return codes and a message display routine (Error_Handler). In any of my code, this is always the first thing I do.
  USE Type_Kinds
  USE Error_Handler
Access to the IRSSE model is achieved by the following USE statement,
  USE IRSSE_Model

Simple, no?


Model Initialization

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


Computing Emissivities

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.


Model Destruction

The last step is to destroy the IRSSE model space, freeing up all the allocated memory. This step can be ignored if the the code is being used in a program (note I only issue a WARNING below if the structure destruction does fail). But, if this code is used in a routine one should destroy the structure before exiting the calling routine. Of course, the actual order depends on how your code is organised, and I like to be explicit about deallocting pointers to avoid memory leaks.
  ! -- 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


This page maintained by Paul van Delst

Last updated Feb 2, 2004