Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ModBuildFileNames.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: Collection of utility routines for building file names.
26 !
27 ! Description: None
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: ModBuildFileNames.F90,v 1.5 2008/12/06 08:44:18 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2004 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modparameters
42  USE moddatatypes
43  USE modglobal, ONLY: t_global
44  USE moderror
45 
46  IMPLICIT NONE
47 
48 ! ******************************************************************************
49 ! Declarations and definitions
50 ! ******************************************************************************
51 
52 ! ==============================================================================
53 ! Public data
54 ! ==============================================================================
55 
56 ! ==============================================================================
57 ! Private data
58 ! ==============================================================================
59 
60  CHARACTER(CHRLEN), PRIVATE :: &
61  RCSIdentString = '$RCSfile: ModBuildFileNames.F90,v $ $Revision: 1.5 $'
62 
63 ! ==============================================================================
64 ! Public functions
65 ! ==============================================================================
66 
67  PUBLIC :: buildfilenamebasic, &
74 
75 ! ==============================================================================
76 ! Private functions
77 ! ==============================================================================
78 
79 ! ******************************************************************************
80 ! Routines
81 ! ******************************************************************************
82 
83  CONTAINS
84 
85 
86 
87 
88 ! ******************************************************************************
89 !
90 ! Purpose: Build basic file name, that is, file name consisting only of
91 ! directory, case name, extension, and region id.
92 !
93 ! Description: None.
94 !
95 ! Input:
96 ! global Global pointer
97 ! dest Integer parameter indicating destination directory
98 ! ext Extension (including ".")
99 ! regId Region index
100 !
101 ! Output:
102 ! fileName File name
103 !
104 ! Notes: None.
105 !
106 ! ******************************************************************************
107 
108  SUBROUTINE buildfilenamebasic(global,dest,ext,regId,fileName)
109 
110  IMPLICIT NONE
111 
112 ! ******************************************************************************
113 ! Declarations and definitions
114 ! ******************************************************************************
115 
116 ! ==============================================================================
117 ! Local variables
118 ! ==============================================================================
119 
120  CHARACTER(CHRLEN) :: deststring,regidstring
121 
122 ! ==============================================================================
123 ! Arguments
124 ! ==============================================================================
125 
126  CHARACTER(*), INTENT(IN) :: ext
127  INTEGER, INTENT(IN) :: dest,regid
128  TYPE(t_global), POINTER :: global
129 
130  CHARACTER(CHRLEN), INTENT(OUT) :: filename
131 
132 ! ******************************************************************************
133 ! Start
134 ! ******************************************************************************
135 
136  CALL registerfunction(global,'BuildFileNameBasic',&
137  'ModBuildFileNames.F90')
138 
139 ! ******************************************************************************
140 ! Build file name
141 ! ******************************************************************************
142 
143  IF ( dest == filedest_indir ) THEN
144  WRITE(deststring,'(A)') global%inDir
145  ELSE IF ( dest == filedest_outdir ) THEN
146  WRITE(deststring,'(A)') global%outDir
147  ELSE
148  CALL errorstop(global,err_filedest_invalid,&
149  __line__)
150  END IF ! dest
151 
152  CALL buildregionidstring(global,regid,regidstring)
153 
154  WRITE(filename,'(A)') trim(deststring)//trim(global%caseName)// &
155  trim(ext)//'_'//trim(regidstring)
156 
157 ! ******************************************************************************
158 ! End
159 ! ******************************************************************************
160 
161  CALL deregisterfunction(global)
162 
163  END SUBROUTINE buildfilenamebasic
164 
165 
166 
167 
168 
169 
170 
171 
172 ! ******************************************************************************
173 !
174 ! Purpose: Build plain file name, that is, file name consisting only of
175 ! directory, case name, and extension.
176 !
177 ! Description: None.
178 !
179 ! Input:
180 ! global Global pointer
181 ! dest Integer parameter indicating destination directory
182 ! ext Extension (including ".")
183 !
184 ! Output:
185 ! fileName File name
186 !
187 ! Notes: None.
188 !
189 ! ******************************************************************************
190 
191  SUBROUTINE buildfilenameplain(global,dest,ext,fileName)
192 
193  IMPLICIT NONE
194 
195 ! ******************************************************************************
196 ! Declarations and definitions
197 ! ******************************************************************************
198 
199 ! ==============================================================================
200 ! Local variables
201 ! ==============================================================================
202 
203  CHARACTER(CHRLEN) :: deststring
204 
205 ! ==============================================================================
206 ! Arguments
207 ! ==============================================================================
208 
209  CHARACTER(*), INTENT(IN) :: ext
210  INTEGER, INTENT(IN) :: dest
211  TYPE(t_global), POINTER :: global
212 
213  CHARACTER(CHRLEN), INTENT(OUT) :: filename
214 
215 ! ******************************************************************************
216 ! Start
217 ! ******************************************************************************
218 
219  CALL registerfunction(global,'BuildFileNamePlain',&
220  'ModBuildFileNames.F90')
221 
222 ! ******************************************************************************
223 ! Build file name
224 ! ******************************************************************************
225 
226  IF ( dest == filedest_indir ) THEN
227  WRITE(deststring,'(A)') global%inDir
228  ELSE IF ( dest == filedest_outdir ) THEN
229  WRITE(deststring,'(A)') global%outDir
230  ELSE
231  CALL errorstop(global,err_filedest_invalid,&
232  __line__)
233  END IF ! dest
234 
235  WRITE(filename,'(A)') trim(deststring)//trim(global%caseName)//trim(ext)
236 
237 ! ******************************************************************************
238 ! End
239 ! ******************************************************************************
240 
241  CALL deregisterfunction(global)
242 
243  END SUBROUTINE buildfilenameplain
244 
245 
246 
247 
248 
249 
250 
251 
252 ! ******************************************************************************
253 !
254 ! Purpose: Build plain file name with stamp, that is, file name consisting
255 ! only of directory, case name, iteration stamp, and extension.
256 !
257 ! Description: None.
258 !
259 ! Input:
260 ! global Global pointer
261 ! dest Integer parameter indicating destination directory
262 ! ext Extension (including ".")
263 ! it Iteration counter
264 !
265 ! Output:
266 ! fileName File name
267 !
268 ! Notes: None.
269 !
270 ! ******************************************************************************
271 
272  SUBROUTINE buildfilenameplainsteady(global,dest,ext,it,fileName)
273 
274  IMPLICIT NONE
275 
276 ! ******************************************************************************
277 ! Declarations and definitions
278 ! ******************************************************************************
279 
280 ! ==============================================================================
281 ! Local variables
282 ! ==============================================================================
283 
284  CHARACTER(CHRLEN) :: deststring
285 
286 ! ==============================================================================
287 ! Arguments
288 ! ==============================================================================
289 
290  CHARACTER(*), INTENT(IN) :: ext
291  INTEGER, INTENT(IN) :: dest,it
292  TYPE(t_global), POINTER :: global
293 
294  CHARACTER(CHRLEN), INTENT(OUT) :: filename
295 
296 ! ******************************************************************************
297 ! Start
298 ! ******************************************************************************
299 
300  CALL registerfunction(global,'BuildFileNamePlainSteady',&
301  'ModBuildFileNames.F90')
302 
303 ! ******************************************************************************
304 ! Build file name
305 ! ******************************************************************************
306 
307  IF ( dest == filedest_indir ) THEN
308  WRITE(deststring,'(A)') global%inDir
309  ELSE IF ( dest == filedest_outdir ) THEN
310  WRITE(deststring,'(A)') global%outDir
311  ELSE
312  CALL errorstop(global,err_filedest_invalid,&
313  __line__)
314  END IF ! dest
315 
316  WRITE(filename,'(A,A,I6.6,A)') &
317  trim(deststring)//trim(global%caseName),'_',it,trim(ext)
318 
319 ! ******************************************************************************
320 ! End
321 ! ******************************************************************************
322 
323  CALL deregisterfunction(global)
324 
325  END SUBROUTINE buildfilenameplainsteady
326 
327 
328 
329 
330 
331 
332 
333 
334 ! ******************************************************************************
335 !
336 ! Purpose: Build plain file name with stamp, that is, file name consisting
337 ! only of directory, case name, time stamp, and extension.
338 !
339 ! Description: None.
340 !
341 ! Input:
342 ! global Global pointer
343 ! dest Integer parameter indicating destination directory
344 ! ext Extension (including ".")
345 ! tm Time stamp
346 !
347 ! Output:
348 ! fileName File name
349 !
350 ! Notes: None.
351 !
352 ! ******************************************************************************
353 
354  SUBROUTINE buildfilenameplainunsteady(global,dest,ext,tm,fileName)
355 
356  IMPLICIT NONE
357 
358 ! ******************************************************************************
359 ! Declarations and definitions
360 ! ******************************************************************************
361 
362 ! ==============================================================================
363 ! Local variables
364 ! ==============================================================================
365 
366  CHARACTER(CHRLEN) :: deststring
367 
368 ! ==============================================================================
369 ! Arguments
370 ! ==============================================================================
371 
372  CHARACTER(*), INTENT(IN) :: ext
373  INTEGER, INTENT(IN) :: dest
374  REAL(RFREAL), INTENT(IN) :: tm
375  TYPE(t_global), POINTER :: global
376 
377  CHARACTER(CHRLEN), INTENT(OUT) :: filename
378 
379 ! ******************************************************************************
380 ! Start
381 ! ******************************************************************************
382 
383  CALL registerfunction(global,'BuildFileNamePlainUnsteady',&
384  'ModBuildFileNames.F90')
385 
386 ! ******************************************************************************
387 ! Build file name
388 ! ******************************************************************************
389 
390  IF ( dest == filedest_indir ) THEN
391  WRITE(deststring,'(A)') global%inDir
392  ELSE IF ( dest == filedest_outdir ) THEN
393  WRITE(deststring,'(A)') global%outDir
394  ELSE
395  CALL errorstop(global,err_filedest_invalid,&
396  __line__)
397  END IF ! dest
398 
399  WRITE(filename,'(A,A,1PE11.5,A)') &
400  trim(deststring)//trim(global%caseName),'_',tm,trim(ext)
401 
402 ! ******************************************************************************
403 ! End
404 ! ******************************************************************************
405 
406  CALL deregisterfunction(global)
407 
408  END SUBROUTINE buildfilenameplainunsteady
409 
410 
411 
412 
413 
414 
415 
416 
417 ! ******************************************************************************
418 !
419 ! Purpose: Build file name for steady flow, that is, file name consisting of
420 ! directory, case name, extension, region id, and iteration counter.
421 !
422 ! Description: None.
423 !
424 ! Input:
425 ! global Global pointer
426 ! dest Integer parameter indicating destination directory
427 ! ext Extension (including ".")
428 ! regId Region index
429 ! it Iteration counter
430 !
431 ! Output:
432 ! fileName File name
433 !
434 ! Notes: None.
435 !
436 ! ******************************************************************************
437 
438  SUBROUTINE buildfilenamesteady(global,dest,ext,regId,it,fileName)
439 
440  IMPLICIT NONE
441 
442 ! ******************************************************************************
443 ! Declarations and definitions
444 ! ******************************************************************************
445 
446 ! ==============================================================================
447 ! Local variables
448 ! ==============================================================================
449 
450  CHARACTER(CHRLEN) :: deststring,regidstring
451 
452 ! ==============================================================================
453 ! Arguments
454 ! ==============================================================================
455 
456  CHARACTER(*), INTENT(IN) :: ext
457  INTEGER, INTENT(IN) :: dest,regid,it
458  TYPE(t_global), POINTER :: global
459 
460  CHARACTER(CHRLEN), INTENT(OUT) :: filename
461 
462 ! ******************************************************************************
463 ! Start
464 ! ******************************************************************************
465 
466  CALL registerfunction(global,'BuildFileNameSteady',&
467  'ModBuildFileNames.F90')
468 
469 ! ******************************************************************************
470 ! Build file name
471 ! ******************************************************************************
472 
473  IF ( dest == filedest_indir ) THEN
474  WRITE(deststring,'(A)') global%inDir
475  ELSE IF ( dest == filedest_outdir ) THEN
476  WRITE(deststring,'(A)') global%outDir
477  ELSE
478  CALL errorstop(global,err_filedest_invalid,&
479  __line__)
480  END IF ! dest
481 
482  CALL buildregionidstring(global,regid,regidstring)
483 
484  WRITE(filename,'(A,I6.6)') trim(deststring)//trim(global%caseName)// &
485  trim(ext)//'_'//trim(regidstring)//'_',it
486 
487 ! ******************************************************************************
488 ! End
489 ! ******************************************************************************
490 
491  CALL deregisterfunction(global)
492 
493  END SUBROUTINE buildfilenamesteady
494 
495 
496 
497 
498 
499 
500 
501 ! ******************************************************************************
502 !
503 ! Purpose: Build file name for unsteady flow, that is, file name consisting of
504 ! directory, case name, extension, region id, and time stamp.
505 !
506 ! Description: None.
507 !
508 ! Input:
509 ! global Global pointer
510 ! dest Integer parameter indicating destination directory
511 ! ext Extension (including ".")
512 ! regId Region index
513 ! tm Time stamp
514 !
515 ! Output:
516 ! fileName File name
517 !
518 ! Notes: None.
519 !
520 ! ******************************************************************************
521 
522  SUBROUTINE buildfilenameunsteady(global,dest,ext,regId,tm,fileName)
523 
524  IMPLICIT NONE
525 
526 ! ******************************************************************************
527 ! Declarations and definitions
528 ! ******************************************************************************
529 
530 ! ==============================================================================
531 ! Local variables
532 ! ==============================================================================
533 
534  CHARACTER(CHRLEN) :: deststring,regidstring
535 
536 ! ==============================================================================
537 ! Arguments
538 ! ==============================================================================
539 
540  CHARACTER(*), INTENT(IN) :: ext
541  INTEGER, INTENT(IN) :: dest,regid
542  REAL(RFREAL), INTENT(IN) :: tm
543  TYPE(t_global), POINTER :: global
544 
545  CHARACTER(CHRLEN), INTENT(OUT) :: filename
546 
547 ! ******************************************************************************
548 ! Start
549 ! ******************************************************************************
550 
551  CALL registerfunction(global,'BuildFileNameUnsteady',&
552  'ModBuildFileNames.F90')
553 
554 ! ******************************************************************************
555 ! Build file name
556 ! ******************************************************************************
557 
558  IF ( dest == filedest_indir ) THEN
559  WRITE(deststring,'(A)') global%inDir
560  ELSE IF ( dest == filedest_outdir ) THEN
561  WRITE(deststring,'(A)') global%outDir
562  ELSE
563  CALL errorstop(global,err_filedest_invalid,&
564  __line__)
565  END IF ! dest
566 
567  CALL buildregionidstring(global,regid,regidstring)
568 
569  WRITE(filename,'(A,1PE11.5)') trim(deststring)//trim(global%caseName)// &
570  trim(ext)//'_'//trim(regidstring)//'_',tm
571 
572 ! ******************************************************************************
573 ! End
574 ! ******************************************************************************
575 
576  CALL deregisterfunction(global)
577 
578  END SUBROUTINE buildfilenameunsteady
579 
580 
581 
582 
583 
584 
585 
586 
587 ! ******************************************************************************
588 !
589 ! Purpose: Build region id string.
590 !
591 ! Description: None.
592 !
593 ! Input:
594 ! global Global pointer
595 ! regId Region index
596 !
597 ! Output:
598 ! regIdString Region string
599 !
600 ! Notes: None.
601 !
602 ! ******************************************************************************
603 
604  SUBROUTINE buildregionidstring(global,regId,regIdString)
605 
606  IMPLICIT NONE
607 
608 ! ******************************************************************************
609 ! Declarations and definitions
610 ! ******************************************************************************
611 
612 ! ==============================================================================
613 ! Local variables
614 ! ==============================================================================
615 
616 ! ==============================================================================
617 ! Arguments
618 ! ==============================================================================
619 
620  INTEGER, INTENT(IN) :: regid
621  TYPE(t_global), POINTER :: global
622 
623  CHARACTER(CHRLEN), INTENT(OUT) :: regidstring
624 
625 ! ******************************************************************************
626 ! Start
627 ! ******************************************************************************
628 
629  CALL registerfunction(global,'BuildRegionIdString',&
630  'ModBuildFileNames.F90')
631 
632 ! ******************************************************************************
633 ! Write region id into region string
634 ! ******************************************************************************
635 
636  WRITE(regidstring,'(I5.5)') regid
637 
638 ! ******************************************************************************
639 ! End
640 ! ******************************************************************************
641 
642  CALL deregisterfunction(global)
643 
644  END SUBROUTINE buildregionidstring
645 
646 
647 
648 
649 
650 
651 
652 END MODULE modbuildfilenames
653 
654 ! ******************************************************************************
655 !
656 ! RCS Revision history:
657 !
658 ! $Log: ModBuildFileNames.F90,v $
659 ! Revision 1.5 2008/12/06 08:44:18 mtcampbe
660 ! Updated license.
661 !
662 ! Revision 1.4 2008/11/19 22:17:29 mtcampbe
663 ! Added Illinois Open Source License/Copyright
664 !
665 ! Revision 1.3 2006/04/07 15:19:18 haselbac
666 ! Removed tabs
667 !
668 ! Revision 1.2 2004/10/19 19:28:38 haselbac
669 ! Added BuildRegionIdString bcos needed in GENX modules, cosmetics
670 !
671 ! Revision 1.1 2004/06/16 20:00:43 haselbac
672 ! Initial revision
673 !
674 ! ******************************************************************************
675 
676 
677 
678 
679 
680 
681 
682 
683 
684 
685 
686 
687 
subroutine buildfilenamebasic(global, dest, ext, id, fileName)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine, public buildfilenameplainsteady(global, dest, ext, it, fileName)
subroutine buildfilenameplain(global, dest, ext, fileName)
subroutine, public buildregionidstring(global, regId, regIdString)
subroutine, public buildfilenameplainunsteady(global, dest, ext, tm, fileName)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine buildfilenamesteady(global, dest, ext, id, it, fileName)
subroutine buildfilenameunsteady(global, dest, ext, id, tm, fileName)