[Ad-dev] [openAD] #111: posprocessor ( and transformFile): initialization in activated type for DATA

OpenAD trac at mcs.anl.gov
Wed Apr 27 14:29:24 CDT 2011


#111: posprocessor ( and transformFile): initialization in activated type for
DATA
------------------------------+---------------------------------------------
 Reporter:  Utke              |       Owner:  hlcm    
     Type:  defect            |      Status:  assigned
 Priority:  3                 |   Milestone:          
Component:  SourceProcessing  |    Keywords:          
------------------------------+---------------------------------------------

Comment(by hlcm):

 The following is acceptable syntax & compiles successfully with nagfor:
 module m
 public ::  mType

 type mType
  integer:: c1
  integer:: c2=0
 end type

 end module

 program p

 use m

 type(mType) :: x=mType(2,1)
 type(mType) :: v
 data v%c1/2/
 print*, x,v
 end program

 Therefore it would be possible to explicitly initialize only the value
 component of the active type and leave the default-initialized derivative
 component alone.
 For a more complicated case, it would be possible to make a transformation
 for a structure s with components a, b & c where b becomes active in the
 following manner
 data s / 1,2,3 /
 data s%a, s%b%v, s%c / 1,2,3 /

 However it may not be worth the effort until a problem arises

-- 
Ticket URL: <https://trac.mcs.anl.gov/projects/openAD/ticket/111#comment:5>
OpenAD <http://www.mcs.anl.gov/openad>
Bug tracking for OpenAD components


More information about the Ad-dev mailing list