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    end type reduced_gauss_grid_data
00052 
00053    interface psmile_gauss_local_1d_to_3d
00054 
00055       function psmile_gauss_1_local_1d_to_3d (grid_id, idx)
00056 
00057          use psmile_common, only : ndim_3d
00058 
00059          integer, intent (in) :: grid_id, idx
00060 
00061          integer              :: psmile_gauss_1_local_1d_to_3d (ndim_3d)
00062       end function psmile_gauss_1_local_1d_to_3d
00063 
00064       function psmile_gauss_n_local_1d_to_3d (grid_id, idx, num_points)
00065 
00066          use psmile_common, only : ndim_3d
00067 
00068          integer, intent (in) :: num_points
00069          integer, intent (in) :: grid_id, idx(num_points)
00070 
00071          integer              :: psmile_gauss_n_local_1d_to_3d (ndim_3d, num_points)
00072       end function psmile_gauss_n_local_1d_to_3d
00073 
00074    end interface psmile_gauss_local_1d_to_3d
00075 
00076    interface
00077 
00078       subroutine psmile_init_gauss_data (grid_id, nbr_points_per_lat)
00079 
00080          integer, intent(in) :: grid_id
00081          integer, intent(in) :: nbr_points_per_lat(:)
00082       end subroutine psmile_init_gauss_data
00083 
00084       subroutine psmile_gauss_gen_aux_grid (grid_id)
00085 
00086          integer, intent(in) :: grid_id
00087       end subroutine
00088 
00089       subroutine psmile_gauss_gen_aux_grid_map (grid_id)
00090 
00091          integer, intent (in) :: grid_id
00092       end subroutine psmile_gauss_gen_aux_grid_map
00093 
00094       subroutine psmile_free_aux_grid_data (grid_id)
00095 
00096          integer, intent (in) :: grid_id
00097       end subroutine psmile_free_aux_grid_data
00098 
00099 
00100       integer function get_gauss_neighbour_cell (idx, nbr_points_lat, nbr_points_lat_neigh)
00101 
00102          integer, intent (in) :: idx,            
00103                                  nbr_points_lat, 
00104                                  nbr_points_lat_neigh
00105       end function get_gauss_neighbour_cell
00106 
00107       integer function get_gauss_opposite_neighbour_cell (idx, nbr_points_lat, nbr_points_lat_neigh)
00108 
00109          integer, intent (in) :: idx,            
00110                                  nbr_points_lat, 
00111                                  nbr_points_lat_neigh
00112       end function get_gauss_opposite_neighbour_cell
00113 
00114       integer function psmile_gauss_blockidx_to_glat (grid_id, block_idx)
00115 
00116          integer, intent (in) :: grid_id, block_idx
00117       end function psmile_gauss_blockidx_to_glat
00118 
00119       function psmile_gauss_get_bicu_stencil (grid_id, base)
00120 
00121          use psmile_common, only : ndim_3d
00122 
00123          integer, intent (in) :: grid_id, base(ndim_3d)
00124 
00125          integer :: psmile_gauss_get_bicu_stencil(ndim_3d, 16)
00126       end function psmile_gauss_get_bicu_stencil
00127 
00128       function psmile_gauss_shift_bicu_stencil (grid_id, base, shift)
00129 
00130          use psmile_common, only : ndim_3d
00131 
00132          integer, intent (in) :: grid_id, base (ndim_3d), shift(ndim_3d)
00133 
00134          integer :: psmile_gauss_shift_bicu_stencil (ndim_3d, 16)
00135       end function psmile_gauss_shift_bicu_stencil
00136 
00137       function psmile_gauss_get_neigh_stencil (grid_id, base)
00138 
00139          use psmile_common, only : ndim_3d
00140 
00141          integer, intent (in) :: grid_id, base (ndim_3d)
00142 
00143          integer :: psmile_gauss_get_neigh_stencil (ndim_3d, 9)
00144       end function psmile_gauss_get_neigh_stencil
00145 
00146       function psmile_gauss_get_bili_stencil (grid_id, base)
00147 
00148          use psmile_common, only : ndim_3d
00149 
00150          integer, intent (in) :: grid_id, base(ndim_3d)
00151 
00152          integer :: psmile_gauss_get_bili_stencil(ndim_3d, 4)
00153       end function psmile_gauss_get_bili_stencil
00154 
00155       function psmile_gauss_shift_bili_stencil (grid_id, base, shift)
00156 
00157          use psmile_common, only : ndim_3d
00158 
00159          integer, intent (in) :: grid_id, base (ndim_3d), shift(ndim_3d)
00160 
00161          integer :: psmile_gauss_shift_bili_stencil (ndim_3d, 4)
00162       end function psmile_gauss_shift_bili_stencil
00163 
00164       function psmile_gauss_3d_to_global_1d (grid_id, points_3d, num_points)
00165 
00166          use psmile_common, only : ndim_3d
00167 
00168          integer, intent(in) :: grid_id, num_points
00169          integer, intent(in) :: points_3d(ndim_3d, num_points)
00170 
00171          integer :: psmile_gauss_3d_to_global_1d(num_points)
00172       end function psmile_gauss_3d_to_global_1d
00173 
00174       function psmile_gauss_1d_global_to_local (grid_id, points_1d, num_points, &
00175                                                 fill_value, inc_remote_neigh)
00176 
00177          integer, intent(in)           :: grid_id, num_points, fill_value
00178          integer, intent(in)           :: points_1d(num_points)
00179          logical, intent(in), optional :: inc_remote_neigh 
00180 
00181          integer :: psmile_gauss_1d_global_to_local(num_points)
00182       end function psmile_gauss_1d_global_to_local
00183 
00184       function psmile_gauss_3d_to_local_1d (grid_id, points_3d, num_points, &
00185                                                 fill_value, inc_remote_neigh)
00186          use psmile_common, only : ndim_3d
00187 
00188          integer, intent(in)           :: grid_id, num_points, fill_value
00189          integer, intent(in)           :: points_3d(ndim_3d, num_points)
00190          logical, intent(in), optional :: inc_remote_neigh 
00191 
00192          integer :: psmile_gauss_3d_to_local_1d(num_points)
00193       end function psmile_gauss_3d_to_local_1d
00194 
00195    end interface
00196 
00197 end module psmile_grid_reduced_gauss

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1