Tuesday, March 19, 2013

Fortran 95

Main article: Fortran 95 language features

Fortran 95, published officially as ISO/IEC 1539-1:1997, was a minor revision, mostly to resolve some outstanding issues from the Fortran 90 standard. Nevertheless, Fortran 95 also added a number of extensions, notably from the High Performance Fortran specification:
  • FORALL and nested WHERE constructs to aid vectorization
  • User-defined PURE and ELEMENTAL procedures
  • Default initialization of derived type components, including pointer initialization
  • Expanded the ability to use initialization expressions for data objects
  • Clearly defined that ALLOCATABLE arrays are automatically deallocated when they go out of scope.
A number of intrinsic functions were extended (for example a dim argument was added to the maxloc intrinsic).
Several features noted in Fortran 90 to be "obsolescent" were removed from Fortran 95:
  • DO statements using REAL and DOUBLE PRECISION variables
  • Branching to an END IF statement from outside its block
  • PAUSE statement
  • ASSIGN and assigned GOTO statement, and assigned format specifiers
  • H edit descriptor.
An important supplement to Fortran 95 was the ISO technical report TR-15581: Enhanced Data Type Facilities, informally known as the Allocatable TR. This specification defined enhanced use of ALLOCATABLE arrays, prior to the availability of fully Fortran 2003-compliant Fortran compilers. Such uses include ALLOCATABLE arrays as derived type components, in procedure dummy argument lists, and as function return values. (ALLOCATABLE arrays are preferable to POINTER-based arrays because ALLOCATABLE arrays are guaranteed by Fortran 95 to be deallocated automatically when they go out of scope, eliminating the possibility of memory leakage. In addition, aliasing is not an issue for optimization of array references, allowing compilers to generate faster code than in the case of pointers.)
Another important supplement to Fortran 95 was the ISO technical report TR-15580: Floating-point exception handling, informally known as the IEEE TR. This specification defined support for IEEE floating-point arithmetic and floating point exception handling.

Conditional compilation and varying length strings

In addition to the mandatory "Base language" (defined in ISO/IEC 1539-1 : 1997), the Fortran 95 language also includes two optional modules:
  • Varying character strings (ISO/IEC 1539-2 : 2000)
  • Conditional compilation (ISO/IEC 1539-3 : 1998)
which, together, compose the multi-part International Standard (ISO/IEC 1539).
According to the standards developers, "the optional parts describe self-contained features which have been requested by a substantial body of users and/or implementors, but which are not deemed to be of sufficient generality for them to be required in all standard-conforming Fortran compilers." Nevertheless, if a standard-conforming Fortran does provide such options, then they "must be provided in accordance with the description of those facilities in the appropriate Part of the Standard."

Fortran 90

The much delayed successor to FORTRAN 77, informally known as Fortran 90 (and prior to that, Fortran 8X), was finally released as ISO/IEC standard 1539:1991 in 1991 and an ANSI Standard in 1992. In addition to changing the official spelling from FORTRAN to Fortran, this major revision added many new features to reflect the significant changes in programming practice that had evolved since the 1978 standard:

  • Free-form source input, also with lowercase Fortran keywords
  • Identifiers up to 31 characters in length
  • Inline comments
  • Ability to operate on arrays (or array sections) as a whole, thus greatly simplifying math and engineering computations.
    • whole, partial and masked array assignment statements and array expressions, such as   X(1:N)=R(1:N)*COS(A(1:N))
    • WHERE statement for selective array assignment
    • array-valued constants and expressions,
    • user-defined array-valued functions and array constructors.
  • RECURSIVE procedures
  • Modules, to group related procedures and data together, and make them available to other program units, including the capability to limit the accessibility to only specific parts of the module.
  • A vastly improved argument-passing mechanism, allowing interfaces to be checked at compile time
  • User-written interfaces for generic procedures
  • Operator overloading
  • Derived (structured) data types
  • New data type declaration syntax, to specify the data type and other attributes of variables
  • Dynamic memory allocation by means of the ALLOCATABLE attribute and the ALLOCATE and DEALLOCATE statements
  • POINTER attribute, pointer assignment, and NULLIFY statement to facilitate the creation and manipulation of dynamic data structures
  • Structured looping constructs, with an END DO statement for loop termination, and EXIT and CYCLE statements for terminating normal DO loop iterations in an orderly way
  • SELECT . . . CASE construct for multi-way selection
  • Portable specification of numerical precision under the user's control
  • New and enhanced intrinsic procedures.

Obsolescence and deletions

Unlike the previous revision, Fortran 90 did not delete any features. (Appendix B.1 says, "The list of deleted features in this standard is empty.") Any standard-conforming FORTRAN 77 program is also standard-conforming under Fortran 90, and either standard should be usable to define its behavior.
A small set of features were identified as "obsolescent" and expected to be removed in a future standard.
Obsolescent feature Example Status / Fate in Fortran 95
Arithmetic IF-statement     IF (X) 10, 20, 30
Non-integer DO parameters or control variables     DO 9 X= 1.7, 1.6, -0.1 Deleted
Shared DO-loop termination or
termination with a statement
other than END DO or CONTINUE  
    DO 9 J= 1, 10         DO 9 K= 1, 10
9   L= J + K


Branching to END IF
from outside a block
66  GO TO 77 ; . . .     IF (E) THEN ;     . . .
77  END IF

Deleted
Alternate return     CALL SUBR( X, Y *100, *200 )
PAUSE statement     PAUSE 600 Deleted
ASSIGN statement
  and assigned GO TO statement
100  . . .     ASSIGN 100 TO H
    . . .
    GO TO H . . .

Deleted
Assigned FORMAT specifiers     ASSIGN F TO 606 Deleted
H edit descriptors 606 FORMAT ( 9H1GOODBYE. ) Deleted
Computed GO TO statement     GO TO (10, 20, 30, 40), index (obsolete)
Statement functions     FOIL( X, Y )= X**2 + 2*X*Y + Y**2 (obsolete)
DATA statements
  among executable statements
    X= 27.3     DATA A, B, C / 5.0, 12.0. 13.0 /     . . .
(obsolete)
CHARACTER* form of CHARACTER declaration     CHARACTER*8 STRING   ! Use CHARACTER(8) (obsolete)
Assumed character length functions     CHARACTER*(*) STRING (obsolete)[14]
Fixed form source code Column 1 contains *, ! or C for comments.
Column 6 for continuation.

"Hello world" example

program helloworld
     print *, "Hello, world."
end program helloworld

FORTRAN 77

After the release of the FORTRAN 66 standard, compiler vendors introduced a number of extensions to "Standard Fortran", prompting ANSI committee X3J3 in 1969 to begin work on revising the 1966 standard, under sponsorship of CBEMA, the Computer Business Equipment Manufacturers Association (formerly BEMA). Final drafts of this revised standard circulated in 1977, leading to formal approval of the new FORTRAN standard in April 1978. The new standard, known as FORTRAN 77 and officially denoted X3.9-1978, added a number of significant features to address many of the shortcomings of FORTRAN 66:

  • Block IF and END IF statements, with optional ELSE and ELSE IF clauses, to provide improved language support for structured programming
  • DO loop extensions, including parameter expressions, negative increments, and zero trip counts
  • OPEN, CLOSE, and INQUIRE statements for improved I/O capability
  • Direct-access file I/O
  • IMPLICIT statement
  • CHARACTER data type, with vastly expanded facilities for character input and output and processing of character-based data
  • PARAMETER statement for specifying constants
  • SAVE statement for persistent local variables
  • Generic names for intrinsic functions
  • A set of intrinsics (LGE, LGT, LLE, LLT) for lexical comparison of strings, based upon the ASCII collating sequence. (These ASCII functions were demanded by the U.S. Department of Defense, in their conditional approval vote.[citation needed])
In this revision of the standard, a number of features were removed or altered in a manner that might invalidate previously standard-conforming programs. (Removal was the only allowable alternative to X3J3 at that time, since the concept of "deprecation" was not yet available for ANSI standards.) While most of the 24 items in the conflict list (see Appendix A2 of X3.9-1978) addressed loopholes or pathological cases permitted by the previous standard but rarely used, a small number of specific capabilities were deliberately removed, such as:
GREET = 12HHELLO THERE!
  • Reading into an H edit (Hollerith field) descriptor in a FORMAT specification.
  • Overindexing of array bounds by subscripts.
DIMENSION A(10,5)
Y= A(11,1)
  • Transfer of control out of and back into the range of a DO loop (also known as "Extended Range").

Variants: Minnesota FORTRAN

Control Data Corporation computers had another version of FORTRAN 77, called Minnesota FORTRAN (MNF), designed especially for student use, with variations in output constructs, special uses of COMMONs and DATA statements, optimizations code levels for compiling, and detailed error listings, extensive warning messages, and debugs.[11]

Transition to ANSI Standard Fortran

The development of a revised standard to succeed FORTRAN 77 would be repeatedly delayed as the standardization process struggled to keep up with rapid changes in computing and programming practice. In the meantime, as the "Standard FORTRAN" for nearly fifteen years, FORTRAN 77 would become the historically most important dialect.
An important practical extension to FORTRAN 77 was the release of MIL-STD-1753 in 1978.[12] This specification, developed by the U.S. Department of Defense, standardized a number of features implemented by most FORTRAN 77 compilers but not included in the ANSI FORTRAN 77 standard. These features would eventually be incorporated into the Fortran 90 standard.
The IEEE 1003.9 POSIX Standard, released in 1991, provided a simple means for FORTRAN 77 programmers to issue POSIX system calls.[13] Over 100 calls were defined in the document — allowing access to POSIX-compatible process control, signal handling, file system control, device control, procedure pointing, and stream I/O in a portable manner.

FORTRAN IV and FORTRAN 66


Starting in 1961, as a result of customer demands, IBM began development of a FORTRAN IV that removed the machine-dependent features of FORTRAN II (such as READ INPUT TAPE), while adding new features such as a LOGICAL data type, logical Boolean expressions and the logical IF statement as an alternative to the arithmetic IF statement. FORTRAN IV was eventually released in 1962, first for the IBM 7030 ("Stretch") computer, followed by versions for the IBM 7090 and IBM 7094.
By 1965, FORTRAN IV was supposed to be compliant with the "standard" being developed by the American Standards Association X3.4.3 FORTRAN Working Group.[10]
At about this time FORTRAN IV had started to become an important educational tool and implementations such as Waterloo University's WATFOR and WATFIV were created to simplify the complex compile and link processes of earlier compilers.

FORTRAN 66

Perhaps the most significant development in the early history of FORTRAN was the decision by the American Standards Association (now ANSI) to form a committee sponsored by BEMA, the Business Equipment Manufacturers Association, to develop an "American Standard Fortran." The resulting two standards, approved in March 1966, defined two languages, FORTRAN (based on FORTRAN IV, which had served as a de facto standard), and Basic FORTRAN (based on FORTRAN II, but stripped of its machine-dependent features). The FORTRAN defined by the first standard, officially denoted X3.9-1966, became known as FORTRAN 66 (although many continued to refer to it as FORTRAN IV, the language upon which the standard was largely based). FORTRAN 66 effectively became the first "industry-standard" version of FORTRAN. FORTRAN 66 included:
  • Main program, SUBROUTINE, FUNCTION, and BLOCK DATA program units
  • INTEGER, REAL, DOUBLE PRECISION, COMPLEX, and LOGICAL data types
  • COMMON, DIMENSION, and EQUIVALENCE statements
  • DATA statement for specifying initial values
  • Intrinsic and EXTERNAL (e.g., library) functions
  • Assignment statement
  • GOTO, assigned GOTO, and computed GOTO statements
  • Logical IF and arithmetic (three-way) IF statements
  • DO loops
  • READ, WRITE, BACKSPACE, REWIND, and ENDFILE statements for sequential I/O
  • FORMAT statement
  • CALL, RETURN, PAUSE, and STOP statements
  • Hollerith constants in DATA and FORMAT statements, and as actual arguments to procedures
  • Identifiers of up to six characters in length
  • Comment lines

FORTRAN II

IBM's FORTRAN II appeared in 1958. The main enhancement was to support procedural programming by allowing user-written subroutines and functions which returned values, with parameters passed by reference. The COMMON statement provided a way for subroutines to access common (or global) variables. Six new statements were introduced:

  • SUBROUTINE, FUNCTION, and END
  • CALL and RETURN
  • COMMON
Over the next few years, FORTRAN II would also add support for the DOUBLE PRECISION and COMPLEX data types.
Early FORTRAN compilers did not support recursion in subroutines. Early computer architectures did not support the concept of a stack, and when they did directly support subroutine calls, the return location was often stored in a single fixed location adjacent to the subroutine code, which does not permit a subroutine to be called again before a previous call of the subroutine has returned. Although not specified in Fortran 77, many F77 compilers supported recursion as an option, while it became a standard in Fortran 90.[8]

Simple FORTRAN II program

This program, for Heron's formula, reads one data card containing three 5-digit integers A, B, and C as input. If A, B, and C cannot represent the sides of a triangle in plane geometry, then the program's execution will end with an error code of "STOP 1". Otherwise, an output line will be printed showing the input values for A, B, and C, followed by the computed AREA of the triangle as a floating-point number with 2 digits after the decimal point.
C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION
C INPUT - CARD READER UNIT 5, INTEGER INPUT
C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT
C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING
      READ INPUT TAPE 5, 501, IA, IB, IC
  501 FORMAT (3I5)
C IA, IB, AND IC MAY NOT BE NEGATIVE
C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE
C IS GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO
      IF (IA) 777, 777, 701
  701 IF (IB) 777, 777, 702
  702 IF (IC) 777, 777, 703
  703 IF (IA+IB-IC) 777,777,704
  704 IF (IA+IC-IB) 777,777,705
  705 IF (IB+IC-IA) 777,777,799
  777 STOP 1
C USING HERON'S FORMULA WE CALCULATE THE
C AREA OF THE TRIANGLE
  799 S = FLOATF (IA + IB + IC) / 2.0
      AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) *
     +     (S - FLOATF(IC)))
      WRITE OUTPUT TAPE 6, 601, IA, IB, IC, AREA
  601 FORMAT (4H A= ,I5,5H  B= ,I5,5H  C= ,I5,8H  AREA= ,F10.2,
     +        13H SQUARE UNITS)
      STOP
      END

FORTRAN III

A FORTRAN coding form, printed on paper and intended to be used by programmers to prepare programs for punching onto cards by keypunch operators. Now obsolete.
IBM also developed a FORTRAN III in 1958 that allowed for inline assembler code among other features; however, this version was never released as a product. Like the 704 FORTRAN and FORTRAN II, FORTRAN III included machine-dependent features that made code written in it unportable from machine to machine. Early versions of FORTRAN provided by other vendors suffered from the same disadvantage.

IBM 1401 FORTRAN

FORTRAN was provided for the IBM 1401 by an innovative 63-pass compiler that ran in only 8k of core. It kept the program in memory and loaded overlays that gradually transformed it, in place, into executable form, as described by Haines et al.[9] The executable form was not machine language; rather it was interpreted, anticipating UCSD Pascal P-code by two decades.

Fortran statements

The initial release of FORTRAN for the IBM 704 contained 32 statements, including:
  • DIMENSION and EQUIVALENCE statements
  • Assignment statements
  • Three-way arithmetic IF statement, which passed control to one of three locations in the program depending on whether or not the result of the arithmetic statement was positive, zero, or negative
  • IF statements for checking exceptions (ACCUMULATOR OVERFLOW, QUOTIENT OVERFLOW, and DIVIDE CHECK); and IF statements for manipulating sense switches and sense lights
  • GOTO, computed GOTO, ASSIGN, and assigned GOTO
  • DO loops
  • Formatted I/O: FORMAT, READ, READ INPUT TAPE, WRITE, WRITE OUTPUT TAPE, PRINT, and PUNCH
  • Unformatted I/O: READ TAPE, READ DRUM, WRITE TAPE, and WRITE DRUM
  • Other I/O: END FILE, REWIND, and BACKSPACE
  • PAUSE, STOP, and CONTINUE
  • FREQUENCY statement (for providing optimization hints to the compiler).
The arithmetic IF statement was similar to a three-way branch instruction on the IBM 704. However, the 704 branch instructions all contained only one destination address (e.g., TZE — Transfer AC Zero, TNZ — Transfer AC Not Zero, TPL — Transfer AC Plus, TMI — Transfer AC Minus). The machine (and its successors in the 700/7000 series) did have a three-way skip instruction (CAS — Compare AC with Storage), but using this instruction to implement the IF would consume 4 instruction words, require the constant Zero in a word of storage, and take 3 machine cycles to execute; using the Transfer instructions to implement the IF could be done in 1 to 3 instruction words, required no constants in storage, and take 1 to 3 machine cycles to execute. An optimizing compiler like FORTRAN would most likely select the more compact and usually faster Transfers instead of the Compare (use of Transfers also allowed the FREQUENCY statement to optimize IFs, which could not be done using the Compare). Also the Compare considered −0 and +0 to be different values while the Transfer Zero and Transfer Not Zero considered them to be the same.
The FREQUENCY statement in FORTRAN was used originally and optionally to give branch probabilities for the three branch cases of the Arithmetic IF statement to bias the way code was generated and order of the basic blocks of code generated, in the global optimisation sense, were arranged in memory for optimality. The first FORTRAN compiler used this weighting to do a Monte Carlo simulation of the run-time generated code at compile time. It was very sophisticated for its time. This technique is documented in the original article in 1957 on the first FORTRAN compiler implementation by J. Backus et al. Many years later, the FREQUENCY statement had no effect on the code, and was treated as a comment statement, since the compilers no longer did this kind of compile-time simulation.
Below is a part of the 1957 paper, "The FORTRAN Automatic Coding System" by Backus et al., with this snippet on the FREQUENCY statement and its use in a compile-time Monte Carlo simulation of the run-time to optimise the code generated. Quoting …
The fundamental unit of program is the basic block; a basic block is a stretch of program which has a single entry point and a single exit point. The purpose of section 4 is to prepare for section 5 a table of predecessors (PRED table) which enumerates the basic blocks and lists for every basic block each of the basic blocks which can be its immediate predecessor in flow, together with the absolute frequency of each such basic block link. This table is obtained by an actual "execution" of the program in Monte-Carlo fashion, in which the outcome of conditional transfers arising out of IF-type statements and computed GO TO'S is determined by a random number generator suitably weighted according to whatever FREQUENCY statements have been provided.

Fortran

Fortran (previously FORTRAN) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing. Originally developed by IBM at their campus in south San Jose, California[1] in the 1950s for scientific and engineering applications, Fortran came to dominate this area of programming early on and has been in continual use for over half a century in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, computational physics and computational chemistry. It is one of the most popular languages in the area of high-performance computing [2] and is the language used for programs that benchmark and rank the world's fastest supercomputers.
Fortran (the name is a blend derived from The IBM Mathematical Formula Translating System) encompasses a lineage of versions, each of which evolved to add extensions to the language while usually retaining compatibility with previous versions. Successive versions have added support for structured programming and processing of character-based data (FORTRAN 77), array programming, modular programming and generic programming (Fortran 90), high performance Fortran (Fortran 95), object-oriented programming (Fortran 2003) and concurrent programming (Fortran 2008)

Capitalization

The names of earlier versions of the language through FORTRAN 77 were conventionally spelled in all-caps (FORTRAN 77 was the version in which the use of lowercase letters in keywords was strictly nonstandard). The capitalization has been dropped in referring to newer versions beginning with Fortran 90. The official language standards now refer to the language as "Fortran". Because the capitalization was never completely consistent in actual usage, this article adopts the convention of using the all-caps FORTRAN in referring to versions of the language up to FORTRAN 77 and the title-caps Fortran in referring to versions of the language from Fortran 90 onward. This convention is reflected in the capitalization of FORTRAN in the ANSI X3.9-1966 (FORTRAN 66) and ANSI X3.9-1978 (FORTRAN 77) standards and the title caps Fortran in the ANSI X3.198-1992 (Fortran 90), ISO/IEC 1539-1:1997 (Fortran 95) and ISO/IEC 1539-1:2004 (Fortran 2003) standards.

History

In late 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more practical alternative to assembly language for programming their IBM 704 mainframe computer. Backus' historic FORTRAN team consisted of programmers Richard Goldberg, Sheldon F. Best, Harlan Herrick, Peter Sheridan, Roy Nutt, Robert Nelson, Irving Ziller, Lois Haibt, and David Sayre.[3] Its concepts included easier entry of equations into a computer, an idea developed by J. Halcombe Laning and demonstrated in his GEORGE compiler of 1952.[4]
A draft specification for The IBM Mathematical Formula Translating System was completed by mid-1954. The first manual for FORTRAN appeared in October 1956, with the first FORTRAN compiler delivered in April 1957. This was the first optimizing compiler, because customers were reluctant to use a high-level programming language unless its compiler could generate code whose performance was comparable to that of hand-coded assembly language.[5]
While the community was skeptical that this new method could possibly outperform hand-coding, it reduced the number of programming statements necessary to operate a machine by a factor of 20, and quickly gained acceptance. John Backus said during a 1979 interview with Think, the IBM employee magazine, "Much of my work has come from being lazy. I didn't like writing programs, and so, when I was working on the IBM 701, writing programs for computing missile trajectories, I started work on a programming system to make it easier to write programs."[6]
The language was widely adopted by scientists for writing numerically intensive programs, which encouraged compiler writers to produce compilers that could generate faster and more efficient code. The inclusion of a complex number data type in the language made Fortran especially suited to technical applications such as electrical engineering.
By 1960, versions of FORTRAN were available for the IBM 709, 650, 1620, and 7090 computers. Significantly, the increasing popularity of FORTRAN spurred competing computer manufacturers to provide FORTRAN compilers for their machines, so that by 1963 over 40 FORTRAN compilers existed. For these reasons, FORTRAN is considered to be the first widely used programming language supported across a variety of computer architectures.
The development of FORTRAN paralleled the early evolution of compiler technology, and many advances in the theory and design of compilers were specifically motivated by the need to generate efficient code for FORTRAN programs.

Methods of urine collection

Objectives of Urine collection:
        To obtain laboratory results that provides prevalence estimate of disease, risk factor for exam components and bone line information on health and nutritional status of the population.
Collection technique of urine:
1.Natural micturation.
2.Manual compression of bladder.
3.Catheterization.
4.cystocentesis.

Micturation

Definition of micturation:
It is a process by which urine is evacuated from urinary bladder.

Mechanism of micturation:
Sympathetic nerve

Stretching of transitional epithelium

Urine

Increase pressure 30mmhg

Activation of stress recsptors

Sensory nerve

Brain

Parasympathetic motor nerve

Acetylcholine

Contraction of bladder muscle

Relaxation of spincters

Micturation



Contradiction of normal micturation :
When we have to urinate frequently the condition is called polyuria.When we are up frequently during the night the condition is called nocturnal polyuria or nocturia.
Frequent urination can cause problems at work and socializing.The constant fear of use the bathroom can effect one everyday life and happiness and nocturia can cause many sleepless night.
Nocturia increases risk of death.

Abnormal micturation:
Interruption of afferent nerves:
Tabes dorsali's interruption of dorsal roots - reflex construction of the bladder lost - distended, them and hypotonic  - there are some contraction due to intrinsic response in the muscle.
Interruption of both afferent and efferent:
Tumors - Bladder is flacid and distended - shrunken and pertrophied.

Frequent urination indicates:
     1.Infection in bladder.
      2.Infection in urethra.
      3.Infection in kidney.
      4.Bladder stones.
      5.Diabetes.
      6.Tumor in pelvis.
      7.Bladder cancer.
      8.Sign of stroke.


Manual compression of the urinary bladder:
Introduction:
 Manual compression of the bladder can be used to indicate urination in dogs and cats. Application of steady gentle pressure should result in relaxation of urethral sphincter and flow of urine, provided there is adequate urine in the bladder and patent outflow tract.
Procedure:
1) Identify the bladder in the caudal abdomen by palpation.
2) Apply moderate digital pressure to either side of the bladder as possible with fingers and thumb of one hand on with the fingers of both hands and gradually increase pressure until the urine is voided.
3) Collected the urine in a sterile universal container.
Advantages:
This method is often used in patients unable to urinate such as neurological and spinal patients.
It is a quick and easy method in animals.
Provides method for obtaining urine sample when voluntary micturation has occurred.
The risk of iatrogenic urinary tract infection and iatrogenic trauma is minimal.
Disadvantages:
The urinary bladder may traumatized if excessive digital pressure is used. This is not only detrimental to the patient, the associated hematuria may interfere with interpretation is result.
The urinary bladder may not contain a sufficient volume of urine to facilitate this technique.
Samples are frequently contaminated with cells, bacteria and other debris located in the genital tract or on the skin and hair.
Precautions:
Care must not be taken to avoid the rupturing the thin walled bladder particularly as urethral obstruction may be present in animal that present in stranguria or hematuria.
Try to direct the force towards the of the urinary bladder.
Steady continous pressure should be applied rather than forceful intermittent squeezing motions.
Obtain appropriate information to be sure that complete obstraction of the urethra does not exist.
Note:
 If the animal does not urinate during manual expression be ready to collect a voided sample because many animal in this situation will urinate soon after being returned to their house.





Catheterization

Indication:
Diagnostic catheterization may be indicated to :
Collect bladder urine for analysis or bacterial culture.
Determine the volume of residual urine in patients with suspected neurogenic inconfinence.
For renal functions studies.
Evaluate the lumen for calculi, strictures.
Instill constant media for constant radiography.

Therapeutic catheterization may be indicated to:
Instill the medications into the urinary bladder.
Relieve obstruction to urine flow.
Facilitate the surgical repair of the urethra or surrounding structures.

Types of catheter:
Rigid metal canine female urethral catheter.
Folsy self-retaining catheter with valve.
Canine flexible urethral catheter.
Olive tip human urethral catheter.
Blasucci human urethral catheter with flexible filiform tip.
Blasucci tip human urethral catheter.
Right metal lacrimal cannula.
Silver abscess cannula.
Tomcat catheter.
Open end tomcat catheter.
Intradermic polyethylene tubing with one end flared.

Care of urinary catheter:
Only sterilized catheters that are in excellent condition should be used. Weakened rough external surface should be avoided.
Catheters should be individually packaged prior to use.
Non-sterilized catheter should never be used because they may cause introgenic infection & contaminate the urine.
Catheter must be sterilized by autoclaving and by using
Ethylene oxide (best)
Quaternary ammonium compounds.



Potential complications:
Trauma :
Trauma to the urinary tract avoided by selection of smooth flexible catheters and a good technique.
Haematuria indicates poor equipment or technique’
Trauma leads to bacterial infection that damage the body defensive mechanism.

Infections:
A resident population of bacteria (mainly streptococci & staphylococci) and mycoplasma are normally present in the urethra.
By systemic natural defense mechanisms of kidneys, ureters & urinary bladder prevent the urinary tract infections in normal animal.
Preventable causes of bacterial infections of the urinary bladder associated with catheterization include:
Inadequate cleansing of the peri-urethral tissues.
Use of non-sterilized equipment.
Catheter induced trauma to the mucosa of ureter &   bladder.
When necessary for diagnostic or therapeutic purposes, carefully executed catheterization of the urinary bladder should be performed without hesitation.
Reduce the incidence of introgenic infection by :
Avoiding indiscriminate use of the technique.
Allowing only properly trained personnel to perform the procedure.
Irritation of the bladder with antibacterial solutions (neomycin, furacin, polymyxin etc.

Use of catheters impregnated with antibacterial agents designated for man.



Equipments of catheterization:
Sterile gloves - consider universal precautions
Sterile drapes
Cleansing solution e.g. Savlon
Cotton swabs
Forceps
Sterile water
Foley catheter
Syringe
Lubricant
Collection bag and tubing.



Procedure:
Steps are to…….
Gather equipment.
Open catheterization kit and catheter
Prepare sterile field, apply sterile gloves
Check balloon for patency.
Generously coat the distal portion (2-5 cm) of the catheter with lubricant
Apply sterile drape
If female, separate labia using non-dominant hand. If male, hold the penis with the non-dominant hand. Maintain hand position until preparing to inflate balloon.
Using dominant hand to handle forceps, cleanse peri-urethral mucosa with cleansing solution. Cleanse anterior to posterior, inner to outer, one swipe per swab, discard swab away from sterile field.
Pick up catheter with gloved (and still sterile) dominant hand. Hold end of catheter loosely coiled in palm of dominant hand.
In the male, lift the penis to a position perpendicular to patient's body and apply light upward traction (with non-dominant hand)
Identify the urinary meatus and gently insert until 1 to 2 inches beyond where urine is noted
Inflate balloon, using correct amount of sterile liquid (usually 10 cc but check actual balloon size)
Gently pull catheter until inflation balloon is snug against bladder neck
Connect catheter to drainage system
Secure catheter to abdomen or thigh, without tension on tubing
Place drainage bag below level of bladder
Evaluate catheter function and amount, color, odor, and quality of urine
Remove gloves, dispose of equipment appropriately, wash hands
Document size of catheter inserted, amount of water in balloon, patient's response to procedure, and assessment of urine


Cystosentesis
Cystocentesis:
Cystocentesis is a urinary procedure where a needle is placed into the urinary bladder through the abdomen of a animal and a sample of urine is removed. Diagnostic cystocentesis is used to present sample taken  for urinalysis from being contaminated with bacteria, cells and debris from lower urogenital tract.
Symptoms of cystocentesis:
       ~Duffuculty urinating.
       ~Urinating out of the litter box.
       ~Painfull urination.
      ~Blood in the urine.
      ~Reduced playfulness.
Indication:
~Routine collection of urine samples for urinalysis or urine culture.
~Immediate relief of bladder over distention in animals with urethral obstruction.
Contradiction:
~Coagulopathy.
~Pregnancy.
~Confirmed transitional cell carcinoma.
~Severe and diffuse cutaneous disease of abdomen.
Potential complication
~Seeding of transitional cell carcinoma and tumor cells into the abdomen or along the needle track.
~Transient hematuria.
~Bladder rupture.



EQUIPMENTS:
1) We routinely  use 22-gauge needles. Depending on  the size  of the patient  and the distance  of the ventral bladder  wall  from the  ventral  abdominal wall .1.5 inches hypodermic  or 3 inches  spinal needles  may be needed.
2) Small capacity  (2.5 to 12ml) syringes are usually employed for diagnostic  cystocentesis, while large  capacity(20-60 ml)syringes are used  for therapeutic  cystocentesis . Alternatively, therapeutic  cystocentesis  may be performed  with  6-12 ml syringes  and a  2-way or 3-way valve.
SITE:
1) Careful planning  of the  site and  direction  of  needle  puncture  of  the  bladder   wall is recommended. The needle  is inserted  in the  ventral  or  ventro-lateral  wall of the urinary bladder,in order to minimize the  chance  of  trauma  to  the  ureters  and  major  abdominal  vessels.
2) If therapeutic cystocentesis  is  to be  performed, recommended  insertion  of  the  needle a short  distance  cranial  to  the  of  the bladder with the  urethra rather than at  the  vertex  of  the bladder. This  will  permit  removal  of  urine  and  decompression  of  the  bladder  without  need  for  re-insertion  of  the  needle  into  the  bladder  needle.
3) The  needle  will be  directed  through  the  bladder  wall at  approximately  at  45 degree  angle so that oblique  needle  tract  will  be  created.
TECHNIQUE:
1) In order  to  perform  cystocentesis  without  risk  to  the  patient  deliberate planning  of  the  site  and  direction  of  the  needle  puncture  is  essential.The  bladder  must  contain  a  sufficient  volume  of  urine  to permite  immobilization  and  localization  by  palpation. Excessive   hair should be removed with scissors or clippers. The  ventral  abdominal skin  penetrated  by  the  needle  should  be  cleansed  with  an  antiseptic  solution   each time  cystocentesis  is performed.
2)In case   of cat, it is  usually  easier  to  perform  the  procedure  with  the  patient   in  lateral  or dorsal  recumbency.
3)In dogs, the procedure  may be  performed when  the  patient is  standing.
4)Following  localization  and   immobilization  of  the  urinary  bladder  the  needle  should  ne  inserted  through  the  ventral  abdominal  wall  and  advanced to  the  caudo-ventral aspect  of the  bladder. The needle should  be  inserted  through  the  bladder  wall at an  oblique  angle.
5.excessive digital pressure should not be applied to the bladder wall while the needle is in its lumen in order to prevent urine from being forced around the needle into the peritoneal cavity.
6. An appropriate quantity of urine for analysis of analysis and/or bacterial culture should be aspirated into the syringe. If disease of the bladder wall or virulence of urine pathogens is a likely cause of complications associated with loss of urine into the peritoneal cavity, the bladder should be emptied as completely as is consistent with atraumatic technique. These potenytial complications have not been a problem in patients.
7. Use of a prophylactic antibacterial therapy following cystocentesis must be determined on the basis of the status of the patient and retrospective evaluation of technique.
8. In order to minimize contamination of the peritoneal cavity with urine , unnecessary digital pressure should not be applied to the urinary bladder following cystocentesis.
9. In case of rabbit,
        a) Restrain and position  the rabbit since excellent restraint is critical if the rabbit is conscious. So, have the rabbit restrained in dorsal recumbency.
       b) Locate the bladder by pulpating just cranial to the pelvic brim on the ventral midline.
       c) Assess the bladder volume.
d) Clip the fur.
e) Disinfect the skin.
f) Isolate the bladder.
g) Direct a small needle attached to a syringe into the bladder.
h) Retract the syringe plunger slowly.
i) Transfer the urine sample to an appropriate container.

Precaution:
-In most domestic rabbit there is no need for sedation. However sedation for anaesthesia will prevent the rabbit for struggling and reduce the rise of damage to the internal structures.
- Repeated puncture of the bladder can result in inflammation and subsequent stone formation.
- Precaution should be taken to avoid introgenic trauma/infection of urinary bladder and surrounding.

-potential complications include damage to the bladder wall or adjacent structures with the needle, local or generalized peritonitis, vesicoperitoneal fistulas and adhesion of adjacent structures to the bladder wall.
- penetration of loop of intestine by the needle may result in false positive significant bacteriurea and varying degrees of microscopic hematuria might be expected for a short period of time following cystocentesis.






Wednesday, January 2, 2013

Matrix multiplication by subroutine subprogram



Find the multiplication of any of the matrix with (3 by 3) dimension by applying subroutine subprogram
Solution:
       SUBROUTINE AL(A,B,C,M,N,L)
       DIMENSION A(M,N),B(M,N),C(M,N)
       DO I=1,M
       DO J=1,N
       C(I,J)=0.0
       Do k = 1,L
       C(I,J)=C(I,J)+A(I,L)*B(L,J)
       ENDDO
       ENDDO
       ENDDO
       RETURN
       END
       DIMENSION A(3,3),B(3,3),C(3,3)
       PRINT*, 'ENTER THE VALUE OF MATRIX A'
       DO I=1,3
       DO J=1,3
       READ*, A(I,J)
       ENDDO
       ENDDO
       PRINT*, 'ENTER THE VALUE OF MATRIX B'
       DO I=1,3
       DO J=1,3
       READ*, B(I,J)
       ENDDO
       ENDDO
       CALL AL(W,Q,E,3,3,3)
       PRINT*, C(1,1),'   ',C(1,2),'   ',C(1,3)
       PRINT*, C(2,1),'   ',C(2,2),'   ',C(2,3)
       PRINT*, C(3,1),'   ',C(3,2),'   ',C(3,3)
       END
      

subroutine



Given that length is 24 and height is 15. Then do the following operation by subroutine subprogram.
Solution:
       Real L,H
        Do k = 1,4
        Write(*,*) 'Enter the values of H and L'
        Read(*,*) H , L
        Call MAK(H,L,V,A)
         Write(*,*) '  H     L        V        A'
         Write(*,*) H,L,V,A
                 End do
          End
        subroutine  MAK(H,L,V,A)
             Pi=3.1416
        q=(L**2+4*h**2)/(8*H)
        w=H/3
        V=pi*H**2*(q-w)
        A=(Pi*(2*H**2+L**2))/2
        Return
        End