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

Tracer advection siparcs #322

Merged
merged 18 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3ce7a74
lorenz_96_tracer_advection model
fairaque1999 Jan 6, 2022
de83106
bug-fix for model interpolate tracer advection
jlaucar Jan 6, 2022
f470cad
cdl file rather than netcdf
hkershaw-brown Jan 6, 2022
6c54f84
Documentation for lorenz_96_tracer_advection
hkershaw-brown Jan 7, 2022
8fc5b91
reanmed target to target_loc to avoid using fortran keyword target
hkershaw-brown Jan 7, 2022
6d39e0a
fix link to model documentation, remove old add_dommain
hkershaw-brown Jan 7, 2022
33ccd01
bug-fix for state_loc. Was using integer division so elements
hkershaw-brown Jan 7, 2022
f13b23b
removed print statements and early exit left in from last commit
hkershaw-brown Jan 7, 2022
2a2d773
removed var_offset, conc_offset, source_offset from namelist.
hkershaw-brown Jan 7, 2022
79b1959
Merge branch 'main' into tracer_advection_siparcs
hkershaw-brown Jan 18, 2022
1448134
Merge branch 'main' into tracer_advection_siparcs
hkershaw-brown Feb 3, 2022
300fb54
replace hardcoded 1:40 and /3 with grid_size
hkershaw-brown Feb 3, 2022
d794dcf
Merge branch 'main' into tracer_advection_siparcs
hkershaw-brown Feb 7, 2022
309beb1
fix rst formatting and description of model size
hkershaw-brown Feb 11, 2022
953293e
Merge branch 'main' into tracer_advection_siparcs
hkershaw-brown Feb 14, 2022
7350f08
add lorenz_96_tracer_advection to plot_bins
hkershaw-brown Feb 17, 2022
461bfdc
Merge branch 'main' into tracer_advection_siparcs
hkershaw-brown Mar 10, 2022
d4d0192
bump version and changlog for release
hkershaw-brown Mar 10, 2022
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
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ References
models/lorenz_84/readme
models/lorenz_96/readme
models/lorenz_96_2scale/readme
models/lorenz_96_tracer_advection/readme
models/forced_lorenz_96/readme
models/MITgcm_ocean/readme
models/mpas_atm/readme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
! QTY_LARGE_SCALE_STATE desc="state varies with large time/space scale"
! QTY_SMALL_SCALE_STATE desc="state varies with small time/space scale"
! QTY_1D_PARAMETER
! QTY_TRACER_CONCENTRATION
! QTY_TRACER_SOURCE
!
! END DART PREPROCESS QUANTITY DEFINITIONS
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_correl.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function plot_correl(diagn_file)
fprintf('Correlating variable %s index %d at time %d.\n', ...
pinfo.base_var,pinfo.base_var_index, pinfo.base_time)

case {'simple_advection'}
case {'simple_advection', 'lorenz_96_tracer_advection'}

disp('Your choice of variables are:')
disp(pinfo.vars)
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_ens_err_spread.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function plot_ens_err_spread(input_file)
switch lower(pinfo.model)

case {'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale', ...
'forced_lorenz_96','lorenz_04','ikeda','simple_advection', 'null'}
'forced_lorenz_96','lorenz_04','ikeda','simple_advection','lorenz_96_tracer_advection', 'null'}

varid = SetVariableID(pinfo);
pinfo.var = varid.var;
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_ens_mean_time_series.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function plot_ens_mean_time_series(input_file)
switch lower(pinfo.model)

case {'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale', ...
'forced_lorenz_96','lorenz_04','ikeda','simple_advection', 'null'}
'forced_lorenz_96','lorenz_04','ikeda','simple_advection','lorenz_96_tracer_advection', 'null'}

varid = SetVariableID(pinfo);
pinfo.var = varid.var;
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_ens_time_series.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function plot_ens_time_series(input_file)

switch lower(pinfo.model)

case {'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale', ...
case {'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale','lorenz_96_tracer_advection' ...
'forced_lorenz_96','lorenz_04','ikeda','simple_advection', 'null'}

varid = SetVariableID(pinfo);
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_jeff_correl.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function plot_jeff_correl(fname)
inputstring = input('Input variable and index for correlation \n','s');
[pinfo.state_var, pinfo.state_var_index] = ParseAlphaNumerics(inputstring);

case {'simple_advection'}
case {'simple_advection', 'lorenz_96_tracer_advection'}

disp('Your choice of variables are:')
disp(pinfo.vars)
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_phase_space.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function plot_phase_space(fname)
'ens_mem' , ens_mem , ...
'ltype' , ltype );

case {'simple_advection'}
case {'simple_advection','lorenz_96_tracer_advection'}
Copy link
Member Author

@hkershaw-brown hkershaw-brown Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get this to run.

>> plot_phase_space
Input name of netCDF file:
<cr> for true_state.nc

Your choice of variables are:
    {'state_variable'      }
    {'tracer_concentration'}
    {'source'              }

the indices (locations) can range from 1 to 40
Input variable and index for axis 1 <cr> for state_variable 1
state_variable 1
Input variable and index for axis 2 <cr> for state_variable 13
tracer_concentration 1
Input variable and index for axis 2 <cr> for state_variable 27
source 1
Error using internal.matlab.imagesci.nc/getGroupAndVarid (line 2096)
Could not find variable or group 'CopyMetaData' in file.

Error in internal.matlab.imagesci.nc/read (line 593)
            [gid, varid] = getGroupAndVarid(this, location);

Error in ncread (line 66)
vardata = ncObj.read(varName, varargin{:});

Error in plot_phase_space (line 204)
         metadata = ncread(fname,'CopyMetaData');


if (ishold), clear var1 var2 var3 ens_mem ltype; end

Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_sawtooth.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function plot_sawtooth(posterior_file,prior_file)
switch lower(pinfo.model)

case {'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale', ...
'lorenz_04','forced_lorenz_96','ikeda','simple_advection', 'null'}
'lorenz_04','forced_lorenz_96','ikeda','simple_advection','lorenz_96_tracer_advection','null'}

% determine which variable ['state','X','Y' ...] and
% determine which variable IDs (locations), as well as
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_total_err.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function plot_total_err(input_file)
pinfo = CheckModelCompatibility(truth_file,input_file);

switch lower(pinfo.model)
case{'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale', ...
case{'9var','lorenz_63','lorenz_84','lorenz_96','lorenz_96_2scale','lorenz_96_tracer_advection', ...
'lorenz_04', 'forced_lorenz_96','ikeda','simple_advection', 'null'}

case{'fms_bgrid'}
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/plot_var_var_correl.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function plot_var_var_correl(fname)
inputstring = input('Input variable and index for correlation \n','s');
[pinfo.state_var, pinfo.state_var_index] = ParseAlphaNumerics(inputstring);

case {'simple_advection'}
case {'simple_advection', 'lorenz_96_tracer_advection'}

disp('Your choice of variables are:')
disp(pinfo.vars)
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/CheckModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

vars.fname = fname;

case {'simple_advection'}
case {'simple_advection', 'lorenz_96_tracer_advection'}

num_locs = dim_length(fname,'location'); % # of X variables
loc1d = ncread(fname,'location');
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotBins.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function PlotBins(pinfo)
axis tight
end

case {'lorenz_96_2scale','simple_advection'}
case {'lorenz_96_2scale','simple_advection', 'lorenz_96_tracer_advection'}

clf; iplot = 0;
for ivar = pinfo.var_inds,
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotCorrel.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function PlotCorrel( pinfo )
switch(lower(pinfo.model))

case {'9var','lorenz_63','lorenz_84','lorenz_96', 'lorenz_96_2scale', ...
'lorenz_04','forced_lorenz_96','ikeda','simple_advection', 'null'}
'lorenz_04','forced_lorenz_96','ikeda','simple_advection', 'lorenz_96_tracer_advection', 'null'}

% The Base Variable Index must be a valid state variable
if ( pinfo.base_var_index > pinfo.num_state_vars )
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotEnsErrSpread.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function PlotEnsErrSpread( pinfo )
end

case {'lorenz_63','lorenz_84','lorenz_96', 'lorenz_96_2scale', ...
'lorenz_04','forced_lorenz_96','ikeda','simple_advection', 'null'}
'lorenz_04','forced_lorenz_96','ikeda','simple_advection','lorenz_96_tracer_advection','null'}

truth = get_hyperslab('fname',pinfo.truth_file, ...
'varname',pinfo.var, ...
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotEnsMeanTimeSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function PlotEnsMeanTimeSeries( pinfo )
legend boxoff

case {'lorenz_96', 'lorenz_96_2scale', 'forced_lorenz_96', 'lorenz_04', ...
'ikeda', 'simple_advection', 'null'}
'ikeda', 'simple_advection', 'lorenz_96_tracer_advection','null'}

%% Plot all variables in own subplot ... might get cluttered.
figure(1); clf; iplot = 0;
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotEnsTimeSeries.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function PlotEnsTimeSeries( pinfo )
legend boxoff

case {'lorenz_96', 'lorenz_96_2scale', 'forced_lorenz_96', 'lorenz_04', ...
'ikeda', 'simple_advection', 'null'}
'ikeda', 'simple_advection', 'lorenz_96_tracer_advection', 'null'}

% Use one figure with subplots
figure(1); clf; iplot = 0;
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/PlotPhaseSpace.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function PlotPhaseSpace( pinfo )
legend boxoff

case {'9var', 'lorenz_63', 'lorenz_84', 'lorenz_96', 'lorenz_96_2scale', ...
'lorenz_04', 'forced_lorenz_96', 'simple_advection', 'null'}
'lorenz_04', 'forced_lorenz_96', 'simple_advection', 'lorenz_96_tracer_advection', 'null'}

BulletProof(pinfo, X, Y, Z) % rudimentary bulletproofing

Expand Down
52 changes: 52 additions & 0 deletions diagnostics/matlab/private/PlotTotalErr.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,59 @@ function PlotTotalErr( pinfo )
title({string1,string2},'interpreter','none','fontweight','bold')
xlabel(sprintf('model "days" (%d timesteps)',pinfo.time_series_length))
ylabel('Total Error')
end


case {'lorenz_96_tracer_advection'}

varlist = {'state_variable','tracer_concentration','source'};

for ivar = 1:length(varlist)

% Get the appropriate netcdf variables

truth = get_hyperslab('fname', pinfo.truth_file, ...
'varname', varlist{ivar}, ...
'permute', 'T', ...
'squeeze', 'T', ...
'tindex1', pinfo.truth_time(1), ...
'tcount', pinfo.truth_time(2));

varname = sprintf('%s_mean',varlist{ivar});
ens = get_hyperslab('fname', pinfo.diagn_file, ...
'varname', varname, ...
'permute', 'T', ...
'tindex1', pinfo.diagn_time(1), ...
'tcount', pinfo.diagn_time(2));

varname = sprintf('%s_sd',varlist{ivar});
spread = get_hyperslab('fname', pinfo.diagn_file, ...
'varname', varname, ...
'permute', 'T', ...
'tindex1', pinfo.diagn_time(1), ...
'tcount', pinfo.diagn_time(2));

[~,num_vars] = size(spread);

% Also need to compute the spread; zero truth for this and
% compute distance from 0
err = total_err(truth, ens);
err_spread = total_err(zeros(size(spread)), spread);
errTotal = sum(err)/pinfo.time_series_length;
spreadTotal= sum(err_spread)/pinfo.time_series_length;
string1 = ['time-mean Ensemble Mean Total Error = ' num2str(errTotal)];
string2 = ['time-mean Ensemble Spread = ' num2str(spreadTotal)];

figure(ivar); clf(ivar);
plot(pinfo.time,err, 'b', pinfo.time,err_spread, 'r','LineWidth',figdata.linewidth);
set(gca,'FontSize',figdata.fontsize)
legend(string1,string2,'Location','NorthEast','FontSize',figdata.fontsize)
legend boxoff
string1 = sprintf('%s Total Error over all %d variables', pinfo.model, num_vars);
string2 = sprintf('''%s'' %s', varlist{ivar}, pinfo.diagn_file);
title({string1,string2},'interpreter','none','fontweight','bold')
xlabel(sprintf('model "days" (%d timesteps)',pinfo.time_series_length))
ylabel('Total Error')
end

case 'fms_bgrid'
Expand Down
2 changes: 1 addition & 1 deletion diagnostics/matlab/private/SetVariableID.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
varid.var_inds = vrbl_inds;
end

case 'simple_advection'
case {'simple_advection','lorenz_96_tracer_advection'}

% query to see if the defaults are OK ...

Expand Down
1 change: 1 addition & 0 deletions models/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DART supported models:
- :doc:`lorenz_84/readme`
- :doc:`lorenz_96/readme`
- :doc:`lorenz_96_2scale/readme`
- :doc:`lorenz_96_tracer_advection/readme`
- :doc:`forced_lorenz_96/readme`
- :doc:`MITgcm_ocean/readme`
- :doc:`mpas_atm/readme`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading