psmile_store_data_partition.F90
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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