NOAA-CEFI-Regional-Ocean-Modeling / ocean_BGC

3 stars 4 forks source link

Simplify and clean up co2 calculation code #72

Closed yichengt900 closed 6 days ago

yichengt900 commented 2 weeks ago

This PR addresses issue #71. The following modifications have been made:

  1. Renamed FMS_ocmip2_co2calc.F90 to FMS_ocmip2_co2calc.F90.archive.
  2. Created FMS_co2calc.F90, which contains the necessary routines/interface for mocsy co2 calculation.
  3. Simplified generic_COBALT.F90, generic_BLING.F90, and generic_abiotic.F90, so they now work properly with the new FMS_co2calc.F90.

The only thing I have not removed yet is the co2_calc option in the namelist. Removing co2_calc would affect the model configurations because we would have to take it out of input.nml to prevent the model from complaining about an unknown namelist.

This PR should not change answers and it has passed both the 1D case. and NWA12-COBALT RT case.

charliestock commented 2 weeks ago

This is great @yichengt900 Do you think a 1 year NWA12 test that looks at the DIC and/or air-sea exchange before and after this is needed to ensure that no subtle change has been introduced?

yichengt900 commented 1 week ago

@charliestock, good point. I conducted a one-year NWA12 test to check if the DIC results from this PR are identical to the results from the current dev/cefi branch. The good news is they are identical (see the plots below). I think this PR is now ready for review.

ALK, DIC, omega from currentdev/cefibranch: alk_dic_omega

ALK, DIC, omega from this PR: alk_dic_omega

yichengt900 commented 1 week ago

@charliestock,

Thank you. Regarding your 2 question, I checked the FMS air-sea exchange codes and found some ocmip2-linked codes. However, none of them seem to be related to FMS_ocmip2_co2calc.F90 directly. I will keep this PR open for a while to ensure everything is okay before we merge it.