|
10 | 10 | * A copy of the [Gnu Lesser General Public License](https://www.gnu.org/licenses/lgpl-3.0.en.html) |
11 | 11 | must be included at the top of each file. |
12 | 12 | * Documentation should be written so that it can be parsed by [Doxygen](http://www.doxygen.nl/). |
| 13 | +* Files, modules, and public routines should be prefixed with `fms_subfolder_` where `subfolder` is |
| 14 | + the name of the subfolder that the file is in. Shorten subfolder names (ie diag) are acceptable |
| 15 | + as long as they are consistent within the subfolder. |
13 | 16 | * All variables should be defined, and include units. Unit-less variables should be marked `unitless` |
14 | 17 | * Provide detailed descriptions of modules, interfaces, functions, and subroutines |
15 | 18 | * Define all function/subroutine arguments, and function results (see below) |
16 | 19 | * Follow coding style of the current file, as much as possible. |
| 20 | +* Add public routines to be used ouside of FMS to the libFMS.F90 file so they can be accessed |
| 21 | + through `use FMS`. |
17 | 22 |
|
18 | 23 | ## Fortran |
19 | 24 |
|
|
89 | 94 | same include subdirectory as the .fh files. See below for details. |
90 | 95 | ## Fortran Example |
91 | 96 |
|
92 | | -```Fortran ./example.F90 file |
| 97 | +```Fortran ./fms_subfolder_example.F90 file |
93 | 98 |
|
94 | 99 | !*********************************************************************** |
95 | 100 | !* GNU Lesser General Public License |
|
115 | 120 | !! @author <developer> |
116 | 121 | !! @email gfdl.climate.model.info@noaa.gov |
117 | 122 |
|
118 | | -module example_mod |
| 123 | +module fms_subfolder_example_mod |
119 | 124 | use platform_mod, only r4_kind, r8_kind, i4_kind, i8_kind |
120 | 125 | use util_mod, only: util_func1 |
121 | 126 | implicit none |
122 | 127 | private |
123 | 128 |
|
124 | | - public :: sub1 |
125 | | - public :: func1 |
126 | | - public :: ex_subroutine |
| 129 | + public :: fms_subfolder_example_sub1 |
| 130 | + public :: fms_subfolder_example_func1 |
| 131 | + public :: fms_subfolder_example_ex_subroutine |
127 | 132 |
|
128 | | - interface ex_subroutine !< generic interface block. When the user |
129 | | - module procedure ex_subroutine_r4 !! calls ex_subroutine, the compiler checks |
130 | | - module procedure ex_subroutine_r8 !! the input arguments and invokes either |
131 | | - end interface ex_subroutine !! ex_subroutine_r4 or ex_subroutine_r8 |
132 | | - !! ex_subroutine_r4/8 are generated by the preprocessor |
133 | | - !! which requires example_r4.fh, example_r8.fh, and |
134 | | - !! example.inc files |
| 133 | + interface fms_subfolder_example_ex_subroutine !< generic interface block. When the user |
| 134 | + module procedure ex_subroutine_r4 !! calls ex_subroutine, the compiler checks |
| 135 | + module procedure ex_subroutine_r8 !! the input arguments and invokes either |
| 136 | + end interface ex_subroutine !! ex_subroutine_r4 or ex_subroutine_r8 |
| 137 | + !! ex_subroutine_r4/8 are generated by the preprocessor |
| 138 | + !! which requires example_r4.fh, example_r8.fh, and |
| 139 | + !! example.inc files |
135 | 140 |
|
136 | 141 | !> @brief Doxygen description of type. |
137 | | - type,public :: CustomType |
| 142 | + type,public :: fms_subfolder_example_CustomType |
138 | 143 | private |
139 | 144 | integer(kind=i4_kind) :: a_var !< Inline doxygen description. |
140 | 145 | real(kind=r8_kind),dimension(:),allocatable :: b_arr !< long description |
141 | 146 | !! continued on |
142 | 147 | !! multiple lines. |
143 | | - endtype CustomType |
| 148 | + endtype fms_subfolder_example_CustomType |
144 | 149 |
|
145 | 150 | contains |
146 | 151 |
|
147 | 152 | !> @brief Doxygen description. |
148 | | - subroutine sub1(arg1, arg2, & |
| 153 | + subroutine fms_subfolder_example_sub1(arg1, arg2, & |
149 | 154 | & arg3) |
150 | 155 | real(kind=r4_kind),intent(in) :: arg1 !< Inline doxygen description. |
151 | 156 | integer(kind=i8_kind),intent(inout) :: arg2 !< Inline doxygen description. |
152 | 157 | character(len=*),intent(inout) :: arg3 !< Long inline doxygen |
153 | 158 | !! description. |
154 | 159 |
|
155 | 160 | arg1=2.456_r4_kind |
156 | | - end subroutine sub1 |
| 161 | + end subroutine fms_subfolder_example_sub1 |
157 | 162 |
|
158 | 163 | !> @brief Doxygen description |
159 | 164 | !! @return Function return value. |
160 | | - function func1(arg1, arg2) result(res) |
| 165 | + function fms_subfolder_example_ func1(arg1, arg2) result(res) |
161 | 166 | integer(kind=i4_kind),intent(in) :: arg1 !< Inline doxygen description |
162 | 167 | integer(kind=i4_kind),intent(in) :: arg2 !< Inline doxygen description |
163 | 168 | integer(kind=r8_kind) :: res |
164 | 169 |
|
165 | 170 | res=real(arg1,r8_kind) * 3.14_r8_kind |
166 | | - end function func1 |
| 171 | + end function fms_subfolder_example_func1 |
167 | 172 |
|
168 | 173 | #include "example_r4.fh" !< These two header file contains the macro definition |
169 | 174 | #include "example_r8.fh" !! and an "#include example.inc" where the procedure |
|
0 commit comments