You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the Fortran template library as show here. I don't know if there's some needed installation in order to use it. Should I download the zip file ? I created a file called task.F90_template as shown in the link and it contains:
T function task(self,ww,pas,cpt ,nb_element,cpt1,dt,dx,p_element,u_prime,u_prime_moins,u_prime_plus,&
&taux,grad_x_u,grad_t_u,grad_x_f,grad_t_f,ax_plus,ax_moins,ux_plus,ux_moins,sm,flux,tab0,tab)
T::self,ww,pas,cpt,nb_element,cpt1,dt,dx,p_element,u_prime,u_prime_moins,u_prime_plus,&
&taux,grad_x_u,grad_t_u,grad_x_f,grad_t_f,ax_plus,ax_moins,ux_plus,ux_moins,sm,flux,tab0,tab
end function task
I don't understand also where to instantiate the template manually using the C preprocessor
#define T integer
#include "task.F90_template"
#define T real
#include "task.F90_template"
I want also to ask about the extension of the file tasks.F90_template since it doesn't get automatically colored.
This is the makefile I am using to compile my code:
What you are trying to do there isn't directly related to the Fortran Template library. You made your own template (the task.F90_template file) and are now trying to instantiate for integers and reals. The FTL is a collection of ready made templates, that you can use as they are. It provides templates for commonly used things like dynamically sized arrays, dictionaries, and other popular containers. But you are not using any of those templates, and instead making your own. That is perfectly fine of course, and you can probably draw some inspiration from how the FTL does things for your own templates.
The code you pasted looks pretty much correct to me. Just skip all the FTL related things like "-lftl" and such. If you want to see the preprocessed source code your template instantiations have generated, the "-E" flag of gfortran is quite useful. Try "gfortran -cpp -E tasksf90". That should show you the source code of the instantiations of the "task" function template for integers and reals.
I'm trying to use the Fortran template library as show here. I don't know if there's some needed installation in order to use it. Should I download the zip file ? I created a file called task.F90_template as shown in the link and it contains:
I don't understand also where to instantiate the template manually using the C preprocessor
I want also to ask about the extension of the file tasks.F90_template since it doesn't get automatically colored.
This is the makefile I am using to compile my code:
I am a little bit lost.
The text was updated successfully, but these errors were encountered: