Welcome, Guest
Username: Password: Remember me

TOPIC: Control sections, sect. 5.2.2, v8p2r0

Control sections, sect. 5.2.2, v8p2r0 3 years 9 months ago #37834

  • erwanC
  • erwanC's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Hi all,

I jump onto this subject to add my own observation, and also ask for help (please, let me know if I need to open a new topic) :

Looking into read_sections_telemac2d.f help me a lot understanding the differents cases. I understood that for a parallel run using coordinates, 1 (or any positive number ?) is the only solution to undertake the specific case when a section is across different meshes.
Is it correct? Maybe only this point may be clarified...

---
This come to my problem :
I use 40 sections (SECTIONS INPUT and OUTPUT FILE specified in the cas) and 600 buses (CULVERT DATA FILE specified in the cas, along with number and option=2).

AND i use a modified user_fortran buse.F according to www.openmascaret.org/index.php/assistanc...rmatted-results-file to write buses discharges in a file.

Now, there is an error during the first step of graphic output (the run start correctly, parallel mode, steering flag 1 in sections.
ETAPE DE DIFFUSION-PROPAGATION
At line 563 of file C:\Users\erwan.cabon\Desktop\2014_K3_v8_05s\cas.txt_2021-02-16-14h33min40s\user_fortran\buse.F (unit = 9, file = 'C:\Users\erwan.cabon\Desktop\2014_K3_v8_05s\cas.txt_2021-02-16-14h33min40s\T2DSEC00001-00001')
CULVERT 1 DISCHARGE OF 0.10196072903454953 M3/S
Fortran runtime error: Cannot write to file opened for READ
job aborted:


If I delete the user_fortran buse.f and the FORMATTED RESULTS FILE, the run finish successfully and I have my discharge through controle section.
If I delete the SECTIONS INPUT and OUTPUT FILE, the run finish successfully and I have my discharge through my buses.
So I think there is conflict beetween them but I can't figure out were.
T2DRFO ? Private variable N use in buse.f?

If I use the steering flag 0 in section, it run in scalar mode with buses and section output but not in parallel.
Same error if I use global numbers of node instead of coordinates (and the -1 flag).

Any idea how to solve this ?
thanks
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37896

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello,

Your user Fortran buse.F may be the issue. It seems you try to write in a file T2DSEC which corresponds to the SECTIONS INPUT FILE which can only be read i.e. you cannot write into it. That is the error written in your message: "Fortran runtime error: Cannot write to file opened for READ".

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37902

  • erwanC
  • erwanC's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Hi Pham,
Thanks for your interest

I can't find any reference to T2DSEC in my edited buse.F.
Only modified section is between the "lignes" (at ligne 563) :

! PRINT FLOW RATES VALUES FOR EACH ACTIVE CULVERT
IF(ENTET.AND.ABS(DBUS(N)).GT.1.D-4) THEN
WRITE(LU,*) 'CULVERT ',N,' DISCHARGE OF ',DBUS(N),' M3/S'
!AJOUT

WRITE(T2D_FILES(T2DRFO)%LU,*) AT,N,DBUS(N)
!FIN AJOUT
ENDIF


and some declaration at the begining :


USE BIEF
!
!

USE DECLARATIONS_TELEMAC2D, ONLY : T2D_FILES,AT,T2DRFO
!
USE DECLARATIONS_SPECIAL
USE INTERFACE_PARALLEL, ONLY : P_DMAX,P_DMIN
IMPLICIT NONE


And I think that T2DRFO is the correct file for Buse Output (FORMATTED RESULTS FILE) and the discharge for the first culvert only is filled for the first period. whereas T2DSEO (Output section file) is correctly filed with discharges for each time step until the first period.

Any idea to find what step call T2DSEC and debug this ?
First thing maybe : what process usually call and write to T2DSEC ?
Or is there any conflict possibility linked to the FORMATTED RESULTS FILE

I can't find any specifique reference in the user manual...

For information, I also tried all the 9 possibility between PARRALLEL PROCESSORS (0, 1 or 2) and Section type (-1, 0 or 1), with the corresponding node ID or Coordinate.
This error appear only in parallele mode (2 processors). And of course there is an error with the Section type flag = 1 with PARRALLEL PROCESSORS = 0 or 1
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37910

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Erwan,

Can you upload the buse.F subroutine you have changed + say which release you are using please?

Chi-Tuan
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37912

  • erwanC
  • erwanC's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Sure,
I'm on Telemac v8p1r2.
Please find the buse.F attached (i put it under a "user_fortran" folder with the FICHIER FORTRAN ='user_fortran' specified in the steering file.

Please note also that I :
- changed MAXKEYWORD = 3000 within declarations_special.f
- changed SIZELIGN = 6000 within read_fic_sources.f
- add in debsce.f :
ELSEIF(I.LT.1000) THEN
WRITE(FCT(3:5),FMT='(I3)') I
FCT(6:6)=')'
- compile_telemac.py --clean

cheers
Erwan
Attachments:
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37914

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello again

Can you add the condition IF(IPID.EQ.0) just before WRITE(T2D_FILES(T2DRFO)%LU,*) AT,N,DBUS(N)
i.e. replace the previous line by:
IF(IPID.EQ.0) WRITE(T2D_FILES(T2DRFO)%LU,*) AT,N,DBUS(N)

and tell me if it is OK?

Did it work for sequential run? (ncsize=1) ?

There may be a conflict of numbering of file as the FORMATTED RESULTS FILE is defined as SCAL in the TELEMAC-2D dictionary (aka scalar, i.e. 1 single file for every subdomain) and when it comes to write, this may be the issue in parallel.

Chi-Tuan
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37916

  • erwanC
  • erwanC's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Nice, it's working !
Thanks for your help and reactivity.

I have both section discharge and buse discharge written in there respective files :
- in parallel mode (n=2) for Section flag = -1, 0 and 1
- in sequential mode (n=1) for Section flag = -1, 0 (1 is obviously not working)
- in sequential mode (n=0) for Section flag = -1, 0 (1 is obviously not working)

Can you just describe for my understanding the impact here of IF(IPID.EQ.0)?

Regards
The administrator has disabled public write access.

Control sections, sect. 5.2.2, v8p2r0 3 years 8 months ago #37917

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
IPID is a variable defined in bief_def module and is the processor number of your parallel run.
IF(IPID.EQ.0) means if the processor number is the master processor, only this one will do what is written after this condition IPID.EQ.0, in your case write
the 3 values AT,N,DBUS(N) in the FORMATTED RESULTS FILE.

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: erwanC
Moderators: pham

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