UFO
ufo_gnssro_refmetoffice_tlad_mod Module Reference

Fortran module for gnssro refractivity Met Office's tangent linear and adjoint. More...

Data Types

type  ufo_gnssro_refmetoffice_tlad
 Fortran derived type for gnssro trajectory. More...
 

Functions/Subroutines

subroutine ufo_gnssro_refmetoffice_tlad_setup (self, vert_interp_ops, pseudo_ops, min_temp_grad)
 Set up the Met Office GNSS-RO refractivity TL/AD. More...
 
subroutine ufo_gnssro_refmetoffice_tlad_settraj (self, geovals, obss)
 Set up the K-matrix for (Jacobian) for the Met Office's GNSS-RO refractivity operator. More...
 
subroutine ufo_gnssro_refmetoffice_simobs_tl (self, geovals, hofx, obss)
 Given an increment to the model state, calculate an increment to the observation. More...
 
subroutine ufo_gnssro_refmetoffice_simobs_ad (self, geovals, hofx, obss)
 Given an increment to the observation, find the equivalent increment to the model state. More...
 
subroutine ufo_gnssro_refmetoffice_tlad_delete (self)
 Tidy up the variables that are used for passing information. More...
 
subroutine jacobian_interface (nlevp, nlevq, za, zb, p, q, pseudo_ops, vert_interp_ops, min_temp_grad, nobs, zobs, Kmat)
 Calculate the K-matrix used in the TL/AD. More...
 

Variables

integer, parameter max_string =800
 

Detailed Description

Fortran module for gnssro refractivity Met Office's tangent linear and adjoint.

Function/Subroutine Documentation

◆ jacobian_interface()

subroutine ufo_gnssro_refmetoffice_tlad_mod::jacobian_interface ( integer, intent(in)  nlevp,
integer, intent(in)  nlevq,
real(kind_real), dimension(:), intent(in)  za,
real(kind_real), dimension(:), intent(in)  zb,
real(kind_real), dimension(:), intent(in)  p,
real(kind_real), dimension(:), intent(in)  q,
logical, intent(in)  pseudo_ops,
logical, intent(in)  vert_interp_ops,
real(kind_real), intent(in)  min_temp_grad,
integer, intent(in)  nobs,
real(kind_real), dimension(:), intent(in)  zobs,
real(kind_real), dimension(:,:), intent(out)  Kmat 
)

Calculate the K-matrix used in the TL/AD.

jacobian_interface

  • Allocate temporary arrays
  • Call partial-derivatives code which calculates various quantities on model levels
  • Loop over each observation, doing the following
  • If using pseudo-levels, calculate specific humidity, pressure and temperature on intermediate levels, and interpolate these appropriately. Then calculate the refractivity gradients for each observation, interpolated from the pseudo-levels.
  • If not using pseudo-levels, assume that refractivity varies exponentially with height and calculate gradients.
  • Calculate K-matrix from the component gradients.
Author
Neill Bowler (Met Office)
Date
26 May 2021
Parameters
[in]nlevpNumber of pressure levels
[in]nlevqNumber of specific humidity levels
[in]zaHeight of the pressure levels
[in]zbHeight of the specific humidity levels
[in]pInput pressure
[in]qInput specific humidity
[in]vert_interp_opsUse log(p) for vertical interpolation?
[in]pseudo_opsUse pseudo-levels to reduce errors?
[in]min_temp_gradMinimum value for the vertical temperature gradient
[in]nobsNumber of observations
[in]zobsHeight of the observations
[out]kmatK-matrix (Jacobian)

Definition at line 392 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ufo_gnssro_refmetoffice_simobs_ad()

subroutine ufo_gnssro_refmetoffice_tlad_mod::ufo_gnssro_refmetoffice_simobs_ad ( class(ufo_gnssro_refmetoffice_tlad), intent(in)  self,
type(ufo_geovals), intent(inout)  geovals,
real(kind_real), dimension(:), intent(in)  hofx,
type(c_ptr), intent(in), value  obss 
)

Given an increment to the observation, find the equivalent increment to the model state.

ufo_gnssro_refmetoffice_simobs_ad

  • Check that set trajectory has previously been called.
  • Get the geovals for the model increment, and allocate these if they have not already been allocated.
  • For each observation calculate the observation increment using the K-matrix
Author
Neill Bowler (Met Office)
Date
26 May 2021
Parameters
[in]selfObject which is being used to transfer information
[in,out]geovalsCalculated perturbations to model state
[in]hofxIncrement to the observations
[in]obssInput - the observations

Definition at line 274 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

Here is the call graph for this function:

◆ ufo_gnssro_refmetoffice_simobs_tl()

subroutine ufo_gnssro_refmetoffice_tlad_mod::ufo_gnssro_refmetoffice_simobs_tl ( class(ufo_gnssro_refmetoffice_tlad), intent(in)  self,
type(ufo_geovals), intent(in)  geovals,
real(kind_real), dimension(:), intent(inout)  hofx,
type(c_ptr), intent(in), value  obss 
)

Given an increment to the model state, calculate an increment to the observation.

ufo_gnssro_refmetoffice_simobs_tl

  • Check that set trajectory has been previously called.
  • Get the geovals for the increment.
  • For each observation apply the K-matrix to calculate the increment to the observation.
Author
Neill Bowler (Met Office)
Date
26 May 2021
Parameters
[in]selfObject which is being used to transfer information
[in]geovalsModel perturbations
[in,out]hofxIncrement to the observations
[in]obssInput - the observations

Definition at line 197 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

Here is the call graph for this function:

◆ ufo_gnssro_refmetoffice_tlad_delete()

subroutine ufo_gnssro_refmetoffice_tlad_mod::ufo_gnssro_refmetoffice_tlad_delete ( class(ufo_gnssro_refmetoffice_tlad), intent(inout)  self)

Tidy up the variables that are used for passing information.

ufo_gnssro_refmetoffice_tlad_delete

  • Set lengths to zero, and deallocate K-matrix
Author
Neill Bowler (Met Office)
Date
26 May 2021

Definition at line 356 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

◆ ufo_gnssro_refmetoffice_tlad_settraj()

subroutine ufo_gnssro_refmetoffice_tlad_mod::ufo_gnssro_refmetoffice_tlad_settraj ( class(ufo_gnssro_refmetoffice_tlad), intent(inout)  self,
type(ufo_geovals), intent(in)  geovals,
type(c_ptr), intent(in), value  obss 
)

Set up the K-matrix for (Jacobian) for the Met Office's GNSS-RO refractivity operator.

ufo_gnssro_refmetoffice_tlad_settraj

  • It is necessary to run this routine before calling the TL or AD routines.
  • Get the geovals specifying the state around which to linearise, flipping the vertical order if required.
  • Call the helper function to calculate the K-matrix for each observation.
Author
Neill Bowler (Met Office)
Date
26 May 2021
Parameters
[in,out]selfThe object that we use to save data in
[in]geovalsThe input geovals
[in]obssThe input observations

Definition at line 102 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

Here is the call graph for this function:

◆ ufo_gnssro_refmetoffice_tlad_setup()

subroutine ufo_gnssro_refmetoffice_tlad_mod::ufo_gnssro_refmetoffice_tlad_setup ( class(ufo_gnssro_refmetoffice_tlad), intent(inout)  self,
logical(c_bool), intent(in)  vert_interp_ops,
logical(c_bool), intent(in)  pseudo_ops,
real(c_float), intent(in)  min_temp_grad 
)

Set up the Met Office GNSS-RO refractivity TL/AD.

ufo_gnssro_refmetoffice_tlad_setup

  • Get the optional settings for the forward model and its linear, and save them in the object so that they can be used in the code.
Author
Neill Bowler (Met Office)
Date
26 May 2021

Definition at line 72 of file ufo_gnssro_refmetoffice_tlad_mod.F90.

Variable Documentation

◆ max_string

integer, parameter ufo_gnssro_refmetoffice_tlad_mod::max_string =800

Definition at line 36 of file ufo_gnssro_refmetoffice_tlad_mod.F90.