Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-03-2015, 10:54 AM   #1
Registered: Mar 2014
Posts: 464

Rep: Reputation: Disabled
Neither Gfortran's CHAR nor ACHAR work in Ubuntu 14.04

Hi there. I need this conversion: Integer==>character string. Nothing I tried so far worked for me. For instance in this calling sequence:

call printDebugThree (lun2,NN,Input,CHAR (jj)//" *** ",jj)
The fourth variable is defined in subroutine printDebugThree as:

printDebugThree (lun2,NN,Input,string,numb)
  implicit none
  DOUBLE COMPLEX, DIMENSION (:), intent (in), POINTER :: Input
  integer*4, intent (in) :: NN,lun2,numb
  integer*4 :: jj
  character (len = *), intent (in) :: string
  write (lun2,*) "# ", string, " ", numb
All I get from the string is an unprintable character in lieu of CHAR(jj), then "***" which comes out correctly.The unprintable character is a square with four symbols in it which I don't understand. Unfortunately I cannot reproduce it here, it does not come out in "Preview Post."

I need this conversion. Any help will be appreciated. Thanks. - Alex

P.S. It is interesting. I just went through my output file and found that not all printed characters are unprintable but it also prints characters (instead of this square) which are not a part of the coded output, e.g #,$,),(,*, etc. It is very strange.

Last edited by AlexBB; 07-03-2015 at 11:00 AM.
Old 07-03-2015, 11:32 AM   #2
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
Actually I've solved the problem with this function. I changed it slightly and it works correctly.

character(len=20) function strConv(k)
!   "Convert an integer to string."
    integer, intent(in) :: k
    write (strConv, *) k
    strConv = adjustl(strConv)
end function strConv
But the problem in OP is still there. Those functions do not work. Thanks, -Alex


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] READ statement in GFortran does not work. AlexBB Programming 2 11-05-2014 07:18 PM
unable to install gfortran in ubuntu 10.04 Gunasekar11 Linux - Newbie 1 02-09-2013 11:59 AM
Problem getting Sed to work with special char inputs. shaselai Programming 8 10-23-2009 01:10 PM
Perl char frequency in a string doesn't work richikiki Programming 9 07-21-2006 04:50 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration