CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
|
|
@ -0,0 +1,7 @@
|
|||
if ( a .gt. 20.0 ) then
|
||||
q = q + a**2
|
||||
else if ( a .ge. 0.0 ) then
|
||||
q = q + 2*a**3
|
||||
else
|
||||
q = q - a
|
||||
end if
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
select case (i)
|
||||
case (21:) ! matches all integers greater than 20
|
||||
q = q + i**2
|
||||
case (0:20) ! matches all integers between 0 and 20 (inclusive)
|
||||
q = q + 2*i**3
|
||||
case default ! matches all other integers (negative in this particular case)
|
||||
q = q - I
|
||||
end select
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
! diffusion grid time step
|
||||
where (edge_type(1:n,1:m) == center)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + a(0:n-1,1:m) + a(2:n+1,1:m) + a(1:n,0:m-1) + a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == left)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(2:n+1,1:m) + a(1:n,0:m-1) + a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == right)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(0:n-1,1:m) + a(1:n,0:m-1) + a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == top)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + a(0:n-1,1:m) + a(2:n+1,1:m) + 2*a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == bottom)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + a(0:n-1,1:m) + a(2:n+1,1:m) + 2*a(1:n,0:m-1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == left_top)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(2:n+1,1:m) + 2*a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == right_top)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(0:n-1,1:m) + 2*a(1:n,2:m+1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == left_bottom)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(2:n+1,1:m) + 2*a(1:n,0:m-1)) / 5
|
||||
|
||||
elsewhere (edge_type(1:n,1:m) == right_bottom)
|
||||
anew(1:n,1:m) = (a(1:n,1:m) + 2*a(0:n-1,1:m) + 2*a(1:n,0:m-1)) / 5
|
||||
|
||||
elsewhere ! sink/source, does not change
|
||||
anew(1:n,1:m) = a(1:n,1:m)
|
||||
end where
|
||||
Loading…
Add table
Add a link
Reference in a new issue