Skip to content

Commit

Permalink
Merge pull request #82 from CasparJungbacker/to4.4.2_Caspar
Browse files Browse the repository at this point in the history
modsubgrid, anisotropic diffusion: Fix anis_fac index
  • Loading branch information
fjansson authored Jun 13, 2023
2 parents 51f183c + 50b2f22 commit a733474
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/modsubgrid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ subroutine diffc (a_in,a_out,flux)
a_out(i,j,1) = a_out(i,j,1) &
+ 0.5 * ( &
( (ekh(i+1,j,1)+ekh(i,j,1))*(a_in(i+1,j,1)-a_in(i,j,1)) &
-(ekh(i,j,1)+ekh(i-1,j,1))*(a_in(i,j,1)-a_in(i-1,j,1)) )*dx2i * anis_fac(k) &
-(ekh(i,j,1)+ekh(i-1,j,1))*(a_in(i,j,1)-a_in(i-1,j,1)) )*dx2i * anis_fac(1) &
+ &
( (ekh(i,j+1,1)+ekh(i,j,1))*(a_in(i,j+1,1)-a_in(i,j,1)) &
-(ekh(i,j,1)+ekh(i,j-1,1))*(a_in(i,j,1)-a_in(i,j-1,1)) )*dy2i * anis_fac(k) &
-(ekh(i,j,1)+ekh(i,j-1,1))*(a_in(i,j,1)-a_in(i,j-1,1)) )*dy2i * anis_fac(1) &
+ &
( rhobh(2)/rhobf(1) * (dzf(2)*ekh(i,j,1) + dzf(1)*ekh(i,j,2)) &
* (a_in(i,j,2)-a_in(i,j,1)) / dzh(2)**2 &
Expand Down Expand Up @@ -678,10 +678,10 @@ subroutine diffe(a_out)

a_out(i,j,1) = a_out(i,j,1) + &
( (ekm(i+1,j,1)+ekm(i,j,1))*(e120(i+1,j,1)-e120(i,j,1)) &
-(ekm(i,j,1)+ekm(i-1,j,1))*(e120(i,j,1)-e120(i-1,j,1)) )*dx2i * anis_fac(k) &
-(ekm(i,j,1)+ekm(i-1,j,1))*(e120(i,j,1)-e120(i-1,j,1)) )*dx2i * anis_fac(1) &
+ &
( (ekm(i,j+1,1)+ekm(i,j,1))*(e120(i,j+1,1)-e120(i,j,1)) &
-(ekm(i,j,1)+ekm(i,j-1,1))*(e120(i,j,1)-e120(i,j-1,1)) )*dy2i * anis_fac(k) &
-(ekm(i,j,1)+ekm(i,j-1,1))*(e120(i,j,1)-e120(i,j-1,1)) )*dy2i * anis_fac(1) &
+ &
( rhobh(2)/rhobf(1) * (dzf(2)*ekm(i,j,1) + dzf(1)*ekm(i,j,2)) &
* (e120(i,j,2)-e120(i,j,1)) / dzh(2)**2 )/dzf(1)
Expand Down Expand Up @@ -786,12 +786,12 @@ subroutine diffu (a_out)
a_out(i,j,1) = a_out(i,j,1) &
+ &
( ekm(i,j,1) * (u0(i+1,j,1)-u0(i,j,1)) &
-ekm(i-1,j,1)* (u0(i,j,1)-u0(i-1,j,1)) ) * 2. * dx2i * anis_fac(k) &
-ekm(i-1,j,1)* (u0(i,j,1)-u0(i-1,j,1)) ) * 2. * dx2i * anis_fac(1) &
+ &
( empo * ( (u0(i,jp,1)-u0(i,j,1)) *dyi &
+(v0(i,jp,1)-v0(i-1,jp,1))*dxi) &
-emmo * ( (u0(i,j,1)-u0(i,jm,1)) *dyi &
+(v0(i,j,1)-v0(i-1,j,1)) *dxi) ) / dy * anis_fac(k) &
+(v0(i,j,1)-v0(i-1,j,1)) *dxi) ) / dy * anis_fac(1) &
+ &
( rhobh(2)/rhobf(1) * emop * ( (u0(i,j,2)-u0(i,j,1)) /dzh(2) &
+(w0(i,j,2)-w0(i-1,j,2)) *dxi) &
Expand Down Expand Up @@ -896,10 +896,10 @@ subroutine diffv (a_out)
( epmo * ( (v0(i+1,j,1)-v0(i,j,1)) *dxi &
+(u0(i+1,j,1)-u0(i+1,jm,1))*dyi) &
-emmo * ( (v0(i,j,1)-v0(i-1,j,1)) *dxi &
+(u0(i,j,1)-u0(i,jm,1)) *dyi) ) / dx * anis_fac(k) &
+(u0(i,j,1)-u0(i,jm,1)) *dyi) ) / dx * anis_fac(1) &
+ &
( ekm(i,j,1) * (v0(i,jp,1)-v0(i,j,1)) &
-ekm(i,jm,1)* (v0(i,j,1)-v0(i,jm,1)) ) * 2. * dy2i * anis_fac(k) &
-ekm(i,jm,1)* (v0(i,j,1)-v0(i,jm,1)) ) * 2. * dy2i * anis_fac(1) &
+ &
( rhobh(2)/rhobf(1) * eomp * ( (v0(i,j,2)-v0(i,j,1)) /dzh(2) &
+(w0(i,j,2)-w0(i,jm,2)) *dyi) &
Expand Down

0 comments on commit a733474

Please sign in to comment.