LST_calc_marker_unit_cube_vertex.F90 22.3 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 388 389 390 391 392 393 394 395 396
SUBROUTINE LST_calc_marker_unit_cube_vertex(divide_dim1,divide_dim2,divide_dim3,&
& vertex000_dim1,vertex100_dim1,vertex010_dim1,vertex001_dim1,vertex101_dim1,vertex011_dim1,&
& vertex110_dim1,vertex111_dim1,vertex000_dim2,vertex100_dim2,vertex010_dim2,vertex001_dim2,&
& vertex101_dim2,vertex011_dim2,vertex110_dim2,vertex111_dim2,vertex000_dim3,vertex100_dim3,&
& vertex010_dim3,vertex001_dim3,vertex101_dim3,vertex011_dim3,vertex110_dim3,vertex111_dim3,&
& LST_marker_position_dim1,LST_marker_position_dim2,&
& LST_marker_position_dim3,My_MPI_Process_ID,&
& local_dim1_min_ghost,local_dim1_max_ghost,&
& local_dim2_min_ghost,local_dim2_max_ghost,&
& local_dim3_min_ghost,local_dim3_max_ghost,&
& local_dim1_min_real,local_dim1_max_real,&
& local_dim2_min_real,local_dim2_max_real,&
& local_dim3_min_real,local_dim3_max_real,&
& global_dim1_min_real,global_dim1_max_real,&
& global_dim2_min_real,global_dim2_max_real,&
& global_dim3_min_real,global_dim3_max_real,&
& cartesian_communicator)

!THIS SUBROUTINE WILL CALCULAT THE NEIGHBORING LATTICE NODE COORDINATES

USE random_number_generator
USE debug_module
USE precision_detector

	IMPLICIT NONE

	INCLUDE "mpif.h"

	!-----------INTENT(IN)------------------------------------------
	INTEGER,INTENT(IN) :: My_MPI_Process_ID

	INTEGER,INTENT(IN) :: local_dim1_min_ghost,local_dim1_max_ghost
	INTEGER,INTENT(IN) :: local_dim2_min_ghost,local_dim2_max_ghost
	INTEGER,INTENT(IN) :: local_dim3_min_ghost,local_dim3_max_ghost

	INTEGER,INTENT(IN) :: local_dim1_min_real,local_dim1_max_real
	INTEGER,INTENT(IN) :: local_dim2_min_real,local_dim2_max_real
	INTEGER,INTENT(IN) :: local_dim3_min_real,local_dim3_max_real

	INTEGER,INTENT(IN) :: global_dim1_min_real,global_dim1_max_real
	INTEGER,INTENT(IN) :: global_dim2_min_real,global_dim2_max_real
	INTEGER,INTENT(IN) :: global_dim3_min_real,global_dim3_max_real
	INTEGER,INTENT(IN) :: cartesian_communicator

	REAL,INTENT(IN) :: LST_marker_position_dim1
	REAL,INTENT(IN) :: LST_marker_position_dim2
	REAL,INTENT(IN) :: LST_marker_position_dim3
	LOGICAL,INTENT(IN) :: divide_dim1,divide_dim2,divide_dim3
	LOGICAL*4,PARAMETER :: debug = GLOBAL_DEBUG
	!-----------INTENT(OUT)------------------------------------------
	INTEGER,INTENT(OUT) :: vertex000_dim1,vertex100_dim1,vertex010_dim1,vertex001_dim1,vertex101_dim1,vertex011_dim1,vertex110_dim1,vertex111_dim1
	INTEGER,INTENT(OUT) :: vertex000_dim2,vertex100_dim2,vertex010_dim2,vertex001_dim2,vertex101_dim2,vertex011_dim2,vertex110_dim2,vertex111_dim2
	INTEGER,INTENT(OUT) :: vertex000_dim3,vertex100_dim3,vertex010_dim3,vertex001_dim3,vertex101_dim3,vertex011_dim3,vertex110_dim3,vertex111_dim3


	!-----------INTENT(INOUT)------------------------------------------

	!-----------NO INTENT------------------------------------------

	INTEGER :: memory_status,mpi_abort_error,mpi_error_code
	
	IF(debug) WRITE (0,*) My_MPI_Process_ID,'entered SUBROUTINE LST_calc_marker_unit_cube_vertex'
	IF(debug) WRITE (9,*) My_MPI_Process_ID,'entered SUBROUTINE LST_calc_marker_unit_cube_vertex'

	!SET THE COORDINATES OF THE  (0,0,0) CORNER OF THE UNIT CUBE
	vertex000_dim1 = INT( LST_marker_position_dim1 )	
	vertex000_dim2 = INT( LST_marker_position_dim2 )
	vertex000_dim3 = INT( LST_marker_position_dim3 )


	!COMPUTER THE REST OF THE VERTICIES COORDINATES BASED ON THE (0,0,0) VERTEX OF THE UNIT CUBE
	!THE IF STATEMENTS ACCOUNT FOR THE CASE WHERE THERE IS NO DIVISION IN A PARTICULAR DIMENSION AND THEREFORE NO GHOST WALLS
!	IF( .NOT.divide_dim1.AND.vertex000_dim1.EQ.global_dim1_min_real - 1 ) vertex000_dim1 = global_dim1_max_real
!	IF( .NOT.divide_dim2.AND.vertex000_dim2.EQ.global_dim2_min_real - 1 ) vertex000_dim2 = global_dim2_max_real
!	IF( .NOT.divide_dim3.AND.vertex000_dim3.EQ.global_dim3_min_real - 1 ) vertex000_dim3 = global_dim3_max_real
	
	!THIS CONDITION CAN OCCUR DUE TO THE MODULO FUNCTION IN LST_LAGRANGIAN_TRACKING
	IF( divide_dim1.AND.global_dim1_max_real.EQ.local_dim1_max_real.AND.vertex000_dim1.EQ.0 ) vertex000_dim1 = global_dim1_max_real	!FOR SPLIT CASE:  CORRECT THE EDGE
	IF( divide_dim2.AND.global_dim2_max_real.EQ.local_dim2_max_real.AND.vertex000_dim2.EQ.0 ) vertex000_dim2 = global_dim2_max_real
	IF( divide_dim3.AND.global_dim3_max_real.EQ.local_dim3_max_real.AND.vertex000_dim3.EQ.0 ) vertex000_dim3 = global_dim3_max_real


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim1',vertex000_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim1',vertex000_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim2',vertex000_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim2',vertex000_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim3',vertex000_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim3',vertex000_dim3

			vertex010_dim1 = vertex000_dim1
			vertex001_dim1 = vertex000_dim1
			vertex011_dim1 = vertex000_dim1 

			vertex100_dim1 = vertex000_dim1 + 1
			vertex101_dim1 = vertex000_dim1 + 1
			vertex110_dim1 = vertex000_dim1 + 1
			vertex111_dim1 = vertex000_dim1 + 1


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim1',vertex010_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim1',vertex010_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim1',vertex001_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim1',vertex001_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim1',vertex011_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim1',vertex011_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim1',vertex100_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim1',vertex100_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim1',vertex101_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim1',vertex101_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim1',vertex110_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim1',vertex110_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim1',vertex111_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim1',vertex111_dim1


			IF( .NOT.divide_dim1.AND.vertex000_dim1.EQ.global_dim1_max_real ) THEN
				!NOTE THIS CONDITION SHOULD BE IMPOSSIBLE FOR THE PLANE RELEASE
				vertex100_dim1 = global_dim1_min_real
				vertex101_dim1 = global_dim1_min_real
				vertex110_dim1 = global_dim1_min_real
				vertex111_dim1 = global_dim1_min_real

			ENDIF !! .NOT.divide_dim1.AND.vertex000_dim1.EQ.global_dim1_max_real

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim1',vertex100_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim1',vertex100_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim1',vertex101_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim1',vertex101_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim1',vertex110_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim1',vertex110_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim1',vertex111_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim1',vertex111_dim1


			
			IF( .NOT.divide_dim1.AND.vertex100_dim1.EQ.global_dim1_min_real ) THEN
				!NOTE THIS CONDITION SHOULD BE IMPOSSIBLE FOR THE PLANE RELEASE
				vertex000_dim1 = global_dim1_max_real
				vertex010_dim1 = global_dim1_max_real
				vertex001_dim1 = global_dim1_max_real
				vertex011_dim1 = global_dim1_max_real

			ENDIF !! .NOT.divide_dim1.AND.vertex100_dim1.EQ.global_dim1_min_real

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim1',vertex000_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim1',vertex000_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim1',vertex010_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim1',vertex010_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim1',vertex001_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim1',vertex001_dim1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim1',vertex011_dim1
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim1',vertex011_dim1


			vertex100_dim2 = vertex000_dim2
			vertex001_dim2 = vertex000_dim2
			vertex101_dim2 = vertex000_dim2
	
			vertex010_dim2 = vertex000_dim2 + 1
			vertex011_dim2 = vertex000_dim2 + 1
			vertex110_dim2 = vertex000_dim2 + 1
			vertex111_dim2 = vertex000_dim2 + 1


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim2',vertex100_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim2',vertex100_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim2',vertex001_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim2',vertex001_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim2',vertex101_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim2',vertex101_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim2',vertex010_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim2',vertex010_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim2',vertex011_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim2',vertex011_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim2',vertex110_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim2',vertex110_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim2',vertex111_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim2',vertex111_dim2


			IF( .NOT.divide_dim2.AND.vertex000_dim2.EQ.global_dim2_max_real ) THEN
		
				vertex010_dim2 = global_dim2_min_real
				vertex011_dim2 = global_dim2_min_real
				vertex110_dim2 = global_dim2_min_real
				vertex111_dim2 = global_dim2_min_real

			ENDIF !! .NOT.divide_dim2.AND.vertex000_dim2.EQ.global_dim2_max_real


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim2',vertex010_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim2',vertex010_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim2',vertex011_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim2',vertex011_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim2',vertex110_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim2',vertex110_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim2',vertex111_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim2',vertex111_dim2



			IF( .NOT.divide_dim2.AND.vertex010_dim2.EQ.global_dim2_min_real ) THEN
		
				vertex000_dim2 = global_dim2_max_real
				vertex100_dim2 = global_dim2_max_real
				vertex001_dim2 = global_dim2_max_real
				vertex101_dim2 = global_dim2_max_real

			ENDIF !! .NOT.divide_dim2.AND.vertex100_dim2.EQ.global_dim2_min_real


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim2',vertex000_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim2',vertex000_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim2',vertex100_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim2',vertex100_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim2',vertex001_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim2',vertex001_dim2

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim2',vertex101_dim2
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim2',vertex101_dim2


			vertex100_dim3 = vertex000_dim3
			vertex010_dim3 = vertex000_dim3
			vertex110_dim3 = vertex000_dim3

			vertex001_dim3 = vertex000_dim3 + 1
			vertex101_dim3 = vertex000_dim3 + 1
			vertex011_dim3 = vertex000_dim3 + 1
			vertex111_dim3 = vertex000_dim3 + 1

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim3',vertex100_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim3',vertex100_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim3',vertex010_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim3',vertex010_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim3',vertex110_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim3',vertex110_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim3',vertex001_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim3',vertex001_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim3',vertex101_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim3',vertex101_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim3',vertex011_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim3',vertex011_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim3',vertex111_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim3',vertex111_dim3



			IF( .NOT.divide_dim3.AND.vertex000_dim3.EQ.global_dim3_max_real ) THEN
		
				vertex001_dim3 = global_dim3_min_real
				vertex101_dim3 = global_dim3_min_real
				vertex011_dim3 = global_dim3_min_real
				vertex111_dim3 = global_dim3_min_real

			ENDIF !! .NOT.divide_dim3.AND.vertex000_dim3.EQ.global_dim3_max_real


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim3',vertex001_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex001_dim3',vertex001_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim3',vertex101_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex101_dim3',vertex101_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim3',vertex011_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex011_dim3',vertex011_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim3',vertex111_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex111_dim3',vertex111_dim3



			IF( .NOT.divide_dim3.AND.vertex001_dim3.EQ.global_dim3_min_real ) THEN
		
				vertex000_dim3 = global_dim3_max_real
				vertex010_dim3 = global_dim3_max_real
				vertex100_dim3 = global_dim3_max_real
				vertex110_dim3 = global_dim3_max_real

			ENDIF !! .NOT.divide_dim3.AND.vertex100_dim3.EQ.global_dim3_min_real


			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim3',vertex000_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex000_dim3',vertex000_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim3',vertex010_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex010_dim3',vertex010_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim3',vertex100_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex100_dim3',vertex100_dim3

			IF(DEBUG) write(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim3',vertex110_dim3
			IF(DEBUG) write(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex : vertex110_dim3',vertex110_dim3



!			IF( ((vertex000_dim1.LT.local_dim1_min_ghost.OR.vertex100_dim1.GT.local_dim1_max_ghost).AND.divide_dim1).OR.&
!			& ((vertex000_dim2.LT.local_dim2_min_ghost.OR.vertex100_dim2.GT.local_dim2_max_ghost).AND.divide_dim2).OR.&
!			& ((vertex000_dim3.LT.local_dim3_min_ghost.OR.vertex100_dim3.GT.local_dim3_max_ghost).AND.divide_dim3) ) THEN

			IF( ((vertex000_dim1.LT.local_dim1_min_ghost.OR.vertex111_dim1.GT.local_dim1_max_ghost)).OR.&
			& ((vertex000_dim2.LT.local_dim2_min_ghost.OR.vertex111_dim2.GT.local_dim2_max_ghost)).OR.&
			& ((vertex000_dim3.LT.local_dim3_min_ghost.OR.vertex111_dim3.GT.local_dim3_max_ghost)) ) THEN


				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim1',vertex000_dim1  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim1',vertex000_dim1  
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim2',vertex000_dim2  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim2',vertex000_dim2  
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim3',vertex000_dim3  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex000_dim3',vertex000_dim3  

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim1',vertex111_dim1  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim1',vertex111_dim1  
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim2',vertex111_dim2  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim2',vertex111_dim2  
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim3',vertex111_dim3  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: vertex111_dim3',vertex111_dim3 
	
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim1',LST_marker_position_dim1  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim1',LST_marker_position_dim1  

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim2',LST_marker_position_dim2  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim2',LST_marker_position_dim2  

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim3',LST_marker_position_dim3  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: LST_marker_position_dim3',LST_marker_position_dim3  



				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim1',divide_dim1  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim1',divide_dim1

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim1_min_ghost',local_dim1_min_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim1_min_ghost',local_dim1_min_ghost
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim1_max_ghost',local_dim1_max_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim1_max_ghost',local_dim1_max_ghost

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim2',divide_dim2  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim2',divide_dim2

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim2_min_ghost',local_dim2_min_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim2_min_ghost',local_dim2_min_ghost
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim2_max_ghost',local_dim2_max_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim2_max_ghost',local_dim2_max_ghost

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim3',divide_dim3  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: divide_dim3',divide_dim3

				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim3_min_ghost',local_dim3_min_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim3_min_ghost',local_dim3_min_ghost
				WRITE(0,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim3_max_ghost',local_dim3_max_ghost  
				WRITE(9,*) My_MPI_Process_ID,'LST_calc_marker_unit_cube_vertex ERROR: local_dim3_max_ghost',local_dim3_max_ghost

				PRINT*, 'LST_calc_marker_unit_cube_vertex: error!'
				
				CALL MPI_Abort(cartesian_communicator,mpi_abort_error,mpi_error_code)
				STOP
			ENDIF !! vertex000_dim1.LT.local_dim1_min_ghost

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

RETURN
END SUBROUTINE LST_calc_marker_unit_cube_vertex