metno / emep-ctm

Open Source EMEP/MSC-W model
GNU General Public License v3.0
27 stars 18 forks source link

Stomata flux question - StoFlux_ml.f90 #52

Closed mvieno closed 4 years ago

mvieno commented 5 years ago

Hi, in the stomata flux calculation module near the line 156 (StoFlux_ml.f90) the L%g_sun is set as the old_gsun(i,j,ivps) if the SumVPD is larger than 8.

if ( SumVPD(i,j,ivpd) > 8.0 ) L%g_sun = min( L%g_sun, old_gsun(i,j,ivpd) )

This is done within the land cover loop, so the old_gsun may be from a different land cover? I may have massively misinterpreted this.

Massimo

mvieno commented 5 years ago

I am using rv4.17

mifads commented 5 years ago

Hi Massimo, I'm busy ESX'ing this week with Arthur, but will take a look a.s.a.p, and if anything needs fixing I'll get it into the open-source (coming in ca. 2 weeks).

mifads commented 5 years ago

Hi Massimo, Sorry it took so long to get back to this. I think the code is ok, since the old_gsun has index ivpd. This index applies only for that particular land-cover.

I see some other issues in the same code though. The variable my_first_call is kept at true always in Setup_StoFlux. No harm done, but the allocations are done way too many times. More serious, the reset of SumVPD, old_gsun and old_daynumber on the same routine are based upon jd /= old_number. This is fine for Europe, but should be changed for global runs. I'll sort this out for the next open-source.

avaldebe commented 5 years ago

@mifads Was this addressed on rv4_33?

mifads commented 5 years ago

Afraid not. Luckily it doesn't matter much for European runs, but we should sort it out for global. Massimo, feel free to remind me after the vacation period.

mifads commented 4 years ago

In the soon-to-be-released rv4_34, the logic around SumVPD etc has now been changed to use radiation (Grid%Idirect) rather than daynumber to reset to night values. This should now work anywhere on the globe. So, I'll close this issue :-)