Add Chlorophyll Files to the Run#
MOM6 can take chlorophyll data as a file in the regional domain. It impacts shortwave penetration. MOM6 parameters that are impacted by it CHL_FROM_FILE, CHL_FILE, VAR_PEN_SW, and PEN_SW_NBANDS. In our workflow, we take raw data from SeaWIFS, process it globally, and subset to our regional domain.
Chlorophyll can be added into a CrocoDash case, using functions from mom6_bathy and called from configure_forcings. There is one parameter in configure forcings and three parameters in MOM6
Caution
This method does not do a great job of resolving chlorophyll in estuaries and similar features. If possible, the generated chlorophyll file should be replaced with a better product (which can be done by replacing the file in CHL_FILE
).
CrocoDash Parameters#
In case.configure_forcings(), the argument chl_processed_filepath takes in a processed global chlorophyll file. The global processed chlorophyll file is hosted on the CESM inputdata svn server under ocn/mom/croc/chl/data and can be accessed through the CrocoDash raw_data_access module like below:
from CrocoDash.raw_data_access.datasets import seawifs as sw
sw.get_processed_global_seawifs_script_for_cli(
output_dir="<insert_dir>",
output_file="get_seawifs_data.sh"
)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Input In [1], in <cell line: 0>()
1 from CrocoDash.raw_data_access.datasets import seawifs as sw
----> 2 sw.get_processed_global_seawifs_script_for_cli(
3 output_dir="<insert_dir>",
4 output_file="get_seawifs_data.sh"
5 )
File ~/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/raw_data_access/datasets/seawifs.py:88, in get_processed_global_seawifs_script_for_cli(dates, lat_min, lat_max, lon_min, lon_max, output_dir, output_file)
57 def get_processed_global_seawifs_script_for_cli(
58 dates="UNUSED",
59 lat_min="UNUSED",
(...)
64 output_file="processed_seawifs.nc",
65 ):
66 """
67 Downloads chlor_a data from the CESM inputdata repository by generating a script users can run in their terminal.
68 Parameters
(...)
85
86 """
---> 88 return utils.write_bash_curl_script(
89 url="https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/ocn/mom/croc/chl/data/SeaWIFS.L3m.MC.CHL.chlor_a.0.25deg.nc",
90 script_name="get_processed_seawifs.sh",
91 output_dir=output_dir,
92 output_filename=output_file,
93 )
File ~/work/CrocoGallery/CrocoGallery/CrocoDash/CrocoDash/raw_data_access/datasets/utils.py:22, in write_bash_curl_script(url, script_name, output_dir, output_filename)
13 full_path = os.path.join(output_dir, output_filename)
14 script_lines = [
15 "#!/bin/bash",
16 "",
(...)
19 'echo "Download complete."',
20 ]
---> 22 with open(full_script_path, "w") as f:
23 f.write("\n".join(script_lines))
24 os.chmod(full_script_path, 0o755) # Make it executable
FileNotFoundError: [Errno 2] No such file or directory: '<insert_dir>/get_processed_seawifs.sh'
The file path of the global file (after running the script from the code block) can be passed into configure forcings as shown in this demo
case.configure_forcings(
date_range = ["2020-01-01 00:00:00", "2020-01-09 00:00:00"],
chl_file = "<CHL_PROCESSED>",
)