Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20815

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello all,

Up until v7p1, I've been using a modified noerod.f subroutine to read RIGID BED from the geometry file, using FIND_IN_SEL. I am trying to adapt it to v7p1 using FIND_VARIABLE. The code is inspired by subroutine FONSTR but I am unable to make it work and I get errors at runtime.

Can anyone have a look at my code to see what am I doing wrong? Sisyphe is running in coupled mode with T2D.

Best Regards,
Costas

File Attachment:

File Name: noerod_t2d_v1.f
File Size: 5 KB
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20817

  • Svensmolders
  • Svensmolders's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 105
  • Thank you received: 20
Hi Costas,

that's a nice feature you made for sisyphe. I could use this in the near feature. I did something similar to read Salinity values in T3D. I did this in v7p1 so I already used the FIND_VARIABLE code. Could you give more specifics about the errors you get? Do you know which part of your code gives the problem? I used the WRITE command to give me details about different variables and to find out which part of the code gave me errors.

Best regards,

Sven
The administrator has disabled public write access.
The following user(s) said Thank You: cyamin

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20819

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello Sven,

There is and ENDIF missing after line 117 but it makes no difference in the end.

The subroutine compiles OK, but I get this error when the code executes and program crashes in INIT_SEDIMENT after NOEROD:
|Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

At first I thought that it was NOEROD that causing the trouble by not defining the rigid bed elevation correctly, but after modifying the subroutine to print the layer thickness at all points, it seems that NOEROD works as it should and the crash comes from later on.

I have the message
MAXIMUM INITIAL NUMBER OF LAYERS :           1
after INIT_SEDIMENT which is sent by INIT_AVAI, so I am looking into this at the moment. This showed up after adding a non-erodible bed. The code worked fine without it.

Thanks for taking interest at my problem.

Regards,
Costas
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20820

  • Svensmolders
  • Svensmolders's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 105
  • Thank you received: 20
So your subroutine works well, but gives a conflict with INIT_SEDIMENT at this moment. If you can pinpoint the conflict, you can probably solve it. I don't have that much experience with this code to give you suggestions at this moment :-)

Best of luck!

Sven
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20821

  • konsonaut
  • konsonaut's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 413
  • Thank you received: 144
Hi Costas,

maybe you should allocate your structure with ALLVEC after the declaration as bief object?


Hope this helps,
Clemens
The administrator has disabled public write access.
The following user(s) said Thank You: cyamin

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 7 months ago #20822

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
That was it... In my initial approach I thought I won't have to use the NOER object, but in the end I had to add it and totally forgot about that. Many thanks for the help, Clemens!

Best Regards,
Costas
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 6 months ago #21224

  • josekdiaz
  • josekdiaz's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 161
  • Thank you received: 48
Dear Costas,

After a couple of hours trying to make the "noerod.f" FORTRAN file that was referenced in many post i realized, after reading this thread, that the "FIND_IN_SEL" subroutine is no longer included in the current version (v7p1).

Trying to modify the routine you posted here led me to the same (?) "SIGSEGV: Segmentation fault" after compiling and running the case, but unfortunately due to my nonexistent skill in FORTRAN, i couldn't pinpoint the issue even after reading Clemens advice.

Could you please, pinpoint the last fix that you included in the fortran file?

Thank you much for your time, regards

José D.
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 6 months ago #21227

  • jmhervouet
  • jmhervouet's Avatar
Hello,

The new syntax to be used in noerod.f for reading the non erodable bed in a serafin file is tentatively:

INTEGER IERR

CALL FIND_VARIABLE('SERAFIN ',LU_FILE,'NON ERODABLE BED',
& ZR,NPOIN,IERR)

where LU_FILE is the logical unit of your file and IERR an error number (0 if OK). NON ERODABLE BED is the name of the variable in the file, in 16 characters. This statement will read the last record of the file.

With best regards,

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

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 6 months ago #21301

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello Jose,

Sorry for the delay, I was out of office for Easter holidays. Here is my final NOEROD file:

File Attachment:

File Name: noerod_t2d_v7p1.f
File Size: 5 KB


Best Regards,
Costas
The administrator has disabled public write access.

Replace FIND_IN_SEL with FIND_VARIABLE in noerod.f 8 years 6 months ago #21314

  • jmhervouet
  • jmhervouet's Avatar
Hello Costas,

No doubt that your implementation works but I do not understand the use of NOER. As we now ask directly for the double precision array, you can put ZR directly in the call to find_variable, instead of NOER%R.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: Pablo, pavans

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