Welcome, Guest
Username: Password: Remember me

TOPIC: One-year running period: error with reading wind file in subroutine

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20416

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Hi everyone,


Previously, I modify a METEO file, so the modified subroutine can successfully read a wind file with a short period (e.g. 10 days), by modifying:

IF(MY_OPTION.EQ.2) THEN
! JUMPING TWO LINES OF COMMENTS
READ(UL,*,ERR=100,END=25800)
READ(UL,*,ERR=100,END=25800)
! READING THE FIRST TWO LINES OF DATA
READ(UL,*,ERR=100,END=25800) AT1,FUAIR1,FVAIR1
READ(UL,*,ERR=100,END=25800) AT2,FUAIR2,FVAIR2

(With a time step of 30s, 25800 steps is an equivalent of 774,000s=10 days)


Now, I suppose to run TELEMAC 2D with about one-year period, so I prepare a wind file (txt. file) and modify a subroutine (METEO) in order to read this file.

I set up a model with a time step of 60s, and and wind file (text file) has a length of 31,560,000s =365days6h40m = 526 000 steps). So, in METEO subroutine I change:

IF(MY_OPTION.EQ.2) THEN
! JUMPING TWO LINES OF COMMENTS
READ(UL,*,ERR=100,END=526000)
READ(UL,*,ERR=100,END=526000)
! READING THE FIRST TWO LINES OF DATA
READ(UL,*,ERR=100,END=526000) AT1,FUAIR1,FVAIR1
READ(UL,*,ERR=100,END=526000) AT2,FUAIR2,FVAIR2

But it does not work!

What do I need to modify more?

Please help me :(

Thanks & Best Regards

Huy
Untitled.jpg
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20418

  • riadh
  • riadh's Avatar
Hello

This is well written in the error message. you have given a wrong statement label for end of file: END = 99 means that in case of end of file, execute the command located at label 99. So 10 here is not the number of lines in the file.

hereafter an example:

READ( 1, END=99, IOSTAT=N ) X, Y
...
99 WRITE( *, * ) 'EoF on 1'
RETURN
END

I hope that this helps

with my best regards

Riadh
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20420

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Thanks riadh.

But, by the way, could you please explain more about numbers: 10, 100, 200 and ERR=100 in the METEO subroutine?

I am sorry for asking you simple questions but I am beginner, and I really want to learn quickly.

Thank you so much.

10 CONTINUE
IF(AT.GE.AT1.AND.AT.LT.AT2) THEN
IF(AT2-AT1.GT.1.D-6) THEN
COEF=(AT-AT1)/(AT2-AT1)
ELSE
COEF=0.D0
ENDIF
UAIR=FUAIR1+COEF*(FUAIR2-FUAIR1)
VAIR=FVAIR1+COEF*(FVAIR2-FVAIR1)
IF(LISTIN) THEN
IF(LNG.EQ.1) WRITE(LU,*) 'VENT A T=',AT,' UAIR=',UAIR,
& ' VAIR=',VAIR
IF(LNG.EQ.2) WRITE(LU,*) 'WIND AT T=',AT,' UAIR=',UAIR,
& ' VAIR=',VAIR
ENDIF
ELSE
AT1=AT2
FUAIR1=FUAIR2
FVAIR1=FVAIR2
READ(UL,*,ERR=100,END=200) AT2,FUAIR2,FVAIR2
GO TO 10
!
!
!
100 CONTINUE
WRITE(LU,*) ' '
WRITE(LU,*) 'METEO'
IF(LNG.EQ.1) WRITE(LU,*) 'ERREUR DANS LE FICHIER DE VENT'
IF(LNG.EQ.2) WRITE(LU,*) 'ERROR IN THE WIND FILE'
CALL PLANTE(1)
STOP
200 CONTINUE
WRITE(LU,*) ' '
WRITE(LU,*) 'METEO'
IF(LNG.EQ.1)WRITE(LU,*)'FIN PREMATUREE DU FICHIER DE VENT'
IF(LNG.EQ.2)WRITE(LU,*) 'WIND FILE TOO SHORT'
CALL PLANTE(1)
STOP

Best Regards

Huy
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20424

  • riadh
  • riadh's Avatar
Hello

It is the same logic, when you find label 10 or 100 for instance, that means that in this case execute what is at label 10 or 100.
ERROR=100 mens that in case od error in the reasing process, execute instruction located at label 100.

Kind regards

Riadh
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20425

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
Merci Beaucoup Riah,

It means that I don't have to modify numbers such as 10,100,20 in the subroutine? :P

Best Regards

Huy
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20426

  • riadh
  • riadh's Avatar
I think That you don(t need to modify these labels. just verify that you have the same columns as the standard meteo file given in the validation case.
The administrator has disabled public write access.

One-year running period: error with reading wind file in subroutine 8 years 8 months ago #20427

  • huyquangtran
  • huyquangtran's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 271
  • Thank you received: 23
I understand clearly :P

and I also fixed the error, now the model is running.

P/s: please kindly take time to help me with the another question regarding OPTION FOR WIND: 3 on another topic.

Thanks and Best Regards

Huy
The administrator has disabled public write access.
Moderators: pham

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