Problems about pCO2 and CO2_flux output results under Wetdry

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
kent
Posts: 10
Joined: Tue Aug 02, 2011 5:18 am
Location: national marine environmental forcasting center

Problems about pCO2 and CO2_flux output results under Wetdry

#1 Post by kent » Sun Dec 24, 2017 8:08 pm

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!

User avatar
kate
Posts: 3678
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Problems about pCO2 and CO2_flux output results under We

#2 Post by kate » Sun Dec 24, 2017 9:21 pm

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.

kent
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

#3 Post by kent » Mon Dec 25, 2017 3:48 am

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?

User avatar
kate
Posts: 3678
Joined: Wed Jul 02, 2003 5:29 pm
Location: IMS/UAF, USA

Re: Problems about pCO2 and CO2_flux output results under We

#4 Post by kate » Mon Dec 25, 2017 1:34 pm

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.

User avatar
wilkin
Posts: 503
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Problems about pCO2 and CO2_flux output results under We

#5 Post by wilkin » Wed Dec 27, 2017 9:45 pm

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.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply