psmile_store_data_partition.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 ! The routine psmile_store_data_partition stores the data provided
00009 ! by the user through the interface prism_def_partition.
00010 !
00011 !
00012 ! !REVISION HISTORY:
00013 !
00014 !   Date      Programmer   Description
00015 ! ----------  ----------   -----------
00016 ! 27.10.10    M. Hanke     created
00017 !
00018 !----------------------------------------------------------------------
00019 !
00020 !  $Id: psmile_store_data_partition.F90 2769 2010-11-23 14:49:21Z hanke $
00021 !  $Author: hanke $
00022 !
00023 !----------------------------------------------------------------------
00024 
00025 subroutine psmile_store_data_partition (grid_id, nbr_blocks, &
00026                                         partition_array,     &
00027                                         extent_array, ierror)
00028 
00029    use psmile_user_data, only : grid_data
00030    use psmile_grid, only      : get_size_of_shape
00031    use prism_constants, only  : PRISM_Error_Arg
00032    use psmile_common, only    : ch_id
00033 
00034    implicit none
00035 
00036    integer, intent (in)  :: grid_id
00037    integer, intent (in)  :: nbr_blocks
00038    integer, intent (in)  :: partition_array(1:nbr_blocks,*)
00039    integer, intent (in)  :: extent_array(1:nbr_blocks,*)
00040    integer, intent (out) :: ierror
00041 
00042    integer :: shape_size(2)
00043 
00044 #ifdef VERBOSE
00045    print 9990, trim(ch_id)
00046    call psmile_flushstd
00047 #endif /* VERBOSE */
00048 
00049    ierror = 0
00050 
00051    if (associated (grid_data(grid_id)%partition_array)) then
00052 
00053       ierror = PRISM_Error_Arg
00054       call psmile_error ( PRISM_Error_Arg, 'partition data already existed', &
00055                           (/grid_id/), 1, __FILE__, __LINE__ )
00056       return
00057    endif
00058 
00059    shape_size = get_size_of_shape(grid_data(grid_id)%grid_type)
00060 
00061    allocate (grid_data(grid_id)%partition_array(nbr_blocks,1:shape_size(2)), &
00062              grid_data(grid_id)%extent_array(nbr_blocks,1:shape_size(2)))
00063 
00064    grid_data(grid_id)%partition_array = partition_array(:,1:shape_size(2))
00065    grid_data(grid_id)%extent_array = extent_array(:,1:shape_size(2))
00066 
00067 #ifdef VERBOSE
00068    print 9980, trim(ch_id), ierror
00069    call psmile_flushstd
00070 #endif /* VERBOSE */
00071 
00072 9990 format (1x, a, ': psmile_store_data_partition: ')
00073 9980 format (1x, a, ': psmile_store_data_partition: eof ierror =', i5)
00074 end subroutine psmile_store_data_partition

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1