-
Notifications
You must be signed in to change notification settings - Fork 1
/
GROW.FOR
1778 lines (1629 loc) · 74.8 KB
/
GROW.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 GROW, Subroutine, G. Hoogenboom, J.W. Jones, and K.J.Boote
C-----------------------------------------------------------------------
C Governing Model Equations
C Integrates all growth related variables
C-----------------------------------------------------------------------
C REVISION HISTORY
C 01/09/1989 GH Written.
C 01/04/1996 GH Added seed composition routine.
C 01/19/1996 KJB NMOBR
C 04/02/1996 KJB Modified
C 05/30/1998 CHP moved diseased leaf area calculations to PEST module.
C 07/16/1998 CHP Modified for modular format
C 05/11/1999 GH Incorporated in CROPGRO
C 03/29/2000 CHP Added cumulative senescence variables
C 06/19/2001 GH Add checks for negative state variables
C 06/11/2002 GH Modified for Y2K
C 03/12/2003 CHP Changed senescence variable to composite (SENESCE)
C as defined in ModuleDefs.for
C 03/24/2004 CHP Added P component of senesced matter
C 01/19/2006 CHP N in senesced roots lost at actual N%, not minimum.
C-----------------------------------------------------------------------
C Called by: PLANT
C Calls: IPGROW, STRESS
C ERROR
C=======================================================================
SUBROUTINE GROW(CONTROL, ISWITCH, DYNAMIC, SOILPROP,
& AGEFAC, CADLF, CADST, CRUSLF, CRUSRT, CRUSSH, !Input
& CRUSST, DISLA, F, FILECC, FRLF, FRSTM, !Input
& NADLF, NADRT, NADST, NDTH, NFIXN, NGRLF, NGRRT, !Input
& NGRSD, NGRSH, NGRST, NMINEA, NODGR, NOUTDO, !Input
& NPLTD, NRUSLF, NRUSRT, NRUSSH, NRUSST, !Input
& POTCAR, POTLIP, PPLTD, SDIDOT, SDPROR, !Input
& SENNOD, SENRT, SLDOT, SLNDOT, SRDOT, SSDOT, !Input
& SSNDOT, TRNH4U, TRNO3U, TRNU, !Input
& TURFAC, WLDOTN, WLIDOT, WRDOTN, WRIDOT, WSDDTN, !Input
& WSDOTN, WSHDTN, WSIDOT, WTABRT, WTSHMT, YRNR1, !Input
& MDATE, YRPLT, !Input
& SWIDOT, WLFDOT, WSHIDT, WTNFX, XHLAI, !Input/Output
& AREALF, BETN, CANNAA, CANWAA, CLW, CSW, DWNOD, !Output
& DWNODA, GROWTH, GRWRES, LAIMX, PCCSD, PCLSD, !Output
& PCNL, PCNRT, PCNSD, PCNSH, PCNST, PLTPOP, !Output
& PLIGLF, PLIGNO, PLIGRT, PLIGSD, PLIGSH, PLIGST, !Output
& PODWT, PUNCSD, PUNCTR, RHOL, RHOS, RNITP, !Output
& ROWSPC, RTWT, SDNPL, SDRATE, SDWT, !Output
& SEEDNI, SEEDNO, SENESCE, SHELWT, SLA, !Output
& SLAAD, STMWT, TOPWT, TOTWT, WCRLF, WCRRT, WCRSH, !Output
& WCRST, WNRLF, WNRRT, WNRSH, WNRST, WTCO, !Output
& WTLF, WTLO, WTMAIN, WTNCAN, WTNEW, WTNLA, WTNLF, !Output
& WTNLO, WTNNA, WTNNAG, WTNNO, WTNNOD, WTNOO, !Output
& WTNRA, WTNRO, WTNRT, WTNSA, WTNSD, WTNSDA, !Output
& WTNSDO, WTNSH, WTNSHA, WTNSHO, WTNSO, WTNST, !Output
& WTNUP, WTRO, WTSDO, WTSHO, WTSO, XLAI, XPOD, !Output
& ShutMob, RootMob, ShelMob) !Output
!-----------------------------------------------------------------------
USE ModuleDefs !Definitions of constructed variable types,
! which contain control information, soil
! parameters, hourly weather data.
IMPLICIT NONE
SAVE
!-----------------------------------------------------------------------
CHARACTER*1 ISWSYM, ISWNIT, IDETO, IHARI, PLME
CHARACTER*2 XPODF, CROP
CHARACTER*6 ERRKEY
PARAMETER (ERRKEY = 'GROW ')
CHARACTER*30 FILEIO
CHARACTER*92 FILECC
INTEGER DYNAMIC, NOUTDO, L, NLAYR
INTEGER YRDOY, YRNR1, MDATE
INTEGER YRPLT
REAL WTNUP,WTNFX,WTNMOB,WTNCAN,TGROW
REAL WRCSHD,DISLA,WSDMAN
REAL WLFDOT, PPLTD,NPLTD,SDWTAM,CANNAA,CANWAA
REAL DWNODA,WTNNAG,AGEFAC
REAL POTLIP,POTCAR
REAL CPFLF, CPFSTM, CPFRT, CPFNOD, CPFSH1, CPFSD1
REAL WRIDOT,WSIDOT,WTNNOD
REAL WNDOT, WPDOT, WDOT,WRCLDT,WRCSDT,WRCRDT
REAL NLOFF, NSOFF, NROFF, NSHOFF, NSDOFF, NNOFF
REAL WTLO, WTSO, WTRO, WTSHO, WTSDO, WTNOO
REAL WTCO
REAL NLALL, NSALL, NRALL, NSHALL, NSDALL
REAL WTNLA, WTNSA, WTNRA, WTNSHA, WTNSDA, WTNNA
REAL WTNLO, WTNSO, WTNRO, WTNSHO, WTNSDO, WTNNO
REAL WLDOT, WSDOT, WRDOT
REAL WLDOTN, WSDOTN, WRDOTN, WSDDTN, WSHDTN
REAL NGRLF, NGRST, NGRRT, NGRSH, NGRSD
REAL WTLF, STMWT, RTWT, SHELWT, SDWT
REAL PROLFF, PROSTF, PRORTF, PROSHF
REAL PCNL, PCNST, PCNRT, PCNSH, PCNSD
REAL WTNLF, WTNST, WTNRT, WTNSH, WTNSD
REAL NLDOT, NSDOT, NRDOT, NSHDOT, NSDDOT
REAL NRUSLF, NRUSST, NRUSRT, NRUSSH
REAL CRUSLF, CRUSST, CRUSRT, CRUSSH
REAL ALPHL, ALPHS, ALPHR, ALPHSH
REAL RHOL, RHOS, RHOR, RHOSH
REAL WCRLF, WCRST, WCRRT, WCRSH
REAL NADLF, NADST, NADRT
REAL WNRLF, WNRST, WNRRT, WNRSH
REAL CADLF, CADST
REAL SLDOT, SSDOT, SRDOT, SWIDOT
REAL SLNDOT, SSNDOT, SDIDOT
REAL WLIDOT, WSHIDT, WSHDOT, WSDDOT
REAL SDPROR, GRWRES, TRNO3U, TRNH4U, NFIXN
REAL WTABRT
REAL WTLSD, WTCSD, NTOVR, NDTH, XPOD
REAL TOTWT, TOPWT, PODWT, DWNOD
REAL WTMAIN
REAL WTSHMT
REAL WTNTOT, NMINEA, TRNU
REAL PCLSD, PCCSD, RNITP, PCNMIN
REAL ALFDOT, F, SLA, AREALF, XLAI, SLAAD
REAL LAIMX, AREAH
REAL XHLAI, SEEDNO, PLTPOP, ROWSPC, BETN
REAL TURFAC
REAL GROWTH, NODGR
REAL FRLF, FRSTM
REAL SDNPL, SEEDNI, SDRATE
REAL WTNEW
REAL PCARLF, PCARNO, PCARRT, PCARSD, PCARSH, PCARST,
& PLIGLF, PLIGNO, PLIGRT, PLIGSD, PLIGSH, PLIGST,
& PLIPLF, PLIPNO, PLIPRT, PLIPSH, PLIPST,
& PMINLF, PMINNO, PMINRT, PMINSD, PMINSH, PMINST,
& POALF, POANO, POART, POASD, POASH, POAST,
& PROLFI, PRONOD, PRORTI, PROSTI,
& SDPRO, WTFSD, WTPSD, SDWTPL
REAL RMIN, SDLIP, WLFI, WSTI, WRTI
REAL CLW, CSW
! Surface and soil residue due to daily senescence of plant matter
REAL SENRT(NL), SENNOD(NL)
REAL SenWt(0:NL) !kg[dry matter]/ha
REAL SenLig(0:NL) !kg[lignin]/ha
REAL SenE(0:NL,NELEM) !kg[E]/ha (E=N, P, S,...)
REAL NLPEST
!CHP - puncture variables, not functional
REAL PUNCSD, PUNCTR, PUNDOT, SDPDOT
! P module
REAL ADD
REAL ShutMob, RootMob, ShelMob
!-----------------------------------------------------------------------
! Constructed variable types defined in ModuleDefs.for.
TYPE (ControlType) CONTROL
TYPE (SwitchType) ISWITCH
TYPE (SoilType) SOILPROP
TYPE (ResidueType) SENESCE
! Transfer values from constructed data types into local variables.
!Don't get DYNAMIC from CONTROL variable because it will not
! have EMERG value (set only in CROPGRO).
!DYNAMIC = CONTROL % DYNAMIC
FILEIO = CONTROL % FILEIO
YRDOY = CONTROL % YRDOY
IDETO = ISWITCH % IDETO
IHARI = ISWITCH % IHARI
ISWNIT = ISWITCH % ISWNIT
ISWSYM = ISWITCH % ISWSYM
NLAYR = SOILPROP % NLAYR
!***********************************************************************
!***********************************************************************
! Run Initialization - Called once per simulation
!***********************************************************************
IF (DYNAMIC == RUNINIT) THEN
!-----------------------------------------------------------------------
CALL IPGROW(
& FILEIO, FILECC, CROP, !Input
& ALPHL, ALPHR, ALPHS, ALPHSH, !Output
& PCARLF, PCARST, PCARRT, PCARSH, PCARSD, PCARNO, !Output
& PLIGLF, PLIGST, PLIGRT, PLIGSH, PLIGSD, PLIGNO, !Output
& PLIPLF, PLIPST, PLIPRT, PLIPSH, PLIPNO, !Output
& PMINLF, PMINST, PMINRT, PMINSH, PMINSD, PMINNO, !Output
& POALF, POAST, POART, POASH, POASD, POANO, !Output
& PROLFF, PROSTF, PRORTF, PROSHF, PRONOD, !Output
& PROLFI, PROSTI, PRORTI, !Output
& PLTPOP, ROWSPC, RMIN, PLME, SDWTPL, !Output
& SDLIP, SDPRO, WTFSD, WTPSD, XPODF) !Output
IF (CROP .NE. 'FA') THEN
!-----------------------------------------------------------------------
! Copied from IPIBS
!-----------------------------------------------------------------------
ROWSPC = ROWSPC / 100.
IF (ROWSPC * PLTPOP > 1.E-4) THEN
BETN = 1./(ROWSPC*PLTPOP)
ELSE
BETN = 0.
ENDIF
C-----------------------------------------------------------------------
C Newest version of CROPGRO has variable seed N, oil, CH2O,
C which may make this tougher
C-----------------------------------------------------------------------
CPFLF = 30./44.*(PLIPLF*1.720 + PLIGLF*0.659 + POALF*(-0.011)
& + PMINLF*RMIN + PCARLF*0.170)
CPFSTM = 30./44.*(PLIPST*1.720 + PLIGST*0.659 + POAST*(-0.011)
& + PMINST*RMIN + PCARST*0.170)
CPFRT = 30./44.*(PLIPRT*1.720 + PLIGRT*0.659 + POART*(-0.011)
& + PMINRT*RMIN + PCARRT*0.170)
CPFNOD = 30./44.*(PLIPNO*1.720 + PLIGNO*0.659 + POANO*(-0.011)
& + PMINNO*RMIN + PCARNO*0.170)
CPFSH1 = 30./44.*(PLIPSH*1.720 + PLIGSH*0.659 + POASH*(-0.011)
& + PMINSH*0.073 + PCARSH*0.170)
CPFSD1 = 30./44.*(PMINSD*0.073 + PLIGSD*0.659 + POASD*(-0.011)
& + (SDLIP*1.720 + PCARSD*0.170)*(1. - SDPROR))
C-----------------------------------------------------------------------
! CALCULATE PERCENT NITROGEN IN LEAVES AT END OF SEASON
PCNMIN = PROLFF * 16.0 !Moved from INCOMP
!-----------------------------------------------------------------------
ENDIF
!***********************************************************************
!***********************************************************************
! Seasonal initialization - run once per season
!***********************************************************************
ELSEIF (DYNAMIC == SEASINIT) THEN
!-----------------------------------------------------------------------
ALFDOT = 0.0
AREALF = 0.0
AREAH = 0.0
CANWAA = 0.0
CANNAA = 0.0
GROWTH = 0.0
GRWRES = 0.0
LAIMX = 0.0
NLDOT = 0.0
NSDOT = 0.0
NRDOT = 0.0
NSDDOT = 0.0
NSHDOT = 0.0
NTOVR = 0.0
PCCSD = 0.0
PCLSD = 0.0
PCNL = 0.0
PCNRT = 0.0
PCNSD = 0.0
PCNSH = 0.0
PCNST = 0.0
PODWT = 0.0
RHOL = 0.0
RHOR = 0.0
RHOS = 0.0
RHOSH = 0.0
RTWT = 0.0
SDRATE = 0.0
SDWT = 0.0
SDWTAM = 0.0
SEEDNI = 0.0
SEEDNO = 0.0
SenWt = 0.0
SenLig = 0.0
SenE = 0.0
SENESCE % ResWt = 0.0
SENESCE % ResLig = 0.0
SENESCE % ResE = 0.0
SENESCE % CumResE(N) = 0.0
SHELWT = 0.0
SLAAD = 0.0
STMWT = 0.0
TGROW = 0.0
TOPWT = 0.0
TOTWT = 0.0
WCRLF = 0.0
WCRRT = 0.0
WCRSH = 0.0
WCRST = 0.0
WNRLF = 0.0
WNRRT = 0.0
WNRSH = 0.0
WNRST = 0.0
WSDDOT = 0.0
WSHDOT = 0.0
WTCO = 0.0
WTCSD = 0.0
WTLF = 0.0
WTLO = 0.0
WTLSD = 0.0
WTMAIN = 0.0
WTNCAN = 0.0
WTNLA = 0.0
WTNLF = 0.0
WTNLO = 0.0
WTNMOB = 0.0
WTNNA = 0.0
WTNNAG = 0.0
WTNNO = 0.0
WTNNOD = 0.0
WTNOO = 0.0
WTNRA = 0.0
WTNRO = 0.0
WTNRT = 0.0
WTNSA = 0.0
WTNSD = 0.0
WTNSDA = 0.0
WTNSDO = 0.0
WTNSH = 0.0
WTNSHA = 0.0
WTNSHO = 0.0
WTNSO = 0.0
WTNST = 0.0
WTNTOT = 0.0
WTNUP = 0.0
WTRO = 0.0
WTSDO = 0.0
WTSHO = 0.0
WTSO = 0.0
XLAI = 0.0
XHLAI = 0.0
XPOD = 0.0
CLW = 0.0 !Cumulative leaf growth
CSW = 0.0 !Cumulative stem growth
ShutMob = 0.0
RootMob = 0.0
ShelMob = 0.0
SDPDOT = 0.0 !CHP - not used
PUNDOT = 0.0 !CHP - not used
NLPEST = 0.0 !CHP - N loss due to pest damage
!-----------------------------------------------------------------------
! KJB 02/12/03 Set SLA to zero until emergence
! JWJ 09/16/03 Set SLA to -99 until emergence
! CHP 09/17/03 Do this for output only - SLA is used in calculations!
SLA = 0.0
! Need to get initial value of F from DEMAND first chp 9/14/98
! IF (CROP .NE. 'FA') THEN
! SLA = F
! ENDIF
!***********************************************************************
!***********************************************************************
! EMERGENCE CALCULATIONS - Performed once per season upon emergence
! or transplanting of plants
!***********************************************************************
ELSEIF (DYNAMIC == EMERG) THEN
!-----------------------------------------------------------------------
! Net growth rates
WLDOT = 0.0
WSDOT = 0.0
WRDOT = 0.0
WNDOT = 0.0
WPDOT = 0.0
WLFDOT = 0.0
C Initial seedling or transplant weight
SDRATE = WTPSD * PLTPOP / 0.8 * 10
IF (PLME .NE. 'T') THEN
WTNEW = WTFSD * WTPSD
TOTWT = WTNEW * PLTPOP
ELSE
TOTWT = SDWTPL / 10.
WTNEW = TOTWT / PLTPOP
ENDIF
! Initial mass of plant components
WTLF = FRLF * TOTWT
STMWT = FRSTM * TOTWT
TOPWT = WTLF + STMWT
RTWT = TOTWT - TOPWT
WLFI = WTLF
WSTI = STMWT
WRTI = RTWT
! Initialize cumulative variables
CLW = WTLF
CSW = STMWT
! CH2O reserves
WCRLF = ALPHL * WTLF
WCRST = ALPHS * STMWT
WCRRT = ALPHR * RTWT
!! Initialize cumulative C variables
! WCRLA = WCRLF
! WCRSA = WCRST
! WCRRA = WCRRT
! Carbohydrate composition of plant components (fraction)
RHOL = ALPHL
RHOR = ALPHR
RHOS = ALPHS
RHOSH = ALPHSH
! Net carbon addition variables
WRCLDT = 0.0
WRCSDT = 0.0
WRCRDT = 0.0
WRCSHD = 0.0
! Compute N in plant components
WTNLF = WLFI * PROLFI * 0.16
WTNST = WSTI * PROSTI * 0.16
WTNRT = WRTI * PRORTI * 0.16
WTNSH = 0.0
WTNSD = 0.0
WTNTOT = WTNLF + WTNST + WTNRT + WTNSH + WTNSD
! Seed or transplant N at planting
SDNPL = WTPSD * SDPRO * 0.16 * 0.75 * PLTPOP -
& (WTNLF + WTNST + WTNRT)
SDNPL = MAX(SDNPL,0.0)
SEEDNI = WTNLF + WTNST + WTNRT + SDNPL
! Initialize cumulative N variables
WTNLA = WTNLF
WTNSA = WTNST
WTNRA = WTNRT
! Percent N in plant components
PCNL = WTNLF / WLFI * 100.
RNITP = PCNL
PCNST = WTNST / WSTI * 100.
PCNRT = WTNRT / WRTI * 100.
! Intialize leaf area. Value of F initialized in DEMAND.
AREALF = WTLF * F
AREAH = AREALF
SLA = AREALF / WTLF
SLAAD = AREALF / (WTLF - WCRLF)
XLAI = AREALF / 10000.
XHLAI = XLAI
C***********************************************************************
C***********************************************************************
C Daily integration
C***********************************************************************
ELSEIF (DYNAMIC == INTEGR) THEN
C-----------------------------------------------------------------------
NLPEST = 0.0 !CHP - N loss due to pest damage
GROWTH = WLDOTN + WSDOTN + WRDOTN + WSHDTN + WSDDTN + NODGR
GRWRES = WLDOTN*CPFLF + WSDOTN*CPFSTM + WRDOTN*CPFRT +
& NODGR*CPFNOD + WSHDTN*CPFSH1 + WSDDTN*CPFSD1 +
& 30./44*(TRNO3U/0.16 * 1.798 + TRNH4U/0.16 * 0.462 +
& NFIXN/0.16 * 1.798)
C-----------------------------------------------------------------------
C Use 1982 Penning de Vries book, p. 125, composition of tissue,
C fraction C for six categories, convert by 30/12 to CH20.
C-----------------------------------------------------------------------
C Account for N added to existing plant tissue, e.g., NADLF, that
C is damaged by insects, freezing, or senesced. Otherwise, could
C get increase in tissue N composition when tissue is aborted. Need
C to account for mass, N and C lost this way in sections below
C-----------------------------------------------------------------------
C WLDOT = Net leaf growth rate
C-----------------------------------------------------------------------
WLDOT = WLDOTN - SLDOT - WLIDOT - WLFDOT - NRUSLF/0.16 - CRUSLF
! ShutMob is amount of leaf mass lost due to N and C mobilization
! A positive value represents leaf mass lost. (kg/ha)
ShutMob = (NRUSLF/0.16 + CRUSLF) * 10. !kg/ha
IF (WTLF > 1.E-4) THEN
WLDOT = WLDOT + (CADLF+NADLF/0.16) *
& (1. - MIN(1.0,(SLDOT+WLIDOT+WLFDOT)/WTLF))
ADD = (CADLF+NADLF/0.16) *
& (1. - MIN(1.0,(SLDOT+WLIDOT+WLFDOT)/WTLF))
ShutMob = ShutMob - ADD * 10. !kg/ha
ELSE
ADD = 0.0
ENDIF
IF (WLDOT < 0.0) THEN
WLDOT = MAX(WLDOT, -WTLF)
ENDIF
C-----------------------------------------------------------------------
C WSDOT = Net stem growth rate
C-----------------------------------------------------------------------
WSDOT = WSDOTN - SSDOT - WSIDOT - NRUSST / 0.16 - CRUSST
ShutMob = ShutMob + (NRUSST / 0.16 + CRUSST) * 10. !kg/ha
IF (STMWT > 1.E-4) THEN
WSDOT = WSDOT + (CADST+NADST/0.16) *
& (1. - MIN(1.0,(SSDOT+WSIDOT)/STMWT))
ADD = (CADST+NADST/0.16) *
& (1. - MIN(1.0,(SSDOT+WSIDOT)/STMWT))
ShutMob = ShutMob - ADD * 10. !kg/ha
ELSE
ADD = 0.
ENDIF
IF (WSDOT < 0.0) THEN
WSDOT = MAX(WSDOT, -STMWT)
ENDIF
C-----------------------------------------------------------------------
C Net root growth rate
C-----------------------------------------------------------------------
WRDOT = WRDOTN - SRDOT - NRUSRT/0.16 - CRUSRT - WRIDOT
RootMob = (NRUSRT/0.16 + CRUSRT) * 10. !kg/ha
IF (RTWT > 1.E-4) THEN
WRDOT = WRDOT + (NADRT/0.16) *
& (1. - MIN(1.0,(SRDOT+WRIDOT)/RTWT))
ADD = (NADRT/0.16) *
& (1. - MIN(1.0,(SRDOT+WRIDOT)/RTWT))
RootMob = RootMob - ADD * 10. !kg/ha
ELSE
ADD = 0.0
ENDIF
IF (WRDOT < 0.0) THEN
WRDOT = MAX(WRDOT, -RTWT)
ENDIF
C-----------------------------------------------------------------------
C Net shell growth rate
C-----------------------------------------------------------------------
WSHIDT = MIN(WSHIDT,SHELWT) ! pest damage to shells
WSHDOT = WSHDTN - WSHIDT - WTABRT - NRUSSH / 0.16 - CRUSSH
ShelMob = (NRUSSH / 0.16 + CRUSSH) * 10. !kg/ha
C-----------------------------------------------------------------------
C Net seed growth rate
C-----------------------------------------------------------------------
SWIDOT = MIN(SWIDOT,SDWT) ! pest damage to seeds
WSDDOT = WSDDTN - SWIDOT
WTLSD = WTLSD + WSDDOT * POTLIP !lipids in seed
WTCSD = WTCSD + WSDDOT * POTCAR !carbohydrates in seed
C-----------------------------------------------------------------------
C Net nodule growth rate
C-----------------------------------------------------------------------
WNDOT = NODGR - NDTH
C-----------------------------------------------------------------------
C Net pod growth rate
C-----------------------------------------------------------------------
WPDOT = WSHDOT + WSDDOT
C-----------------------------------------------------------------------
C Total Net plant growth rate
C-----------------------------------------------------------------------
WDOT = WLDOT + WSDOT + WRDOT + WPDOT + WNDOT
C-----------------------------------------------------------------------
IF (GROWTH > 1.E-4) THEN
IF (XPODF == 'PD') THEN
XPOD = 0.17 * (WSDDTN+WSHDTN)/GROWTH + 0.83 * XPOD
ELSE IF (XPODF == 'SD') THEN
XPOD = 0.17 * (WSDDTN)/GROWTH + 0.83 * XPOD
ELSE
CALL ERROR(ERRKEY,1,' ',0)
ENDIF
ENDIF
C-----------------------------------------------------------------------
C Integration, Add Today's Net Growth to Existing Weights
C-----------------------------------------------------------------------
TOTWT = TOTWT + WDOT
TOPWT = TOPWT + WSDOT + WLDOT + WPDOT
WTLF = WTLF + WLDOT
STMWT = STMWT + WSDOT
SDWT = SDWT + WSDDOT
SHELWT = SHELWT + WSHDOT
RTWT = RTWT + WRDOT
PODWT = PODWT + WPDOT
DWNOD = DWNOD + WNDOT
TGROW = TGROW + GROWTH
C-----------------------------------------------------------------------
C Cumulative leaf and stem growth
C-----------------------------------------------------------------------
CLW = CLW + WLDOTN
CSW = CSW + WSDOTN
C-----------------------------------------------------------------------
C Store values of TOPWT at flowering and SDWT at maturity
C-----------------------------------------------------------------------
IF (YRDOY == YRNR1) THEN
CANWAA = TOPWT
ELSEIF (YRDOY == MDATE) THEN
SDWTAM = SDWT
ENDIF
C---------------------------------------------------------------------
C Compute Seed Weight for Which there is Maintenance Costs.
C-----------------------------------------------------------------------
WSDMAN = MIN(SDWT,SHELWT)
WTMAIN = TOTWT - SDWT + WSDMAN
C-----------------------------------------------------------------------
C Carbon Reserves: Net Growth Rates for Mobile Carbohydrates
C-----------------------------------------------------------------------
C Account for N added to existing plant tissue, e.g., NADLF, that
C is damaged by insects, freezing, or senesced. Otherwise, could
C get increase in tissue N composition when tissue is aborted. Need
C to account for mass, N and C lost this way in sections below
C-----------------------------------------------------------------------
WRCLDT = ALPHL * WLDOTN - CRUSLF - RHOL*(SLNDOT+WLIDOT+WLFDOT)
IF (WTLF > 1.E-4) THEN
WRCLDT = WRCLDT + CADLF *
& (1. - MIN(1.0,(SLDOT+WLIDOT+WLFDOT)/WTLF))
ENDIF
WRCSDT = ALPHS * WSDOT - CRUSST - RHOS * SSNDOT
IF (STMWT > 1.E-4) THEN
WRCSDT = WRCSDT + CADST *
& (1. - MIN(1.0,(SSDOT+WSIDOT)/STMWT))
ENDIF
WRCRDT = ALPHR * WRDOT - CRUSRT - RHOR * SRDOT
WRCSHD = ALPHSH * WSHDOT - CRUSSH - RHOSH*(WTABRT+WTSHMT+WSHIDT)
C-----------------------------------------------------------------------
C Update C Storage, Concentrations in Leaves, Stems, Roots, and Shells
C-----------------------------------------------------------------------
WCRLF = WCRLF + WRCLDT
WCRST = WCRST + WRCSDT
WCRRT = WCRRT + WRCRDT
WCRSH = WCRSH + WRCSHD
IF (WCRLF .LE. 1.0E-30) WCRLF = 0.0
IF (WCRST .LE. 1.0E-30) WCRST = 0.0
IF (WCRRT .LE. 1.0E-30) WCRRT = 0.0
IF (WCRSH .LE. 1.0E-30) WCRSH = 0.0
C-----------------------------------------------------------------------
C Compute Cumulative C loss During Season
C-----------------------------------------------------------------------
WTLO = WTLO + SLDOT + WLIDOT + WLFDOT
WTSO = WTSO + SSDOT + WSIDOT
WTRO = WTRO + SRDOT + WRIDOT
WTSHO = WTSHO + WTABRT + WSHIDT
WTSDO = WTSDO + SWIDOT
WTNOO = WTNOO + NDTH
WTCO = WTLO + WTSO + WTSHO + WTSDO
C-----------------------------------------------------------------------
C Compute CH20 fractions
C-----------------------------------------------------------------------
IF (WTLF > 0.0001) THEN
RHOL = WCRLF/WTLF
ELSE
RHOL = 0.0
ENDIF
IF (STMWT > 0.0001) THEN
RHOS = WCRST/STMWT
ELSE
RHOS = 0.0
ENDIF
IF (RTWT > 0.0001) THEN
RHOR = WCRRT/RTWT
ELSE
RHOR = 0.0
ENDIF
IF (SHELWT > 0.0001) THEN
RHOSH = WCRSH/SHELWT
ELSE
RHOSH = 0.0
ENDIF
C=======================================================================
C Nitrogen Balance: Net Growth Rates for Nitrogen Components
C=======================================================================
C Account for N added to existing plant tissue, e.g., NADLF, that
C is damaged by insects, freezing, or senesced. Otherwise, could
C get increase in tissue N composition when tissue is aborted. Need
C to account for mass, N and C lost this way in sections below
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
C Leaf nitrogen senescence and pest damage loss
C-----------------------------------------------------------------------
! senesc. + pest + freeze
NLOFF = (SLNDOT + WLIDOT + WLFDOT) * (PCNL/100.) +
& (SLDOT-SLNDOT) * PROLFF * 0.16
NLPEST = NLPEST + WLIDOT * PCNL/100.
IF (NLOFF. LT. 0.0) THEN
NLOFF = 0.0
ENDIF
C-----------------------------------------------------------------------
C Net growth rate of nitrogen in the leaves
C-----------------------------------------------------------------------
NLDOT = NGRLF - NLOFF - NRUSLF
IF (WTLF > 1.E-4) THEN
NLDOT = NLDOT + NADLF *
& (1. - MIN(1.0,(SLDOT + WLIDOT + WLFDOT) / WTLF))
ENDIF
C-----------------------------------------------------------------------
C Stem nitrogen senescence and pest damage loss
C-----------------------------------------------------------------------
! senesce + pest
NSOFF = (SSNDOT + WSIDOT) * (PCNST/100.) + (SSDOT - SSNDOT)
& * PROSTF * 0.16
NLPEST = NLPEST + WSIDOT * PCNST/100.
IF (NSOFF < 0.0) THEN
NSOFF = 0.0
ENDIF
C-----------------------------------------------------------------------
C Net growth rate of nitrogen in the stems
C-----------------------------------------------------------------------
NSDOT = NGRST - NSOFF - NRUSST
IF (STMWT > 1.E-4) THEN
NSDOT = NSDOT + NADST *
& (1. - MIN(1.0,(SSDOT + WSIDOT) / STMWT))
ENDIF
C-----------------------------------------------------------------------
C Root nitrogen senescence and pest damage loss
C-----------------------------------------------------------------------
NROFF = (SRDOT+WRIDOT) * (PCNRT/100.)
IF (NROFF < 0.0) THEN
NROFF = 0.0
ENDIF
C-----------------------------------------------------------------------
C Net growth rate of nitrogen in the roots
C-----------------------------------------------------------------------
NRDOT = NGRRT - NROFF - NRUSRT
IF (RTWT > 1.E-4) THEN
NRDOT = NRDOT + NADRT *
& (1. - MIN(1.0,(SRDOT + WRIDOT) / RTWT))
ENDIF
C-----------------------------------------------------------------------
C Shell nitrogen senescence, abortion and pest damage loss
C-----------------------------------------------------------------------
NSHOFF = (WTABRT+WSHIDT) * (PCNSH/100.)
NLPEST = NLPEST + WSHIDT * PCNSH/100.
IF (NSHOFF < 0.0) THEN
NSHOFF = 0.0
ENDIF
C-----------------------------------------------------------------------
C Net growth rate of nitrogen in shells
C-----------------------------------------------------------------------
NSHDOT = NGRSH - NSHOFF - NRUSSH
C-----------------------------------------------------------------------
C Seed nitrogen senescence, abortion and pest damage loss
C-----------------------------------------------------------------------
NSDOFF = SWIDOT * PCNSD/100.
IF (NSDOFF < 0.0) THEN
NSDOFF = 0.0
ENDIF
C-----------------------------------------------------------------------
C Net growth rate of nitrogen in seeds
C-----------------------------------------------------------------------
NSDDOT = NGRSD - NSDOFF
C-----------------------------------------------------------------------
C Integration, Update N in Each Component by Adding Today's Growth
C-----------------------------------------------------------------------
C-----------------------------------------------------------------------
C Total nitrogen in the leaves
C-----------------------------------------------------------------------
IF ((NLDOT < 0.0) .AND. (ABS(NLDOT) > WTNLF)) THEN
NLDOT = - WTNLF
ENDIF
WTNLF = WTNLF + NLDOT
C-----------------------------------------------------------------------
C Total nitrogen in the stems
C-----------------------------------------------------------------------
IF ((NSDOT < 0.0) .AND. (ABS(NSDOT) > WTNST)) THEN
NSDOT = - WTNST
ENDIF
WTNST = WTNST + NSDOT
C-----------------------------------------------------------------------
C Total nitrogen in the roots
C-----------------------------------------------------------------------
IF ((NRDOT < 0.0) .AND. (ABS(NRDOT) > WTNRT)) THEN
NRDOT = - WTNRT
ENDIF
WTNRT = WTNRT + NRDOT
C-----------------------------------------------------------------------
C Total nitrogen in the nodules
C-----------------------------------------------------------------------
WTNNOD = DWNOD * 0.16 * PRONOD
C-----------------------------------------------------------------------
C Total nitrogen in the shells
C-----------------------------------------------------------------------
IF ((NSHDOT < 0.0) .AND. (ABS(NSHDOT) > WTNSH)) THEN
NSHDOT = - WTNSH
ENDIF
WTNSH = WTNSH + NSHDOT
IF ((NSDDOT < 0.0) .AND. (ABS(NSDDOT) > WTNSD)) THEN
NSDDOT = - WTNSD
ENDIF
C-----------------------------------------------------------------------
C Total nitrogen in the seed
C-----------------------------------------------------------------------
WTNSD = WTNSD + NSDDOT
C-----------------------------------------------------------------------
C Total nitrogen in the plant
C-----------------------------------------------------------------------
WTNTOT = WTNLF + WTNST + WTNRT + WTNSH + WTNSD + WTNNOD
C-----------------------------------------------------------------------
C Total nitrogen in the canopy (all above ground components)
C-----------------------------------------------------------------------
WTNCAN = WTNLF + WTNST + WTNSH + WTNSD
C-----------------------------------------------------------------------
C Save total nitrogen in the canopy at the start of flowering
C-----------------------------------------------------------------------
IF (YRDOY == YRNR1) THEN
CANNAA = WTNCAN
ENDIF
C-----------------------------------------------------------------------
C Compute Cumulative N added during season
C-----------------------------------------------------------------------
! CHP - working on Plant N balance:
! Add adjustment factors for N addition.
! These factors are used in computation of net addition to
! tissue, but previously not here. Adding these statements
! forces cumulative N additions to equal 'current N' plus
! 'senesced N'.
! However . . . by making this change, cumulative tissue N no longer
! matches 'Seed N' plus 'N2 fixed' plus 'N uptake'. Why???
! Leaf
NLALL = NGRLF - NRUSLF
IF (WTLF > 1.E-4) THEN
NLALL = NLALL + NADLF *
& (1. - MIN(1.0,(SLDOT + WLIDOT + WLFDOT) / WTLF))
ENDIF
! Stem
NSALL = NGRST - NRUSST
IF (STMWT > 1.E-4) THEN
NSALL = NSALL + NADST *
& (1. - MIN(1.0,(SSDOT + WSIDOT) / STMWT))
ENDIF
! Root
NRALL = NGRRT - NRUSRT
IF (RTWT > 1.E-4) THEN
NRALL = NRALL + NADRT *
& (1. - MIN(1.0,(SRDOT + WRIDOT) / RTWT))
ENDIF
! Shell and seed
NSHALL = NGRSH - NRUSSH
NSDALL = NGRSD
WTNLA = WTNLA + NLALL
WTNSA = WTNSA + NSALL
WTNRA = WTNRA + NRALL
WTNSHA = WTNSHA + NSHALL
WTNSDA = WTNSDA + NSDALL
C-----------------------------------------------------------------------
C Nodules
C-----------------------------------------------------------------------
IF (ISWNIT == 'Y' .AND. ISWSYM == 'Y') THEN
DWNODA = DWNODA + NODGR
WTNFX = WTNFX + NFIXN + (NODGR * 0.16 * PRONOD) - NTOVR
WTNNAG = DWNODA * 0.16 * PRONOD
ENDIF
C-----------------------------------------------------------------------
C Compute Cumulative N loss During Season
C-----------------------------------------------------------------------
WTNLO = WTNLO + NLOFF
WTNSO = WTNSO + NSOFF
WTNRO = WTNRO + NROFF
WTNSHO = WTNSHO + NSHOFF
WTNSDO = WTNSDO + NSDOFF
IF (ISWNIT == 'Y' .AND. ISWSYM == 'Y') THEN
NNOFF = NDTH * 0.16 * PRONOD
WTNNO = WTNNO + NNOFF
ENDIF
C-----------------------------------------------------------------------
C N Balance Components for Mobilized, Uptake, and Fixed N
C-----------------------------------------------------------------------
WTNMOB = WTNMOB + NMINEA
WTNUP = WTNUP + TRNU
WTNNA = WTNNOD + WTNNO
C-----------------------------------------------------------------------
C Compute Percentage N in each Plant Component
C-----------------------------------------------------------------------
IF ((WTLF > 1.E-4) .AND. (WTLF > WTNLF) .AND.
& (WTNLF > 1.E-5)) THEN
PCNL = WTNLF / WTLF * 100.0
ELSE
PCNL = 0.0
ENDIF
IF ((STMWT > 1.E-4) .AND. (WTNST > 1.E-5)) THEN
PCNST = WTNST / STMWT * 100.0
ELSE
PCNST = 0.0
ENDIF
IF ((RTWT > 1.E-4) .AND. (WTNRT > 1.E-5)) THEN
PCNRT = WTNRT / RTWT * 100.0
ELSE
PCNRT = 0.0
ENDIF
IF ((SHELWT > 1.E-4) .AND. (WTNSH > 1.E-5)) THEN
PCNSH = WTNSH / SHELWT * 100.0
ELSE
PCNSH = 0.0
ENDIF
C-----------------------------------------------------------------------
C Compute Percentage Seed Composition
C-----------------------------------------------------------------------
IF (SDWT > 0.01) THEN
PCNSD = WTNSD / SDWT * 100.0
PCLSD = WTLSD / SDWT * 100.0
PCCSD = WTCSD / SDWT * 100.0
ELSE
PCNSD = 0.0
PCLSD = 0.0
PCCSD = 0.0
ENDIF
C-----------------------------------------------------------------------
C Calculate true nitrogen concentration in leaf tissue for
C photosynthesis reduction.
C-----------------------------------------------------------------------
IF ((WTLF - WCRLF) > 1.E-4) THEN
RNITP = 100.*WTNLF/(WTLF-WCRLF)
ELSE
RNITP = PCNMIN
ENDIF
C-----------------------------------------------------------------------
C Calculate Remaining N in Shells, Leaves, Stems, and Roots
C That can be Mined (Plant N-Balance).
C-----------------------------------------------------------------------
IF ((WTLF - WCRLF) > 1.E-4) THEN
WNRLF = MAX (WTNLF - PROLFF * 0.16 * (WTLF-WCRLF), 0.0)
ELSE
WNRLF = 0.0
ENDIF
IF ((STMWT - WCRST) > 1.E-4) THEN
WNRST = MAX (WTNST - PROSTF * 0.16 * (STMWT-WCRST), 0.0)
ELSE
WNRST = 0.0
ENDIF
IF (RTWT > 1.E-4) THEN
WNRRT = MAX (WTNRT - PRORTF * 0.16 * RTWT, 0.0)
ELSE
WNRRT = 0.0
ENDIF
IF (SHELWT > 1.E-4) THEN
WNRSH = MAX (WTNSH - PROSHF * 0.16 * SHELWT, 0.0)
ELSE
WNRSH = 0.0
ENDIF
C-----------------------------------------------------------------------
C This section added to provide senescence parameters to the
C Soil N routines (senescence and freeze values are added to soil
C residue; pest damage components are lost from the system)
C-----------------------------------------------------------------------
C Surface carbon includes all senescence and freeze variables for
C leaf (SLDOT, WLFDOT), stem (SSDOT), and shell (WTABRT)
C At this time, the model does not senesce seed.
C Convert from biomass to C with a factor 0.40.
C-----------------------------------------------------------------------
SenWt(0) = (SLDOT + WLFDOT + SSDOT + WTABRT)
C Convert from g/m2 to kg/ha with a factor of 10.
SenWt(0) = AMAX1(SenWt(0), 0.) * 10.0 !kg[dry matter]/ha
C-----------------------------------------------------------------------
C Surface nitrogen includes nitrogen losses computed above minus the
C pest damage components.
C-----------------------------------------------------------------------
SenE(0,1) = NLOFF + NSOFF + NSHOFF - NLPEST
C Convert from g/m2 to kg/ha with a factor of 10.
SenE(0,1) = AMAX1 (SenE(0,1),0.) * 10.0 !kg[N]/ha