CABLE-LSM / CABLE-Trac-archive

Archive CABLE Trac contents as issues
Other
0 stars 0 forks source link

bug in code translation within SUBROUTINE surface_albedosn #201

Open penguian opened 6 years ago

penguian commented 6 years ago

keyword_snow_albedo_keepgit type_defect | by bep599


The original version in CABLE1.4b has: tmp = ssoil%isflag ssoil%tggsn(:,1) + (1 - ssoil%isflag ) ssoil%tgg(:,1)

tmp = MIN(tmp, 273.15)

ar1 = 5000.0 * (1.0 / 273.15 - 1.0 / tmp) ! crystal growth  (-ve)

ar2 = 10.0 * ar1 ! freezing of melt water

Somehow, when translated into CABLE2.0, it becomes: tmp = ssnow%isflag ssnow%tggsn(:,1) + ( 1 - ssnow%isflag ) ssnow%tgg(:,1)

  tmp = MIN( tmp, C%TFRZ )

  ar1 = 5000. * (1. / (C%TFRZ-0.01) - 1. / tmp) ! crystal growth  (-ve)

  ar2 = 10. * ar1 ! freezing of melt water

Since tfrz is set to 273.16, the second and third lines are not complementary. When tmp is just below freezing point (between 273.15 and 273.16), there will be positive values of ar1 and ar2.


Issue migrated from trac:201 at 2023-11-27 11:26:50 +1100

penguian commented 6 years ago

@bep599@nci.org.au edited the issue description

penguian commented 5 years ago

@bep599@nci.org.au commented


There are also 8 instances in SUBROUTINE snowdensity within cable_soilsnow.F90 where the number 273.15 has been used. Suggest to use C%belowFRZ, with assigned value of 273.15, to replace all 10 instances. Later on, someone can test if some other value (eg. 273.159 or 273.15999, etc.) could be more appropriate.

penguian commented 2 years ago

@inh599@nci.org.au commented


In this particular case we need to ensure that the value of ar1 and ar2 is negative or = 0

There are three solutions

penguian commented 1 year ago

@ccc561@nci.org.au changed keywords from snow albedo to snow albedo keepgit