-
Notifications
You must be signed in to change notification settings - Fork 145
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
MARBL-DART #701
MARBL-DART #701
Conversation
Thanks for this Robin! For reviewers, summary of July 11th 2024 meeting as todo list: model mom6-marbl:
observation converter(s):
General git tidiness:
Other: Testing:
backup of this branch since we're rewriting history: |
…n models/MARBL_MOM6_1D in branch marbl_mom6_1d) and MARBL_joint_estimation (developed in models/MARBL_MOM6_1D on branch param_estimation).
…imation branch. Also added in the observation codes for BATS variables, which were accidentally left out of the last commit.
…r parameter smoothing.
… This required fixing a bug in direct_netcdf_mod, using a solution provided by Helen Kershaw.
…d. Split the BATS data converter into two separate converters, one for sequential state or state-parameter estimation, and another for pure parameter estimation.
… cycles with MARBL without errors. Further testing needed to assess the quality of assimilations.
…imatology.py now records observation error in units of standard deviation, and the script also generates a surrogate netCDF file containing the BATS empirical climatology.
… BATS_clim data converter.
…t, so that it works with the self-contained test package.
9ed2fed
to
b126a16
Compare
it is actually a netcdf file
add executables to root/.gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first batch of review comments
! QTY_MICROWAVE_BRIGHT_TEMP | ||
! QTY_MICROZOOPLANKTON_CARBON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_quantities_mod is missing many of the new ocean qtys (ocean_quantities_mod.f90)
! QTY_DISSOLVED_INORGANIC_SIO3 | ||
! QTY_MESOZOOPLANKTON_CARBON | ||
! QTY_MICROZOOPLANKTON_CARBON | ||
! QTY_PARAM_AUTOTROPH1_KCO2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the goal of having PARAM in the QTY name? Just to communicate that it is a parameter?
Do you need a qty for each parameter? Could you have QTY_PARAMETER?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to differentiate this param from other model parameters, we can call it QTY_BGC_PARAM
so that it's only a biogeochemistry parameter. I don't think we need a quantity for every single parameter. If I am not mistaken, all MARBL parameters have the same physical properties, for instance >0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, I created multiple QTY_PARAM_...
types in order to facilitate experiments where multiple parameters are being estimated at once. For experiments of this type, we need a way to distinguish one parameter from another, although they do indeed have the same physical properties. That said, we did eventually switch to only running with one parameter being estimated at a time, and for experiments of that sort, having a single QTY_BGC_PARAM
would work just fine.
real(r8), parameter :: geolon = 360 - 64.0 | ||
real(r8), parameter :: geolat = 31.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are hardcoded, should these be namelist options for people to put the column anywhere on Earth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any reason to not make them namelist options, but a user will need to know that any mismatch between the location in the obs-seq file and geolat
/geolon
will cause DART to reject the observation. I think that was our motive for hard-coding those coordinates. We wanted to make sure that they always agreed with the coordinates written in the obs-seq file, which in turn are hard-coded into the obs converter.
! Print module information to log file and stdout. | ||
call register_module(source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! Print module information to log file and stdout. | |
call register_module(source) |
type(time_type) :: mom6_time | ||
integer :: mom_base_date_in_days, mom_days | ||
|
||
mom_base_date_in_days = 139157 ! 1982 1 1 0 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this always Jan 1st 1982?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless changes have been made to the MARBL date/time format, yes, it's always Jan 1st 1982.
|
||
character(len=*), parameter :: routine = 'read_ocean_geometry' | ||
|
||
! Need nx, ny |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
! Need nx, ny |
I think this comment is from the MOM6 model_mod where you need nx, ny for the size of the basin_depth variable. The column marble is (2,2) always.
&preprocess_nml | ||
input_obs_def_mod_file = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/observations/forward_operators/DEFAULT_obs_def_mod.F90' | ||
output_obs_def_mod_file = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/observations/forward_operators/obs_def_mod.f90' | ||
input_obs_qty_mod_file = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90' | ||
output_obs_qty_mod_file = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/assimilation_code/modules/observations/obs_kind_mod.f90' | ||
obs_type_files = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/observations/forward_operators/obs_def_ocean_mod.f90' | ||
quantity_files = '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/assimilation_code/modules/observations/default_quantities_mod.f90', '/glade/derecho/scratch/rarmstrong/marbl_dart/DART/assimilation_code/modules/observations/ocean_quantities_mod.f90' | ||
/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs changing to relative paths (within DART) rather than pointing at Robin's directories.
@@ -0,0 +1,241 @@ | |||
&perfect_model_obs_nml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will need qceff namelists in this file.
@@ -0,0 +1,2 @@ | |||
This folder contains files adapted from those in DART/observations/obs\_converters/text, for the purpose of converting data from the [Bermude Atlantic Time-Series Study](https://bats.bios.asu.edu/) (BATS) into a format readable by DART. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to .rst file for online docs
@@ -0,0 +1,2 @@ | |||
This folder contains files adapted from those in DART/observations/obs\_converters/text, for the purpose of converting data from the [Bermude Atlantic Time-Series Study](https://bats.bios.asu.edu/) (BATS) into a format readable by DART. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to .rst for online docs.
Description needed for BATS_clim vs BATS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my first rundown of the code. I have not run the code but I plan to do that soon.
ret = nf90_inquire(ncfile_in, unlimitedDimID=unlim_dimID) | ||
call nc_check(ret, 'read_variables: nf90_inquire', 'unlimitedDimID') | ||
|
||
if (has_unlimited_dim(domain) .and. any(get_io_dim_ids(domain, i) == unlim_dimID )) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a marbl-only issue? Do we need this chunk of code in other models? If so, I'm wondering if we should have a separate issue for this. Perhaps this is a question to @hkershaw-brown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup it is an issue already #614
It affects models which have some state variables with an unlimited dimension and some without.
! QTY_DISSOLVED_INORGANIC_SIO3 | ||
! QTY_MESOZOOPLANKTON_CARBON | ||
! QTY_MICROZOOPLANKTON_CARBON | ||
! QTY_PARAM_AUTOTROPH1_KCO2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to differentiate this param from other model parameters, we can call it QTY_BGC_PARAM
so that it's only a biogeochemistry parameter. I don't think we need a quantity for every single parameter. If I am not mistaken, all MARBL parameters have the same physical properties, for instance >0.
update_list = update_var_list(1:nfields)) | ||
|
||
! setting up the DART parameter vector | ||
if(estimate_params) then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the state is always being estimated. This is where we can generalize this and estimate:
- only state
- only parameters
- or both
Perhaps we can visit this later, but just a note that we can come back to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been a while since I was developing the parameter-only version, but as I remember, that setup still needs a separate domain for state variables. The reasoning here was that the forward operator in the parameter-only case involves running MARBL to produce climatological averages, and this operation cannot be coded into DART. Maintaining a separate domain for state variables allows us to compute those averages externally, so that DART can read them as identity observations from a "climatology" component of the state vector. That said, it might be better to rename that component within the model-mod, so that instead of state_dom_id
we have something like climatology_dom_id
.
!------------------------------------------------------------------ | ||
! Returns the number of items in the state vector as an integer. | ||
|
||
function get_model_size() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not very clean, especially if the parameter domain is not active. I would count the domains and loop over them to get the model_size
(which is by the way defined on line 84 but not used). I suggest a code similar to the one below:
domain_count = get_num_domains()
model_size = 0
do i_dom = 1,domain_count
model_size = model_size + get_domain_size(i_dom)
enddo
This is related to my previous comment on active domains and the nature of the DA configuration
! reading the clamp values | ||
|
||
if (table(i, 3) /= 'NA') then | ||
read(table(i,3), '(d16.8)') clamp_vals(i,1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the format specification needed here? What if people added the clamps in a different format?
@@ -0,0 +1,591 @@ | |||
! DART software - Copyright UCAR. This open source software is provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we agreed that we will only do the joint state-parameter estimation one. I would stick to one marbl directory and one model mod for now. These could be consolidated into one in the future. I mean something that comes to mind now is to do no_copy_back on the state variables to turn it into a parameter estimation only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we did agree to only do the joint state-parameter estimation model-mod. I had all three model-mods being developed on the same branch to make it easier to switch between them, which is why they're all in the same pull request; I apologize if that's bad form. In any case, MARBL_joint_estimation
is the one that we agreed to pull into DART.
was pointing at Robin's directory
note for test package, I switched to inflation not read from file
|
I checked out the code and I was not able to run any of the DART executables. Here is the error that I was getting:
So, it turns out the length of the state vector is
With this change, I can now run |
MARBL_joint_estimation is the model_mod we are using (see pull NCAR#701)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to run filter and state and parameter updates. The only necessary change that is needed to run filter properly is the handling of model_size
.
&filter_nml | ||
single_file_in = .false., | ||
input_state_files = '', | ||
input_state_file_list = 'states_input.txt', 'params_input.txt', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set estimate_params = .false.
in the model_nml
, the code will still look for a list of parameter files. I guess that's ok given that this is a joint state-parameter estimation routine. This can be easily fixed once we work on merging the 3 different filtering strategies together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set
estimate_params = .false.
in themodel_nml
, the code will still look for a list of parameter files. I guess that's ok given that this is a joint state-parameter estimation routine. This can be easily fixed once we work on merging the 3 different filtering strategies together.
merging the 3 different filtering strategies is happening as part of this pull request, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helen, I'm not quite sure. I'm happy to do it but it would take some time as I'm leaving. I say, we push the joint one now after small corrections. Once I'm back, I can get to it and add flexibility to perform the 3 using one code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is quite a bit to do before releasing on this code. I'll go ahead an close the pull request. We can reopen it when it its ready.
pushed robins branch to https://github.com/NCAR/DART/tree/marbl-dart |
|
Description:
Contains model-mods for data assimilation with the Marine Biogeochemistry Library (MARBL/MOM6).
also fixes #614
Testing Datasets:
A test package for MARBL_joint_estimation can be found at
/glade/u/home/rarmstrong/DART_test_package
.