740
743
744 class(GhostNodeType) :: this
745
746 character(len=LINELENGTH) :: line, nodestr, fmtgnc, cellid, &
747 cellidm, cellidn
748 integer(I4B) :: lloc, ierr, ival
749 integer(I4B) :: ignc, jidx, nodeun, nodeum, nerr
750 integer(I4B), dimension(:), allocatable :: nodesuj
751 logical :: isfound, endOfBlock
752
753
754 write (fmtgnc, '("(2i10,",i0,"i10,",i0, "(1pg15.6))")') this%numjs, &
755 this%numjs
756
757
758
759 allocate (nodesuj(this%numjs))
760
761
762 call this%parser%GetBlock('GNCDATA', isfound, ierr, supportopenclose=.true.)
763
764
765 if (isfound) then
766 write (this%iout, '(1x,a)') 'PROCESSING GNCDATA'
767 endofblock = .false.
768 do ignc = 1, this%nexg
769 call this%parser%GetNextLine(endofblock)
770 if (endofblock) then
771 write (
errmsg,
'(a,i0,a,i0,a)') &
772 'GNCDATA block has ', ignc - 1, &
773 ' rows, but NUMGNC is ', this%nexg, '.'
775 exit
776 end if
777 call this%parser%GetCurrentLine(line)
778 lloc = 1
779
780
781 call this%parser%GetCellid(this%m1%dis%ndim, cellidn)
782 nodeun = this%m1%dis%nodeu_from_cellid(cellidn, this%parser%iuactive, &
783 this%iout)
784
785
786 call this%nodeu_to_noder(nodeun, this%nodem1(ignc), this%m1)
787
788
789 call this%parser%GetCellid(this%m2%dis%ndim, cellidm)
790 nodeum = this%m2%dis%nodeu_from_cellid(cellidm, this%parser%iuactive, &
791 this%iout)
792
793
794 call this%nodeu_to_noder(nodeum, this%nodem2(ignc), this%m2)
795
796
797 do jidx = 1, this%numjs
798
799 call this%parser%GetCellid(this%m1%dis%ndim, cellid)
800 ival = this%m1%dis%nodeu_from_cellid(cellid, this%parser%iuactive, &
801 this%iout, allow_zero=.true.)
802 nodesuj(jidx) = ival
803 if (ival > 0) then
804 call this%nodeu_to_noder(ival, this%nodesj(jidx, ignc), this%m1)
805 else
806 this%nodesj(jidx, ignc) = 0
807 end if
808 end do
809
810
811 do jidx = 1, this%numjs
812 this%alphasj(jidx, ignc) = this%parser%GetDouble()
813 end do
814
815
816 if (this%iprpak /= 0) &
817 write (this%iout, fmtgnc) nodeun, nodeum, &
818 (nodesuj(jidx), jidx=1, this%numjs), &
819 (this%alphasj(jidx, ignc), jidx=1, this%numjs)
820
821
822 if (this%nodem1(ignc) <= 0) then
823 call this%m1%dis%nodeu_to_string(nodeun, nodestr)
825 trim(adjustl(this%m1%name))// &
826 ' Cell is outside active grid domain: '// &
827 trim(adjustl(nodestr))
829 end if
830
831
832 if (this%nodem2(ignc) <= 0) then
833 call this%m2%dis%nodeu_to_string(nodeum, nodestr)
835 trim(adjustl(this%m2%name))// &
836 ' Cell is outside active grid domain: '// &
837 trim(adjustl(nodestr))
839 end if
840
841
842 do jidx = 1, this%numjs
843 if (this%nodesj(jidx, ignc) < 0) then
844 call this%m1%dis%nodeu_to_string(nodesuj(jidx), nodestr)
846 trim(adjustl(this%m1%name))// &
847 ' Cell is outside active grid domain: '// &
848 trim(adjustl(nodestr))
850 end if
851 end do
852
853 end do
854
855
856 if (.not. endofblock) then
857 call this%parser%GetNextLine(endofblock)
858 if (.not. endofblock) then
859 write (
errmsg,
'(a,i0,a)') &
860 'GNCDATA block has more rows than NUMGNC, which is ', this%nexg, '.'
862 end if
863 end if
864
865
867 if (nerr > 0) then
868 call store_error(
'Errors encountered in GNC input file.')
869 call this%parser%StoreErrorUnit()
870 end if
871
872 write (this%iout, '(1x,a)') 'END OF GNCDATA'
873 else
874 write (
errmsg,
'(a)')
'Required GNCDATA block not found.'
876 call this%parser%StoreErrorUnit()
877 end if
878
879
880 deallocate (nodesuj)