Changeset 1882
- Timestamp:
- Apr 20, 2016 3:24:46 PM (9 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pmc_handle_communicator_mod.f90
r1851 r1882 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! MPI_BCAST-calls to broadcast nesting_mode and nesting_datatransfer_mode 23 ! are moved out from the DO i = 1, m_ncpl loop. 23 24 ! 24 25 ! Former revisions: … … 237 238 CALL MPI_BCAST( m_couplers(i)%lower_left_x, 1, MPI_REAL, 0, MPI_COMM_WORLD, istat ) 238 239 CALL MPI_BCAST( m_couplers(i)%lower_left_y, 1, MPI_REAL, 0, MPI_COMM_WORLD, istat ) 239 !-- TO_DO: the next two calls can and should probably moved outside this loop240 CALL MPI_BCAST( nesting_mode, LEN( nesting_mode ), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )241 CALL MPI_BCAST( nesting_datatransfer_mode, LEN(nesting_datatransfer_mode), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat )242 240 ENDDO 241 CALL MPI_BCAST( nesting_mode, LEN( nesting_mode ), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat ) 242 CALL MPI_BCAST( nesting_datatransfer_mode, LEN(nesting_datatransfer_mode), MPI_CHARACTER, 0, MPI_COMM_WORLD, istat ) 243 243 244 244 ! … … 435 435 TYPE(pmc_layout), DIMENSION(pmc_max_modell) :: domain_layouts 436 436 437 437 !-- TO_DO: include anterp_relax_length_? into nestpar and communicate them. 438 438 NAMELIST /nestpar/ domain_layouts, nesting_datatransfer_mode, nesting_mode 439 439 -
palm/trunk/SOURCE/pmc_interface_mod.f90
r1879 r1882 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! The factor ijfc for nfc used in anterpolation is redefined as 2-D array 23 ! and precomputed in pmci_init_anterp_tophat. 23 24 ! 24 25 ! Former revisions: … … 27 28 ! 28 29 ! 1878 2016-04-19 12:30:36Z hellstea 29 ! Synchronization rewritten, logc-array index order changed for cache optimization 30 ! Synchronization rewritten, logc-array index order changed for cache optimization 30 31 ! 31 32 ! 1850 2016-04-08 13:29:27Z maronga … … 308 309 INTEGER(iwp), SAVE, ALLOCATABLE, DIMENSION(:) :: kfuo !: 309 310 311 ! 312 !-- Number of fine-grid nodes inside coarse-grid ij-faces 313 !-- to be precomputed for anterpolation. 314 INTEGER(iwp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: ijfc_u !: 315 INTEGER(iwp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: ijfc_v !: 316 INTEGER(iwp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: ijfc_s !: 317 310 318 INTEGER(iwp), DIMENSION(3) :: define_coarse_grid_int !: 311 319 REAL(wp), DIMENSION(7) :: define_coarse_grid_real !: … … 2005 2013 2006 2014 INTEGER(iwp) :: i !: Fine-grid index 2015 INTEGER(iwp) :: ifc_o !: 2016 INTEGER(iwp) :: ifc_u !: 2007 2017 INTEGER(iwp) :: ii !: Coarse-grid index 2008 2018 INTEGER(iwp) :: istart !: … … 2063 2073 ALLOCATE( kfuo(0:kctu) ) 2064 2074 2075 ALLOCATE( ijfc_u(jcs:jcn,icl:icr) ) 2076 ALLOCATE( ijfc_v(jcs:jcn,icl:icr) ) 2077 ALLOCATE( ijfc_s(jcs:jcn,icl:icr) ) 2078 2065 2079 ! 2066 2080 !-- i-indices of u for each ii-index value … … 2174 2188 kstart = kflo(kk) 2175 2189 ENDDO 2176 2190 2191 ! 2192 !-- Precomputation of number of fine-grid nodes inside coarse-grid ij-faces. 2193 !-- Note that ii, jj, and kk are coarse-grid indices. 2194 !-- This information is needed in anterpolation. 2195 DO ii = icl, icr 2196 ifc_u = ifuu(ii) - iflu(ii) + 1 2197 ifc_o = ifuo(ii) - iflo(ii) + 1 2198 DO jj = jcs, jcn 2199 ijfc_u(jj,ii) = ifc_u * ( jfuo(jj) - jflo(jj) + 1 ) 2200 ijfc_v(jj,ii) = ifc_o * ( jfuv(jj) - jflv(jj) + 1 ) 2201 ijfc_s(jj,ii) = ifc_o * ( jfuo(jj) - jflo(jj) + 1 ) 2202 ENDDO 2203 ENDDO 2204 2177 2205 ! 2178 2206 !-- Spatial under-relaxation coefficients … … 3022 3050 SUBROUTINE pmci_datatrans( local_nesting_mode ) 3023 3051 ! 3024 !-- Althoug nesting_mode is a variable of this model, pass it as an argument to 3025 !-- allow for example to force one-way initialization phase 3052 !-- This subroutine controls the nesting according to the nestpar 3053 !-- parameter nesting_mode (two-way (default) or one-way) and the 3054 !-- order of anterpolations according to the nestpar parameter 3055 !-- nesting_datatransfer_mode (cascade, overlap or mixed (default)). 3056 !-- Although nesting_mode is a variable of this model, pass it as 3057 !-- an argument to allow for example to force one-way initialization 3058 !-- phase. 3026 3059 3027 3060 IMPLICIT NONE … … 3402 3435 ! 3403 3436 !-- A wrapper routine for all anterpolation actions. 3437 !-- Note that TKE is not anterpolated. 3404 3438 IMPLICIT NONE 3405 3439 3406 3440 CALL pmci_anterp_tophat( u, uc, kctu, iflu, ifuu, jflo, jfuo, kflo, & 3407 kfuo, 'u' )3441 kfuo, ijfc_u, 'u' ) 3408 3442 CALL pmci_anterp_tophat( v, vc, kctu, iflo, ifuo, jflv, jfuv, kflo, & 3409 kfuo, 'v' )3443 kfuo, ijfc_v, 'v' ) 3410 3444 CALL pmci_anterp_tophat( w, wc, kctw, iflo, ifuo, jflo, jfuo, kflw, & 3411 kfuw, 'w' )3445 kfuw, ijfc_s, 'w' ) 3412 3446 CALL pmci_anterp_tophat( pt, ptc, kctu, iflo, ifuo, jflo, jfuo, kflo, & 3413 kfuo, 's' )3447 kfuo, ijfc_s, 's' ) 3414 3448 IF ( humidity .OR. passive_scalar ) THEN 3415 3449 CALL pmci_anterp_tophat( q, qc, kctu, iflo, ifuo, jflo, jfuo, kflo, & 3416 kfuo, 's' )3450 kfuo, ijfc_s, 's' ) 3417 3451 ENDIF 3418 3452 … … 4118 4152 4119 4153 SUBROUTINE pmci_anterp_tophat( f, fc, kct, ifl, ifu, jfl, jfu, kfl, kfu, & 4120 var )4154 ijfc, var ) 4121 4155 ! 4122 4156 !-- Anterpolation of internal-node values to be used as the server-domain … … 4133 4167 INTEGER(iwp) :: iclp !: 4134 4168 INTEGER(iwp) :: icrm !: 4135 INTEGER(iwp) :: ifc !:4136 INTEGER(iwp) :: ijfc !:4137 4169 INTEGER(iwp) :: j !: Fine-grid index 4138 4170 INTEGER(iwp) :: jj !: Coarse-grid index … … 4153 4185 INTEGER(iwp), DIMENSION(0:kct), INTENT(IN) :: kfu !: 4154 4186 4187 INTEGER(iwp), DIMENSION(jcs:jcn,icl:icr), INTENT(IN) :: ijfc !: 4155 4188 4156 4189 REAL(wp) :: cellsum !: … … 4197 4230 4198 4231 ! 4199 !-- Note that l,m, and n are coarse-grid indices and i,j, and k are fine-grid4200 !-- indices.4232 !-- Note that ii, jj, and kk are coarse-grid indices and i,j, and k 4233 !-- are fine-grid indices. 4201 4234 DO ii = iclp, icrm 4202 ifc = ifu(ii) - ifl(ii) + 14203 4235 DO jj = jcsp, jcnm 4204 ijfc = ifc * ( jfu(jj) - jfl(jj) + 1 )4205 4236 ! 4206 4237 !-- For simplicity anterpolate within buildings too 4207 4238 DO kk = kcb, kct 4208 nfc = ijfc * ( kfu(kk) - kfl(kk) + 1 ) 4239 ! 4240 !-- ijfc is precomputed in pmci_init_anterp_tophat 4241 nfc = ijfc(jj,ii) * ( kfu(kk) - kfl(kk) + 1 ) 4209 4242 cellsum = 0.0_wp 4210 4243 DO i = ifl(ii), ifu(ii) … … 4225 4258 ENDIF 4226 4259 ENDIF 4227 ! 4228 !-- TO DO: introduce 3-d coarse grid array for precomputed 4229 !-- 1/REAL(nfc) values 4260 4230 4261 fc(kk,jj,ii) = ( 1.0_wp - fra ) * fc(kk,jj,ii) + & 4231 4262 fra * cellsum / REAL( nfc, KIND = wp )
Note: See TracChangeset
for help on using the changeset viewer.