PDAFomi_obs_f Module

PDAF-OMI routines for full observations

This module contains subroutines to handle full observations. Further, it contains routines to restrict the global full vector of observations to those observations that are relevant for a process-local model subdomain. The routines are

  • PDAFomi_gather_obs \n Gather full observation information
  • PDAFomi_gather_obsstate \n Gather a full observed state vector (used in observation operators)
  • PDAFomi_init_obs_f \n Initialize full vector of observations for adaptive forgetting factor
  • PDAFomi_init_obsvar_f \n Compute mean observation error variance for adaptive forgetting factor
  • PDAFomi_prodRinvA \n Multiply an intermediate matrix of the global filter analysis with the inverse of the observation error covariance matrix
  • PDAFomi_likelihood \n Compute likelihood for an ensemble member
  • PDAFomi_add_obs_err \n Add observation error to some matrix
  • PDAFomi_init_obscovar \n Initialize global observation error covariance matrix
  • PDAFomi_set_domain_limits \n Set min/max coordinate locations of decomposed grid
  • PDAFomi_get_domain_limits_unstr \n Find min/max coordinate locations in unstructured grid
  • PDAFomi_get_local_ids_obs_f \n Find observations inside or close to process domain
  • PDAFomi_limit_obs_f \n Reduce full observation vector to part relevant for local process domain

The routine PDAFomi_get_domain_limits_unstr assumed geographic coordinates in radians and within the range -pi to +pi for longitude (- is westward) and -pi/2 to +pi/2 for latitude.

Revision history: * 2019-06 - Lars Nerger - Initial code * Later revisions - see repository log



Variables

Type Visibility Attributes Name Initial
integer, public :: debug = 0
integer, public :: error = 0
real, public, ALLOCATABLE :: domain_limits(:)
real, public, parameter :: r_earth = 6.3675e6
real, public, parameter :: pi = 3.141592653589793
integer, public :: n_obstypes = 0
integer, public :: obscnt = 0
integer, public :: offset_obs = 0
integer, public :: offset_obs_g = 0
logical, public :: omit_obs = .FALSE.
logical, public :: omi_was_used = .FALSE.
integer, public, ALLOCATABLE :: obsdims(:,:)
integer, public, ALLOCATABLE :: map_obs_id(:)
integer, public :: ostats_omit(7)
type(obs_arr_f), public, ALLOCATABLE :: obs_f_all(:)

Derived Types

type, public ::  obs_f

Components

Type Visibility Attributes Name Initial
integer, public :: doassim = 0
integer, public :: disttype
integer, public :: ncoord
integer, public, ALLOCATABLE :: id_obs_p(:,:)
real, public, ALLOCATABLE :: icoeff_p(:,:)
real, public, ALLOCATABLE :: domainsize(:)
integer, public :: obs_err_type = 0
integer, public :: use_global_obs = 1
real, public :: inno_omit = 0.0
real, public :: inno_omit_ivar = 1.0e-12
integer, public :: dim_obs_p
integer, public :: dim_obs_f
integer, public :: dim_obs_g
integer, public :: off_obs_f
integer, public :: off_obs_g
integer, public :: obsid
real, public, ALLOCATABLE :: obs_f(:)
real, public, ALLOCATABLE :: ocoord_f(:,:)
real, public, ALLOCATABLE :: ivar_obs_f(:)
integer, public, ALLOCATABLE :: id_obs_f_lim(:)
integer, public :: locweight_v

type, public ::  obs_arr_f

Components

Type Visibility Attributes Name Initial
type(obs_f), public, POINTER :: ptr

Subroutines

public subroutine PDAFomi_gather_obs(thisobs, dim_obs_p, obs_p, ivar_obs_p, ocoord_p, ncoord, lradius, dim_obs_f)

Gather full observational information

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
integer, intent(in) :: dim_obs_p
real, intent(in) :: obs_p(:)
real, intent(in) :: ivar_obs_p(:)
real, intent(in) :: ocoord_p(:,:)
integer, intent(in) :: ncoord
real, intent(in) :: lradius
integer, intent(out) :: dim_obs_f

public subroutine PDAFomi_gather_obsstate(thisobs, obsstate_p, obsstate_f)

Gather full observational information

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout), TARGET :: thisobs
real, intent(in) :: obsstate_p(:)
real, intent(inout) :: obsstate_f(:)

public subroutine PDAFomi_init_obs_f(thisobs, dim_obs_f, obsstate_f, offset)

Initialize full vector of observations

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
integer, intent(in) :: dim_obs_f
real, intent(inout) :: obsstate_f(:)
integer, intent(inout) :: offset

public subroutine PDAFomi_init_obsvar_f(thisobs, meanvar, cnt_obs)

Compute mean observation error variance

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
real, intent(inout) :: meanvar
integer, intent(inout) :: cnt_obs

public subroutine PDAFomi_prodRinvA(thisobs, ncols, A_p, C_p)

Compute product of inverse of R with some matrix

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
integer, intent(in) :: ncols
real, intent(in) :: A_p(:,:)
real, intent(out) :: C_p(:,:)

public subroutine PDAFomi_likelihood(thisobs, resid, lhood)

Compute likelihood for an ensemble member

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
real, intent(in) :: resid(:)
real, intent(inout) :: lhood

public subroutine PDAFomi_add_obs_error(thisobs, nobs_all, matC)

Add observation error to some matrix

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(in) :: thisobs
integer, intent(in) :: nobs_all
real, intent(inout) :: matC(:,:)

public subroutine PDAFomi_init_obscovar(thisobs, nobs_all, covar, isdiag)

Initialize global observation error covariance matrix

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
integer, intent(in) :: nobs_all
real, intent(inout) :: covar(:,:)
logical, intent(out) :: isdiag

public subroutine PDAFomi_init_obserr_f(thisobs, obserr_f)

Initialize vector of observation errors for generating synthetic obs.

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(in) :: thisobs
real, intent(inout) :: obserr_f(:)

public subroutine PDAFomi_set_domain_limits(lim_coords)

Set min/max coordinate locations of a decomposed grid

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: lim_coords(2,2)

public subroutine PDAFomi_get_domain_limits_unstr(npoints_p, coords_p)

Find min/max coordinate locations in unstructured grid

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npoints_p
real, intent(in) :: coords_p(:,:)

public subroutine PDAFomi_get_local_ids_obs_f(dim_obs_g, lradius, oc_f, cnt_lim, id_lim, disttype, domainsize)

Find observations inside or close to process domain

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: dim_obs_g
real, intent(in) :: lradius
real, intent(in) :: oc_f(:,:)
integer, intent(out) :: cnt_lim
integer, intent(out) :: id_lim(:)
integer, intent(in) :: disttype
real, intent(in), optional :: domainsize(:)

public subroutine PDAFomi_limit_obs_f(thisobs, offset, obs_f_one, obs_f_lim)

Reduce full observation vector to part relevant for local process domain

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
integer, intent(in) :: offset
real, intent(in) :: obs_f_one(:)
real, intent(out) :: obs_f_lim(:)

public subroutine PDAFomi_gather_obs_f_flex(dim_obs_p, obs_p, obs_f, status)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: dim_obs_p
real, intent(in) :: obs_p(:)
real, intent(out) :: obs_f(:)
integer, intent(out) :: status

public subroutine PDAFomi_gather_obs_f2_flex(dim_obs_p, coords_p, coords_f, nrows, status)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: dim_obs_p
real, intent(in) :: coords_p(:,:)
real, intent(out) :: coords_f(:,:)
integer, intent(in) :: nrows
integer, intent(out) :: status

public subroutine PDAFomi_omit_by_inno(thisobs, inno_f, obs_f_all, obsid, cnt_all)

Exclude observations for too high innovation

Read more…

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(inout) :: thisobs
real, intent(in) :: inno_f(:)
real, intent(in) :: obs_f_all(:)
integer, intent(in) :: obsid
integer, intent(inout) :: cnt_all

public subroutine PDAFomi_obsstats(screen)

Get statistics on local observations

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: screen

public subroutine PDAFomi_gather_obsdims()

Gather global observation dimension information

Read more…

Arguments

None

public subroutine PDAFomi_check_error(flag)

Check error flag

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: flag