psmile_grid_reduced_gauss.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2011, DKRZ, Hamburg, Germany.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !------------------------------------------------------------------------
00005 
00006 module psmile_grid_reduced_gauss
00007 
00008    use psmile_common, only : ndim_3d, dble_vector
00009 
00010    type block_info
00011       integer :: global_1d_start_idx, global_1d_end_idx
00012       integer :: local_1d_start_idx, local_1d_end_idx
00013       integer :: global_3d_start_idx(ndim_3d), 
00014                  global_3d_end_idx(ndim_3d)
00015    end type block_info
00016 
00017    type reduced_gauss_grid_data
00018 
00019       ! global grid information
00020       integer, pointer :: nbr_points_per_lat(:)
00021 
00022       ! auxiliary grid
00023       type (dble_vector) :: aux_corners (ndim_3d) ! This should replaced with type(corner_block)
00024                                                   ! or something similar. However, due to the
00025                                                   ! current design of module psmile this would
00026                                                   ! create cyclic dependencies.
00027 
00028       ! mapping of 3d aux grid coordinates to 1d local reduced gauss grid coordinates
00029       integer, pointer :: aux_3d_to_local_1d_map(:,:,:)
00030 
00031       ! local grid information
00032       integer, pointer :: local_1d_stencil_lookup(:,:) ! for every local cell index this array
00033                                                        ! contains the indices of the 15
00034                                                        ! neighbours for the bicubic stencil. It
00035                                                        ! is set in psmile_gauss_get_neighbours.
00036                                                        ! The neighbours are arrangend as follos
00037                                                        ! (6 is the base point of the stencil):
00038                                                        !   13  14  15  16
00039                                                        !    9  10  11  12
00040                                                        !    5   6   7   8
00041                                                        !    1   2   3   4
00042                                                        ! memory layout:
00043                                                        ! local_1d_stencil_lookup (16, nloc)
00044 
00045       type (block_info), pointer :: local_block_info(:) ! contains some additional data on the
00046                                                         ! blocks of the local parition. This is
00047                                                         ! used of optimisation purpose
00048       ! transformation information
00049       integer, pointer :: global_lat_offsets(:)
00050 
00051       ! contains global 1d indices of the remote points that are stored locally
00052       integer, pointer              :: remote_index(:)
00053 
00054    end type reduced_gauss_grid_data
00055 
00056    interface psmile_gauss_local_1d_to_3d
00057 
00058       function psmile_gauss_1_local_1d_to_3d (grid_id, idx)
00059 
00060          use psmile_common, only : ndim_3d
00061 
00062          integer, intent (in) :: grid_id, idx
00063 
00064          integer              :: psmile_gauss_1_local_1d_to_3d (ndim_3d)
00065       end function psmile_gauss_1_local_1d_to_3d
00066 
00067       function psmile_gauss_n_local_1d_to_3d (grid_id, idx, num_points)
00068 
00069          use psmile_common, only : ndim_3d
00070 
00071          integer, intent (in) :: num_points
00072          integer, intent (in) :: grid_id, idx(num_points)
00073 
00074          integer              :: psmile_gauss_n_local_1d_to_3d (ndim_3d, num_points)
00075       end function psmile_gauss_n_local_1d_to_3d
00076 
00077    end interface psmile_gauss_local_1d_to_3d
00078 
00079    interface
00080 
00081       subroutine psmile_init_gauss_data (grid_id, nbr_points_per_lat)
00082 
00083          integer, intent(in) :: grid_id
00084          integer, intent(in) :: nbr_points_per_lat(:)
00085       end subroutine psmile_init_gauss_data
00086 
00087       subroutine psmile_gauss_gen_aux_grid (grid_id)
00088 
00089          integer, intent(in) :: grid_id
00090       end subroutine
00091 
00092       subroutine psmile_gauss_gen_aux_grid_map (grid_id)
00093 
00094          integer, intent (in) :: grid_id
00095       end subroutine psmile_gauss_gen_aux_grid_map
00096 
00097       subroutine psmile_free_aux_grid_data (grid_id)
00098 
00099          integer, intent (in) :: grid_id
00100       end subroutine psmile_free_aux_grid_data
00101 
00102 
00103       integer function get_gauss_neighbour_cell (idx, nbr_points_lat, nbr_points_lat_neigh)
00104 
00105          integer, intent (in) :: idx,            
00106                                  nbr_points_lat, 
00107                                  nbr_points_lat_neigh
00108       end function get_gauss_neighbour_cell
00109 
00110       integer function get_gauss_opposite_neighbour_cell (idx, nbr_points_lat, nbr_points_lat_neigh)
00111 
00112          integer, intent (in) :: idx,            
00113                                  nbr_points_lat, 
00114                                  nbr_points_lat_neigh
00115       end function get_gauss_opposite_neighbour_cell
00116 
00117       integer function psmile_gauss_blockidx_to_glat (grid_id, block_idx)
00118 
00119          integer, intent (in) :: grid_id, block_idx
00120       end function psmile_gauss_blockidx_to_glat
00121 
00122       function psmile_gauss_get_bicu_stencil (grid_id, base)
00123 
00124          use psmile_common, only : ndim_3d
00125 
00126          integer, intent (in) :: grid_id, base(ndim_3d)
00127 
00128          integer :: psmile_gauss_get_bicu_stencil(ndim_3d, 16)
00129       end function psmile_gauss_get_bicu_stencil
00130 
00131       function psmile_gauss_shift_bicu_stencil (grid_id, base, shift)
00132 
00133          use psmile_common, only : ndim_3d
00134 
00135          integer, intent (in) :: grid_id, base (ndim_3d), shift(ndim_3d)
00136 
00137          integer :: psmile_gauss_shift_bicu_stencil (ndim_3d, 16)
00138       end function psmile_gauss_shift_bicu_stencil
00139 
00140       function psmile_gauss_get_neigh_stencil (grid_id, base)
00141 
00142          use psmile_common, only : ndim_3d
00143 
00144          integer, intent (in) :: grid_id, base (ndim_3d)
00145 
00146          integer :: psmile_gauss_get_neigh_stencil (ndim_3d, 9)
00147       end function psmile_gauss_get_neigh_stencil
00148 
00149       function psmile_gauss_get_bili_stencil (grid_id, base)
00150 
00151          use psmile_common, only : ndim_3d
00152 
00153          integer, intent (in) :: grid_id, base(ndim_3d)
00154 
00155          integer :: psmile_gauss_get_bili_stencil(ndim_3d, 4)
00156       end function psmile_gauss_get_bili_stencil
00157 
00158       function psmile_gauss_shift_bili_stencil (grid_id, base, shift)
00159 
00160          use psmile_common, only : ndim_3d
00161 
00162          integer, intent (in) :: grid_id, base (ndim_3d), shift(ndim_3d)
00163 
00164          integer :: psmile_gauss_shift_bili_stencil (ndim_3d, 4)
00165       end function psmile_gauss_shift_bili_stencil
00166 
00167       function psmile_gauss_3d_to_global_1d (grid_id, points_3d, num_points)
00168 
00169          use psmile_common, only : ndim_3d
00170 
00171          integer, intent(in) :: grid_id, num_points
00172          integer, intent(in) :: points_3d(ndim_3d, num_points)
00173 
00174          integer :: psmile_gauss_3d_to_global_1d(num_points)
00175       end function psmile_gauss_3d_to_global_1d
00176 
00177       function psmile_gauss_1d_global_to_local (grid_id, points_1d, num_points, &
00178                                                 fill_value, inc_remote_neigh)
00179 
00180          integer, intent(in)           :: grid_id, num_points, fill_value
00181          integer, intent(in)           :: points_1d(num_points)
00182          logical, intent(in), optional :: inc_remote_neigh 
00183 
00184          integer :: psmile_gauss_1d_global_to_local(num_points)
00185       end function psmile_gauss_1d_global_to_local
00186 
00187       function psmile_gauss_3d_to_local_1d (grid_id, points_3d, num_points, &
00188                                                 fill_value, inc_remote_neigh)
00189          use psmile_common, only : ndim_3d
00190 
00191          integer, intent(in)           :: grid_id, num_points, fill_value
00192          integer, intent(in)           :: points_3d(ndim_3d, num_points)
00193          logical, intent(in), optional :: inc_remote_neigh 
00194 
00195          integer :: psmile_gauss_3d_to_local_1d(num_points)
00196       end function psmile_gauss_3d_to_local_1d
00197 
00198    end interface
00199 
00200 end module psmile_grid_reduced_gauss

Generated on 1 Dec 2011 for Oasis4 by  doxygen 1.6.1