- Timestamp:
- Nov 16, 2012 3:28:04 PM (12 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/init_pegrid.f90
r1042 r1056 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Indices for arrays n.._mg start from zero due to definition of arrays f2 and 23 ! p2 as automatic arrays in recursive subroutine next_mg_level 23 24 ! 24 25 ! Former revisions: … … 860 861 ENDIF 861 862 862 ALLOCATE( grid_level_count(maximum_grid_level), &863 nxl_mg( maximum_grid_level), nxr_mg(maximum_grid_level), &864 nyn_mg( maximum_grid_level), nys_mg(maximum_grid_level), &865 nzt_mg( maximum_grid_level) )863 ALLOCATE( grid_level_count(maximum_grid_level), & 864 nxl_mg(0:maximum_grid_level), nxr_mg(0:maximum_grid_level), & 865 nyn_mg(0:maximum_grid_level), nys_mg(0:maximum_grid_level), & 866 nzt_mg(0:maximum_grid_level) ) 866 867 867 868 grid_level_count = 0 869 ! 870 !-- Index zero required as dummy due to definition of arrays f2 and p2 in 871 !-- recursive subroutine next_mg_level 872 nxl_mg(0) = 0; nxr_mg(0) = 0; nyn_mg(0) = 0; nys_mg(0) = 0; nzt_mg(0) = 0 868 873 869 874 nxl_l = nxl; nxr_l = nxr; nys_l = nys; nyn_l = nyn; nzt_l = nzt -
palm/trunk/SOURCE/poismg.f90
r1037 r1056 23 23 ! Current revisions: 24 24 ! ----------------- 25 ! 25 ! Bugfix: all ghost points have to be used for allocating p3 26 ! arrays p2, f2, and f2_l changed from allocatable to automatic 26 27 ! 27 28 ! Former revisions: … … 125 126 mg_switch_to_pe0_level)+1) ) 126 127 ELSE 127 ALLOCATE ( p3(nzb:nzt+1,nys-1:nyn+1,nxl-1:nxr+1) ) 128 ENDIF 128 ALLOCATE ( p3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 129 ENDIF 130 131 p3 = 0.0 129 132 130 133 ! … … 618 621 nys_mg(grid_level)-1:nyn_mg(grid_level)+1, & 619 622 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) :: f_mg, p_mg 620 621 623 622 624 l = grid_level … … 1002 1004 ENDDO 1003 1005 ENDDO 1004 !$OMP END PARALLEL 1006 !$OMP END PARALLEL 1005 1007 1006 1008 ! … … 1027 1029 REAL, DIMENSION(nzb:nzt_mg(grid_level)+1, & 1028 1030 nys_mg(grid_level)-1:nyn_mg(grid_level)+1, & 1029 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) :: f2 1031 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) :: f2, f2_l 1030 1032 1031 1033 REAL, DIMENSION(nzb:mg_loc_ind(5,myid)+1, & … … 1033 1035 mg_loc_ind(1,myid)-1:mg_loc_ind(2,myid)+1) :: f2_sub 1034 1036 1035 REAL, DIMENSION(:,:,:), ALLOCATABLE :: f2_l1036 1037 ALLOCATE( f2_l(nzb:nzt_mg(grid_level)+1, &1038 nys_mg(grid_level)-1:nyn_mg(grid_level)+1, &1039 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) )1040 1037 1041 1038 #if defined( __parallel ) … … 1073 1070 nwords, MPI_REAL, MPI_SUM, comm2d, ierr ) 1074 1071 1075 DEALLOCATE( f2_l )1076 1077 1072 CALL cpu_log( log_point_s(34), 'mg_gather', 'stop' ) 1078 1073 #endif … … 1150 1145 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) :: f_mg, p_mg, p3, r 1151 1146 1152 REAL, DIMENSION(:,:,:), ALLOCATABLE :: f2, f2_sub, p2, p2_sub 1153 1147 REAL, DIMENSION(nzb:nzt_mg(grid_level-1)+1, & 1148 nys_mg(grid_level-1)-1:nyn_mg(grid_level-1)+1, & 1149 nxl_mg(grid_level-1)-1:nxr_mg(grid_level-1)+1) :: f2, p2 1150 1151 REAL, DIMENSION(:,:,:), ALLOCATABLE :: f2_sub, p2_sub 1154 1152 1155 1153 ! … … 1190 1188 nyn = nyn_mg(grid_level) 1191 1189 nzt = nzt_mg(grid_level) 1192 1193 ALLOCATE( f2(nzb:nzt_mg(grid_level)+1, &1194 nys_mg(grid_level)-1:nyn_mg(grid_level)+1, &1195 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1), &1196 p2(nzb:nzt_mg(grid_level)+1, &1197 nys_mg(grid_level)-1:nyn_mg(grid_level)+1, &1198 nxl_mg(grid_level)-1:nxr_mg(grid_level)+1) )1199 1190 1200 1191 IF ( grid_level == mg_switch_to_pe0_level ) THEN … … 1281 1272 1282 1273 ELSE 1274 1283 1275 CALL restrict( f2, r ) 1284 1276 … … 1392 1384 1393 1385 ! 1394 !-- Temporary arrays for the actual grid are not needed any more1395 DEALLOCATE( p2, f2 )1396 1397 !1398 1386 !-- Computation of the new pressure correction. Therefore, 1399 1387 !-- values from prior grids are added up automatically stage by stage.
Note: See TracChangeset
for help on using the changeset viewer.