Skip to content

Commit d5fd567

Browse files
committed
Describe the units of 33 real function results
Added a description of the units of the return values to the comments describing 33 real functions in 8 modules. Only comments are changed and all answers are bitwise identical.
1 parent 463424c commit d5fd567

File tree

8 files changed

+37
-34
lines changed

8 files changed

+37
-34
lines changed

src/core/MOM_open_boundary.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ subroutine initialize_segment_data(G, GV, US, OBC, PF)
11231123
end subroutine initialize_segment_data
11241124

11251125
!> Return an appropriate dimensional scaling factor for input data based on an OBC segment data
1126-
!! name, or 1 for tracers or other fields that do not match one of the specified names.
1126+
!! name [various ~> 1], or 1 for tracers or other fields that do not match one of the specified names.
11271127
!! Note that calls to register_segment_tracer can come before or after calls to scale_factor_from_name.
11281128

11291129
real function scale_factor_from_name(name, GV, US, Tr_Reg)

src/parameterizations/lateral/MOM_MEKE.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,8 @@ subroutine predict_MEKE(G, US, CS, npts, Time, features_array, MEKE)
19951995

19961996
end subroutine predict_MEKE
19971997

1998-
!> Compute average of interface quantities weighted by the thickness of the surrounding layers
1998+
!> Compute average of interface quantities weighted by the thickness of the surrounding
1999+
!! layers [arbitrary]
19992000
real function vertical_average_interface(h, w, h_min)
20002001

20012002
real, dimension(:), intent(in) :: h !< Layer Thicknesses [H ~> m or kg m-2]

src/tracer/MOM_hor_bnd_diffusion.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ subroutine hbd_grid(boundary, G, GV, hbl, h, CS)
416416

417417
end subroutine hbd_grid
418418

419-
!> Calculate the harmonic mean of two quantities
419+
!> Calculate the harmonic mean of two quantities [arbitrary]
420420
!! See \ref section_harmonic_mean.
421421
real function harmonic_mean(h1,h2)
422422
real :: h1 !< Scalar quantity [arbitrary]

src/tracer/MOM_neutral_diffusion.F90

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ end subroutine interface_scalar
11311131

11321132
!> Returns the PPM quasi-fourth order edge value at k+1/2 following
11331133
!! equation 1.6 in Colella & Woodward, 1984: JCP 54, 174-201.
1134+
!! The returned units are the same as those of Ak (e.g. [C ~> degC] for temperature).
11341135
real function ppm_edge(hkm1, hk, hkp1, hkp2, Ak, Akp1, Pk, Pkp1, h_neglect)
11351136
real, intent(in) :: hkm1 !< Width of cell k-1 in [H ~> m or kg m-2] or other units
11361137
real, intent(in) :: hk !< Width of cell k in [H ~> m or kg m-2] or other units
@@ -1289,9 +1290,9 @@ subroutine PLM_diff(nk, h, S, c_method, b_method, diff)
12891290

12901291
end subroutine PLM_diff
12911292

1292-
!> Returns the cell-centered second-order finite volume (unlimited PLM) slope
1293-
!! using three consecutive cell widths and average values. Slope is returned
1294-
!! as a difference across the central cell (i.e. units of scalar S).
1293+
!> Returns the cell-centered second-order finite volume (unlimited PLM) slope using three
1294+
!! consecutive cell widths and average values. Slope is returned as a difference across
1295+
!! the central cell (i.e. units of scalar S, e.g. [C ~> degC] for temperature).
12951296
!! Discretization follows equation 1.7 in Colella & Woodward, 1984: JCP 54, 174-201.
12961297
real function fv_diff(hkm1, hk, hkp1, Skm1, Sk, Skp1)
12971298
real, intent(in) :: hkm1 !< Left cell width [H ~> m or kg m-2] or other arbitrary units
@@ -1572,7 +1573,7 @@ subroutine find_neutral_surface_positions_continuous(nk, Pl, Tl, Sl, dRdTl, dRdS
15721573
end subroutine find_neutral_surface_positions_continuous
15731574

15741575
!> Returns the non-dimensional position between Pneg and Ppos where the
1575-
!! interpolated density difference equals zero.
1576+
!! interpolated density difference equals zero [nondim].
15761577
!! The result is always bounded to be between 0 and 1.
15771578
real function interpolate_for_nondim_position(dRhoNeg, Pneg, dRhoPos, Ppos)
15781579
real, intent(in) :: dRhoNeg !< Negative density difference [R ~> kg m-3]
@@ -1875,7 +1876,8 @@ subroutine mark_unstable_cells(CS, nk, T, S, P, stable_cell)
18751876
enddo
18761877
end subroutine mark_unstable_cells
18771878

1878-
!> Searches the "other" (searched) column for the position of the neutral surface
1879+
!> Searches the "other" (searched) column for the position of the neutral surface, returning
1880+
!! the fractional postion within the layer [nondim]
18791881
real function search_other_column(CS, ksurf, pos_last, T_from, S_from, P_from, T_top, S_top, P_top, &
18801882
T_bot, S_bot, P_bot, T_poly, S_poly ) result(pos)
18811883
type(neutral_diffusion_CS), intent(in ) :: CS !< Neutral diffusion control structure

src/tracer/nw2_tracers.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ subroutine nw2_tracer_column_physics(h_old, h_new, ea, eb, fluxes, dt, G, GV, US
270270

271271
end subroutine nw2_tracer_column_physics
272272

273-
!> The target value of a NeverWorld2 tracer label m at non-dimensional
273+
!> The target value of a NeverWorld2 tracer label m [conc] at non-dimensional
274274
!! position x=lon/Lx, y=lat/Ly, z=eta/H
275275
real function nw2_tracer_dist(m, G, GV, eta, i, j, k)
276276
integer, intent(in) :: m !< Indicates the NW2 tracer

src/user/MOM_wave_interface.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ subroutine Update_Stokes_Drift(G, GV, US, CS, dz, ustar, dt, dynamics_step)
10331033

10341034
end subroutine Update_Stokes_Drift
10351035

1036-
!> Return the value of (1 - exp(-x))/x, using an accurate expression for small values of x.
1036+
!> Return the value of (1 - exp(-x))/x [nondim], using an accurate expression for small values of x.
10371037
real function one_minus_exp_x(x)
10381038
real, intent(in) :: x !< The argument of the function ((1 - exp(-x))/x) [nondim]
10391039
real, parameter :: C1_6 = 1.0/6.0 ! A rational fraction [nondim]
@@ -1045,7 +1045,7 @@ real function one_minus_exp_x(x)
10451045
endif
10461046
end function one_minus_exp_x
10471047

1048-
!> Return the value of (1 - exp(-x)), using an accurate expression for small values of x.
1048+
!> Return the value of (1 - exp(-x)) [nondim], using an accurate expression for small values of x.
10491049
real function one_minus_exp(x)
10501050
real, intent(in) :: x !< The argument of the function ((1 - exp(-x))/x) [nondim]
10511051
real, parameter :: C1_6 = 1.0/6.0 ! A rational fraction [nondim]

src/user/Neverworld_initialization.F90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ subroutine Neverworld_initialize_topography(D, G, param_file, max_depth)
8282

8383
end subroutine Neverworld_initialize_topography
8484

85-
!> Returns the value of a cosine-bell function evaluated at x/L
85+
!> Returns the value of a cosine-bell function evaluated at x/L [nondim]
8686
real function cosbell(x, L)
8787
real , intent(in) :: x !< Position in arbitrary units [A]
8888
real , intent(in) :: L !< Width in arbitrary units [A]
@@ -92,7 +92,7 @@ real function cosbell(x, L)
9292
cosbell = 0.5 * (1 + cos(PI*MIN(ABS(x/L),1.0)))
9393
end function cosbell
9494

95-
!> Returns the value of a sin-spike function evaluated at x/L
95+
!> Returns the value of a sin-spike function evaluated at x/L [nondim]
9696
real function spike(x, L)
9797

9898
real , intent(in) :: x !< Position in arbitrary units [A]
@@ -104,7 +104,7 @@ real function spike(x, L)
104104
end function spike
105105

106106
!> Returns the value of a triangular function centered at x=x0 with value 1
107-
!! and linearly decreasing to 0 at x=x0+/-L, and 0 otherwise.
107+
!! and linearly decreasing to 0 at x=x0+/-L, and 0 otherwise [nondim].
108108
!! If clip is present the top of the cone is cut off at "clip", which
109109
!! effectively defaults to 1.
110110
real function cone(x, x0, L, clip)
@@ -117,7 +117,7 @@ real function cone(x, x0, L, clip)
117117
if (present(clip)) cone = min(clip, cone)
118118
end function cone
119119

120-
!> Returns an s-curve s(x) s.t. s(x0)<=0, s(x0+L)>=1 and cubic in between.
120+
!> Returns an s-curve s(x) s.t. s(x0)<=0, s(x0+L)>=1 and cubic in between [nondim].
121121
real function scurve(x, x0, L)
122122
real, intent(in) :: x !< Coordinate in arbitrary units [A]
123123
real, intent(in) :: x0 !< position of peak in arbitrary units [A]
@@ -130,7 +130,7 @@ end function scurve
130130

131131
! None of the following 7 functions appear to be used.
132132

133-
!> Returns a "coastal" profile.
133+
!> Returns a "coastal" profile [nondim].
134134
real function cstprof(x, x0, L, lf, bf, sf, sh)
135135
real, intent(in) :: x !< Coordinate in arbitrary units [A]
136136
real, intent(in) :: x0 !< position of peak in arbitrary units [A]
@@ -145,7 +145,7 @@ real function cstprof(x, x0, L, lf, bf, sf, sh)
145145
cstprof = sh * scurve(s-lf,0.,bf) + (1.-sh) * scurve(s - (1.-sf),0.,sf)
146146
end function cstprof
147147

148-
!> Distance between points x,y and a line segment (x0,y0) and (x0,y1).
148+
!> Distance between points x,y and a line segment (x0,y0) and (x0,y1) in arbitrary units [A].
149149
real function dist_line_fixed_x(x, y, x0, y0, y1)
150150
real, intent(in) :: x !< X-coordinate in arbitrary units [A]
151151
real, intent(in) :: y !< Y-coordinate in arbitrary units [A]
@@ -160,7 +160,7 @@ real function dist_line_fixed_x(x, y, x0, y0, y1)
160160
dist_line_fixed_x = sqrt( (dx*dx) + (dy*dy) )
161161
end function dist_line_fixed_x
162162

163-
!> Distance between points x,y and a line segment (x0,y0) and (x1,y0).
163+
!> Distance between points x,y and a line segment (x0,y0) and (x1,y0) in arbitrary units [A].
164164
real function dist_line_fixed_y(x, y, x0, x1, y0)
165165
real, intent(in) :: x !< X-coordinate in arbitrary units [A]
166166
real, intent(in) :: y !< Y-coordinate in arbitrary units [A]
@@ -171,7 +171,7 @@ real function dist_line_fixed_y(x, y, x0, x1, y0)
171171
dist_line_fixed_y = dist_line_fixed_x(y, x, y0, x0, x1)
172172
end function dist_line_fixed_y
173173

174-
!> A "coast profile" applied in an N-S line from lon0,lat0 to lon0,lat1.
174+
!> A "coast profile" applied in an N-S line from lon0,lat0 to lon0,lat1 [nondim].
175175
real function NS_coast(lon, lat, lon0, lat0, lat1, dlon, sh)
176176
real, intent(in) :: lon !< Longitude [degrees_E]
177177
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -186,7 +186,7 @@ real function NS_coast(lon, lat, lon0, lat0, lat1, dlon, sh)
186186
NS_coast = cstprof(r, 0., dlon, 0.125, 0.125, 0.5, sh)
187187
end function NS_coast
188188

189-
!> A "coast profile" applied in an E-W line from lon0,lat0 to lon1,lat0.
189+
!> A "coast profile" applied in an E-W line from lon0,lat0 to lon1,lat0 [nondim].
190190
real function EW_coast(lon, lat, lon0, lon1, lat0, dlat, sh)
191191
real, intent(in) :: lon !< Longitude [degrees_E]
192192
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -201,7 +201,7 @@ real function EW_coast(lon, lat, lon0, lon1, lat0, dlat, sh)
201201
EW_coast = cstprof(r, 0., dlat, 0.125, 0.125, 0.5, sh)
202202
end function EW_coast
203203

204-
!> A NS ridge
204+
!> A NS ridge [nondim]
205205
real function NS_ridge(lon, lat, lon0, lat0, lat1, dlon, rh)
206206
real, intent(in) :: lon !< Longitude [degrees_E]
207207
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -217,7 +217,7 @@ real function NS_ridge(lon, lat, lon0, lat0, lat1, dlon, rh)
217217
end function NS_ridge
218218

219219

220-
!> A circular ridge
220+
!> A circular ridge [nondim]
221221
real function circ_ridge(lon, lat, lon0, lat0, ring_radius, ring_thickness, ridge_height)
222222
real, intent(in) :: lon !< Longitude [degrees_E]
223223
real, intent(in) :: lat !< Latitude [degrees_N]

src/user/basin_builder.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ subroutine basin_builder_topography(D, G, param_file, max_depth)
157157
end subroutine basin_builder_topography
158158

159159
!> Returns the value of a triangular function centered at x=x0 with value 1
160-
!! and linearly decreasing to 0 at x=x0+/-L, and 0 otherwise.
160+
!! and linearly decreasing to 0 at x=x0+/-L, and 0 otherwise [nondim].
161161
!! If clip is present the top of the cone is cut off at "clip", which
162162
!! effectively defaults to 1.
163163
real function cone(x, x0, L, clip)
@@ -170,7 +170,7 @@ real function cone(x, x0, L, clip)
170170
if (present(clip)) cone = min(clip, cone)
171171
end function cone
172172

173-
!> Returns an s-curve s(x) s.t. s(x0)<=0, s(x0+L)>=1 and cubic in between.
173+
!> Returns an s-curve s(x) s.t. s(x0)<=0, s(x0+L)>=1 and cubic in between [nondim].
174174
real function scurve(x, x0, L)
175175
real, intent(in) :: x !< Coordinate in arbitrary units [A]
176176
real, intent(in) :: x0 !< position of peak in arbitrary units [A]
@@ -181,7 +181,7 @@ real function scurve(x, x0, L)
181181
scurve = ( 3. - 2.*s ) * ( s * s )
182182
end function scurve
183183

184-
!> Returns a "coastal" profile.
184+
!> Returns a "coastal" profile [nondim].
185185
real function cstprof(x, x0, L, lf, bf, sf, sh)
186186
real, intent(in) :: x !< Coordinate in arbitrary units [A]
187187
real, intent(in) :: x0 !< position of peak in arbitrary units [A]
@@ -196,7 +196,7 @@ real function cstprof(x, x0, L, lf, bf, sf, sh)
196196
cstprof = sh * scurve(s-lf,0.,bf) + (1.-sh) * scurve(s - (1.-sf),0.,sf)
197197
end function cstprof
198198

199-
!> Distance between points x,y and a line segment (x0,y0) and (x0,y1).
199+
!> Distance between points x,y and a line segment (x0,y0) and (x0,y1) in arbitrary units [A].
200200
real function dist_line_fixed_x(x, y, x0, y0, y1)
201201
real, intent(in) :: x !< X-coordinate in arbitrary units [A]
202202
real, intent(in) :: y !< Y-coordinate in arbitrary units [A]
@@ -211,7 +211,7 @@ real function dist_line_fixed_x(x, y, x0, y0, y1)
211211
dist_line_fixed_x = sqrt( (dx*dx) + (dy*dy) )
212212
end function dist_line_fixed_x
213213

214-
!> Distance between points x,y and a line segment (x0,y0) and (x1,y0).
214+
!> Distance between points x,y and a line segment (x0,y0) and (x1,y0) in arbitrary units [A].
215215
real function dist_line_fixed_y(x, y, x0, x1, y0)
216216
real, intent(in) :: x !< X-coordinate in arbitrary units [A]
217217
real, intent(in) :: y !< Y-coordinate in arbitrary units [A]
@@ -222,7 +222,7 @@ real function dist_line_fixed_y(x, y, x0, x1, y0)
222222
dist_line_fixed_y = dist_line_fixed_x(y, x, y0, x0, x1)
223223
end function dist_line_fixed_y
224224

225-
!> An "angled coast profile".
225+
!> An "angled coast profile" [nondim].
226226
real function angled_coast(lon, lat, lon_eq, lat_mer, dr, sh)
227227
real, intent(in) :: lon !< Longitude [degrees_E]
228228
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -238,7 +238,7 @@ real function angled_coast(lon, lat, lon_eq, lat_mer, dr, sh)
238238
angled_coast = cstprof(r, 0., dr, 0.125, 0.125, 0.5, sh)
239239
end function angled_coast
240240

241-
!> A "coast profile" applied in an N-S line from lonC,lat0 to lonC,lat1.
241+
!> A "coast profile" applied in an N-S line from lonC,lat0 to lonC,lat1 [nondim].
242242
real function NS_coast(lon, lat, lonC, lat0, lat1, dlon, sh)
243243
real, intent(in) :: lon !< Longitude [degrees_E]
244244
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -253,7 +253,7 @@ real function NS_coast(lon, lat, lonC, lat0, lat1, dlon, sh)
253253
NS_coast = cstprof(r, 0., dlon, 0.125, 0.125, 0.5, sh)
254254
end function NS_coast
255255

256-
!> A "coast profile" applied in an E-W line from lon0,latC to lon1,latC.
256+
!> A "coast profile" applied in an E-W line from lon0,latC to lon1,latC [nondim].
257257
real function EW_coast(lon, lat, latC, lon0, lon1, dlat, sh)
258258
real, intent(in) :: lon !< Longitude [degrees_E]
259259
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -268,7 +268,7 @@ real function EW_coast(lon, lat, latC, lon0, lon1, dlat, sh)
268268
EW_coast = cstprof(r, 0., dlat, 0.125, 0.125, 0.5, sh)
269269
end function EW_coast
270270

271-
!> A NS ridge with a cone profile
271+
!> A NS ridge with a cone profile [nondim]
272272
real function NS_conic_ridge(lon, lat, lonC, lat0, lat1, dlon, rh)
273273
real, intent(in) :: lon !< Longitude [degrees_E]
274274
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -283,7 +283,7 @@ real function NS_conic_ridge(lon, lat, lonC, lat0, lat1, dlon, rh)
283283
NS_conic_ridge = 1. - rh * cone(r, 0., dlon)
284284
end function NS_conic_ridge
285285

286-
!> A NS ridge with an scurve profile
286+
!> A NS ridge with an scurve profile [nondim]
287287
real function NS_scurve_ridge(lon, lat, lonC, lat0, lat1, dlon, rh)
288288
real, intent(in) :: lon !< Longitude [degrees_E]
289289
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -298,7 +298,7 @@ real function NS_scurve_ridge(lon, lat, lonC, lat0, lat1, dlon, rh)
298298
NS_scurve_ridge = 1. - rh * (1. - scurve(r, 0., dlon) )
299299
end function NS_scurve_ridge
300300

301-
!> A circular ridge with cutoff conic profile
301+
!> A circular ridge with cutoff conic profile [nondim]
302302
real function circ_conic_ridge(lon, lat, lon0, lat0, ring_radius, ring_thickness, ridge_height)
303303
real, intent(in) :: lon !< Longitude [degrees_E]
304304
real, intent(in) :: lat !< Latitude [degrees_N]
@@ -316,7 +316,7 @@ real function circ_conic_ridge(lon, lat, lon0, lat0, ring_radius, ring_thickness
316316
circ_conic_ridge = 1. - frac_ht ! nondim depths (1-frac_ridge_height) .. 1
317317
end function circ_conic_ridge
318318

319-
!> A circular ridge with cutoff scurve profile
319+
!> A circular ridge with cutoff scurve profile [nondim]
320320
real function circ_scurve_ridge(lon, lat, lon0, lat0, ring_radius, ring_thickness, ridge_height)
321321
real, intent(in) :: lon !< Longitude [degrees_E]
322322
real, intent(in) :: lat !< Latitude [degrees_N]

0 commit comments

Comments
 (0)