Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildFileNameBasic.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: Build basic file name, that is, file name consisting only of
26 ! directory, case name, extension, and domain id.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! global Global pointer
32 ! dest Integer parameter indicating destination directory
33 ! ext Extension (including ".")
34 ! id Region index
35 !
36 ! Output:
37 ! fileName File name
38 !
39 ! Notes: None.
40 !
41 !******************************************************************************
42 !
43 ! $Id: BuildFileNameBasic.F90,v 1.4 2008/12/06 08:44:08 mtcampbe Exp $
44 !
45 ! Copyright: (c) 2003 by the University of Illinois
46 !
47 !******************************************************************************
48 
49 SUBROUTINE buildfilenamebasic(global,dest,ext,id,fileName)
50 
51  USE modglobal, ONLY: t_global
52  USE moddatatypes
53  USE modparameters
54  USE moderror
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Declarations and definitions
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Local variables
64 ! ==============================================================================
65 
66  CHARACTER(CHRLEN) :: deststring,rcsidentstring
67 
68 ! ==============================================================================
69 ! Arguments
70 ! ==============================================================================
71 
72  CHARACTER(*), INTENT(IN) :: ext
73  INTEGER, INTENT(IN) :: dest,id
74  TYPE(t_global), POINTER :: global
75 
76  CHARACTER(CHRLEN), INTENT(OUT) :: filename
77 
78 ! ******************************************************************************
79 ! Start
80 ! ******************************************************************************
81 
82  rcsidentstring = '$RCSfile: BuildFileNameBasic.F90,v $ $Revision: 1.4 $'
83 
84  CALL registerfunction(global,'BuildFileNameBasic',&
85  'BuildFileNameBasic.F90')
86 
87  IF ( dest == filedest_indir ) THEN
88  WRITE(deststring,'(A)') global%inDir
89  ELSE IF ( dest == filedest_outdir ) THEN
90  WRITE(deststring,'(A)') global%outDir
91  ELSE
92  CALL errorstop(global,err_filedest_invalid,__line__)
93  END IF ! dest
94 
95  WRITE(filename,'(A,A,I5.5)') trim(deststring)//trim(global%caseName)// &
96  trim(ext),'_',id
97 
98  CALL deregisterfunction(global)
99 
100 ! ******************************************************************************
101 ! End
102 ! ******************************************************************************
103 
104 END SUBROUTINE buildfilenamebasic
105 
106 
107 ! ******************************************************************************
108 !
109 ! RCS Revision history:
110 !
111 ! $Log: BuildFileNameBasic.F90,v $
112 ! Revision 1.4 2008/12/06 08:44:08 mtcampbe
113 ! Updated license.
114 !
115 ! Revision 1.3 2008/11/19 22:17:22 mtcampbe
116 ! Added Illinois Open Source License/Copyright
117 !
118 ! Revision 1.2 2006/04/07 15:19:15 haselbac
119 ! Removed tabs
120 !
121 ! Revision 1.1 2004/12/01 16:48:06 haselbac
122 ! Initial revision after changing case
123 !
124 ! Revision 1.1 2003/01/28 16:12:15 haselbac
125 ! Initial revision
126 !
127 ! ******************************************************************************
128 
129 
130 
131 
132 
133 
134 
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
unsigned long id(const Leda_like_handle &x)
Definition: Handle.h:107
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469