Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NEED FORTAN77 HELP

86 views
Skip to first unread message

Douglas Eagleson

unread,
Jul 16, 2022, 2:00:02 PM7/16/22
to
I wrote this code a long time ago. It takes a real number as a character string and converts it to a real composed of zeros and ones.

I am trying to formalize it and have encountered an immediate question.

statement:
CHARACTER*10 PROCESSDECIMAL
end statement

Question:
Can PROCESSDECIMAL be used as a dummy argument?

Here is the code:


XXXXXXXXXNEED HELP HERExxxxxxxx
XXXXXXXXX QUESTION. IS THE VARIABLE PROCESSDEECIMAL XXXXX
XXXXXXXXX A DUMMY ARGUMENT??XXXXXXXXXX

PROGRAM TWOCADE
CHARACTER*10 PROCESSDECIMAL
C FIX VALUS STRING?
C *10 IS LENGHT OF PROCESSDECIMAL
C PROCESSDECIMAL IS DUMMY ARGUMENT?
XXXXXXXXXXFROM FORTRAN77 REFERENCE
CHARACTER S*1
S = ''
During execution of the assignment statement, the variable S is precleared to blank, and then zero characters are moved into S, so S contains one blank; because of the declaration, the intrinsic function LEN(S) will return a length of 1. You cannot declare a size of less than 1, so this is the smallest length string variable you can get.
XXXXXXXXXXXXX
INTEGER J
REAL*4 BASETWO
PROCESSDECIMAL = '123004'
BASETWO = 0
J=6
C J IS THE LENGHT OF PROCESSDECIMAL
C
CALL CON(PROCESSDECIMAL,J,BASETWO)
WRITE(*,*) BASETWO
C BASETWO IS A REAL NUMBER OF ZEROS AND ONES.
END
SUBROUTINE CON(DSS,J,VALUE)
CHARACTER DSS*10
XXXXXXXXXXEND OF HELP SECTIONXXXXXX
REAL TEMP(10)
75 FLAG=0
FLAP=0
SIGN=1
SIGNFL=0
NEXP=0
VALUE=0
IDECFL=0
DEC=1
INUM=1
DO 77 L=1,J
IF(DSS(L:L).EQ.'E')THEN
IF(DSS(L+1:L+1).EQ.'-')NSIGN=-1
IF(DSS(L+1:L+1).EQ.'+')NSIGN=1
NEXP=NSIGN*(10*(ICHAR(DSS(L+2:L+2))-48)+(ICHAR(DSS(L+3:L+3))-48))
GOTO 80
ENDIF
IF(DSS(L:L).EQ.'.')THEN
DEC=L
IDECFL=1
GOTO 77
ENDIF
IF(DSS(L:L).EQ.'-')THEN
SIGN= -1
SIGNFL=1
GOTO 77
ENDIF
IF (DSS(L:L).EQ.'+')THEN
SIGN=1
SIGNFL=1
GOTO 77
ENDIF
TEMP(INUM)=ICHAR(DSS(L:L))-48
INUM=INUM+1
77 CONTINUE
80 CONTINUE
WRITE(*,*) INUM
IF(IDECFL.EQ.0)THEN
DEC=J+1
IF(NEXP.NE.0)DEC=DEC-4
ENDIF
IF(SIGNFL.EQ.1)DEC=DEC-1
INUM=INUM-1
C BIG PLACE 10 POWER FUNCTION TO SMALL VALUE POWER
C SO WHAT GIVES??!!aBSTRACT FUNCTION TRANSFORM THEORY HERE!!!!!!!!
C "0*10**X" ADDS ZERO AT POWER X REAL LOCATION. HERE
C HERE X=((DEC-1)-M) ADDING ZERO MEANS SOMETHING
DO 78 M=1,INUM
VALUE=VALUE+(TEMP(M)*10**((DEC-1)-M))
C
78 CONTINUE
VALUE=VALUE*(10**NEXP)*SIGN
C HERE (10**NEXP)=1 FOR NON 'E' STRINGS. E=0
C the mantissa is abstract. The valuated exponential
C with NEXP=0 is ONE! One origin power.
RETURN
END

Rich

unread,
Jul 16, 2022, 10:25:28 PM7/16/22
to
Douglas Eagleson <eagleso...@gmail.com> wrote:

You might have better luck asking in comp.lang.fortran rather than
sci.crypt.

Douglas Eagleson

unread,
Jul 17, 2022, 12:47:44 AM7/17/22
to
ok thanks

Douglas Eagleson

unread,
Jul 17, 2022, 10:27:06 PM7/17/22
to
I forgot to mention. If I get it working it might take both real and integer inputs.
On formalization I hope to state the exact output form. It might be twos-complement.
The goal, functions of bit sets. Surpassing functions of binary words.

Rich

unread,
Jul 18, 2022, 5:37:22 PM7/18/22
to
I had one fortran class circa 1988 - have not written any fortran since.

Much of the cryptography code that gets posted here has been in one of
C, Python, a bit in Tcl from myself, some bc, and of course the Ada
mess that one poster pontificates upon as "unbreakable".

But I can't recall seeing anyone post any fortran.

So, again, you will probably get better help in comp.lang.fortran
(where fortran should clearly be discussed) than in sci.crypt.

MM

unread,
Jul 19, 2022, 1:14:39 PM7/19/22
to
On Monday, 18 July 2022 at 22:37:22 UTC+1, Rich wrote:
> But I can't recall seeing anyone post any fortran.

I speak a bit still. Once this heatwave is over, I can take a look.

M
--

Richard Heathfield

unread,
Jul 19, 2022, 3:18:10 PM7/19/22
to
I thought you guys were dead. Or scuba-diving in the Maldives or
whatever.


--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Douglas Eagleson

unread,
Jul 19, 2022, 3:38:10 PM7/19/22
to
well I found a reference.
There is a way to declare a dummy argument. So I need to rewrite the
code start to maybe.

cccccccc

https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn7r/index.html

Use dummy arg.

CHARACTER PROCESSDECIMAL*(*)
PROCESSDECIMAL= '13433'
C or like PROCESSDECIMAL= '-1232E-10'
C length same as explicit assignment
J=LEN(PROCESSDECIMAL)
C J=5
cccccccc
the old version uses a length of 10 characters for processdecimal.
I simply forgot why I used 10.

Rich

unread,
Jul 19, 2022, 5:14:13 PM7/19/22
to
Richard Heathfield <r...@cpax.org.uk> wrote:
> On 19/07/2022 6:14 pm, MM wrote:
>> On Monday, 18 July 2022 at 22:37:22 UTC+1, Rich wrote:
>>> But I can't recall seeing anyone post any fortran.
>>
>> I speak a bit still. Once this heatwave is over, I can take a look.
>
> I thought you guys were dead. Or scuba-diving in the Maldives or
> whatever.

There has been nothing (besides the SPAM) posted, and responding to
SPAM is not really worthwhile.

Richard Heathfield

unread,
Jul 19, 2022, 7:11:19 PM7/19/22
to
My Christmas challenges remain un-cracked. Just sayin'...

Douglas Eagleson

unread,
Jul 19, 2022, 9:40:45 PM7/19/22
to
On Tuesday, July 19, 2022 at 5:37:22 AM UTC+8, Rich wrote:
> Douglas Eagleson <eagleso...@gmail.com> wrote:
> > On Sunday, July 17, 2022 at 12:47:44 PM UTC+8, Douglas Eagleson wrote:
> >> On Sunday, July 17, 2022 at 10:25:28 AM UTC+8, Rich wrote:
> >> > Douglas Eagleson <eagleso...@gmail.com> wrote:
> >> >
> >> > You might have better luck asking in comp.lang.fortran rather than
> >> > sci.crypt.
> >> ok thanks
> >
> > I forgot to mention. If I get it working it might take both real and
> > integer inputs. On formalization I hope to state the exact output
> > form. It might be twos-complement. The goal, functions of bit sets.
> > Surpassing functions of binary words.
> I had one fortran class circa 1988 - have not written any fortran since.
>
> Much of the cryptography code that gets posted here has been in one of
> C, Python, a bit in Tcl from myself, some bc, and of course the Ada
> mess that one poster pontificates upon as "unbreakable".
>
> But I can't recall seeing anyone post any fortran.
>
> So, again, you will probably get better help in comp.lang.fortran
> (where fortran should clearly be discussed) than in sci.crypt.
I took the s-box out of DES and wrote it in java. It is called MODDES
on the Hobbs archive.

a simple command line program is easier to secure than
user interface apps. I simply like Fortran. with DOSBOX
it runs on a secure RASPBERRY Pi computer.

I will be learning python soon and do not deny its
utility.

As I get further into formalization I will be asking about
proper IF statement nesting. this i will send to the correct
newsgroup.

Douglas Eagleson

unread,
Jul 31, 2022, 3:13:04 PM7/31/22
to
my memory really failed me. I got it running. it still needs debugging. ugh.
it is experimental. The brain noodle works slow.

It is written back when I was studying the complex plane. I wanted to
recast functional variables to 1 plus a mantissa. All variables to be
between one and minus one? Like?

how to map one to an infinity? a pragmatic approach is to simply
pick a number that is large in the function solution space.
Sort of like using the maximum size of the fortran real number as one?

I am bad at mathematics. I learned my lesson in a number theory classroom>
I am not claiming any thing, just stating a personal goal.


Max

unread,
Aug 2, 2022, 3:32:16 PM8/2/22
to
On 31.07.22 21:13, Douglas Eagleson wrote:

[snip]

>
> It is written back when I was studying the complex plane. I wanted to
> recast functional variables to 1 plus a mantissa. All variables to be
> between one and minus one? Like?
>
> how to map one to an infinity? a pragmatic approach is to simply
> pick a number that is large in the function solution space.
> Sort of like using the maximum size of the fortran real number as one?
>
> I am bad at mathematics. I learned my lesson in a number theory classroom>
> I am not claiming any thing, just stating a personal goal.
>
>

If I get you right, you want to map the reals to a closed range (say
[-1; +1]). If so, you might want to take a look at the sigmoid functions
(https://en.wikipedia.org/wiki/Sigmoid_function). They are often used in
AI stuff. I mostly came across the logistic function (1 / (1+ e**-x))
and the arctangent function. Depending on what you want to do, dividing
by the Fortran maxVal should work as well.

Richard Heathfield

unread,
Aug 2, 2022, 7:09:04 PM8/2/22
to
This might sound difficult, but of course it turns out (as does
so much when you get closer to it) to be quite easy. In C, for
example, it's just one line of code plus housekeeping

#include <math.h>

#define e 2.71828182846

double sigmoid(double n)
{
return 1.0 / (1.0 + pow(e, -n));

Chris M. Thomasson

unread,
Aug 2, 2022, 7:18:27 PM8/2/22
to
Always loved how the logistics function is related to the:

https://en.wikipedia.org/wiki/Bifurcation_diagram

Douglas Eagleson

unread,
Aug 3, 2022, 10:47:46 PM8/3/22
to
thankyou my approach needs formalizing

Douglas Eagleson

unread,
Aug 3, 2022, 10:54:03 PM8/3/22
to
thank you also

the sigmoid looks close to my codes intension.
I have to figure out why I used 10**x not e

Douglas Eagleson

unread,
Aug 3, 2022, 11:00:57 PM8/3/22
to
thanks

the Bifurcation diagram looks interesting

my goal if I remember was to have a functional solution space
that might be useful

Chris M. Thomasson

unread,
Aug 4, 2022, 12:03:22 AM8/4/22
to
Thanks. Fwiw, if you are interested and when you get some free time to
kill, check this out... A fairly decent bifurcation diagram IFS from cos
ans sin:

https://youtu.be/XKhS_nklCkE

Read my comments for the animation. I show my very simple 2d IFS.
Anybody should be able to code this up:
______________________________________________
A highly experimental #iterated function system of mine that creates
many #fractal #bifurcation diagrams locked in the unit square. Afaict,
the animation makes it appear as if everything is rotating around a
cylinder. Here is my #IFS that was used to create this animation:
______________
// px_mutation interpolates from -4...4 across each frame; 1440 here.

render frames:
_________
// angle interpolates from 0...pi2 across iterations
// px = py = 0

// Iteration:
px = sin(angle * px_mutation);
py = cos(angle * py);
______________

Plot every pixel in the ifs. Actually, I am adding color to each pixel
visited during iteration.
______________________________________________


Give it a go. :^)

Jakob Bohm

unread,
Aug 4, 2022, 2:27:27 AM8/4/22
to
exp() is in math.h too, faster and more accurate than trying to use
pow() with a a typed in truncated e value.


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S. https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark. Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

Richard Heathfield

unread,
Aug 4, 2022, 4:10:22 AM8/4/22
to
When you're right, you're right.

Douglas Eagleson

unread,
Aug 7, 2022, 7:53:10 PM8/7/22
to
On Wednesday, August 3, 2022 at 3:32:16 AM UTC+8, Max wrote:
my program evidently maybe just inputs and outputs the same value.
it is written to study algebra. It uses the basic function of twos complement
to apply to decade, tens complement, bases.

the logistic function gets me out of trouble thanks I now have (-1,+1) outputs
I would call functions of the line a 1D transform. X=f(x) where X is abstract
a set value.

I ran into an old favorite function on Wiki, the Gompertz_function. I started looking into
AI a very long time ago. I defined a system for modeling Futures market decision
making. It uses an artificial neural network. It is software implemented hardware
nets. It required a change in lifestyle to get it running, That's why I am poor.
It will work and if not it was trained wrong. Or maybe you just took the wrong day off.
Maybe if I focus on gold, gas, lithium . But definitely exclude weather related markets.

Douglas Eagleson

unread,
Sep 15, 2022, 10:30:59 PM9/15/22
to
thanks for the help so far.

I think of maybe just doing what I am told.

amplitude = 1/ (1 + f(x)) I think a logistic function (1 / (1+ e**-x))
It (e**-x) needs to be restricted to positive values. so amplitude is 0 to 1?
well it is just a quandary right now.

Gompertz curves are a class of double exponential function btw. By playing with constant values you can make a graph looking like an abstract pulse. in a time domain. With pulses at a certain time.


here are areas of interest to me some examples: of course my interest is finance market modeling. and as a class of function to make training data for neural networks. In crypto can a neural network define an algorithm? Here f(x) is a continuous function everywhere
this is the meaning of training in simulated analog inputs, No binary anywhere,


Examples of uses for Gompertz curves include:
Mobile phone uptake, where costs were initially high (so uptake was slow), followed by a period of rapid growth, followed by a slowing of uptake as saturation was reached[6]
Population in a confined space, as birth rates first increase and then slow as resource limits are reached[7]
Modelling of growth of tumors[8]
Modelling market impact in finance[9] and aggregated subnational loans dynamic.[10]
Detailing population growth in animals of prey, with regard to predator-prey relationships
Modelling bacterial cells within a population
Examining disease spread
Applications

Chris M. Thomasson

unread,
Sep 15, 2022, 10:42:03 PM9/15/22
to
On 9/15/2022 7:30 PM, Douglas Eagleson wrote:
> On Monday, August 8, 2022 at 7:53:10 AM UTC+8, Douglas Eagleson wrote:
>> On Wednesday, August 3, 2022 at 3:32:16 AM UTC+8, Max wrote:
>>> On 31.07.22 21:13, Douglas Eagleson wrote:
>>>
>>> [snip]
>>>>
>>>> It is written back when I was studying the complex plane. I wanted to
>>>> recast functional variables to 1 plus a mantissa. All variables to be
>>>> between one and minus one? Like?
[...]
> Detailing population growth in animals of prey, with regard to predator-prey relationships
> Modelling bacterial cells within a population
^^^^^^^^^^^^^^^^^^^^^^^^^^

fwiw, check this out and click around:

http://fractallife247.com/fdla/

Max

unread,
Sep 16, 2022, 8:54:11 AM9/16/22
to
On 16.09.22 04:30, Douglas Eagleson wrote:
[...]
>
> I think of maybe just doing what I am told.
>
> amplitude = 1/ (1 + f(x)) I think a logistic function (1 / (1+ e**-x))
> It (e**-x) needs to be restricted to positive values. so amplitude is 0 to 1? > well it is just a quandary right now.

Yes, the amplitude will be 0 to 1. Is that a problem? You can of course
stretch and shift it to any range you like:

(<range> / (1+ e**-x)) - <minimum>
0 new messages