Skip to content

Commit c71de28

Browse files
committed
Make wtg_jas2008 compatible with mpiensemble
1 parent fa9b486 commit c71de28

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

wtg_jas2008.f90

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ subroutine wtg_jas2008
1111
integer :: ktrop1
1212
real :: ztrop
1313
real :: ztrop1
14-
real :: min_temp
14+
real :: min_temp
15+
real :: coef, buffer(nzm), buffer1(nzm)
1516

1617
if (dowtg_timedependence) then
1718

@@ -79,7 +80,20 @@ subroutine wtg_jas2008
7980
end if
8081

8182
tv_lsbg = tg0 * (1. + 0.61*qg0)
82-
tv_wave = tabs0 * (1. + 0.61*qv0 - qn0 - qp0)
83+
84+
if(dompiensemble) then
85+
coef = 1. / nsubdomains
86+
do k = 1, nzm
87+
buffer(k) = tabs0(k) * (1. + 0.61*qv0(k) - qn0(k) - qp0(k))
88+
end do
89+
call task_sum_real8(buffer,buffer1,nzm)
90+
do k = 1, nzm
91+
tv_wave(k) = buffer1(k) * coef
92+
end do
93+
else
94+
tv_wave = tabs0 * (1. + 0.61*qv0 - qn0 - qp0)
95+
end if
96+
8397
dwwtgdt = 0.
8498

8599
call calc_wtend(0.5*pi/lambda_wtg, w_wtg(1:ktrop), dwwtgdt(1:ktrop), &

0 commit comments

Comments
 (0)