Joint calculation with source file

From: Ogawa Tatsuhiko <ogawa_at_n.t.u-tokyo.ac.jp>
Date: Mon, 28 Dec 2009 22:02:52 +0900

Dear FLUKA experts,

I am now faced with a problem in using source.f routine.
I would like to start a transport calculation from the source saved as a
formatted collision file. However, the source.f routine (attached) fails
to do simulation maybe due to the definition of a variable "am".

Attached are...

failure.log: .log file from the calculation. Error message can be seen
at the top.
source.f: source.f file modified from the original one.

Many thanks in advance for your help.

Sincerely,
Ogawa

-- 
**************************************************
Department of Nuclear Engineering and Management
        Graduate School of Engineering
           The University of Tokyo
            Tatsuhiko Ogawa
     E-mail:  ogawa_at_n.t.u-tokyo.ac.jp
              togawa_at_cern.ch
        Tel:   090-6934-6732(Domestic call only)
              +81-3-5841-2905
Facsimile :   +81-3-3813-2010
Address: 2-11-16 Engineering Bld.12th Room421
             Yayoi Bunkyo-ku, Tokyo  113-0032
**************************************************

Subscript out of range on file line 174, procedure source.f/source.
Attempt to access the 601230-th element of variable am.
 the following license/conditions/requests:

                Copyright statement and license conditions
    
  Copyright Italian National Institute for Nuclear Physics
  (INFN) and European Organization for Nuclear Research (CERN)
  ("the FLUKA copyright holders"), 1989-2009.
    
  All rights not expressly granted under this license are
  reserved.
    
  This software results from work performed by Alberto Fasso`,
  Alfredo Ferrari, Johannes Ranft and Paola Sala.
    
  INFN and CERN are the exclusive source of distribution of
  the code, bug fixes and documentation of the FLUKA
  software. Each official version of FLUKA is identified by a
  numbering scheme specifying major and minor releases.
    
  The FLUKA Coordination Committee or its delegates are able
  to grant any of the permissions noted in this License
  Agreement as requiring a specific consent. Any such consent
  may only be granted in writing.
    
  Installation, use, reproduction, display of the FLUKA
  software ("FLUKA"), in source and binary forms, are
  permitted free of charge on a non-exclusive basis for
  internal scientific, non-commercial and non-weapon-related
  use by non-profit organizations only. Any exercise of these
  rights is subject to the following conditions:
    
  1 Insertion of the FLUKA code, in whole or in part, into
    other codes, or its translation into any other computer
    language are possible only after obtaining prior written
    permission. Modifications of the FLUKA code are permitted
    for use by the licensee only, unless authorized in
    writing.
    
  2 FLUKA is non-transferable, non-sub-licensable and may not
    be distributed in any way, without express written
    consent, whether in original or modified form. Site-wise
    or collaboration-wise conditions can be agreed with the
    FLUKA Coordination Committee.
    
  3 Notwithstanding the above, the licensee may modify and
    sub-license FLUKA User Routines to third parties in so far
    as their purpose is limited to the adaptation of input and
    output interfaces of FLUKA and their modification does not
    circumvent, replace, add to or modify any of the functions
    of FLUKA, or extract specific isolated results from any of
    the individual internal physics models embedded within
    FLUKA.
    
  4 The licensee shall forthwith license all its modifications
    of FLUKA to the FLUKA copyright holders, at no cost and
    with no limitation of use. The licensee acknowledges that
    the FLUKA copyright holders may insert such modifications
    into future releases of FLUKA, subject to appropriate
    acknowledgment of the licensee's contribution.
    
  5 Any publication by the licensee with respect to FLUKA or
    results obtained from it shall explicitly acknowledge
    FLUKA by quoting its set of references and the FLUKA
    copyright holders. The licensee shall not without prior
    written permission publish documents or results based on a
    modified form of FLUKA, unless the modification
    exclusively concerns User Routines for the adaptation of
    its input and output interfaces which comply with the same
    restrictions, as defined in section 3) as those which
    apply to sub-licensing. Any publication of documents or
    results shall be based only on official FLUKA versions as
    obtained from the FLUKA website (http://www.fluka.org) or
    from any authorized mirror. Publication here implies any
    legal publication to any third party, whether verbal,
    electronic, visual, in writing or otherwise.
    
  6 The licensee shall ensure that the FLUKA references,
    copyright statement and license conditions are not altered
    or removed from FLUKA. Any integration of any portion of
    FLUKA, in modified or in unmodified form, into any other
    software package must preserve the internal copyright
    notices in those portions of FLUKA that have been
    employed, and must reproduce such notices within any
    additional global notices included along or embedded
    within the software into which FLUKA has been
    integrated. Any portion of FLUKA so integrated, whether
    modified or unmodified shall continue to be subject to
    these license conditions.
    
  7 Nothing in this license shall be construed as to grant any
    rights in any of the FLUKA versions since 1989. In
    addition, users are not permitted to circumvent any
    protection in prior distributions of FLUKA that provided
    for a preset expiration date of the code.
    
  8 Versions or parts of the FLUKA source code, entrusted to
    individuals or groups prior to the enactment of the
    CERN-INFN Collaboration Agreement, which are listed in
    Chapter 5 of Annex 1 of the EP-AB-INFN Scientific
    Agreement (19-02-2003), together with the agreed
    conditions of use, are subject to this License Agreement
    in addition to any other restrictions on the scope of use
    that may have been part of the initial use grant.
    
  9 Commercial use of FLUKA, outside the scope of this
    license, must be negotiated with the copyright holders.
    
  10 DISCLAIMER
    
  THIS SOFTWARE IS PROVIDED BY THE FLUKA COPYRIGHT HOLDERS "AS
  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
  NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, OF
  SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE
  OR USE ARE DISCLAIMED. THE FLUKA COPYRIGHT HOLDERS AND THE
  AUTHORS MAKE NO REPRESENTATION THAT THE SOFTWARE AND
  MODIFICATIONS THEREOF, WILL NOT INFRINGE ANY PATENT,
  COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY RIGHT.
    
  11 LIMITATION OF LIABILITY
    
  THE FLUKA COPYRIGHT HOLDERS AND THE AUTHORS SHALL HAVE NO
  LIABILITY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
  CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES OF ANY
  CHARACTER INCLUDING, WITHOUT LIMITATION, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS,
  OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY
  OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT
  LIABILITY OR OTHERWISE, ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  DAMAGES.
    
    
    
  REQUESTS MADE BY THE FLUKA AUTHORS TO ALL USERS
    
  All licensees are requested to report as soon as practical
  to the Authors any errors or bugs found in any portion of
  FLUKA and its accompanying documentation.
    
  All licensees are requested to forward copies of all
  comparisons that they make between FLUKA results and
  data or other codes as soon as practical. The Authors agree
  to keep any such communications confidential unless
  otherwise notified by the contributing user.
    
  The Authors reserve the right of publishing any benchmarking
  and/or comparisons of the distinct separate performance of
  the individual internal models that are embedded into FLUKA,
  whether the comparisons are with data or with other
  codes. The Authors would also like to convey a general
  willingness to conduct any such benchmarking efforts either
  upon request or in collaboration with interested parties. In
  case of doubt please contact the Authors.
    
  Users should exclusively download FLUKA from the official
  FLUKA website (http://www.fluka.org) or one of the
  authorized mirror sites. Users are invited to regularly
  update their FLUKA version to profit for improvements and
  bug fixes.
    
  Users are invited to use reasonably updated versions of the
  code for publications. Publications of results based on
  those FLUKA versions that are declared unsupported and
  obsolete on the official FLUKA website shall be avoided.
    
  Users should address any request of consent to one member of
  the FLUKA Coordinating Committee, which at present is
  composed as follows:
    
  Giuseppe Battistoni Giuseppe.Battistoni_at_mi.infn.it
  (chairman)
  Michael Doser Michael.Doser_at_cern.ch
  Roberto Losito Roberto.Losito_at_cern.ch
  Johannes Ranft Johannes.Ranft_at_cern.ch
  Paola Sala Paola.Sala_at_mi.infn.it
    

     In accordance with the User License, the use of the FLUKA code
     shall be acknowledged explicitly by quoting the following and
     only the following set of references:

   - A. Ferrari, P.R. Sala, A. Fasso', and J. Ranft,
     "FLUKA: a multi-particle transport code",
      CERN 2005-10 (2005), INFN/TC_05/11, SLAC-R-773

   - G. Battistoni, S. Muraro, P.R. Sala, F. Cerutti, A. Ferrari,
     S. Roesler, A. Fasso`, J. Ranft
     "The FLUKA code: Description and benchmarking",
     Proceedings of the Hadronic Shower Simulation Workshop 2006,
     Fermilab 6-8 September 2006, M. Albrow, R. Raja eds.,
     AIP Conference Proceeding 896, 31-49, (2007)

     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     !!!! DOWNLOAD/USE OF THE FLUKA SOFTWARE IMPLIES FULL !!!!
     !!!! ACCEPTANCE OF THE LICENSE AND ASSOCIATED CONDITIONS !!!!
     !!!! INCLUDING THE AUTHOR'S REQUESTS !!!!
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

   Notes: The "FLUKA User Routines" mentioned at point 3) in the
          FLUKA User License are those (and only those) contained
          in the directory usermvax, both in the source and binary
          versions of the code

          The Nuclear Energy Agency Data Bank is an authorized
          distributor of the code

*$ CREATE SOURCE.FOR
*COPY SOURCE
*
*=== source ===========================================================*
*
      SUBROUTINE SOURCE ( NOMORE )

      INCLUDE '(DBLPRC)'
      INCLUDE '(DIMPAR)'
      INCLUDE '(IOUNIT)'
*
*----------------------------------------------------------------------*
* *
* Copyright (C) 1990-2006 by Alfredo Ferrari & Paola Sala *
* All Rights Reserved. *
* *
* *
* New source for FLUKA9x-FLUKA200x: *
* *
* Created on 07 january 1990 by Alfredo Ferrari & Paola Sala *
* Infn - Milan *
* *
* Last change on 03-mar-06 by Alfredo Ferrari *
* *
* This is just an example of a possible user written source routine. *
* note that the beam card still has some meaning - in the scoring the *
* maximum momentum used in deciding the binning is taken from the *
* beam momentum. Other beam card parameters are obsolete. *
* *
*----------------------------------------------------------------------*
*
      INCLUDE '(BEAMCM)'
      INCLUDE '(FHEAVY)'
      INCLUDE '(FLKSTK)'
      INCLUDE '(IOIOCM)'
      INCLUDE '(LTCLCM)'
      INCLUDE '(PAPROP)'
      INCLUDE '(SOURCM)'
      INCLUDE '(SUMCOU)'
*
      LOGICAL LFIRST
*
      integer*4 sample
      parameter(score = 900000)
      dimension xcoo(score), ycoo(score), zcoo(score), weigh(score)
      dimension cosx(score), cosy(score), cosz(score), jpart(score)
      dimension enrgy(score)
      SAVE LFIRST, kount
      DATA LFIRST / .TRUE. /
*======================================================================*
* *
* BASIC VERSION *
* *
*======================================================================*
      NOMORE = 0
* +-------------------------------------------------------------------*
* | First call initializations:
      IF ( LFIRST ) THEN
* | *** The following 3 cards are mandatory ***
         TKESUM = ZERZER
         LFIRST = .FALSE.
         LUSSRC = .TRUE.
* | *** User initialization ***
        write(lunout,*)
        write(lunout,'(a,132a)') ("*",i=1,132)
        write(lunout,*)
        write(lunout,*)
        write(lunout,'(a)') "@ Source: collision file around shield11"
          open(unit=28,file=
     $ "/afs/slac.stanford.edu/u/sa/komi/Himac/Cion/secondaries.dat",
     $ status="old")
        open(unit=29,file="../sampledso",status="unknown")
        write(lunout,*)
        write(lunout,*)'@ Beam momentum [GeV/c]:',Pbeam
        write(lunout,'(a,132a)') ("*",i=1,132)
        write(lunout,*)
        do i = 1, (score - 1)
           read(28,*) jpart(i), xcoo(i), ycoo(i), zcoo(i), cosx(i),
     $ cosy(i), cosz(i), enrgy(i), weigh(i)
        end do
        kount = 0
      END IF
* |
* +-------------------------------------------------------------------*
      kount = kount + 1
* Sample a line from the file
      xi = flrndm(dummy)
      sample = int(xi * dble(score)) + 1
      if (sample.eq.score) then
        sample=score-1
      end if
      if(kount .le. 50) then
         write(29,*) sample,xcoo(sample),ycoo(sample),zcoo(sample),
     $ enrgy(sample),weigh(sample)
      end if
* Push one source particle to the stack. Note that you could as well
* push many but this way we reserve a maximum amount of space in the
* stack for the secondaries to be generated
* Npflka is the stack counter: of course any time source is called it
* must be =0
      NPFLKA = NPFLKA + 1
* Wt is the weight of the particle
      WTFLK (NPFLKA) = weigh(sample)
      WEIPRI = WEIPRI + WTFLK (NPFLKA)
* Particle type (1=proton.....). Ijbeam is the type set by the BEAM
* card
* +-------------------------------------------------------------------*
* | (Radioactive) isotope:
      IF ( IJBEAM .EQ. -2 .AND. LRDBEA ) THEN
         IARES = IPROA
         IZRES = IPROZ
         IISRES = IPROM
         CALL STISBM ( IARES, IZRES, IISRES )
         IJHION = IPROZ * 1000 + IPROA
         IJHION = IJHION * 100 + KXHEAV
         IONID = IJHION
         CALL DCDION ( IONID )
         CALL SETION ( IONID )
* |
* +-------------------------------------------------------------------*
* | Heavy ion:
      ELSE IF ( IJBEAM .EQ. -2 ) THEN
         IJHION = IPROZ * 1000 + IPROA
         IJHION = IJHION * 100 + KXHEAV
         IONID = IJHION
         CALL DCDION ( IONID )
         CALL SETION ( IONID )
         ILOFLK (NPFLKA) = IJHION
* | Flag this is prompt radiation
         LRADDC (NPFLKA) = .FALSE.
* |
* +-------------------------------------------------------------------*
* | Normal hadron:
      ELSE
         IONID = IJBEAM
* ILOFLK (NPFLKA) = IJBEAM
* Warning!!!! in the input file BEAM is of electrons!!!!!
         ILOFLK (NPFLKA) = jpart(sample)
* | Flag this is prompt radiation
         LRADDC (NPFLKA) = .FALSE.
      END IF
* |
* +-------------------------------------------------------------------*
* From this point .....
* Particle generation (1 for primaries)
      LOFLK (NPFLKA) = 1
* User dependent flag:
      LOUSE (NPFLKA) = 0
* User dependent spare variables:
      DO 100 ISPR = 1, MKBMX1
         SPAREK (ISPR,NPFLKA) = ZERZER
 100 CONTINUE
* User dependent spare flags:
      DO 200 ISPR = 1, MKBMX2
         ISPARK (ISPR,NPFLKA) = 0
 200 CONTINUE
* Save the track number of the stack particle:
      ISPARK (MKBMX2,NPFLKA) = NPFLKA
      NPARMA = NPARMA + 1
      NUMPAR (NPFLKA) = NPARMA
      NEVENT (NPFLKA) = 0
      DFNEAR (NPFLKA) = +ZERZER
* ... to this point: don't change anything
* Particle age (s)
      AGESTK (NPFLKA) = +ZERZER
      AKNSHR (NPFLKA) = -TWOTWO
* Group number for "low" energy neutrons, set to 0 anyway
      IGROUP (NPFLKA) = 0
* Kinetic energy of the particle (GeV)
      TKEFLK (NPFLKA) = enrgy(sample)
* Particle momentum
      PMOFLK (NPFLKA) = SQRT ( TKEFLK (NPFLKA) * ( TKEFLK (NPFLKA)
     & + TWOTWO * AM (ILOFLK(NPFLKA)) ) )
* Cosines (tx,ty,tz)
      TXFLK (NPFLKA) = cosx(sample)
      TYFLK (NPFLKA) = cosy(sample)
      TZFLK (NPFLKA) = SQRT ( ONEONE - TXFLK (NPFLKA)**2
     & - TYFLK (NPFLKA)**2 )
* Polarization cosines:
      TXPOL (NPFLKA) = -TWOTWO
      TYPOL (NPFLKA) = +ZERZER
      TZPOL (NPFLKA) = +ZERZER
* Particle coordinates
      XFLK (NPFLKA) = xcoo(sample)
      YFLK (NPFLKA) = ycoo(sample)
      ZFLK (NPFLKA) = zcoo(sample)
* Calculate the total kinetic energy of the primaries: don't change
          IF ( ILOFLK (NPFLKA) .EQ. -2 .OR.
     & ILOFLK (NPFLKA) .GT. 2000000 )
     & THEN

         TKESUM = TKESUM + TKEFLK (NPFLKA) * WTFLK (NPFLKA)
      ELSE IF ( ILOFLK (NPFLKA) .NE. 0 ) THEN
         TKESUM = TKESUM + ( TKEFLK (NPFLKA) + AMDISC (ILOFLK(NPFLKA)) )
     & * WTFLK (NPFLKA)
      ELSE
         TKESUM = TKESUM + TKEFLK (NPFLKA) * WTFLK (NPFLKA)
      END IF
      RADDLY (NPFLKA) = ZERZER
* Here we ask for the region number of the hitting point.
* NREG (NPFLKA) = ...
* The following line makes the starting region search much more
* robust if particles are starting very close to a boundary:
      CALL GEOCRS ( TXFLK (NPFLKA), TYFLK (NPFLKA), TZFLK (NPFLKA) )
      CALL GEOREG ( XFLK (NPFLKA), YFLK (NPFLKA), ZFLK (NPFLKA),
     & NRGFLK(NPFLKA), IDISC )
* Do not change these cards:
      CALL GEOHSM ( NHSPNT (NPFLKA), 1, -11, MLATTC )
      NLATTC (NPFLKA) = MLATTC
      CMPATH (NPFLKA) = ZERZER
      CALL SOEVSV
      RETURN
*=== End of subroutine Source =========================================*
      END
Received on Tue Dec 29 2009 - 09:52:07 CET

This archive was generated by hypermail 2.2.0 : Tue Dec 29 2009 - 09:52:11 CET