OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
open_tempfile.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| open_f_scratch_file ../engine/source/system/open_tempfile.F
25!||--- called by ------------------------------------------------------
26!|| freform ../engine/source/input/freform.f
27!|| radioss2 ../engine/source/engine/radioss2.F
28!||--- calls -----------------------------------------------------
29!|| my_getpid ../engine/source/system/pid.c
30!|| tmpenvf ../engine/source/system/tmpenv_c.c
31!||====================================================================
32 SUBROUTINE open_f_scratch_file(FD,ACCES_TYPE,ROOTN,LENROOTN,FILN)
33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36#include "implicit_f.inc"
37C-----------------------------------------------
38C ACCESS TYPES - File format
39C T_FORMATED : FORM=FORMATED
40#define T_FORMATED 1
41C T_DIRECT : FORM=DIRECT_120 RECL=120
42#define T_DIRECT_120 2
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "task_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER, INTENT(IN) :: FD
51 INTEGER, INTENT(IN) :: LENROOTN
52 CHARACTER(LEN=LENROOTN),INTENT(IN) :: ROOTN
53 CHARACTER(LEN=10192),INTENT(OUT) :: FILN
54 INTEGER,INTENT(IN) :: ACCES_TYPE
55C-----------------------------------------------
56C L o c a l V a r i a b l e s
57C-----------------------------------------------
58 INTEGER MY_PID,TLEN
59 CHARACTER(LEN=4096) TMPDIR
60 CHARACTER(LEN=20) :: CPID,CISPMD
61 CHARACTER(LEN=5) :: CFD
62C-----------------------------------------------
63 CALL my_getpid(my_pid)
64 tlen=4096
65
66 tmpdir=''
67 CALL tmpenvf(tmpdir,tlen)
68
69 WRITE(cpid,'(I10.10)') my_pid
70 WRITE(cispmd,'(I6.6)') ispmd
71 WRITE(cfd,'(I2.2)') fd
72#ifdef _WIN64
73 filn=tmpdir(1:tlen)//'\\'//trim(cfd)//'_'//rootn(1:lenrootn)//'_'//trim(cpid)//'_'//trim(cispmd)//'.tmp'
74#else
75 filn=tmpdir(1:tlen)//'/'//trim(cfd)//'_'//rootn(1:lenrootn)//'_'//trim(cpid)//'_'//trim(cispmd)//'.tmp'
76#endif
77C Create tempo file
78 IF (acces_type == t_formated ) THEN
79
80 OPEN(unit=fd,form='FORMATTED',file=trim(filn))
81
82 ELSEIF (acces_type == t_direct_120 ) THEN
83
84 OPEN(unit=fd,form='FORMATTED',access='DIRECT',recl=120,file=trim(filn))
85 ENDIF
86 END
87
88
subroutine freform(irunn, irfl, irfe, h3d_data, flag_cst_ams, dynain_data, sensors, dt, output, glob_therm)
Definition freform.F:88
subroutine open_f_scratch_file(fd, acces_type, rootn, lenrootn, filn)
#define my_getpid
Definition tmpenv_c.c:47
void tmpenvf(char *tmpdir, int *tmplen)
Definition tmpenv_c.c:149