Fortran test

From Core Physics Wiki
Jump to: navigation, search

SyntaxHighlighting

Test of Fortran Syntax Highlighting

See http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi


      subroutine mem_geom(npin, kd, nsize, iopt)
      implicit none
      integer, intent(in) :: npin
      integer, intent(in) :: kd
      integer, intent(in) :: nsize  ! number of assemblies across
      integer, intent(in) :: iopt   ! 1=allocate, 2=deallocate
 
      write (*,*) 'Test of String'
 
      if (iopt.eq.1) then
        allocate (ipinmap(npin,npin,kd))
        allocate (ifuemap(npin,npin,kd))
        allocate (imapasm(npin,npin))
        allocate (iassm(nsize,nsize))
        allocate (xcent(npin))
!!      allocate (xedge(0:npinx))    ! done in fillmaps
        ipinmap=0
        ifuemap=0
        imapasm=0
        iassm=0
        xcent=0.0d0
!!      xedge=0.0d0
      elseif (iopt.eq.2) then
        deallocate (ipinmap)
        deallocate (ifuemap)
        deallocate (imapasm)
        deallocate (iassm)
        deallocate (xcent)
        deallocate (xedge)
      else
        stop 'invalid allocation option in mem_geom'
      endif
 
      end subroutine mem_geom
 
      end module mod_geom