@@ -181,6 +181,7 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
181
181
logical :: om4_remap_via_sub_cells
182
182
type (hybgen_regrid_CS), pointer :: hybgen_regridCS = > NULL () ! Control structure for hybgen regridding
183
183
! for sharing parameters.
184
+ real :: h_neglect, h_neglect_edge ! small thicknesses [H ~> m or kg m-2]
184
185
185
186
if (associated (CS)) then
186
187
call MOM_error(WARNING, " ALE_init called with an associated " // &
@@ -248,20 +249,30 @@ subroutine ALE_init( param_file, GV, US, max_depth, CS)
248
249
default= default_answer_date, do_not_log= .not. GV% Boussinesq)
249
250
if (.not. GV% Boussinesq) CS% answer_date = max (CS% answer_date, 20230701 )
250
251
252
+ if (CS% answer_date >= 20190101 ) then
253
+ h_neglect = GV% H_subroundoff ; h_neglect_edge = GV% H_subroundoff
254
+ elseif (GV% Boussinesq) then
255
+ h_neglect = GV% m_to_H * 1.0e-30 ; h_neglect_edge = GV% m_to_H * 1.0e-10
256
+ else
257
+ h_neglect = GV% kg_m2_to_H * 1.0e-30 ; h_neglect_edge = GV% kg_m2_to_H * 1.0e-10
258
+ endif
259
+
251
260
call initialize_remapping( CS% remapCS, string, &
252
261
boundary_extrapolation= init_boundary_extrap, &
253
262
check_reconstruction= check_reconstruction, &
254
263
check_remapping= check_remapping, &
255
264
force_bounds_in_subcell= force_bounds_in_subcell, &
256
265
om4_remap_via_sub_cells= om4_remap_via_sub_cells, &
257
- answer_date= CS% answer_date)
266
+ answer_date= CS% answer_date, &
267
+ h_neglect= h_neglect, h_neglect_edge= h_neglect_edge)
258
268
call initialize_remapping( CS% vel_remapCS, vel_string, &
259
269
boundary_extrapolation= init_boundary_extrap, &
260
270
check_reconstruction= check_reconstruction, &
261
271
check_remapping= check_remapping, &
262
272
force_bounds_in_subcell= force_bounds_in_subcell, &
263
273
om4_remap_via_sub_cells= om4_remap_via_sub_cells, &
264
- answer_date= CS% answer_date)
274
+ answer_date= CS% answer_date, &
275
+ h_neglect= h_neglect, h_neglect_edge= h_neglect_edge)
265
276
266
277
call get_param(param_file, mdl, " PARTIAL_CELL_VELOCITY_REMAP" , CS% partial_cell_vel_remap, &
267
278
" If true, use partial cell thicknesses at velocity points that are masked out " // &
@@ -345,7 +356,7 @@ subroutine ALE_set_OM4_remap_algorithm( CS, om4_remap_via_sub_cells )
345
356
type (ALE_CS), pointer :: CS ! < Module control structure
346
357
logical , intent (in ) :: om4_remap_via_sub_cells ! < If true, use OM4 remapping algorithm
347
358
348
- call remapping_set_param(CS% remapCS, om4_remap_via_sub_cells = om4_remap_via_sub_cells )
359
+ call remapping_set_param(CS% remapCS, om4_remap_via_sub_cells= om4_remap_via_sub_cells )
349
360
350
361
end subroutine ALE_set_OM4_remap_algorithm
351
362
@@ -591,8 +602,8 @@ subroutine ALE_offline_inputs(CS, G, GV, US, h, tv, Reg, uhtr, vhtr, Kd, debug,
591
602
endif
592
603
enddo ; enddo
593
604
594
- call ALE_remap_scalar(CS% remapCS, G, GV, nk, h, tv% T, h_new, tv% T, answer_date = CS % answer_date )
595
- call ALE_remap_scalar(CS% remapCS, G, GV, nk, h, tv% S, h_new, tv% S, answer_date = CS % answer_date )
605
+ call ALE_remap_scalar(CS% remapCS, G, GV, nk, h, tv% T, h_new, tv% T)
606
+ call ALE_remap_scalar(CS% remapCS, G, GV, nk, h, tv% S, h_new, tv% S)
596
607
597
608
if (debug) call MOM_tracer_chkinv(" After ALE_offline_inputs" , G, GV, h_new, Reg% Tr, Reg% ntr)
598
609
@@ -653,7 +664,6 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
653
664
real , dimension (SZI_(G),SZJ_(G),SZK_(GV)+ 1 ) :: dzInterface ! Interface height changes within
654
665
! an iteration [H ~> m or kg m-2]
655
666
real , dimension (SZI_(G),SZJ_(G),SZK_(GV)+ 1 ) :: dzIntTotal ! Cumulative interface position changes [H ~> m or kg m-2]
656
- real :: h_neglect, h_neglect_edge ! small thicknesses [H ~> m or kg m-2]
657
667
658
668
nz = GV% ke
659
669
@@ -680,14 +690,6 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
680
690
if (present (dt)) &
681
691
call ALE_update_regrid_weights(dt, CS)
682
692
683
- if (CS% answer_date >= 20190101 ) then
684
- h_neglect = GV% H_subroundoff ; h_neglect_edge = GV% H_subroundoff
685
- elseif (GV% Boussinesq) then
686
- h_neglect = GV% m_to_H * 1.0e-30 ; h_neglect_edge = GV% m_to_H * 1.0e-10
687
- else
688
- h_neglect = GV% kg_m2_to_H * 1.0e-30 ; h_neglect_edge = GV% kg_m2_to_H * 1.0e-10
689
- endif
690
-
691
693
do itt = 1 , n_itt
692
694
693
695
call do_group_pass(pass_T_S_h, G% domain)
@@ -704,10 +706,8 @@ subroutine ALE_regrid_accelerated(CS, G, GV, US, h, tv, n_itt, u, v, OBC, Reg, d
704
706
705
707
! remap from original grid onto new grid
706
708
do j = G% jsc-1 ,G% jec+1 ; do i = G% isc-1 ,G% iec+1
707
- call remapping_core_h(CS% remapCS, nz, h_orig(i,j,:), tv% S(i,j,:), nz, h(i,j,:), tv_local% S(i,j,:), &
708
- h_neglect, h_neglect_edge)
709
- call remapping_core_h(CS% remapCS, nz, h_orig(i,j,:), tv% T(i,j,:), nz, h(i,j,:), tv_local% T(i,j,:), &
710
- h_neglect, h_neglect_edge)
709
+ call remapping_core_h(CS% remapCS, nz, h_orig(i,j,:), tv% S(i,j,:), nz, h(i,j,:), tv_local% S(i,j,:))
710
+ call remapping_core_h(CS% remapCS, nz, h_orig(i,j,:), tv% T(i,j,:), nz, h(i,j,:), tv_local% T(i,j,:))
711
711
enddo ; enddo
712
712
713
713
! starting grid for next iteration
@@ -763,22 +763,13 @@ subroutine ALE_remap_tracers(CS, G, GV, h_old, h_new, Reg, debug, dt, PCM_cell)
763
763
real :: Idt ! The inverse of the timestep [T-1 ~> s-1]
764
764
real :: h1(GV% ke) ! A column of source grid layer thicknesses [H ~> m or kg m-2]
765
765
real :: h2(GV% ke) ! A column of target grid layer thicknesses [H ~> m or kg m-2]
766
- real :: h_neglect, h_neglect_edge ! Tiny thicknesses used in remapping [H ~> m or kg m-2]
767
766
logical :: show_call_tree
768
767
type (tracer_type), pointer :: Tr = > NULL ()
769
768
integer :: i, j, k, m, nz, ntr
770
769
771
770
show_call_tree = .false.
772
771
if (present (debug)) show_call_tree = debug
773
772
774
- if (CS% answer_date >= 20190101 ) then
775
- h_neglect = GV% H_subroundoff ; h_neglect_edge = GV% H_subroundoff
776
- elseif (GV% Boussinesq) then
777
- h_neglect = GV% m_to_H* 1.0e-30 ; h_neglect_edge = GV% m_to_H* 1.0e-10
778
- else
779
- h_neglect = GV% kg_m2_to_H* 1.0e-30 ; h_neglect_edge = GV% kg_m2_to_H* 1.0e-10
780
- endif
781
-
782
773
if (show_call_tree) call callTree_enter(" ALE_remap_tracers(), MOM_ALE.F90" )
783
774
784
775
nz = GV% ke
@@ -803,11 +794,9 @@ subroutine ALE_remap_tracers(CS, G, GV, h_old, h_new, Reg, debug, dt, PCM_cell)
803
794
h2(:) = h_new(i,j,:)
804
795
if (present (PCM_cell)) then
805
796
PCM(:) = PCM_cell(i,j,:)
806
- call remapping_core_h(CS% remapCS, nz, h1, Tr% t(i,j,:), nz, h2, tr_column, &
807
- h_neglect, h_neglect_edge, PCM_cell= PCM)
797
+ call remapping_core_h(CS% remapCS, nz, h1, Tr% t(i,j,:), nz, h2, tr_column, PCM_cell= PCM)
808
798
else
809
- call remapping_core_h(CS% remapCS, nz, h1, Tr% t(i,j,:), nz, h2, tr_column, &
810
- h_neglect, h_neglect_edge)
799
+ call remapping_core_h(CS% remapCS, nz, h1, Tr% t(i,j,:), nz, h2, tr_column)
811
800
endif
812
801
813
802
! Possibly underflow any very tiny tracer concentrations to 0. Note that this is not conservative!
@@ -1091,22 +1080,13 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
1091
1080
real :: v_tgt(GV% ke) ! A column of v-velocities on the target grid [L T-1 ~> m s-1]
1092
1081
real :: h1(GV% ke) ! A column of source grid layer thicknesses [H ~> m or kg m-2]
1093
1082
real :: h2(GV% ke) ! A column of target grid layer thicknesses [H ~> m or kg m-2]
1094
- real :: h_neglect, h_neglect_edge ! Tiny thicknesses used in remapping [H ~> m or kg m-2]
1095
1083
logical :: show_call_tree
1096
1084
integer :: i, j, k, nz
1097
1085
1098
1086
show_call_tree = .false.
1099
1087
if (present (debug)) show_call_tree = debug
1100
1088
if (show_call_tree) call callTree_enter(" ALE_remap_velocities()" )
1101
1089
1102
- if (CS% answer_date >= 20190101 ) then
1103
- h_neglect = GV% H_subroundoff ; h_neglect_edge = GV% H_subroundoff
1104
- elseif (GV% Boussinesq) then
1105
- h_neglect = GV% m_to_H* 1.0e-30 ; h_neglect_edge = GV% m_to_H* 1.0e-10
1106
- else
1107
- h_neglect = GV% kg_m2_to_H* 1.0e-30 ; h_neglect_edge = GV% kg_m2_to_H* 1.0e-10
1108
- endif
1109
-
1110
1090
nz = GV% ke
1111
1091
1112
1092
! --- Remap u profiles from the source vertical grid onto the new target grid.
@@ -1120,8 +1100,7 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
1120
1100
u_src(k) = u(I,j,k)
1121
1101
enddo
1122
1102
1123
- call remapping_core_h(CS% vel_remapCS, nz, h1, u_src, nz, h2, u_tgt, &
1124
- h_neglect, h_neglect_edge)
1103
+ call remapping_core_h(CS% vel_remapCS, nz, h1, u_src, nz, h2, u_tgt)
1125
1104
1126
1105
if ((CS% BBL_h_vel_mask > 0.0 ) .and. (CS% h_vel_mask > 0.0 )) &
1127
1106
call mask_near_bottom_vel(u_tgt, h2, CS% BBL_h_vel_mask, CS% h_vel_mask, nz)
@@ -1146,8 +1125,7 @@ subroutine ALE_remap_velocities(CS, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, u
1146
1125
v_src(k) = v(i,J,k)
1147
1126
enddo
1148
1127
1149
- call remapping_core_h(CS% vel_remapCS, nz, h1, v_src, nz, h2, v_tgt, &
1150
- h_neglect, h_neglect_edge)
1128
+ call remapping_core_h(CS% vel_remapCS, nz, h1, v_src, nz, h2, v_tgt)
1151
1129
1152
1130
if ((CS% BBL_h_vel_mask > 0.0 ) .and. (CS% h_vel_mask > 0.0 )) then
1153
1131
call mask_near_bottom_vel(v_tgt, h2, CS% BBL_h_vel_mask, CS% h_vel_mask, nz)
@@ -1300,8 +1278,7 @@ end subroutine mask_near_bottom_vel
1300
1278
! > Remaps a single scalar between grids described by thicknesses h_src and h_dst.
1301
1279
! ! h_dst must be dimensioned as a model array with GV%ke layers while h_src can
1302
1280
! ! have an arbitrary number of layers specified by nk_src.
1303
- subroutine ALE_remap_scalar (CS , G , GV , nk_src , h_src , s_src , h_dst , s_dst , all_cells , old_remap , &
1304
- answers_2018 , answer_date , h_neglect , h_neglect_edge )
1281
+ subroutine ALE_remap_scalar (CS , G , GV , nk_src , h_src , s_src , h_dst , s_dst , all_cells , old_remap )
1305
1282
type (remapping_CS), intent (in ) :: CS ! < Remapping control structure
1306
1283
type (ocean_grid_type), intent (in ) :: G ! < Ocean grid structure
1307
1284
type (verticalGrid_type), intent (in ) :: GV ! < Ocean vertical grid structure
@@ -1319,44 +1296,16 @@ subroutine ALE_remap_scalar(CS, G, GV, nk_src, h_src, s_src, h_dst, s_dst, all_c
1319
1296
! ! layers otherwise (default).
1320
1297
logical , optional , intent (in ) :: old_remap ! < If true, use the old "remapping_core_w"
1321
1298
! ! method, otherwise use "remapping_core_h".
1322
- logical , optional , intent (in ) :: answers_2018 ! < If true, use the order of arithmetic
1323
- ! ! and expressions that recover the answers for
1324
- ! ! remapping from the end of 2018. Otherwise,
1325
- ! ! use more robust forms of the same expressions.
1326
- integer , optional , intent (in ) :: answer_date ! < The vintage of the expressions to use
1327
- ! ! for remapping
1328
- real , optional , intent (in ) :: h_neglect ! < A negligibly small thickness used in
1329
- ! ! remapping cell reconstructions, in the same
1330
- ! ! units as h_src, often [H ~> m or kg m-2]
1331
- real , optional , intent (in ) :: h_neglect_edge ! < A negligibly small thickness used in
1332
- ! ! remapping edge value calculations, in the same
1333
- ! ! units as h_src, often [H ~> m or kg m-2]
1334
- ! Local variables
1299
+ ! Local variables
1335
1300
integer :: i, j, k, n_points
1336
1301
real :: dx(GV% ke+1 ) ! Change in interface position [H ~> m or kg m-2]
1337
- real :: h_neg, h_neg_edge ! Tiny thicknesses used in remapping [H ~> m or kg m-2]
1338
- logical :: ignore_vanished_layers, use_remapping_core_w, use_2018_remap
1302
+ logical :: ignore_vanished_layers, use_remapping_core_w
1339
1303
1340
1304
ignore_vanished_layers = .false.
1341
1305
if (present (all_cells)) ignore_vanished_layers = .not. all_cells
1342
1306
use_remapping_core_w = .false.
1343
1307
if (present (old_remap)) use_remapping_core_w = old_remap
1344
1308
n_points = nk_src
1345
- use_2018_remap = .true. ; if (present (answers_2018)) use_2018_remap = answers_2018
1346
- if (present (answer_date)) use_2018_remap = (answer_date < 20190101 )
1347
-
1348
- if (present (h_neglect)) then
1349
- h_neg = h_neglect
1350
- h_neg_edge = h_neg ; if (present (h_neglect_edge)) h_neg_edge = h_neglect_edge
1351
- else
1352
- if (.not. use_2018_remap) then
1353
- h_neg = GV% H_subroundoff ; h_neg_edge = GV% H_subroundoff
1354
- elseif (GV% Boussinesq) then
1355
- h_neg = GV% m_to_H* 1.0e-30 ; h_neg_edge = GV% m_to_H* 1.0e-10
1356
- else
1357
- h_neg = GV% kg_m2_to_H* 1.0e-30 ; h_neg_edge = GV% kg_m2_to_H* 1.0e-10
1358
- endif
1359
- endif
1360
1309
1361
1310
! $OMP parallel do default(shared) firstprivate(n_points,dx)
1362
1311
do j = G% jsc,G% jec ; do i = G% isc,G% iec
@@ -1371,10 +1320,10 @@ subroutine ALE_remap_scalar(CS, G, GV, nk_src, h_src, s_src, h_dst, s_dst, all_c
1371
1320
if (use_remapping_core_w) then
1372
1321
call dzFromH1H2( n_points, h_src(i,j,1 :n_points), GV% ke, h_dst(i,j,:), dx )
1373
1322
call remapping_core_w(CS, n_points, h_src(i,j,1 :n_points), s_src(i,j,1 :n_points), &
1374
- GV% ke, dx, s_dst(i,j,:), h_neg, h_neg_edge )
1323
+ GV% ke, dx, s_dst(i,j,:))
1375
1324
else
1376
1325
call remapping_core_h(CS, n_points, h_src(i,j,1 :n_points), s_src(i,j,1 :n_points), &
1377
- GV% ke, h_dst(i,j,:), s_dst(i,j,:), h_neg, h_neg_edge )
1326
+ GV% ke, h_dst(i,j,:), s_dst(i,j,:))
1378
1327
endif
1379
1328
else
1380
1329
s_dst(i,j,:) = 0 .
0 commit comments