On our NEC SX-4 and SX-5, the f90 Language Reference manual,under
3.3.3.2 NONNUMERIC TYPES
...
Character Type
says (inscrutably;-) "The value of kind must be 1 or 2."
There is no mention of what the kinds refer to. There is definitely room
for improvement in the (English) documentation. A quick test program
run on a kterm (supports Asian characters) shows Japanese characters
for char(i) where i<0 or i>128, REGARDLESS of KIND!!. It executes without
runtime error on an (ASCII) xterm, with "funny" characters outside 0-127
-------------------------------------------------------------------------
! Kind check for character
program charkind
integer :: ch,startch
integer,parameter :: strlen=32
character(len=strlen,kind=1):: blob1
character(len=strlen,kind=2):: blob2
!
do startch=-128,255,strlen
do ch=1,strlen
blob1(ch:ch)=char(startch+ch,kind=1)
blob2(ch:ch)=char(startch+ch,kind=2)
end do
print *,'Start at:',startch
print *,'------------ASCII?-----------'
print *,blob1
print *,'------------KANJI?-----------'
print *,blob2
end do
stop
end
-------------------------------------------------------------------------
The suggestion arises that there should be inquiry functions for CHARACTER
such as FIRSTCHAR(KIND=K) and LASTCHAR(KIND=K)
analogous to HUGE() and TINY(). This would allow users to check the valid
range for I in CHAR(I,KIND=K). Can this request get to J3?
Does anyone have a compiler which complains if the argument I for CHAR is
negative or "too large" for a given KIND?
The NEC version doesn't complain, but funny things happen outside +/-256.
Cheers,
Len
[log in to unmask]:+61 3 9669 8109: CSIRO/Bureau of Meteorology
High Performance Computing and Communications Centre
24th floor, 150 Lonsdale St., Melbourne 3000, Victoria, AUSTRALIA
On Thursday, 2 November 2000, at 10:33,
Walt Brainerd <[log in to unmask]> wrote:
> Michael Metcalf wrote:
> > As has been pointed out, there is, after all that hoo-ha, no known example
> > of a compiler that supports anything other than the default kind.
>
> Actually, there is one: the Fujitsu or NEC (I can't remember which)
> compiler on their supercomputers. All the manual says is that there is
> a kind=2 for "Japanese characters".
>
> But that's the only one I know about.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|