Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Refactoring for Fortran code with #include?

Hi Brian,

> 
> Hi Eclipse Photran Developers and Users,
> 
> I help manage a weather forecasting software package called WRF, which is composed of over a million lines of Fortran code contributed from hundreds of different sources.   Managing this complex software with an IDE would be extremely helpful, but the IDE support for complex Fortran (i.e. free-form, with script-generated code inserted with CPP directives) has traditionally been absent.   
> 
> I recently took a tutorial that covered Eclipse/PTP for Fortran developers.   It looked, at first glance, like all refactoring operations are disabled for Fortran source with C preprocessor directives.   Since most of the WRF software has these directives, which inserts automatically generated Fortran code sometimes in excess of 10,000 lines, it would seem l am still out of luck as far as using Eclipse/Photran to manage and try to control its ever-growing gnarliness.  
> 
> 
> My questions are as follows: 
> 
> 1.   Are there any workarounds for refactoring Fortran code with CPP directives?  
> 
> 2.  Can other features of Eclipse/PTP help us with finding and fixing certain "bad" code blocks that appear?   One example: we don't want users writing debug messages  directly to various output streams, but call one of our debug message handling functions instead.   We would like Fortran lines of the form
> 
>          write(0,*) ' error in rfftmi ',ierr
> 
> to be rewritten as 
> 
>          write(stringbuf, *)  ' error in rfftmi ',ierr
>          call wrf_debug(stringbuf)   
> 
> 
> There are so many instances of these kinds of problems, that it just cries out for some kind of automated, incremental IDE tool to help find and change these kinds of code blocks.   
> 
> 
> Any stories, good or bad, about using Eclipse/Photran to manage complex Fortran source are greatly appreciated.   


I can't answer to your question about CCP directives.

About mange complex code, I'm developing fortran code not large as your code but it is about 100000 lines.
The use of Eclipse/Photran works very well and I'm really appreciate it, although, I've encountered several problems relatively to the size of the code/files :
- I don't find convenient to work with large files (more than several thousand lines), but it is OK.
- Unfortunately, I can't use refactoring (I've to disable it). I've had several "internal error" and I've had to "rebuilt the database" often. The worst is to save a file which can take ages (sometimes several minutes).

Every new version of Eclipse/Photran, I'm trying "the refactoring feature", but I don't see improvement.

Best regards

David

Back to the top