This routine allocates matrix with given dimentions
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_matrix_type) | :: | me | ||||
integer, | intent(in) | :: | dim1 | |||
integer, | intent(in) | :: | dim2 |
subroutine alloc_matrix( me, dim1, dim2 ) ! -------------------------------------------------------------------------- type( tem_matrix_type ) :: me integer, intent(in) :: dim1 integer, intent(in) :: dim2 ! -------------------------------------------------------------------------- if ( dim1 > 0 .and. dim2 > 0 ) then me%nEntries(1) = dim1 me%nEntries(2) = dim2 allocate( me%A( dim1, dim2 ) ) me%A = 0.0_rk else write( logUnit(1), "(A)" ) & & 'Failed to allocate matrix. Dimension is negative number.' call tem_abort() end if end subroutine alloc_matrix