ADJOINT_MODEL.F90 Subprograms

Last modified: Fri Apr 19 10:48:09 2002.


List of Subprograms


Subprogram Descriptions

ADJOINT_RTM

[Next Subprogram] [List of Subprograms]
 NAME:
       adjoint_rtm

 PURPOSE:
       PUBLIC function that calculates the adjoint of the top-of-atmosphere (TOA)
       radiances and brightness temperatures for an input atmospheric profile
       set and user specified satellites/channels.

 CATEGORY:
       NCEP RTM

 CALLING SEQUENCE:
       result = adjoint_rtm( &
                             ! -- Forward inputs
                             level_p, layer_p, layer_t, layer_w, layer_o,                &  ! Input, K x M

                             surface_temperature,                                        &  ! Input, M
                             surface_emissivity,                                         &  ! Input, L*M
                             surface_reflectivity,                                       &  ! Input, L*M

                             absorber,                                                   &  ! Input, 0:K x J x M

                             tau_layer_index,                                            &  ! Input, K x J x M
                             flux_tau_layer_index,                                       &  ! Input, K x J x M
                             solar_tau_layer_index,                                      &  ! Input, K x J x M

                             tau_predictor,                                              &  ! Input, Imax x K x M
                             flux_tau_predictor,                                         &  ! Input, Imax x K x M
                             solar_tau_predictor,                                        &  ! Input, Imax x K x M

                             tau,                                                        &  ! Input, K x L*M
                             flux_tau,                                                   &  ! Input, K x L*M
                             solar_tau,                                                  &  ! Input, K x L*M

                             layer_radiance,                                             &  ! Input, K x L*M
                             downwelling_radiance,                                       &  ! Input, L*M
                             upwelling_radiance,                                         &  ! Input, L*M

                             ! -- Adjoint inputs
                             tau_AD,                                                     &  ! In/Output, K x L*M
                             flux_tau_AD,                                                &  ! In/Output, K x L*M
                             solar_tau_AD,                                               &  ! In/Output, K x L*M

                             layer_radiance_AD,                                          &  ! In/Output, K x L*M
                             downwelling_radiance_AD,                                    &  ! In/Output, L*M
                             upwelling_radiance_AD,                                      &  ! In/Output, L*M

                             brightness_temperature_AD,                                  &  ! In/Output, L*M

                             ! -- Other inputs
                             secant_view_angle,                                          &  ! Input, M
                             secant_solar_angle,                                         &  ! Input, M
                             n_channels_per_profile,                                     &  ! Input, M
                             channel_index,                                              &  ! Input, L*M

                             ! -- Adjoint outputs
                             level_p_AD, layer_p_AD, layer_t_AD, layer_w_AD, layer_o_AD, &  ! In/Output, K x M

                             surface_temperature_AD,                                     &  ! In/Output, M
                             surface_emissivity_AD,                                      &  ! In/Output, L*M
                             surface_reflectivity_AD,                                    &  ! In/Output, L*M

                             ! Optional inputs
                             message_log = message_log )

 INPUT ARGUMENTS:

       level_p:                   Profile set layer interface pressure array. The TOA
                                  pressure is not included. TOA pressure is parameterised
                                  in the PARAMETERS module.
                                  UNITS:      hPa
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_p:                   Profile set layer average pressure array.
                                  UNITS:      hPa
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_t:                   Profile set layer average temperature array.
                                  UNITS:      Kelvin
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_w:      .            Profile set layer average water vapor mixing ratio array
                                  UNITS:      g/kg
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_o:                   Profile set layer average ozone mixing ratio array.
                                  UNITS:      ppmv
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       surface_temperature:       Profile set surface temperature array.
                                  UNITS:      Kelvin
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       surface_emissivity:        Profile set surface emissivity array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       surface_reflectivity:      Profile set surface reflectivity array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       absorber:                  Array of absorber amount for nadir view.
                                  UNITS:      Absorber dependent.
                                  TYPE:       Real
                                  DIMENSION:  0:K x J x M
                                  ATTRIBUTES: INTENT( IN )

       tau_layer_index:           Array of absorber space layer indices of the input
                                  absorber amounts at the satellite view angle.
                                  UNITS:      None.
                                  TYPE:       Integer
                                  DIMENSION:  K x J x M
                                  ATTRIBUTES: INTENT( IN )

       flux_tau_layer_index:      Array of absorber space layer indices of the input
                                  absorber amounts at the default diffusivity angle.
                                  UNITS:      None.
                                  TYPE:       Integer
                                  DIMENSION:  K x J x M
                                  ATTRIBUTES: INTENT( IN )

       solar_tau_layer_index:     Array of absorber space layer indices of the input
                                  absorber amounts at the solar zenith angle.
                                  UNITS:      None.
                                  TYPE:       Integer
                                  DIMENSION:  K x J x M
                                  ATTRIBUTES: INTENT( IN )

       tau_predictor:             Predictor profiles for the layer->TOA transmittance.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  I x K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       flux_tau_predictor:        Predictor profiles for the thermal flux transmittance.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  I x K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       solar_tau_predictor:       Predictor profiles for the solar transmittance.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  I x K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       tau:                       Layer->TOA transmittance for the satellite
                                  view angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       flux_tau:                  Layer->SFC transmittance for the default
                                  diffusivity angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       solar_tau:                 Layer->SFC transmittance for the solar
                                  zenith angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_radiance:            Layer Planck radiances at every layer for
                                  each channel/profile.
                                  UNITS:      mW/(m^2.sr.cm^-1)
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       downwelling_radiance:      TOA->SFC radiances for each channel/profile due
                                  to thermal flux and solar components.
                                  UNITS:      mW/(m^2.sr.cm^-1)
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       upwelling_radiance:        TOA radiances for each channel/profile.
                                  UNITS:      mW/(m^2.sr.cm^-1)
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       tau_AD:                    Layer->TOA adjoint transmittance for the satellite
                                  view angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       flux_tau_AD:               Layer->SFC adjoint transmittance for the default
                                  diffusivity angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       solar_tau_AD:              Layer->SFC adjoint transmittance for the solar
                                  zenith angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_radiance_AD:         Layer Planck adjoint radiances at every layer for
                                  each channel/profile.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      (m^2.sr.cm^-1)/mW
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       downwelling_radiance_AD:   TOA->SFC adjoint radiances for each channel/profile due
                                  to thermal flux and solar components.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      (m^2.sr.cm^-1)/mW
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       upwelling_radiance_AD:     TOA adjoint radiances for each channel/profile.
                                  UNITS:      (m^2.sr.cm^-1)/mW
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       brightness_temperature_AD: adjoint temperatures corresponding to the
                                  TOA adjoint radiances.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       secant_view_angle:         Secant of the satellite view angle measured
                                  from nadir for each profile in the set.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       secant_solar_angle:        Secant of the solar zenith angle for each
                                  profile in the set.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       n_channels_per_profile:    The number of channels for each profile in the
                                  set for which radiances are required.
                                  UNITS:      None
                                  TYPE:       Integer
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       channel_index:             Channel index id array. Each element is a unique
                                  index to a (supported) sensor channel.
                                  UNITS:      None
                                  TYPE:       Integer
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

 OPTIONAL INPUT ARGUMENTS:

       message_log:               Character string specifying a filename in which any
                                  messages will be logged. If not specified, or if an
                                  error occurs opening the log file, the default action
                                  is to output messages to the screen.
                                  UNITS:      None
                                  TYPE:       Character
                                  DIMENSION:  Scalar
                                  ATTRIBUTES: INTENT( IN ), OPTIONAL

 OUTPUT ARGUMENTS:

       level_p_AD:                Profile set layer interface pressure adjoint
                                  array.
                                  UNITS:      hPa^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_p_AD:                Profile set layer average pressure adjoint
                                  array.
                                  UNITS:      hPa^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_t_AD:                Profile set layer average temperature adjoint
                                  array.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_w_AD:      .         Profile set layer average water vapor mixing ratio
                                  adjoint array.
                                  UNITS:      kg/g
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_o_AD:                Profile set layer average ozone mixing ratio
                                  adjoint array.
                                  UNITS:      ppmv^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_temperature_AD:    Profile set surface temperature adjoint array.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_emissivity_AD:     Profile set surface emissivity adjoint array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_reflectivity_AD:   Profile set surface reflectivity adjoint array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

 OPTIONAL OUTPUT ARGUMENTS:
       None.

 FUNCTION RESULT:
       Result = SUCCESS => Calculation was successful
              = FAILURE => Error occurred checking input arguments

 CALLS:
      display_message:            Subroutine to output messages
                                  SOURCE: error_handler module

      get_max_n_channels:         Routine to retrieve the value of the
                                  MAX_N_CHANNELS "pseudo-parameter".
                                  SOURCE: parameters module

      compute_absorber_amount_AD: Subroutine to calculate the adjoint
                                  absorber profiles
                                  SOURCE: absorber_profile module

      compute_predictors_AD:      Subroutine to compute the adjoint 
                                  transmittance predictor profiles.
                                  SOURCE: predictor module

      compute_transmittance_AD:   Subroutine to compute the adjoint
                                  transmittance profiles.
                                  SOURCE: transmittance module

      compute_radiance_AD:        Subroutine to compute the TOA adjoint 
                                  radiances and brightness temperatures.
                                  SOURCE: radiance module

 EXTERNALS:
       None

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       All input adjoint arguments are set to ZERO on output.

 RESTRICTIONS:
       Note the restrictions on the input array dimensions:
         K == n_layers > 1
         L == n_channels > 1
         M == n_profiles > or = 1

 PROCEDURE:
       See individual module function documentation.

(See adjoint_model.f90)


COMPUTE_RTM_AD

[Previous Subprogram] [List of Subprograms]
 NAME:
       compute_rtm_AD

 PURPOSE:
       PUBLIC function that calculates the Adjoint of the top-of-atmosphere (TOA)
       radiances and brightness temperatures for an input atmospheric profile
       set and user specified satellites/channels.

       This function is simply a wrapper around both the FORWARD model and the
       ADJOINT model so that the user doesn't have to declare the absorber/
       predictor/etc arrays in the calling routine.

 CATEGORY:
       NCEP RTM

 CALLING SEQUENCE:
       result = compute_rtm_AD( &
                               ! -- Forward inputs
                               level_p, layer_p, layer_t, layer_w, layer_o, &  ! Input, K x M

                               surface_temperature,                         &  ! Input, M
                               surface_emissivity,                          &  ! Input, L*M
                               surface_reflectivity,                        &  ! Input, L*M

                               ! -- Adjoint inputs
                               tau_AD,                                      &  ! In/Output, K x L*M
                               flux_tau_AD,                                 &  ! In/Output, K x L*M
                               solar_tau_AD,                                &  ! In/Output, K x L*M

                               upwelling_radiance_AD,                       &  ! In/Output, L*M
                               brightness_temperature_AD,                   &  ! In/Output, L*M

                               ! -- Other inputs
                               secant_view_angle,                           &  ! Input, M
                               secant_solar_angle,                          &  ! Input, M
                               n_channels_per_profile,                      &  ! Input, M
                               channel_index,                               &  ! Input, L*M

                               ! -- Forward output
                               tau,                                         &  ! Input, K x L*M
                               flux_tau,                                    &  ! Input, K x L*M
                               solar_tau,                                   &  ! Input, K x L*M

                               upwelling_radiance,                          &  ! Input, L*M
                               brightness_temperature,                      &  ! Input, L*M

                               ! -- Adjoint outputs
                               level_p_AD, layer_p_AD, layer_t_AD, layer_w_AD, layer_o_AD, &  ! In/Output, K x M

                               surface_temperature_AD,                      &  ! In/Output, M
                               surface_emissivity_AD,                       &  ! In/Output, L*M
                               surface_reflectivity_AD,                     &  ! In/Output, L*M

                               ! Optional inputs
                               message_log = message_log )

 INPUT ARGUMENTS:

       level_p:                   Profile set layer interface pressure array. The TOA
                                  pressure is not included. TOA pressure is parameterised
                                  in the PARAMETERS module.
                                  UNITS:      hPa
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_p:                   Profile set layer average pressure array.
                                  UNITS:      hPa
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_t:                   Profile set layer average temperature array.
                                  UNITS:      Kelvin
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_w:      .            Profile set layer average water vapor mixing ratio array
                                  UNITS:      g/kg
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       layer_o:                   Profile set layer average ozone mixing ratio array.
                                  UNITS:      ppmv
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN )

       surface_temperature:       Profile set surface temperature array.
                                  UNITS:      Kelvin
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       surface_emissivity:        Profile set surface emissivity array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       surface_reflectivity:      Profile set surface reflectivity array
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )

       tau_AD:                    Layer->TOA adjoint transmittance for the satellite
                                  view angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       flux_tau_AD:               Layer->SFC adjoint transmittance for the default
                                  diffusivity angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       solar_tau_AD:              Layer->SFC adjoint transmittance for the solar
                                  zenith angle.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       upwelling_radiance_AD:     TOA adjoint radiances for each channel/profile.
                                  UNITS:      (m^2.sr.cm^-1)/mW
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       brightness_temperature_AD: Adjoint temperatures corresponding to the
                                  TOA adjoint radiances.
                                  ** THIS ARGUMENT IS SET TO ZERO ON OUTPUT **.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       secant_view_angle:         Secant of the satellite view angle measured
                                  from nadir for each profile in the set.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       secant_solar_angle:        Secant of the solar zenith angle for each
                                  profile in the set.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       n_channels_per_profile:    The number of channels for each profile in the
                                  set for which radiances are required.
                                  UNITS:      None
                                  TYPE:       Integer
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN )

       channel_index:             Channel index id array. Each element is a unique
                                  index to a (supported) sensor channel.
                                  UNITS:      None
                                  TYPE:       Integer
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN )


 OPTIONAL INPUT ARGUMENTS:

       message_log:               Character string specifying a filename in which any
                                  messages will be logged. If not specified, or if an
                                  error occurs opening the log file, the default action
                                  is to output messages to the screen.
                                  UNITS:      None
                                  TYPE:       Character
                                  DIMENSION:  Scalar
                                  ATTRIBUTES: INTENT( IN ), OPTIONAL

 OUTPUT ARGUMENTS:

       tau:                       Layer->TOA transmittance for the satellite
                                  view angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( OUT )

       flux_tau:                  Layer->SFC transmittance for the default
                                  diffusivity angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( OUT )

       solar_tau:                 Layer->SFC transmittance for the solar
                                  zenith angle.
                                  UNITS:      None.
                                  TYPE:       Real
                                  DIMENSION:  K x L*M; K > 1, L > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( OUT )

       upwelling_radiance:        TOA radiances for each channel/profile.
                                  UNITS:      mW/(m^2.sr.cm^-1)
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( OUT )

       brightness_temperature:    TOA brightness temperatures corresponding
                                  to the TOA radiances.
                                  UNITS:      Kelvin
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( OUT )

       level_p_AD:                Profile set layer interface pressure adjoint array.
                                  UNITS:      hPa^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_p_AD:                Profile set layer average pressure adjoint array.
                                  UNITS:      hPa^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_t_AD:                Profile set layer average temperature adjoint array.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_w_AD:      .         Profile set layer average water vapor mixing ratio
                                  adjoint array.
                                  UNITS:      kg/g
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       layer_o_AD:                Profile set layer average ozone mixing ratio
                                  adjoint array.
                                  UNITS:      ppmv^-1
                                  TYPE:       Real
                                  DIMENSION:  K x M; K > 1, and M > or = 1
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_temperature_AD:    Profile set surface temperature adjoint
                                  array.
                                  UNITS:      K^-1
                                  TYPE:       Real
                                  DIMENSION:  M; M > or = 1 (i.e. scalar)
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_emissivity_AD:     Profile set surface emissivity k-matrix adjoint
                                  array.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

       surface_reflectivity_AD:    Profile set surface reflectivity k-matrix adjoint
                                  array.
                                  UNITS:      None
                                  TYPE:       Real
                                  DIMENSION:  L*M; L > 1, and M > or = 1
                                              NB: This is a 1-D array.
                                  ATTRIBUTES: INTENT( IN OUT )

 OPTIONAL OUTPUT ARGUMENTS:
       None.

 FUNCTION RESULT:
       Result = SUCCESS => Calculation was successful
              = FAILURE => Error occurred

 CALLS:
      display_message:            Subroutine to output messages
                                  SOURCE: error_handler module

      get_max_n_channels:         Routine to retrieve the value of the
                                  MAX_N_CHANNELS "pseudo-parameter".
                                  SOURCE: parameters module

      forward_rtm:                Function to construct the forward model and calculate
                                  the transmittance profiles and TOA radiance/temperatures.
                                  SOURCE: forward_model module

      adjoint_rtm:                Function that calculates the adjoint of the (TOA)
                                  radiances/temperatures.

 EXTERNALS:
       None

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       All input adjoint arguments are set to ZERO on output.

 RESTRICTIONS:
       Note the restrictions on the input array dimensions:
         K == n_layers > 1
         L == n_channels > 1
         M == n_profiles > or = 1

 PROCEDURE:
       See individual module function documentation.

(See adjoint_model.f90)