Exponentially Decaying Dye
This week I successfully converted an inert passive dye into a nonconservative dye that decays exponentially! However, the dye decayed at a rate that was 8-times smaller than what I defined. Clearly, I still need to do a bit more debugging.
The good news is that there isn’t any apparent noise in the model output, but I need to confirm this with more rigorous testing in the coming week.
More details below.
The experiment and the results
In this experiment, I added two inert passive tracer dyes to LiveOcean:
- dye_01
- dye_02
Both of these dyes have zero concentration everywhere, except for a single point source at West Point WWTP, which discharges both dyes at the same concentration.
After verifying that both inert passive dyes worked, I then forced dye_02 to decay exponentially. The movie below shows the concentration differences between dye_01 and dye_02 over the course of one day.
Because dye_01 and dye_02 discharge from West Point at the same rate and concentration, then anywhere that dye_01 > dye_02 suggests that dye_02 must have decayed.
Fig. 1 Comparison of dye_01 and dye_02 concentration after one day of run time. The left panel shows surface differences. The right panel shows bottom differences. The pink circle denotes the location of West Point WWTP.
Below I have also included a binary difference plot to show how much the signal propagates. It seems as though the difference in dye concentrations propagates rather far– but the propagation doesn’t appear noisy. For instance, I’m not seeing any spurious differences at Sinclair Inlet.
Fig. 2 Binary comparison of dye_01 and dye_02 after one day of run time. Black indicates that there are concentration differences between dye_01 and dye_02 in at least one sigma level within a horizontal grid cell.
However, I still need to investigate noise more rigorously in future experiments to verify that the tracer implementation is truly noise-free.
Interventions in the code
fennel.h interventions
Initialize idye index.
Initialize scratch arrays for dye.
Add dye concentrations to scratch arrays.
Use backward-implicit exponential decay scheme on dye_02, which corresponds to inert(2).
Update global tracer array with dye concentrations from scratch array.
fennel_def_pio.h
Print the input exponential decay rate, decay_dye2, into output netCDF file.
fennel_def.h
Print the input exponential decay rate, decay_dye2, into output netCDF file.
fennel_inp.h
Read in the specified exponential decay rate, decay_dye02.
Print the specified exponential decay rate, decay_dye02, to log.txt file.
fennel_mod.h
Declare the specified exponential decay rate, decay_dye02.
Allocate the specified exponential decay rate values to the variable decay_dye02.
fennel_var.h
Assign metadata indices for the decay_dye02 variable.
fennel_wrt_pio.h
Prints exponential decay rate, decay_dye02, to output file.
fennel_wrt.h
Prints exponential decay rate, decay_dye02, to output file.
bio_Fennel_BLANK.in
Specify the value of the exponential decay rate, decay_dye02.
Bug in the decay rate
I specified an exponential decay rate of 8E-6 1/s in my input file (see above code snippet), which corresponds to a half-life of 1 day. However, ROMS used a value of 1E-6 1/s. In both the log.txt file and the output history files, ROMS prints:
I am not sure why I am seeing this bug and I need to spend some time understanding why this problem popped up.