Skip to content

Commit f851563

Browse files
committed
Latest dev/cryo
Merge branch 'dev/cryo' of github.com:gfdl-cryosphere/MOM6 into gfdl_cryo
2 parents 48ed9e1 + f23f8b7 commit f851563

6 files changed

Lines changed: 143 additions & 96 deletions

File tree

ac/makedep

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ def scan_fortran_file(src_file, defines=None):
389389

390390
cpp_defines = defines if defines is not None else []
391391

392-
cpp_macros = dict([t.split('=') for t in cpp_defines])
392+
cpp_macros = dict(
393+
[t.split('=') if '=' in t else (t, None) for t in cpp_defines]
394+
)
393395
cpp_group_stack = []
394396

395397
with io.open(src_file, 'r', errors='replace') as file:
@@ -454,13 +456,14 @@ def scan_fortran_file(src_file, defines=None):
454456
# Activate a new macro (ignoring the value)
455457
match = re_cpp_define.match(line)
456458
if match:
459+
# TODO: Tokenize this, don't hunt for `(` in `macro`.
457460
tokens = line.strip()[1:].split(maxsplit=2)
458461
macro = tokens[1]
459462
value = tokens[2] if tokens[2:] else None
460463
if '(' in macro:
461464
# TODO: Actual handling of function macros
462465
macro, arg = macro.split('(', maxsplit=1)
463-
value = '(' + arg + value
466+
value = '(' + arg + value if value else '(' + arg
464467
cpp_macros[macro] = value
465468

466469
# Deactivate a macro

src/core/MOM.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,12 +1863,14 @@ subroutine ALE_regridding_and_remapping(CS, G, GV, US, u, v, h, tv, dtdia, Time_
18631863
call remap_dyn_split_RK2_aux_vars(G, GV, CS%dyn_split_RK2_CSp, h_old_u, h_old_v, h_new_u, h_new_v, CS%ALE_CSp)
18641864
endif
18651865

1866-
if (associated(CS%OBC)) then
1866+
if (associated(CS%OBC) .or. associated(CS%visc%Kv_shear_Bu)) then
18671867
call pass_var(h, G%Domain, complete=.false.)
18681868
call pass_var(h_new, G%Domain, complete=.true.)
1869-
call remap_OBC_fields(G, GV, h, h_new, CS%OBC, PCM_cell=PCM_cell)
18701869
endif
18711870

1871+
if (associated(CS%OBC)) &
1872+
call remap_OBC_fields(G, GV, h, h_new, CS%OBC, PCM_cell=PCM_cell)
1873+
18721874
call remap_vertvisc_aux_vars(G, GV, CS%visc, h, h_new, CS%ALE_CSp, CS%OBC)
18731875
if (associated(CS%visc%Kv_shear)) &
18741876
call pass_var(CS%visc%Kv_shear, G%Domain, To_All+Omit_Corners, clock=id_clock_pass, halo=1)

src/core/MOM_dynamics_split_RK2.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,10 +1338,11 @@ subroutine remap_dyn_split_RK2_aux_vars(G, GV, CS, h_old_u, h_old_v, h_new_u, h_
13381338
call ALE_remap_velocities(ALE_CSp, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, CS%u_av, CS%v_av)
13391339
call pass_vector(CS%u_av, CS%v_av, G%Domain, complete=.false.)
13401340
call ALE_remap_velocities(ALE_CSp, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, CS%CAu_pred, CS%CAv_pred)
1341-
call pass_vector(CS%CAu_pred, CS%CAv_pred, G%Domain, complete=.true.)
1341+
call pass_vector(CS%CAu_pred, CS%CAv_pred, G%Domain, complete=.false.)
13421342
endif
13431343

13441344
call ALE_remap_velocities(ALE_CSp, G, GV, h_old_u, h_old_v, h_new_u, h_new_v, CS%diffu, CS%diffv)
1345+
call pass_vector(CS%diffu, CS%diffv, G%Domain, complete=.true.)
13451346

13461347
end subroutine remap_dyn_split_RK2_aux_vars
13471348

0 commit comments

Comments
 (0)