Welcome, Guest
Username: Password: Remember me

TOPIC: FORTRAN Programming: adjusting friction_def module

FORTRAN Programming: adjusting friction_def module 5 months 2 weeks ago #44887

Dear all,

I want to extend the friction.tbl by new variables (part of the vegetation example in T2D). It should be able to chose the kind of method to calculate the dimensionles shear stress (shields parameter) if vegetation is used (VEGETATION=YES in T2D) and sediment transport is activated. There will be this new keyword "ARMA" in the friction.tbl and 3 parameters, which need to be defined by the user (diameter, density and plant height, see friction_ARMA.txt). These 4 parameters should also be read by the subroutine friction_read.f

Attached you can find the module "friction_def", the subroutine "friction_read.f" and the friction.tbl for this case. So far, I get the following error message: "C:\opentelemac-mascaret\V8P4\BAPT_veg-shields_new-implementation\NP2_test_arma\t2d_veg.cas_2024-06-04-15h28min49s\user_fortran\user_fortran_BAPT_ARMA.f:116:10:

116 | USE INTERFACE_TELEMAC2D, EX_FRICTION_READ => FRICTION_READ
| 1
Fatal Error: Mismatch in components of derived type 'friction_obj' from 'friction_def' at (1): expecting 'stype', but got 'rcoef'
compilation terminated."

My question is: Do I miss something while programming or is it an issue of compiling the system newly when a module is changed?

I am looking forward to your answers/suggestions.

Best,

Antonia

File Attachment:

File Name: friction_read.f
File Size: 20 KB

File Attachment:

File Name: friction_def.f
File Size: 2 KB

File Attachment:

File Name: friction_ARMA.txt
File Size: 6 KB
The administrator has disabled public write access.

FORTRAN Programming: adjusting friction_def module 5 months 2 weeks ago #44892

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

As soon as you change memory allocation, you have to put your changes in the $HOMETEL/sources directory and compile with --clean option (compile_telemac.py --clean).

Anyway, as suggested to Frederik a few days ago, some advice to better implement Fortran:
- do not use tabulations (you have indentations issues due to the lack of columns if you use fixed format),
- every opening bracket has to be associated with a closing bracket,
- you have to add more USE declarations so that COUPLING and INCLUS can be used (more difficult to know).

Please find enclosed a modified file for your friction_read.f which can help you.

Hope this helps,

Chi-Tuan

File Attachment:

File Name: friction_read.f
File Size: 20 KB
The administrator has disabled public write access.
Moderators: pham

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