@@ -160,8 +160,8 @@ module MOM_oda_driver_mod
160
160
type (INC_CS) :: INC_CS ! < A Structure containing integer file handles for bias adjustment
161
161
integer :: id_inc_t ! < A diagnostic handle for the temperature climatological adjustment
162
162
integer :: id_inc_s ! < A diagnostic handle for the salinity climatological adjustment
163
- integer :: id_inc_ml_t ! < A diagnostic handle for the temperature climatological adjustment
164
- integer :: id_inc_ml_s ! < A diagnostic handle for the salinity climatological adjustment
163
+ ! integer :: id_inc_ml_t !< A diagnostic handle for the temperature climatological adjustment
164
+ ! integer :: id_inc_ml_s !< A diagnostic handle for the salinity climatological adjustment
165
165
integer :: answer_date ! < The vintage of the order of arithmetic and expressions in the
166
166
! ! remapping invoked by the ODA driver. Values below 20190101 recover
167
167
! ! the answers from the end of 2018, while higher values use updated
@@ -442,10 +442,10 @@ subroutine init_oda(Time, G, GV, US, diag_CS, CS)
442
442
allocate (CS% ml_config)
443
443
call oda_ml_init(CS% ml_config, CS% ml_data, CS% GV)
444
444
445
- CS% id_inc_ml_t = register_diag_field(' ocean_model' , ' temp_ml_increment' , diag_CS% axesTL, &
446
- Time, ' ocean potential temperature increments predicted by ML' , ' degC' , conversion= US% C_to_degC)
447
- CS% id_inc_ml_s = register_diag_field(' ocean_model' , ' salt_ml_increment' , diag_CS% axesTL, &
448
- Time, ' ocean salinity increments predicted by ML' , ' psu' , conversion= US% S_to_ppt)
445
+ ! CS%id_inc_ml_t = register_diag_field('ocean_model', 'temp_ml_increment', diag_CS%axesTL, &
446
+ ! Time, 'ocean potential temperature increments predicted by ML', 'degC', conversion=US%C_to_degC)
447
+ ! CS%id_inc_ml_s = register_diag_field('ocean_model', 'salt_ml_increment', diag_CS%axesTL, &
448
+ ! Time, 'ocean salinity increments predicted by ML', 'psu', conversion=US%S_to_ppt)
449
449
450
450
allocate (CS% T_ml_tend(G% isd:G% ied,G% jsd:G% jed,CS% GV% ke), source= 0.0 )
451
451
allocate (CS% S_ml_tend(G% isd:G% ied,G% jsd:G% jed,CS% GV% ke), source= 0.0 )
@@ -790,33 +790,38 @@ subroutine get_ML_bias_correction(Time, US, CS)
790
790
! ! Loop through all local gridpoints
791
791
do j= CS% model_G% jsc,CS% model_G% jec ; do i= CS% model_G% isc,CS% model_G% iec
792
792
793
- ! ! put local variables into ml_data
794
- CS% ml_data% T = CS% Ocean_background_ave% T(i,j,:)
795
- CS% ml_data% S = CS% Ocean_background_ave% S(i,j,:)
796
- CS% ml_data% U_left = CS% Ocean_background_ave% U(i-1 ,j,:)
797
- CS% ml_data% U_right = CS% Ocean_background_ave% U(i,j,:)
798
- CS% ml_data% V_north = CS% Ocean_background_ave% V(i,j,:)
799
- CS% ml_data% V_south = CS% Ocean_background_ave% V(i,j-1 ,:)
800
- CS% ml_data% latent = CS% Ocean_background_ave% latent(i,j)
801
- CS% ml_data% sensible = CS% Ocean_background_ave% sensible(i,j)
802
- CS% ml_data% lw = CS% Ocean_background_ave% lw(i,j)
803
- CS% ml_data% sw = CS% Ocean_background_ave% sw(i,j)
804
- CS% ml_data% taux_left = CS% Ocean_background_ave% taux(i-1 ,j)
805
- CS% ml_data% taux_right = CS% Ocean_background_ave% taux(i,j)
806
- CS% ml_data% tauy_north = CS% Ocean_background_ave% tauy(i,j)
807
- CS% ml_data% tauy_south = CS% Ocean_background_ave% tauy(i,j-1 )
808
-
809
- CS% ml_data% dyCu_left = CS% model_G% dyCu(i-1 ,j)
810
- CS% ml_data% dyCu_right = CS% model_G% dyCu(i,j)
811
- CS% ml_data% dxCv_north = CS% model_G% dxCv(i,j)
812
- CS% ml_data% dxCv_south = CS% model_G% dxCv(i,j-1 )
813
- CS% ml_data% areacello = CS% model_G% areaT(i,j)
814
-
815
- ! ! Call inference subroutine with the concatenated vector
816
- call oda_ml_inference(CS% ml_config, CS% ml_data)
817
-
818
- CS% T_ml_tend(i,j,:) = CS% ml_data% T_inc
819
- CS% S_ml_tend(i,j,:) = CS% ml_data% S_inc
793
+ if (CS% model_G% geolatT(i,j) > 60.0 .or. CS% model_G% geolatT(i,j) < - 60.0 ) then
794
+ CS% T_ml_tend(i,j,:) = 0.0
795
+ CS% S_ml_tend(i,j,:) = 0.0
796
+ else
797
+ ! ! put local variables into ml_data
798
+ CS% ml_data% T = CS% Ocean_background_ave% T(i,j,:)
799
+ CS% ml_data% S = CS% Ocean_background_ave% S(i,j,:)
800
+ CS% ml_data% U_left = CS% Ocean_background_ave% U(i-1 ,j,:)
801
+ CS% ml_data% U_right = CS% Ocean_background_ave% U(i,j,:)
802
+ CS% ml_data% V_north = CS% Ocean_background_ave% V(i,j,:)
803
+ CS% ml_data% V_south = CS% Ocean_background_ave% V(i,j-1 ,:)
804
+ CS% ml_data% latent = CS% Ocean_background_ave% latent(i,j)
805
+ CS% ml_data% sensible = CS% Ocean_background_ave% sensible(i,j)
806
+ CS% ml_data% lw = CS% Ocean_background_ave% lw(i,j)
807
+ CS% ml_data% sw = CS% Ocean_background_ave% sw(i,j)
808
+ CS% ml_data% taux_left = CS% Ocean_background_ave% taux(i-1 ,j)
809
+ CS% ml_data% taux_right = CS% Ocean_background_ave% taux(i,j)
810
+ CS% ml_data% tauy_north = CS% Ocean_background_ave% tauy(i,j)
811
+ CS% ml_data% tauy_south = CS% Ocean_background_ave% tauy(i,j-1 )
812
+
813
+ CS% ml_data% dyCu_left = CS% model_G% dyCu(i-1 ,j)
814
+ CS% ml_data% dyCu_right = CS% model_G% dyCu(i,j)
815
+ CS% ml_data% dxCv_north = CS% model_G% dxCv(i,j)
816
+ CS% ml_data% dxCv_south = CS% model_G% dxCv(i,j-1 )
817
+ CS% ml_data% areacello = CS% model_G% areaT(i,j)
818
+
819
+ ! ! Call inference subroutine with the concatenated vector
820
+ call oda_ml_inference(CS% ml_config, CS% ml_data)
821
+
822
+ CS% T_ml_tend(i,j,:) = CS% ml_data% T_inc
823
+ CS% S_ml_tend(i,j,:) = CS% ml_data% S_inc
824
+ endif
820
825
enddo ; enddo
821
826
822
827
CS% T_ml_tend = CS% T_ml_tend * CS% ml_bias_adjustment_multiplier
0 commit comments