Changeset 1015 for palm/trunk/SOURCE/prandtl_fluxes.f90
- Timestamp:
- Sep 27, 2012 9:23:24 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/prandtl_fluxes.f90
r979 r1015 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 ! OpenACC statements added 7 7 ! 8 8 ! Former revisions: … … 65 65 66 66 INTEGER :: i, j, k 67 LOGICAL :: coupled_run 67 68 REAL :: a, b, e_q, rifm, uv_total, z_p 68 69 70 ! 71 !-- Data information for accelerators 72 !$acc data present( e, nzb_u_inner, nzb_v_inner, nzb_s_inner, pt, q, qs ) & 73 !$acc present( qsws, rif, shf, ts, u, us, usws, v, vpt, vsws, zu, zw, z0, z0h ) 69 74 ! 70 75 !-- Compute theta* … … 74 79 !-- for u* use the value from the previous time step 75 80 !$OMP PARALLEL DO 81 !$acc kernels do 76 82 DO i = nxlg, nxrg 77 83 DO j = nysg, nyng … … 90 96 !-- (the Richardson number is still the one from the previous time step) 91 97 !$OMP PARALLEL DO PRIVATE( a, b, k, z_p ) 98 !$acc kernels do 92 99 DO i = nxlg, nxrg 93 100 DO j = nysg, nyng … … 122 129 IF ( .NOT. humidity ) THEN 123 130 !$OMP PARALLEL DO PRIVATE( k, z_p ) 131 !$acc kernels do 124 132 DO i = nxlg, nxrg 125 133 DO j = nysg, nyng … … 140 148 ELSE 141 149 !$OMP PARALLEL DO PRIVATE( k, z_p ) 150 !$acc kernels do 142 151 DO i = nxlg, nxrg 143 152 DO j = nysg, nyng … … 162 171 !-- Compute u* at the scalars' grid points 163 172 !$OMP PARALLEL DO PRIVATE( a, b, k, uv_total, z_p ) 173 !$acc kernels do 164 174 DO i = nxl, nxr 165 175 DO j = nys, nyn … … 203 213 !-- Values of us at ghost point locations are needed for the evaluation of usws 204 214 !-- and vsws. 215 !$acc update host( us ) 205 216 CALL exchange_horiz_2d( us ) 217 !$acc update device( us ) 218 206 219 ! 207 220 !-- Compute u'w' for the total model domain. 208 221 !-- First compute the corresponding component of u* and square it. 209 222 !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p ) 223 !$acc kernels do 210 224 DO i = nxl, nxr 211 225 DO j = nys, nyn … … 245 259 !-- First compute the corresponding component of u* and square it. 246 260 !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p ) 261 !$acc kernels do 247 262 DO i = nxl, nxr 248 263 DO j = nys, nyn … … 285 300 !-- For a given water flux in the Prandtl layer: 286 301 !$OMP PARALLEL DO 302 !$acc kernels do 287 303 DO i = nxlg, nxrg 288 304 DO j = nysg, nyng … … 291 307 ENDDO 292 308 293 ELSE 309 ELSE 310 coupled_run = ( coupling_mode == 'atmosphere_to_ocean' .AND. run_coupled ) 294 311 !$OMP PARALLEL DO PRIVATE( a, b, k, z_p ) 312 !$acc kernels do 295 313 DO i = nxlg, nxrg 296 314 DO j = nysg, nyng … … 302 320 !-- Assume saturation for atmosphere coupled to ocean (but not 303 321 !-- in case of precursor runs) 304 IF ( coupling_mode == 'atmosphere_to_ocean' .AND. run_coupled )& 305 THEN 322 IF ( coupled_run ) THEN 306 323 e_q = 6.1 * & 307 324 EXP( 0.07 * ( MIN(pt(0,j,i),pt(1,j,i)) - 273.15 ) ) … … 334 351 !-- Exchange the boundaries for the momentum fluxes (only for sake of 335 352 !-- completeness) 353 !$acc update host( usws, vsws ) 336 354 CALL exchange_horiz_2d( usws ) 337 355 CALL exchange_horiz_2d( vsws ) 338 IF ( humidity .OR. passive_scalar ) CALL exchange_horiz_2d( qsws ) 356 !$acc update device( usws, vsws ) 357 IF ( humidity .OR. passive_scalar ) THEN 358 !$acc update host( qsws ) 359 CALL exchange_horiz_2d( qsws ) 360 !$acc update device( qsws ) 361 ENDIF 339 362 340 363 ! … … 342 365 IF ( .NOT. constant_heatflux ) THEN 343 366 !$OMP PARALLEL DO 367 !$acc kernels do 344 368 DO i = nxlg, nxrg 345 369 DO j = nysg, nyng … … 353 377 IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar ) ) THEN 354 378 !$OMP PARALLEL DO 379 !$acc kernels do 355 380 DO i = nxlg, nxrg 356 381 DO j = nysg, nyng … … 364 389 IF ( ibc_e_b == 2 ) THEN 365 390 !$OMP PARALLEL DO 391 !$acc kernels do 366 392 DO i = nxlg, nxrg 367 393 DO j = nysg, nyng … … 375 401 ENDIF 376 402 403 !$acc end data 377 404 378 405 END SUBROUTINE prandtl_fluxes
Note: See TracChangeset
for help on using the changeset viewer.