Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

Array or structure (or both) constructor silliness

IanH
Honored Contributor III
477 Views

This week's round of infectious disease from one of the local biological weapons research facilities ("preschool" or "day care" - not sure which) has laid me low, making it difficult for me to string a sentence together.  But I am in good company...

PROGRAM StringASentenceTogether
  IMPLICIT NONE
  TYPE String
    CHARACTER(:), ALLOCATABLE :: item
  END TYPE String
  TYPE(String), ALLOCATABLE :: a_sentence(:)
  INTEGER :: i
  !****
  a_sentence = [ String('Mary') ]
  a_sentence = [ a_sentence, String('had') ]
  a_sentence = [ a_sentence, String('a') ]
  a_sentence = [ a_sentence, String('little') ]
  a_sentence = [ a_sentence, String('lamb') ]
  DO i = 1, SIZE(a_sentence) - 1
    WRITE (*, "(A,1X)", ADVANCE='NO') a_sentence(i)%item
  END DO
  WRITE (*, "(A,'.')") a_sentence(i)%item
END PROGRAM StringASentenceTogether

 

>ifort /check:all /warn:all /standard-semantics "2014-09-09 StringASentence.f90" && "2014-09-09 StringASentence.exe"
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2014-09-09 StringASentence.exe"
-subsystem:console
"2014-09-09 StringASentence.obj"
Mary Mar a Maryle lamb.

 

(Apologies if a repeat report.)

0 Kudos
2 Replies
andrew_4619
Honored Contributor III
477 Views

His fleece was was wa snow.

0 Kudos
IanH
Honored Contributor III
477 Views

Mary had a lapse in memory and forgot to check the bugs that the lamb had already filed... https://software.intel.com/en-us/forums/topic/285920

0 Kudos
Reply