-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add_dens_deriv_diag' of github.com:gmacgilchrist/MOM6 i…
…nto add_dens_deriv_diag
- Loading branch information
Showing
49 changed files
with
262 additions
and
3,947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ODA_hooks | ||
========= | ||
|
||
These APIs reflect those for the ocean data assimilation hooks similar to https://github.com/MJHarrison-GFDL/MOM6_DA_hooks | ||
|
||
The modules in this directory do not do any computations. They simply reflect the APIs of the above package. | ||
|
||
- kdtree.f90 - would come from https://github.com/travissluka/geoKdTree | ||
- ocean_da_core.F90, ocean_da_types.F90, write_ocean_obs.F90 were copied from https://github.com/MJHarrison-GFDL/MOM6_DA_hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!> A null version of K-d tree from geoKdTree | ||
module kdtree | ||
implicit none | ||
private | ||
|
||
public :: kd_root | ||
|
||
!> A K-d tree tpe | ||
type kd_root | ||
integer :: dummy !< To stop a compiler from doing nothing | ||
end type kd_root | ||
end module kdtree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
!> A set of dummy interfaces for compiling the MOM6 DA driver code. | ||
module ocean_da_core_mod | ||
! MOM modules | ||
use MOM_domains, only : MOM_domain_type, domain2D | ||
use MOM_time_manager, only : time_type, set_time, get_date | ||
! ODA_tools modules | ||
use ocean_da_types_mod, only : ocean_profile_type, grid_type | ||
use kdtree, only : kd_root | ||
|
||
implicit none | ||
private | ||
public :: ocean_da_core_init | ||
public :: get_profiles | ||
|
||
contains | ||
|
||
!> Initializes the MOM6 DA driver code. | ||
subroutine ocean_da_core_init(Domain, global_grid, Profiles, model_time) | ||
type(domain2D), pointer, intent(in) :: Domain !< A MOM domain type | ||
type(grid_type), pointer, intent(in) :: global_grid !< The global ODA horizontal grid type | ||
type(ocean_profile_type), pointer :: Profiles !< This is an unstructured recursive list of profiles | ||
!! which are either within the localized domain corresponding | ||
!! to the Domain argument, or the global profile list (type). | ||
type(time_type), intent(in) :: model_time !< The current model time type. | ||
|
||
|
||
|
||
Profiles=>NULL() | ||
return | ||
end subroutine ocean_da_core_init | ||
|
||
|
||
!> Get profiles obs within the current analysis interval | ||
subroutine get_profiles(model_time, Profiles, Current_profiles) | ||
type(time_type), intent(in) :: model_time !< The current analysis time. | ||
type(ocean_profile_type), pointer :: Profiles !< The full recursive list of profiles. | ||
type(ocean_profile_type), pointer :: Current_profiles !< A returned list of profiles for the | ||
!! current analysis step. | ||
|
||
Profiles=>NULL() | ||
Current_Profiles=>NULL() | ||
|
||
return | ||
end subroutine get_profiles | ||
|
||
|
||
end module ocean_da_core_mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
!> Dummy aata structures and methods for ocean data assimilation. | ||
module ocean_da_types_mod | ||
|
||
use MOM_time_manager, only : time_type | ||
|
||
implicit none | ||
|
||
private | ||
|
||
|
||
!> Example type for ocean ensemble DA state | ||
type, public :: OCEAN_CONTROL_STRUCT | ||
integer :: ensemble_size | ||
real, pointer, dimension(:,:,:) :: SSH=>NULL() !<sea surface height (m) across ensembles | ||
real, pointer, dimension(:,:,:,:) :: h=>NULL() !<layer thicknesses (m or kg) across ensembles | ||
real, pointer, dimension(:,:,:,:) :: T=>NULL() !<layer potential temperature (degC) across ensembles | ||
real, pointer, dimension(:,:,:,:) :: S=>NULL() !<layer salinity (psu or g kg-1) across ensembles | ||
real, pointer, dimension(:,:,:,:) :: U=>NULL() !<layer zonal velocity (m s-1) across ensembles | ||
real, pointer, dimension(:,:,:,:) :: V=>NULL() !<layer meridional velocity (m s-1) across ensembles | ||
end type OCEAN_CONTROL_STRUCT | ||
|
||
!> Example of a profile type | ||
type, public :: ocean_profile_type | ||
integer :: inst_type !< A numeric code indicating the type of instrument (e.g. ARGO drifter, CTD, ...) | ||
logical :: initialized !< a True value indicates that this profile has been allocated for use | ||
logical :: colocated !< a True value indicated that the measurements of (num_variables) data are | ||
!! co-located in space-time | ||
integer :: ensemble_size !< size of the ensemble of model states used in association with this profile | ||
integer :: num_variables !< number of measurement types associated with this profile. | ||
integer, pointer, dimension(:) :: var_id !< variable ids are defined by the ocean_types module | ||
integer :: platform !< platform types are defined by platform class (e.g. MOORING, DROP, etc.) | ||
!! and instrument type (XBT, CDT, etc.) | ||
integer :: levels !< number of levels in the current profile | ||
integer :: basin_mask !< 1:Southern Ocean, 2:Atlantic Ocean, 3:Pacific Ocean, | ||
!! 4:Arctic Ocean, 5:Indian Ocean, 6:Mediterranean Sea, 7:Black Sea, | ||
!! 8:Hudson Bay, 9:Baltic Sea, 10:Red Sea, 11:Persian Gulf | ||
integer :: profile_flag !< an overall flag for the profile | ||
real :: lat, lon !< latitude and longitude (degrees E and N) | ||
logical :: accepted !< logical flag to disable a profile | ||
type(time_type) :: time_window !< The time window associated with this profile [s] | ||
real, pointer, dimension(:) :: obs_error !< The observation error by variable | ||
real :: loc_dist !< The impact radius of this observation (m) | ||
type(ocean_profile_type), pointer :: next=>NULL() !< all profiles are stored as linked list. | ||
type(ocean_profile_type), pointer :: prev=>NULL() | ||
type(ocean_profile_type), pointer :: cnext=>NULL() ! current profiles are stored as linked list. | ||
type(ocean_profile_type), pointer :: cprev=>NULL() | ||
integer :: nbr_xi, nbr_yi ! nearest neighbor model gridpoint for the profile | ||
real :: nbr_dist ! distance to nearest neighbor model gridpoint | ||
logical :: compute !< profile is within current compute domain | ||
real, dimension(:,:), pointer :: depth => NULL() !< depth of measurement [m] | ||
real, dimension(:,:), pointer :: data => NULL() !< data by variable type | ||
integer, dimension(:,:), pointer :: flag => NULL() !< flag by depth and variable type | ||
real, dimension(:,:,:), pointer :: forecast => NULL() !< ensemble member first guess | ||
real, dimension(:,:,:), pointer :: analysis => NULL() !< ensemble member analysis | ||
type(forward_operator_type), pointer :: obs_def => NULL() !< observation forward operator | ||
type(time_type) :: time !< profile time type | ||
real :: i_index, j_index !< model longitude and latitude indices respectively | ||
real, dimension(:,:), pointer :: k_index !< model depth indices | ||
type(time_type) :: tdiff !< difference between model time and observation time | ||
character(len=128) :: filename | ||
end type ocean_profile_type | ||
|
||
!> Example forward operator type. | ||
type, public :: forward_operator_type | ||
integer :: num | ||
integer, dimension(2) :: state_size !< for | ||
integer, dimension(:), pointer :: state_var_index !< for flattened data | ||
integer, dimension(:), pointer :: i_index !< i-dimension index | ||
integer, dimension(:), pointer :: j_index !< j-dimension index | ||
real, dimension(:), pointer :: coef | ||
end type forward_operator_type | ||
|
||
!> Grid type for DA | ||
type, public :: grid_type | ||
real, pointer, dimension(:,:) :: x=>NULL(), y=>NULL() | ||
real, pointer, dimension(:,:,:) :: z=>NULL() | ||
real, pointer, dimension(:,:,:) :: h=>NULL() | ||
real, pointer, dimension(:,:) :: basin_mask => NULL() | ||
real, pointer, dimension(:,:,:) :: mask => NULL() | ||
real, pointer, dimension(:,:) :: bathyT => NULL() | ||
logical :: tripolar_N | ||
integer :: ni, nj, nk | ||
end type grid_type | ||
|
||
end module ocean_da_types_mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
!> Dummy interfaces for writing ODA data | ||
module write_ocean_obs_mod | ||
|
||
|
||
use ocean_da_types_mod, only : ocean_profile_type | ||
use MOM_time_manager, only : time_type, get_time, set_date | ||
|
||
implicit none | ||
|
||
private | ||
|
||
public :: open_profile_file, write_profile, close_profile_file, & | ||
write_ocean_obs_init | ||
|
||
contains | ||
|
||
!> Open a profile file | ||
integer function open_profile_file(name, nvar, grid_lon, grid_lat,thread,fset) | ||
character(len=*), intent(in) :: name !< File name | ||
integer, intent(in), optional :: nvar !< Number of variables | ||
real, dimension(:), optional, intent(in) :: grid_lon !< Longitude [degreeE] | ||
real, dimension(:), optional, intent(in) :: grid_lat !< Latitude [degreeN] | ||
integer, intent(in), optional :: thread !< Thread | ||
integer, intent(in), optional :: fset !< File set | ||
|
||
open_profile_file=-1 | ||
end function open_profile_file | ||
|
||
!> Write a profile | ||
subroutine write_profile(unit,profile) | ||
integer, intent(in) :: unit !< File unit | ||
type(ocean_profile_type), intent(in) :: profile !< Profile | ||
|
||
return | ||
end subroutine write_profile | ||
|
||
!> Close a profile file | ||
subroutine close_profile_file(unit) | ||
integer, intent(in) :: unit !< File unit | ||
|
||
return | ||
end subroutine close_profile_file | ||
|
||
!> Initialize write_ocean_obs module | ||
subroutine write_ocean_obs_init() | ||
|
||
return | ||
end subroutine write_ocean_obs_init | ||
|
||
end module write_ocean_obs_mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule MOM6_DA_hooks
deleted from
6d8834
Submodule geoKdTree
deleted from
a4670b
Oops, something went wrong.