22 use fv_mp_nlm_mod,
only:
ng, isc,jsc,iec,jec, isd,jsd,ied,jed, is,js,ie,je, is_master
73 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy
74 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), intent(&
76 LOGICAL,
INTENT(IN),
OPTIONAL :: pd_in, debug_in
77 INTEGER :: i, j, istart, iend, jstart, jend
79 INTEGER :: is, ie, js, je
80 INTEGER :: isd, ied, jsd, jed
98 IF (ied .GT. npx - 1)
THEN 108 IF (jed .GT. npy - 1)
THEN 114 IF (
PRESENT(pd_in))
THEN 119 IF (
PRESENT(debug_in))
THEN 126 DO j=jstart,jend+jstag
128 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
129 & q(1, j) .LT. q(2, j)) THEN
132 q(i, j) =
REAL(2-i)*q(1, j) -
REAL(1-i)*q(2, j)
137 DO j=jstart,jend+jstag
139 q(i, j) =
REAL(2-i)*q(1, j) -
REAL(1-i)*q(2, j)
147 DO i=istart,iend+istag
148 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
149 & q(i, 1) .LT. q(i, 2)) THEN
152 q(i, j) =
REAL(2-j)*q(i, 1) -
REAL(1-j)*q(i, 2)
158 DO i=istart,iend+istag
159 q(i, j) =
REAL(2-j)*q(i, 1) -
REAL(1-j)*q(i, 2)
164 IF (ie .EQ. npx - 1)
THEN 166 DO j=jstart,jend+jstag
167 DO i=ie+1+istag,ied+istag
168 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
169 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag, j) .LT. q(ie&
173 q(i, j) =
REAL(i-(ie+istag-1))*q(ie+istag, j) +
REAL(ie+&
174 & istag-i)*q(ie+istag-1, j)
179 DO j=jstart,jend+jstag
180 DO i=ie+1+istag,ied+istag
181 q(i, j) =
REAL(i-(ie+istag-1))*q(ie+istag, j) +
REAL(ie+&
182 & istag-i)*q(ie+istag-1, j)
187 IF (je .EQ. npy - 1)
THEN 189 DO j=je+1+jstag,jed+jstag
190 DO i=istart,iend+istag
191 IF (
REAL(j) .GE. je + jstag + q(i, je+jstag)/(q(i, je+jstag-&
192 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
196 q(i, j) =
REAL(j-(je+jstag-1))*q(i, je+jstag) +
REAL(je+&
197 & jstag-j)*q(i, je+jstag-1)
202 DO j=je+1+jstag,jed+jstag
203 DO i=istart,iend+istag
204 q(i, j) =
REAL(j-(je+jstag-1))*q(i, je+jstag) +
REAL(je+&
205 & jstag-j)*q(i, je+jstag-1)
211 IF (is .EQ. 1 .AND. js .EQ. 1)
THEN 215 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
216 & q(2, j) .GT. q(1, j)) THEN
217 q(i, j) = 0.5*q(i+1, j)
219 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j))
221 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
222 & q(i, 2) .GT. q(i, 1)) THEN
223 q(i, j) = q(i, j) + 0.5*q(i, j+1)
225 q(i, j) = q(i, j) + 0.5*(
REAL(2-j)*q(i, 1)-
REAL(1-j)*q(i, &
233 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j)) + 0.5*(&
234 & REAL(2-j)*q(i, 1)-REAL(1-j)*q(i, 2))
239 IF (is .EQ. 1 .AND. je .EQ. npy - 1)
THEN 241 DO j=je+1+jstag,jed+jstag
243 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
244 & q(2, j) .GT. q(1, j)) THEN
245 q(i, j) = 0.5*q(i+1, j)
247 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j))
251 IF (
REAL(j) .GE. je + jstag - q(i, je+jstag)/(q(i, je+jstag-&
252 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
254 q(i, j) = q(i, j) + 0.5*q(i, j-1)
256 q(i, j) = q(i, j) + 0.5*(
REAL(j-(je+jstag-1))*q(i, je+&
257 & jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
262 DO j=je+1+jstag,jed+jstag
264 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j)) + 0.5*(&
265 & REAL(j-(je+jstag-1))*q(i, je+jstag)+REAL(je+jstag-j)*q(i, &
271 IF (ie .EQ. npx - 1 .AND. je .EQ. npy - 1)
THEN 273 DO j=je+1+jstag,jed+jstag
274 DO i=ie+1+istag,ied+istag
275 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
276 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag-1, j) .GT. q(&
278 q(i, j) = 0.5*q(i-1, j)
280 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie&
281 & +istag-i)*q(ie+istag-1, j))
283 IF (
REAL(j) .GE. je + jstag + q(i, je+jstag)/(q(i, je+jstag-&
284 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
286 q(i, j) = q(i, j) + 0.5*q(i, j-1)
288 q(i, j) = q(i, j) + 0.5*(
REAL(j-(je+jstag-1))*q(i, je+&
289 & jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
294 DO j=je+1+jstag,jed+jstag
295 DO i=ie+1+istag,ied+istag
296 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie+&
297 & istag-i)*q(ie+istag-1, j)) + 0.5*(REAL(j-(je+jstag-1))*q(i&
298 & , je+jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
303 IF (ie .EQ. npx - 1 .AND. js .EQ. 1)
THEN 306 DO i=ie+1+istag,ied+istag
307 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
308 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag-1, j) .GT. q(&
310 q(i, j) = 0.5*q(i-1, j)
312 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie&
313 & +istag-i)*q(ie+istag-1, j))
315 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
316 & q(i, 2) .GT. q(i, 1)) THEN
317 q(i, j) = q(i, j) + 0.5*q(i, j+1)
319 q(i, j) = q(i, j) + 0.5*(
REAL(2-j)*q(i, 1)-
REAL(1-j)*q(i, &
326 DO i=ie+1+istag,ied+istag
327 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie+&
328 & istag-i)*q(ie+istag-1, j)) + 0.5*(REAL(2-j)*q(i, 1)-REAL(1&
336 & jstag, isg, ieg, jsg, jeg, bd, istart_in, iend_in, jstart_in, &
339 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
340 INTEGER,
INTENT(IN) :: istag, jstag, isg, ieg, jsg, jeg
341 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
343 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
345 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
347 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
349 INTEGER,
INTENT(IN),
OPTIONAL :: istart_in, iend_in, jstart_in, &
351 INTEGER :: i, j, ic, jc
352 INTEGER :: istart, iend, jstart, jend
353 INTEGER :: is, ie, js, je
354 INTEGER :: isd, ied, jsd, jed
364 IF (
PRESENT(istart_in))
THEN 369 IF (
PRESENT(iend_in))
THEN 370 iend = iend_in + istag
374 IF (
PRESENT(jstart_in))
THEN 379 IF (
PRESENT(jend_in))
THEN 380 jend = jend_in + jstag
388 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
389 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + wt&
390 & (i, j, 4)*var_coarse(ic+1, jc)
395 & jstag, isg, ieg, jsg, jeg, npz, bd, istart_in, iend_in, jstart_in, &
398 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
399 INTEGER,
INTENT(IN) :: istag, jstag, isg, ieg, jsg, jeg, npz
400 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
401 & INTENT(INOUT) :: var_nest
402 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
404 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
406 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
408 INTEGER,
INTENT(IN),
OPTIONAL :: istart_in, iend_in, jstart_in, &
410 INTEGER :: i, j, ic, jc, k
411 INTEGER :: istart, iend, jstart, jend
412 INTEGER :: is, ie, js, je
413 INTEGER :: isd, ied, jsd, jed
423 IF (
PRESENT(istart_in))
THEN 428 IF (
PRESENT(iend_in))
THEN 429 iend = iend_in + istag
433 IF (
PRESENT(jstart_in))
THEN 438 IF (
PRESENT(jend_in))
THEN 439 jend = jend_in + jstag
448 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i, &
449 & j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(ic+1&
450 & , jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
456 & wt, istag, jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, &
457 & nsplit_in, proc_in)
459 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
460 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz, isg, ieg, jsg, &
462 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
463 & INTENT(INOUT) :: var_nest
464 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
466 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
467 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
469 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
471 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
472 LOGICAL,
INTENT(IN),
OPTIONAL :: proc_in
473 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
474 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
475 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
476 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
477 REAL,
ALLOCATABLE :: wbuffer(:, :, :)
478 REAL,
ALLOCATABLE :: ebuffer(:, :, :)
479 REAL,
ALLOCATABLE :: sbuffer(:, :, :)
480 REAL,
ALLOCATABLE :: nbuffer(:, :, :)
481 INTEGER :: i, j, ic, jc, istart, iend, k
484 INTEGER :: is, ie, js, je
485 INTEGER :: isd, ied, jsd, jed
495 IF (
PRESENT(proc_in))
THEN 500 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 502 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 504 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 509 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
510 & isw_c, iew_c, jsw_c, jew_c, west, position)
511 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
512 & ise_c, iee_c, jse_c, jee_c, east, position)
513 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
514 & iss_c, ies_c, jss_c, jes_c, south, position)
515 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
516 & isn_c, ien_c, jsn_c, jen_c, north, position)
517 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 518 ALLOCATE(wbuffer(isw_c:iew_c, jsw_c:jew_c, npz))
520 ALLOCATE(wbuffer(1, 1, 1))
523 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 524 ALLOCATE(ebuffer(ise_c:iee_c, jse_c:jee_c, npz))
526 ALLOCATE(ebuffer(1, 1, 1))
529 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 530 ALLOCATE(sbuffer(iss_c:ies_c, jss_c:jes_c, npz))
532 ALLOCATE(sbuffer(1, 1, 1))
535 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 536 ALLOCATE(nbuffer(isn_c:ien_c, jsn_c:jen_c, npz))
538 ALLOCATE(nbuffer(1, 1, 1))
543 & , ebuffer, nbuffer, position)
553 var_nest(i, j, k) = wt(i, j, 1)*wbuffer(ic, jc, k) + wt(i&
554 & , j, 2)*wbuffer(ic, jc+1, k) + wt(i, j, 3)*wbuffer(ic+1&
555 & , jc+1, k) + wt(i, j, 4)*wbuffer(ic+1, jc, k)
566 IF (ie .EQ. npx - 1)
THEN 573 DO i=istart,iend+istag
576 var_nest(i, j, k) = wt(i, j, 1)*sbuffer(ic, jc, k) + wt(i&
577 & , j, 2)*sbuffer(ic, jc+1, k) + wt(i, j, 3)*sbuffer(ic+1&
578 & , jc+1, k) + wt(i, j, 4)*sbuffer(ic+1, jc, k)
583 IF (ie .EQ. npx - 1)
THEN 586 DO i=npx+istag,ied+istag
589 var_nest(i, j, k) = wt(i, j, 1)*ebuffer(ic, jc, k) + wt(i&
590 & , j, 2)*ebuffer(ic, jc+1, k) + wt(i, j, 3)*ebuffer(ic+1&
591 & , jc+1, k) + wt(i, j, 4)*ebuffer(ic+1, jc, k)
596 IF (je .EQ. npy - 1)
THEN 602 IF (ie .EQ. npx - 1)
THEN 608 DO j=npy+jstag,jed+jstag
609 DO i=istart,iend+istag
612 var_nest(i, j, k) = wt(i, j, 1)*nbuffer(ic, jc, k) + wt(i&
613 & , j, 2)*nbuffer(ic, jc+1, k) + wt(i, j, 3)*nbuffer(ic+1&
614 & , jc+1, k) + wt(i, j, 4)*nbuffer(ic+1, jc, k)
628 REAL,
DIMENSION(:, :, :),
INTENT(IN) :: var_coarse
629 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
630 INTEGER,
INTENT(IN) :: istag, jstag
631 REAL,
ALLOCATABLE :: wbuffer(:, :, :)
632 REAL,
ALLOCATABLE :: ebuffer(:, :, :)
633 REAL,
ALLOCATABLE :: sbuffer(:, :, :)
634 REAL,
ALLOCATABLE :: nbuffer(:, :, :)
635 INTEGER :: i, j, ic, jc, istart, iend, k
637 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 639 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 641 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 646 ALLOCATE(wbuffer(1, 1, 1))
647 ALLOCATE(ebuffer(1, 1, 1))
648 ALLOCATE(sbuffer(1, 1, 1))
649 ALLOCATE(nbuffer(1, 1, 1))
652 & , ebuffer, nbuffer, position)
660 & ind, wt, istag, jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, &
661 & nsplit_in, proc_in)
663 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
664 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg
665 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
667 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
669 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
670 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
672 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
674 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
675 LOGICAL,
INTENT(IN),
OPTIONAL :: proc_in
676 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
677 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
678 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
679 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
680 REAL,
ALLOCATABLE :: wbuffer(:, :)
681 REAL,
ALLOCATABLE :: ebuffer(:, :)
682 REAL,
ALLOCATABLE :: sbuffer(:, :)
683 REAL,
ALLOCATABLE :: nbuffer(:, :)
684 INTEGER :: i, j, ic, jc, istart, iend, k
687 INTEGER :: is, ie, js, je
688 INTEGER :: isd, ied, jsd, jed
698 IF (
PRESENT(proc_in))
THEN 703 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 705 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 707 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 712 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
713 & isw_c, iew_c, jsw_c, jew_c, west, position)
714 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
715 & ise_c, iee_c, jse_c, jee_c, east, position)
716 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
717 & iss_c, ies_c, jss_c, jes_c, south, position)
718 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
719 & isn_c, ien_c, jsn_c, jen_c, north, position)
720 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 721 ALLOCATE(wbuffer(isw_c:iew_c, jsw_c:jew_c))
723 ALLOCATE(wbuffer(1, 1))
726 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 727 ALLOCATE(ebuffer(ise_c:iee_c, jse_c:jee_c))
729 ALLOCATE(ebuffer(1, 1))
732 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 733 ALLOCATE(sbuffer(iss_c:ies_c, jss_c:jes_c))
735 ALLOCATE(sbuffer(1, 1))
738 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 739 ALLOCATE(nbuffer(isn_c:ien_c, jsn_c:jen_c))
741 ALLOCATE(nbuffer(1, 1))
746 & , ebuffer, nbuffer, position)
755 var_nest(i, j) = wt(i, j, 1)*wbuffer(ic, jc) + wt(i, j, 2)*&
756 & wbuffer(ic, jc+1) + wt(i, j, 3)*wbuffer(ic+1, jc+1) + wt(i&
757 & , j, 4)*wbuffer(ic+1, jc)
767 IF (ie .EQ. npx - 1)
THEN 773 DO i=istart,iend+istag
776 var_nest(i, j) = wt(i, j, 1)*sbuffer(ic, jc) + wt(i, j, 2)*&
777 & sbuffer(ic, jc+1) + wt(i, j, 3)*sbuffer(ic+1, jc+1) + wt(i&
778 & , j, 4)*sbuffer(ic+1, jc)
782 IF (ie .EQ. npx - 1)
THEN 784 DO i=npx+istag,ied+istag
787 var_nest(i, j) = wt(i, j, 1)*ebuffer(ic, jc) + wt(i, j, 2)*&
788 & ebuffer(ic, jc+1) + wt(i, j, 3)*ebuffer(ic+1, jc+1) + wt(i&
789 & , j, 4)*ebuffer(ic+1, jc)
793 IF (je .EQ. npy - 1)
THEN 799 IF (ie .EQ. npx - 1)
THEN 804 DO j=npy+jstag,jed+jstag
805 DO i=istart,iend+istag
808 var_nest(i, j) = wt(i, j, 1)*nbuffer(ic, jc) + wt(i, j, 2)*&
809 & nbuffer(ic, jc+1) + wt(i, j, 3)*nbuffer(ic+1, jc+1) + wt(i&
810 & , j, 4)*nbuffer(ic+1, jc)
821 & jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
823 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
824 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg
825 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
827 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
829 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
831 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
833 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
834 INTEGER :: nstep, nsplit
835 INTEGER :: i, j, ic, jc, istart, iend
836 INTEGER :: is, ie, js, je
837 INTEGER :: isd, ied, jsd, jed
847 IF ((.NOT.
PRESENT(nstep_in)) .OR. (.NOT.
PRESENT(nsplit_in)))
THEN 859 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
860 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
861 & wt(i, j, 4)*var_coarse(ic+1, jc)
871 IF (ie .EQ. npx - 1)
THEN 877 DO i=istart,iend+istag
880 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
881 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
882 & wt(i, j, 4)*var_coarse(ic+1, jc)
886 IF (ie .EQ. npx - 1)
THEN 888 DO i=npx+istag,ied+istag
891 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
892 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
893 & wt(i, j, 4)*var_coarse(ic+1, jc)
897 IF (je .EQ. npy - 1)
THEN 903 IF (ie .EQ. npx - 1)
THEN 908 DO j=npy+jstag,jed+jstag
909 DO i=istart,iend+istag
912 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
913 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
914 & wt(i, j, 4)*var_coarse(ic+1, jc)
920 & jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
922 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
923 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg, &
925 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
926 & INTENT(INOUT) :: var_nest
927 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
929 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
931 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
933 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
934 INTEGER :: nstep, nsplit
935 INTEGER :: i, j, ic, jc, istart, iend, k
936 INTEGER :: is, ie, js, je
937 INTEGER :: isd, ied, jsd, jed
947 IF ((.NOT.
PRESENT(nstep_in)) .OR. (.NOT.
PRESENT(nsplit_in)))
THEN 960 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
961 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
962 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
973 IF (ie .EQ. npx - 1)
THEN 980 DO i=istart,iend+istag
983 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
984 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
985 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
990 IF (ie .EQ. npx - 1)
THEN 993 DO i=npx+istag,ied+istag
996 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
997 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
998 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
1003 IF (je .EQ. npy - 1)
THEN 1009 IF (ie .EQ. npx - 1)
THEN 1015 DO j=npy+jstag,jed+jstag
1016 DO i=istart,iend+istag
1019 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
1020 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
1021 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
1029 REAL,
DIMENSION(:, :, :),
INTENT(IN) :: var_coarse
1031 INTEGER,
INTENT(IN) :: istag, jstag
1033 REAL :: wbuffer(1, 1, 1)
1034 REAL :: ebuffer(1, 1, 1)
1035 REAL :: sbuffer(1, 1, 1)
1036 REAL :: nbuffer(1, 1, 1)
1037 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1039 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1041 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1048 & , ebuffer, nbuffer, position)
1056 INTEGER,
INTENT(IN) :: istag, jstag, npz
1058 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz) :: &
1061 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
1062 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
1063 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
1064 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
1067 var_coarse_dummy = 0.0
1068 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1070 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1072 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1077 IF (.NOT.
ALLOCATED(nest_bc_buffers%west_t1))
THEN 1078 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
1079 & isw_c, iew_c, jsw_c, jew_c, west, position)
1080 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
1081 & ise_c, iee_c, jse_c, jee_c, east, position)
1082 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
1083 & iss_c, ies_c, jss_c, jes_c, south, position)
1084 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
1085 & isn_c, ien_c, jsn_c, jen_c, north, position)
1086 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 1087 IF (.NOT.
ALLOCATED(nest_bc_buffers%west_t1))
THEN 1088 ALLOCATE(nest_bc_buffers%west_t1(isw_c:iew_c, jsw_c:jew_c, npz&
1095 nest_bc_buffers%west_t1(i, j, k) = 0.
1100 ALLOCATE(nest_bc_buffers%west_t1(1, 1, 1))
1101 nest_bc_buffers%west_t1(1, 1, 1) = 0.
1103 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 1104 IF (.NOT.
ALLOCATED(nest_bc_buffers%east_t1))
THEN 1105 ALLOCATE(nest_bc_buffers%east_t1(ise_c:iee_c, jse_c:jee_c, npz&
1111 nest_bc_buffers%east_t1(i, j, k) = 0.
1116 ALLOCATE(nest_bc_buffers%east_t1(1, 1, 1))
1117 nest_bc_buffers%east_t1(1, 1, 1) = 0.
1119 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 1120 IF (.NOT.
ALLOCATED(nest_bc_buffers%south_t1))
THEN 1121 ALLOCATE(nest_bc_buffers%south_t1(iss_c:ies_c, jss_c:jes_c, &
1127 nest_bc_buffers%south_t1(i, j, k) = 0.
1132 ALLOCATE(nest_bc_buffers%south_t1(1, 1, 1))
1133 nest_bc_buffers%south_t1(1, 1, 1) = 0.
1135 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 1136 IF (.NOT.
ALLOCATED(nest_bc_buffers%north_t1))
THEN 1137 ALLOCATE(nest_bc_buffers%north_t1(isn_c:ien_c, jsn_c:jen_c, &
1143 nest_bc_buffers%north_t1(i, j, k) = 0.
1148 ALLOCATE(nest_bc_buffers%north_t1(1, 1, 1))
1149 nest_bc_buffers%north_t1(1, 1, 1) = 0
1154 & nest_bc_buffers%west_t1, nest_bc_buffers%&
1155 & south_t1, nest_bc_buffers%east_t1, &
1156 & nest_bc_buffers%north_t1, position)
1160 & , npx, npy, npz, bd, nest_bc, nest_bc_buffers, pd_in)
1164 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1165 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
1167 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
1169 LOGICAL,
INTENT(IN),
OPTIONAL :: pd_in
1174 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz) :: &
1176 REAL,
DIMENSION(:, :, :),
POINTER :: var_east, var_west, var_south, &
1178 REAL,
DIMENSION(:, :, :),
POINTER :: buf_east, buf_west, buf_south, &
1181 INTEGER :: i, j, k, ic, jc, istart, iend
1183 LOGICAL,
SAVE :: pd=.false.
1184 INTEGER :: is, ie, js, je
1185 INTEGER :: isd, ied, jsd, jed
1196 IF (
PRESENT(pd_in))
THEN 1201 var_east => nest_bc%east_t1
1202 var_west => nest_bc%west_t1
1203 var_north => nest_bc%north_t1
1204 var_south => nest_bc%south_t1
1205 buf_east => nest_bc_buffers%east_t1
1206 buf_west => nest_bc_buffers%west_t1
1207 buf_north => nest_bc_buffers%north_t1
1208 buf_south => nest_bc_buffers%south_t1
1218 var_west(i, j, k) = wt(i, j, 1)*buf_west(ic, jc, k) + wt(i, &
1219 & j, 2)*buf_west(ic, jc+1, k) + wt(i, j, 3)*buf_west(ic+1, &
1220 & jc+1, k) + wt(i, j, 4)*buf_west(ic+1, jc, k)
1229 IF (var_west(i, j, k) .LT. 0.5*nest_bc%west_t0(i, j, k)) &
1231 var_west(i, j, k) = 0.5*nest_bc%west_t0(i, j, k)
1233 var_west(i, j, k) = var_west(i, j, k)
1246 IF (ie .EQ. npx - 1)
THEN 1254 DO i=istart,iend+istag
1257 var_south(i, j, k) = wt(i, j, 1)*buf_south(ic, jc, k) + wt(i&
1258 & , j, 2)*buf_south(ic, jc+1, k) + wt(i, j, 3)*buf_south(ic+&
1259 & 1, jc+1, k) + wt(i, j, 4)*buf_south(ic+1, jc, k)
1267 DO i=istart,iend+istag
1268 IF (var_south(i, j, k) .LT. 0.5*nest_bc%south_t0(i, j, k)&
1270 var_south(i, j, k) = 0.5*nest_bc%south_t0(i, j, k)
1272 var_south(i, j, k) = var_south(i, j, k)
1279 IF (ie .EQ. npx - 1)
THEN 1283 DO i=npx+istag,ied+istag
1286 var_east(i, j, k) = wt(i, j, 1)*buf_east(ic, jc, k) + wt(i, &
1287 & j, 2)*buf_east(ic, jc+1, k) + wt(i, j, 3)*buf_east(ic+1, &
1288 & jc+1, k) + wt(i, j, 4)*buf_east(ic+1, jc, k)
1296 DO i=npx+istag,ied+istag
1297 IF (var_east(i, j, k) .LT. 0.5*nest_bc%east_t0(i, j, k)) &
1299 var_east(i, j, k) = 0.5*nest_bc%east_t0(i, j, k)
1301 var_east(i, j, k) = var_east(i, j, k)
1308 IF (je .EQ. npy - 1)
THEN 1314 IF (ie .EQ. npx - 1)
THEN 1321 DO j=npy+jstag,jed+jstag
1322 DO i=istart,iend+istag
1325 var_north(i, j, k) = wt(i, j, 1)*buf_north(ic, jc, k) + wt(i&
1326 & , j, 2)*buf_north(ic, jc+1, k) + wt(i, j, 3)*buf_north(ic+&
1327 & 1, jc+1, k) + wt(i, j, 4)*buf_north(ic+1, jc, k)
1334 DO j=npy+jstag,jed+jstag
1335 DO i=istart,iend+istag
1336 IF (var_north(i, j, k) .LT. 0.5*nest_bc%north_t0(i, j, k)&
1338 var_north(i, j, k) = 0.5*nest_bc%north_t0(i, j, k)
1340 var_north(i, j, k) = var_north(i, j, k)
1355 & , jstag, npx, npy, npz, bd, step, split, bc, bctype)
1358 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1359 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1360 & INTENT(INOUT) :: var_nest
1361 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1362 & INTENT(INOUT) :: var_nest_tl
1363 REAL,
INTENT(IN) :: split, step
1364 INTEGER,
INTENT(IN) :: bctype
1366 REAL,
DIMENSION(:, :, :),
POINTER :: var_t0, var_t1
1367 INTEGER :: i, j, istart, iend, k
1369 LOGICAL,
SAVE :: printdiag=.true.
1370 INTEGER :: is, ie, js, je
1371 INTEGER :: isd, ied, jsd, jed
1382 var_t0 => bc%west_t0
1383 var_t1 => bc%west_t1
1387 var_nest_tl(i, j, k) = 0.0
1388 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1389 & var_t1(i, j, k))*denom
1400 IF (ie .EQ. npx - 1)
THEN 1405 var_t0 => bc%south_t0
1406 var_t1 => bc%south_t1
1409 DO i=istart,iend+istag
1410 var_nest_tl(i, j, k) = 0.0
1411 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1412 & var_t1(i, j, k))*denom
1417 IF (ie .EQ. npx - 1)
THEN 1418 var_t0 => bc%east_t0
1419 var_t1 => bc%east_t1
1422 DO i=npx+istag,ied+istag
1423 var_nest_tl(i, j, k) = 0.0
1424 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1425 & var_t1(i, j, k))*denom
1430 IF (je .EQ. npy - 1)
THEN 1436 IF (ie .EQ. npx - 1)
THEN 1441 var_t0 => bc%north_t0
1442 var_t1 => bc%north_t1
1444 DO j=npy+jstag,jed+jstag
1445 DO i=istart,iend+istag
1446 var_nest_tl(i, j, k) = 0.0
1447 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1448 & var_t1(i, j, k))*denom
1458 & , npz, bd, step, split, bc, bctype)
1461 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1462 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1463 & INTENT(INOUT) :: var_nest
1464 REAL,
INTENT(IN) :: split, step
1465 INTEGER,
INTENT(IN) :: bctype
1467 REAL,
DIMENSION(:, :, :),
POINTER :: var_t0, var_t1
1468 INTEGER :: i, j, istart, iend, k
1470 LOGICAL,
SAVE :: printdiag=.true.
1471 INTEGER :: is, ie, js, je
1472 INTEGER :: isd, ied, jsd, jed
1483 var_t0 => bc%west_t0
1484 var_t1 => bc%west_t1
1488 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1489 & var_t1(i, j, k))*denom
1500 IF (ie .EQ. npx - 1)
THEN 1505 var_t0 => bc%south_t0
1506 var_t1 => bc%south_t1
1509 DO i=istart,iend+istag
1510 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1511 & var_t1(i, j, k))*denom
1516 IF (ie .EQ. npx - 1)
THEN 1517 var_t0 => bc%east_t0
1518 var_t1 => bc%east_t1
1521 DO i=npx+istag,ied+istag
1522 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1523 & var_t1(i, j, k))*denom
1528 IF (je .EQ. npy - 1)
THEN 1534 IF (ie .EQ. npx - 1)
THEN 1539 var_t0 => bc%north_t0
1540 var_t1 => bc%north_t1
1542 DO j=npy+jstag,jed+jstag
1543 DO i=istart,iend+istag
1544 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1545 & var_t1(i, j, k))*denom
1552 & , ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, &
1553 & js_n, je_n, isu, ieu, jsu, jeu, npx, npy, istag, jstag, r, &
1554 & nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
1556 INTEGER,
INTENT(IN) :: isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n&
1558 INTEGER,
INTENT(IN) :: isu, ieu, jsu, jeu
1559 INTEGER,
INTENT(IN) :: istag, jstag, r, nestupdate, upoff, nsponge
1560 INTEGER,
INTENT(IN) :: ind_update(isd_p:ied_p+1, jsd_p:jed_p+1, 2)
1561 INTEGER,
INTENT(IN) :: npx, npy
1562 REAL,
INTENT(IN) :: var_nest(is_n:ie_n+istag, js_n:je_n+jstag)
1563 REAL,
INTENT(INOUT) :: var_coarse(isd_p:ied_p+istag, jsd_p:jed_p+&
1565 REAL,
INTENT(IN) :: dx(isd:ied, jsd:jed+1)
1566 REAL,
INTENT(IN) :: dy(isd:ied+1, jsd:jed)
1567 REAL,
INTENT(IN) :: area(isd:ied, jsd:jed)
1568 LOGICAL,
INTENT(IN) :: parent_proc, child_proc
1569 TYPE(FV_ATMOS_TYPE),
INTENT(INOUT) :: parent_grid
1570 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
1571 REAL :: var_nest_3d(is_n:ie_n+istag, js_n:je_n+jstag, 1)
1572 REAL :: var_coarse_3d(isd_p:ied_p+istag, jsd_p:jed_p+jstag, 1)
1574 IF (child_proc .AND.
SIZE(var_nest) .GT. 1) var_nest_3d(is_n:ie_n+&
1575 & istag, js_n:je_n+jstag, 1) = var_nest(is_n:ie_n+istag, js_n:je_n+&
1577 IF (parent_proc .AND.
SIZE(var_coarse) .GT. 1) var_coarse_3d(isd_p:&
1578 & ied_p+istag, jsd_p:jed_p, 1) = var_coarse(isd_p:ied_p+istag, jsd_p&
1581 & , ind_update, dx, dy, area, isd_p, ied_p, &
1582 & jsd_p, jed_p, is_n, ie_n, js_n, je_n, isu, ieu&
1583 & , jsu, jeu, npx, npy, 1, istag, jstag, r, &
1584 & nestupdate, upoff, nsponge, parent_proc, &
1585 & child_proc, parent_grid)
1586 IF (
SIZE(var_coarse) .GT. 1 .AND. parent_proc) var_coarse(isd_p:&
1587 & ied_p+istag, jsd_p:jed_p+jstag) = var_coarse_3d(isd_p:ied_p+istag&
1591 & ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, &
1592 & js_n, je_n, isu, ieu, jsu, jeu, npx, npy, npz, istag, jstag, r, &
1593 & nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
1598 INTEGER,
INTENT(IN) :: isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n&
1600 INTEGER,
INTENT(IN) :: isu, ieu, jsu, jeu
1601 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz, r, nestupdate, &
1603 INTEGER,
INTENT(IN) :: ind_update(isd_p:ied_p+1, jsd_p:jed_p+1, 2)
1604 REAL,
INTENT(IN) :: var_nest(is_n:ie_n+istag, js_n:je_n+jstag, npz)
1605 REAL,
INTENT(INOUT) :: var_coarse(isd_p:ied_p+istag, jsd_p:jed_p+&
1607 REAL,
INTENT(IN) :: area(isd:ied, jsd:jed)
1608 REAL,
INTENT(IN) :: dx(isd:ied, jsd:jed+1)
1609 REAL,
INTENT(IN) :: dy(isd:ied+1, jsd:jed)
1610 LOGICAL,
INTENT(IN) :: parent_proc, child_proc
1611 TYPE(FV_ATMOS_TYPE),
INTENT(INOUT) :: parent_grid
1612 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
1613 INTEGER :: in, jn, ini, jnj, s, qr
1614 INTEGER :: is_c, ie_c, js_c, je_c, is_f, ie_f, js_f, je_f
1615 INTEGER :: istart, istop, jstart, jstop, ishift, jshift, j, i, k
1617 REAL,
DIMENSION(:, :, :),
ALLOCATABLE :: nest_dat
1618 REAL :: var_nest_send(is_n:ie_n+istag, js_n:je_n+jstag, npz)
1620 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1622 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1624 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1629 CALL mpp_get_f2c_index(nest_domain, is_c, ie_c, js_c, je_c, is_f, &
1630 & ie_f, js_f, je_f, position)
1631 IF (ie_f .GT. is_f .AND. je_f .GT. js_f)
THEN 1632 ALLOCATE(nest_dat(is_f:ie_f, js_f:je_f, npz))
1634 ALLOCATE(nest_dat(1, 1, 1))
1637 IF (child_proc)
THEN 1639 IF (istag .EQ. 0 .AND. jstag .EQ. 0)
THEN 1640 SELECT CASE (nestupdate)
1641 CASE (1, 2, 6, 7, 8)
1646 var_nest_send(i, j, k) = var_nest(i, j, k)*area(i, j)
1651 ELSE IF (istag .EQ. 0 .AND. jstag .GT. 0)
THEN 1652 SELECT CASE (nestupdate)
1658 var_nest_send(i, j, k) = var_nest(i, j, k)*dx(i, j)
1663 CALL mpp_error(fatal,
'nestupdate type not implemented')
1665 ELSE IF (istag .GT. 0 .AND. jstag .EQ. 0)
THEN 1666 SELECT CASE (nestupdate)
1673 var_nest_send(i, j, k) = var_nest(i, j, k)*dy(i, j)
1678 CALL mpp_error(fatal,
'nestupdate type not implemented')
1682 &
'Cannot have both nonzero istag and jstag.')
1687 & position=position)
1691 qr = r*upoff + nsponge - s
1692 IF (parent_proc .AND. (.NOT.(ieu .LT. isu .OR. jeu .LT. jsu)))
THEN 1693 IF (istag .EQ. 0 .AND. jstag .EQ. 0)
THEN 1694 SELECT CASE (nestupdate)
1695 CASE (1, 2, 6, 7, 8)
1702 in = ind_update(i, j, 1)
1703 jn = ind_update(i, j, 2)
1713 val = val + nest_dat(ini, jnj, k)
1719 var_coarse(i, j, k) = val*parent_grid%gridstruct%rarea(i&
1725 CALL mpp_error(fatal,
'nestupdate type not implemented')
1727 ELSE IF (istag .EQ. 0 .AND. jstag .GT. 0)
THEN 1728 SELECT CASE (nestupdate)
1735 in = ind_update(i, j, 1)
1736 jn = ind_update(i, j, 2)
1745 val = val + nest_dat(ini, jn, k)
1748 var_coarse(i, j, k) = val*parent_grid%gridstruct%rdx(i, &
1754 CALL mpp_error(fatal,
'nestupdate type not implemented')
1756 ELSE IF (istag .GT. 0 .AND. jstag .EQ. 0)
THEN 1757 SELECT CASE (nestupdate)
1765 in = ind_update(i, j, 1)
1766 jn = ind_update(i, j, 2)
1775 val = val + nest_dat(in, jnj, k)
1778 var_coarse(i, j, k) = val*parent_grid%gridstruct%rdy(i, &
1784 CALL mpp_error(fatal,
'nestupdate type not implemented')
1788 DEALLOCATE(nest_dat)
subroutine, public nested_grid_bc_apply_intt(var_nest, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine nested_grid_bc_2d(var_nest, var_coarse, ind, wt, istag, jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
subroutine, public nested_grid_bc_send(var_coarse, nest_domain, istag, jstag)
l_size ! loop over number of fields ke do je do ie to je n if(.NOT. d_comm%R_do_buf(list)) cycle from_pe
subroutine update_coarse_grid_mpp_2d(var_coarse, var_nest, nest_domain, ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n, je_n, isu, ieu, jsu, jeu, npx, npy, istag, jstag, r, nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
integer, parameter, public ng
subroutine timing_on(blk_name)
subroutine nested_grid_bc_mpp_send(var_coarse, nest_domain, istag, jstag)
subroutine fill_nested_grid_2d(var_nest, var_coarse, ind, wt, istag, jstag, isg, ieg, jsg, jeg, bd, istart_in, iend_in, jstart_in, jend_in)
subroutine update_coarse_grid_mpp(var_coarse, var_nest, nest_domain, ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n, je_n, isu, ieu, jsu, jeu, npx, npy, npz, istag, jstag, r, nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
subroutine fill_nested_grid_3d(var_nest, var_coarse, ind, wt, istag, jstag, isg, ieg, jsg, jeg, npz, bd, istart_in, iend_in, jstart_in, jend_in)
subroutine nested_grid_bc_3d(var_nest, var_coarse, ind, wt, istag, jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
real, parameter, public grav
Acceleration due to gravity [m/s^2].
subroutine, public nested_grid_bc_save_proc(nest_domain, ind, wt, istag, jstag, npx, npy, npz, bd, nest_bc, nest_bc_buffers, pd_in)
subroutine, public nested_grid_bc_apply_intt_tlm(var_nest, var_nest_tl, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine, public extrapolation_bc(q, istag, jstag, npx, npy, bd, pd_in, debug_in)
subroutine nested_grid_bc_mpp(var_nest, var_coarse, nest_domain, ind, wt, istag, jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in, proc_in)
subroutine, public nested_grid_bc_recv(nest_domain, istag, jstag, npz, bd, nest_bc_buffers)
subroutine nested_grid_bc_2d_mpp(var_nest, var_coarse, nest_domain, ind, wt, istag, jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in, proc_in)
subroutine timing_off(blk_name)