22 use fv_mp_nlm_mod,
only:
ng, isc,jsc,iec,jec, isd,jsd,ied,jed, is,js,ie,je, is_master
76 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy
77 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), intent(&
79 LOGICAL,
INTENT(IN),
OPTIONAL :: pd_in, debug_in
80 INTEGER :: i, j, istart, iend, jstart, jend
82 INTEGER :: is, ie, js, je
83 INTEGER :: isd, ied, jsd, jed
101 IF (ied .GT. npx - 1)
THEN 111 IF (jed .GT. npy - 1)
THEN 117 IF (
PRESENT(pd_in))
THEN 122 IF (
PRESENT(debug_in))
THEN 129 DO j=jstart,jend+jstag
131 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
132 & q(1, j) .LT. q(2, j)) THEN
135 q(i, j) =
REAL(2-i)*q(1, j) -
REAL(1-i)*q(2, j)
140 DO j=jstart,jend+jstag
142 q(i, j) =
REAL(2-i)*q(1, j) -
REAL(1-i)*q(2, j)
150 DO i=istart,iend+istag
151 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
152 & q(i, 1) .LT. q(i, 2)) THEN
155 q(i, j) =
REAL(2-j)*q(i, 1) -
REAL(1-j)*q(i, 2)
161 DO i=istart,iend+istag
162 q(i, j) =
REAL(2-j)*q(i, 1) -
REAL(1-j)*q(i, 2)
167 IF (ie .EQ. npx - 1)
THEN 169 DO j=jstart,jend+jstag
170 DO i=ie+1+istag,ied+istag
171 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
172 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag, j) .LT. q(ie&
176 q(i, j) =
REAL(i-(ie+istag-1))*q(ie+istag, j) +
REAL(ie+&
177 & istag-i)*q(ie+istag-1, j)
182 DO j=jstart,jend+jstag
183 DO i=ie+1+istag,ied+istag
184 q(i, j) =
REAL(i-(ie+istag-1))*q(ie+istag, j) +
REAL(ie+&
185 & istag-i)*q(ie+istag-1, j)
190 IF (je .EQ. npy - 1)
THEN 192 DO j=je+1+jstag,jed+jstag
193 DO i=istart,iend+istag
194 IF (
REAL(j) .GE. je + jstag + q(i, je+jstag)/(q(i, je+jstag-&
195 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
199 q(i, j) =
REAL(j-(je+jstag-1))*q(i, je+jstag) +
REAL(je+&
200 & jstag-j)*q(i, je+jstag-1)
205 DO j=je+1+jstag,jed+jstag
206 DO i=istart,iend+istag
207 q(i, j) =
REAL(j-(je+jstag-1))*q(i, je+jstag) +
REAL(je+&
208 & jstag-j)*q(i, je+jstag-1)
214 IF (is .EQ. 1 .AND. js .EQ. 1)
THEN 218 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
219 & q(2, j) .GT. q(1, j)) THEN
220 q(i, j) = 0.5*q(i+1, j)
222 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j))
224 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
225 & q(i, 2) .GT. q(i, 1)) THEN
226 q(i, j) = q(i, j) + 0.5*q(i, j+1)
228 q(i, j) = q(i, j) + 0.5*(
REAL(2-j)*q(i, 1)-
REAL(1-j)*q(i, &
236 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j)) + 0.5*(&
237 & REAL(2-j)*q(i, 1)-REAL(1-j)*q(i, 2))
242 IF (is .EQ. 1 .AND. je .EQ. npy - 1)
THEN 244 DO j=je+1+jstag,jed+jstag
246 IF (
REAL(i) .LE. 1. - q(1, j)/(q(2, j)-q(1, j)+1.e-12) .AND.&
247 & q(2, j) .GT. q(1, j)) THEN
248 q(i, j) = 0.5*q(i+1, j)
250 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j))
254 IF (
REAL(j) .GE. je + jstag - q(i, je+jstag)/(q(i, je+jstag-&
255 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
257 q(i, j) = q(i, j) + 0.5*q(i, j-1)
259 q(i, j) = q(i, j) + 0.5*(
REAL(j-(je+jstag-1))*q(i, je+&
260 & jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
265 DO j=je+1+jstag,jed+jstag
267 q(i, j) = 0.5*(
REAL(2-i)*q(1, j)-
REAL(1-i)*q(2, j)) + 0.5*(&
268 & REAL(j-(je+jstag-1))*q(i, je+jstag)+REAL(je+jstag-j)*q(i, &
274 IF (ie .EQ. npx - 1 .AND. je .EQ. npy - 1)
THEN 276 DO j=je+1+jstag,jed+jstag
277 DO i=ie+1+istag,ied+istag
278 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
279 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag-1, j) .GT. q(&
281 q(i, j) = 0.5*q(i-1, j)
283 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie&
284 & +istag-i)*q(ie+istag-1, j))
286 IF (
REAL(j) .GE. je + jstag + q(i, je+jstag)/(q(i, je+jstag-&
287 & 1)-q(i, je+jstag)+1.e-12) .AND. q(i, je+jstag-1) .GT. q(&
289 q(i, j) = q(i, j) + 0.5*q(i, j-1)
291 q(i, j) = q(i, j) + 0.5*(
REAL(j-(je+jstag-1))*q(i, je+&
292 & jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
297 DO j=je+1+jstag,jed+jstag
298 DO i=ie+1+istag,ied+istag
299 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie+&
300 & istag-i)*q(ie+istag-1, j)) + 0.5*(REAL(j-(je+jstag-1))*q(i&
301 & , je+jstag)+REAL(je+jstag-j)*q(i, je+jstag-1))
306 IF (ie .EQ. npx - 1 .AND. js .EQ. 1)
THEN 309 DO i=ie+1+istag,ied+istag
310 IF (
REAL(i) .GE. ie + istag + q(ie+istag, j)/(q(ie+istag-1, &
311 & j)-q(ie+istag, j)+1.e-12) .AND. q(ie+istag-1, j) .GT. q(&
313 q(i, j) = 0.5*q(i-1, j)
315 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie&
316 & +istag-i)*q(ie+istag-1, j))
318 IF (
REAL(j) .LE. 1. - q(i, 1)/(q(i, 2)-q(i, 1)+1.e-12) .AND.&
319 & q(i, 2) .GT. q(i, 1)) THEN
320 q(i, j) = q(i, j) + 0.5*q(i, j+1)
322 q(i, j) = q(i, j) + 0.5*(
REAL(2-j)*q(i, 1)-
REAL(1-j)*q(i, &
329 DO i=ie+1+istag,ied+istag
330 q(i, j) = 0.5*(
REAL(i-(ie+istag-1))*q(ie+istag, j)+
REAL(ie+&
331 & istag-i)*q(ie+istag-1, j)) + 0.5*(REAL(2-j)*q(i, 1)-REAL(1&
339 & jstag, isg, ieg, jsg, jeg, bd, istart_in, iend_in, jstart_in, &
342 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
343 INTEGER,
INTENT(IN) :: istag, jstag, isg, ieg, jsg, jeg
344 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
346 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
348 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
350 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
352 INTEGER,
INTENT(IN),
OPTIONAL :: istart_in, iend_in, jstart_in, &
354 INTEGER :: i, j, ic, jc
355 INTEGER :: istart, iend, jstart, jend
356 INTEGER :: is, ie, js, je
357 INTEGER :: isd, ied, jsd, jed
367 IF (
PRESENT(istart_in))
THEN 372 IF (
PRESENT(iend_in))
THEN 373 iend = iend_in + istag
377 IF (
PRESENT(jstart_in))
THEN 382 IF (
PRESENT(jend_in))
THEN 383 jend = jend_in + jstag
391 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
392 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + wt&
393 & (i, j, 4)*var_coarse(ic+1, jc)
398 & jstag, isg, ieg, jsg, jeg, npz, bd, istart_in, iend_in, jstart_in, &
401 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
402 INTEGER,
INTENT(IN) :: istag, jstag, isg, ieg, jsg, jeg, npz
403 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
404 & INTENT(INOUT) :: var_nest
405 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
407 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
409 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
411 INTEGER,
INTENT(IN),
OPTIONAL :: istart_in, iend_in, jstart_in, &
413 INTEGER :: i, j, ic, jc, k
414 INTEGER :: istart, iend, jstart, jend
415 INTEGER :: is, ie, js, je
416 INTEGER :: isd, ied, jsd, jed
426 IF (
PRESENT(istart_in))
THEN 431 IF (
PRESENT(iend_in))
THEN 432 iend = iend_in + istag
436 IF (
PRESENT(jstart_in))
THEN 441 IF (
PRESENT(jend_in))
THEN 442 jend = jend_in + jstag
451 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i, &
452 & j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(ic+1&
453 & , jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
459 & wt, istag, jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, &
460 & nsplit_in, proc_in)
462 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
463 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz, isg, ieg, jsg, &
465 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
466 & INTENT(INOUT) :: var_nest
467 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
469 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
470 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
472 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
474 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
475 LOGICAL,
INTENT(IN),
OPTIONAL :: proc_in
476 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
477 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
478 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
479 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
480 REAL,
ALLOCATABLE :: wbuffer(:, :, :)
481 REAL,
ALLOCATABLE :: ebuffer(:, :, :)
482 REAL,
ALLOCATABLE :: sbuffer(:, :, :)
483 REAL,
ALLOCATABLE :: nbuffer(:, :, :)
484 INTEGER :: i, j, ic, jc, istart, iend, k
487 INTEGER :: is, ie, js, je
488 INTEGER :: isd, ied, jsd, jed
498 IF (
PRESENT(proc_in))
THEN 503 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 505 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 507 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 512 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
513 & isw_c, iew_c, jsw_c, jew_c, west, position)
514 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
515 & ise_c, iee_c, jse_c, jee_c, east, position)
516 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
517 & iss_c, ies_c, jss_c, jes_c, south, position)
518 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
519 & isn_c, ien_c, jsn_c, jen_c, north, position)
520 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 521 ALLOCATE(wbuffer(isw_c:iew_c, jsw_c:jew_c, npz))
523 ALLOCATE(wbuffer(1, 1, 1))
526 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 527 ALLOCATE(ebuffer(ise_c:iee_c, jse_c:jee_c, npz))
529 ALLOCATE(ebuffer(1, 1, 1))
532 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 533 ALLOCATE(sbuffer(iss_c:ies_c, jss_c:jes_c, npz))
535 ALLOCATE(sbuffer(1, 1, 1))
538 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 539 ALLOCATE(nbuffer(isn_c:ien_c, jsn_c:jen_c, npz))
541 ALLOCATE(nbuffer(1, 1, 1))
546 & , ebuffer, nbuffer, position)
556 var_nest(i, j, k) = wt(i, j, 1)*wbuffer(ic, jc, k) + wt(i&
557 & , j, 2)*wbuffer(ic, jc+1, k) + wt(i, j, 3)*wbuffer(ic+1&
558 & , jc+1, k) + wt(i, j, 4)*wbuffer(ic+1, jc, k)
569 IF (ie .EQ. npx - 1)
THEN 576 DO i=istart,iend+istag
579 var_nest(i, j, k) = wt(i, j, 1)*sbuffer(ic, jc, k) + wt(i&
580 & , j, 2)*sbuffer(ic, jc+1, k) + wt(i, j, 3)*sbuffer(ic+1&
581 & , jc+1, k) + wt(i, j, 4)*sbuffer(ic+1, jc, k)
586 IF (ie .EQ. npx - 1)
THEN 589 DO i=npx+istag,ied+istag
592 var_nest(i, j, k) = wt(i, j, 1)*ebuffer(ic, jc, k) + wt(i&
593 & , j, 2)*ebuffer(ic, jc+1, k) + wt(i, j, 3)*ebuffer(ic+1&
594 & , jc+1, k) + wt(i, j, 4)*ebuffer(ic+1, jc, k)
599 IF (je .EQ. npy - 1)
THEN 605 IF (ie .EQ. npx - 1)
THEN 611 DO j=npy+jstag,jed+jstag
612 DO i=istart,iend+istag
615 var_nest(i, j, k) = wt(i, j, 1)*nbuffer(ic, jc, k) + wt(i&
616 & , j, 2)*nbuffer(ic, jc+1, k) + wt(i, j, 3)*nbuffer(ic+1&
617 & , jc+1, k) + wt(i, j, 4)*nbuffer(ic+1, jc, k)
631 REAL,
DIMENSION(:, :, :),
INTENT(IN) :: var_coarse
632 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
633 INTEGER,
INTENT(IN) :: istag, jstag
634 REAL,
ALLOCATABLE :: wbuffer(:, :, :)
635 REAL,
ALLOCATABLE :: ebuffer(:, :, :)
636 REAL,
ALLOCATABLE :: sbuffer(:, :, :)
637 REAL,
ALLOCATABLE :: nbuffer(:, :, :)
638 INTEGER :: i, j, ic, jc, istart, iend, k
640 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 642 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 644 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 649 ALLOCATE(wbuffer(1, 1, 1))
650 ALLOCATE(ebuffer(1, 1, 1))
651 ALLOCATE(sbuffer(1, 1, 1))
652 ALLOCATE(nbuffer(1, 1, 1))
655 & , ebuffer, nbuffer, position)
663 & ind, wt, istag, jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, &
664 & nsplit_in, proc_in)
666 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
667 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg
668 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
670 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
672 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
673 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
675 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
677 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
678 LOGICAL,
INTENT(IN),
OPTIONAL :: proc_in
679 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
680 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
681 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
682 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
683 REAL,
ALLOCATABLE :: wbuffer(:, :)
684 REAL,
ALLOCATABLE :: ebuffer(:, :)
685 REAL,
ALLOCATABLE :: sbuffer(:, :)
686 REAL,
ALLOCATABLE :: nbuffer(:, :)
687 INTEGER :: i, j, ic, jc, istart, iend, k
690 INTEGER :: is, ie, js, je
691 INTEGER :: isd, ied, jsd, jed
701 IF (
PRESENT(proc_in))
THEN 706 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 708 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 710 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 715 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
716 & isw_c, iew_c, jsw_c, jew_c, west, position)
717 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
718 & ise_c, iee_c, jse_c, jee_c, east, position)
719 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
720 & iss_c, ies_c, jss_c, jes_c, south, position)
721 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
722 & isn_c, ien_c, jsn_c, jen_c, north, position)
723 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 724 ALLOCATE(wbuffer(isw_c:iew_c, jsw_c:jew_c))
726 ALLOCATE(wbuffer(1, 1))
729 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 730 ALLOCATE(ebuffer(ise_c:iee_c, jse_c:jee_c))
732 ALLOCATE(ebuffer(1, 1))
735 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 736 ALLOCATE(sbuffer(iss_c:ies_c, jss_c:jes_c))
738 ALLOCATE(sbuffer(1, 1))
741 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 742 ALLOCATE(nbuffer(isn_c:ien_c, jsn_c:jen_c))
744 ALLOCATE(nbuffer(1, 1))
749 & , ebuffer, nbuffer, position)
758 var_nest(i, j) = wt(i, j, 1)*wbuffer(ic, jc) + wt(i, j, 2)*&
759 & wbuffer(ic, jc+1) + wt(i, j, 3)*wbuffer(ic+1, jc+1) + wt(i&
760 & , j, 4)*wbuffer(ic+1, jc)
770 IF (ie .EQ. npx - 1)
THEN 776 DO i=istart,iend+istag
779 var_nest(i, j) = wt(i, j, 1)*sbuffer(ic, jc) + wt(i, j, 2)*&
780 & sbuffer(ic, jc+1) + wt(i, j, 3)*sbuffer(ic+1, jc+1) + wt(i&
781 & , j, 4)*sbuffer(ic+1, jc)
785 IF (ie .EQ. npx - 1)
THEN 787 DO i=npx+istag,ied+istag
790 var_nest(i, j) = wt(i, j, 1)*ebuffer(ic, jc) + wt(i, j, 2)*&
791 & ebuffer(ic, jc+1) + wt(i, j, 3)*ebuffer(ic+1, jc+1) + wt(i&
792 & , j, 4)*ebuffer(ic+1, jc)
796 IF (je .EQ. npy - 1)
THEN 802 IF (ie .EQ. npx - 1)
THEN 807 DO j=npy+jstag,jed+jstag
808 DO i=istart,iend+istag
811 var_nest(i, j) = wt(i, j, 1)*nbuffer(ic, jc) + wt(i, j, 2)*&
812 & nbuffer(ic, jc+1) + wt(i, j, 3)*nbuffer(ic+1, jc+1) + wt(i&
813 & , j, 4)*nbuffer(ic+1, jc)
824 & jstag, npx, npy, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
826 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
827 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg
828 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag), INTENT(&
830 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag),
INTENT(IN) :: &
832 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
834 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
836 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
837 INTEGER :: nstep, nsplit
838 INTEGER :: i, j, ic, jc, istart, iend
839 INTEGER :: is, ie, js, je
840 INTEGER :: isd, ied, jsd, jed
850 IF ((.NOT.
PRESENT(nstep_in)) .OR. (.NOT.
PRESENT(nsplit_in)))
THEN 862 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
863 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
864 & wt(i, j, 4)*var_coarse(ic+1, jc)
874 IF (ie .EQ. npx - 1)
THEN 880 DO i=istart,iend+istag
883 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
884 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
885 & wt(i, j, 4)*var_coarse(ic+1, jc)
889 IF (ie .EQ. npx - 1)
THEN 891 DO i=npx+istag,ied+istag
894 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
895 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
896 & wt(i, j, 4)*var_coarse(ic+1, jc)
900 IF (je .EQ. npy - 1)
THEN 906 IF (ie .EQ. npx - 1)
THEN 911 DO j=npy+jstag,jed+jstag
912 DO i=istart,iend+istag
915 var_nest(i, j) = wt(i, j, 1)*var_coarse(ic, jc) + wt(i, j, 2)*&
916 & var_coarse(ic, jc+1) + wt(i, j, 3)*var_coarse(ic+1, jc+1) + &
917 & wt(i, j, 4)*var_coarse(ic+1, jc)
923 & jstag, npx, npy, npz, bd, isg, ieg, jsg, jeg, nstep_in, nsplit_in)
925 TYPE(FV_GRID_BOUNDS_TYPE),
INTENT(IN) :: bd
926 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, isg, ieg, jsg, jeg, &
928 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
929 & INTENT(INOUT) :: var_nest
930 REAL,
DIMENSION(isg:ieg+istag, jsg:jeg+jstag, npz),
INTENT(IN) :: &
932 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
934 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
936 INTEGER,
INTENT(IN),
OPTIONAL :: nstep_in, nsplit_in
937 INTEGER :: nstep, nsplit
938 INTEGER :: i, j, ic, jc, istart, iend, k
939 INTEGER :: is, ie, js, je
940 INTEGER :: isd, ied, jsd, jed
950 IF ((.NOT.
PRESENT(nstep_in)) .OR. (.NOT.
PRESENT(nsplit_in)))
THEN 963 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
964 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
965 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
976 IF (ie .EQ. npx - 1)
THEN 983 DO i=istart,iend+istag
986 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
987 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
988 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
993 IF (ie .EQ. npx - 1)
THEN 996 DO i=npx+istag,ied+istag
999 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
1000 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
1001 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
1006 IF (je .EQ. npy - 1)
THEN 1012 IF (ie .EQ. npx - 1)
THEN 1018 DO j=npy+jstag,jed+jstag
1019 DO i=istart,iend+istag
1022 var_nest(i, j, k) = wt(i, j, 1)*var_coarse(ic, jc, k) + wt(i&
1023 & , j, 2)*var_coarse(ic, jc+1, k) + wt(i, j, 3)*var_coarse(&
1024 & ic+1, jc+1, k) + wt(i, j, 4)*var_coarse(ic+1, jc, k)
1032 REAL,
DIMENSION(:, :, :),
INTENT(IN) :: var_coarse
1034 INTEGER,
INTENT(IN) :: istag, jstag
1036 REAL :: wbuffer(1, 1, 1)
1037 REAL :: ebuffer(1, 1, 1)
1038 REAL :: sbuffer(1, 1, 1)
1039 REAL :: nbuffer(1, 1, 1)
1040 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1042 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1044 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1051 & , ebuffer, nbuffer, position)
1059 INTEGER,
INTENT(IN) :: istag, jstag, npz
1061 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz) :: &
1064 INTEGER :: isw_f, iew_f, jsw_f, jew_f, isw_c, iew_c, jsw_c, jew_c
1065 INTEGER :: ise_f, iee_f, jse_f, jee_f, ise_c, iee_c, jse_c, jee_c
1066 INTEGER :: iss_f, ies_f, jss_f, jes_f, iss_c, ies_c, jss_c, jes_c
1067 INTEGER :: isn_f, ien_f, jsn_f, jen_f, isn_c, ien_c, jsn_c, jen_c
1070 var_coarse_dummy = 0.0
1071 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1073 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1075 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1080 IF (.NOT.
ALLOCATED(nest_bc_buffers%west_t1))
THEN 1081 CALL mpp_get_c2f_index(nest_domain, isw_f, iew_f, jsw_f, jew_f, &
1082 & isw_c, iew_c, jsw_c, jew_c, west, position)
1083 CALL mpp_get_c2f_index(nest_domain, ise_f, iee_f, jse_f, jee_f, &
1084 & ise_c, iee_c, jse_c, jee_c, east, position)
1085 CALL mpp_get_c2f_index(nest_domain, iss_f, ies_f, jss_f, jes_f, &
1086 & iss_c, ies_c, jss_c, jes_c, south, position)
1087 CALL mpp_get_c2f_index(nest_domain, isn_f, ien_f, jsn_f, jen_f, &
1088 & isn_c, ien_c, jsn_c, jen_c, north, position)
1089 IF (iew_c .GE. isw_c .AND. jew_c .GE. jsw_c)
THEN 1090 IF (.NOT.
ALLOCATED(nest_bc_buffers%west_t1))
THEN 1091 ALLOCATE(nest_bc_buffers%west_t1(isw_c:iew_c, jsw_c:jew_c, npz&
1098 nest_bc_buffers%west_t1(i, j, k) = 0.
1103 ALLOCATE(nest_bc_buffers%west_t1(1, 1, 1))
1104 nest_bc_buffers%west_t1(1, 1, 1) = 0.
1106 IF (iee_c .GE. ise_c .AND. jee_c .GE. jse_c)
THEN 1107 IF (.NOT.
ALLOCATED(nest_bc_buffers%east_t1))
THEN 1108 ALLOCATE(nest_bc_buffers%east_t1(ise_c:iee_c, jse_c:jee_c, npz&
1114 nest_bc_buffers%east_t1(i, j, k) = 0.
1119 ALLOCATE(nest_bc_buffers%east_t1(1, 1, 1))
1120 nest_bc_buffers%east_t1(1, 1, 1) = 0.
1122 IF (ies_c .GE. iss_c .AND. jes_c .GE. jss_c)
THEN 1123 IF (.NOT.
ALLOCATED(nest_bc_buffers%south_t1))
THEN 1124 ALLOCATE(nest_bc_buffers%south_t1(iss_c:ies_c, jss_c:jes_c, &
1130 nest_bc_buffers%south_t1(i, j, k) = 0.
1135 ALLOCATE(nest_bc_buffers%south_t1(1, 1, 1))
1136 nest_bc_buffers%south_t1(1, 1, 1) = 0.
1138 IF (ien_c .GE. isn_c .AND. jen_c .GE. jsn_c)
THEN 1139 IF (.NOT.
ALLOCATED(nest_bc_buffers%north_t1))
THEN 1140 ALLOCATE(nest_bc_buffers%north_t1(isn_c:ien_c, jsn_c:jen_c, &
1146 nest_bc_buffers%north_t1(i, j, k) = 0.
1151 ALLOCATE(nest_bc_buffers%north_t1(1, 1, 1))
1152 nest_bc_buffers%north_t1(1, 1, 1) = 0
1157 & nest_bc_buffers%west_t1, nest_bc_buffers%&
1158 & south_t1, nest_bc_buffers%east_t1, &
1159 & nest_bc_buffers%north_t1, position)
1163 & , npx, npy, npz, bd, nest_bc, nest_bc_buffers, pd_in)
1167 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1168 INTEGER,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 2), &
1170 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, 4), &
1172 LOGICAL,
INTENT(IN),
OPTIONAL :: pd_in
1177 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz) :: &
1179 REAL,
DIMENSION(:, :, :),
POINTER :: var_east, var_west, var_south, &
1181 REAL,
DIMENSION(:, :, :),
POINTER :: buf_east, buf_west, buf_south, &
1184 INTEGER :: i, j, k, ic, jc, istart, iend
1186 LOGICAL,
SAVE :: pd=.false.
1187 INTEGER :: is, ie, js, je
1188 INTEGER :: isd, ied, jsd, jed
1199 IF (
PRESENT(pd_in))
THEN 1204 var_east => nest_bc%east_t1
1205 var_west => nest_bc%west_t1
1206 var_north => nest_bc%north_t1
1207 var_south => nest_bc%south_t1
1208 buf_east => nest_bc_buffers%east_t1
1209 buf_west => nest_bc_buffers%west_t1
1210 buf_north => nest_bc_buffers%north_t1
1211 buf_south => nest_bc_buffers%south_t1
1221 var_west(i, j, k) = wt(i, j, 1)*buf_west(ic, jc, k) + wt(i, &
1222 & j, 2)*buf_west(ic, jc+1, k) + wt(i, j, 3)*buf_west(ic+1, &
1223 & jc+1, k) + wt(i, j, 4)*buf_west(ic+1, jc, k)
1232 IF (var_west(i, j, k) .LT. 0.5*nest_bc%west_t0(i, j, k)) &
1234 var_west(i, j, k) = 0.5*nest_bc%west_t0(i, j, k)
1236 var_west(i, j, k) = var_west(i, j, k)
1249 IF (ie .EQ. npx - 1)
THEN 1257 DO i=istart,iend+istag
1260 var_south(i, j, k) = wt(i, j, 1)*buf_south(ic, jc, k) + wt(i&
1261 & , j, 2)*buf_south(ic, jc+1, k) + wt(i, j, 3)*buf_south(ic+&
1262 & 1, jc+1, k) + wt(i, j, 4)*buf_south(ic+1, jc, k)
1270 DO i=istart,iend+istag
1271 IF (var_south(i, j, k) .LT. 0.5*nest_bc%south_t0(i, j, k)&
1273 var_south(i, j, k) = 0.5*nest_bc%south_t0(i, j, k)
1275 var_south(i, j, k) = var_south(i, j, k)
1282 IF (ie .EQ. npx - 1)
THEN 1286 DO i=npx+istag,ied+istag
1289 var_east(i, j, k) = wt(i, j, 1)*buf_east(ic, jc, k) + wt(i, &
1290 & j, 2)*buf_east(ic, jc+1, k) + wt(i, j, 3)*buf_east(ic+1, &
1291 & jc+1, k) + wt(i, j, 4)*buf_east(ic+1, jc, k)
1299 DO i=npx+istag,ied+istag
1300 IF (var_east(i, j, k) .LT. 0.5*nest_bc%east_t0(i, j, k)) &
1302 var_east(i, j, k) = 0.5*nest_bc%east_t0(i, j, k)
1304 var_east(i, j, k) = var_east(i, j, k)
1311 IF (je .EQ. npy - 1)
THEN 1317 IF (ie .EQ. npx - 1)
THEN 1324 DO j=npy+jstag,jed+jstag
1325 DO i=istart,iend+istag
1328 var_north(i, j, k) = wt(i, j, 1)*buf_north(ic, jc, k) + wt(i&
1329 & , j, 2)*buf_north(ic, jc+1, k) + wt(i, j, 3)*buf_north(ic+&
1330 & 1, jc+1, k) + wt(i, j, 4)*buf_north(ic+1, jc, k)
1337 DO j=npy+jstag,jed+jstag
1338 DO i=istart,iend+istag
1339 IF (var_north(i, j, k) .LT. 0.5*nest_bc%north_t0(i, j, k)&
1341 var_north(i, j, k) = 0.5*nest_bc%north_t0(i, j, k)
1343 var_north(i, j, k) = var_north(i, j, k)
1375 & , jstag, npx, npy, npz, bd, step, split, bc, bctype)
1378 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1379 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1380 & INTENT(INOUT) :: var_nest
1381 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1382 & INTENT(INOUT) :: var_nest_ad
1383 REAL,
INTENT(IN) :: split, step
1384 INTEGER,
INTENT(IN) :: bctype
1386 REAL,
DIMENSION(:, :, :),
POINTER :: var_t0, var_t1
1387 INTEGER :: i, j, istart, iend, k
1389 LOGICAL,
SAVE :: printdiag=.true.
1390 INTEGER :: is, ie, js, je
1391 INTEGER :: isd, ied, jsd, jed
1414 IF (ie .EQ. npx - 1)
THEN 1422 i = iend + istag + 1
1431 IF (ie .EQ. npx - 1)
THEN 1436 IF (je .EQ. npy - 1)
THEN 1442 IF (ie .EQ. npx - 1)
THEN 1448 DO j=jed+jstag,npy+jstag,-1
1449 DO i=iend+istag,istart,-1
1450 var_nest_ad(i, j, k) = 0.0
1456 IF (branch .EQ. 0)
THEN 1458 DO j=jed+jstag,jsd,-1
1459 DO i=ied+istag,npx+istag,-1
1460 var_nest_ad(i, j, k) = 0.0
1466 IF (branch .EQ. 0)
THEN 1471 DO i=ad_to,ad_from,-1
1472 var_nest_ad(i, j, k) = 0.0
1478 IF (branch .EQ. 0)
THEN 1480 DO j=jed+jstag,jsd,-1
1482 var_nest_ad(i, j, k) = 0.0
1492 & , npz, bd, step, split, bc, bctype)
1495 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz
1496 REAL,
DIMENSION(bd%isd:bd%ied+istag, bd%jsd:bd%jed+jstag, npz), &
1497 & INTENT(INOUT) :: var_nest
1498 REAL,
INTENT(IN) :: split, step
1499 INTEGER,
INTENT(IN) :: bctype
1501 REAL,
DIMENSION(:, :, :),
POINTER :: var_t0, var_t1
1502 INTEGER :: i, j, istart, iend, k
1504 LOGICAL,
SAVE :: printdiag=.true.
1505 INTEGER :: is, ie, js, je
1506 INTEGER :: isd, ied, jsd, jed
1517 var_t0 => bc%west_t0
1518 var_t1 => bc%west_t1
1522 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1523 & var_t1(i, j, k))*denom
1534 IF (ie .EQ. npx - 1)
THEN 1539 var_t0 => bc%south_t0
1540 var_t1 => bc%south_t1
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
1550 IF (ie .EQ. npx - 1)
THEN 1551 var_t0 => bc%east_t0
1552 var_t1 => bc%east_t1
1555 DO i=npx+istag,ied+istag
1556 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1557 & var_t1(i, j, k))*denom
1562 IF (je .EQ. npy - 1)
THEN 1568 IF (ie .EQ. npx - 1)
THEN 1573 var_t0 => bc%north_t0
1574 var_t1 => bc%north_t1
1576 DO j=npy+jstag,jed+jstag
1577 DO i=istart,iend+istag
1578 var_nest(i, j, k) = (var_t0(i, j, k)*(split-step)+step*&
1579 & var_t1(i, j, k))*denom
1586 & , ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, &
1587 & js_n, je_n, isu, ieu, jsu, jeu, npx, npy, istag, jstag, r, &
1588 & nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
1590 INTEGER,
INTENT(IN) :: isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n&
1592 INTEGER,
INTENT(IN) :: isu, ieu, jsu, jeu
1593 INTEGER,
INTENT(IN) :: istag, jstag, r, nestupdate, upoff, nsponge
1594 INTEGER,
INTENT(IN) :: ind_update(isd_p:ied_p+1, jsd_p:jed_p+1, 2)
1595 INTEGER,
INTENT(IN) :: npx, npy
1596 REAL,
INTENT(IN) :: var_nest(is_n:ie_n+istag, js_n:je_n+jstag)
1597 REAL,
INTENT(INOUT) :: var_coarse(isd_p:ied_p+istag, jsd_p:jed_p+&
1599 REAL,
INTENT(IN) :: dx(isd:ied, jsd:jed+1)
1600 REAL,
INTENT(IN) :: dy(isd:ied+1, jsd:jed)
1601 REAL,
INTENT(IN) :: area(isd:ied, jsd:jed)
1602 LOGICAL,
INTENT(IN) :: parent_proc, child_proc
1603 TYPE(FV_ATMOS_TYPE),
INTENT(INOUT) :: parent_grid
1604 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
1605 REAL :: var_nest_3d(is_n:ie_n+istag, js_n:je_n+jstag, 1)
1606 REAL :: var_coarse_3d(isd_p:ied_p+istag, jsd_p:jed_p+jstag, 1)
1608 IF (child_proc .AND.
SIZE(var_nest) .GT. 1) var_nest_3d(is_n:ie_n+&
1609 & istag, js_n:je_n+jstag, 1) = var_nest(is_n:ie_n+istag, js_n:je_n+&
1611 IF (parent_proc .AND.
SIZE(var_coarse) .GT. 1) var_coarse_3d(isd_p:&
1612 & ied_p+istag, jsd_p:jed_p, 1) = var_coarse(isd_p:ied_p+istag, jsd_p&
1615 & , ind_update, dx, dy, area, isd_p, ied_p, &
1616 & jsd_p, jed_p, is_n, ie_n, js_n, je_n, isu, ieu&
1617 & , jsu, jeu, npx, npy, 1, istag, jstag, r, &
1618 & nestupdate, upoff, nsponge, parent_proc, &
1619 & child_proc, parent_grid)
1620 IF (
SIZE(var_coarse) .GT. 1 .AND. parent_proc) var_coarse(isd_p:&
1621 & ied_p+istag, jsd_p:jed_p+jstag) = var_coarse_3d(isd_p:ied_p+istag&
1625 & ind_update, dx, dy, area, isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, &
1626 & js_n, je_n, isu, ieu, jsu, jeu, npx, npy, npz, istag, jstag, r, &
1627 & nestupdate, upoff, nsponge, parent_proc, child_proc, parent_grid)
1632 INTEGER,
INTENT(IN) :: isd_p, ied_p, jsd_p, jed_p, is_n, ie_n, js_n&
1634 INTEGER,
INTENT(IN) :: isu, ieu, jsu, jeu
1635 INTEGER,
INTENT(IN) :: istag, jstag, npx, npy, npz, r, nestupdate, &
1637 INTEGER,
INTENT(IN) :: ind_update(isd_p:ied_p+1, jsd_p:jed_p+1, 2)
1638 REAL,
INTENT(IN) :: var_nest(is_n:ie_n+istag, js_n:je_n+jstag, npz)
1639 REAL,
INTENT(INOUT) :: var_coarse(isd_p:ied_p+istag, jsd_p:jed_p+&
1641 REAL,
INTENT(IN) :: area(isd:ied, jsd:jed)
1642 REAL,
INTENT(IN) :: dx(isd:ied, jsd:jed+1)
1643 REAL,
INTENT(IN) :: dy(isd:ied+1, jsd:jed)
1644 LOGICAL,
INTENT(IN) :: parent_proc, child_proc
1645 TYPE(FV_ATMOS_TYPE),
INTENT(INOUT) :: parent_grid
1646 TYPE(NEST_DOMAIN_TYPE),
INTENT(INOUT) :: nest_domain
1647 INTEGER :: in, jn, ini, jnj, s, qr
1648 INTEGER :: is_c, ie_c, js_c, je_c, is_f, ie_f, js_f, je_f
1649 INTEGER :: istart, istop, jstart, jstop, ishift, jshift, j, i, k
1651 REAL,
DIMENSION(:, :, :),
ALLOCATABLE :: nest_dat
1652 REAL :: var_nest_send(is_n:ie_n+istag, js_n:je_n+jstag, npz)
1654 IF (istag .EQ. 1 .AND. jstag .EQ. 1)
THEN 1656 ELSE IF (istag .EQ. 0 .AND. jstag .EQ. 1)
THEN 1658 ELSE IF (istag .EQ. 1 .AND. jstag .EQ. 0)
THEN 1663 CALL mpp_get_f2c_index(nest_domain, is_c, ie_c, js_c, je_c, is_f, &
1664 & ie_f, js_f, je_f, position)
1665 IF (ie_f .GT. is_f .AND. je_f .GT. js_f)
THEN 1666 ALLOCATE(nest_dat(is_f:ie_f, js_f:je_f, npz))
1668 ALLOCATE(nest_dat(1, 1, 1))
1671 IF (child_proc)
THEN 1673 IF (istag .EQ. 0 .AND. jstag .EQ. 0)
THEN 1674 SELECT CASE (nestupdate)
1675 CASE (1, 2, 6, 7, 8)
1680 var_nest_send(i, j, k) = var_nest(i, j, k)*area(i, j)
1685 ELSE IF (istag .EQ. 0 .AND. jstag .GT. 0)
THEN 1686 SELECT CASE (nestupdate)
1692 var_nest_send(i, j, k) = var_nest(i, j, k)*dx(i, j)
1697 CALL mpp_error(fatal,
'nestupdate type not implemented')
1699 ELSE IF (istag .GT. 0 .AND. jstag .EQ. 0)
THEN 1700 SELECT CASE (nestupdate)
1707 var_nest_send(i, j, k) = var_nest(i, j, k)*dy(i, j)
1712 CALL mpp_error(fatal,
'nestupdate type not implemented')
1716 &
'Cannot have both nonzero istag and jstag.')
1721 & position=position)
1725 qr = r*upoff + nsponge - s
1726 IF (parent_proc .AND. (.NOT.(ieu .LT. isu .OR. jeu .LT. jsu)))
THEN 1727 IF (istag .EQ. 0 .AND. jstag .EQ. 0)
THEN 1728 SELECT CASE (nestupdate)
1729 CASE (1, 2, 6, 7, 8)
1736 in = ind_update(i, j, 1)
1737 jn = ind_update(i, j, 2)
1747 val = val + nest_dat(ini, jnj, k)
1753 var_coarse(i, j, k) = val*parent_grid%gridstruct%rarea(i&
1759 CALL mpp_error(fatal,
'nestupdate type not implemented')
1761 ELSE IF (istag .EQ. 0 .AND. jstag .GT. 0)
THEN 1762 SELECT CASE (nestupdate)
1769 in = ind_update(i, j, 1)
1770 jn = ind_update(i, j, 2)
1779 val = val + nest_dat(ini, jn, k)
1782 var_coarse(i, j, k) = val*parent_grid%gridstruct%rdx(i, &
1788 CALL mpp_error(fatal,
'nestupdate type not implemented')
1790 ELSE IF (istag .GT. 0 .AND. jstag .EQ. 0)
THEN 1791 SELECT CASE (nestupdate)
1799 in = ind_update(i, j, 1)
1800 jn = ind_update(i, j, 2)
1809 val = val + nest_dat(in, jnj, k)
1812 var_coarse(i, j, k) = val*parent_grid%gridstruct%rdy(i, &
1818 CALL mpp_error(fatal,
'nestupdate type not implemented')
1822 DEALLOCATE(nest_dat)
subroutine, public nested_grid_bc_apply_intt(var_nest, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine popinteger4(x)
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, public nested_grid_bc_apply_intt_adm(var_nest, var_nest_ad, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine, public pushcontrol(ctype, field)
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 pushcontrol1b(cc)
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)
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)
integer, parameter, public ng
subroutine timing_on(blk_name)
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, public nested_grid_bc_save_proc(nest_domain, ind, wt, istag, jstag, npx, npy, npz, bd, nest_bc, nest_bc_buffers, pd_in)
real, parameter, public grav
Acceleration due to gravity [m/s^2].
subroutine popcontrol1b(cc)
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 nested_grid_bc_mpp_send(var_coarse, nest_domain, istag, jstag)
subroutine, public extrapolation_bc(q, istag, jstag, npx, npy, bd, pd_in, debug_in)
subroutine, public popcontrol(ctype, field)
subroutine pushinteger4(x)
subroutine timing_off(blk_name)