Changeset 1766 for palm/trunk/SOURCE/pmc_interface.f90
- Timestamp:
- Feb 29, 2016 8:37:15 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_interface.f90
r1765 r1766 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! modifications to allow for using PALM's pointer version, 23 ! +new routine pmci_set_swaplevel 23 24 ! 24 25 ! Former revisions: … … 42 43 !------------------------------------------------------------------------------! 43 44 45 #if defined( __nopointer ) 46 !-- TO_DO: is it really required to use arrays te_m, tu_m, etc. and to set them 47 !-- to zero withi buildings? 44 48 USE arrays_3d, & 45 49 ONLY: dzu, dzw, e, e_p, pt, pt_p, q, q_p, te_m, tu_m, tv_m, tw_m, u, & 46 50 u_p, v, v_p, w, w_p, zu, zw, z0 51 #else 52 USE arrays_3d, & 53 ONLY: dzu, dzw, e, e_p, e_1, e_2, pt, pt_p, pt_1, pt_2, q, q_p, q_1, q_2, te_m, tu_m, & 54 tv_m, tw_m, u, u_p, u_1, u_2, v, v_p, v_1, v_2, w, w_p, w_1, w_2, zu, zw, z0 55 #endif 47 56 48 57 USE control_parameters, & … … 94 103 ONLY: pmc_serverinit, pmc_s_fillbuffer, pmc_s_getdata_from_buffer, & 95 104 pmc_s_getnextarray, pmc_s_setind_and_allocmem, & 96 pmc_s_set_dataarray, pmc_s_set_2d_index_list 105 pmc_s_set_active_data_array, pmc_s_set_dataarray, & 106 pmc_s_set_2d_index_list 97 107 98 108 #endif … … 309 319 END INTERFACE 310 320 321 INTERFACE pmci_set_swaplevel 322 MODULE PROCEDURE pmci_set_swaplevel 323 END INTERFACE pmci_set_swaplevel 324 311 325 INTERFACE pmci_update_new 312 326 MODULE PROCEDURE pmci_update_new … … 322 336 PUBLIC pmci_server_initialize 323 337 PUBLIC pmci_server_synchronize 338 PUBLIC pmci_set_swaplevel 324 339 PUBLIC pmci_update_new 325 340 … … 2214 2229 END SUBROUTINE pmci_client_synchronize 2215 2230 2231 2232 2233 SUBROUTINE pmci_set_swaplevel( swaplevel ) 2234 2235 IMPLICIT NONE 2236 2237 INTEGER(iwp),INTENT(IN) :: swaplevel !: swaplevel (1 or 2) of PALM's timestep 2238 2239 INTEGER(iwp) :: client_id !: 2240 INTEGER(iwp) :: m !: 2241 2242 ! 2243 !-- After each timestep, alternately set buffer one or buffer two active 2244 DO m = 1, SIZE( pmc_server_for_client )-1 2245 client_id = pmc_server_for_client(m) 2246 CALL pmc_s_set_active_data_array( client_id, swaplevel ) 2247 ENDDO 2248 2249 END SUBROUTINE pmci_set_swaplevel 2250 2216 2251 2217 2252 … … 3320 3355 w(nzt+1,:,:) = w(nzt,:,:) 3321 3356 3322 #if defined( __nopointer )3323 3324 3357 u_p = u 3325 3358 v_p = v … … 3331 3364 ENDIF 3332 3365 3333 #endif3334 3335 3366 ! 3336 3367 !-- TO_DO: Find out later if nesting would work without __nopointer. … … 3351 3382 #if defined( __parallel ) 3352 3383 REAL(wp), POINTER, DIMENSION(:,:) :: p_2d !: 3384 REAL(wp), POINTER, DIMENSION(:,:) :: p_2d_sec !: 3353 3385 REAL(wp), POINTER, DIMENSION(:,:,:) :: p_3d !: 3386 REAL(wp), POINTER, DIMENSION(:,:,:) :: p_3d_sec !: 3354 3387 INTEGER(iwp) :: ierr !: 3355 3388 INTEGER(iwp) :: istat !: … … 3369 3402 !IF ( TRIM(name) == "z0" ) p_2d => z0 3370 3403 3404 #if defined( __nopointer ) 3371 3405 IF ( ASSOCIATED( p_3d ) ) THEN 3372 3406 CALL pmc_s_set_dataarray( client_id, p_3d, nz_cl, nz ) … … 3387 3421 ENDIF 3388 3422 ENDIF 3423 #else 3424 !-- TO_DO: Why aren't the other pointers (p_3d) not set to u_1, v_1, etc.?? 3425 IF ( TRIM(name) == "u" ) p_3d_sec => u_2 3426 IF ( TRIM(name) == "v" ) p_3d_sec => v_2 3427 IF ( TRIM(name) == "w" ) p_3d_sec => w_2 3428 IF ( TRIM(name) == "e" ) p_3d_sec => e_2 3429 IF ( TRIM(name) == "pt" ) p_3d_sec => pt_2 3430 !IF ( TRIM(name) == "z0" ) p_2d_sec => z0_2 3431 3432 IF ( ASSOCIATED( p_3d ) ) THEN 3433 CALL pmc_s_set_dataarray( client_id, p_3d, nz_cl, nz, & 3434 array_2 = p_3d_sec ) 3435 ELSEIF ( ASSOCIATED( p_2d ) ) THEN 3436 CALL pmc_s_set_dataarray( client_id, p_2d, array_2 = p_2d_sec ) 3437 ELSE 3438 ! 3439 !-- Give only one message for the root domain 3440 IF ( myid == 0 .AND. cpl_id == 1 ) THEN 3441 3442 message_string = 'pointer for array "' // TRIM( name ) // & 3443 '" can''t be associated' 3444 CALL message( 'pmci_set_array_pointer', 'PA0117', 3, 2, 0, 6, 0 ) 3445 ELSE 3446 ! 3447 !-- Avoid others to continue 3448 CALL MPI_BARRIER( comm2d, ierr ) 3449 ENDIF 3450 3451 ENDIF 3452 #endif 3389 3453 3390 3454 #endif
Note: See TracChangeset
for help on using the changeset viewer.