650
651
652 class(GweCndType) :: this
653
654 integer(I4B) :: nodes, n
655 real(DP) :: q, qx, qy, qz
656 real(DP) :: alh, alv, ath1, ath2, atv, a
657 real(DP) :: al, at1, at2
658 real(DP) :: qzoqsquared
659 real(DP) :: ktbulk
660 real(DP) :: dstar
661 real(DP) :: qsw
662
663
664 nodes = size(this%d11)
665 do n = 1, nodes
666
667
668 this%d11(n) = dzero
669 this%d22(n) = dzero
670 this%d33(n) = dzero
671 this%angle1(n) = dzero
672 this%angle2(n) = dzero
673 this%angle3(n) = dzero
674 if (this%fmi%ibdgwfsat0(n) == 0) cycle
675
676
677 qx = dzero
678 qy = dzero
679 qz = dzero
680 q = dzero
681 qx = this%fmi%gwfspdis(1, n)
682 qy = this%fmi%gwfspdis(2, n)
683 qz = this%fmi%gwfspdis(3, n)
684 q = qx**2 + qy**2 + qz**2
685 if (q > dzero) q = sqrt(q)
686
687
688 alh = dzero
689 alv = dzero
690 ath1 = dzero
691 ath2 = dzero
692 atv = dzero
693 if (this%idisp > 0) then
694 alh = this%alh(n)
695 alv = this%alv(n)
696 ath1 = this%ath1(n)
697 ath2 = this%ath2(n)
698 atv = this%atv(n)
699 end if
700
701
702 ktbulk = dzero
703 if (this%iktw > 0) ktbulk = ktbulk + this%porosity(n) * this%ktw(n) * &
704 this%fmi%gwfsat(n)
705 if (this%ikts > 0) ktbulk = ktbulk + (done - this%porosity(n)) * this%kts(n)
706
707
708
709
710
711
712
713 dstar = ktbulk / (this%gwecommon%gwecpw * this%gwecommon%gwerhow)
714
715
716 al = dzero
717 at1 = dzero
718 at2 = dzero
719 if (q > dzero) then
720 qzoqsquared = (qz / q)**2
721 al = alh * (done - qzoqsquared) + alv * qzoqsquared
722 at1 = ath1 * (done - qzoqsquared) + atv * qzoqsquared
723 at2 = ath2 * (done - qzoqsquared) + atv * qzoqsquared
724 end if
725
726
727 qsw = q * this%fmi%gwfsat(n) * this%eqnsclfac
728 this%d11(n) = al * qsw + ktbulk
729 this%d22(n) = at1 * qsw + ktbulk
730 this%d33(n) = at2 * qsw + ktbulk
731
732
733 if (this%idisp > 0) then
734
735
736 this%angle3(n) = dzero
737
738
739 if (q > dzero) then
740 a = max(-done, min(done, qz / q))
741 else
742 a = dzero
743 end if
744 this%angle2(n) = asin(a)
745
746
747 if (qx /= dzero .or. qy /= dzero) then
748 this%angle1(n) = atan2(qy, qx)
749 else
750 this%angle1(n) = dzero
751 end if
752 end if
753 end do