|

|
|
Fortran90
This configuration component contains highlighting, active strings, dictionary, menus, keyword search, buttons and images, tool bar customizations, compilation support and many more for Fortran 90 computer language and its later standards, including the current Fortran 2003 standard.
Installation
The contents of the zip archive should be extracted in the following directory: %b\Config\Fortran90.
Note that %b is different from %B. While %B always means the WinEdt installation directory, i.e.,
- for x86 platform: C:\Program Files\WinEdt Team\WinEdt
- for x64 platform: C:\Program Files (x86)\WinEdt Team\WinEdt
%b means:
- on Windows 95/98/Me:
- %b is equal to %B, usually it is
C:\Program Files\WinEdt Team\WinEdt
- on 32-bit Windows NT/2000/XP/2003 working as Administrator (or single user mode):
- %b is equal to %B, usually it is
C:\Program Files\WinEdt Team\WinEdt
- on 64-bit Windows XP/2003/Vista working as Administrator (or single user mode):
- %b is equal to %B, usually it is
C:\Program Files (x86)\WinEdt Team\WinEdt
- on 32 or 64-bit Windows XP/2003/Vista working as an ordinary user:
- %b is equal to %appdata%\WinEdt, usually it is
C:\Documents and Settings\<username>\Application Data\WinEdt
or, for Windows Vista
C:\Users\<username>\AppData\Roaming\WinEdt
After extraction you have to open WinEdt to execute the installation macro via Macros | Execute Macro... | _install_Fortran90.edt command.
What does it contain?
After installation a new item, named Fortran90 Editor, is added to the Options | Configurations menu. It does the following: Loads all menus and toolbar customizations related to Fortran90 mode.
Static Highlighting
You can see the custom Fortran90 highlighting in action by answering "Yes" at the end of installation regarding the sample file or you can later open sample.f90 file by hand. Highlighting includes:
Highlighted switches:
- Fortran90 Comment: !
- Fortran90 Strings: ' or "
- Fortran90 Intent: intent(?)
- Fortran90 Module, Function, and Subroutine names
- Fortran90 Numbers
Highlighted keywords:
- Fortran90 Keywords
- Fortran90 Data Types
- Fortran90 Intrinsics
- Fortran90 Logicals
- Fortran90 Specifiers
Dynamic Highlighting and Command Completion
Dynamic highlighting and (dynamic) command completion is supported via the dynamicKeywords macro. It allows highlighting and command completion of user defined Fortran90 functions, subroutines, interfaces, and (some) variables gathered from WinEdt's Tree. Therefore, to use this feature you need to have dynamicKeywords files installed at %b\Macros\macro and, additionally, you have to set a Fortran90 Main file and then build a Tree.
Dynamic highlighting and command completion can be triggered either manually, by choosing Tools | Update Dynamic Keywords, or automatically by using the related active strings, like "function<space>" or "subroutine<space>", for example.
Active Strings
Trigger Inserts
| program<space> | program statement |
| module<space> | module statement |
| forall<space> | forall construct |
| fall<space> | forall statement |
| dowhile<space> | do while (optimized form) |
| do<space> | do construct |
| ndo<space> | named do construct |
| case<space> | case construct |
| if<space> | if statement |
| ifthen<space> | if ... then ... end if |
| ifelse<space> | if ... then ... else ... end if |
| where<space> | where statement |
| welse<space> | where construct with elsewhere |
| subroutine<space> | subroutine statement |
| function<space> | function statement |
| typefunc<space> | function with inline type declaration |
| recursive<space> | recursive function |
| recfunc<space> | recursive function with inline type declaration |
| open<space> | open file statement |
| mproc<space> | expands to: module procedure |
| call ? | jumps to corresponding function, subroutine or interface definition on double-click |
| procedure ? | jumps to corresponding function or subroutine definition (if module procedure) on double-click |
Insert Menu
Some Fortran90 Statements and Constructs.
| Program Start | Inserts a Fortran program statement with some user comments. Very useful to begin new programs from scratch. |
| Module Start | Inserts a Fortran module statement with some user comments. Very useful to begin new modules from scratch. |
| Function | Inserts a Fortran function statement. |
| Recursive Function | Inserts a Fortran recursive function statement. |
| Subroutine | Inserts a Fortran function statement. |
| Constructs | Inserts some Fortran constructs: case, do, forall, if, etc... |
| Statements | Inserts some Fortran statements: forall, if, open |
Tools Menu
If it doesn't already exist, a new menu item called Update Dynamic Keywords will be added to the Tools Menu.
| Update Dynamic Keywords | This command will update highlighting and completions. This commands will not only be useful for Fortran90 mode, but for all other modes that use the Dynamic Keywords macro, so it will not be removed when uninstalling Fotran90 mode. |
Accessories Menu
| Compile File (Ctrl+F8) |
Compile your current Fortran file. If this file has dependencies, like modules or includes, you need to set it as Main File and then Build a Tree. Before compiling, you must select and configure your preferred Fortran compiler, this can be done in the Compiler Settings dialog. |
| Build & Run (F9) |
Compile, link into executable, and run if build succeeded. Note that if you have previously set a Main File then this command compiles every (dependent) file in a project, tracking whether the compiled version of each file are already up to date to save time, and then it uses the linker to put it all together in an executable and then execute your project. |
| Run (F8) |
Launch the executable. |
| Clean |
Open Erase dialog window. Allows you to selectively delete output files. |
| Compiler Settings |
Select your preferred compiler and change compiler settings. You can also set linker options. All settings are tied to the current fortran file or project. The information you entered here is saved in a configuration file (.mak) for future reference. The current supported compilers are:
- Intel Visual Fortran Compiler
- g95 Fortran Compiler (MinGW version only)
- GFortran Compiler (MinGW version only)
|
Help Menu
If you have downloaded the version of this component that come with the Intel® Visual Fortran Language Reference, then the Keyword Search command, or Ctrl+F1 shortcut, can be used to search for Fortran keywords and intrinsic procedures. If your download does not contain the help file (lref_for.chm), you can try downloading it from one of the links below and thereafter copy the help file to %b\Config\Fortran90 directory:
Fortran90 Dictionary
The Fortran90 Dictionary has most Fortran keywords and intrinsic procedures, it can be used for Command Completion by using the Ctrl+Enter shortcut.
To be effective Command Completion needs your intervention. By default, several dictionaries, like "User (Addon)" and several English dictionaries, are enabled for all modes. For each of these dictionaries you must add the string "*|Fortran90", without quotes, in the corresponding Enabled field in the Dictionaries tab of Options | Dictionary Manager screen. This procedure disables those dictionaries only for Fortran90 mode.
Time and file stamps
If this option was selected in the installation procedure, a new macro replaces the original MDI Save Event macro. The purpose of this new macro is to automatically update custom time and file stamps while in Fortran90 mode. Time and file stamps are inserted as Fortran comments, begins with a dollar sign and ends with a colon (:). For example:
! $file: filename.f90
! $date: January 05, 2007
Known Bugs & Limitations
- This Configuration Component recognizes only the .f90 extension for Fortran source code, with the exception for included files. If your included files reside in the same directory of your source files, then you must assign included files a distinct extension (for example, .inc) in order to avoid unwanted compilation of included files.
- If you don't like to use a different file extension for includes, then you have to put those included files in a distinct directory in order to still use the default .f90 extension. Note also that it is necessary to inform the location of this specific folder in the third tab (Paths) of the Compiler Settings dialog. Please use only relative (to source) paths and forward slash (Unix-like) in this dialog.
- Although it is possible to put module files together with included files, in a specific folder apart from normal source code, this is not supported by this component. Please put your modules along with your ordinary source code.
- If a module filename is different from the module name it contains then the Clean procedure will not delete the corresponding generated .mod file.
- If a file containing only a function (for example) is required by your project but it's not INCLUDEd or USEd then this file will not be shown inside WinEdt's Tree. But you can still build your project.
- All .f90 files in the source folder are compiled. So do not leave unrelated Fortran files in your project's source folder. Use a folder per project.
- There is no syntax highlighting or other features for Fortran 77, this configuration mode is intended to Fortran 90 and latter only.
Download
Fortran90.zip [152 KB, without Intel Visual Fortran Language Reference]
Fortran90+Help.zip [1956 KB, including Intel Visual Fortran Language Reference]
The package requires the
which both must be saved in %b\Macros\macro (preferably) or %B\Macros\macro.
Configuration component contributed by Bernhard Enders <bgeneto gmail.com>
|