f_esmf_lapack_iworksize Subroutine

subroutine f_esmf_lapack_iworksize(minmn, iworksize)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: minmn
integer, intent(out) :: iworksize

Source Code

   subroutine f_esmf_lapack_iworksize(minmn,iworksize)
    
     implicit none
   
     integer, intent(in)              :: minmn 
     integer, intent(out)             :: iworksize

#if defined (ESMF_LAPACK)
#if defined (ESMF_LAPACK_INTERNAL)
#include "ESMF_LapackBlas.inc"
#endif
     integer, external :: ILAENV

     integer :: smlsiz              
     integer ::  nlvl
#endif

#if defined (ESMF_LAPACK)
 
    smlsiz=ILAENV(9,'DGELSD',' ',0,0,0,0)   
 
    nlvl = MAX( INT( LOG( DBLE( minmn ) / DBLE( smlsiz+1 ) ) / &
           LOG(2.0) ) + 1, 0 )
   
    iworksize = 3*minmn*nlvl+11*minmn +10 
#else
! The following is to eliminate compiler warnings when LAPACK
! is not used.
    iworksize = merge (0, 0, minmn == 0)
#endif

  end subroutine f_esmf_lapack_iworksize