Conversion from type 'DBNull' to type 'Double' is not valid

80 views
Skip to first unread message

D R Sena

unread,
Oct 11, 2019, 3:29:07 AM10/11/19
to AGWA Support
Hi Shea,
I tried to develop my own soil database for my area ( annexed herwith. While creating parameter file i receive the following error.

10/11/2019 10:15:50 AM
ParameterizerSoilsFao.GetsoilComponents()
The index passed was not within the valid range.
10/11/2019 11:55:39 AM
ModelKineros.ParFileHelper()
Conversion from type 'DBNull' to type 'Double' is not valid.

it also prepares a par file that looks like this passing the database to text file as follows

BEGIN GLOBAL
  CLEN = 10, UNITS = METRIC
  DIAMS = 0.25, 0.033, 0.004 ! mm
  DENSITY = 2.65, 2.65, 2.65 ! g/cc
  TEMP = 33                  ! deg C
  NELE = 136
END GLOBAL

BEGIN PLANE
  ID = 351, PRINT = 3, FILE = planes\plane_351.sim
  LEN = 3428, WID = 777.9
  SL =   0.34503, 0.18483, 0.14747, 0.31188, 0.25487, 0.22593, 0.11322, 0.13749, 0.14078, 0.19921, 0.08121, 0.19441, 0.16563, 0.24932, 0.18176, 0.14149, 0.16544, 0.16821, 0.10990, 0.11479
  SX =   0.00000, 0.03234, 0.10219, 0.15844, 0.22407, 0.29364, 0.33377, 0.37421, 0.42501, 0.48480, 0.54000, 0.59363, 0.64816, 0.71896, 0.78859, 0.84150, 0.88211, 0.93557, 0.98475, 1.00000
  MAN = 0.04, X = 217321.5, Y = 3350639.7
  CV = -99
  Ks = -128.23, G = -99, DIST = -99, POR = -99, ROCK = -99
  FR = 0.33, 0.33, 0.33, SPLASH = 0.001, COH = -99, SMAX = -99
  INTER = 0.93, CANOPY = 0.382, PAVE = 0.11
END PLANE

BEGIN PLANE
  ID = 352, PRINT = 3, FILE = planes\plane_352.sim
  LEN = 354.8, WID = 392.5
  SL =   0.06445, 0.07818, 0.04919, 0.06309, 0.05728, 0.04356, 0.04943, 0.03398, 0.03224, 0.03415, 0.04241, 0.05251, 0.23507, 0.47992, 0.32413, 0.27313, 0.25693, 0.17210, 0.35285, 0.10199
  SX =   0.00000, 0.04533, 0.10084, 0.15475, 0.20638, 0.25754, 0.32342, 0.38363, 0.44652, 0.49953, 0.55149, 0.59632, 0.65475, 0.71707, 0.77018, 0.81517, 0.85986, 0.92200, 0.98317, 1.00000
  MAN = 0.046, X = 216555.6, Y = 3352641.2
  CV = -99
  Ks = -122.92, G = -99, DIST = -99, POR = -99, ROCK = -99
  FR = 0.33, 0.33, 0.33, SPLASH = 0.001, COH = -99, SMAX = -99
  INTER = 1.32, CANOPY = 0.281, PAVE = 0.05
END PLANE

BEGIN PLANE
  ID = 353, PRINT = 3, FILE = planes\plane_353.sim
  LEN = 350, WID = 225.7
  SL =   0.26238, 0.16300, 0.07926, 0.17971, 0.14531, 0.25232, 0.27494, 0.66367, 0.39567, 0.02807, 0.02967, 0.22195, 0.46563, 0.37847, 0.27194, 0.38683, 0.24095, 0.45096, 0.22768, 0.32702
  SX =   0.00000, 0.04594, 0.10221, 0.15685, 0.20918, 0.26103, 0.31912, 0.38278, 0.44625, 0.50263, 0.54857, 0.59451, 0.64603, 0.70542, 0.74742, 0.81592, 0.87688, 0.92904, 0.98105, 1.00000
  MAN = 0.056, X = 216410.7, Y = 3352344
  CV = -99
  Ks = -107.92, G = -99, DIST = -99, POR = -99, ROCK = -99
  FR = 0.33, 0.33, 0.33, SPLASH = 0.001, COH = -99, SMAX = -99
  INTER = 1.27, CANOPY = 0.283, PAVE = 0.17
END PLANE

BEGIN CHANNEL
  ID = 354, PRINT = 3, FILE = channels\chan_354.sim
  LAT =  352 353
  UP =  351
  LEN = 604.85, SLOPE = 0.0083, X = 216359.991, Y = 3352484.644
  WIDTH = 9.75, 10.03, DEPTH = 0.48, 0.48
  MAN = 0.035, SS1 = 1, SS2 = 1
  WOOL = Yes
  CV = 0, Ks = 210, G = 101
  DIST = 0.545, POR = 0.44, ROCK = 0
  FR = 0.9, 0.05, 0.05, SP = 63, COH = 0.005
  PAVE = 0
  SAT = 0.2
END CHANNEL

i am enclosing the dbf file as follows

KIndly trouble shoot


regards Dipak
FAO_summ.DBF
FAO_properties.DBF
FAO_component.DBF

D R Sena

unread,
Oct 11, 2019, 3:39:49 AM10/11/19
to AGWA Support
I am also enclosing th4e soil shape file which i am using
fao.rar

Shea

unread,
Oct 17, 2019, 1:46:52 PM10/17/19
to AGWA Support
Upon first glance, it does appear the look-up tables and soils map have been created properly, so I'll dig a little deeper and use your data for a parameterization and see what's going on. Also, just to confirm, did you place the FAO tables you created and attached to your post in the \datafiles\fao\ folder of your AGWA home directory?

Shea

Waikiki Twins

unread,
Nov 4, 2019, 5:48:35 AM11/4/19
to AGWA Support

Hi everyone;
I Have the same problem as you D R Sena.
Shea; For me, I place the FAO tables I created and attached to My post in the \datafiles\fao\ folder of My AGWA home directory. 
But the problem still persists!!!
thanks in advance for your Help 

Shea

unread,
Dec 12, 2019, 5:13:34 PM12/12/19
to AGWA Support
I finally got another chance to take a look at this and run the soils through a parameterization. For me, the parameterization worked and I did not have any negative values for KS, CV, G, DIST, POR, ROCK, COH, or SMAX. I'm not sure what's going on here, can you attach your delineation\discretization geodatabase?

Shea

Shea

unread,
Dec 12, 2019, 5:19:46 PM12/12/19
to AGWA Support
I spoke too soon. I ran a parameterization and saw good parameter values when using the soils shapefile provided with the original FAO tables (FAO_summ, FAO_properties, and FAO_component), but I received negative values when I replaced the original FAO tables with the ones attached above. I'll take a closer look as to what needs to be corrected in the attached tables and post back.

Shea

Shea

unread,
Dec 12, 2019, 5:46:28 PM12/12/19
to AGWA Support
This is a capitalization/casing issue/bug. Because the soil units in the original FAO tables provided with AGWA are all capitalized, AGWA capitalizes the soil unit when querying and consequently queries for 'TAX 48' or any of the other soil units returns no results because those values don't exist in the tables you created (they exist as Tax instead of TAX).

To work around this, open the FAO_Summ and FAO_properties tables you provided in ArcMap and right-click on the SOIL_UNIT field to open the Field Calculator. In the Field Calculator window that opens, enter UCase( [SOIL_UNIT] ) in the bottom textbox and click OK. In the FAO_component table, right-click on the SU1 field to open the field calculator and enter UCase( [SU1] ) in the bottom textbox and click OK.

I will update AGWA to remove the sensitivity of case/capitalization of the soil queries in the next release to make the workaround unnecessary.

Shea

Waikiki Twins

unread,
Dec 13, 2019, 2:34:38 PM12/13/19
to AGWA Support
Hi Shea;
Even I tried your recommendation I have the same error !! 
        13/12/2019 19:51:20
ModelKineros.ParFileHelper()
La conversion from type 'DBNull' to type 'Double' is not valid

File OUT:

 KINEROS2 Compiled 11-Sep-2013 with Intel Fortran 11.1      

 Title: 

 Parameter File Used....... 2.par
 Rainfall File Used........ 2yr1hr.pre

 Length of Run, minutes.... 460
 Time Step, minutes........ 1
 Use Courant criteria?..... Y
 Simulate Sed. Transport?.. Y
 Multiplier file (if any).. N
 Tabular Summary?.......... Y

 Multipliers Used:

 Saturated Conductivity... 1.0                 
 Manning n................ 1.0                 
 CV of Ksat............... 1.0                 
 Capillary Drive Coeff.... 1.0                 
 Intercepted Depth........ 1.0                 
 Sediment Cohesion Coeff.. 1.0                 
 Sediment Splash Coeff.... 1.0                 

  Plane     71:  based on length and parameter CLEN,
  the numerical increment of  269.5 m. is too large for
  realistic numerical solution of the flow equation, and may 
  give  misleading results.

 error - Plane Element 
 zero slope

I attached the FAO_Summ, FAO_properties and FAO_component tables that I use.

thank you
FAO.zip

Shea

unread,
Dec 20, 2019, 5:25:21 PM12/20/19
to AGWA Support
Waikiki Twins- I was able to use the tables you uploaded to complete a successful parameterization. You may be experiencing a different problem. Would you mind creating a new topic/question where we can troubleshoot? It would be helpful if you could attach the delineation/discretization geodatabase, the FAO soils map, and the errors.txt file located in your workspace to the new topic.

Thanks!
Shea
Reply all
Reply to author
Forward
0 new messages