LALA_cmds Subroutine

public subroutine LALA_cmds(pseudo_file, echo)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: pseudo_file(:)
logical, intent(in), optional :: echo

Contents

Source Code


Source Code

subroutine LALA_cmds(pseudo_file,echo)

! ident_3="@(#) M_matrix lala(3f) run an array of commands in matrix laboratory interpreter and return to calling program"

character(len=*),intent(in),optional :: pseudo_file(:)
logical,intent(in),optional          :: echo

   if(present(echo)) G_ECHO=echo

   if(GM_BIGMEM.LT.0)then
      call lala_init(200000)
   else
      G_INPUT_LUN = STDIN                                                    ! unit number for terminal input
      G_RIO = G_INPUT_LUN                                                    ! current file to read commands from
      G_PROMPT=.true.
   endif

   if(present(pseudo_file))then
      G_PSEUDO_FILE=[character(len=GG_LINELEN) :: pseudo_file,'quit;']
      G_PROMPT=.false.
   else
      if(allocated(G_PSEUDO_FILE))deallocate(G_PSEUDO_FILE)
      allocate(G_PSEUDO_FILE(0))
   endif

   PARSE_LINE : do
      call mat_parse()
      select case(G_FUN)
      case(1) ; call mat_matfn1()
      case(2) ; call mat_matfn2()
      case(3) ; call mat_matfn3()
      case(4) ; call mat_matfn4()
      case(5) ; call mat_matfn5()
      case(6) ; call mat_matfn6()
      case(21); call mat_matfn1()
      case(99); exit PARSE_LINE
      case default
      end select
   enddo PARSE_LINE

end subroutine LALA_cmds