LST_user_mask_nonuniform_release.F90 19.5 KB
Newer Older
Femi Kadri's avatar
Femi Kadri committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
SUBROUTINE LST_user_mask_nonuniform_release(&
& My_MPI_Process_ID,&
& global_initial_positions_lu,&
& global_initial_marker_IDs,&
& local_x_min_ghost,local_x_max_ghost,&
& local_y_min_ghost,local_y_max_ghost,&
& local_z_min_ghost,local_z_max_ghost,&
& global_x_min_real,global_x_max_real,&
& global_y_min_real,global_y_max_real,&
& global_z_min_real,global_z_max_real,&
& global_x_min_ghost,global_x_max_ghost,&
& global_y_min_ghost,global_y_max_ghost,&
& global_z_min_ghost,global_z_max_ghost,&
& cartesian_communicator,&
& divide_x,divide_y,divide_z,&
& local_x_min_real,local_x_max_real,&
& local_y_min_real,local_y_max_real,&
& local_z_min_real,local_z_max_real,&
& IN,OUT,WEST,EAST,UP,DOWN,&
& global_x_nodes_real,global_y_nodes_real,global_z_nodes_real,&
& global_x_nodes_ghost,global_y_nodes_ghost,global_z_nodes_ghost,&
& ROOT,&
& local_x_nodes_real,local_y_nodes_real,local_z_nodes_real,&
& local_x_nodes_ghost,local_y_nodes_ghost,local_z_nodes_ghost, &
& lattice_dimension,My_MPI_Process_ID_Digits,&
& xyz_dir_normal_to_release_plane,&
& LST_local_walls,&
& Number_Of_Processes,&
& local_x_min_real_minus_half,local_x_max_real_plus_half,&
& local_y_min_real_minus_half,local_y_max_real_plus_half,&
& local_z_min_real_minus_half,local_z_max_real_plus_half,&
& total_number_of_LST_markers,&
& my_mpi_real_data_type,&
& global_plane_dim1_min_ghost,global_plane_dim1_max_ghost,&
& global_plane_dim2_min_ghost,global_plane_dim2_max_ghost,&
& global_plane_dim3_min_ghost,global_plane_dim3_max_ghost,&
& global_plane_dim1_min_real,global_plane_dim1_max_real,&
& global_plane_dim2_min_real,global_plane_dim2_max_real,&
& global_plane_dim3_min_real,global_plane_dim3_max_real,&
& global_plane_dim1_nodes_ghost,&
& global_plane_dim2_nodes_ghost,&
& global_plane_dim3_nodes_ghost,&
& global_plane_dim1_nodes_real,&
& global_plane_dim2_nodes_real,& 
& global_plane_dim3_nodes_real,&
& global_product_xyz_nodes_real,&
& global_walls_surf_rel_dim1_min,&
& global_walls_surf_rel_dim1_max)

USE debug_module


	IMPLICIT NONE

	INCLUDE "mpif.h"

	!-----------INTENT(IN)------------------------------------------
	INTEGER,INTENT(IN) :: total_number_of_LST_markers
	INTEGER,INTENT(IN) :: My_MPI_Process_ID
	LOGICAL*4,PARAMETER :: debug = GLOBAL_DEBUG

	INTEGER,INTENT(IN) :: local_x_min_ghost,local_x_max_ghost
	INTEGER,INTENT(IN) :: local_y_min_ghost,local_y_max_ghost
	INTEGER,INTENT(IN) :: local_z_min_ghost,local_z_max_ghost
	INTEGER,INTENT(IN) :: global_x_min_real,global_x_max_real
	INTEGER,INTENT(IN) :: global_y_min_real,global_y_max_real
	INTEGER,INTENT(IN) :: global_z_min_real,global_z_max_real
	INTEGER,INTENT(IN) :: global_x_min_ghost,global_x_max_ghost
	INTEGER,INTENT(IN) :: global_y_min_ghost,global_y_max_ghost
	INTEGER,INTENT(IN) :: global_z_min_ghost,global_z_max_ghost

	INTEGER,INTENT(IN) :: global_product_xyz_nodes_real

	INTEGER,INTENT(IN) :: local_x_min_real,local_x_max_real
	INTEGER,INTENT(IN) :: local_y_min_real,local_y_max_real
	INTEGER,INTENT(IN) :: local_z_min_real,local_z_max_real

	INTEGER,INTENT(IN) :: global_plane_dim1_min_ghost,global_plane_dim1_max_ghost
	INTEGER,INTENT(IN) :: global_plane_dim2_min_ghost,global_plane_dim2_max_ghost
	INTEGER,INTENT(IN) :: global_plane_dim3_min_ghost,global_plane_dim3_max_ghost
	INTEGER,INTENT(IN) :: global_plane_dim1_min_real,global_plane_dim1_max_real
	INTEGER,INTENT(IN) :: global_plane_dim2_min_real,global_plane_dim2_max_real
	INTEGER,INTENT(IN) :: global_plane_dim3_min_real,global_plane_dim3_max_real

	INTEGER,INTENT(IN) :: global_plane_dim1_nodes_ghost
	INTEGER,INTENT(IN) :: global_plane_dim2_nodes_ghost
	INTEGER,INTENT(IN) :: global_plane_dim3_nodes_ghost
	INTEGER,INTENT(IN) :: global_plane_dim1_nodes_real 
	INTEGER,INTENT(IN) :: global_plane_dim2_nodes_real 
	INTEGER,INTENT(IN) :: global_plane_dim3_nodes_real

	INTEGER,INTENT(IN) :: local_x_nodes_real,local_y_nodes_real,local_z_nodes_real
	INTEGER,INTENT(IN) :: local_x_nodes_ghost,local_y_nodes_ghost,local_z_nodes_ghost


	INTEGER,INTENT(IN) :: cartesian_communicator,ROOT,Number_Of_Processes

	INTEGER,INTENT(IN) :: IN,OUT,WEST,EAST,UP,DOWN

	INTEGER,INTENT(IN) :: global_walls_surf_rel_dim1_min,global_walls_surf_rel_dim1_max

	INTEGER,INTENT(IN) :: global_x_nodes_real,global_y_nodes_real,global_z_nodes_real
	INTEGER,INTENT(IN) :: global_x_nodes_ghost,global_y_nodes_ghost,global_z_nodes_ghost

	INTEGER,INTENT(IN) :: xyz_dir_normal_to_release_plane
	INTEGER,INTENT(IN) :: my_mpi_real_data_type

	INTEGER,INTENT(IN) :: lattice_dimension,My_MPI_Process_ID_Digits

	REAL,INTENT(IN) :: local_x_min_real_minus_half,local_x_max_real_plus_half
	REAL,INTENT(IN) :: local_y_min_real_minus_half,local_y_max_real_plus_half
	REAL,INTENT(IN) :: local_z_min_real_minus_half,local_z_max_real_plus_half

	LOGICAL,INTENT(IN) :: divide_x,divide_y,divide_z
	LOGICAL*4,INTENT(IN),DIMENSION(local_x_min_ghost:local_x_max_ghost,local_y_min_ghost:local_y_max_ghost,&
	& local_z_min_ghost:local_z_max_ghost) :: LST_local_walls

	!-----------INTENT(OUT)------------------------------------------
	
	!-----------INTENT(INOUT)------------------------------------------	
	INTEGER,INTENT(INOUT)  :: global_initial_marker_IDs(total_number_of_LST_markers)
	REAL,INTENT(INOUT) :: global_initial_positions_lu(lattice_dimension * total_number_of_LST_markers)
	!-----------NO INTENT------------------------------------------
	REAL,ALLOCATABLE :: local_user_release_probability(:,:,:)
	LOGICAL*4,ALLOCATABLE :: local_user_defined_release_mask(:,:,:)
	
	LOGICAL*4,DIMENSION(:,:,:),ALLOCATABLE :: LST_global_user_mask_rel_plane

	INTEGER :: global_LST_user_mask_count_real,global_inv_user_mask_count_real
	INTEGER :: mpi_abort_error,mpi_error_code

	INTEGER :: I,J,K
	
	INTEGER,PARAMETER :: memory_success = 0
	INTEGER :: memory_status

	INTEGER,DIMENSION(global_x_min_real:global_x_max_real) :: global_non_user_mask_count_x
	INTEGER,DIMENSION(global_y_min_real:global_y_max_real) :: global_non_user_mask_count_y
	INTEGER,DIMENSION(global_z_min_real:global_z_max_real) :: global_non_user_mask_count_z

	INTEGER,DIMENSION(global_x_min_real:global_x_max_real) :: global_LST_user_mask_count_x
	INTEGER,DIMENSION(global_y_min_real:global_y_max_real) :: global_LST_user_mask_count_y
	INTEGER,DIMENSION(global_z_min_real:global_z_max_real) :: global_LST_user_mask_count_z

	INTEGER,DIMENSION(global_x_min_real:global_x_max_real,&
	& global_y_min_real:global_y_max_real) :: global_user_mask_count_xy
	INTEGER,DIMENSION(global_y_min_real:global_y_max_real,&
	& global_z_min_real:global_z_max_real) :: global_user_mask_count_yz
	INTEGER,DIMENSION(global_z_min_real:global_z_max_real,&
	& global_x_min_real:global_x_max_real) :: global_user_mask_count_zx

	INTEGER,DIMENSION(global_x_min_real:global_x_max_real,&
	& global_y_min_real:global_y_max_real) :: global_inv_user_mask_count_xy
	INTEGER,DIMENSION(global_y_min_real:global_y_max_real,&
	& global_z_min_real:global_z_max_real) :: global_inv_user_mask_count_yz
	INTEGER,DIMENSION(global_z_min_real:global_z_max_real,&
	& global_x_min_real:global_x_max_real) :: global_inv_user_mask_count_zx

	CHARACTER(LEN = My_MPI_Process_ID_Digits) Print_Results_MPI_ID

	ALLOCATE ( local_user_defined_release_mask(local_x_min_ghost:local_x_max_ghost,&
	& local_y_min_ghost:local_y_max_ghost,&
	& local_z_min_ghost:local_z_max_ghost),STAT=memory_status )

	IF (memory_status /= memory_success) THEN
	
		WRITE (0,*) My_MPI_Process_ID, &
		&     "LST_user_mask_nonuniform_release ERROR: can't allocate local_user_defined_release_mask of dimensions ", &
		&     local_x_min_ghost, ":", local_x_max_ghost, ",", &
		&     local_y_min_ghost, ":", local_y_max_ghost, ",", &
		&     local_z_min_ghost, ":", local_z_max_ghost, ")"
		CALL MPI_Abort(cartesian_communicator,mpi_abort_error,mpi_error_code)
	
	END IF !! (memory_status /= memory_success)


	ALLOCATE( LST_global_user_mask_rel_plane(0:1,&
	& global_plane_dim2_min_ghost:global_plane_dim2_max_ghost,&
	& global_plane_dim3_min_ghost:global_plane_dim3_max_ghost) )
	LST_global_user_mask_rel_plane(:,:,:) = .TRUE.  !JUST FOR DEBUGGING PURPOSES (SHOULD BE OVERWRITTEN BY SUBROUTINE local_read_global_logical_array)


	IF(debug) WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: ALLOCATED local_fluid_surface'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: ALLOCATED local_fluid_surface'

	!READ local_user_defined_release_mask ARRAY FROM FROM A TXT FILE
	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: READING USER DEFINIED LST RELEASE MASK FROM FILE ...'
	IF(debug) WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: about to call local_read_global_logical_array local_user_defined_release_mask'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: about to call local_read_global_logical_array local_user_defined_release_mask'

	CALL local_read_global_logical_array(local_x_min_ghost,local_x_max_ghost,local_y_min_ghost,local_y_max_ghost,&
	& local_z_min_ghost,local_z_max_ghost,global_product_xyz_nodes_real,global_x_min_real,global_x_max_real,global_y_min_real,&
	& global_y_max_real,global_z_min_real,global_z_max_real,global_non_user_mask_count_x,global_non_user_mask_count_y,global_non_user_mask_count_z,&
	& global_LST_user_mask_count_x,global_LST_user_mask_count_y,global_LST_user_mask_count_z,LST_global_user_mask_rel_plane,&
	& My_MPI_Process_ID,divide_x,divide_y,divide_z,IN,OUT,WEST,EAST,UP,DOWN,cartesian_communicator,&
	& local_x_min_real,local_x_max_real,local_y_min_real,local_y_max_real,local_z_min_real,local_z_max_real,&
	& local_x_nodes_real,local_y_nodes_real,local_z_nodes_real,local_x_nodes_ghost,local_y_nodes_ghost,local_z_nodes_ghost,&
	& global_x_min_ghost,global_x_max_ghost,global_y_min_ghost,global_y_max_ghost,global_z_min_ghost,global_z_max_ghost,&
	& global_x_nodes_real,global_y_nodes_real,global_z_nodes_real,&
	& global_x_nodes_ghost,global_y_nodes_ghost,global_z_nodes_ghost,&
	& ROOT,global_LST_user_mask_count_real,global_inv_user_mask_count_real,&
	& global_plane_dim2_min_ghost,global_plane_dim2_max_ghost,&
	& global_plane_dim3_min_ghost,global_plane_dim3_max_ghost,&
	& global_walls_surf_rel_dim1_min,global_walls_surf_rel_dim1_max,&
	& xyz_dir_normal_to_release_plane,&
	& global_plane_dim1_min_real,global_plane_dim1_max_real,&
	& global_plane_dim2_min_real,global_plane_dim2_max_real,&
	& global_plane_dim3_min_real,global_plane_dim3_max_real,&
	& global_plane_dim1_nodes_ghost,&
	& global_plane_dim2_nodes_ghost,&
	& global_plane_dim3_nodes_ghost,&
	& global_plane_dim1_nodes_real,&
	& global_plane_dim2_nodes_real,&
	& global_plane_dim3_nodes_real,&
	& global_inv_user_mask_count_xy,&
	& global_inv_user_mask_count_yz,&
	& global_inv_user_mask_count_zx,&
	& global_user_mask_count_xy,&
	& global_user_mask_count_yz,&
	& global_user_mask_count_zx,&
	& local_user_defined_release_mask,29,'LST_user_defined_release_mask')

	IF(debug) WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: finished calling local_read_global_logical_array local_user_defined_release_mask'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: finished calling local_read_global_logical_array local_user_defined_release_mask'
	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED READING USER DEFINIED LST RELEASE MASK!'

	IF(debug) WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: ABOUT TO CHECK local_user_defined_release_mask'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: ABOUT TO CHECK local_user_defined_release_mask'
					

	DO K = local_z_min_ghost,local_z_max_ghost

		DO J = local_y_min_ghost,local_y_max_ghost
			
			DO I = local_x_min_ghost,local_x_max_ghost			

				IF(local_user_defined_release_mask(I,J,K).AND.LST_local_walls(I,J,K))	THEN

					PRINT*,'LST_user_mask_nonuniform_release ERROR: local_user_defined_release_mask OVERLAPS WITH LST_local_walls!'
					PRINT*,'LST_user_mask_nonuniform_release ERROR: I = ',I,'J = ',J,'K = ',K
					WRITE (0,*) 'LST_user_mask_nonuniform_release ERROR: local_user_defined_release_mask OVERLAPS WITH LST_local_walls!'
					WRITE (0,*) 'LST_user_mask_nonuniform_release ERROR: I = ',I,'J = ',J,'K = ',K
					IF(debug) WRITE (9,*) 'LST_user_mask_nonuniform_release ERROR: local_user_defined_release_mask OVERLAPS WITH LST_local_walls!'
					IF(debug) WRITE (29,*) 'LST_user_mask_nonuniform_release ERROR: local_user_defined_release_mask OVERLAPS WITH LST_local_walls!'
					CALL MPI_Abort(cartesian_communicator,mpi_abort_error,mpi_error_code)
					STOP

				END IF !!local_user_defined_release_mask(I,J,K).AND.LST_local_walls(I,J,K)

			END DO !I = local_x_min_ghost,local_x_max_ghost

		END DO !J = local_y_min_ghost,local_y_max_ghost

	END DO !K = local_z_min_ghost,local_z_max_ghost


	IF(debug) WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED TO CHECK local_user_defined_release_mask'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED TO CHECK local_user_defined_release_mask'


	ALLOCATE ( local_user_release_probability(local_x_min_ghost:local_x_max_ghost,&
	& local_y_min_ghost:local_y_max_ghost,&
	& local_z_min_ghost:local_z_max_ghost),STAT=memory_status )

	IF (memory_status /= memory_success) THEN
	
		WRITE (0,*) My_MPI_Process_ID, &
		&     "LST_user_mask_nonuniform_release ERROR: can't allocate local_user_defined_release_mask of dimensions ", &
		&     local_x_min_ghost, ":", local_x_max_ghost, ",", &
		&     local_y_min_ghost, ":", local_y_max_ghost, ",", &
		&     local_z_min_ghost, ":", local_z_max_ghost, ")"
		CALL MPI_Abort(cartesian_communicator,mpi_abort_error,mpi_error_code)
	
	END IF !! (memory_status /= memory_success)


	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: about to call local_read_global_REAL_array local_user_defined_release_mask'
	WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: about to call local_read_global_REAL_array local_user_defined_release_mask'

	CALL local_read_global_REAL_array(&
	& local_x_min_ghost,local_x_max_ghost,local_y_min_ghost,local_y_max_ghost,&
	& local_z_min_ghost,local_z_max_ghost,global_product_xyz_nodes_real,&
	& global_x_min_real,global_x_max_real,global_y_min_real,&
	& global_y_max_real,global_z_min_real,global_z_max_real,&
	& My_MPI_Process_ID,divide_x,divide_y,divide_z,&
	& IN,OUT,WEST,EAST,UP,DOWN,cartesian_communicator,&
	& local_x_min_real,local_x_max_real,local_y_min_real,&
	& local_y_max_real,local_z_min_real,local_z_max_real,&
	& local_x_nodes_real,local_y_nodes_real,local_z_nodes_real,&
	& local_x_nodes_ghost,local_y_nodes_ghost,local_z_nodes_ghost,&
	& global_x_min_ghost,global_x_max_ghost,global_y_min_ghost,&
	& global_y_max_ghost,global_z_min_ghost,global_z_max_ghost,&
	& global_x_nodes_real,global_y_nodes_real,global_z_nodes_real,&
	& global_x_nodes_ghost,global_y_nodes_ghost,global_z_nodes_ghost,&
	& ROOT,&
	& xyz_dir_normal_to_release_plane,&
	& local_user_release_probability,&
	& 36,'LST_user_defined_release_probability')

	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED calling local_read_global_REAL_array local_user_defined_release_mask'
	WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED calling local_read_global_REAL_array local_user_defined_release_mask'


	!if(My_MPI_Process_ID.eq.root) then


!		write(0,*)'My_MPI_Process_ID',My_MPI_Process_ID
!		write(0,*)'total_number_of_LST_markers',total_number_of_LST_markers!
!		write(0,*)'Number_Of_Processes',Number_Of_Processes
!	    write(0,*)'lattice_dimension',lattice_dimension
!		write(0,*)'ROOT',ROOT
!		write(0,*)'cartesian_communicator',cartesian_communicator
!		write(0,*)'divide_x',divide_x
!		write(0,*)'divide_y',divide_y
!		write(0,*)'divide_z',divide_z
!		write(0,*)'local_x_min_ghost',local_x_min_ghost
!		write(0,*)'local_x_max_ghost',local_x_max_ghost
!	  	write(0,*)'local_y_min_ghost',local_y_min_ghost
!		write(0,*)'local_y_max_ghost',local_y_max_ghost
!		write(0,*)'local_z_min_ghost',local_z_min_ghost
!		write(0,*)'local_z_min_ghost',local_z_min_ghost
!		write(0,*)'global_x_min_real',global_x_min_real
!		write(0,*)'global_x_max_real',global_x_max_real
!		write(0,*)'global_y_min_real',global_y_min_real
!		write(0,*)'global_y_max_real',global_y_max_real
!		write(0,*)'global_z_min_real',global_z_min_real
!		write(0,*)'global_z_max_real',global_z_max_real
!		write(0,*)'global_x_min_ghost',global_x_min_ghost
!		write(0,*)'global_x_max_ghost',global_x_max_ghost
!		write(0,*)'global_y_min_ghost',global_y_min_ghost
!		write(0,*)'global_y_max_ghost',global_y_max_ghost
!		write(0,*)'global_z_min_ghost',global_z_min_ghost
!		write(0,*)'global_z_max_ghost',global_z_max_ghost
!		write(0,*)'local_x_min_real_minus_half',local_x_min_real_minus_half
!		write(0,*)'local_y_min_real_minus_half',local_y_min_real_minus_half
!		write(0,*)'local_z_min_real_minus_half',local_z_min_real_minus_half
!		write(0,*)'local_x_max_real_plus_half',local_x_max_real_plus_half
!		write(0,*)'local_y_max_real_plus_half',local_y_max_real_plus_half
!		write(0,*)'local_z_max_real_plus_half',local_z_max_real_plus_half
!		write(0,*)'local_x_min_real',local_x_min_real
!		write(0,*)'local_x_max_real',local_x_max_real
!		write(0,*)'local_y_min_real',local_y_min_real
!		write(0,*)'local_y_max_real',local_y_max_real
!		write(0,*)'local_z_min_real',local_z_min_real
!		write(0,*)'local_z_max_real',local_z_max_real
!		write(0,*)'My_MPI_Process_ID_Digits',My_MPI_Process_ID_Digits
!		write(0,*)'Print_Results_MPI_ID',Print_Results_MPI_ID
!		write(0,*)'my_mpi_real_data_type',my_mpi_real_data_type
!
!	!endif 

	!CALL MPI_Barrier(cartesian_communicator,mpi_error_code)  !EVERYBODY MUST FINISH READING THE FILE, BEFORE IT CAN BE DELETED

	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: STARTED to CALL LST_nonuniform_marker_release'
	WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: STARTED to CALL LST_nonuniform_marker_release'

	CALL LST_nonuniform_marker_release(My_MPI_Process_ID,total_number_of_LST_markers,Number_Of_Processes,&
	& lattice_dimension,ROOT,cartesian_communicator,&
	& divide_x,divide_y,divide_z,local_x_min_ghost,local_x_max_ghost,&
	& local_y_min_ghost,local_y_max_ghost,local_z_min_ghost,local_z_max_ghost,&
	& global_x_min_real,global_x_max_real,global_y_min_real,global_y_max_real,&
	& global_z_min_real,global_z_max_real,global_x_min_ghost,global_x_max_ghost,&
	& global_y_min_ghost,global_y_max_ghost,global_z_min_ghost,global_z_max_ghost,&
	& local_x_min_real_minus_half,local_y_min_real_minus_half,&
	& local_z_min_real_minus_half,local_x_max_real_plus_half,&
	& local_y_max_real_plus_half,local_z_max_real_plus_half,&
	& local_x_min_real,local_x_max_real,&
	& local_y_min_real,local_y_max_real,&
	& local_z_min_real,local_z_max_real,&
	& My_MPI_Process_ID_Digits,LST_local_walls, &
	& Print_Results_MPI_ID,my_mpi_real_data_type,&
	& global_initial_marker_IDs,global_initial_positions_lu,&
	& local_user_defined_release_mask,&
	& local_user_release_probability )

	WRITE (0,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED to CALL LST_nonuniform_marker_release'
	WRITE (9,*) My_MPI_Process_ID,'LST_user_mask_nonuniform_release: FINISHED to CALL LST_nonuniform_marker_release'


	DEALLOCATE ( local_user_defined_release_mask )


	IF(debug) WRITE (0,*) My_MPI_Process_ID,'about to END SUBROUTINE LST_user_mask_nonuniform_release'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'about to END SUBROUTINE LST_user_mask_nonuniform_release'

RETURN
END SUBROUTINE LST_user_mask_nonuniform_release