Welcome, Guest
Username: Password: Remember me

TOPIC: How to use two fortran files together for the decay rate.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33884

  • SHUO
  • SHUO's Avatar
Hello~everyone

I am studying the degradation of E.coli with the help of TELEMAC.
I have simulated the flow of the E.coli in the canal without the decay rate and now I wanna use the fortran files:source_trac.f to add a decay rate,but i have already used t3d_heat_exchange.f. So i don't know how to add two fortran files.

In my case, the tracer 2 is the E.coli, so i edit the codes below in the source_trac.f.
INTEGER IPOIN3, IPOIN2, IPLAN
DOUBLE PRECISION DECAYDAY,DECAYRATE
DO ITRAC=1,NTRAC
S0TA%ADR(ITRAC)%P%TYPR='0'
S1TA%ADR(ITRAC)%P%TYPR='0'
ENDDO
DECAYDAY = D0
DECAYRATE = 0.9D0

UNIFORM DECAY RATE FOR TRACER NUMBER 2 (%ADR(2)) -
IF(NTRAC.GE.2) THEN

S0TA%ADR(2)%P%TYPR='Q'
S1TA%ADR(2)%P%TYPR='Q'
DO IPOIN3 = 1,NPOIN3
S0TA%ADR(2)%P%R(IPOIN3) = TA%ADR(2)%P%R(IPOIN3) *
& DLOG( 1.D0-DECAYRATE ) / ( DECAYDAY*24*3600.D0 ) / 2.D0
S1TA%ADR(2)%P%R(IPOIN3) =
& - DLOG( 1.D0-DECAYRATE ) / ( DECAYDAY*24*3600.D0 ) / 2.D0
ENDDO
!
ENDIF


Is that all right? And how can I use it in the t3d_heat_exchange.cas.
Thank you very much for your help. I have tried lots of times, but it didn't work.
I add all the files in the model.rar.

Regards.
Shuo
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33885

  • SHUO
  • SHUO's Avatar
Here is other files:
Attachments:
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33886

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
If you use a recent version of Telemac, you could replace the name of the fortran file in the dedicated keyword by the name of a directory (for example user_fortran) in which you just place the 2 fortran file

Hope this helps
Regards
Christophe
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33887

  • SHUO
  • SHUO's Avatar
Thank you. My versions is v2p2, dose that work?

Regards
Shuo
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33889

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
I suppose you mean v7p2 :unsure:
I think this feature was introduced after...
But in such case, just add one of the subroutine at the end of the declared fortran file...
Christophe
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33895

  • SHUO
  • SHUO's Avatar
yes, it's V7P2, sorry.

But I have two fortran files. How can I add them together?
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33896

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
look into t3d_heat_exchange.f
There is already 2 subroutines in this file...
Open source_trac.f, copy all the lines and paste them at the end of t3d_heat_exchange.f

regards
Christophe
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33897

  • SHUO
  • SHUO's Avatar
Thank you very much.
I tried it, but there are some errors with my code.

checking the executable
t3dfort.f:1101.8:

UNIFORM DECAY RATE FOR TRACER NUMBER 2 (%ADR(2)) -
1
Error: Unclassifiable statement at (1)
t3dfort.f:1107.72:

S0TA%ADR(2)%P%R(IPOIN3) = TA%ADR(2)%P%R(IPOIN3) *
1
Error: Invalid character in name at (1)
t3dfort.f:1108.7:

& DLOG( 1.D0-DECAYRATE ) / ( DECAYDAY*24*3600.D0 ) / 2.D0
1
Error: Invalid character in name at (1)

t3dfort.f:1109.72:

S1TA%ADR(2)%P%R(IPOIN3) =
1
Error: Invalid character in name at (1)
t3dfort.f:1110.7:

& - DLOG( 1.D0-DECAYRATE ) / ( DECAYDAY*24*3600.D0 ) / 2.D0
1
Error: Invalid character in name at (1)
runCAS: could not compile: t3d_heat_exchange.exe
|processExecutable: could not compile your FORTRAN (runcode=1).


I am very now with Telemac3D and I have attached the files.
Thank you very very much for your help!

Best regards.
Shuo
Attachments:
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33898

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
These errors are fortran programming error!
You didn't add C or ! at the first character of a comment line
You misplaced the continuation line mark & (should be in sixth position)
Christophe
The administrator has disabled public write access.

How to use two fortran files together for the decay rate. 5 years 4 months ago #33899

  • SHUO
  • SHUO's Avatar
Thank you for your quick reply. You are so nice!
I've edited the codes. It works.
But now it tells me:

runCAS:
|scanCAS: no value to keyword -DLOG( 1.D0-DECAYRATE ) ENDDO ! ENDIF ! !

! RETURN END
I've attached the file.

Thank you very much!
Attachments:
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.