Skip to content

Commit a499f36

Browse files
committed
+Initialize thicknesses in height units
Pass arguments in height units rather than thickness units to most of the routines that initialize thickness or temperatures and salinities. These routines are already undoing this scaling and working in height units, and it is not possible to convert thicknesses to thickness units in non-Boussinesq mode until the temperatures and salinities are also known. The routines whose argument units are altered include: - initialize_thickness_uniform - initialize_thickness_list - DOME_initialize_thickness - ISOMIP_initialize_thickness - benchmark_initialize_thickness - Neverworld_initialize_thickness - circle_obcs_initialize_thickness - lock_exchange_initialize_thickness - external_gwave_initialize_thickness - DOME2d_initialize_thickness - adjustment_initialize_thickness - sloshing_initialize_thickness - seamount_initialize_thickness - dumbbell_initialize_thickness - soliton_initialize_thickness - Phillips_initialize_thickness - Rossby_front_initialize_thickness - user_initialize_thickness - DOME2d_initialize_temperature_salinity - ISOMIP_initialize_temperature_salinity - adjustment_initialize_temperature_salinity - baroclinic_zone_init_temperature_salinity - sloshing_initialize_temperature_salinity - seamount_initialize_temperature_salinity - dumbbell_initialize_temperature_salinity - Rossby_front_initialize_temperature_salinity - SCM_CVMix_tests_TS_init - dense_water_initialize_TS - adjustEtaToFitBathymetry Similar changes were made internally to MOM_temp_salt_initialize_from_Z to defer the transition to working in thickness units, although the appropriate call to convert_thickness does still occur within MOM_temp_salt_initialize_from_Z and the units of its arguments are not changed. The routine convert thickness was modified to work with a new input depth space input thickness argument and return a thickness in thickness units, and it is now being called after all of the routines to initialize thicknesses and temperatures and salinities, except in the few cases where the thickness are being specified directly in mass-based thickness units, as might happen when they are read from an input file. The new option "mass_file" is now a recognized option for the THICKNESS_CONFIG runtime parameter, and this information is passed in the new mass_file argument to initialize_thickness_from_file. The description of the runtime parameter THICKNESS_IC_RESCALE was updated to reflect this change. The unused thickness (h) argument to soliton_initialize_velocity was eliminated. The unused thickness (h) argument to determine_temperature was eliminated, as was the unused optional h_massless argument to the same function. This commit also rearranges the calls to do adjustments to the thicknesses to account for the presence of an ice shelf or to iteratively apply the ALE remapping to occur before the velocities are initialized, so that there is a clearer separation of the phases of the initialization. Also added optional height_units argument to ALE_initThicknessToCoord to specify that the coordinate are to be returned in height_units. If it is omitted or false, the previous thickness units are returned, but when called from MOM_initialize_state the new argument is being used. The runtime parameter CONVERT_THICKNESS_UNITS is no longer meaningful, so it has been obsoleted. All answers are bitwise identical, but there are multiple changes to the arguments to publicly visible subroutines or their units, and there are changes to the contents of the MOM_parameter_doc files.
1 parent 975651a commit a499f36

23 files changed

Lines changed: 295 additions & 267 deletions

src/ALE/MOM_ALE.F90

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,17 +1463,23 @@ subroutine ALE_writeCoordinateFile( CS, GV, directory )
14631463
end subroutine ALE_writeCoordinateFile
14641464

14651465
!> Set h to coordinate values for fixed coordinate systems
1466-
subroutine ALE_initThicknessToCoord( CS, G, GV, h )
1466+
subroutine ALE_initThicknessToCoord( CS, G, GV, h, height_units )
14671467
type(ALE_CS), intent(inout) :: CS !< module control structure
14681468
type(ocean_grid_type), intent(in) :: G !< module grid structure
14691469
type(verticalGrid_type), intent(in) :: GV !< Ocean vertical grid structure
1470-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: h !< layer thickness [H ~> m or kg m-2]
1470+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: h !< layer thickness in thickness units
1471+
!! [H ~> m or kg m-2] or height units [Z ~> m]
1472+
logical, optional, intent(in) :: height_units !< If present and true, the
1473+
!! thicknesses are in height units
14711474

14721475
! Local variables
1476+
real :: scale ! A scaling value for the thicknesses [nondim] or [H Z-1 ~> nondim or kg m-3]
14731477
integer :: i, j
14741478

1479+
scale = GV%Z_to_H
1480+
if (present(height_units)) then ; if (height_units) scale = 1.0 ; endif
14751481
do j = G%jsd,G%jed ; do i = G%isd,G%ied
1476-
h(i,j,:) = GV%Z_to_H * getStaticThickness( CS%regridCS, 0., G%bathyT(i,j)+G%Z_ref )
1482+
h(i,j,:) = scale * getStaticThickness( CS%regridCS, 0., G%bathyT(i,j)+G%Z_ref )
14771483
enddo ; enddo
14781484

14791485
end subroutine ALE_initThicknessToCoord

src/diagnostics/MOM_obsolete_params.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ subroutine find_obsolete_params(param_file)
5656
hint="Instead use OBC_SEGMENT_xxx_VELOCITY_NUDGING_TIMESCALES.")
5757
enddo
5858

59+
call obsolete_logical(param_file, "CONVERT_THICKNESS_UNITS", .true.)
5960
call obsolete_logical(param_file, "MASK_MASSLESS_TRACERS", .false.)
6061

6162
call obsolete_logical(param_file, "SALT_REJECT_BELOW_ML", .false.)

src/initialization/MOM_state_initialization.F90

Lines changed: 165 additions & 139 deletions
Large diffs are not rendered by default.

src/tracer/MOM_tracer_Z_init.F90

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -556,29 +556,24 @@ end function find_limited_slope
556556

557557
!> This subroutine determines the potential temperature and salinity that
558558
!! is consistent with the target density using provided initial guess
559-
subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, h, k_start, G, GV, US, &
560-
PF, just_read, h_massless)
559+
subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, k_start, G, GV, US, PF, &
560+
just_read)
561561
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure
562562
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
563563
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
564564
intent(inout) :: temp !< potential temperature [C ~> degC]
565565
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
566566
intent(inout) :: salt !< salinity [S ~> ppt]
567567
real, dimension(SZK_(GV)), intent(in) :: R_tgt !< desired potential density [R ~> kg m-3].
568-
type(EOS_type), intent(in) :: EOS !< seawater equation of state control structure
568+
type(EOS_type), intent(in) :: EOS !< seawater equation of state control structure
569569
real, intent(in) :: p_ref !< reference pressure [R L2 T-2 ~> Pa].
570570
integer, intent(in) :: niter !< maximum number of iterations
571571
integer, intent(in) :: k_start !< starting index (i.e. below the buffer layer)
572-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
573-
intent(in) :: h !< layer thickness, used only to avoid working on
574-
!! massless layers [H ~> m or kg m-2]
575572
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
576573
type(param_file_type), intent(in) :: PF !< A structure indicating the open file
577574
!! to parse for model parameter values.
578575
logical, intent(in) :: just_read !< If true, this call will only read
579576
!! parameters without changing T or S.
580-
real, optional, intent(in) :: h_massless !< A threshold below which a layer is
581-
!! determined to be massless [H ~> m or kg m-2]
582577

583578
! Local variables (All of which need documentation!)
584579
real, dimension(SZI_(G),SZK_(GV)) :: &
@@ -587,7 +582,6 @@ subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, h, k_star
587582
dT, & ! An estimated change in temperature before bounding [C ~> degC]
588583
dS, & ! An estimated change in salinity before bounding [S ~> ppt]
589584
rho, & ! Layer densities with the current estimate of temperature and salinity [R ~> kg m-3]
590-
hin, & ! A 2D copy of the layer thicknesses [H ~> m or kg m-2]
591585
drho_dT, & ! Partial derivative of density with temperature [R C-1 ~> kg m-3 degC-1]
592586
drho_dS ! Partial derivative of density with salinity [R S-1 ~> kg m-3 ppt-1]
593587
real, dimension(SZI_(G)) :: press ! Reference pressures [R L2 T-2 ~> Pa]
@@ -675,7 +669,6 @@ subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, h, k_star
675669
dS(:,:) = 0. ! Needs to be zero everywhere since there is a maxval(abs(dS)) later...
676670
T(:,:) = temp(:,j,:)
677671
S(:,:) = salt(:,j,:)
678-
hin(:,:) = h(:,j,:)
679672
dT(:,:) = 0.0
680673
adjust_salt = .true.
681674
iter_loop: do itt = 1,niter
@@ -685,7 +678,7 @@ subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, h, k_star
685678
EOS, EOSdom )
686679
enddo
687680
do k=k_start,nz ; do i=is,ie
688-
! if (abs(rho(i,k)-R_tgt(k))>tol_rho .and. hin(i,k)>h_massless .and. abs(T(i,k)-land_fill) < epsln) then
681+
! if (abs(rho(i,k)-R_tgt(k))>tol_rho .and. abs(T(i,k)-land_fill) < epsln) then
689682
if (abs(rho(i,k)-R_tgt(k))>tol_rho) then
690683
if (.not.fit_together) then
691684
dT(i,k) = max(min((R_tgt(k)-rho(i,k)) / drho_dT(i,k), max_t_adj), -max_t_adj)
@@ -713,7 +706,7 @@ subroutine determine_temperature(temp, salt, R_tgt, EOS, p_ref, niter, h, k_star
713706
EOS, EOSdom )
714707
enddo
715708
do k=k_start,nz ; do i=is,ie
716-
! if (abs(rho(i,k)-R_tgt(k))>tol_rho .and. hin(i,k)>h_massless .and. abs(T(i,k)-land_fill) < epsln ) then
709+
! if (abs(rho(i,k)-R_tgt(k))>tol_rho .and. abs(T(i,k)-land_fill) < epsln ) then
717710
if (abs(rho(i,k)-R_tgt(k)) > tol_rho) then
718711
dS(i,k) = max(min((R_tgt(k)-rho(i,k)) / drho_dS(i,k), max_s_adj), -max_s_adj)
719712
S(i,k) = max(min(S(i,k)+dS(i,k), S_max), S_min)

src/user/DOME2d_initialization.F90

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ju
9898
type(verticalGrid_type), intent(in) :: GV !< Vertical grid structure
9999
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
100100
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
101-
intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2].
101+
intent(out) :: h !< The thickness that is being initialized [Z ~> m]
102102
real, dimension(SZI_(G),SZJ_(G)), &
103103
intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m]
104104
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
@@ -158,16 +158,16 @@ subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ju
158158
eta1D(k) = e0(k)
159159
if (eta1D(k) < (eta1D(k+1) + GV%Angstrom_Z)) then
160160
eta1D(k) = eta1D(k+1) + GV%Angstrom_Z
161-
h(i,j,k) = GV%Angstrom_H
161+
h(i,j,k) = GV%Angstrom_Z
162162
else
163-
h(i,j,k) = GV%Z_to_H * (eta1D(k) - eta1D(k+1))
163+
h(i,j,k) = eta1D(k) - eta1D(k+1)
164164
endif
165165
enddo
166166

167167
x = ( G%geoLonT(i,j) - G%west_lon ) / G%len_lon
168168
if ( x <= dome2d_width_bay ) then
169-
h(i,j,1:nz-1) = GV%Angstrom_H
170-
h(i,j,nz) = GV%Z_to_H * dome2d_depth_bay * G%max_depth - (nz-1) * GV%Angstrom_H
169+
h(i,j,1:nz-1) = GV%Angstrom_Z
170+
h(i,j,nz) = dome2d_depth_bay * G%max_depth - (nz-1) * GV%Angstrom_Z
171171
endif
172172

173173
enddo ; enddo
@@ -180,16 +180,16 @@ subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ju
180180
! eta1D(k) = e0(k)
181181
! if (eta1D(k) < (eta1D(k+1) + min_thickness)) then
182182
! eta1D(k) = eta1D(k+1) + min_thickness
183-
! h(i,j,k) = GV%Z_to_H * min_thickness
183+
! h(i,j,k) = min_thickness
184184
! else
185-
! h(i,j,k) = GV%Z_to_H * (eta1D(k) - eta1D(k+1))
185+
! h(i,j,k) = eta1D(k) - eta1D(k+1)
186186
! endif
187187
! enddo
188188
!
189189
! x = G%geoLonT(i,j) / G%len_lon
190190
! if ( x <= dome2d_width_bay ) then
191-
! h(i,j,1:nz-1) = GV%Z_to_H * min_thickness
192-
! h(i,j,nz) = GV%Z_to_H * (dome2d_depth_bay * G%max_depth - (nz-1) * min_thickness)
191+
! h(i,j,1:nz-1) = min_thickness
192+
! h(i,j,nz) = dome2d_depth_bay * G%max_depth - (nz-1) * min_thickness
193193
! endif
194194
!
195195
! enddo ; enddo
@@ -202,16 +202,16 @@ subroutine DOME2d_initialize_thickness ( h, depth_tot, G, GV, US, param_file, ju
202202
eta1D(k) = e0(k)
203203
if (eta1D(k) < (eta1D(k+1) + min_thickness)) then
204204
eta1D(k) = eta1D(k+1) + min_thickness
205-
h(i,j,k) = GV%Z_to_H * min_thickness
205+
h(i,j,k) = min_thickness
206206
else
207-
h(i,j,k) = GV%Z_to_H * (eta1D(k) - eta1D(k+1))
207+
h(i,j,k) = eta1D(k) - eta1D(k+1)
208208
endif
209209
enddo
210210
enddo ; enddo
211211

212212
case ( REGRIDDING_SIGMA )
213213
do j=js,je ; do i=is,ie
214-
h(i,j,:) = GV%Z_to_H*depth_tot(i,j) / nz
214+
h(i,j,:) = depth_tot(i,j) / nz
215215
enddo ; enddo
216216

217217
case default
@@ -225,11 +225,11 @@ end subroutine DOME2d_initialize_thickness
225225

226226
!> Initialize temperature and salinity in the 2d DOME configuration
227227
subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, US, param_file, just_read)
228-
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
228+
type(ocean_grid_type), intent(in) :: G !< Ocean grid structure
229229
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
230-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [C ~> degC]
231-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Salinity [S ~> ppt]
232-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2]
230+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [C ~> degC]
231+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Salinity [S ~> ppt]
232+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [Z ~> m]
233233
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
234234
type(param_file_type), intent(in) :: param_file !< Parameter file structure
235235
logical, intent(in) :: just_read !< If true, this call will
@@ -287,7 +287,7 @@ subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, US, param_fi
287287
do j=js,je ; do i=is,ie
288288
xi0 = 0.0
289289
do k = 1,nz
290-
xi1 = xi0 + (GV%H_to_Z * h(i,j,k)) / G%max_depth
290+
xi1 = xi0 + h(i,j,k) / G%max_depth
291291
S(i,j,k) = S_surf + 0.5 * S_range * (xi0 + xi1)
292292
xi0 = xi1
293293
enddo
@@ -298,7 +298,7 @@ subroutine DOME2d_initialize_temperature_salinity ( T, S, h, G, GV, US, param_fi
298298
do j=js,je ; do i=is,ie
299299
xi0 = 0.0
300300
do k = 1,nz
301-
xi1 = xi0 + (GV%H_to_Z * h(i,j,k)) / G%max_depth
301+
xi1 = xi0 + h(i,j,k) / G%max_depth
302302
S(i,j,k) = S_surf + 0.5 * S_range * (xi0 + xi1)
303303
xi0 = xi1
304304
enddo

src/user/DOME_initialization.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ subroutine DOME_initialize_thickness(h, depth_tot, G, GV, param_file, just_read)
105105
type(ocean_grid_type), intent(in) :: G !< The ocean's grid structure.
106106
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
107107
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
108-
intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2].
108+
intent(out) :: h !< The thickness that is being initialized [Z ~> m]
109109
real, dimension(SZI_(G),SZJ_(G)), &
110110
intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m]
111111
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
@@ -141,9 +141,9 @@ subroutine DOME_initialize_thickness(h, depth_tot, G, GV, param_file, just_read)
141141
eta1D(K) = e0(K)
142142
if (eta1D(K) < (eta1D(K+1) + GV%Angstrom_Z)) then
143143
eta1D(K) = eta1D(K+1) + GV%Angstrom_Z
144-
h(i,j,k) = GV%Angstrom_H
144+
h(i,j,k) = GV%Angstrom_Z
145145
else
146-
h(i,j,k) = GV%Z_to_H * (eta1D(K) - eta1D(K+1))
146+
h(i,j,k) = eta1D(K) - eta1D(K+1)
147147
endif
148148
enddo
149149
enddo ; enddo

src/user/ISOMIP_initialization.F90

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv
143143
type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure.
144144
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
145145
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
146-
intent(out) :: h !< The thickness that is being initialized [H ~> m or kg m-2].
146+
intent(out) :: h !< The thickness that is being initialized [Z ~> m]
147147
real, dimension(SZI_(G),SZJ_(G)), &
148148
intent(in) :: depth_tot !< The nominal total depth of the ocean [Z ~> m]
149149
type(param_file_type), intent(in) :: param_file !< A structure indicating the open file
@@ -170,7 +170,7 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv
170170
is = G%isc ; ie = G%iec ; js = G%jsc ; je = G%jec ; nz = GV%ke
171171

172172
if (.not.just_read) &
173-
call MOM_mesg("MOM_initialization.F90, initialize_thickness_uniform: setting thickness")
173+
call MOM_mesg("ISOMIP_initialization.F90, ISOMIP_initialize_thickness: setting thickness")
174174

175175
call get_param(param_file, mdl,"MIN_THICKNESS", min_thickness, &
176176
'Minimum layer thickness', units='m', default=1.e-3, do_not_log=just_read, scale=US%m_to_Z)
@@ -225,9 +225,9 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv
225225
eta1D(k) = e0(k)
226226
if (eta1D(k) < (eta1D(k+1) + GV%Angstrom_Z)) then
227227
eta1D(k) = eta1D(k+1) + GV%Angstrom_Z
228-
h(i,j,k) = GV%Angstrom_H
228+
h(i,j,k) = GV%Angstrom_Z
229229
else
230-
h(i,j,k) = GV%Z_to_H * (eta1D(k) - eta1D(k+1))
230+
h(i,j,k) = eta1D(k) - eta1D(k+1)
231231
endif
232232
enddo
233233
enddo ; enddo
@@ -240,17 +240,17 @@ subroutine ISOMIP_initialize_thickness ( h, depth_tot, G, GV, US, param_file, tv
240240
eta1D(k) = -G%max_depth * real(k-1) / real(nz)
241241
if (eta1D(k) < (eta1D(k+1) + min_thickness)) then
242242
eta1D(k) = eta1D(k+1) + min_thickness
243-
h(i,j,k) = GV%Z_to_H * min_thickness
243+
h(i,j,k) = min_thickness
244244
else
245-
h(i,j,k) = GV%Z_to_H * (eta1D(k) - eta1D(k+1))
245+
h(i,j,k) = eta1D(k) - eta1D(k+1)
246246
endif
247247
enddo
248248
enddo ; enddo
249249

250250
case ( REGRIDDING_SIGMA ) ! Initial thicknesses for sigma coordinates
251251
if (just_read) return ! All run-time parameters have been read, so return.
252252
do j=js,je ; do i=is,ie
253-
h(i,j,:) = GV%Z_to_H * depth_tot(i,j) / real(nz)
253+
h(i,j,:) = depth_tot(i,j) / real(nz)
254254
enddo ; enddo
255255

256256
case default
@@ -269,7 +269,7 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U
269269
type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
270270
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: T !< Potential temperature [C ~> degC]
271271
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(out) :: S !< Salinity [S ~> ppt]
272-
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [H ~> m or kg m-2]
272+
real, dimension(SZI_(G),SZJ_(G),SZK_(GV)), intent(in) :: h !< Layer thickness [Z ~> m]
273273
real, dimension(SZI_(G),SZJ_(G)), intent(in) :: depth_tot !< The nominal total bottom-to-top
274274
!! depth of the ocean [Z ~> m]
275275
type(param_file_type), intent(in) :: param_file !< Parameter file structure
@@ -334,10 +334,10 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U
334334
do j=js,je ; do i=is,ie
335335
xi0 = -depth_tot(i,j)
336336
do k = nz,1,-1
337-
xi0 = xi0 + 0.5 * h(i,j,k) * GV%H_to_Z ! Depth in middle of layer
337+
xi0 = xi0 + 0.5 * h(i,j,k) ! Depth in middle of layer
338338
S(i,j,k) = S_sur + dS_dz * xi0
339339
T(i,j,k) = T_sur + dT_dz * xi0
340-
xi0 = xi0 + 0.5 * h(i,j,k) * GV%H_to_Z ! Depth at top of layer
340+
xi0 = xi0 + 0.5 * h(i,j,k) ! Depth at top of layer
341341
enddo
342342
enddo ; enddo
343343

@@ -372,10 +372,10 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U
372372
xi0 = 0.0
373373
do k = 1,nz
374374
!T0(k) = T_Ref; S0(k) = S_Ref
375-
xi1 = xi0 + 0.5 * h(i,j,k) * GV%H_to_Z
375+
xi1 = xi0 + 0.5 * h(i,j,k)
376376
S0(k) = S_sur - dS_dz * xi1
377377
T0(k) = T_sur - dT_dz * xi1
378-
xi0 = xi0 + h(i,j,k) * GV%H_to_Z
378+
xi0 = xi0 + h(i,j,k)
379379
! write(mesg,*) 'S,T,xi0,xi1,k',S0(k),T0(k),xi0,xi1,k
380380
! call MOM_mesg(mesg,5)
381381
enddo
@@ -430,7 +430,7 @@ subroutine ISOMIP_initialize_temperature_salinity ( T, S, h, depth_tot, G, GV, U
430430
!i=G%iec; j=G%jec
431431
!do k = 1,nz
432432
! call calculate_density(T(i,j,k), S(i,j,k),0.0,rho_tmp,eqn_of_state, scale=US%kg_m3_to_R)
433-
! write(mesg,*) 'k,h,T,S,rho,Rlay',k,h(i,j,k),US%C_to_degC*T(i,j,k),US%S_to_ppt*S(i,j,k),rho_tmp,GV%Rlay(k)
433+
! write(mesg,*) 'k,h,T,S,rho,Rlay',k,US%Z_to_m*h(i,j,k),US%C_to_degC*T(i,j,k),US%S_to_ppt*S(i,j,k),rho_tmp,GV%Rlay(k)
434434
! call MOM_mesg(mesg,5)
435435
!enddo
436436

0 commit comments

Comments
 (0)