Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BuildFileNamePlain.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 plain file name, that is, file name consisting only of
26 ! directory, case name, and extension.
27 !
28 ! Description: None.
29 !
30 ! Input:
31 ! global Global pointer
32 ! dest Integer parameter indicating destination directory
33 ! ext Extension (including ".")
34 !
35 ! Output:
36 ! fileName File name
37 !
38 ! Notes: None.
39 !
40 !******************************************************************************
41 !
42 ! $Id: BuildFileNamePlain.F90,v 1.4 2008/12/06 08:44:08 mtcampbe Exp $
43 !
44 ! Copyright: (c) 2003 by the University of Illinois
45 !
46 !******************************************************************************
47 
48 SUBROUTINE buildfilenameplain(global,dest,ext,fileName)
49 
50  USE modglobal, ONLY: t_global
51  USE moddatatypes
52  USE modparameters
53  USE moderror
54 
55  IMPLICIT NONE
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61 ! ==============================================================================
62 ! Local variables
63 ! ==============================================================================
64 
65  CHARACTER(CHRLEN) :: deststring,rcsidentstring
66 
67 ! ==============================================================================
68 ! Arguments
69 ! ==============================================================================
70 
71  CHARACTER(*), INTENT(IN) :: ext
72  INTEGER, INTENT(IN) :: dest
73  TYPE(t_global), POINTER :: global
74 
75  CHARACTER(CHRLEN), INTENT(OUT) :: filename
76 
77 ! ******************************************************************************
78 ! Start
79 ! ******************************************************************************
80 
81  rcsidentstring = '$RCSfile: BuildFileNamePlain.F90,v $ $Revision: 1.4 $'
82 
83  CALL registerfunction(global,'BuildFileNamePlain',&
84  'BuildFileNamePlain.F90')
85 
86  IF ( dest == filedest_indir ) THEN
87  WRITE(deststring,'(A)') global%inDir
88  ELSE IF ( dest == filedest_outdir ) THEN
89  WRITE(deststring,'(A)') global%outDir
90  ELSE
91  CALL errorstop(global,err_filedest_invalid,__line__)
92  END IF ! dest
93 
94  WRITE(filename,'(A)') trim(deststring)//trim(global%caseName)//trim(ext)
95 
96  CALL deregisterfunction(global)
97 
98 ! ******************************************************************************
99 ! End
100 ! ******************************************************************************
101 
102 END SUBROUTINE buildfilenameplain
103 
104 
105 ! ******************************************************************************
106 !
107 ! RCS Revision history:
108 !
109 ! $Log: BuildFileNamePlain.F90,v $
110 ! Revision 1.4 2008/12/06 08:44:08 mtcampbe
111 ! Updated license.
112 !
113 ! Revision 1.3 2008/11/19 22:17:22 mtcampbe
114 ! Added Illinois Open Source License/Copyright
115 !
116 ! Revision 1.2 2006/04/07 15:19:15 haselbac
117 ! Removed tabs
118 !
119 ! Revision 1.1 2004/12/01 16:48:09 haselbac
120 ! Initial revision after changing case
121 !
122 ! Revision 1.1 2003/01/28 16:12:15 haselbac
123 ! Initial revision
124 !
125 ! ******************************************************************************
126 
127 
128 
129 
130 
131 
132 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine buildfilenameplain(global, dest, ext, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469