@@ -49,18 +49,28 @@ subroutine DOME_initialize_topography(D, G, param_file, max_depth, US)
49
49
real :: min_depth ! The minimum ocean depth [Z ~> m]
50
50
real :: shelf_depth ! The ocean depth on the shelf in the DOME configuration [Z ~> m]
51
51
real :: slope ! The bottom slope in the DOME configuration [Z L-1 ~> nondim]
52
- real :: shelf_edge_lat ! The latitude of the edge of the topographic shelf [km]
53
- real :: inflow_lon ! The edge longitude of the DOME inflow [km]
54
- real :: inflow_width ! The longitudinal width of the DOME inflow channel [km]
55
- real :: km_to_L ! The conversion factor from the units of latitude to L [L km-1 ~> 1e3]
52
+ real :: shelf_edge_lat ! The latitude of the edge of the topographic shelf in the same units as geolat, often [km]
53
+ real :: inflow_lon ! The edge longitude of the DOME inflow in the same units as geolon, often [km]
54
+ real :: inflow_width ! The longitudinal width of the DOME inflow channel in the same units as geolat, often [km]
55
+ real :: km_to_grid_unit ! The conversion factor from km to the units of latitude often 1 [nondim],
56
+ ! but this could be 1000 [m km-1]
56
57
! This include declares and sets the variable "version".
57
58
# include " version_variable.h"
58
59
character (len= 40 ) :: mdl = " DOME_initialize_topography" ! This subroutine's name.
59
60
integer :: i, j, is, ie, js, je, isd, ied, jsd, jed
60
61
is = G% isc ; ie = G% iec ; js = G% jsc ; je = G% jec
61
62
isd = G% isd ; ied = G% ied ; jsd = G% jsd ; jed = G% jed
62
63
63
- km_to_L = 1.0e3 * US% m_to_L
64
+ if (G% grid_unit_to_L <= 0 .) call MOM_error(FATAL, " DOME_initialization: " // &
65
+ " DOME_initialize_topography is only set to work with Cartesian axis units." )
66
+ if (abs (G% grid_unit_to_L* US% L_to_m - 1000.0 ) < 1.0e-3 ) then ! The grid latitudes are in km.
67
+ km_to_grid_unit = 1.0
68
+ elseif (abs (G% grid_unit_to_L* US% L_to_m - 1.0 ) < 1.0e-6 ) then ! The grid latitudes are in m.
69
+ km_to_grid_unit = 1000.0
70
+ else
71
+ call MOM_error(FATAL, " DOME_initialization: " // &
72
+ " DOME_initialize_topography is not recognizing the value of G%grid_unit_to_L." )
73
+ endif
64
74
65
75
call MOM_mesg(" DOME_initialization.F90, DOME_initialize_topography: setting topography" , 5 )
66
76
@@ -75,15 +85,16 @@ subroutine DOME_initialize_topography(D, G, param_file, max_depth, US)
75
85
default= 600.0 , units= " m" , scale= US% m_to_Z)
76
86
call get_param(param_file, mdl, " DOME_SHELF_EDGE_LAT" , shelf_edge_lat, &
77
87
" The latitude of the shelf edge in the DOME configuration." , &
78
- default= 600.0 , units= " km" )
88
+ default= 600.0 , units= " km" , scale = km_to_grid_unit )
79
89
call get_param(param_file, mdl, " DOME_INFLOW_LON" , inflow_lon, &
80
- " The edge longitude of the DOME inflow." , units= " km" , default= 1000.0 )
90
+ " The edge longitude of the DOME inflow." , units= " km" , default= 1000.0 , scale = km_to_grid_unit )
81
91
call get_param(param_file, mdl, " DOME_INFLOW_WIDTH" , inflow_width, &
82
- " The longitudinal width of the DOME inflow channel." , units= " km" , default= 100.0 )
92
+ " The longitudinal width of the DOME inflow channel." , &
93
+ units= " km" , default= 100.0 , scale= km_to_grid_unit)
83
94
84
95
do j= js,je ; do i= is,ie
85
96
if (G% geoLatT(i,j) < shelf_edge_lat) then
86
- D(i,j) = min (shelf_depth - slope * (G% geoLatT(i,j)- shelf_edge_lat)* km_to_L , max_depth)
97
+ D(i,j) = min (shelf_depth - slope * (G% geoLatT(i,j)- shelf_edge_lat)* G % grid_unit_to_L , max_depth)
87
98
else
88
99
if ((G% geoLonT(i,j) > inflow_lon) .AND. (G% geoLonT(i,j) < inflow_lon+ inflow_width)) then
89
100
D(i,j) = shelf_depth
@@ -177,7 +188,6 @@ subroutine DOME_initialize_sponges(G, GV, US, tv, depth_tot, PF, CSp)
177
188
real :: min_depth ! The minimum depth at which to apply damping [Z ~> m]
178
189
real :: damp_W, damp_E ! Damping rates in the western and eastern sponges [T-1 ~> s-1]
179
190
real :: peak_damping ! The maximum sponge damping rates as the edges [T-1 ~> s-1]
180
- real :: km_to_L ! The conversion factor from the units of longitude to L [L km-1 ~> 1e3]
181
191
real :: edge_dist ! The distance to an edge [L ~> m]
182
192
real :: sponge_width ! The width of the sponges [L ~> m]
183
193
character (len= 40 ) :: mdl = " DOME_initialize_sponges" ! This subroutine's name.
@@ -186,7 +196,8 @@ subroutine DOME_initialize_sponges(G, GV, US, tv, depth_tot, PF, CSp)
186
196
is = G% isc ; ie = G% iec ; js = G% jsc ; je = G% jec ; nz = GV% ke
187
197
isd = G% isd ; ied = G% ied ; jsd = G% jsd ; jed = G% jed
188
198
189
- km_to_L = 1.0e3 * US% m_to_L
199
+ if (G% grid_unit_to_L <= 0 .) call MOM_error(FATAL, " DOME_initialization: " // &
200
+ " DOME_initialize_sponges is only set to work with Cartesian axis units." )
190
201
191
202
! Set up sponges for the DOME configuration
192
203
call get_param(PF, mdl, " MINIMUM_DEPTH" , min_depth, &
@@ -196,15 +207,15 @@ subroutine DOME_initialize_sponges(G, GV, US, tv, depth_tot, PF, CSp)
196
207
default= 10.0 , units= " day-1" , scale= 1.0 / (86400.0 * US% s_to_T))
197
208
call get_param(PF, mdl, " DOME_SPONGE_WIDTH" , sponge_width, &
198
209
" The width of the the DOME sponges." , &
199
- default= 200.0 , units= " km" , scale= km_to_L )
210
+ default= 200.0 , units= " km" , scale= 1.0e3 * US % m_to_L )
200
211
201
212
! Here the inverse damping time [T-1 ~> s-1], is set. Set Idamp to 0 wherever
202
213
! there is no sponge, and the subroutines that are called will automatically
203
214
! set up the sponges only where Idamp is positive and mask2dT is 1.
204
215
205
216
Idamp(:,:) = 0.0
206
217
do j= js,je ; do i= is,ie ; if (depth_tot(i,j) > min_depth) then
207
- edge_dist = (G% geoLonT(i,j) - G% west_lon) * km_to_L
218
+ edge_dist = (G% geoLonT(i,j) - G% west_lon) * G % grid_unit_to_L
208
219
if (edge_dist < 0.5 * sponge_width) then
209
220
damp_W = peak_damping
210
221
elseif (edge_dist < sponge_width) then
@@ -213,7 +224,7 @@ subroutine DOME_initialize_sponges(G, GV, US, tv, depth_tot, PF, CSp)
213
224
damp_W = 0.0
214
225
endif
215
226
216
- edge_dist = ((G% len_lon + G% west_lon) - G% geoLonT(i,j)) * km_to_L
227
+ edge_dist = ((G% len_lon + G% west_lon) - G% geoLonT(i,j)) * G % grid_unit_to_L
217
228
if (edge_dist < 0.5 * sponge_width) then
218
229
damp_E = peak_damping
219
230
elseif (edge_dist < sponge_width) then
@@ -328,10 +339,12 @@ subroutine DOME_set_OBC_data(OBC, tv, G, GV, US, PF, tr_Reg)
328
339
! properties [T-1 ~> s-1]
329
340
real :: g_prime_tot ! The reduced gravity across all layers [L2 Z-1 T-2 ~> m s-2]
330
341
real :: Def_Rad ! The deformation radius, based on fluid of thickness D_edge [L ~> m]
331
- real :: inflow_lon ! The edge longitude of the DOME inflow [km]
342
+ real :: inflow_lon ! The edge longitude of the DOME inflow in the same units as geolon, often [km]
332
343
real :: I_Def_Rad ! The inverse of the deformation radius in the same units as G%geoLon [km-1]
333
344
real :: Ri_trans ! The shear Richardson number in the transition
334
345
! region of the specified shear profile [nondim]
346
+ real :: km_to_grid_unit ! The conversion factor from km to the units of latitude often 1 [nondim],
347
+ ! but this could be 1000 [m km-1]
335
348
character (len= 32 ) :: name ! The name of a tracer field.
336
349
character (len= 40 ) :: mdl = " DOME_set_OBC_data" ! This subroutine's name.
337
350
integer :: i, j, k, itt, is, ie, js, je, isd, ied, jsd, jed, m, nz, ntherm, ntr_id
@@ -343,6 +356,17 @@ subroutine DOME_set_OBC_data(OBC, tv, G, GV, US, PF, tr_Reg)
343
356
isd = G% isd ; ied = G% ied ; jsd = G% jsd ; jed = G% jed
344
357
IsdB = G% IsdB ; IedB = G% IedB ; JsdB = G% JsdB ; JedB = G% JedB
345
358
359
+ if (G% grid_unit_to_L <= 0 .) call MOM_error(FATAL, " DOME_initialization: " // &
360
+ " DOME_initialize_topography is only set to work with Cartesian axis units." )
361
+ if (abs (G% grid_unit_to_L* US% L_to_m - 1000.0 ) < 1.0e-3 ) then ! The grid latitudes are in km.
362
+ km_to_grid_unit = 1.0
363
+ elseif (abs (G% grid_unit_to_L* US% L_to_m - 1.0 ) < 1.0e-6 ) then ! The grid latitudes are in m.
364
+ km_to_grid_unit = 1000.0
365
+ else
366
+ call MOM_error(FATAL, " DOME_initialization: " // &
367
+ " DOME_initialize_topography is not recognizing the value of G%grid_unit_to_L." )
368
+ endif
369
+
346
370
call get_param(PF, mdl, " DOME_INFLOW_THICKNESS" , D_edge, &
347
371
" The thickness of the dense DOME inflow at the inner edge." , &
348
372
default= 300.0 , units= " m" , scale= US% m_to_Z)
@@ -362,7 +386,7 @@ subroutine DOME_set_OBC_data(OBC, tv, G, GV, US, PF, tr_Reg)
362
386
" The value of the Coriolis parameter that is used to determine the DOME " // &
363
387
" inflow properties." , units= " s-1" , default= f_0* US% s_to_T, scale= US% T_to_s)
364
388
call get_param(PF, mdl, " DOME_INFLOW_LON" , inflow_lon, &
365
- " The edge longitude of the DOME inflow." , units= " km" , default= 1000.0 )
389
+ " The edge longitude of the DOME inflow." , units= " km" , default= 1000.0 , scale = km_to_grid_unit )
366
390
if (associated (tv% S) .or. associated (tv% T)) then
367
391
call get_param(PF, mdl, " S_REF" , S_ref, &
368
392
units= " ppt" , default= 35.0 , scale= US% ppt_to_S, do_not_log= .true. )
@@ -383,7 +407,9 @@ subroutine DOME_set_OBC_data(OBC, tv, G, GV, US, PF, tr_Reg)
383
407
tr_0 = (- D_edge* sqrt (D_edge* g_prime_tot)* 0.5 * Def_Rad) * (Rlay_Ref + 0.5 * Rlay_range) * GV% RZ_to_H
384
408
endif
385
409
386
- I_Def_Rad = 1.0 / (1.0e-3 * US% L_to_m* Def_Rad)
410
+ I_Def_Rad = 1.0 / ((1.0e-3 * US% L_to_m* km_to_grid_unit) * Def_Rad)
411
+ ! This is mathematically equivalent to
412
+ ! I_Def_Rad = G%grid_unit_to_L / Def_Rad
387
413
388
414
if (OBC% number_of_segments /= 1 ) then
389
415
call MOM_error(WARNING, ' Error in DOME OBC segment setup' , .true. )
0 commit comments