From 3e8c0ddf4a034067500d00352f0910dc8800c322 Mon Sep 17 00:00:00 2001 From: Cheng Da Date: Wed, 18 Oct 2023 09:41:59 -0400 Subject: [PATCH] update SSS processing & obsop --- src/obs/obsop_sss.f90 | 4 ++++ src/obs/read_smap.f90 | 7 ++++++- src/obs/superob.f90 | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/obs/obsop_sss.f90 b/src/obs/obsop_sss.f90 index 2872f69..5b2925e 100644 --- a/src/obs/obsop_sss.f90 +++ b/src/obs/obsop_sss.f90 @@ -488,6 +488,10 @@ SUBROUTINE process_command_line CALL GET_COMMAND_ARGUMENT(i+1,arg2) PRINT *, "Argument ", i+1, " = ",TRIM(arg2) read (arg2,*) DO_SUPEROBS + case('-binary') + CALL GET_COMMAND_ARGUMENT(i+1,arg2) + PRINT *, "Argument ", i+1, " = ",TRIM(arg2) + read (arg2,*) BINARY_INPUT case('-thin') CALL GET_COMMAND_ARGUMENT(i+1,arg2) PRINT *, "Argument ", i+1, " = ",TRIM(arg2) diff --git a/src/obs/read_smap.f90 b/src/obs/read_smap.f90 index ea1ad47..f529094 100644 --- a/src/obs/read_smap.f90 +++ b/src/obs/read_smap.f90 @@ -253,6 +253,8 @@ SUBROUTINE read_jpl_smap_l2_sss_h5(obsinfile, obs_data, nobs, Syyyymmddhh, delta INTEGER,PARAMETER :: QUAL_FLAG_SSS_USABLE_BAD = 1 INTEGER,PARAMETER :: QUAL_FLAG_SSS_HAS_LAND = 1 INTEGER,PARAMETER :: QUAL_FLAG_SSS_HAS_ICE = 1 + REAL(r_size),PARAMETER :: oerr_qc_user = 2.0 ! psu, obs with JPL > oerr_qc_user removed + REAL(r_size),PARAMETER :: oerr_min_user = 0.2 ! psu, obs with JPL oerr < oerr_min_user has err oerr_min_user !------------------------------------------------------------------------------- ! Open the hdf5 file @@ -393,6 +395,9 @@ SUBROUTINE read_jpl_smap_l2_sss_h5(obsinfile, obs_data, nobs, Syyyymmddhh, delta where(stde < r4FillValue) valid = .false. end where + where(stde > oerr_qc_user) ! User QC based on read-in oerr + valid = .false. + end where WRITE(6,*) "[msg] read_jpl_smap_l2_sss_h5::smap_sss_uncertainty: min, max=", & minval(stde, mask=valid), maxval(stde, mask=valid) @@ -481,7 +486,7 @@ SUBROUTINE read_jpl_smap_l2_sss_h5(obsinfile, obs_data, nobs, Syyyymmddhh, delta obs_data(n)%x_grd(2) = alat2d(i,j) obs_data(n)%hour = sss_time_in_seconds_since19780101(i)/3600. obs_data(n)%value = sea_surface_salinity(i,j) - obs_data(n)%oerr = stde(i,j) + obs_data(n)%oerr = max(stde(i,j), oerr_min_user) ! set a limit bound for error end if end do end do diff --git a/src/obs/superob.f90 b/src/obs/superob.f90 index 519e5bf..6d75835 100644 --- a/src/obs/superob.f90 +++ b/src/obs/superob.f90 @@ -64,6 +64,8 @@ PROGRAM superob INTEGER, DIMENSION(:,:), ALLOCATABLE :: supercnt INTEGER :: idx REAL(r_size) :: min_oerr = 0.2 !(K) + REAL(r_size) :: input_oerr = 0.75 ! (K) + LOGICAL :: HAS_INPUT_OERR = .false. !----------------------------------------------------------------------------- ! Initialize the common_oceanmodel module, and process command line options @@ -181,6 +183,10 @@ PROGRAM superob nobs = idx endif + if (HAS_INPUT_OERR) then + oerr(:) = input_oerr + endif + call write_obs3(trim(obsoutfile),nobs,elem(1:nobs), & rlon(1:nobs), & rlat(1:nobs), & @@ -243,6 +249,14 @@ SUBROUTINE process_command_line CALL GET_COMMAND_ARGUMENT(i+1,arg2) PRINT *, "Argument ", i+1, " = ",TRIM(arg2) read (arg2,*) min_quality_level + case('-inputoerr') + CALL GET_COMMAND_ARGUMENT(i+1,arg2) + PRINT *, "Argument ", i+1, " = ",TRIM(arg2) + read (arg2,*) HAS_INPUT_OERR + case('-useroerr') + CALL GET_COMMAND_ARGUMENT(i+1,arg2) + PRINT *, "Argument ", i+1, " = ",TRIM(arg2) + read (arg2,*) input_oerr case('-debug') CALL GET_COMMAND_ARGUMENT(i+1,arg2) PRINT *, "Argument ", i+1, " = ",TRIM(arg2)