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
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
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(:) |
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 |
Gather full observational information
Type | Intent | Optional | 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 |
Gather full observational information
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout), | TARGET | :: | thisobs | ||
real, | intent(in) | :: | obsstate_p(:) | |||
real, | intent(inout) | :: | obsstate_f(:) |
Initialize full vector of observations
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
integer, | intent(in) | :: | dim_obs_f | |||
real, | intent(inout) | :: | obsstate_f(:) | |||
integer, | intent(inout) | :: | offset |
Compute mean observation error variance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
real, | intent(inout) | :: | meanvar | |||
integer, | intent(inout) | :: | cnt_obs |
Compute product of inverse of R with some matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
integer, | intent(in) | :: | ncols | |||
real, | intent(in) | :: | A_p(:,:) | |||
real, | intent(out) | :: | C_p(:,:) |
Compute likelihood for an ensemble member
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
real, | intent(in) | :: | resid(:) | |||
real, | intent(inout) | :: | lhood |
Add observation error to some matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(in) | :: | thisobs | |||
integer, | intent(in) | :: | nobs_all | |||
real, | intent(inout) | :: | matC(:,:) |
Initialize global observation error covariance matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
integer, | intent(in) | :: | nobs_all | |||
real, | intent(inout) | :: | covar(:,:) | |||
logical, | intent(out) | :: | isdiag |
Initialize vector of observation errors for generating synthetic obs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(in) | :: | thisobs | |||
real, | intent(inout) | :: | obserr_f(:) |
Set min/max coordinate locations of a decomposed grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in) | :: | lim_coords(2,2) |
Find min/max coordinate locations in unstructured grid
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npoints_p | |||
real, | intent(in) | :: | coords_p(:,:) |
Find observations inside or close to process domain
Type | Intent | Optional | 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(:) |
Reduce full observation vector to part relevant for local process domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(inout) | :: | thisobs | |||
integer, | intent(in) | :: | offset | |||
real, | intent(in) | :: | obs_f_one(:) | |||
real, | intent(out) | :: | obs_f_lim(:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | dim_obs_p | |||
real, | intent(in) | :: | obs_p(:) | |||
real, | intent(out) | :: | obs_f(:) | |||
integer, | intent(out) | :: | status |
Type | Intent | Optional | 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 |
Exclude observations for too high innovation
Type | Intent | Optional | 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 |
Get statistics on local observations
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | screen |
Check error flag
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout) | :: | flag |