-
Notifications
You must be signed in to change notification settings - Fork 1
/
CSP_DEMAND.FOR
1453 lines (1237 loc) · 61 KB
/
CSP_DEMAND.FOR
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
C=======================================================================
C CSP_DEMAND, Subroutine, from DEMAND subroutine
C by J.W. Jones and G. Hoogenboom.
C-----------------------------------------------------------------------
C Calculates potential demand for C and N based upon new growth and
C existing N deficiency in old tissue.
C-----------------------------------------------------------------------
C REVISION HISTORY
C 01/01/1990 JWJ Written.
C 02/01/1993 GH Revised.
C 04/24/1994 NBP Changed TAIRHR to TGRO.
C 08/22/1995 GH Added seed composition routine from KJB & ELPiper
C 04/02/1996 JWJ Modified partitioning during early growth
C 01/10/1997 GH Added TURFAC effect on seed growth and pod addition
C 09/15/1998 CHP Modified for modular format
C 05/10/1999 GH Incorporated in CROPGRO
! 11/08/2001 O.H. Daza modified for the sugarcane model
C 08/19/2003 FSR Modified for DSSAT 4.0 CASUPRO sugarcane
C 07/26/2004 CHP Removed variables which were not being used
C-----------------------------------------------------------------------
C Called by: CASUPRO
C Calls: CSP_IPDMND
C=======================================================================
SUBROUTINE CSP_DEMAND(DYNAMIC,
& AGRLF, AGRRT, AGRSTM, AGRSU, CROP, DLFN, DPLARF, !Input
& DRPP, FILECC, FILEIO, NSTRES, NVEG0, PAR, !Input
& PCNL, PCNRT, PCNST, PCNSU, PGAVL, PLTPOP, RPROAV, !Input
& RTWT, SetStalk, STMWT, SUWT, SWFAC, TAVG, TDUMX, !Input
& TURFAC, VSTAGE, WCRLF, WCRRT, WCRST, WCRSU, WNRLF, !Input
& WNRRT, WNRST, WNRSU, WTLF, YRDOY, YRSIM, !Input
& AGRVG, AGRVG2, F, FNINL, FNINR, FNINS, FRLF, !Ouput
& FRRT, FRSTM, FRSU, NDMNEW, NDMOLD, NDMTOT, !Ouput
& NDMVEG, NMINEP, NMOBR) !Ouput
!-----------------------------------------------------------------------
USE ModuleDefs
USE ModuleData
IMPLICIT NONE
SAVE
CHARACTER*2 CROP
! CHARACTER*3 TYPSDT
CHARACTER*30 FILEIO
CHARACTER*92 FILECC !, FILEGC
! INTEGER RUNINIT, SEASINIT, EMERG, INTEGR
! PARAMETER (RUNINIT = 1, SEASINIT = 2, EMERG = 3, INTEGR = 4)
! INTEGER TS
! PARAMETER (TS = 24)
INTEGER DYNAMIC !, TIMDIF
INTEGER DAS, YRSIM !NPP, I,
INTEGER YRDOY, NVEG0
! REAL FRSTMM, NVSTL,NVSTS,NVSTR
REAL TABEX !,CURV
REAL TPHFAC,PARSLA,FFVEG, SLAVAR, SLAREF, !GROYES,GAINNW,GAINWT,
& FINREF, SLAMAX, SLAMIN, AGRRT, AGRSTM, FRLFF, FRSTMF
REAL AGRLF, AGRVG, AGRVG2, CDMTOT, CDMVEG, CNOLD, DRPP, DUMFAC, F,
& FNINL, FNINR, FNINS, FRLF, FRLFMX, FRRT, FRSTM, FVEG, !GROMAX,
& NDMNEW, NDMOLD, NDMTOT, NDMVEG, NMINEP, NMOBMX, NMOBR, NSTRES,
& NVSMOB, PAR, PCNL, PCNRT, PCNST, PGAVL, PLTPOP, PROLFF,
& PROLFI, PRORTF, PRORTI, PROSTF, PROSTI, RCH2O, RLIG, RLIP,
& RMIN, RNO3C, RPRO, ROA, RPROAV, RTWT, SIZELF, SIZREF, SLAMN,
& SLAMX, SLAPAR, STMWT, SWFAC, TAVG, TDUMX, SIZRAT, TURFAC,!SRMAX,
& TURSLA, VSSINK, VSTAGE, WCRLF, WCRRT, WCRST, WNRLF, WNRRT,
& WNRST, WTLF
! REAL TEMXFR,CAVTOT,GDMSDO
REAL XVGROW(6), YVREF(6) !, YVGROW(6)
REAL XSLATM(10), YSLATM(10)
REAL XLEAF(25), YLEAF(25), YSTEM(25)
REAL TURFSL
!Sugars
REAL AGRSU, FNINSU, FRSU, PROSUF, PROSUI, WNRSU !, NVSTSU
REAL SUWT, WCRSU, PCNSU
!New
REAL ACDMVEG, DPSTK, STKRAT, STKVAR, STKREF
REAL DLFN, DPLFA, DPLFG, DPLFAG, DPLARF, DPSGRF
REAL PGROSTK !GROSTKYES,
REAL DPSTKG, DPRTG, DPSUG
REAL FRRTK, FRSUK, XFRRT(4), YFRRT(4), XFRSU(4), YFRSU(4)
REAL RFPSTKG, RSDC, EXCAR !GRORTYES, PGRORT,
REAL WLFPLUS, WSTKPLUS, WRTPLUS, WSUPLUS, GAMMA, WPLUS
! REAL X1, X2, Y1, Y2
! SKPOP Temporal variable to estimate stalk growth rate in funtion
! estimated from experiment
INTEGER SetStalk, SKPOP
! INTEGER OpenStatus
LOGICAL SUBTITLE
TYPE (ControlType) CONTROL
CALL GET(Control)
!***********************************************************************
!***********************************************************************
! Run Initialization - Called once per simulation
!***********************************************************************
IF (DYNAMIC .EQ. RUNINIT) THEN
!-----------------------------------------------------------------------
CALL CSP_IPDMND(FILECC, FILEIO, !Input
& FINREF, FRLFF, FRLFMX, FRSTMF, NMOBMX, NVSMOB, PROLFF, !Output
& PROLFI, PRORTF, PROSUF, PROSUI, PRORTI, PROSTF, PROSTI, !Output
& RCH2O, RLIG, RLIP, RMIN, RNO3C, RPRO, ROA, SIZELF, !Output
& SIZREF, SLAMAX, SLAMIN, SLAPAR, SLAREF, SLAVAR, TURSLA, !Output
& VSSINK, XLEAF, XSLATM, XVGROW, YLEAF, YSLATM, YSTEM, !Output
& YVREF, XFRRT, YFRRT, XFRSU, YFRSU, GAMMA) !Output
STKVAR = 1 ! g/cm
STKREF = 1 ! g/cm
!***********************************************************************
!***********************************************************************
! Seasonal initialization - run once per season
!***********************************************************************
ELSEIF (DYNAMIC .EQ. SEASINIT) THEN
!-----------------------------------------------------------------------
NDMNEW = 0.0
NDMVEG = 0.0
NDMTOT = 0.0
NMINEP = 0.0
NMOBR = 0.0
FNINL = 0.0
FNINS = 0.0
FNINR = 0.0
FNINSU = 0.0 !Sugars
SKPOP = 1 ! Temporary
! X1 = 14
! Y1 = 0.15
! X2 = 30
! Y2 = 0.05
C-----------------------------------------------------------------------
C SET VARIETY SPECIFIC LEAF PARAMETERS
! Scaling of leaf parameters of current cultivar with respect to
! the selected cultivar
C-----------------------------------------------------------------------
IF (CROP .NE. 'FA') THEN
DUMFAC = SLAVAR / SLAREF
F = DUMFAC * FINREF
FVEG = DUMFAC * SLAMAX
SLAMN = DUMFAC * SLAMIN
SLAMX = DUMFAC * SLAMAX
! GROMAX = 0.0
SIZRAT = SIZELF / SIZREF
!NEW
STKRAT = STKVAR / STKREF !Ratio of stalk weights
DPLFA = 0 !Former GROMAX
! SC Area values are calculated in PHENOL_SC
! DO I = 1,6
! YVGROW(I) = SIZRAT * YVREF(I) ! look up table in .SPE file
! ENDDO
C-----------------------------------------------------------------------
C INITIALIZE PARTITIONING PARAMETERS
C-----------------------------------------------------------------------
! look up table in .SPE file
! FRLF = TABEX(YLEAF,XLEAF,0.0,8) !leaf
! FRSTM = TABEX(YSTEM,XLEAF,0.0,8) !stalk
! FRSU = 0.0 !Sugars
! FRRT = 1.0 - FRLF - FRSTM - FRSU !root
! SC Initialization
FRLF = 0.7
FRSTM = 0.05
FRRT = 0.1
FRSU = 1.0 - FRLF - FRSTM - FRRT
PGROSTK = 0.0 !Growth of stalks
DPSTKG = 0.0 !Delta stalks
DPRTG = 0.0 !Delta roots
DPSUG = 0.0 !Delta sugars
ENDIF
!***********************************************************************
!***********************************************************************
! EMERGENCE CALCULATIONS - Performed once per season upon emergence
! or transplanting of plants
!***********************************************************************
ELSEIF (DYNAMIC .EQ. EMERG) THEN
!-----------------------------------------------------------------------
! Converts protein content in plant components to nitrogen
! g [N]/g [leaf tissue] = g [Protein]/g [leaf tissue] x 0.16 g [N]/g [Protein]
! PROLFI Maximum protein composition in leaves during growth with
! luxurious supply of N (g [protein] / g [leaf tissue])
! PRORTI Maximum protein composition in roots during growth with
! luxurious supply of N (g [protein] / g [root])
! PROSTI Maximum protein composition in stalks during growth with
! luxurious supply of N (g [protein] / g [stem])
! PROSUI Maximum protein composition in sugars during growth with
! luxurious supply of N (g [protein] / g [sugars])
FNINL = PROLFI * 0.16 !leaf
FNINS = PROSTI * 0.16 !stalk
FNINR = PRORTI * 0.16 !root
! SC
FNINSU = PROSUI * 0.16 !Sugars
C***********************************************************************
C***********************************************************************
C DAILY RATE/INTEGRATION
C***********************************************************************
ELSEIF (DYNAMIC .EQ. INTEGR) THEN
C-----------------------------------------------------------------------
! DAS = MAX(0,TIMDIF(YRSIM,YRDOY))
DAS = CONTROL % DAS
C-----------------------------------------------------------------------
C Compute max N mining, NMINEP, based on stage-dependent mining
C rate, NMOBR
C-----------------------------------------------------------------------
C Assume that a Maximum Fraction (NMOBMX) of N can be Mobilized per Day
! The part below (*) may not be applicable to sugarcane.
! The decision for dropping it is postponed until we get a better
! understanding for SC.
! NVSMOB is the relative N mobil rate in veg stage, rel to reprod. stage
C-----------------------------------------------------------------------
C 9/27/95 ACCELERATE N MOBILIZATION AFTER R5, FUNCTION OF (1-SWFAC)
C ALLOWS ACCELERATING BY 50% IF MAX DEFICIT.
C 2/6/96 SOMETIMES SEEDS FILL, XPOD IS LOW, THEN N MOBILIZATION SLOWS
C I DON'T REALLY WANT THAT, LATE IN CYCLE. KJB
C NOW, DXR57 HITS CLOSE TO 1 AT MATURITY AND PREVENTS THAT
C-----------------------------------------------------------------------
! NMOBMX Maximum fraction of N which can be mobilized in a day
! NMOBR Stage-dependent potential N mining rate expressed as a
! fraction of the maximum rate (NMOBMX)
! NVSMOB Relative rate of N mining during vegetative stage to that in
! reproductive stage
! TDUMX Photo-thermal time that occurs in a real day based on early
! reproductive development temperature function
! (photo-thermal days / day)
TDUMX = 1.0
NMOBR = NVSMOB * NMOBMX * TDUMX
! (*)
! IF (DAS .GT. NR5) THEN
! NMOBR = NMOBMX * TDUMX2 * (1.0 + 0.5*(1.0 - SWFAC))
! & * (1.0 + 0.3*(1.0 - NSTRES)) * (NVSMOB + (1. - NVSMOB)
! & * MAX(XPOD,DXR57**2.))
! ENDIF
! NMINEP Potential N mobilization from storage (g [N] / m2 - d)
! WNRLF N available for mobilization from leaves above lower limit of
! mining (g [N] / m2)
! WNRRT N available for mobilization from roots above lower limit of
! mining (g [N] / m2)
! WNRST N available for mobilization from stalks above lower limit of
! mining (g [N] / m2)
! WNRSU N available for mobilization from sugars above lower limit of
! mining (g [N] / m2)
NMINEP = NMOBR * (WNRLF + WNRST + WNRRT + WNRSU)
C-----------------------------------------------------------------------
! Several lines from DEMAND for seed and shell (growth and N) were
! deleted here
C-----------------------------------------------------------------------
C Vegetative partitioning factors and demand for C and N for new
C growth before VSSINK, assume leaf expansion is fixed, compute
C SLA based on function of light, temp, etc, then compute
C FRLF (leaf partitioning), then FRRT, FRSTM
C-----------------------------------------------------------------------
C Check to see if new vegetative tissue can be grown, using PGAVL
C-----------------------------------------------------------------------
! CDMVEG = MAX(0.0,(1.0 - XFRT) * PGAVL)
! CDMVEG Carbon demand for vegetative growth (g [CH2O] / m2 - d)
! NDMVEG N required for vegetative growth if all PGAVL is used as
! computed (g [N] / m2 - d)
! PGAVL Total available CH2O available for growth & respiration
! (g [CH2O] / m2)
NDMVEG = 0.0
! CDMVEG = (PGAVL * XFRT - CDMREP) + CDMVEG
C-----------------------------------------------------------------------
C Calculate Pattern of Vegetative Partitioning, a function of V-STAGE
C-----------------------------------------------------------------------
! VSTAGE = LeafNumber from PHENOL_SC. This is not needed any longer as it
! will be passed from PHENOL_SC
! FRLF = TABEX(YLEAF,XLEAF,VSTAGE,8)
! FRSTM = TABEX(YSTEM,XLEAF,VSTAGE,8)
! FRSU = 0
! FRRT = 1. - FRLF - FRSTM - FRSU
!-----------------------------------------------------------------------
C Compute F, specific leaf area for new leaf weight
C-----------------------------------------------------------------------
! TPHFAC Reduction in specific leaf area due to daytime temperature
! being less than optimal (0-1)
! TPHFAC = 0.
! DO I = 1,24
! TPHFAC = TPHFAC + TABEX (YSLATM,XSLATM,TGRO(I),5)
! ENDDO
! TPHFAC = TPHFAC/24.
! SC Not used but code above is kept intact for future reference
TPHFAC = 1.0
C-----------------------------------------------------------------------
PARSLA = (SLAMN + (SLAMX - SLAMN) * EXP(SLAPAR * PAR)) / SLAMX
TURFSL = MAX(0.1, (1.0 - (1.0 - TURFAC) * TURSLA))
C-----------------------------------------------------------------------
C Compute overall effect of TMP, PAR, water stress on SLA (F)
! First for veg stages, then transition to rep stage from R1 to end leaf
C effect of PAR on SLA, COX PEANUT SCI. 5:27, 1978
C-----------------------------------------------------------------------
FFVEG = FVEG * TPHFAC * PARSLA * TURFSL
F = FFVEG
! IF (XFRT*FRACDN .GE. 0.05) F = FFVEG * (1.0 - XFRT * FRACDN)
C-----------------------------------------------------------------------
C For determinate plants (XFRUIT=1.) leaf expansion stops at NDLEAF
C-----------------------------------------------------------------------
! IF (XFRUIT .GT. 0.9999 .AND. DAS .GE. NDLEAF) F = 0.0
C-----------------------------------------------------------------------
C During early vegetative growth, leaf area expansion depends on
C VSTAGE (Prior to VSSINK). This sets FRLF, partitioning of d.m.
C to leaves. FRRT and FRSTM are then computed by left over C. When
C an upper limit of d.m. goes to leaves, leaf area expansion is
C restricted so that F is maintained as computed and minimal amounts
C of C is partitioned to FRSTM and FRRT (JWJ 4/1/96)
C-----------------------------------------------------------------------
! Potential growth of leaves
!-----------------------------------------------------------------------
! Sugarcane is not limited by VSSINK. The following lines will be
! commneted out to include calculations for the sugarcane model.
! Values are passed from PHENOL_SC
! GAINNW Leaf area added (prior to VSSINK) (cm2 [leaf] / m2 [ground])
! GAINWT Leaf weight added (prior to VSSINK and after NDLEAF)
! (g [leaf] / m2 [ground])
! GROMAX Maximum leaf area which can be added per plant between
! emergence and day of simulation as a function of V-stage on
! day of simulation (cm2 [leaf] / plant)
! GROYES Maximum leaf area which could have been added per plant between
! emergence and yesterday as a function of V-stage
! (cm2 [leaf] / plant)
! IF (VSTAGE .LT. VSSINK) THEN
! GROYES = GROMAX
! SC This value is calculated for each day of simulation in PHENOL_SC
! DPLFA DeltaPotLeafArea
! DPLARF Potential rate of increase of leaf area per plant of
! reference cane variety (cm2 / plant - d)
! DPLFA Potential rate of increase of leaf area per plant of
! selected cane variety (cm2 / plant - d)
! DPLFAG Potential rate of increase of leaf area per ground unit
! (cm2 [leaf] / m2)
! TURFAC Water stress factor for expansion (0 - 1)
DPLFA = SIZRAT * DPLARF * TURFAC
! GROMAX = TABEX(YVGROW,XVGROW,VSTAGE,6) * SIZELF / SIZREF
! SC It is required to have the leaf area of the whole plant
! (sum of leaf area of each stalk: See PHENOL_SC)
! GROMAX = DPLFAG
! GAINNW = (GROMAX - GROYES) * PLTPOP
! (cm2 [leaf] / m2-d) = (cm2 [leaf] / plant-d) (plants / m2)
DPLFAG = DPLFA * PLTPOP
C-----------------------------------------------------------------------
C CALCULATE MINIMUM WEIGHT NEEDED TO ADD GAINNW LEAF AREA/M2,
C AND AMOUNT OF LEAF WEIGHT WHICH CAN BE GROWN WITH PG AVAILABLE
C-----------------------------------------------------------------------
! IF (F .GT. 0.0) THEN
! GAINWT = GAINNW / F
! ELSE
! GAINWT = 0.0
! ENDIF
! DPLFG potential increase of leaf growth (g [leaf]/m2 [ground] - d )
! g [leaf]/m2 [ground] - d = (cm2 [leaf]/m2 [ground]-d) / (cm2 [leaf]/g [leaf])
IF (F .GT. 0.0) THEN
DPLFG = DPLFAG / F
ELSE
DPLFG = 0.0
ENDIF
C-----------------------------------------------------------------------
C Include the gains in weight of stalks, roots and sugars
C-----------------------------------------------------------------------
! Potential growth of stalks
C-----------------------------------------------------------------------
!DelPotLfGrow =
!DelPotStlkGrow =
!DelPotRtGrow =
!DelPotSuGrow =
! DPRTG potential increase of root growth (g [root] / plant)
! DPSUG potential increase of sugars accumulation (g [sugars] / plant)
! GROSTKYES Growth of stalks yesterday (g [stalk] / plant)
! PGROSTK Potential growth of stalks today (g [stalk] / plant)
! GROSTKYES = PGROSTK
! This a temporary function deduced from experiment Lote 14.
! Used here as an approximation for the time being.
! g [stalk] / stalk = (g [stalk] / m2) / (stalks / m2)
! It will be important to have the functions in the same notation.
! Use either accumulation or rates in all functions as a standard.
! PGROSTK = (2.8929 * VSTAGE ** 2 + 9.3593 * VSTAGE) / SKPOP
! The function below is the first derivative of the equation above
! RFPSTKG Rate function of potential stalk growth (g [stalk]/m2 - leaf)
! (g [stalk] / stalk - leaf) = (g [stalk] / m2 - leaf) / (stalks/m2)
RFPSTKG = (5.7858 * VSTAGE + 9.3593) / SKPOP * TURFAC
! DPSGRF Potential growth of stalk of reference cane variety (g [stalk] / m2)
! (g [stalk]/plant) = (stalks/plant) (g [stalk]/stalk-leaf) * leaf
! DPSTK Potential growth of stalk of selected cane variety
DPSGRF = SetStalk * RFPSTKG * DLFN
DPSTK = STKRAT * DPSGRF
! DPSTKG potential increase of stalk growth (g [stalk] / m2)
! g [stalk]/m2 = (g [stalk]/plant) (plants/m2)
DPSTKG = DPSTK * PLTPOP
C-----------------------------------------------------------------------
! Potential growth of roots
C-----------------------------------------------------------------------
! FRRTK fraction of potential leaf and stalk growth that is used for
! growth of roots
! Use TABEX function instead
! IF (VSTAGE <= X1) THEN
! FRRTK = Y1
! ELSE IF (VSTAGE > X1 .AND. VSTAGE <= X2) THEN
! FRRTK = (Y2 - Y1) / (X2 - X1) * (VSTAGE - X1) + Y1
! ELSE
! FRRTK = Y2
! END IF
FRRTK = TABEX(YFRRT, XFRRT, VSTAGE, 4)
! Potential root growth is a fraction of the sum of rates of potential
! leaf growth and potential stalk growth
! When TURFAC=1 (No water stress) the right most term becomes 1
DPRTG = FRRTK * (DPLFG + DPSTKG) * (2 - TURFAC)
!CHECK THIS
C-----------------------------------------------------------------------
! Potential growth of sugars
C-----------------------------------------------------------------------
! FRSUK fraction of potential leaf and stalk growth that is
! depositioned as sugars
FRSUK = TABEX(YFRSU, XFRSU, VSTAGE, 4)
! Potential sugar growth is a fraction of the sum of rates of potential
! leaf growth and potential stalk growth
DPSUG = FRSUK * (DPLFG + DPSTKG)
C-----------------------------------------------------------------------
C Compute fraction of C partitioned to leaves, based on F, VSSINK
C Limit leaf pertitioning to FRLFMX (i.e., FRLFMX = 0.7)
C-----------------------------------------------------------------------
! g [leaf]/g [veg] = (g [CH2O]/g [leaf]) * (g [leaf]/m2 [ground])/(g [CH2O]/m2-d)
! FRLF = (AGRLF * GAINWT) / (CDMVEG + 0.0001)
! IF (FRLF .GT. FRLFMX) THEN
! GAINWT = (CDMVEG / AGRLF) * FRLFMX
! GAINNW = GAINWT * F
! FRLF = FRLFMX
! ENDIF
!
!-----------------------------------------------------------------------
! NEW Carbon demand for potential growth
!-----------------------------------------------------------------------
! AGRLF Mass of CH2O required for new leaf growth (g [CH2O] / g [leaf])
! AGRRT Mass of CH2O required for new root growth (g [CH2O] / g [root])
! AGRSTM Mass of CH2O required for new stalk growth (g [CH2O] / g [stalk])
! AGRSU Mass of CH2O required for new sugar growth (g [CH2O] / g [sugar])
! CDMVEG Carbon demand for vegetative growth (g [CH2O] / m2 - d)
! ACDMVEG Actual carbon demand for vegetative growth (g [CH2O] / m2 - d)
! RSDC Ratio of supply demand for carbon
! Better replace this statement with (YRDOY > YREMRG)
IF (VSTAGE > 0) THEN
! IF YRDOY > YREMRG
CDMVEG = AGRLF * DPLFG + AGRSTM * DPSTKG + AGRRT * DPRTG +
& AGRSU * DPSUG
IF (PGAVL > 0) THEN
RSDC = PGAVL / CDMVEG
IF (RSDC >= 1.0) THEN !Excess of carbon
EXCAR = PGAVL - CDMVEG
WLFPLUS = AGRLF * DPLFG
!Make GAMMA a function of leaf number
WSTKPLUS = AGRSTM * DPSTKG + GAMMA * EXCAR !CHECK UNITS
! WSTKPLUS = DPSTKG
WRTPLUS = AGRRT * DPRTG
WSUPLUS = AGRSU * DPSUG + (1 - GAMMA) * EXCAR !CHECK UNITS
! WSUPLUS = DPSUG
ACDMVEG = CDMVEG !Updates carbon actually used
ELSE !Deficit of carbon
WLFPLUS = RSDC * AGRLF * DPLFG
WSTKPLUS = RSDC * AGRSTM * DPSTKG
WRTPLUS = RSDC * AGRRT * DPRTG
WSUPLUS = RSDC * AGRSU * DPSUG
ACDMVEG = PGAVL !Updates carbon actually used
END IF
!-----------------------------------------------------------------------
C Recompute FRSTM and FRRT based on FRLF
! SC has the sugar component. It is included in the relations to
! account for it.
C-----------------------------------------------------------------------
! Compute actual fractions FRLF, FRSTM, FRRT and FRSU allocated to each
! plant component on each day, based on carbon availability
! FRLF Fraction of vegetative tissue growth that goes to leaves on a
! day (g [leaf] / g [veg])
! FRRT Fraction of vegetative tissue growth that goes to roots on a
! day (g [root] / g [veg])
! FRSTM Fraction of vegetative tissue growth that goes to stems on a
! day (g [stem] / g [veg])
! FRSU Fraction of vegetative tissue growth that goes to sugars on a
! day (g [root] / g [veg])
WPLUS = WLFPLUS + WSTKPLUS + WRTPLUS + WSUPLUS
! FRLF = AGRLF * WLFPLUS / ACDMVEG
! FRSTM = AGRSTM * WSTKPLUS / ACDMVEG
! FRRT = AGRRT * WRTPLUS / ACDMVEG
! FRSU = AGRRT * WSUPLUS / ACDMVEG
! FRSU = 1.0 - FRLF - FRSTM - FRRT
!!!!! FRSU = AGRSU * WSUPLUS / ACDMVEG
FRLF = WLFPLUS / WPLUS
FRSTM = WSTKPLUS / WPLUS
FRRT = WRTPLUS / WPLUS
FRSU = WSUPLUS / WPLUS
! FRSU = 1.0 - FRLF - FRSTM - FRRT
END IF
! FRSTM = (1.0 - FRLF) * FRSTM / (FRSTM + FRRT)
! SC
! FRSTM = (1.0 - FRLF) * FRSTM / (FRSTM + FRRT + FRSU)
! FRRT = (1.0 - FRLF) * FRRT / (FRSTM + FRRT + FRSU)
! SC Sugar is allocated after leaf, stalk and root
! FRSU = 1.0 - FRLF - FRSTM - FRRT
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
C Compute CH2O cost per g of tissue, excluding cost for protein (AGRVG)
C and total CH2O cost per g of veg tissue (AGRVG2)
C-----------------------------------------------------------------------
! AGRVG Mass of CH2O required for vegetative tissue growth including
! stoichiometry and respiration (g [CH2O] / g [tissue])
! AGRVG2 Total mass of CH2O required for vegetative tissue growth
! (g [CH2O] / g [tissue])
! RPROAV Respiration required for protein synthesis, average based on
! sources of N (g [CH2O] / g [protein])
! Updates AGRVG and AGRVG2
AGRVG = AGRLF * FRLF + AGRRT * FRRT + AGRSTM * FRSTM +
& AGRSU * FRSU
AGRVG2 = AGRVG + (FRLF * PROLFI + FRRT * PRORTI + FRSTM * PROSTI +
& FRSU * PROSUI) * RPROAV
C-----------------------------------------------------------------------
C Compute N Demand for new tissue, including reproductive and vegetative
C SC Compute N Demand for new vegetative tissue for sugarcane
C-----------------------------------------------------------------------
! NDMNEW Total N demand for new growth (g [N] / m2 - d)
! NDMOLD N demand for old tissue (g [N] / m2 - d)
! NDMTOT Total N demand (g [N] / m2 - d)
! NDMVEG N required for vegetative growth if all PGAVL is used as
! computed (g [N] / m2 / d)
! SC
NDMVEG = (ACDMVEG / AGRVG2) * (FRLF * FNINL + FRSTM * FNINS +
& FRRT * FNINR + FRSU * FNINSU)
! NDMNEW = NDMREP + NDMVEG
! SC
NDMNEW = NDMVEG
C-----------------------------------------------------------------------
C Check to see if any C is left after reproductive growth for
C reducing N to re-fill old tissue, if N can be taken up by roots
C-----------------------------------------------------------------------
! CNOLD = MAX(0.0,PGAVL-CDMREP)
! CNOLD Available CH2O after reproductive growth (g [CH2O]/m2-d)
! SC does not have reproductive partitioning. Therefore XFRT=0 and CDMREP=0
CNOLD = 0
NDMOLD = 0.0
C-----------------------------------------------------------------------
C Nitrogen demand for old tissue
C-----------------------------------------------------------------------
! IF (DAS .GT. NVEG0 .AND. DAS .LT. NR7 .AND.
! & CNOLD .GT. 0.0) THEN
! SC if CNOLD = 0 this IF condition will never be met. To account for
! N demand for old tissue explicitly, this IF and the inner IF are
! removed.
! IF (DAS .GT. NVEG0 .AND. CNOLD .GT. 0.0) THEN
! NVSTL = FNINL
! NVSTS = FNINS
! NVSTR = FNINR
! SC
! NVSTSU = FNINSU !Sugars
! IF (DXR57 .GT.0.0) THEN
! FRNLFT = (NRCVR + (1. - NRCVR) * (1. - DXR57**2))
! NVSTL = PROLFF*0.16 + (FNINL-PROLFF*0.16) * FRNLFT
! NVSTS = PROSTF*0.16 + (FNINS-PROSTF*0.16) * FRNLFT
! NVSTR = PRORTF*0.16 + (FNINR-PRORTF*0.16) * FRNLFT
! ENDIF
! Last line for sugars
! NDMOLD = (WTLF - WCRLF) * MAX(0.0,(NVSTL - PCNL / 100.))
! & + (STMWT - WCRST) * MAX(0.0,(NVSTS - PCNST / 100.))
! & + (RTWT - WCRRT) * MAX(0.0,(NVSTR - PCNRT / 100.))
! & + (SUWT - WCRSU) * MAX(0.0,(NVSTSU - PCNSU / 100.))
! IF (NDMOLD .GT. (CNOLD / RNO3C * 0.16)) THEN
! NDMOLD = CNOLD / RNO3C * 0.16
! ENDIF
! ENDIF
C-----------------------------------------------------------------------
C Total N demand
C-----------------------------------------------------------------------
! NDMTOT = NDMREP + NDMVEG + NDMOLD
NDMTOT = NDMVEG + NDMOLD ! Sugarcane
C-----------------------------------------------------------------------
C Compute total demand for C, and max. C that could be mined
! CDMTOT not used - chp
C-----------------------------------------------------------------------
! RNO3C Respiration required for reducing NO3 to protein
! (g [CH2O] / g [protein])
! CDMTOT = CDMREP + CDMVEG + NDMOLD*RNO3C/0.16
CDMTOT = CDMVEG + NDMOLD * RNO3C / 0.16 ! Sugarcane
! END IF
! GDMSD = GDMSDO
ENDIF !end VSTAGE
IF (DYNAMIC == 4) THEN
SUBTITLE = .TRUE.
END IF
C-----------------------------------------------------------------------
C At this point, PGAVL will be used entirely, assuming that N can be
C made available in the ratio described.
C Growth Demands :
C N-Demands : NDMVEG, NDMOLD, NDMTOT, NDMNEW
C C-Demands : CDMVEG,, CDMVEG, CDMTOT, CNOLD
C***********************************************************************
C***********************************************************************
C END OF DYNAMIC IF CONSTRUCT
C***********************************************************************
ENDIF
C-----------------------------------------------------------------------
SELECT CASE (DYNAMIC)
CASE (1)
SUBTITLE = .TRUE.
CASE (2)
SUBTITLE = .TRUE.
CASE (3)
SUBTITLE = .TRUE.
CASE (4)
IF (SUBTITLE) THEN !portability
SUBTITLE = .FALSE.
ELSE
SUBTITLE = .TRUE.
END IF
END SELECT
CALL PRNT_DEMAND_SC(
& DYNAMIC, SUBTITLE, YRDOY, YRSIM,
& AGRLF, AGRRT, AGRSTM, AGRSU,
& DLFN, DPLARF, DRPP,
& NSTRES, NVEG0,
& PAR, PCNL, PCNRT, PCNST, PCNSU, PGAVL, PLTPOP,
& RPROAV,
& WTLF, RTWT, STMWT, SUWT,
& SetStalk, SWFAC,
& TAVG, TDUMX, TURFAC,
& VSTAGE,
& WCRLF, WCRRT, WCRST, WCRSU,
& WNRLF, WNRRT, WNRST, WNRSU,
& AGRVG, AGRVG2,
& F, FNINL, FNINR, FNINS,
& FRLF, FRRT, FRSTM, FRSU,
& NDMNEW, NDMOLD, NDMTOT, NDMVEG, NMINEP, NMOBR)
SUBTITLE = .FALSE.
RETURN
END SUBROUTINE CSP_DEMAND
C=======================================================================
C CSP_IPDMND Subroutine, from IPDMND subroutine, C.H. Porter
C-----------------------------------------------------------------------
C Reads input data for CSP_DEMAND subroutine
C-----------------------------------------------------------------------
C REVISION HISTORY
C 07/04/1998 CHP Written.
C 08/12/2003 CHP Added I/O error checking
C 08/19/2003 FSR Changed from Daza's IPDMND_SC for CASUPRO sugarcane
C-----------------------------------------------------------------------
C Called by: CSP_DEMAND
C Calls: FIND, ERROR, IGNORE
C=======================================================================
SUBROUTINE CSP_IPDMND(FILECC, FILEIO, !Input
& FINREF, FRLFF, FRLFMX, FRSTMF, NMOBMX, NVSMOB, PROLFF, !Output
& PROLFI, PRORTF, PROSUF, PROSUI, PRORTI, PROSTF, PROSTI, !Output
& RCH2O, RLIG, RLIP, RMIN, RNO3C, RPRO, ROA, SIZELF, !Output
& SIZREF, SLAMAX, SLAMIN, SLAPAR, SLAREF, SLAVAR, TURSLA, !Output
& VSSINK, XLEAF, XSLATM, XVGROW, YLEAF, YSLATM, YSTEM, !Output
& YVREF, XFRRT, YFRRT, XFRSU, YFRSU, GAMMA) !Output
!-----------------------------------------------------------------------
IMPLICIT NONE
!-----------------------------------------------------------------------
! CHARACTER*3 TYPSDT
CHARACTER*6 ERRKEY
PARAMETER (ERRKEY = 'DEMAND')
CHARACTER*6 SECTION
CHARACTER*6 ECONO !ECOTYP,
CHARACTER*30 FILEIO
CHARACTER*80 C80
CHARACTER*92 FILECC !, FILEGC
! CHARACTER*255 C255
INTEGER LUNCRP, LUNIO, ERR, LINC, LNUM, FOUND, ISECT !, LUNECO
INTEGER I, II
REAL FINREF, FRLFF, FRLFMX, FRSTMF, NMOBMX, NVSMOB,
& PROLFF, PROLFI, PRORTF, PRORTI, PROSTF, PROSTI, PROSUF, PROSUI,
& RPRO, RCH2O, RLIG, RLIP, RMIN, RNO3C, ROA, SIZELF, SIZREF,
& SLAMAX, SLAMIN, SLAPAR, SLAREF, SLAVAR, TURSLA, VSSINK !,SLOSUM
REAL XVGROW(6), YVREF(6)
REAL XSLATM(10), YSLATM(10)
REAL XLEAF(25), YLEAF(25), YSTEM(25)
REAL GAMMA, XFRRT(4), YFRRT(4), XFRSU(4), YFRSU(4) !CASUPRO
!-----------------------------------------------------------------------
CALL GETLUN('FILEIO', LUNIO)
OPEN (LUNIO, FILE = FILEIO,STATUS = 'OLD',IOSTAT=ERR)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILEIO,0)
LNUM = 0
!-----------------------------------------------------------------------
C Find and Read Field Section from FILEIO - previously read in IPIBS
! Look for the second section header beginning with '*CULTI'
C-----------------------------------------------------------------------
SECTION = '*CULTI'
CALL FIND(LUNIO, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILEIO, LNUM)
ENDIF
CALL FIND(LUNIO, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILEIO, LNUM)
ELSE
READ(LUNIO,'(24X,A6,66X,2F6.0)',IOSTAT=ERR)
& ECONO, SLAVAR, SIZELF ; LNUM = LNUM + 1
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILEIO,LNUM)
ENDIF
CLOSE (LUNIO)
!-----------------------------------------------------------------------
! Read in values from input file, which were previously input
! in Subroutine IPCROP.
!-----------------------------------------------------------------------
CALL GETLUN('FILEC', LUNCRP)
OPEN (LUNCRP,FILE = FILECC, STATUS = 'OLD',IOSTAT=ERR)
LNUM = 0
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
!-----------------------------------------------------------------------
! Find and Read Respiration Section
!-----------------------------------------------------------------------
SECTION = '!*RESP'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(F6.0,6X,F6.0)',IOSTAT=ERR) RNO3C, RPRO
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(5F6.0)',IOSTAT=ERR)RCH2O,RLIP,RLIG,ROA,RMIN
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
ENDIF
!-----------------------------------------------------------------------
! Find and Read Plant Composition Section
!-----------------------------------------------------------------------
SECTION = '!*PLAN'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(F6.0,6X,2F6.0,6X,F6.0)', IOSTAT=ERR)
& PROLFI, PROLFF, PROSTI, PROSTF
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(F6.0,6X,2F6.0,6X,F6.0)', IOSTAT=ERR)
& PRORTI, PRORTF, PROSUI, PROSUF
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
ENDIF
!-----------------------------------------------------------------------
! Find and Read Seed Composition Section
! Removed for CASUPRO sugarcane model (FSR)
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
! Find and Read Carbon and Nitrogen Mining Section
!-----------------------------------------------------------------------
SECTION = '!*CARB'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(18X,2F6.0)',IOSTAT=ERR) NMOBMX, NVSMOB
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
ENDIF
!-----------------------------------------------------------------------
! Find and Read Vegetative Partitioning Section
!-----------------------------------------------------------------------
SECTION = '!*VEGE'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(8F6.0)',IOSTAT=ERR)(XLEAF(II),II=1,8)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(8F6.0)',IOSTAT=ERR)(YLEAF(II),II=1,8)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(8F6.0)',IOSTAT=ERR)(YSTEM(II),II=1,8)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(12X,2F6.0)',IOSTAT=ERR) FRSTMF, FRLFF
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(F6.0)',IOSTAT=ERR) FRLFMX
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
ENDIF
!-----------------------------------------------------------------------
! Find and Read Leaf Growth Section
!-----------------------------------------------------------------------
SECTION = '!*LEAF'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(4F6.0)',IOSTAT=ERR) FINREF, SLAREF, SIZREF, VSSINK
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(4F6.0)',IOSTAT=ERR) SLAMAX, SLAMIN, SLAPAR, TURSLA
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(6F6.0)',IOSTAT=ERR)(XVGROW(II),II=1,6)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(6F6.0)',IOSTAT=ERR)(YVREF(II),II=1,6)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(5F6.0)',IOSTAT=ERR)(XSLATM(II),II = 1,5)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(5F6.0)',IOSTAT=ERR)(YSLATM(II),II = 1,5)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
ENDIF
! New
!-----------------------------------------------------------------------
! Find and Read Root Section
!-----------------------------------------------------------------------
SECTION = '!*ROOT'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
DO I=1,3
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
ENDDO
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(4F6.0)',IOSTAT=ERR) (XFRRT(II),II = 1,4)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(4F6.0)',IOSTAT=ERR) (YFRRT(II),II = 1,4)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)
END IF
! New
!-----------------------------------------------------------------------
! Find and Read Sugars Section
!-----------------------------------------------------------------------
SECTION = '!*SUGA'
CALL FIND(LUNCRP, SECTION, LINC, FOUND) ; LNUM = LNUM + LINC
IF (FOUND .EQ. 0) THEN
CALL ERROR(SECTION, 42, FILECC, LNUM)
ELSE
CALL IGNORE(LUNCRP,LNUM,ISECT,C80)
READ(C80,'(4F6.0)',IOSTAT=ERR) (XFRSU(II),II = 1,4)
IF (ERR .NE. 0) CALL ERROR(ERRKEY,ERR,FILECC,LNUM)