OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
open_tempfile.F File Reference
#include "implicit_f.inc"
#include "task_c.inc"

Go to the source code of this file.

Macros

#define T_FORMATED   1
#define T_DIRECT_120   2

Functions/Subroutines

subroutine open_f_scratch_file (fd, acces_type, rootn, lenrootn, filn)

Macro Definition Documentation

◆ T_DIRECT_120

#define T_DIRECT_120   2

◆ T_FORMATED

#define T_FORMATED   1

Function/Subroutine Documentation

◆ open_f_scratch_file()

subroutine open_f_scratch_file ( integer, intent(in) fd,
integer, intent(in) acces_type,
character(len=lenrootn), intent(in) rootn,
integer, intent(in) lenrootn,
character(len=10192), intent(out) filn )

Definition at line 32 of file open_tempfile.F.

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
#define my_getpid
Definition tmpenv_c.c:47
void tmpenvf(char *tmpdir, int *tmplen)
Definition tmpenv_c.c:149