ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExFortranAlgorithm
src
FortranAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FortranAlgorithm.h
"
6
7
extern
"C"
{
8
void
initialize_
(
const
int
& lun,
const
char
*,
long
int
);
9
void
execute_
(
const
int
& lun);
10
void
finalize_
(
const
int
& lun);
11
void
_gfortran_flush_i4
(
int
*);
12
}
13
14
15
namespace
{
16
17
18
void
fortran_flush()
19
{
20
#ifdef __GNUC__
21
_gfortran_flush_i4
(
nullptr
);
22
#endif
23
}
24
25
26
}
27
28
30
31
FortranAlgorithm::FortranAlgorithm
(
const
std::string& name, ISvcLocator* pSvcLocator) :
32
AthAlgorithm
(name, pSvcLocator),
m_lun
(16),
m_fileName
(
"FortranAlgorithmInput.data"
)
33
{
34
declareProperty
(
"LUN"
,
m_lun
);
35
declareProperty
(
"fileName"
,
m_fileName
);
36
}
37
38
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
39
40
StatusCode
FortranAlgorithm::initialize
(){
41
ATH_MSG_INFO
(
"calling initialize_()"
);
42
initialize_
(
m_lun
,
m_fileName
.c_str(),
m_fileName
.size());
43
fortran_flush();
44
return
StatusCode::SUCCESS;
45
}
46
47
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
48
49
StatusCode
FortranAlgorithm::execute
(
const
EventContext&
/*ctx*/
) {
50
ATH_MSG_INFO
(
"calling execute_()"
);
51
execute_
(
m_lun
);
52
fortran_flush();
53
return
StatusCode::SUCCESS;
54
}
55
56
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
57
58
StatusCode
FortranAlgorithm::finalize
() {
59
ATH_MSG_INFO
(
"calling finalize_()"
);
60
finalize_
(
m_lun
);
61
fortran_flush();
62
return
StatusCode::SUCCESS;
63
}
64
65
66
67
68
69
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
_gfortran_flush_i4
void _gfortran_flush_i4(int *)
initialize_
void initialize_(const int &lun, const char *, long int)
finalize_
void finalize_(const int &lun)
execute_
void execute_(const int &lun)
FortranAlgorithm.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
FortranAlgorithm::m_lun
int m_lun
Definition
FortranAlgorithm.h:22
FortranAlgorithm::initialize
StatusCode initialize()
Definition
FortranAlgorithm.cxx:40
FortranAlgorithm::execute
StatusCode execute(const EventContext &ctx)
Execute method.
Definition
FortranAlgorithm.cxx:49
FortranAlgorithm::m_fileName
std::string m_fileName
Definition
FortranAlgorithm.h:23
FortranAlgorithm::finalize
StatusCode finalize()
Definition
FortranAlgorithm.cxx:58
FortranAlgorithm::FortranAlgorithm
FortranAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FortranAlgorithm.cxx:31
Generated on
for ATLAS Offline Software by
1.17.0