NOAA-GFDL / MOM6-examples

Example configurations for MOM6 and SIS2
Other
88 stars 148 forks source link

"o2_tendency" and "dic_tendency" are missing value in diagnostics #226

Open favorliao opened 6 years ago

favorliao commented 6 years ago

Hi,

I want to diagnose o2 and dic budget in MOM6. However, the diagnostics (nc files) shows all the o2_tendency and dic_tendency are missing values. Regarding other terms in equation (e.g., o2_vmove, o2_vdiffuse_impl, and o2_vdiff), there are normal values in 10-90N and missing values in other regions (10N-90S). Is there any solution for this problem?

Thanks,

Enhui

ashao commented 6 years ago

From your description it sounds like o2_tendency and dic_tendency are registered, but never posted anywhere. Can you clarify a few things? 1) Which biogeochemical model are you using? 2) For the other diagnostics are you saying that only the northern hemisphere has sensible values? 3) Could you point to a run that's exhibiting this behavior?

favorliao commented 6 years ago
  1. The biogeochemical model is latest COBALT.
  2. Yes. The northern hemisphere has sensible value and southern hemisphere has missing values.
  3. How to point to a run? The run is in Princeton cluster with latest MOM6 and COBALT model. It is an ocean forced run and forcing is JRA interannual forcing.
ashao commented 6 years ago

If the run isn't on GFDL's Gaea, could you post the diag_table, MOM_parameter.short, and input.nml to https://gist.github.com/?

MJHarrison-GFDL commented 6 years ago

This sounds like there may have been a problem with the Tiger cluster. Can you verify that this is reproducible on your cluster? If so, then we need to determine if this is a problem with tendency diagnostics for generic tracers in MOM6 or if the problem is specific to the COBALT package. Knowing if any of the tracer tendency diagnostics are correct (e.g. in BLING, or CFCs) would be helpful as well.

favorliao commented 6 years ago

As matt suggested, I tested it again that the problem is not reproducible on my cluster. It seems like some region has reasonable values and some region not. Not reproducible means the output files not always has reasonable value in specific region. Sometimes, it has value in region A, but sometimes not. For other variable, such as "dic" concentration, there is not this problem.

image

The diag_table, MOM_parameter.short, and input.nml is https://gist.github.com/favorliao/944c1da74b7ebbc96ee0efd1b4e6dc81

ashao commented 6 years ago

@favorliao, I think I'm a little confused. Did you run the model again and now you have some values for DIC tendency whereas before you did not? Also that output looks strange, is what you're plotting from the remapped diagnostic output or the native hybrid-coordinate?

@MJHarrison-GFDL, if I remember correctly, I think there's a CPP flag in the generic tracer package that controls whether the MOM6 wrapper of the diag manager or the FMS diag manager is used. Am I correct in assuming that CM4/ESM4 uses the MOM6 wrapper?

favorliao commented 6 years ago

@ashao , I run the model again and I have some values for DIC tendency whereas before I did not. The results are remapped diagnostic output. I am going to run again to see native hybrid-coordinate.

favorliao commented 6 years ago

I double check there is the same problem in the native hybrid-coordinate.

MJHarrison-GFDL commented 6 years ago

I just spoke with @nikizadehgfdl and he informed me that the CPP flag "_USE_MOM6_DIAG" is enabled in ESM4 in order to get correct remapped diagnostics - so this is worth a try

favorliao commented 6 years ago

I just check the compilation file and I found the "_USE_MOM6_DIAG" is used in my current run. Do I need to try a run without "_USE_MOM6_DIAG"?

The compilation is: (cd $BUILDDIR; rm -f path_names; \ "$BASEDIR/src/mkmf/bin/list_paths" ./ "$BASEDIR/src/MOM6/config_src/{dynamic,coupled_driver}" "$BASEDIR/src/MOM6/src/{*,*/*}/" "$BASEDIR/src/{atmos_null,coupler,land_null,ice_ocean_extras,icebergs,SIS2,FMS/coupler,FMS/include}/" "$BASEDIR/src/ocean_shared/{generic_tracers,mocsy/src}") (cd $BUILDDIR; \ "$BASEDIR/src/mkmf/bin/mkmf" -t $MKF_TEMPLATE -o '-I../../shared/repro' -p MOM6beta2 -l '-L../../shared/repro -lfms' -c '-Duse_libMPI -Duse_netCDF -DSPMD -Duse_AM3_physics -D_USE_LEGACY_LAND_ -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2' path_names )

MJHarrison-GFDL commented 6 years ago

What you have should be correct .

ashao commented 6 years ago

To narrow down whether this is a problem with the generic tracer package or with MOM6, could you try outputting the ocean_model calculation of the tendency? For example replace

 "generic_cobalt_z","o2_tendency", "o2_tendency", "hist_newMOM_diag_o2_month_%4yr_%3dy", "all", "mean", "none", 2

with

 "ocean_model_z","o2_tendency", "o2_tendency", "hist_newMOM_diag_o2_month_%4yr_%3dy", "all", "mean", "none", 2
favorliao commented 6 years ago

I just finished the run. There is no "o2_tendency" variable in the output file. I think the reason is "o2_tendency" is not registered in ocean_model. According to "available_diags.000000", "o2_tendency" only register in generic_cobalt.

`"generic_cobalt", "o2_tendency" [Unused] ! long_name: Generic tracer tendency of o2 ! units: mole/m^2/s ! cell_methods: xh:mean yh:mean zl:mean area:mean

"generic_cobalt", "o2_tendency_xyave" [Unused] ! long_name: Generic tracer tendency of o2 ! units: mole/m^2/s ! cell_methods: zl:mean

"generic_cobalt_z", "o2_tendency" [Unused] ! long_name: Generic tracer tendency of o2 ! units: mole/m^2/s ! cell_methods: xh:mean yh:mean z_l:mean area:mean

"generic_cobalt_z", "o2_tendency_xyave" [Unused] ! long_name: Generic tracer tendency of o2 ! units: mole/m^2/s ! cell_methods: z_l:mean

"generic_cobalt_rho2", "o2_tendency" [Unused] ! long_name: Generic tracer tendency of o2 ! units: mole/m^2/s ! cell_methods: xh:mean yh:mean rho2_l:mean area:mean`

ashao commented 6 years ago

I was just looking through the code and it doesn't look like the oxygen tendency is calculated anywhere in COBALT and I can't see where the dic_tendency diagnostic is registered in generic_tracers or where any cell-by-cell tendencies are calculated, so I have questions as to what is actually being output in the plots that @favorliao made.

I think the easiest thing to do would be to get MOM6 to post these diagnostics since the tracer registry is already setup to calculate most of the physical ones (https://github.com/NOAA-GFDL/MOM6/blob/dev/gfdl/src/tracer/MOM_tracer_registry.F90). Something in generic tracer would still be responsible for any column-related tendencies (sources/sinks and vertical difffusion come to mind).

nikizadehgfdl commented 6 years ago

@favorliao could you try the following code change in MOM6/src/tracer/MOM_generic_tracer.F90 line 199 :

-                              registry_diags=.false., &   !### CHANGE TO TRUE?
+                              registry_diags=.true., &   !### CHANGE TO TRUE?

And then change the module for the tendency diagnostics in diag_table to "ocean_model", .e.g.,

 "ocean_model", "o2_tendency",        "o2_tendency",         "ocean_annual","all","mean","none",2
 "ocean_model", "dic_tendency",        "dic_tendency",         "ocean_annual","all","mean","none",2

Let us know if that works.

favorliao commented 6 years ago

@nikizadehgfdl It works after I change the "registry_diags" from false to true. Thanks a lot! The output shows no more missing values and the order of magnitude seems plausible when I compare it with time difference of o2 field.

favorliao commented 6 years ago

Hi, May I ask one more question? Since I want to diagnose tracer (e.g., o2) budget, I output the "o2_diffx_2d". However, there is a similar issue that "o2_diffx_2d" has missing value. Does anyone know the solution?

Enhui

ashao commented 6 years ago

Is the diagnostic registered with 'ocean_model' and NOT 'ocean_model_z' or 'generic_cobalt'?

favorliao commented 6 years ago

@ashao The diagnostic "o2_diffx_2d" registered with "ocean_model".

adcroft commented 6 years ago

Is this resolved?

nikizadehgfdl commented 6 years ago

No. The user has a code patch, but I did not make a PR since the fix has to be first evaluated in ESM4 to make sure it doesn't harm the current cmip6 diagnostics.