Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ASCAT SM reader and matlab util for clim_stats #656

Merged
merged 107 commits into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
3b0c5f7
update clsm_ensupd_read_obs.F90
amfox37 Dec 13, 2022
7352522
update clsm_ensupd_glob_param
amfox37 Dec 13, 2022
a264ee9
update componentsyaml and cmakelists
amfox37 Dec 14, 2022
cb628a5
trying to build with bufr
amfox37 Dec 14, 2022
792c4b0
update GEOSlandassim_GridComp CMakeLists.txt
amfox37 Dec 14, 2022
e50f695
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Dec 21, 2022
95f4488
update LDASsa_DEFAULT_inputs_ensupd.nml
amfox37 Dec 22, 2022
8896bc9
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Jan 27, 2023
cc527be
Add tpcx and iwfr QC
amfox37 Jan 31, 2023
fba30af
Merge branch 'feature/amfox/metop_sm' of github.com:GEOS-ESM/GEOSldas…
amfox37 Jan 31, 2023
35b2ef5
fix CMakeLists in Shared
amfox37 Jan 31, 2023
0fefd6b
updating varname to sfds
amfox37 Jan 31, 2023
60c07b9
change N_slect_varnames
amfox37 Feb 1, 2023
67fb4e5
deliberate breaking for test
amfox37 Feb 1, 2023
5f5f3bb
sfds fix
amfox37 Feb 1, 2023
264e842
units in nml and combine case
amfox37 Feb 2, 2023
243eabe
temp fixes to reader
amfox37 Mar 3, 2023
e2e6d0a
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Mar 8, 2023
ed82bee
minor bug fixes
amfox37 Mar 14, 2023
19813fa
update Shared_CMakelists
amfox37 Mar 14, 2023
e47b985
relaxed QC
amfox37 Mar 20, 2023
8506d17
making things generic
amfox37 Mar 22, 2023
8029699
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Mar 27, 2023
6365910
add metop-C
amfox37 Mar 27, 2023
2711714
quick fix
amfox37 Mar 28, 2023
4dfc760
fix typo
amfox37 Mar 29, 2023
f0f6189
write out to netcdf
amfox37 Mar 29, 2023
52cf2b3
temporary test reader
amfox37 Apr 17, 2023
4148093
Merge branch 'feature/amfox/metop_sm' of https://github.com/GEOS-ESM/…
amfox37 Apr 17, 2023
f0d312f
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Apr 17, 2023
0736db5
add obs lat, lon, time to EUMETSAT reader output
amfox37 Apr 17, 2023
ebc4e6c
add scale_obs_sfmc_zscore template
amfox37 Apr 19, 2023
d4b4d56
fix typoes
amfox37 Apr 19, 2023
8e43a4b
add netcdf sclprm read
amfox37 Apr 20, 2023
c44c96b
nf_ to nf90_
amfox37 Apr 20, 2023
33d6e52
sort out get_var for 3D array
amfox37 Apr 20, 2023
c193dec
scale via standard normal deviates
amfox37 Apr 21, 2023
9a24270
sort out netcdf dimensions
amfox37 Apr 25, 2023
c7a886f
more netcdf read issues
amfox37 Apr 25, 2023
e9e698a
sorted netcdf read for 2D grids
amfox37 Apr 28, 2023
e8792dc
new latlon-grid based statistics
amfox37 Apr 30, 2023
d038311
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Apr 30, 2023
4dff64e
Merge branch 'develop' into feature/amfox/generic_get_model_and_obs_c…
amfox37 Apr 30, 2023
df2c5cf
add ncdump header comment to netcdf write
amfox37 May 1, 2023
a31c594
adding pentads latlon
amfox37 May 22, 2023
769f281
fix conflict in get_ij_ind_from_latlon.m
amfox37 May 22, 2023
b60ed63
remove some debug output
amfox37 May 22, 2023
b2b9e74
Merge branch 'feature/amfox/metop_sm' of github.com:GEOS-ESM/GEOSldas…
amfox37 May 22, 2023
79f0088
Merge branch 'feature/amfox/generic_get_model_and_obs_clim_stats' int…
amfox37 May 26, 2023
3798744
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 May 26, 2023
7d7598d
bug fix
amfox37 May 26, 2023
ad7d6bb
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 May 31, 2023
08b3f85
added timing statements
amfox37 May 31, 2023
9e5d8d4
fix corruption of LDAS_TileCoordRoutines.F90
amfox37 May 31, 2023
f5a0b9e
system_clock calls
amfox37 Jun 1, 2023
e951127
Merge branch 'feature/amfox/metop_sm' of https://github.com/GEOS-ESM/…
amfox37 Jun 1, 2023
3f5ba33
clean up obs_scaling_param directory
amfox37 Jun 2, 2023
578a5f2
timing statements
amfox37 Jun 2, 2023
38db8c1
switch to fname list reader
amfox37 Jun 6, 2023
8730724
Merge branch 'feature/amfox/metop_sm' of https://github.com/GEOS-ESM/…
amfox37 Jun 6, 2023
b954682
timing in read_obs
amfox37 Jun 6, 2023
f7f0efe
Merge branch 'feature/amfox/metop_sm' of github.com:GEOS-ESM/GEOSldas…
amfox37 Jun 6, 2023
d05c5de
fname from list working but slow
amfox37 Jun 8, 2023
c3ace9a
fname list read working and tidied
amfox37 Jun 11, 2023
532a777
fix date_time_low_fname bug
amfox37 Jun 15, 2023
cab71d7
reinstate exit on error
amfox37 Jun 21, 2023
7f6e047
add dt_ASCAT_obsfile parameter
amfox37 Jun 23, 2023
8b5511e
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Jun 26, 2023
33cf274
read all subsets to memory before qc
amfox37 Jul 20, 2023
3535bbd
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Jul 20, 2023
fd7d8c4
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Sep 19, 2023
ac4bbf7
changed defaults of %bias_trel and %bias_tcut for ASCAT sm retrievals…
gmao-rreichle Sep 19, 2023
364e5dd
cleanup of subroutine read_obs_sm_ASCAT_EUMET() in clsm_ensupd_read_o…
gmao-rreichle Sep 20, 2023
3f95ee0
Review response
amfox37 Sep 21, 2023
546b0c6
Remove asc v desc species differentiation
amfox37 Sep 22, 2023
01d41bc
Fix dimension size in ufbint call
amfox37 Sep 22, 2023
bd3bd06
fix tmp_vdata dimension
amfox37 Sep 22, 2023
aad96aa
additional clean-up of ASCAT EUMETSAT BUFR reader
gmao-rreichle Sep 22, 2023
48af04b
removed obsolete variable declaration (clsm_ensupd_read_obs.F90)
gmao-rreichle Sep 22, 2023
7e505af
increase max_rec size
amfox37 Sep 29, 2023
3330c5c
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Oct 3, 2023
b1ce78c
add range to scaled obs
amfox37 Oct 26, 2023
c9fc077
Merge branch 'develop' into feature/amfox/metop_sm
amfox37 Oct 26, 2023
43455e5
add latlon grid clim stats matlab scripts
amfox37 Oct 27, 2023
f749710
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Oct 30, 2023
9ca4bd4
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Nov 7, 2023
cab8a57
make update type 1 work
amfox37 Nov 7, 2023
0295360
Merge branch 'feature/amfox/metop_sm' of github.com:GEOS-ESM/GEOSldas…
amfox37 Nov 7, 2023
89cdbf5
update NCEP_Shared to v1.3.0
amfox37 Nov 9, 2023
f388fa6
Merge branch 'feature/amfox/metop_sm' of github.com:GEOS-ESM/GEOSldas…
amfox37 Nov 13, 2023
4c5e283
allocation of mwRTM_param
amfox37 Nov 22, 2023
e251abe
bugfix for ASCAT_sm_std
amfox37 Nov 22, 2023
32a0354
minimal edits of comment lines in ASCAT reader (clsm_ensupd_read_obs.…
gmao-rreichle Nov 30, 2023
0614d41
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Dec 3, 2023
bdbfa6e
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Dec 7, 2023
7c70b16
Merge branch 'develop' into feature/amfox/metop_sm
gmao-rreichle Dec 7, 2023
c3fa251
minimal update to comments (clsm_ensupd_upd_routines.F90)
gmao-rreichle Dec 18, 2023
567b6cb
minimal edits of comments, a few white-space changes (clsm_ensupd_rea…
gmao-rreichle Dec 18, 2023
185436b
added minor comment to (ASCAT) sfmc zscore scaling subroutine (clsm_e…
gmao-rreichle Dec 18, 2023
c643b6b
moved lines with user-defined inputs into corresponding block of code
gmao-rreichle Dec 19, 2023
810f871
cleanup of functions to get obs scaling parameters (get_model_and_obs…
gmao-rreichle Dec 19, 2023
612dc57
minimal white space changes (get_tile_num_for_obs.m, pentad_of_year.m)
gmao-rreichle Dec 19, 2023
319905a
cleanup of netcdf writer for (ASCAT) obs scaling parameters (write_ne…
gmao-rreichle Dec 19, 2023
3ffee32
replaced deprecated Matlab functions "nanmean", "nanstd", and "nansum…
gmao-rreichle Dec 19, 2023
4113033
construct "ldas_obsparam" file name from user-defined inputs (Run_get…
gmao-rreichle Dec 19, 2023
565c868
fix bad no-data check (get_model_and_obs_clim_stats*.m)
gmao-rreichle Dec 22, 2023
544a119
remove lat lon vectors from matlab write
amfox37 Dec 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ ecbuild:
remote: ../ecbuild.git
tag: geos/v1.3.0

NCEP_Shared:
local: ./src/Shared/@NCEP_Shared
remote: ../NCEP_Shared.git
tag: v1.3.0
sparse: ./config/NCEP_Shared.sparse
develop: main

GMAO_Shared:
local: ./src/Shared/@GMAO_Shared
remote: ../GMAO_Shared.git
Expand Down
8 changes: 8 additions & 0 deletions config/NCEP_Shared.sparse
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
!/*
/NCEP_sp
/NCEP_w3
/NCEP_bufr
/NCEP_bacio
/NCEP_sfcio
/NCEP_sigio
/CMakeLists.txt
113 changes: 112 additions & 1 deletion src/Applications/LDAS_App/LDASsa_DEFAULT_inputs_ensupd.nml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fcsterr_inflation_fac = -9999.
! 0 = n/a [eg., in situ obs]
! 1 = ascending
! 2 = descending
! 3 = ascending and descending
! 3 = ascending or descending
! 4 = geostationary
! %pol = polarization
! 0 = n/a [eg., multi-pol. retrieval]
Expand Down Expand Up @@ -2064,6 +2064,117 @@ obs_param_nml(48)%xcorr = 0.1875
obs_param_nml(48)%ycorr = 0.1875
obs_param_nml(48)%adapt = 0

! --------------------------------------------------------------------
!
! 49 = ASCAT_META_SM (ASCAT soil moisture ascending and descending orbits)
!
! https://navigator.eumetsat.int/product/EO:EUM:DAT:METOP:SOMO25

obs_param_nml(49)%descr = 'ASCAT_META_SM'
obs_param_nml(49)%orbit = 3
obs_param_nml(49)%pol = 0
obs_param_nml(49)%N_ang = 0
obs_param_nml(49)%freq = 0
obs_param_nml(49)%FOV = 20.
obs_param_nml(49)%FOV_units = 'km'
obs_param_nml(49)%assim = .false.
obs_param_nml(49)%scale = .false.
obs_param_nml(49)%getinnov = .false.
obs_param_nml(49)%RTM_ID = 0
obs_param_nml(49)%bias_Npar = 0
obs_param_nml(49)%bias_trel = 864000
obs_param_nml(49)%bias_tcut = 432000
obs_param_nml(49)%nodata = -9999.
obs_param_nml(49)%varname = 'sfds'
obs_param_nml(49)%units = '%'
obs_param_nml(49)%path = '/discover/nobackup/projects/gmao/merra/iau/merra_land/DATA/ASCAT_EUMETSAT/Metop_A/'
obs_param_nml(49)%name = 'M02-ASCA-ASCSMO02'
obs_param_nml(49)%scalepath = ''
obs_param_nml(49)%scalename = ''
obs_param_nml(49)%flistpath = ''
obs_param_nml(49)%flistname = ''
obs_param_nml(49)%errstd = 9.
obs_param_nml(49)%std_normal_max = 2.5
obs_param_nml(49)%zeromean = .true.
obs_param_nml(49)%coarsen_pert = .false.
obs_param_nml(49)%xcorr = 0.25
obs_param_nml(49)%ycorr = 0.25
obs_param_nml(49)%adapt = 0

! --------------------------------------------------------------------
!
! 50 = ASCAT_METB_SM (ASCAT soil moisture ascending and descending orbits)
!
! https://navigator.eumetsat.int/product/EO:EUM:DAT:METOP:SOMO25

obs_param_nml(50)%descr = 'ASCAT_METB_SM'
obs_param_nml(50)%orbit = 3
obs_param_nml(50)%pol = 0
obs_param_nml(50)%N_ang = 0
obs_param_nml(50)%freq = 0
obs_param_nml(50)%FOV = 20.
obs_param_nml(50)%FOV_units = 'km'
obs_param_nml(50)%assim = .false.
obs_param_nml(50)%scale = .false.
obs_param_nml(50)%getinnov = .false.
obs_param_nml(50)%RTM_ID = 0
obs_param_nml(50)%bias_Npar = 0
obs_param_nml(50)%bias_trel = 864000
obs_param_nml(50)%bias_tcut = 432000
obs_param_nml(50)%nodata = -9999.
obs_param_nml(50)%varname = 'sfds'
obs_param_nml(50)%units = '%'
obs_param_nml(50)%path = '/discover/nobackup/projects/gmao/merra/iau/merra_land/DATA/ASCAT_EUMETSAT/Metop_B/'
obs_param_nml(50)%name = 'M01-ASCA-ASCSMO02'
obs_param_nml(50)%scalepath = ''
obs_param_nml(50)%scalename = ''
obs_param_nml(50)%flistpath = ''
obs_param_nml(50)%flistname = ''
obs_param_nml(50)%errstd = 9.
obs_param_nml(50)%std_normal_max = 2.5
obs_param_nml(50)%zeromean = .true.
obs_param_nml(50)%coarsen_pert = .false.
obs_param_nml(50)%xcorr = 0.25
obs_param_nml(50)%ycorr = 0.25
obs_param_nml(50)%adapt = 0

! --------------------------------------------------------------------
!
! 51 = ASCAT_METC_SM (ASCAT soil moisture ascending and descending orbits)
!
! https://navigator.eumetsat.int/product/EO:EUM:DAT:METOP:SOMO25

obs_param_nml(51)%descr = 'ASCAT_METC_SM'
obs_param_nml(51)%orbit = 3
obs_param_nml(51)%pol = 0
obs_param_nml(51)%N_ang = 0
obs_param_nml(51)%freq = 0
obs_param_nml(51)%FOV = 20.
obs_param_nml(51)%FOV_units = 'km'
obs_param_nml(51)%assim = .false.
obs_param_nml(51)%scale = .false.
obs_param_nml(51)%getinnov = .false.
obs_param_nml(51)%RTM_ID = 0
obs_param_nml(51)%bias_Npar = 0
obs_param_nml(51)%bias_trel = 864000
obs_param_nml(51)%bias_tcut = 432000
obs_param_nml(51)%nodata = -9999.
obs_param_nml(51)%varname = 'sfds'
obs_param_nml(51)%units = '%'
obs_param_nml(51)%path = '/discover/nobackup/projects/gmao/merra/iau/merra_land/DATA/ASCAT_EUMETSAT/Metop_C/'
obs_param_nml(51)%name = 'M03-ASCA-ASCSMO02'
obs_param_nml(51)%scalepath = ''
obs_param_nml(51)%scalename = ''
obs_param_nml(51)%flistpath = ''
obs_param_nml(51)%flistname = ''
obs_param_nml(51)%errstd = 9.
obs_param_nml(51)%std_normal_max = 2.5
obs_param_nml(51)%zeromean = .true.
obs_param_nml(51)%coarsen_pert = .false.
obs_param_nml(51)%xcorr = 0.25
obs_param_nml(51)%ycorr = 0.25
obs_param_nml(51)%adapt = 0

! --------------------------------------------------------------------

/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@

header = [y1 m1 d1 0 0 0 y2 m2 d2 0 0 0 tc.N_tile 1];

tile_data = nanmean(L2_tau_tile([nidx_pre nidx nidx_nxt],:),1);
tile_data = mean(L2_tau_tile([nidx_pre nidx nidx_nxt],:),1,"omitnan");
tile_data(isnan(tile_data)) = 1.e15;

fwrite( ifp, 14*4, int_precision ); % fortran_tag
Expand All @@ -260,7 +260,7 @@
end

% ========================
% The final vegopacity.bin file contains data averaged (nanmean) of Asc
% The final vegopacity.bin file contains data averaged (mean) of Asc
% and Des tau climatology. VOD is climatology,the other 2 parameters are
% time constant with maximum spatial coverage
data_clim_tile = NaN + ones(48, tc.N_tile,2);
Expand Down Expand Up @@ -295,7 +295,7 @@
data_clim_tile(data_clim_tile < 0.) = 0.; % set small negative values to 0

% averaging A, D values
tile_data = nanmean(data_clim_tile,3);
tile_data = mean(data_clim_tile,3,"omitnan");
fname_out = strrep(fname, L2_Ascdes,'_AD_');
if fill_small_gaps

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
L2_version,start_time, end_time)

% function to compute the 2 RTM constant variables: Albedo and Roughness(H) based on the
% preprocessed data. Constants are taken as the long term temporal nanmean
% preprocessed data. Constants are taken as the long term temporal mean
% with maximum coverage across Asc/Desc passes.

% Q. Liu 18 Jul 2022
Expand Down Expand Up @@ -212,7 +212,7 @@
data_clim_tile(data_clim_tile < 0.) = 0.; % set small negative values to 0

% averaging A, D values
tile_data = nanmean(data_clim_tile,2);
tile_data = mean(data_clim_tile,2,"omitnan");

eval(['out_mwRTM.',out_Para{iPara},'=tile_data;'])
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
clear

% -------------------------------------------------------------------
% Begin user-defined inputs
% -------------------------------------------------------------------

% addpath('../../shared/matlab/');
addpath('/discover/nobackup/amfox/current_GEOSldas/GEOSldas/src/Applications/LDAS_App/util/shared/matlab')

% Define the Open Loop experiment path, run name, domain, and output prefix

exp_path = '/discover/nobackup/amfox/Experiments/OLv7_M36_ascat';
exp_run = {'OLv7_M36_ascat'};
domain = 'SMAP_EASEv2_M36_GLOBAL';
prefix_out = 'M36_zscore_stats_';

% Define the Open Loop experiment start and end dates

start_month = 4;
start_year = 2015;
end_month = 3;
end_year = 2021;

% Define the species names

species_names = {'ASCAT_META_SM','ASCAT_METB_SM','ASCAT_METC_SM'};

% Define whether to combine species

combine_species_stats = 1; % 1 to combine all species into single set of statistics

% Define the grid resolution (degrees)

grid_resolution = 0.25;

% Define moving window size over which statistics are calculated,
% and minimum number of data points required to calculate statistics

w_days = 75;
Ndata_min = 5;

% Define the assimilation time step and initial time

dt_assim = 3*60*60;
t0_assim = 0;

% Define print intervals

print_each_DOY = 1;
print_each_pentad = 0;
print_all_pentads = 1;

% Define output directory (takes form "domain"/stats/"out_dir")
out_dir = 'z_score_clim_quarter_degree';

% Define the months to run over, 1:12, plus a number of months required to complete the window
run_months = [1:12 1:ceil(w_days/30)];

% -------------------------------------------------------------------
% End user-defined inputs
% -------------------------------------------------------------------

% Calculate the earliest and latest years for each month in the experiment
earliest_year = zeros(length(run_months),1);
latest_year = zeros(length(run_months),1);

cnt = 0;
for month = run_months
% Initialize the earliest and latest year variables
cnt = cnt + 1;

% Check if the current year/month combination is earlier than the earliest
if datenum(start_year, month, 1) < datenum(start_year, start_month, 1)
earliest_year(cnt) = start_year+1;
else
earliest_year(cnt) = start_year;
end

% Check if the current year/month combination is later than the latest
if datenum(end_year, month, 1) > datenum(end_year, end_month,1)
latest_year(cnt) = end_year-1;
else
latest_year(cnt) = end_year;
end
end

% assume "ldas_obsparam" file is available at 0z on first day of start_month/start_year

YYYY = num2str( start_year, '%4.4d' );
MM = num2str( start_month, '%2.2d' );

obs_param_fname = [exp_path, '/', exp_run{1}, '/output/', domain, '/rc_out/Y', YYYY, ...
'/M', MM, '/',exp_run{1}, '.ldas_obsparam.', YYYY, MM, '01_0000z.txt'];

[N_obs_param, obs_param ] = read_obsparam(obs_param_fname);

species =[];

for i = 1:length(species_names)
add_species = obs_param(strcmp(species_names(i),{obs_param.descr})).species;
species = union(species,add_species);
end

if combine_species_stats
disp('Calculating stats by combining multiple species');
end

% Calculate the climatology statistics

get_model_and_obs_clim_stats_latlon_grid( species_names, run_months, exp_path, exp_run{1}, domain, earliest_year, ...
latest_year, dt_assim, t0_assim, species, combine_species_stats, ...
grid_resolution, w_days, Ndata_min, prefix_out, print_each_DOY, ...
print_each_pentad, print_all_pentads, out_dir );

% ================= EOF =========================================================================
Loading