Changeset 1179 for palm/trunk/SOURCE/buoyancy.f90
 Timestamp:
 Jun 14, 2013 5:57:58 AM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/buoyancy.f90
r1172 r1179 19 19 ! 20 20 ! Currrent revisions: 21 !  22 ! 21 !  22 ! steering of reference state revised (var_reference and pr removed from 23 ! parameter list), use_reference renamed use_single_reference_value 23 24 ! 24 25 ! Former revisions: … … 108 109 ! Call for all grid points 109 110 !! 110 SUBROUTINE buoyancy( var, var_reference, wind_component, pr)111 SUBROUTINE buoyancy( var, wind_component ) 111 112 112 113 USE arrays_3d … … 114 115 USE indices 115 116 USE pegrid 116 USE statistics117 117 118 118 IMPLICIT NONE 119 119 120 INTEGER :: i, j, k, pr, wind_component 121 REAL :: var_reference 120 INTEGER :: i, j, k, wind_component 122 121 #if defined( __nopointer ) 123 122 REAL, DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: var … … 130 129 ! 131 130 ! Normal case: horizontal surface 132 IF ( use_reference ) THEN 133 DO i = nxl, nxr 134 DO j = nys, nyn 135 DO k = nzb_s_inner(j,i)+1, nzt1 136 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * & 137 ( & 138 ( var(k,j,i)  hom(k,1,pr,0) ) / var_reference + & 139 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / var_reference & 140 ) 141 ENDDO 142 ENDDO 143 ENDDO 144 ELSE 145 DO i = nxl, nxr 146 DO j = nys, nyn 147 DO k = nzb_s_inner(j,i)+1, nzt1 148 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * & 149 ( & 150 ( var(k,j,i)  hom(k,1,pr,0) ) / hom(k,1,pr,0) + & 151 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / hom(k+1,1,pr,0) & 152 ) 153 ENDDO 154 ENDDO 155 ENDDO 156 ENDIF 131 DO i = nxl, nxr 132 DO j = nys, nyn 133 DO k = nzb_s_inner(j,i)+1, nzt1 134 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * ( & 135 ( var(k,j,i)  ref_state(k) ) / ref_state(k) + & 136 ( var(k+1,j,i)  ref_state(k+1) ) / ref_state(k+1) & 137 ) 138 ENDDO 139 ENDDO 140 ENDDO 157 141 158 142 ELSE … … 205 189 ! Call for all grid points  accelerator version 206 190 !! 207 SUBROUTINE buoyancy_acc( var, var_reference, wind_component, pr)191 SUBROUTINE buoyancy_acc( var, wind_component ) 208 192 209 193 USE arrays_3d … … 211 195 USE indices 212 196 USE pegrid 213 USE statistics214 197 215 198 IMPLICIT NONE 216 199 217 INTEGER :: i, j, k, pr, wind_component 218 REAL :: var_reference 200 INTEGER :: i, j, k, wind_component 219 201 #if defined( __nopointer ) 220 202 REAL, DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: var … … 227 209 ! 228 210 ! Normal case: horizontal surface 229 IF ( use_reference ) THEN 230 !$acc kernels present( nzb_s_inner, hom, tend, var ) 231 !$acc loop 232 DO i = i_left, i_right 233 DO j = j_south, j_north 234 !$acc loop independent vector(32) 235 DO k = nzb_s_inner(j,i)+1, nzt1 236 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * & 237 ( & 238 ( var(k,j,i)  hom(k,1,pr,0) ) / var_reference + & 239 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / var_reference & 240 ) 241 ENDDO 242 ENDDO 243 ENDDO 244 !$acc end kernels 245 ELSE 246 !$acc kernels present( nzb_s_inner, hom, tend, var ) 247 !$acc loop 248 DO i = i_left, i_right 249 DO j = j_south, j_north 250 !$acc loop independent vector(32) 251 DO k = nzb_s_inner(j,i)+1, nzt1 252 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * & 253 ( & 254 ( var(k,j,i)  hom(k,1,pr,0) ) / hom(k,1,pr,0) + & 255 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / hom(k+1,1,pr,0) & 256 ) 257 ENDDO 258 ENDDO 259 ENDDO 260 !$acc end kernels 261 ENDIF 211 !$acc kernels present( nzb_s_inner, ref_state, tend, var ) 212 !$acc loop 213 DO i = i_left, i_right 214 DO j = j_south, j_north 215 !$acc loop independent vector(32) 216 DO k = nzb_s_inner(j,i)+1, nzt1 217 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * ( & 218 ( var(k,j,i)  ref_state(k) ) / ref_state(k) + & 219 ( var(k+1,j,i)  ref_state(k+1) ) / ref_state(k+1) & 220 ) 221 ENDDO 222 ENDDO 223 ENDDO 224 !$acc end kernels 262 225 263 226 ELSE … … 313 276 !! 314 277 !pgi$r opt=1 315 SUBROUTINE buoyancy_ij( i, j, var, var_reference, wind_component, pr)278 SUBROUTINE buoyancy_ij( i, j, var, wind_component ) 316 279 317 280 USE arrays_3d … … 319 282 USE indices 320 283 USE pegrid 321 USE statistics322 284 323 285 IMPLICIT NONE 324 286 325 287 INTEGER :: i, j, k, pr, wind_component 326 REAL :: var_reference327 288 #if defined( __nopointer ) 328 289 REAL, DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: var … … 335 296 ! 336 297 ! Normal case: horizontal surface 337 IF ( use_reference ) THEN 338 DO k = nzb_s_inner(j,i)+1, nzt1 339 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * ( & 340 ( var(k,j,i)  hom(k,1,pr,0) ) / var_reference + & 341 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / var_reference & 342 ) 343 ENDDO 344 ELSE 345 DO k = nzb_s_inner(j,i)+1, nzt1 346 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * ( & 347 ( var(k,j,i)  hom(k,1,pr,0) ) / hom(k,1,pr,0) + & 348 ( var(k+1,j,i)  hom(k+1,1,pr,0) ) / hom(k+1,1,pr,0) & 349 ) 350 ENDDO 351 ENDIF 298 DO k = nzb_s_inner(j,i)+1, nzt1 299 tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * ( & 300 ( var(k,j,i)  ref_state(k) ) / ref_state(k) + & 301 ( var(k+1,j,i)  ref_state(k+1) ) / ref_state(k+1) & 302 ) 303 ENDDO 352 304 353 305 ELSE … … 395 347 !  396 348 ! Calculate the horizontally averaged vertical temperature profile (pr=4 in case 397 ! of potential temperature and 44 in case of virtual potential temperature). 398 !! 399 349 ! of potential temperature, 44 in case of virtual potential temperature, and 64 350 ! in case of density (ocean runs)). 351 !! 352 353 USE arrays_3d, ONLY: ref_state 400 354 USE control_parameters 401 355 USE indices … … 457 411 ENDIF 458 412 413 ref_state(:) = hom(:,1,pr,0) ! this is used in the buoyancy term 414 459 415 END SUBROUTINE calc_mean_profile 460 416
Note: See TracChangeset
for help on using the changeset viewer.