- Timestamp:
- 2012-11-27T15:42:24+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_MERGE_2012/NEMOGCM/NEMO/TOP_SRC/prtctl_trc.F90
r3294 r3680 17 17 USE par_trc ! TOP parameters 18 18 USE oce_trc ! ocean space and time domain variables 19 USE prtctl ! print control for OPA 19 20 20 21 IMPLICIT NONE … … 296 297 END SUBROUTINE prt_ctl_trc_init 297 298 298 299 SUBROUTINE sub_dom300 !!----------------------------------------------------------------------301 !! *** ROUTINE sub_dom ***302 !!303 !! ** Purpose : Lay out the global domain over processors.304 !! CAUTION:305 !! This part has been extracted from the mpp_init306 !! subroutine and names of variables/arrays have been307 !! slightly changed to avoid confusion but the computation308 !! is exactly the same. Any modification about indices of309 !! each sub-domain in the mppini.F90 module should be reported310 !! here.311 !!312 !! ** Method : Global domain is distributed in smaller local domains.313 !! Periodic condition is a function of the local domain position314 !! (global boundary or neighbouring domain) and of the global315 !! periodic316 !! Type : jperio global periodic condition317 !! nperio local periodic condition318 !!319 !! ** Action : - set domain parameters320 !! nimpp : longitudinal index321 !! njmpp : latitudinal index322 !! nperio : lateral condition type323 !! narea : number for local area324 !! nlcil : first dimension325 !! nlcjl : second dimension326 !! nbondil : mark for "east-west local boundary"327 !! nbondjl : mark for "north-south local boundary"328 !!----------------------------------------------------------------------329 INTEGER :: ji, jj, js ! dummy loop indices330 INTEGER :: ii, ij ! temporary integers331 INTEGER :: irestil, irestjl ! " "332 INTEGER :: ijpi , ijpj, nlcil ! temporary logical unit333 INTEGER :: nlcjl , nbondil, nbondjl334 INTEGER :: nrecil, nrecjl, nldil, nleil, nldjl, nlejl335 REAL(wp) :: zidom, zjdom ! temporary scalars336 INTEGER, POINTER, DIMENSION(:,:) :: iimpptl, ijmpptl, ilcitl, ilcjtl ! temporary workspace337 !!----------------------------------------------------------------------338 !339 CALL wrk_alloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )340 !341 ! Dimension arrays for subdomains342 ! -------------------------------343 ! Computation of local domain sizes ilcitl() ilcjtl()344 ! These dimensions depend on global sizes isplt,jsplt and jpiglo,jpjglo345 ! The subdomains are squares leeser than or equal to the global346 ! dimensions divided by the number of processors minus the overlap347 ! array (cf. par_oce.F90).348 349 ijpi = ( jpiglo-2*jpreci + (isplt-1) ) / isplt + 2*jpreci350 ijpj = ( jpjglo-2*jprecj + (jsplt-1) ) / jsplt + 2*jprecj351 352 nrecil = 2 * jpreci353 nrecjl = 2 * jprecj354 irestil = MOD( jpiglo - nrecil , isplt )355 irestjl = MOD( jpjglo - nrecjl , jsplt )356 357 IF( irestil == 0 ) irestil = isplt358 DO jj = 1, jsplt359 DO ji = 1, irestil360 ilcitl(ji,jj) = ijpi361 END DO362 DO ji = irestil+1, isplt363 ilcitl(ji,jj) = ijpi -1364 END DO365 END DO366 367 IF( irestjl == 0 ) irestjl = jsplt368 DO ji = 1, isplt369 DO jj = 1, irestjl370 ilcjtl(ji,jj) = ijpj371 END DO372 DO jj = irestjl+1, jsplt373 ilcjtl(ji,jj) = ijpj -1374 END DO375 END DO376 377 zidom = nrecil378 DO ji = 1, isplt379 zidom = zidom + ilcitl(ji,1) - nrecil380 END DO381 382 zjdom = nrecjl383 DO jj = 1, jsplt384 zjdom = zjdom + ilcjtl(1,jj) - nrecjl385 END DO386 387 ! Index arrays for subdomains388 ! ---------------------------389 390 iimpptl(:,:) = 1391 ijmpptl(:,:) = 1392 393 IF( isplt > 1 ) THEN394 DO jj = 1, jsplt395 DO ji = 2, isplt396 iimpptl(ji,jj) = iimpptl(ji-1,jj) + ilcitl(ji-1,jj) - nrecil397 END DO398 END DO399 ENDIF400 401 IF( jsplt > 1 ) THEN402 DO jj = 2, jsplt403 DO ji = 1, isplt404 ijmpptl(ji,jj) = ijmpptl(ji,jj-1)+ilcjtl(ji,jj-1)-nrecjl405 END DO406 END DO407 ENDIF408 409 ! Subdomain description410 ! ---------------------411 412 DO js = 1, ijsplt413 ii = 1 + MOD( js-1, isplt )414 ij = 1 + (js-1) / isplt415 nimpptl(js) = iimpptl(ii,ij)416 njmpptl(js) = ijmpptl(ii,ij)417 nlcitl (js) = ilcitl (ii,ij)418 nlcil = nlcitl (js)419 nlcjtl (js) = ilcjtl (ii,ij)420 nlcjl = nlcjtl (js)421 nbondjl = -1 ! general case422 IF( js > isplt ) nbondjl = 0 ! first row of processor423 IF( js > (jsplt-1)*isplt ) nbondjl = 1 ! last row of processor424 IF( jsplt == 1 ) nbondjl = 2 ! one processor only in j-direction425 ibonjtl(js) = nbondjl426 427 nbondil = 0 !428 IF( MOD( js, isplt ) == 1 ) nbondil = -1 !429 IF( MOD( js, isplt ) == 0 ) nbondil = 1 !430 IF( isplt == 1 ) nbondil = 2 ! one processor only in i-direction431 ibonitl(js) = nbondil432 433 nldil = 1 + jpreci434 nleil = nlcil - jpreci435 IF( nbondil == -1 .OR. nbondil == 2 ) nldil = 1436 IF( nbondil == 1 .OR. nbondil == 2 ) nleil = nlcil437 nldjl = 1 + jprecj438 nlejl = nlcjl - jprecj439 IF( nbondjl == -1 .OR. nbondjl == 2 ) nldjl = 1440 IF( nbondjl == 1 .OR. nbondjl == 2 ) nlejl = nlcjl441 nlditl(js) = nldil442 nleitl(js) = nleil443 nldjtl(js) = nldjl444 nlejtl(js) = nlejl445 END DO446 !447 CALL wrk_dealloc( isplt, jsplt, ilcitl, ilcjtl, iimpptl, ijmpptl )448 !449 END SUBROUTINE sub_dom450 451 299 #else 452 300 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.