Skip to content

Commit c8da4e8

Browse files
committed
bug fixes for the first compilable version
1 parent 8cd78c4 commit c8da4e8

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/ocean_data_assim/MOM_oda_driver.F90

+2-3
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ subroutine get_ML_bias_correction(Time, US, CS)
785785

786786
call cpu_clock_begin(id_clock_ml_bias_correction)
787787

788-
!! Co-locate all variables (taux, tauy, U, V to tracer grid)
789-
788+
call MOM_mesg('Doing ML inference')
789+
790790
!! Loop through all local gridpoints
791791
do j=CS%model_G%jsc,CS%model_G%jec ; do i=CS%model_G%isc,CS%model_G%iec
792792

@@ -1002,7 +1002,6 @@ subroutine apply_oda_tracer_increments(dt, Time_end, G, GV, tv, h, CS)
10021002
call diag_update_remap_grids(CS%diag_CS)
10031003
call cpu_clock_end(id_clock_apply_increments)
10041004

1005-
10061005
end subroutine apply_oda_tracer_increments
10071006

10081007
subroutine set_up_global_tgrid(T_grid, CS, G)

src/ocean_data_assim/MOM_oda_ml.F90

+12-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module MOM_oda_ml_mod
5959
real(8) :: ReLU_zero = 0
6060
real(8), dimension(15) :: target_sigmas = (/0.1,0.3,0.5,0.7,0.9,1.1,1.3,1.5,1.7,1.9,2.1,2.3,2.5,2.7,2.9/)
6161
real(8), dimension(16) :: output_flux_sigmas = (/0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0/)
62-
character(len=255) :: danni_ANN_name = '/scratch/cimes/dd7201/pp_DA_increments/danni_data_20250120/argo_only_clean/networks/danni_ANN_weights_2006_2010.nc'
62+
character(len=255) :: danni_ANN_name = '/gpfs/f5/gfdl_sd/world-shared/Feiyu.Lu/ECDA_data/ML/danni_ANN_weights_2006_2010.nc'
6363

6464
integer :: id_clock_ml_remapping
6565
integer :: id_clock_ml_normalization
@@ -177,20 +177,23 @@ subroutine oda_ml_inference(ml_config,ml_data)
177177
do i = 1, 15
178178
call find_right_index(zi_to_sigma, target_sigmas(i),value_for_control_depth, right_index)
179179
if (right_index == 1) then
180-
thetao_zgrad_sigma(i) = thetao_zgrad_profile(1)
181-
so_zgrad_sigma(i) = so_zgrad_profile(1)
182-
PRHO_zgrad_sigma(i) = PRHO_zgrad_profile(1)
180+
thetao_zgrad_sigma(i) = thetao_zgrad_profile(1)
181+
so_zgrad_sigma(i) = so_zgrad_profile(1)
182+
PRHO_zgrad_sigma(i) = PRHO_zgrad_profile(1)
183183
else
184-
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),thetao_zgrad_profile(right_index-1),thetao_zgrad_profile(right_index),target_sigmas(i),thetao_zgrad_sigma(i))
185-
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),so_zgrad_profile(right_index-1),so_zgrad_profile(right_index),target_sigmas(i),so_zgrad_sigma(i))
186-
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),PRHO_zgrad_profile(right_index-1),PRHO_zgrad_profile(right_index),target_sigmas(i),PRHO_zgrad_sigma(i))
184+
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),thetao_zgrad_profile(right_index-1), &
185+
thetao_zgrad_profile(right_index),target_sigmas(i),thetao_zgrad_sigma(i))
186+
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),so_zgrad_profile(right_index-1), &
187+
so_zgrad_profile(right_index),target_sigmas(i),so_zgrad_sigma(i))
188+
call interpolate(zi_to_sigma(right_index-1),zi_to_sigma(right_index),PRHO_zgrad_profile(right_index-1), &
189+
PRHO_zgrad_profile(right_index),target_sigmas(i),PRHO_zgrad_sigma(i))
187190
end if
188191

189192
call find_right_index(zl_to_sigma, target_sigmas(i),value_for_control_depth, right_index)
190193
if (right_index == 1) then
191-
div_sigma(i) = div_profile(1)
194+
div_sigma(i) = div_profile(1)
192195
else
193-
call interpolate(zl_to_sigma(right_index-1),zl_to_sigma(right_index),div_profile(right_index-1),div_profile(right_index),target_sigmas(i),div_sigma(i))
196+
call interpolate(zl_to_sigma(right_index-1),zl_to_sigma(right_index),div_profile(right_index-1),div_profile(right_index),target_sigmas(i),div_sigma(i))
194197
end if
195198
end do
196199

0 commit comments

Comments
 (0)