Recently, I am running the Bio_Fennel model and ready to simulate the pCO2 in seawater distribution in China seas. I read the subroutine for the calculating the pCO2 in Fennel model, and find there is one choice about defining WET_DRY CPP, such as follows:
DiaBio2d(i,j,ipCO2)=pCO2(i)
# ifdef WET_DRY
DiaBio2d(i,j,ipCO2)=DiaBio2d(i,j,ipCO2)*rmask_io(i,j)
# endif
I added Yangtze River in my model, so after considering the calculating at the nearshore, I define WET_DRY cpp. After running some days, I find the values of DIAGNOSTICS_BIO outputs, like the pCO2, CO2_airsea flux and so on, are all zero. While If I do not define the WET_DRY, the results are performing normal. Could anyone help and explain this problem. Thanks!
Problems about pCO2 and CO2_flux output results under Wetdry
Re: Problems about pCO2 and CO2_flux output results under We
Yeah, WET_DRY and ecosystem models are a tricky mix. I went through COBALT, adding the wetdry mask to all the diagnostics and got the diagnostics to look OK. Then I discovered that I had to move the wetdry mask stuff to the actual computations instead of to the diagnostics of those computations. Anyway, this is to say that there could be work to do in Fennel too.
-
- Posts: 10
- Joined: Tue Aug 02, 2011 5:18 am
- Location: national marine environmental forcasting center
Re: Problems about pCO2 and CO2_flux output results under We
Hi Kate,
Thanks for reply. I do not understand your method. Does that mean I should remove rmask_io from the computation for the diagnostics in Fennel model, or using rmask instead of rmask_io?
Thanks for reply. I do not understand your method. Does that mean I should remove rmask_io from the computation for the diagnostics in Fennel model, or using rmask instead of rmask_io?
Re: Problems about pCO2 and CO2_flux output results under We
Hernan and I haven't always agreed on what mask to use when. I'm using rmask_full to mask biological processes where dry. Otherwise, I was getting very large values for some fields, not zeroes.
Re: Problems about pCO2 and CO2_flux output results under We
Looking in the source code I have downloaded I see no occurrence of the variable rmask_io in fennel.h.
So I went into the source code "trac" tool
https://www.myroms.org/projects/src/wiki
intending to look at the sequence of changes to fennel.h.
But first I did a search on "rmask_io"
which led me directly to this ticket from 3 years ago:
https://www.myroms.org/projects/src/ticket/648
So you have a very old fennel.h. That might be OK if the rest of your code is also 3 years or more old (not recommended) but I suspect you have mixed and matched codes and so you have inconsistent masking variables.
I recommend you update your ROMS code.
If you are using a modified fennel.h, if you have kept those modifications in your svn repository there is every possibility that those mods will be successfully preserved in the update, or flagged with sufficiently few conflicts diffs that you can resolve them easily.
The new rmask_full etc. variables are used instead of rmask only in the WET_DRY option
and should always be used in WET_DRY. If you are modifying fennel.h then if a cell is dry you probably want nothing to happen in that cell - but just think through the logic of what will happen when the cell gets wet again and might have an inventory of nitrogen in it carried over from before it dried out.
The DIAGNOSTICS and AVERAGES options use other special masks in wetting/drying because the time average step in both cases has to be modified to count only the time steps during which cells are wet. That's what the rmask_avg etc. variables defined in Utility/set_mask.F are for. If you read through the code I think the logic becomes apparent.
So I went into the source code "trac" tool
https://www.myroms.org/projects/src/wiki
intending to look at the sequence of changes to fennel.h.
But first I did a search on "rmask_io"
which led me directly to this ticket from 3 years ago:
https://www.myroms.org/projects/src/ticket/648
So you have a very old fennel.h. That might be OK if the rest of your code is also 3 years or more old (not recommended) but I suspect you have mixed and matched codes and so you have inconsistent masking variables.
I recommend you update your ROMS code.
If you are using a modified fennel.h, if you have kept those modifications in your svn repository there is every possibility that those mods will be successfully preserved in the update, or flagged with sufficiently few conflicts diffs that you can resolve them easily.
The new rmask_full etc. variables are used instead of rmask only in the WET_DRY option
and should always be used in WET_DRY. If you are modifying fennel.h then if a cell is dry you probably want nothing to happen in that cell - but just think through the logic of what will happen when the cell gets wet again and might have an inventory of nitrogen in it carried over from before it dried out.
The DIAGNOSTICS and AVERAGES options use other special masks in wetting/drying because the time average step in both cases has to be modified to count only the time steps during which cells are wet. That's what the rmask_avg etc. variables defined in Utility/set_mask.F are for. If you read through the code I think the logic becomes apparent.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu