@@ -1147,61 +1147,121 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1147
1147
IF (output% isoil) CALL define_ovar(ncid_out, opid% isoil, &
1148
1148
' isoil' , ' -' , ' Soil type' , patchout% isoil, ' integer' , &
1149
1149
xID, yID, zID, landID, patchID)
1150
- IF (output% bch) CALL define_ovar(ncid_out, opid% bch, &
1151
- ! 'bch', '-', 'Parameter b, Campbell eqn 1985', patchout%bch, 'real', &
1152
- ! replaced above by below - rk4417 - phase2
1153
- ' bch' , ' -' , ' Parameter b, Campbell eqn 1985' , patchout% bch, soilID,' soil' , &
1154
- xID, yID, zID, landID, patchID)
1155
- IF (output% clay) CALL define_ovar(ncid_out, opid% clay, &
1156
- ! 'clay', '-', 'Fraction of soil which is clay', patchout%clay, 'real', &
1157
- ! replaced above by below - rk4417 - phase2
1150
+ IF (output% bch) THEN
1151
+ IF (cable_user% gw_model) THEN
1152
+ CALL define_ovar(ncid_out, opid% bch, &
1153
+ ' bch' , ' -' , ' Parameter b, Campbell eqn 1985' , patchout% bch, soilID,' soil' , &
1154
+ xID, yID, zID, landID, patchID)
1155
+ ELSE
1156
+ CALL define_ovar(ncid_out, opid% bch, &
1157
+ ' bch' , ' -' , ' Parameter b, Campbell eqn 1985' , patchout% bch, ' real' , &
1158
+ xID, yID, zID, landID, patchID)
1159
+ END IF
1160
+ END IF
1161
+ IF (output% clay) THEN
1162
+ IF (cable_user% gw_model) THEN
1163
+ CALL define_ovar(ncid_out, opid% clay, &
1158
1164
' clay' , ' -' , ' Fraction of soil which is clay' , patchout% clay, soilID,' soil' , &
1159
1165
xID, yID, zID, landID, patchID)
1160
- IF (output% sand) CALL define_ovar(ncid_out, opid% sand, &
1161
- ! 'sand', '-', 'Fraction of soil which is sand', patchout%sand, 'real', &
1162
- ! replaced above by below - rk4417 - phase2
1166
+ ELSE
1167
+ CALL define_ovar(ncid_out, opid% clay, &
1168
+ ' clay' , ' -' , ' Fraction of soil which is clay' , patchout% clay, ' real' , &
1169
+ xID, yID, zID, landID, patchID)
1170
+ END IF
1171
+ END IF
1172
+ IF (output% sand) THEN
1173
+ IF (cable_user% gw_model) THEN
1174
+ CALL define_ovar(ncid_out, opid% sand, &
1163
1175
' sand' , ' -' , ' Fraction of soil which is sand' , patchout% sand, soilID,' soil' , &
1164
1176
xID, yID, zID, landID, patchID)
1165
- IF (output% silt) CALL define_ovar(ncid_out, opid% silt, &
1166
- ! 'silt', '-', 'Fraction of soil which is silt', patchout%silt, 'real', &
1167
- ! replaced above by below - rk4417 - phase2
1177
+ ELSE
1178
+ CALL define_ovar(ncid_out, opid% sand, &
1179
+ ' sand' , ' -' , ' Fraction of soil which is sand' , patchout% sand, ' real' , &
1180
+ xID, yID, zID, landID, patchID)
1181
+ END IF
1182
+ END IF
1183
+ IF (output% silt) THEN
1184
+ IF (cable_user% gw_model) THEN
1185
+ CALL define_ovar(ncid_out, opid% silt, &
1168
1186
' silt' , ' -' , ' Fraction of soil which is silt' , patchout% silt, soilID,' soil' , &
1169
1187
xID, yID, zID, landID, patchID)
1170
- IF (output% ssat) CALL define_ovar(ncid_out, opid% ssat, &
1171
- ' ssat' , ' -' , ' Fraction of soil volume which is water @ saturation' , &
1172
- ! patchout%ssat, 'real', xID, yID, zID, landID, patchID)
1173
- ! replaced above by below - rk4417 - phase2
1174
- patchout% ssat, soilID,' soil' , xID, yID, zID, landID, patchID)
1175
- IF (output% sfc) CALL define_ovar(ncid_out, opid% sfc, &
1176
- ' sfc' , ' -' , ' Fraction of soil volume which is water @ field capacity' , &
1177
- ! patchout%sfc, 'real', xID, yID, zID, landID, patchID)
1178
- ! replaced above by below - rk4417 - phase2
1179
- patchout% sfc, soilID,' soil' , xID, yID, zID, landID, patchID)
1180
- IF (output% swilt) CALL define_ovar(ncid_out, opid% swilt, &
1181
- ' swilt' , ' -' , ' Fraction of soil volume which is water @ wilting point' , &
1182
- ! patchout%swilt, 'real', xID, yID, zID, landID, patchID)
1183
- ! replaced above by below - rk4417 - phase2
1184
- patchout% swilt, soilID,' soil' , xID, yID, zID, landID, patchID)
1185
- IF (output% hyds) CALL define_ovar(ncid_out, opid% hyds, &
1186
- ' hyds' , ' m/s' , ' Hydraulic conductivity @ saturation' , &
1187
- ! patchout%hyds, 'real', xID, yID, zID, landID, patchID)
1188
- ! replaced above by below - rk4417 - phase2
1189
- patchout% hyds, soilID,' soil' , xID, yID, zID, landID, patchID)
1190
- IF (output% sucs) CALL define_ovar(ncid_out, opid% sucs, &
1191
- ' sucs' , ' m' , ' Suction @ saturation' , &
1192
- ! patchout%sucs, 'real', xID, yID, zID, landID, patchID)
1193
- ! replaced above by below - rk4417 - phase2
1194
- patchout% sucs, soilID,' soil' , xID, yID, zID, landID, patchID)
1188
+ ELSE
1189
+ CALL define_ovar(ncid_out, opid% silt, &
1190
+ ' silt' , ' -' , ' Fraction of soil which is silt' , patchout% silt, ' real' , &
1191
+ xID, yID, zID, landID, patchID)
1192
+ END IF
1193
+ END IF
1194
+ IF (output% ssat) THEN
1195
+ IF (cable_user% gw_model) THEN
1196
+ CALL define_ovar(ncid_out, opid% ssat, &
1197
+ ' ssat' , ' -' , ' Fraction of soil volume which is water @ saturation' , &
1198
+ patchout% ssat, soilID,' soil' , xID, yID, zID, landID, patchID)
1199
+ ELSE
1200
+ CALL define_ovar(ncid_out, opid% ssat, &
1201
+ ' ssat' , ' -' , ' Fraction of soil volume which is water @ saturation' , &
1202
+ patchout% ssat, ' real' , xID, yID, zID, landID, patchID)
1203
+ END IF
1204
+ END IF
1205
+ IF (output% sfc) THEN
1206
+ IF (cable_user% gw_model) THEN
1207
+ CALL define_ovar(ncid_out, opid% sfc, &
1208
+ ' sfc' , ' -' , ' Fraction of soil volume which is water @ field capacity' , &
1209
+ patchout% sfc, soilID,' soil' , xID, yID, zID, landID, patchID)
1210
+ ELSE
1211
+ CALL define_ovar(ncid_out, opid% sfc, &
1212
+ ' sfc' , ' -' , ' Fraction of soil volume which is water @ field capacity' , &
1213
+ patchout% sfc, ' real' , xID, yID, zID, landID, patchID)
1214
+ END IF
1215
+ END IF
1216
+ IF (output% swilt) THEN
1217
+ IF (cable_user% gw_model) THEN
1218
+ CALL define_ovar(ncid_out, opid% swilt, &
1219
+ ' swilt' , ' -' , ' Fraction of soil volume which is water @ wilting point' , &
1220
+ patchout% swilt, soilID,' soil' , xID, yID, zID, landID, patchID)
1221
+ ELSE
1222
+ CALL define_ovar(ncid_out, opid% swilt, &
1223
+ ' swilt' , ' -' , ' Fraction of soil volume which is water @ wilting point' , &
1224
+ patchout% swilt, ' real' , xID, yID, zID, landID, patchID)
1225
+ END IF
1226
+ END IF
1227
+ IF (output% hyds) THEN
1228
+ IF (cable_user% gw_model) THEN
1229
+ CALL define_ovar(ncid_out, opid% hyds, &
1230
+ ' hyds' , ' m/s' , ' Hydraulic conductivity @ saturation' , &
1231
+ patchout% hyds, soilID,' soil' , xID, yID, zID, landID, patchID)
1232
+ ELSE
1233
+ CALL define_ovar(ncid_out, opid% hyds, &
1234
+ ' hyds' , ' m/s' , ' Hydraulic conductivity @ saturation' , &
1235
+ patchout% hyds, ' real' , xID, yID, zID, landID, patchID)
1236
+ END IF
1237
+ END IF
1238
+ IF (output% sucs) THEN
1239
+ IF (cable_user% gw_model) THEN
1240
+ ! gw_model uses sucs_vec that is a 2D variable
1241
+ CALL define_ovar(ncid_out, opid% sucs, &
1242
+ ' sucs' , ' m' , ' Suction @ saturation' , &
1243
+ patchout% sucs, soilID,' soil' , xID, yID, zID, landID, patchID)
1244
+ ELSE
1245
+ CALL define_ovar(ncid_out, opid% sucs, &
1246
+ ' sucs' , ' m' , ' Suction @ saturation' , &
1247
+ patchout% sucs, ' real' , xID, yID, zID, landID, patchID)
1248
+ END IF
1249
+ END IF
1195
1250
IF (output% css) CALL define_ovar(ncid_out, opid% css, &
1196
1251
' css' , ' J/kg/C' , ' Heat capacity of soil minerals' , &
1197
1252
! patchout%css, 'real', xID, yID, zID, landID, patchID)
1198
- ! replaced above by below - rk4417 - phase2
1199
1253
patchout% css, soilID,' soil' , xID, yID, zID, landID, patchID)
1200
- IF (output% rhosoil) CALL define_ovar(ncid_out, &
1201
- opid% rhosoil, ' rhosoil' , ' kg/m^3' , ' Density of soil minerals' , &
1202
- ! patchout%rhosoil, 'real', xID, yID, zID, landID, patchID)
1203
- ! replaced above by below - rk4417 - phase2
1204
- patchout% rhosoil, soilID,' soil' , xID, yID, zID, landID, patchID)
1254
+ IF (output% rhosoil) THEN
1255
+ IF (cable_user% gw_model) THEN
1256
+ CALL define_ovar(ncid_out, &
1257
+ opid% rhosoil, ' rhosoil' , ' kg/m^3' , ' Density of soil minerals' , &
1258
+ patchout% rhosoil, soilID,' soil' , xID, yID, zID, landID, patchID)
1259
+ ELSE
1260
+ CALL define_ovar(ncid_out, &
1261
+ opid% rhosoil, ' rhosoil' , ' kg/m^3' , ' Density of soil minerals' , &
1262
+ patchout% rhosoil, ' real' , xID, yID, zID, landID, patchID)
1263
+ END IF
1264
+ END IF
1205
1265
IF (output% rs20) CALL define_ovar(ncid_out, opid% rs20, &
1206
1266
' rs20' , ' -' , ' Soil respiration coefficient at 20C' , &
1207
1267
patchout% rs20, ' real' , xID, yID, zID, landID, patchID)
@@ -1463,55 +1523,59 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1463
1523
out_settings% dimswitch = " integer"
1464
1524
CALL check_and_write(output% isoil, opid% isoil, &
1465
1525
' isoil' , REAL (soil% isoilm, 4 ), ranges% isoil, patchout% isoil, out_settings)
1466
- out_settings% dimswitch = " real"
1467
- CALL check_and_write(output% bch, opid% bch, &
1468
- ! 'bch', REAL(soil%bch, 4), ranges%bch, patchout%bch, out_settings)
1469
- ! replaced above by below - rk4417 - phase2
1526
+
1527
+ IF (cable_user% gw_model) THEN
1528
+ out_settings% dimswitch = " soil"
1529
+
1530
+ CALL check_and_write(output% bch, opid% bch, &
1470
1531
' bch' , REAL (soil% bch_vec, 4 ), ranges% bch, patchout% bch, out_settings)
1471
- CALL check_and_write(output% clay, opid% clay, &
1472
- ! 'clay', REAL(soil%clay, 4), ranges%clay, patchout%clay, out_settings)
1473
- ! replaced above by below - rk4417 - phase2
1532
+ CALL check_and_write(output% clay, opid% clay, &
1474
1533
' clay' , REAL (soil% clay_vec, 4 ), ranges% clay, patchout% clay, out_settings)
1475
- CALL check_and_write(output% sand, opid% sand, &
1476
- ! 'sand', REAL(soil%sand, 4), ranges%sand, patchout%sand, out_settings)
1477
- ! replaced above by below - rk4417 - phase2
1478
- ' sand' , REAL (soil% sand_vec, 4 ), ranges% sand, patchout% sand, out_settings)
1479
- CALL check_and_write(output% silt, opid% silt, &
1480
- ! 'silt', REAL(soil%silt, 4), ranges%silt, patchout%silt, out_settings)
1481
- ! replaced above by below - rk4417 - phase2
1534
+ CALL check_and_write(output% sand, opid% sand, &
1535
+ ' sand' , REAL (soil% sand_vec, 4 ), ranges% sand, patchout% sand, out_settings)
1536
+ CALL check_and_write(output% silt, opid% silt, &
1482
1537
' silt' , REAL (soil% silt_vec, 4 ), ranges% silt, patchout% silt, out_settings)
1483
- CALL check_and_write(output% css, opid% css, &
1484
- ! 'css', REAL(soil%css, 4), ranges%css, patchout%css, out_settings)
1485
- ! replaced above by below - rk4417 - phase2
1538
+ CALL check_and_write(output% css, opid% css, &
1486
1539
' css' , REAL (soil% css_vec, 4 ), ranges% css, patchout% css, out_settings)
1487
- CALL check_and_write(output% rhosoil, &
1488
- ! opid%rhosoil, 'rhosoil',REAL(soil%rhosoil,4), &
1489
- ! replaced above by below - rk4417 - phase2
1540
+ CALL check_and_write(output% rhosoil, &
1490
1541
opid% rhosoil, ' rhosoil' ,REAL (soil% rhosoil_vec,4 ), &
1491
1542
ranges% rhosoil, patchout% rhosoil, out_settings)
1492
- CALL check_and_write(output% hyds, opid% hyds, &
1493
- ! 'hyds', REAL(soil%hyds, 4), ranges%hyds, patchout%hyds, out_settings)
1494
- ! replaced above by below - rk4417 - phase2
1543
+ CALL check_and_write(output% hyds, opid% hyds, &
1495
1544
' hyds' , REAL (soil% hyds_vec, 4 ), ranges% hyds, patchout% hyds, out_settings)
1496
- CALL check_and_write(output% sucs, opid% sucs, &
1497
- ! 'sucs', REAL(soil%sucs, 4), ranges%sucs, patchout%sucs, out_settings)
1498
- ! replaced above by below - rk4417 - phase2
1545
+ CALL check_and_write(output% sucs, opid% sucs, &
1499
1546
' sucs' , REAL (soil% sucs_vec, 4 ), ranges% sucs, patchout% sucs, out_settings)
1500
- CALL check_and_write(output% rs20, opid% rs20, &
1501
- ' rs20' , REAL (veg% rs20, 4 ), ranges% rs20, patchout% rs20, out_settings)
1502
- ! 'rs20',REAL(soil%rs20,4),ranges%rs20,patchout%rs20,out_settings)
1503
- CALL check_and_write(output% ssat, opid% ssat, &
1504
- ! 'ssat', REAL(soil%ssat, 4), ranges%ssat, patchout%ssat, out_settings)
1505
- ! replaced above by below - rk4417 - phase2
1547
+ CALL check_and_write(output% ssat, opid% ssat, &
1506
1548
' ssat' , REAL (soil% ssat_vec, 4 ), ranges% ssat, patchout% ssat, out_settings)
1507
- CALL check_and_write(output% sfc, opid% sfc, &
1508
- ! 'sfc', REAL(soil%sfc, 4), ranges%sfc, patchout%sfc, out_settings)
1509
- ! replaced above by below - rk4417 - phase2
1549
+ CALL check_and_write(output% sfc, opid% sfc, &
1510
1550
' sfc' , REAL (soil% sfc_vec, 4 ), ranges% sfc, patchout% sfc, out_settings)
1511
- CALL check_and_write(output% swilt, opid% swilt, &
1512
- ! 'swilt', REAL(soil%swilt, 4), ranges%swilt, patchout%swilt, out_settings)
1513
- ! replaced above by below - rk4417 - phase2
1551
+ CALL check_and_write(output% swilt, opid% swilt, &
1514
1552
' swilt' , REAL (soil% swilt_vec, 4 ), ranges% swilt, patchout% swilt, out_settings)
1553
+ ELSE
1554
+ out_settings% dimswitch = " real"
1555
+ CALL check_and_write(output% bch, opid% bch, &
1556
+ ' bch' , REAL (soil% bch, 4 ), ranges% bch, patchout% bch, out_settings)
1557
+ CALL check_and_write(output% clay, opid% clay, &
1558
+ ' clay' , REAL (soil% clay, 4 ), ranges% clay, patchout% clay, out_settings)
1559
+ CALL check_and_write(output% sand, opid% sand, &
1560
+ ' sand' , REAL (soil% sand, 4 ), ranges% sand, patchout% sand, out_settings)
1561
+ CALL check_and_write(output% silt, opid% silt, &
1562
+ ' silt' , REAL (soil% silt, 4 ), ranges% silt, patchout% silt, out_settings)
1563
+ CALL check_and_write(output% css, opid% css, &
1564
+ ' css' , REAL (soil% css, 4 ), ranges% css, patchout% css, out_settings)
1565
+ CALL check_and_write(output% rhosoil, &
1566
+ opid% rhosoil, ' rhosoil' ,REAL (soil% rhosoil,4 ), &
1567
+ ranges% rhosoil, patchout% rhosoil, out_settings)
1568
+ CALL check_and_write(output% hyds, opid% hyds, &
1569
+ ' hyds' , REAL (soil% hyds, 4 ), ranges% hyds, patchout% hyds, out_settings)
1570
+ CALL check_and_write(output% sucs, opid% sucs, &
1571
+ ' sucs' , REAL (soil% sucs, 4 ), ranges% sucs, patchout% sucs, out_settings)
1572
+ CALL check_and_write(output% ssat, opid% ssat, &
1573
+ ' ssat' , REAL (soil% ssat, 4 ), ranges% ssat, patchout% ssat, out_settings)
1574
+ CALL check_and_write(output% sfc, opid% sfc, &
1575
+ ' sfc' , REAL (soil% sfc, 4 ), ranges% sfc, patchout% sfc, out_settings)
1576
+ CALL check_and_write(output% swilt, opid% swilt, &
1577
+ ' swilt' , REAL (soil% swilt, 4 ), ranges% swilt, patchout% swilt, out_settings)
1578
+ END IF
1515
1579
1516
1580
! CALL check_and_write(output%slope ,ncid_out, opid%slope, &
1517
1581
! 'slope', REAL(soil%slope, 4), ranges%slope, patchout%slope, out_settings)
@@ -1528,7 +1592,6 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1528
1592
out_settings% dimswitch = " soil"
1529
1593
CALL check_and_write(output% zse, opid% zse, &
1530
1594
! 'zse', SPREAD(REAL(soil%zse, 4), 1, mp),ranges%zse, &
1531
- ! replaced above by below - rk4417 - phase2
1532
1595
' zse' , REAL (soil% zse_vec, 4 ),ranges% zse, &
1533
1596
patchout% zse, out_settings)! no spatial dim at present
1534
1597
@@ -1558,6 +1621,9 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1558
1621
ENDIF
1559
1622
CALL check_and_write(output% rp20, opid% rp20, &
1560
1623
' rp20' , REAL (veg% rp20, 4 ),ranges% rp20, patchout% rp20, out_settings)
1624
+ CALL check_and_write(output% rs20, opid% rs20, &
1625
+ ' rs20' , REAL (veg% rs20, 4 ), ranges% rs20, patchout% rs20, out_settings)
1626
+ ! 'rs20',REAL(soil%rs20,4),ranges%rs20,patchout%rs20,out_settings)
1561
1627
! Ticket #56
1562
1628
CALL check_and_write(output% g0, opid% g0, &
1563
1629
' g0' , REAL (veg% g0, 4 ),ranges% g0, patchout% g0, out_settings)
@@ -1640,13 +1706,11 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1640
1706
1641
1707
CALL check_and_write(output% params .AND. cable_user% gw_model, opid% SatFracmax, &
1642
1708
! 'SatFracmax', SPREAD(REAL(gw_params%MaxSatFraction,4),1,mp), &
1643
- ! replaced above by below - rk4417 - phase2
1644
1709
' SatFracmax' , SPREAD (REAL (SQRT (gw_params% MaxSatFraction),4 ),1 ,mp), &
1645
1710
ranges% gw_default, patchout% SatFracmax, out_settings) ! note specially for ranges%gw_default that I have instead (/0.0,1000000.0/) - rk4417 - phase2
1646
1711
1647
1712
CALL check_and_write(output% params .AND. cable_user% gw_model, opid% Qhmax, &
1648
1713
! 'Qhmax', SPREAD(REAL(gw_params%MaxHorzDrainRate, 4),1,mp), &
1649
- ! replaced above by below - rk4417 - phase2
1650
1714
' Qhmax' , REAL (soil% qhz_max, 4 ), &
1651
1715
ranges% gw_default, patchout% Qhmax, out_settings) ! note specially for ranges%gw_default that I have instead (/0.0,1000000.0/) - rk4417 - phase2
1652
1716
@@ -1657,13 +1721,11 @@ SUBROUTINE open_output_file(dels, soil, veg, bgc, rough, met)
1657
1721
1658
1722
CALL check_and_write(output% params .AND. cable_user% gw_model, opid% HKefold, &
1659
1723
! 'HKefold', SPREAD(REAL(gw_params%hkrz, 4),1,mp), &
1660
- ! replaced above by below - rk4417 - phase2
1661
1724
' HKefold' , REAL (soil% hkrz, 4 ), &
1662
1725
ranges% gw_default, patchout% HKefold, out_settings) ! note specially for ranges%gw_default that I have instead (/0.0,1000000.0/) - rk4417 - phase2
1663
1726
1664
1727
CALL check_and_write(output% params .AND. cable_user% gw_model, opid% HKdepth, &
1665
1728
! 'HKdepth', SPREAD(REAL(gw_params%zdepth, 4),1,mp), &
1666
- ! replaced above by below - rk4417 - phase2
1667
1729
' HKdepth' , REAL (soil% zdepth, 4 ), &
1668
1730
ranges% gw_default, patchout% HKdepth, out_settings) ! note specially for ranges%gw_default that I have instead (/0.0,1000000.0/) - rk4417 - phase2
1669
1731
END IF ! line inserted by rk4417 - phase2
0 commit comments