MOM6
ocean_da_types.F90
1 !> Dummy aata structures and methods for ocean data assimilation.
3 
4  use mom_time_manager, only : time_type
5 
6  implicit none
7 
8  private
9 
10  !> Example type for ocean ensemble DA state
11  type, public :: ocean_control_struct
12  integer :: ensemble_size !< ensemble size
13  real, pointer, dimension(:,:,:) :: ssh=>null() !<sea surface height (m) across ensembles
14  real, pointer, dimension(:,:,:,:) :: h=>null() !<layer thicknesses (m or kg) across ensembles
15  real, pointer, dimension(:,:,:,:) :: t=>null() !<layer potential temperature (degC) across ensembles
16  real, pointer, dimension(:,:,:,:) :: s=>null() !<layer salinity (psu or g kg-1) across ensembles
17  real, pointer, dimension(:,:,:,:) :: u=>null() !<layer zonal velocity (m s-1) across ensembles
18  real, pointer, dimension(:,:,:,:) :: v=>null() !<layer meridional velocity (m s-1) across ensembles
19  end type ocean_control_struct
20 
21  !> Example of a profile type
22  type, public :: ocean_profile_type
23  integer :: inst_type !< A numeric code indicating the type of instrument (e.g. ARGO drifter, CTD, ...)
24  logical :: initialized !< a True value indicates that this profile has been allocated for use
25  logical :: colocated !< a True value indicated that the measurements of (num_variables) data are
26  !! co-located in space-time
27  integer :: ensemble_size !< size of the ensemble of model states used in association with this profile
28  integer :: num_variables !< number of measurement types associated with this profile.
29  integer, pointer, dimension(:) :: var_id !< variable ids are defined by the ocean_types module
30  integer :: platform !< platform types are defined by platform class (e.g. MOORING, DROP, etc.)
31  !! and instrument type (XBT, CDT, etc.)
32  integer :: levels !< number of levels in the current profile
33  integer :: basin_mask !< 1:Southern Ocean, 2:Atlantic Ocean, 3:Pacific Ocean,
34  !! 4:Arctic Ocean, 5:Indian Ocean, 6:Mediterranean Sea, 7:Black Sea,
35  !! 8:Hudson Bay, 9:Baltic Sea, 10:Red Sea, 11:Persian Gulf
36  integer :: profile_flag !< an overall flag for the profile
37  real :: lat !< latitude [degrees_N]
38  real :: lon !< longitude [degrees_E]
39  logical :: accepted !< logical flag to disable a profile
40  type(time_type) :: time_window !< The time window associated with this profile [s]
41  real, pointer, dimension(:) :: obs_error !< The observation error by variable
42  real :: loc_dist !< The impact radius of this observation (m)
43  type(ocean_profile_type), pointer :: next=>null() !< all profiles are stored as linked list.
44  type(ocean_profile_type), pointer :: prev=>null() !< previous
45  type(ocean_profile_type), pointer :: cnext=>null() !< current profiles are stored as linked list.
46  type(ocean_profile_type), pointer :: cprev=>null() !< previous
47  integer :: nbr_xi !< x nearest neighbor model gridpoint for the profile
48  integer :: nbr_yi !< y nearest neighbor model gridpoint for the profile
49  real :: nbr_dist !< distance to nearest neighbor model gridpoint
50  logical :: compute !< profile is within current compute domain
51  real, dimension(:,:), pointer :: depth => null() !< depth of measurement [m]
52  real, dimension(:,:), pointer :: data => null() !< data by variable type
53  integer, dimension(:,:), pointer :: flag => null() !< flag by depth and variable type
54  real, dimension(:,:,:), pointer :: forecast => null() !< ensemble member first guess
55  real, dimension(:,:,:), pointer :: analysis => null() !< ensemble member analysis
56  type(forward_operator_type), pointer :: obs_def => null() !< observation forward operator
57  type(time_type) :: time !< profile time type
58  real :: i_index !< model longitude indices respectively
59  real :: j_index !< model latitude indices respectively
60  real, dimension(:,:), pointer :: k_index !< model depth indices
61  type(time_type) :: tdiff !< difference between model time and observation time
62  character(len=128) :: filename !< a filename
63  end type ocean_profile_type
64 
65  !> Example forward operator type.
66  type, public :: forward_operator_type
67  integer :: num !< how many?
68  integer, dimension(2) :: state_size !< for
69  integer, dimension(:), pointer :: state_var_index !< for flattened data
70  integer, dimension(:), pointer :: i_index !< i-dimension index
71  integer, dimension(:), pointer :: j_index !< j-dimension index
72  real, dimension(:), pointer :: coef !< coefficient
73  end type forward_operator_type
74 
75  !> Grid type for DA
76  type, public :: grid_type
77  real, pointer, dimension(:,:) :: x=>null() !< x
78  real, pointer, dimension(:,:) :: y=>null() !< y
79  real, pointer, dimension(:,:,:) :: z=>null() !< z
80  real, pointer, dimension(:,:,:) :: h=>null() !< h
81  real, pointer, dimension(:,:) :: basin_mask => null() !< basin mask
82  real, pointer, dimension(:,:,:) :: mask => null() !< land mask?
83  real, pointer, dimension(:,:) :: bathyt => null() !< bathymetry at T points
84  logical :: tripolar_n !< True for tripolar grids
85  integer :: ni !< ni
86  integer :: nj !< nj
87  integer :: nk !< nk
88  end type grid_type
89 
90 end module ocean_da_types_mod
Example forward operator type.
Wraps the FMS time manager functions.
Example type for ocean ensemble DA state.
Dummy aata structures and methods for ocean data assimilation.