KindFinder
Edit Page
Report
Scan day: 07 March 2018 UTC
5
Virus safety - good
Description: Fortran 90 program by Werner W. Schultz that checks for the available KIND parameters available for a given Fortran 90 or 95 compiler. It prints into a file a new Fortran program that can be compiled to write into a unit the various parameters that describe each integer/real representation.
module kind_type !--------------------------------------------------------------------! ! PROGRAM DESCRIPTION: ! Author: Werner W. Schulz ! Department of Chemistry ! University of Cambridge ! COPYRIGHT (c) 1998 WERNER W. SCHULZ ! Please read the Description further down in the program Section. !--------------------------------------------------------------------! implicit none public :: NumericModel private :: NumericInquiry ! A Type Definition for collecting KIND,PRECISION,RANGE Data ! for Integer & FloatingPoint Models type, public :: type_kind integer :: k, p, r character(len=8) :: Text end type type_kind ! Single, DoublePrecision and Integer Default Values integer, parameter, public :: & SP = kind(1.0) & ,DP = selected_real_kind( p=precision(1.0_SP)+1 ) integer, parameter, public :: ID = kind(SP) ! Parameters needed for writing NumericModel Programme character(len=*), parameter, public :: & FileName = "NumericModel" & ,ModuleName = "Fortran_Kind_Module" & ,FileExt = ".f90" integer, parameter, private :: uf=8 character(len=*), parameter, private :: emptyLine = " " contains subroutine NumericModel( f, i ) ! ARGUMENTS: type(type_kind), dimension(:), intent(in out) :: f, i ! LOCAL VARIABLES: integer :: ic & ,Nr_Int & ,Nr_Flt ! EXECUTION: Nr_Int = count( i%k>0 ) Nr_Flt = count( f%k>0 ) open( unit=uf, file=ModuleName//FileExt & ,status="replace", action="write" ) ! Write a Module with KIND Parameters for all Integer/FloatingPoint write(unit=uf,fmt="(A)") & "module " // ModuleName & ,emptyLine & ," implicit none " & ,emptyLine & ," ! This Programme was generated by a copyrighted Code." & ," ! Author: Werner W Schulz (C) 1998." & ,emptyLine & ," ! The following Parameters present all available KIND Values" & ," ! under the Compiler that generated this Module." & ,emptyLine & ," ! Integer KIND Parameters:" do ic=1,Nr_Int write(unit=uf,fmt="(A,I2)") & " integer, parameter, public :: " & // trim(i(ic)%Text) // " = ", i(ic)%k end do write(unit=uf,fmt="(A)") & emptyLine & ," ! Real/Complex KIND Parameters:" do ic=1,Nr_Flt
Size: 2048 chars
Contact Information
Email: —
Phone&Fax: —
Address: —
Extended: —
WEBSITE Info
Page title: | |
Keywords: | |
Description: | |
IP-address: | 130.75.6.189 |
WHOIS Info
NS | |
WHOIS | Status: connect |
Date | Changed: 2017-10-26T17:56:00+02:00 Changed: 2009-04-23T13:55:13+02:00 Changed: 2009-04-23T13:55:13+02:00 |