       program C3D8 zhasira ver1
       implicit real*8(a-h,o-z)
       dimension nofe(8),b(3,3),e66(6,6),c(3,3)
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c  $BClMQA42r@O%W%m%0%i%`!#0zD%;n83MQ(B?                       c
c  $B$3$NJ8>O$r$/$/$C$F$$$k(Bc$B$N$:$l$O2K$J$H$-$KD>$7$^$9!#(B     c
c  ver.2006/06/16=ver.1                                    c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c
c       write(*,*)'x$B<4(B($BCGLL$N2#$N(B)$B$ND9$5$rF~$l$F$/$@$5$$(B'
c       read(*,*)zl
       zl=2.d-2
c       zl=zl/2.d0
c       write(*,*)'y$B<4(B($BCGLL$N=D$N(B)$B$ND9$5$rF~$l$F$/$@$5$$(B'
c       read(*,*)zm
       zm=2.d-2
c       zm=zm/2.d0
c       zm=5.d0
c       write(*,*)'z$B<4(B($B<4D9(B)$B$ND9$5$rF~$l$F$/$@$5$$(B'
c       read(*,*)ziku
       ziku=2.d-1
c       ziku=ziku/2.d0
c       
c
c
c       write(*,*)'x$B<4J}8~$NMWAG?t(B($B6v?t(B)$B$rF~$l$F2<$5$$(B'
c       read(*,*) nx
       nx=6
c       nx=nx/2
c       write(*,*)'y$B<4J}8~$NMWAG?t(B($B6v?t(B)$B$rF~$l$F2<$5$$(B'
c       read(*,*) ny
       ny=6
c       ny=ny/2
c       write(*,*)'z$B<4J}8~$NMWAG?t$rF~$l$F2<$5$$(B'
c       read(*,*) nz
       nz=30
c       nz=nz/2
c       write(*,*)$B$I$NJ}8~$r94B+$7$^$9$+(B
c
       nzen=nx*ny*nz
c       write(*,*)'$B%d%s%0N($r(BPa$B$GF~$l$F$/$@$5$$(B'
c       read(*,*) nyang
c       write(*,*)'$B%]%o%=%sHf$r>.?tE@0J2<$N?t;z$@$1F~$l$F$/$@$5$$(B'
c       write(*,*)'$BNc$($P(B0.3$B$J$i(B3'
c       read(*,*) npoi
c
ccccccccccccccccccccccccccc
c $B5U9TNs$+$i(B9$B@.J,$r5a$a$k(B c
ccccccccccccccccccccccccccc
c
cccccccccc$B:`NADj?t(Bccccccccccccc
c
c$B!!%d%s%0N(!'(Bexx,eyy,ezz
c      write(*,*)'x$B<4J}8~$N%d%s%0N($rF~$l$F2<$5$$(B'
c      read(*,*) exx
       exx=5.d2
       exx=2.d5
c       exx=1.d4
c      write(*,*)'y$B<4J}8~$N%d%s%0N($rF~$l$F2<$5$$(B'
c      read(*,*) eyy
       eyy=1.d3
       eyy=2.d5
       eyy=exx
c      write(*,*)'z$B<4J}8~$N%d%s%0N($rF~$l$F2<$5$$(B'
c      read(*,*) ezz
       ezz=1.d4
       ezz=2.d5
       ezz=exx
c
c$B!!%]%"%=%sHf!'(Bpoixy,poixz,poiyz
       poixy=2.d-1
       poixy=1.d0/3.d0
       poixz=2.5d-2
       poixz=1.d0/3.d0
       poiyz=3.d-2
       poiyz=1.d0/3.d0
c
c$B!!$;$sCGCF@-78?t!'(Bgxy,gxz,gxy
       gxy=7.5d4
       gxz=gxy
       gyz=gxy
c
c$B1~NO!]$R$:$_9TNs!'(Be66
          do 10 i=1,6
          do 10 j=1,6
             e66(i,j)=0.d0
10        continue
c  
       e66(1,1)=1.d0/exx
       e66(1,2)=-poixy/exx
       e66(1,3)=-poixz/exx
       e66(2,1)=e66(1,2)
       e66(2,2)=1.d0/eyy
       e66(2,3)=-poiyz/eyy
       e66(3,1)=e66(1,3)
       e66(3,2)=e66(2,3)
       e66(3,3)=1.d0/ezz
c
c
c
c $B%d%s%0N($d%]%"%=%sHf$r=q$-<L$7$F$+$i(B
      exx=1.d0/e66(1,1)
      eyy=1.d0/e66(2,2)
      ezz=1.d0/e66(3,3)
      poixy=-e66(1,2)*exx
      poixz=-e66(1,3)*exx
      poiyz=-e66(2,3)*eyy
c
c $B5U9TNs$r<h$C$F!"1~NO!]$R$:$_9TNs$KJQ49$9$k(B
       det=e66(1,1)*e66(2,2)*e66(3,3)+e66(2,1)*e66(3,2)*e66(1,3)
     &     +e66(3,1)*e66(1,2)*e66(2,3)-e66(2,1)*e66(1,2)*e66(3,3)
     &     -e66(3,1)*e66(2,2)*e66(1,3)-e66(1,1)*e66(3,2)*e66(2,3)
       b(1,1)=(-1.d0)**(1+1)*(e66(2,2)*e66(3,3)-e66(3,2)*e66(2,3))
       b(1,2)=(-1.d0)**(1+2)*(e66(2,1)*e66(3,3)-e66(3,1)*e66(2,3))
       b(1,3)=(-1.d0)**(1+3)*(e66(2,1)*e66(3,2)-e66(3,1)*e66(2,2))
       b(2,1)=(-1.d0)**(2+1)*(e66(1,2)*e66(3,3)-e66(3,2)*e66(1,3))
       b(2,2)=(-1.d0)**(2+2)*(e66(1,1)*e66(3,3)-e66(3,1)*e66(1,3))
       b(2,3)=(-1.d0)**(2+3)*(e66(1,1)*e66(3,2)-e66(3,1)*e66(1,2))
       b(3,1)=(-1.d0)**(3+1)*(e66(1,2)*e66(2,3)-e66(2,2)*e66(1,3))
       b(3,2)=(-1.d0)**(3+2)*(e66(1,1)*e66(2,3)-e66(2,1)*e66(1,3))
       b(3,3)=(-1.d0)**(3+3)*(e66(1,1)*e66(2,2)-e66(2,1)*e66(1,2))
             do 20 i=1,3
             do 20 j=1,3
              e66(i,j)=b(j,i)/det
20           continue
c
c
c      write(*,*)'xy$BLL$N$;$sCGCF@-78?t$rF~$l$F2<$5$$(B'
c      read(*,*) gxy
      e66(4,4)=gxy
c      write(*,*)'xz$BLL$N$;$sCGCF@-78?t$rF~$l$F2<$5$$(B'
c      read(*,*) gxz
      e66(5,5)=gxz
c      write(*,*)'yz$BLL$N$;$sCGCF@-78?t$rF~$l$F2<$5$$(B'
c      read(*,*) gyz
      e66(6,6)=gyz
c
c
       open(7,file='zhasira.inp')
cccccccccc
c$B:BI8=PNO(Bc
cccccccccc
c
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccc
c $B3NG'$N$?$a(B
c             write(*,*) '$B1~NO(B-$B$R$:$_9TNs!'(B'
c            do 211 i=1,6
c             write(*,212) (e66(i,j),j=1,6)
c211         continue
c212         format(1p6d11.3)
cccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
       write(7,200)
       nnofe=0
       do k=1,nz+1
       do j=1,ny+1
       do i=1,nx+1
        nnofe=nnofe+1
        zax=(i-1)*zl/nx
        zay=(j-1)*zm/ny
        zaz=(k-1)*ziku/nz
       write(7,100)nnofe,',',zax,',',zay,',',zaz
       end do
       end do
       end do
200    format('*NODE,NSET=Nall')
100    format(i5,a,F6.4,a,F6.4,a,F6.4)
c
c  $BJL$K=q$+$J$/$F$b$$$$$N$@$m$&$,!"(Bformat$BJ8$N=q$-J}$O(B
c  http://www.g.dendai.ac.jp/lecture/fortran/fort04.html$B$r8+$FJY6/!#(B
c  $BC5$7$?Cf$G(B $B$O0lHVJ,$+$j$d$9$$!#(B
      write(7,'("*NODE,NSET=Nall")')

cccccccccccccc
c$B@aE@HV9f=PNO(Bc
cccccccccccccc
       do k=1,nz
       do j=1,ny
       do i=1,nx
        node=(k-1)*nx*ny+nx*(j-1)+i
        nofe(1)=(nx+1)*(ny+1)*(k-1)+(nx+1)*(j-1)+i
        nofe(2)=nofe(1)+1
        nofe(3)=nofe(1)+(nx+1)
        nofe(4)=nofe(3)+1
        nofe(5)=nofe(1)+(nx+1)*(ny+1)
        nofe(6)=nofe(2)+(nx+1)*(ny+1)
        nofe(7)=nofe(3)+(nx+1)*(ny+1)
        nofe(8)=nofe(4)+(nx+1)*(ny+1)
        write(7,110)
        write(7,*)node,',',nofe(1),',',nofe(3),',',nofe(7),
     & ',',nofe(5),',',nofe(2),',',nofe(4),',',nofe(8),',',nofe(6)
       end do
       end do
       end do
110    format('*ELEMENT,TYPE=C3D8,ELSET=Eall')
c
cccccccccccccc
c$B8GDjC<$N:BI8(Bc
cccccccccccccc
       write(7,210)
       do i=1,(nx+1)*(ny+1)
       write(7,*)i,','
       end do
210    format('*NSET,NSET=FIX')
c
cccccccccccccccccccccccccccccccc
c$B$=$NB>6-3&>r7o$KI,MW$JMWAGHV9f(Bc
cccccccccccccccccccccccccccccccc
cccccccc$B8GDjC<$NCfN)<4$N:BI8(Bcccccccccc
       write(7,520)
       do i =1,nx+1
       write(7,*)ny/2*(nx+1)+i,','
       write(7,*)i,','
       end do
520    format('*NSET,NSET=CHURITU')
      write(7,529)
       do i =1,ny+1
       write(7,*)nx/2*(ny+1)+i,','
       write(7,*)i,','
       end do
529    format('*NSET,NSET=CHU') 
c
cccccccc$B@ZCGLL$NMWAGHV9f(Bcccccccccccccc
c
cccccccc yz$BJ?LL(B cccccccccccccc
c       write(7,530)
c       do k=1,nz+1
c       do j=1,ny+1
c       write(7,*) (nx+1)*(ny+1)*(k-1)+(nx+1)*(j-1)+1,','
c       end do
c       end do
c530    format('*NSET,NSET=SETUYZ')
c
cccccccc xz$BJ?LL(B cccccccccccccc
c       write(7,540)
c       do k=1,nz+1
c       do i=1,nx+1
c       write(7,*) (k-1)*(nx+1)*(ny+1)+i,','
c       end do
c       end do
c540    format('*NSET,NSET=SETUXZ')
cccccccccc
c$B6-3&>r7o(Bc
cccccccccc
       write(7,220)
       write(7,510)
220    format('*BOUNDARY')
510    format('FIX,3')
c
cccccc$B8GDjC<$NCfN)<4$N(By$B$r94B+(Bccccccc
c       write(7,521)
c521    format('CHURITU,2')
c
ccc
c       write(7,'("CHU,1")')
cccccc $BH>J,$K@ZCG$7$?(Byz$BLL$N(Bx$B$r94B+(B ccccccc
c       write(7,531)
c531    format('SETUYZ,1')
c
cccccc $BH>J,$K@ZCG$7$?(Bxz$BLL$N(By$B$r94B+(B ccccccc
c       write(7,541)
c541    format('SETUXZ,2')
cccccc
c$B:`NA(Bc
cccccc
       write(7,230)
230    format('*MATERIAL,NAME=EL')
cccccccccc
c$BCF@-FC@-(Bc
cccccccccc
       write(7,240)
240    format('*ELASTIC')
c$B%G%U%)!<%k%H$OEyJ}@-0[J}@-$J$i(BTYPE=ANISO$B$r$D$1$k(B
       write(7,250)
c250    format('210000.,.3')
250    format('207000,.3333')
c
c250    format('nyang.,.npoi')
c
c
c$B%d%s%0N(!"%]%o%=%sHf$N=g(B
c
ccccccc$B!!D>9T0[J}@-$N>l9g(B  ccccccc
c       write(7,240)
c240    format('*ELASTIC,TYPE=ORTHOTROPIC')
c       write(7,243) e66(1,1),',',e66(1,2),',',e66(2,2),',',e66(1,3),','
c     & ,e66(2,3),',',e66(3,3),',',e66(6,6),',',e66(5,5)
c       write(7,242) e66(4,4)
c243    format(f12.1,a,f12.1,a,f12.1,a,f12.1,a,f12.1,a,f12.1,a,f12.1,a
c     & ,f12.1)
c242    format(f12.1,',','294')
c
c
cccccccc $BA:@-$rF~$l$k$H$-(B ccccccccccc
c       write(7,244)
c244    format('*PLASTIC')
c244    format('*PLASTIC,HARDENING=KINEMATIC')
c       write(7,*)'238.,0.'
c       write(7,*)'242.,0.01405'
c       write(7,*)'319.625,0.02905'
c$B>e$NDj?t$O(BKhaled$B$5$s$N(B
c Spatial ultimate load analysis of thin-walled and its
c application to the design of channel members $B$h$jH4?h(B
c $B$J$*!";09TL\$N(B290.75,0.01$B$O!"O@J8$K=q$+$l$F$$$J$+$C$?$?$a(B
c $B:G=i$KAjEvA:@-$R$:$_$r(B0.01$B$H$*$-!"(BEs$B$r>h$8$F1~NO$r=P$7$F$$$k(B
c       write(7,*)'1000.,0.15'
c
c
c
cccccccccccccccccc
c$B:`NAFC@-$N(B3D$B2=!)(Bc
cccccccccccccccccc
       write(7,260)
260    format('*SOLID SECTION,ELSET=Eall,MATERIAL=EL')
cccccccccccccc
c$B<+M3C<$N:BI8(Bc
cccccccccccccc
       write(7,270)
       nnofe=(nx+1)*(ny+1)*(nz+1)-(nx+1)*(ny+1)
       do i=1,(nx+1)*(ny+1)
       nnofe=nnofe+1
       write(7,*)nnofe,','
       end do
270    format('*NSET,NSET=LAST')
c
c
c
c
       write(7,300)
300    format('*STEP')
       write(7,310)
310    format('*STATIC,SOLVER=SPOOLES')
       write(7,320)
320    format('*CLOAD')
c
cccccccccc
c$B:\2Y>r7o(Bc
cccccccccc
cccccccccccccccccccccccccccccc
c$B3F@aE@$KF1$82Y=E$r$+$1$k>l9g(Bc
cccccccccccccccccccccccccccccc
c       zkajyuu=9.d0/(2*nx+1)/(ny+1)
c       do i =1,ny+1
c       khaji=(nx+1)*(ny+1)*nz+i*(nx+1)
c       write(7,*)khaji,',','3',',',zkajyuu/2.d0
c       end do
c       do j=1,ny+1
c       do i=1,nx
c       knoko=(nx+1)*(ny+1)*nz+(j-1)*(nx+1)+i
c       write(7,*)knoko,',','3',',',zkajyuu
c       end do
c       end do
cccccccccccccccccccccccccccccccccc
c$B3F@aE@$K2Y=E$rJQ$($F:\2Y$9$k>l9g(Bc
cccccccccccccccccccccccccccccccccc
c
ccccccc p,2p,4p$B$KJ,$1$F:\2Y$9$k$1$I!"$=$N(Bp$B$N5a$aJ}(B($BC10L$O(BMN)cccccc
       read(*,*)zkajyu
       pkajyu=zkajyu/4.d0/nx/ny
c
ccccccc p$B:\2Y$9$k@aE@HV9f$H2Y=E$NJ}8~$HBg$-$5$N=PNO(Bcccccccccccc
       do j =1,ny+1,ny
       do i =1,nx+1,nx
       write(7,*) (nx+1)*(ny+1)*nz+(j-1)*(nx+1)+i,',','3',',',pkajyu
       end do
       end do
c
ccccccc 2p$B:\2Y$9$k@aE@HV9f$H2Y=E$NJ}8~$HBg$-$5$N=PNO(Bcccccccccccc
       p2kajyu=pkajyu*2.d0
       do j =1,ny+1,ny
       do i =2,nx
       write(7,*) (nx+1)*(ny+1)*nz+(j-1)*(nx+1)+i,',','3',',',p2kajyu
       end do
       end do
c
       do j =2,ny
       do i =1,nx+1,nx
       write(7,*) (nx+1)*(ny+1)*nz+(j-1)*(nx+1)+i,',','3',',',p2kajyu
       end do
       end do
c
ccccccc 4p$B:\2Y$9$k@aE@HV9f$H2Y=E$NJ}8~$HBg$-$5$N=PNO(Bcccccccccccccc
       p4kajyu=pkajyu*4.d0
       do j =2,ny
       do i =2,nx
       write(7,*) (nx+1)*(ny+1)*nz+(j-1)*(nx+1)+i,',','3',',',p4kajyu
       end do
       end do
c
c       write(7,330)
c330    format('LAST,2,0.36')
       write(7,340)
340    format('*NODE PRINT,NSET=Nall')
       write(7,350)
350    format('U')
       write(7,360)
360    format('*EL PRINT,ELSET=Eall')
       write(7,370)
370    format('S')
       write(7,380)
380    format('*NODE FILE')
       write(7,350)
       write(7,390)
390    format('*EL FILE,POSITION=AVERAGED AT NODES')
       write(7,370)
       write(7,400)
400    format('*END STEP')
c
c
c
c
c
c
       end
