Changeset 866 for palm/trunk/SOURCE/timestep.f90
- Timestamp:
- Mar 28, 2012 6:44:41 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/timestep.f90
r708 r866 3 3 !------------------------------------------------------------------------------! 4 4 ! Current revisions: 5 ! ----------------- 6 ! 5 ! ------------------ 6 ! bugfix for timestep calculation in case of Galilei transformation, 7 ! special treatment in case of mirror velocity boundary condition removed 7 8 ! 8 9 ! Former revisions: … … 56 57 IMPLICIT NONE 57 58 58 INTEGER :: i, j, k 59 INTEGER :: i, j, k, u_max_cfl_ijk(3), v_max_cfl_ijk(3) 59 60 60 61 REAL :: div, dt_diff, dt_diff_l, dt_plant_canopy, & … … 62 63 dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w, & 63 64 dt_u, dt_v, dt_w, lad_max, percent_change, & 64 u_gtrans_l, vabs_max, value, v_gtrans_l65 u_gtrans_l, u_max_cfl, vabs_max, value, v_gtrans_l, v_max_cfl 65 66 66 67 REAL, DIMENSION(2) :: uv_gtrans, uv_gtrans_l … … 70 71 71 72 CALL cpu_log( log_point(12), 'calculate_timestep', 'start' ) 72 73 !74 !-- Determine the maxima of the velocity components.75 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'abs', &76 u_max, u_max_ijk )77 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v, 'abs', &78 v_max, v_max_ijk )79 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w, 'abs', &80 w_max, w_max_ijk )81 82 !83 !-- In case maxima of the horizontal velocity components have been found at the84 !-- bottom boundary (k=nzb), the corresponding maximum at level k=1 is chosen85 !-- if the Dirichlet-boundary condition ('mirror') has been set. This is86 !-- necessary, because otherwise in case of Galilei-transform a far too large87 !-- velocity (having the respective opposite sign) would be used for the time88 !-- step determination (almost double the mean flow velocity).89 IF ( ibc_uv_b == 0 ) THEN90 IF ( u_max_ijk(1) == nzb ) THEN91 u_max = -u_max92 u_max_ijk(1) = nzb + 193 ENDIF94 IF ( v_max_ijk(1) == nzb ) THEN95 v_max = -v_max96 v_max_ijk(1) = nzb + 197 ENDIF98 ENDIF99 73 100 74 ! … … 142 116 ENDIF 143 117 118 ! 119 !-- Determine the maxima of the velocity components. 120 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'abs', 0.0, & 121 u_max, u_max_ijk ) 122 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v, 'abs', 0.0, & 123 v_max, v_max_ijk ) 124 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w, 'abs', 0.0, & 125 w_max, w_max_ijk ) 126 127 ! 128 !-- In case of Galilei transformation, the horizontal velocity maxima have 129 !-- to be calculated from the transformed horizontal velocities 130 IF ( galilei_transformation ) THEN 131 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'absoff', & 132 u_gtrans, u_max_cfl, u_max_cfl_ijk ) 133 CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v, 'absoff', & 134 v_gtrans, v_max_cfl, v_max_cfl_ijk ) 135 ELSE 136 u_max_cfl = u_max 137 v_max_cfl = v_max 138 u_max_cfl_ijk = u_max_ijk 139 v_max_cfl_ijk = v_max_ijk 140 ENDIF 141 142 144 143 IF ( .NOT. dt_fixed ) THEN 145 144 ! … … 147 146 ! 148 147 !-- For each component, compute the maximum time step according to the 149 !-- FCL-criterion.150 dt_u = dx / ( ABS( u_max - u_gtrans) + 1.0E-10 )151 dt_v = dy / ( ABS( v_max - v_gtrans) + 1.0E-10 )148 !-- CFL-criterion. 149 dt_u = dx / ( ABS( u_max_cfl ) + 1.0E-10 ) 150 dt_v = dy / ( ABS( v_max_cfl ) + 1.0E-10 ) 152 151 dt_w = dzu(MAX( 1, w_max_ijk(1) )) / ( ABS( w_max ) + 1.0E-10 ) 153 152 … … 267 266 #if defined( __parallel ) 268 267 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 269 CALL MPI_ALLREDUCE( dt_plant_canopy_l, dt_plant_canopy, 1, MPI_REAL, 268 CALL MPI_ALLREDUCE( dt_plant_canopy_l, dt_plant_canopy, 1, MPI_REAL, & 270 269 MPI_MIN, comm2d, ierr ) 271 270 #else … … 318 317 '&dt_diff = ', dt_diff, ' s', & 319 318 '&dt_plant_canopy = ', dt_plant_canopy, ' s', & 320 '&u_max = ', u_max, ' m/s k=', u_max_ijk(1),&319 '&u_max_cfl = ', u_max_cfl, ' m/s k=', u_max_cfl_ijk(1), & 321 320 ' j=', u_max_ijk(2), ' i=', u_max_ijk(3), & 322 '&v_max = ', v_max, ' m/s k=', v_max_ijk(1),&321 '&v_max_cfl = ', v_max_cfl, ' m/s k=', v_max_cfl_ijk(1), & 323 322 ' j=', v_max_ijk(2), ' i=', v_max_ijk(3), & 324 '&w_max = ', w_max, ' m/s k=', w_max_ijk(1),&323 '&w_max = ', w_max, ' m/s k=', w_max_ijk(1), & 325 324 ' j=', w_max_ijk(2), ' i=', w_max_ijk(3) 326 325 CALL message( 'timestep', 'PA0312', 0, 1, 0, 6, 0 )
Note: See TracChangeset
for help on using the changeset viewer.