Include Files

 

The previous section described only some of the most commonly used intrinsic variables in EMTDC.  There are numerous others as well, but regardless of which are utilized, the appropriate header file must be included within any external source procedure.  The inclusion of header files is not required when the component source is situated within the definition itself (i.e. the Script section) – only external subroutines and functions.

 

The following tables provide a quick reference for the most commonly used include files.

NOTE:  This is also a list of all reserved intrinsic variable names, which should not be declared locally in any user-written models.

nd.h

This file contains important network dimensioning information, and must always be the first file included in all external procedures.

emtstor.h

Variable Name

Type

Description

STORL(*)

LOGICAL

Storage array for runtime logical variables

STORI(*)

INTEGER

Storage array for runtime integer variables

STORF(*)

REAL

Storage array for runtime floating point variables

STORC(*)

COMPLEX

Storage array for runtime complex variables

NSTORC

INTEGER

Pointer for STORC array

NSTORF

INTEGER

Pointer for STORF array

NSTORI

INTEGER

Pointer for STORI array

NSTORL

INTEGER

Pointer for STORL array

THIS

INTEGER

A temporary pointer

rtconfig.h

Variable Name

Type

Description

RTCL(*)

LOGICAL

Storage array for time zero logical variables

RTCI(*)

INTEGER

Storage array for time zero integer variables

RTCF(*)

REAL

Storage array for time zero floating point variables

RTCC(*)

COMPLEX

Storage array for time zero complex variables

NRTCL

INTEGER

Pointer for RTCL array

NRTCI

INTEGER

Pointer for RTCI array

NRTCF

INTEGER

Pointer for RTCF array

NRTCC

INTEGER

Pointer for RTCC array

TFDATA(*,*)

REAL

Used for passing R and L data to the classical transformer model Runtime Configuration procedure

UMECWDGDATA(*,*)

REAL

Used for passing winding specific information to the UMEC transformer model Runtime Configuration procedure

UMECTFDATA(8)

REAL

Used for passing general information (length ratios, areas, etc.) to the UMEC transformer model Runtime Configuration procedure

UMECSATDATA(10,2)

REAL

Used for passing saturation data points to the UMEC transformer model Runtime Configuration procedure

s0.h

Variable Name

Type

Description

RDC(*,*,*)

REAL

Trangularized [G] matrix

CCIN(*,*)

REAL

Sets the value of current injected into a specified node from ground

VDC(*,*)

REAL

Gives the value of voltage at the specified node

GM(*,*,*)

REAL

Conductance matrix

CCGM(*,*)

REAL

Transformer current

CCLI(*,*)

REAL

Transmission line / cable current

GGIN(*,*)

REAL

Sets the equivalent conductance value of the Norton current source CCIN.

CA(*)

REAL

Current injection vector for triangularized [G] matrix

CDCTR(*,*)

REAL

Current flowing through the Mth winding of the Nth transformer.

MBUS(*)

INTEGER

Number of nodes in a subsystem

IDEALSS(*)

LOGICAL

True if subsystem contains ideal branches

ENABCCIN(*,*)

LOGICAL

True if corresponding CCIN source is enabled

 

s1.h

Variable Name

Type

Description

TIME

REAL

Current time of simulation (t) in seconds

DELT

REAL

Simulation time step (t) in seconds

PRINT

REAL

Plot step interval in seconds

FINTIM

REAL

Simulation finish time in seconds

TIMEZERO

LOGICAL

True when time t = 0.0

FIRSTSTEP

LOGICAL

True for first step starting from the Data file or Snapshot file

LASTSTEP

LOGICAL

True at last time step of the simulation

ONSTEP

LOGICAL

True if calling from the DSDYN or DSOUT subroutines

 

branches.h

Variable Name

Type

Description

CBR(*,*)

REAL

Branch current

CCBR(*,*)

REAL

Equivalent history current

CCBRD(*,*)

REAL

CCBR from previous time step

EBR(*,*)

REAL

Branch voltage source magnitude

EBRD(*,*)

REAL

EBR from previous time step

EBRON(*,*)

REAL

ON state resistance

EBROF(*,*)

REAL

OFF state resistance

SWLEVL(*,*)

REAL

Switching level (I, V, or time)

GEQ(*,*)

REAL

Equivalent branch conductance

GEQON(*,*)

REAL

Equivalent ON state conductance

GEQOF(*,*)

REAL

Equivalent OFF state conductance

GEQD(*,*)

REAL

Equivalent conductance from last step

RLG(*,*)

REAL

Factor used in collapsing RLC branch

RCG(*,*)

REAL

Factor used in collapsing RLC branch

RCL(*,*)

REAL

Factor used in collapsing RLC branch

RSC(*,*)

REAL

Factor used in collapsing RLC branch

RSL(*,*)

REAL

Factor used in collapsing RLC branch

CCL(*,*)

REAL

Factor used in collapsing RLC branch

CCLD(*,*)

REAL

Factor used in collapsing RLC branch

CCC(*,*)

REAL

Factor used in collapsing RLC branch

CCCD(*,*)

REAL

Factor used in collapsing RLC branch

G2L(*,*)

REAL

Factor used in collapsing RLC branch

G2C(*,*)

REAL

Factor used in collapsing RLC branch

V12L(*,*)

REAL

Factor used in collapsing RLC branch

V20L(*,*)

REAL

Factor used in collapsing RLC branch

NSW(*)

INTEGER

Total # of switches in subsystem SS

BRNSW(*,*)

INTEGER

Branch # (switch => branch)

IEF(*,*)

INTEGER

Branch number of 'from node' (positive current flows out)

IET(*,*)

INTEGER

Branch number of 'to node' (positive current flows in)

THISBR(*,*)

INTEGER

Starting location of data storage

RESISTOR(*,*)

LOGICAL

True if resistance is present in branch

INDUCTOR(*,*)

LOGICAL

True if inductance is present in branch

CAPACITR(*,*)

LOGICAL

True if capacitance is present in branch

SOURCE(*,*)

LOGICAL

True if internal source is present in branch

SWITCH(*,*)

LOGICAL

True if switchable

IDEALBR(*,*)

LOGICAL

True if ideal branch

OPENBR(*,*)

LOGICAL

True if switch is open

DEFRDBR(*,*)

LOGICAL

True if attributes undecided

FLIPIDLBR(*,*)

LOGICAL

Flag if an ideal branch is collapsed in forward or reverse

GEQCHANGE(*)

LOGICAL

True if branch switched without interpolation

EC_DIODE

INTEGER

Diode (= 20)

EC_THYRISTOR

INTEGER

Thyristor (= 21)

EC_GTO

INTEGER

GTO (= 22)

EC_IGBT

INTEGER

IGBT (= 23)

EC_MOSFET

INTEGER

MOSFET (= 24)

EC_TRANSISTOR

INTEGER

Transistor (= 25)

EC_VZNO

INTEGER

Gapless Metal Oxide Arrestor (= 34)

EC_VSRC

INTEGER

Branch voltage source (= 101)

EC_CSRC1P

INTEGER

Single phase current source (= 111)

EC_CSRC3P

INTEGER

Three phase current source (= 113)

 

emtconst.h

 

Variable Name

Type

Description

PI_

REAL

p = 3.141592653589793

TWO_PI

REAL

2p = 6.283185307179586

PI_BY3

REAL

p /3 = 1.047197551196598

PI2_BY3

REAL

2p /3 = 2.094395102393195

PI_BY2

REAL

p /2 = 1.570796326794896

PI_BY180

REAL

p /180 = 0.017453292519943

BY180_PI

REAL

180/p = 57.29577951308232

BY_PI

REAL

1/p = 0.318309886183791

BY_2PI

REAL

1/2p = 0.159154943091895

SQRT_2

REAL

= 1.414213562373095

SQRT_3

REAL

= 1.732050807568877

SQRT_1BY2

REAL

= 0.707106781186548

SQRT_1BY3

REAL

= 0.577350269189626

 

fnames.h

Variable Name

Type

Description

DUMLIN

CHARACTER

Array used for storing current data line read

SECTION

CHARACTER

Name of the section last read

FILENAME

CHARACTER

Data file name

MAPNAME

CHARACTER

Name of the map to be read for this page

NETDATA

LOGICAL

True while reading network data

INAM

CHARACTER

Input file name (Snapshot or Data files)

TNAM

CHARACTER

Table file name (nodes table file)

INAM1

CHARACTER

Input include file name

ONAM

CHARACTER

Output file name (channel information and/or print plots

SNAM

CHARACTER

End of run snapshot file name

RTSNAM

CHARACTER

Same as SNAM but for runtime snapshot files

MNAM

CHARACTER

Multiple run file name

IUNIT

INTEGER

Current input file unit number

IUNITOUT

INTEGER

Starting unit # for output files

 

warn.h

Variable Name

Type

Description

COMP_ID1

INTEGER

Component call number

COMP_ID2

INTEGER

Component instance number