Skip to content

Commit eeb6d3d

Browse files
committed
Small bug fixes
1 parent 1a592d4 commit eeb6d3d

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

src/ocean_data_assim/MOM_oda_driver.F90

+22-6
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ subroutine init_oda(Time, G, GV, US, diag_CS, CS)
212212
character(len=80) :: remap_scheme
213213
character(len=80) :: bias_correction_file, inc_file
214214
integer :: default_answer_date ! The default setting for the various ANSWER_DATE flags.
215+
character(len=160) :: mesg
215216

216217
if (associated(CS)) call MOM_error(FATAL, 'Calling oda_init with associated control structure')
217218
allocate(CS)
@@ -267,13 +268,15 @@ subroutine init_oda(Time, G, GV, US, diag_CS, CS)
267268
if (CS%do_T_bias_adjustment) then
268269
call get_param(PF, mdl, "TEMP_ADJUSTMENT_FACTOR", CS%T_bias_adjustment_multiplier, &
269270
"A multiplicative scaling factor for the climatological tracer tendency adjustment ", &
270-
units="nondim", default=1.0)
271+
units="nondim", default=0.0)
271272
endif
272273
if (CS%do_S_bias_adjustment) then
273274
call get_param(PF, mdl, "SALT_ADJUSTMENT_FACTOR", CS%S_bias_adjustment_multiplier, &
274275
"A multiplicative scaling factor for the climatological tracer tendency adjustment ", &
275-
units="nondim", default=1.0)
276+
units="nondim", default=0.0)
276277
endif
278+
write(mesg,*) 'OTA adjustment multiplier', CS%T_bias_adjustment_multiplier, CS%S_bias_adjustment_multiplier
279+
call MOM_mesg("ODA init: "//trim(mesg))
277280
call get_param(PF, mdl, "APPLY_ML_TEMP_TENDENCY_ADJUSTMENT", CS%do_T_ml_bias_adjustment, &
278281
"If true, add a machine learning-trained adjustment "//&
279282
"to temperature.", &
@@ -285,13 +288,15 @@ subroutine init_oda(Time, G, GV, US, diag_CS, CS)
285288
if (CS%do_T_ml_bias_adjustment) then
286289
call get_param(PF, mdl, "ML_TEMP_ADJUSTMENT_FACTOR", CS%T_ml_bias_adjustment_multiplier, &
287290
"A multiplicative scaling factor for the machine learning tracer tendency adjustment ", &
288-
units="nondim", default=1.0)
291+
units="nondim", default=0.0)
289292
endif
290293
if (CS%do_S_ml_bias_adjustment) then
291294
call get_param(PF, mdl, "ML_SALT_ADJUSTMENT_FACTOR", CS%S_ml_bias_adjustment_multiplier, &
292295
"A multiplicative scaling factor for the machine learning tracer tendency adjustment ", &
293-
units="nondim", default=1.0)
296+
units="nondim", default=0.0)
294297
endif
298+
write(mesg,*) 'ML adjustment multiplier', CS%T_ml_bias_adjustment_multiplier, CS%S_ml_bias_adjustment_multiplier
299+
call MOM_mesg("ODA init: "//trim(mesg))
295300
call get_param(PF, mdl, "USE_BASIN_MASK", CS%use_basin_mask, &
296301
"If true, add a basin mask to delineate weakly connected "//&
297302
"ocean basins for the purpose of data assimilation.", &
@@ -661,6 +666,9 @@ subroutine oda(Time, CS)
661666
integer :: m
662667
character(len=160) :: mesg ! The text of an error message
663668
integer :: yr, mon, day, hr, min, sec
669+
integer :: isc, iec, jsc, jec
670+
671+
isc=CS%model_G%isc; iec=CS%model_G%iec; jsc=CS%model_G%jsc; jec=CS%model_G%jec
664672

665673
if ( Time >= CS%Time ) then
666674
call cpu_clock_begin(id_clock_ensemble_filter)
@@ -700,13 +708,21 @@ subroutine oda(Time, CS)
700708
if (CS%do_T_bias_adjustment .or. CS%do_S_bias_adjustment) call get_bias_correction_tracer(Time, CS%US, CS)
701709

702710
if (CS%do_T_ml_bias_adjustment .or. CS%do_S_ml_bias_adjustment) then
711+
703712
call get_ML_bias_correction(Time, CS%US, CS)
713+
704714
if (CS%do_T_ml_bias_adjustment) then
705-
CS%Ocean_background_ave%T = CS%Ocean_background_ave%T + CS%T_ml_tend * CS%assim_interval
715+
CS%Ocean_background_ave%T(isc:iec,jsc:jec,:) = CS%Ocean_background_ave%T(isc:iec,jsc:jec,:) + &
716+
CS%T_ml_tend(isc:iec,jsc:jec,:) * CS%assim_interval
717+
call pass_var(CS%Ocean_background_ave%T, CS%model_G%Domain)
706718
endif
719+
707720
if (CS%do_S_ml_bias_adjustment) then
708-
CS%Ocean_background_ave%S = CS%Ocean_background_ave%S + CS%S_ml_tend * CS%assim_interval
721+
CS%Ocean_background_ave%S(isc:iec,jsc:jec,:) = CS%Ocean_background_ave%S(isc:iec,jsc:jec,:) + &
722+
CS%S_ml_tend(isc:iec,jsc:jec,:) * CS%assim_interval
723+
call pass_var(CS%Ocean_background_ave%S, CS%model_G%Domain)
709724
endif
725+
710726
endif
711727

712728
!! switch to global pelist

0 commit comments

Comments
 (0)