psmile_enddef_msg_locs_utils.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 ! This file contains routines for initiating objects of the derived
00009 ! type enddef_msg_locations. In addition there are two routines
00010 ! which allow to convert between object from this type and an integer
00011 ! array, which is sendable via MPI.
00012 !
00013 !
00014 ! !REVISION HISTORY:
00015 !
00016 !   Date      Programmer   Description
00017 ! ----------  ----------   -----------
00018 ! 06.12.10    M. Hanke     created
00019 !
00020 !----------------------------------------------------------------------
00021 !
00022 !  $Id: psmile_enddef_msg_locs_utils.F90 2887 2011-01-14 09:25:49Z redler $
00023 !  $Author: redler $
00024 !
00025 !----------------------------------------------------------------------
00026 
00027 subroutine psmile_init_enddef_msg_locs (msg_locations)
00028    use psmile_common, only : enddef_msg_locations, &
00029                              psmile_undef
00030 
00031    implicit none
00032 
00033    type (enddef_msg_locations), intent (out) :: msg_locations
00034 
00035    msg_locations%requires_conserv_remap = psmile_undef
00036    msg_locations%msg_len                = psmile_undef
00037    msg_locations%transi_out_id          = psmile_undef
00038    msg_locations%src_rank               = psmile_undef
00039    msg_locations%transi_in_id           = psmile_undef
00040    msg_locations%tgt_method_id          = psmile_undef
00041    msg_locations%tgt_var_id             = psmile_undef
00042    msg_locations%relative_msg_tag       = psmile_undef
00043    msg_locations%num_locs_coupler       = psmile_undef
00044    msg_locations%num_locs_direct        = psmile_undef
00045    msg_locations%further_msg_flag       = psmile_undef
00046    msg_locations%epio_id                = psmile_undef
00047    msg_locations%trs_rank               = psmile_undef
00048    msg_locations%num_points_direct      = psmile_undef
00049    msg_locations%num_areas_direct       = psmile_undef
00050 
00051 end subroutine psmile_init_enddef_msg_locs
00052 
00053 subroutine psmile_pack_msg_locations (msg_locations, buffer)
00054    use psmile_common, only : enddef_msg_locations, msgloc_size
00055 
00056    implicit none
00057 
00058    type (enddef_msg_locations), intent (in) :: msg_locations
00059    integer, intent (out)                    :: buffer(msgloc_size)
00060 
00061    buffer  (1) = msg_locations%requires_conserv_remap
00062    buffer  (2) = msg_locations%msg_len
00063    buffer  (3) = msg_locations%transi_out_id
00064    buffer  (4) = msg_locations%src_rank
00065    buffer  (5) = msg_locations%transi_in_id
00066    buffer  (6) = msg_locations%tgt_method_id
00067    buffer  (7) = msg_locations%tgt_var_id
00068    buffer  (8) = msg_locations%relative_msg_tag
00069    buffer  (9) = msg_locations%num_locs_coupler
00070    buffer (10) = msg_locations%num_locs_direct
00071    buffer (11) = msg_locations%further_msg_flag
00072    buffer (12) = msg_locations%epio_id
00073    buffer (13) = msg_locations%trs_rank
00074    buffer (14) = msg_locations%num_points_direct
00075    buffer (15) = msg_locations%num_areas_direct
00076 #ifdef DEBUGX
00077   PRINT *, ' pack requires_conserv_remap ', buffer  (1)
00078   PRINT *, ' pack msg_len                ', buffer  (2)
00079   PRINT *, ' pack transi_out_id          ', buffer  (3)
00080   PRINT *, ' pack src_rank               ', buffer  (4)
00081   PRINT *, ' pack transi_in_id           ', buffer  (5)
00082   PRINT *, ' pack tgt_method_id          ', buffer  (6)
00083   PRINT *, ' pack tgt_var_id             ', buffer  (7)
00084   PRINT *, ' pack relative_msg_tag       ', buffer  (8)
00085   PRINT *, ' pack num_locs_coupler       ', buffer  (9)
00086   PRINT *, ' pack num_locs_direct        ', buffer  (10)
00087   PRINT *, ' pack further_msg_flag       ', buffer  (11)
00088   PRINT *, ' pack epio_id                ', buffer  (12)
00089   PRINT *, ' pack trs_rank               ', buffer  (13)
00090   PRINT *, ' pack num_points_direct      ', buffer  (14)
00091   PRINT *, ' pack num_areas_direct       ', buffer  (15)
00092 #endif
00093 
00094 end subroutine psmile_pack_msg_locations
00095 
00096 subroutine psmile_unpack_msg_locations (msg_locations, buffer)
00097    use psmile_common, only : enddef_msg_locations, msgloc_size
00098 
00099    implicit none
00100 
00101    type (enddef_msg_locations), intent (out) :: msg_locations
00102    integer, intent (in)                      :: buffer(msgloc_size)
00103 
00104    msg_locations%requires_conserv_remap = buffer  (1)
00105    msg_locations%msg_len                = buffer  (2)
00106    msg_locations%transi_out_id          = buffer  (3)
00107    msg_locations%src_rank               = buffer  (4)
00108    msg_locations%transi_in_id           = buffer  (5)
00109    msg_locations%tgt_method_id          = buffer  (6)
00110    msg_locations%tgt_var_id             = buffer  (7)
00111    msg_locations%relative_msg_tag       = buffer  (8)
00112    msg_locations%num_locs_coupler       = buffer  (9)
00113    msg_locations%num_locs_direct        = buffer (10)
00114    msg_locations%further_msg_flag       = buffer (11)
00115    msg_locations%epio_id                = buffer (12)
00116    msg_locations%trs_rank               = buffer (13)
00117    msg_locations%num_points_direct      = buffer (14)
00118    msg_locations%num_areas_direct       = buffer (15)
00119 #ifdef DEBUGX
00120   PRINT *, ' unpack requires_conserv_remap ', buffer  (1)
00121   PRINT *, ' unpack msg_len                ', buffer  (2)
00122   PRINT *, ' unpack transi_out_id          ', buffer  (3)
00123   PRINT *, ' unpack src_rank               ', buffer  (4)
00124   PRINT *, ' unpack transi_in_id           ', buffer  (5)
00125   PRINT *, ' unpack tgt_method_id          ', buffer  (6)
00126   PRINT *, ' unpack tgt_var_id             ', buffer  (7)
00127   PRINT *, ' unpack relative_msg_tag       ', buffer  (8)
00128   PRINT *, ' unpack num_locs_coupler       ', buffer  (9)
00129   PRINT *, ' unpack num_locs_direct        ', buffer  (10)
00130   PRINT *, ' unpack further_msg_flag       ', buffer  (11)
00131   PRINT *, ' unpack epio_id                ', buffer  (12)
00132   PRINT *, ' unpack trs_rank               ', buffer  (13)
00133   PRINT *, ' unpack num_points_direct      ', buffer  (14)
00134   PRINT *, ' unpack num_areas_direct       ', buffer  (15)
00135 #endif
00136 
00137 end subroutine psmile_unpack_msg_locations

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1