Welcome, Guest
Username: Password: Remember me

TOPIC: Infiltration

Infiltration 9 years 6 months ago #17028

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I do not know how the logical unit 14 pops up here. Your local variable T2DGEO is not initialised. Anyway the true T2DGEO value is 1 so you can just send T2D_FILES(1)%LU in the arguments of find_in_sel.

Regards,

JMH
The administrator has disabled public write access.

Infiltration 9 years 6 months ago #17029

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
Thank you very much again,
I did it and now something is changed. I don't get the error anymore but now I get a segmentation fault, in particular:

...

BACK FROM CHARAC
CALLING PROSOU
_____________
runcode::main:
:
|runCode: Fail to run
|/home/hydro/Downloads/SharedFolder/Buna/Prova3/Buna3.cas_2015-05-21-16h13min33s/out_telemac2d
|~~~~~~~~~~~~~~~~~~
|Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
|
|Backtrace for this error:
|#0 0x7F2346DC45F7
|#1 0x7F2346DC4C3E
|#2 0x7F23464FFEAF
|#3 0x7F2346561CF8
|#4 0x7F2346E98D9C
|#5 0x7F2346E97572
|#6 0x589018 in lit_
|#7 0x595950 in find_in_sel_
|#8 0x402082 in prosou_
|#9 0x4CCAD5 in telemac2d_
|#10 0x4D990B in MAIN__ at homere_telemac2d.f:?
|Segmentation fault (core dumped)
|~~~~~~~~~~~~~~~~~~


Do you have any idea about the cause?

Thank you in advance,

Daniele
The administrator has disabled public write access.

Infiltration 9 years 6 months ago #17042

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
Ok the problem seems solved by adding just the terms "ALLOCATE(W(NPOIN),STAT=ERR)".
The simulations I run seem now to take into account the effect of CN. In particular I modify the code in the following way:
!
CALL BIEF_ALLVEC(1,CN,'CN ',IELM1,1,2,MESH)
ALLOCATE(W(NPOIN),STAT=ERR)
NAME='CN '
CALL FIND_IN_SEL(CN,NAME,T2D_FILES(1)%LU,
& T2D_FILES(1)%FMT ,W,OK)
DEALLOCATE(W)
!
! RAIN-EVAPORATION
!
IF(RAIN) THEN
RAIN_MPS=RAIN_MMPD/86400000.D0
SURDT=1.D0/DT
IF(BANDEC) THEN
! EVAPORATION (TENTATIVELY...) LIMITED BY AVAILABLE WATER
DO I=1,NPOIN
IF(CN%R(I).EQ.40) THEN
RAIN_MPS=-0.0000195833
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.50) THEN
RAIN_MPS=-0.0000142778
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.60) THEN
RAIN_MPS=-0.0000123056
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.65) THEN
RAIN_MPS=-0.0000116111
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.70) THEN
RAIN_MPS=-0.0000107778
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.75) THEN
RAIN_MPS=-0.0000096389
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.95) THEN
RAIN_MPS=-0.0000018889
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE IF(CN%R(I).EQ.99) THEN
RAIN_MPS=-0.0000001667
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ELSE
RAIN_MPS=-0.0000001667
PLUIE%R(I)=MAX(RAIN_MPS,-MAX(HN%R(I),0.D0)*SURDT)
ENDIF
ENDDO
ELSE
CALL OS('X=C ',X=PLUIE,C=RAIN_MPS)
ENDIF
ENDIF
My aim is to assign an infiltration value to each pixel accoriding to the soil type.
The value I set as RIAN_MPS is the one I found in literature corresponding to a saturated soil (it changes according to CN).
I attach the modified subroutine just in case someone wants to have a look at it.

Suggestions and comments are always appreciated.

Daniele




File Attachment:

File Name: prosou_2015-05-22.f
File Size: 27 KB
The administrator has disabled public write access.

Infiltration 9 years 6 months ago #17043

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Please note 2 things:

1) the condition IF(BANDEC) THEN corresponds to checking if there are tidal flats or dry zones, is it what you want ?

2) your tests IF(CN%R(I).EQ.50) THEN may not work, 50 is an integer that will be translated into a double precision value before comparison, your CN stems from a file in single precision value then transformed into a double precision value, there is a possibility that this test will never say yes. Allow some tolerance, e.g.:

IF(ABS(CN%R(I)-50.D0).LT.1.D-4) THEN...

With best regards, have a good week-end,

Jean-Michel Hervouet
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17381

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
Hello,
Unfortunately I still have problems with the code I posted..
With the adjustments I did, with the help of Jean-Michel suggestions, it works. The problem is that at each time step the RAM used by my calculator increases until it is saturated and the simulation stops.
The code is into the prosou.f (it starts from line 395).
If you have any suggestion I would be really glad.

Thank you in advance,

Daniele


File Attachment:

File Name: prosou_2015-06-19.f
File Size: 27 KB
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17383

  • jmhervouet
  • jmhervouet's Avatar
Hello,

It is because you allocate W(NPOIN) at every call. This should be done once for all or it should be deallocated before the RETURN

so at the end:

DEALLOCATE(W)
RETURN
END

or at the beginning (better because saves time):

SAVE W
LOGICAL ALREADY
DATA ALREADY/.FALSE./
IF(.NOT.ALREADY) THEN
ALLOCATE(W(NPOIN))
ALREADY=.TRUE.
ENDIF


With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17389

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
Dear Jean-Michel,
Thnaks to your suggestions I don't have the problem anymore.
Thank you very very much.

I wish you a great day,

Daniele
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17404

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
False alarm, the problem still occurs.
Should I write some part of the code in another subroutine?

Thank you,

Daniele
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17405

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Please post your modified Fortran.

Another simple solution is to use a hardcoded size of W:

REAL W(30000)

where 30000 is greater that your number of points.

Regards,

JMH
The administrator has disabled public write access.

Infiltration 9 years 5 months ago #17406

  • DanieleD90
  • DanieleD90's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 55
  • Thank you received: 3
Thanks!

File Attachment:

File Name: prosou_2015-06-19.f.txt
File Size: 27 KB
The administrator has disabled public write access.
Moderators: pham

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