psmile_multimap.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2010, DKRZ, Hamburg, Germany.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !
00006 ! !DESCRIPTION:
00007 !
00008 ! Module psmile_multimap contains a data structure which is similar to
00009 ! the associative container class multimap of the c++ stl
00010 ! (http://www.cplusplus.com/reference/stl/multimap/). It uses integer
00011 ! keys and values.
00012 !
00013 !
00014 ! !REVISION HISTORY:
00015 !
00016 !   Date      Programmer   Description
00017 ! ----------  ----------   -----------
00018 ! 28.10.10    M. Hanke     created
00019 !
00020 !----------------------------------------------------------------------
00021 !
00022 !  $Id: psmile_multimap.F90 2751 2010-11-19 13:53:28Z hanke $
00023 !  $Author: hanke $
00024 !
00025 !----------------------------------------------------------------------
00026 
00027 ! whoever forgot to add the import statement to Fortran 90 was *****
00028 module psmile_multimap_fortran_90_is_no_good
00029    type key_type
00030       integer, pointer :: values (:)
00031    end type key_type
00032 
00033    type multimap
00034       type(key_type), pointer :: keys(:)
00035    end type multimap
00036 end module psmile_multimap_fortran_90_is_no_good
00037 
00038 module psmile_multimap
00039 
00040    use psmile_multimap_fortran_90_is_no_good
00041  
00042    implicit none
00043 
00044    interface
00045 
00046       subroutine init_multimap (this)
00047          use psmile_multimap_fortran_90_is_no_good
00048          type(multimap), intent(inout) :: this
00049       end subroutine init_multimap
00050 
00051       subroutine free_multimap (this)
00052          use psmile_multimap_fortran_90_is_no_good
00053          type(multimap), intent(inout) :: this
00054          integer :: i
00055       end subroutine free_multimap
00056 
00057       subroutine add_pair (this, key, value)
00058          use psmile_multimap_fortran_90_is_no_good
00059          type(multimap), intent(inout) :: this
00060          integer, intent(in) :: key, value
00061          type(key_type), pointer :: temp_keys(:)
00062       end subroutine add_pair
00063 
00064       integer function get_num_values (this, key)
00065          use psmile_multimap_fortran_90_is_no_good
00066          type(multimap), intent(inout) :: this
00067          integer, intent(in) :: key
00068       end function get_num_values
00069 
00070       function get_values(this, key, num_values)
00071          use psmile_multimap_fortran_90_is_no_good
00072          type(multimap), intent(inout) :: this
00073          integer, intent(in) :: key, num_values
00074          integer :: get_values(num_values)
00075       end function get_values
00076 
00077       integer function get_value(this, key, value_idx)
00078          use psmile_multimap_fortran_90_is_no_good
00079          type(multimap), intent(inout) :: this
00080          integer, intent(in) :: key, value_idx
00081       end function
00082 
00083       subroutine init_keys (keys)
00084          use psmile_multimap_fortran_90_is_no_good
00085          type(key_type), intent(inout) :: keys(:)
00086       end subroutine
00087 
00088       subroutine rm_key (this, key)
00089          use psmile_multimap_fortran_90_is_no_good
00090          type(multimap), intent(inout) :: this
00091          integer, intent(in) :: key
00092       end subroutine
00093 
00094       logical function is_valid_key(this, key)
00095          use psmile_multimap_fortran_90_is_no_good
00096          type(multimap), intent(in) :: this
00097          integer, intent(in) :: key
00098       end function
00099 
00100       integer function get_num_valid_keys (this)
00101          use psmile_multimap_fortran_90_is_no_good
00102          type(multimap), intent(in) :: this
00103       end function get_num_valid_keys
00104 
00105    end interface
00106 
00107 end module psmile_multimap

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1