-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMOD_LimnologyVars.f90
5101 lines (4999 loc) · 279 KB
/
MOD_LimnologyVars.f90
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
Module LimnologyVars
! Declare the Water Quality Variables
! List of Modifications:
! -> 30.12.2014: Routine Implementation (Rafael Cavalcanti)
! Programmer: Rafael Cavalcanti
use domain_types
Implicit None
type LimnologyParam
!General
Integer:: iLimn !< Limnology module flag: iLimn = 0 (off); iLimn = 1 (on)
Integer:: iSed !< Sediment module flag: iSed = 0 (off); iSed = 1 (on)
!Integer,ALLOCATABLE:: IndexWQ(:,:) !< Cell Index of Water Quality boundary condition (IndexWQ(:,1) -> Water Temperature; IndexWQ(:,2) -> Salinity; IndexWQ(:,3) -> Inorganic Matter; IndexWQ(:,4) -> Dissolved Organic Matter; IndexWQ(:,4) -> Particulated Organic Matter)
Real, Allocatable:: dVarEstS(:,:)
!1. Water Temperature
!1.1 Flags
Integer:: iTempW !< Water temperatue module flag: iTempW = 0 (off); iTempW = 1 (on)
!1.2 State variables
Real,ALLOCATABLE:: sDTempW(:,:) !<Water Temperature in the current time
Real,ALLOCATABLE:: sDTempWP(:,:) !<Water Temperature in the past time
!1.3 Initial condition
Real sDTempW0 !<Initial condition of Water Temperature
!1.4 Boundary condition
Real,ALLOCATABLE:: uDLoadTemp(:,:) !< Water temperature loading value
Integer:: NuDLoadTemp !< Number of boundary conditions of Water temperature
Integer,ALLOCATABLE:: TempnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: TempTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: TempValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: TempSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: TempCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NTempIndex(:,:)
!1.5 Parameters
Real:: a_param !< Water Temperature Model Coefficient (0.5 to 0.7)
Real:: tau_param !< Stefan-Boltzmann Constant = 11.7 E-8 cal/cm²/d/K
Real:: e_param !< Emissivity of the Radiating Body
Real:: c1_param !< Bowen's Coefficient (0.47 mmHg/ºC)
Real:: cd_param !< Specific Heat (cal/g/ºC)
Real:: WtempRef
!2. Salinity
!2.1 Flags
Integer:: iSal !< Salinity module flag: iSal = 0 (off); iSal = 1 (on)
!2.2 State variables
Real,ALLOCATABLE:: sDSal(:,:) !<Salinity in the current time
Real,ALLOCATABLE:: sDSalP(:,:) !<Salinity in the past time
!2.3 Initial condition
Real sDSal0 !<Initial condition of Salinity
!2.4 Boundary condition
Real,ALLOCATABLE:: uDLoadSal(:,:) !< Salinity loading value
Integer:: NuDLoadSal !< Number of cells with boundary condition of Salinity
Integer,ALLOCATABLE:: SalnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: SalTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: SalValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: SalSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: SalCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NSalIndex(:,:)
Integer:: iLimno !< Water temperatue module flag: iLimno = 0 (off); iLimno = 1 (on
!3. Inorganic Matter
!3.1 Flags
Integer:: InclMatInorg !< Inorganic Matter module flag: InclMatInorg = 0 (off); InclMatInorg = 1 (on)
Integer:: InclMatInorgSplit !< Split Inorganic Matter flag: InclMatInorgSplit = 0 (no); InclMatInorgSplit = 1 (yes)
!3.2 State variables
Real,ALLOCATABLE:: sDIMW(:,:) !<Inorganic Matter in the water at current time
Real,ALLOCATABLE:: sDIMWP(:,:) !<Inorganic Matter in the water at past time
Real,ALLOCATABLE:: sDIMS(:) !<Inorganic Matter in the sediment at current time
Real,ALLOCATABLE:: sDIMSP(:) !<Inorganic Matter in the sediment at past time
!3.3 Initial condition
Real sDIMW0 !<Initial condition of Inorganic Matter in the water (mgDW/l)
Real sDIMS0 !<Initial condition of Inorganic Matter in the sediment (gD/m²)
!3.4 Boundary condition
Real,ALLOCATABLE:: uDLoadIM(:,:) !< Inorganic Matter loading value
Integer:: NuDLoadIM !< Number of cells with boundary condition of Inorganic Matter
Integer,ALLOCATABLE:: IMnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: IMTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: IMValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: IMSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: IMCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NIMIndex(:,:)
!4/5. Dissolved and Particulted Organic Matter
!4/5.1 Flags
Integer:: InclMatOrg !< Organic Matter flag: InclMatOrg = 0 (no); InclMatOrg = 1 (yes)
Integer:: InclMatOrgSplit !< Split Organic Matter flag: InclMatOrgSplit = 0 (no); InclMatOrgSplit = 1 (yes)
Integer:: InclPomDomSplit !< Include Particulated Organic Matter flag: InclPomSplit = 0 (no); InclPomSplit = 1 (yes)
!4/5.2 State variables
Real,ALLOCATABLE:: sDPomW(:,:,:), sCPomW(:,:,:), sNPomW(:,:,:), sPPomW(:,:,:), sSiPomW(:,:,:) !<Fractions of Particulated Organic Matter in the water at current time
Real,ALLOCATABLE:: sDDomW(:,:,:), sCDomW(:,:,:), sNDomW(:,:,:), sPDomW(:,:,:), sSiDomW(:,:,:) !<Fractions of Dissolved Organic Matter in the water at current time
Real,ALLOCATABLE:: sDPomS(:,:), sCPomS(:,:), sNPomS(:,:), sPPomS(:,:), sSiPomS(:,:) !<Fractions of Particulated Organic Matter in the sediment at current time
Real,ALLOCATABLE:: sDDomS(:,:), sCDomS(:,:), sNDomS(:,:), sPDomS(:,:), sSiDomS(:,:) !<Fractions of Dissolved Organic Matter in the sediment at current time
Real,ALLOCATABLE:: sDPomWP(:,:,:), sCPomWP(:,:,:), sNPomWP(:,:,:), sPPomWP(:,:,:), sSiPomWP(:,:,:) !<Fractions of Particulated Organic Matter in the water at past time
Real,ALLOCATABLE:: sDDomWP(:,:,:), sCDomWP(:,:,:), sNDomWP(:,:,:), sPDomWP(:,:,:), sSiDomWP(:,:,:) !<Fractions of Dissolved Organic Matter in the water at past time
Real,ALLOCATABLE:: sDPomSP(:,:), sCPomSP(:,:), sNPomSP(:,:), sPPomSP(:,:), sSiPomSP(:,:) !<Fractions of Particulated Organic Matter in the sediment at past time
Real,ALLOCATABLE:: sDDomSP(:,:), sCDomSP(:,:), sNDomSP(:,:), sPDomSP(:,:), sSiDomSP(:,:) !<Fractions of Dissolved Organic Matter in the sediment at past time
!4/5.3 Initial condition
Real,ALLOCATABLE:: sDDomW0(:),sDDomS0(:) !<Initial condition of Dissolved Organic Matter in the water and in the sediment (mgDW/l)
Real,ALLOCATABLE:: sDPomW0(:),sDPomS0(:) !<Initial condition of Particulated Organic Matter in the water and in the sediment (gD/m²)
!4/5.4 Boundary condition
Real,ALLOCATABLE:: uDLoadDom(:,:) !< Dissolved Organic Matter loading value
Real,ALLOCATABLE:: uDLoadPom(:,:) !< Particulated Organic Matter loading value
Integer:: NuDLoadDom !< Number of cells with boundary condition of Dissolved Organic Matter
Integer,ALLOCATABLE:: DomnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: DomTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: DomValue(:,:) !< value of each time-serie
Integer:: NuDLoadPom !< Number of cells with boundary condition of Particulated Organic Matter
Integer,ALLOCATABLE:: PomnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: PomTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: PomValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: DomSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: DomCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NDomIndex(:,:)
Integer,ALLOCATABLE:: PomSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: PomCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NPomIndex(:,:)
!6. PO4
!6.1 State variables
Real,ALLOCATABLE:: sPO4W(:,:) !<PO4 in the water at current time
Real,ALLOCATABLE:: sPO4WP(:,:) !<PO4 in the water at past time
Real,ALLOCATABLE:: sPO4S(:) !<PO4 in the sediment at current time
Real,ALLOCATABLE:: sPO4SP(:) !<PO4 in the sediment at past time
!6.2 Initial condition
Real sPO4W0 !<Initial condition of PO4 in the water (mgP/l)
Real sPO4S0 !<Initial condition of PO4 in the sediment (mgP/l)
!6.3 Boundary condition
Real,ALLOCATABLE:: uPLoadPO4(:,:) !< PO4 loading value
Integer:: NuPLoadPO4 !< Number of cells with boundary condition of PO4
Integer,ALLOCATABLE:: PO4nTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: PO4Time(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: PO4Value(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: PO4Smallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: PO4CapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NPO4Index(:,:)
!7. PAIM
!7.1 State variables
Real,ALLOCATABLE:: sPAIMW(:,:) !<PAIM in the water at current time
Real,ALLOCATABLE:: sPAIMWP(:,:) !<PAIM in the water at past time
Real,ALLOCATABLE:: sPAIMS(:) !<PAIM in the sediment at current time
Real,ALLOCATABLE:: sPAIMSP(:) !<PAIM in the sediment at past time
!7.2 Initial condition
Real sPAIMW0 !<Initial condition of PAIM in the water (mgP/l)
Real sPAIMS0 !<Initial condition of PAIM in the sediment (mgP/l)
!7.3 Boundary condition
Real,ALLOCATABLE:: uPLoadPAIM(:,:) !< PAIM loading value
Integer:: NuPLoadPAIM !< Number of cells with boundary condition of PAIM
Integer,ALLOCATABLE:: PAIMnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: PAIMTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: PAIMValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: PAIMSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: PAIMCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NPAIMIndex(:,:)
!8. NH4
!8.1 State variables
Real,ALLOCATABLE:: sNH4W(:,:) !<NH4 in the water at current time
Real,ALLOCATABLE:: sNH4WP(:,:) !<NH4 in the water at past time
Real,ALLOCATABLE:: sNH4S(:) !<NH4 in the sediment at current time
Real,ALLOCATABLE:: sNH4SP(:) !<NH4 in the sediment at past time
!8.2 Initial condition
Real sNH4W0 !<Initial condition of NH4 in the water (mgP/l)
Real sNH4S0 !<Initial condition of NH4 in the sediment (mgP/l)
!8.3 Boundary condition
Real,ALLOCATABLE:: uNLoadNH4(:,:) !< NH4 loading value
Integer:: NuNLoadNH4 !< Number of cells with boundary condition of NH4
Integer,ALLOCATABLE:: NH4nTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: NH4Time(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: NH4Value(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: NH4Smallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NH4CapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NNH4Index(:,:)
!9. NO3
!9.1 State variables
Real,ALLOCATABLE:: sNO3W(:,:) !<NO3 in the water at current time
Real,ALLOCATABLE:: sNO3WP(:,:) !<NO3 in the water at past time
Real,ALLOCATABLE:: sNO3S(:) !<NO3 in the sediment at current time
Real,ALLOCATABLE:: sNO3SP(:) !<NO3 in the sediment at past time
!9.2 Initial condition
Real sNO3W0 !<Initial condition of NO3 in the water (mgP/l)
Real sNO3S0 !<Initial condition of NO3 in the sediment (mgP/l)
!9.3 Boundary condition
Real,ALLOCATABLE:: uNLoadNO3(:,:) !< NO3 loading value
Integer:: NuNLoadNO3 !< Number of cells with boundary condition of NO3
Integer,ALLOCATABLE:: NO3nTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: NO3Time(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: NO3Value(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: NO3Smallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NO3CapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NNO3Index(:,:)
!10. SiO2
!10.1 State variables
Real,ALLOCATABLE:: sSiO2W(:,:) !<SiO2 in the water at current time
Real,ALLOCATABLE:: sSiO2WP(:,:) !<SiO2 in the water at past time
!10.2 Initial condition
Real sSiO2W0 !<Initial condition of SiO2 in the water (mgP/l)
!10.3 Boundary condition
Real,ALLOCATABLE:: uSiLoadSiO2(:,:) !< SiO2 loading value
Integer:: NuSiLoadSiO2 !< Number of cells with boundary condition of SiO2
Integer,ALLOCATABLE:: SiO2nTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: SiO2Time(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: SiO2Value(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: SiO2Smallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: SiO2CapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NSiO2Index(:,:)
!11. O2
!11.1 State variables
Integer:: iOxyBOD, iMetabO2
Real,ALLOCATABLE:: sO2W(:,:) !<O2 in the water at current time
Real,ALLOCATABLE:: sO2WP(:,:) !<O2 in the water at past time
!11.2 Initial condition
Real sO2W0 !<Initial condition of O2 in the water (mgP/l)
!11.3 Boundary condition
Real,ALLOCATABLE:: uO2LoadO2(:,:) !< O2 loading value
Integer:: NuO2LoadO2 !< Number of cells with boundary condition of O2
Integer,ALLOCATABLE:: O2nTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: O2Time(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: O2Value(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: O2Smallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: O2CapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NO2Index(:,:)
!12. BOD
!12.1 State variables
Real,ALLOCATABLE:: sDBOW(:,:) !<BOD in the water at current time
Real,ALLOCATABLE:: sDBOWP(:,:) !<BOD in the water at past time
!12.2 Initial condition
Real sDBOW0 !<Initial condition of BOD in the water (mgP/l)
!12.3 Boundary condition
Real,ALLOCATABLE:: uDLoadDBO(:,:) !< BOD loading value
Integer:: NuDBOLoadDBO !< Number of cells with boundary condition of BOD
Integer,ALLOCATABLE:: DBOnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: DBOTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: DBOValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: DBOSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: DBOCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NDBOIndex(:,:)
!13. DIC
!13.1 State variables
Integer:: iCarbon, iGHG, iMetabC
Real,ALLOCATABLE:: sDicW(:,:) !<DIC in the water at current time
Real,ALLOCATABLE:: sDicWP(:,:) !<DIC in the water at past time
!13.2 Initial condition
Real sDicW0 !<Initial condition of DIC in the water (mgP/l)
!13.3 Boundary condition
Real,ALLOCATABLE:: uDLoadDic(:,:) !< DIC loading value
Integer:: NuDicLoadDic !< Number of cells with boundary condition of DIC
Integer,ALLOCATABLE:: DicnTime(:) !< Number of lines in each time-serie
Real,ALLOCATABLE:: DicTime(:,:) !< unix time of each time-serie
Real,ALLOCATABLE:: DicValue(:,:) !< value of each time-serie
Integer,ALLOCATABLE:: DicSmallm(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: DicCapitalM(:) !< Number of lines in each time-serie
Integer,ALLOCATABLE:: NDicIndex(:,:)
!Mass Transport numerical scheme
Integer:: iTranspFlag
Integer:: iAdaptativeTimeStep
!------------------------------------------------------------------------------------------------------------------!
! M O D U L O E C O L O G I C O => B I O T I C O / A B I O T I C O !
!------------------------------------------------------------------------------------------------------------------!
!------------------------------------------------------------------------------------------------------------------!
! B I O T I C O !
!------------------------------------------------------------------------------------------------------------------!
!------------------------------------------------------------------------------------------------------------------!
! B A C T E R I O P L A N C T O N !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclBac
INTEGER nbac !numero de grupos funcionais de bacterioplancton simulados numa aplicacao
INTEGER nbacaer
INTEGER nbacanaer
INTEGER,ALLOCATABLE:: abac(:)
INTEGER:: AEROBICA = 1
INTEGER:: ANAEROBICA = 2
INTEGER:: BACTERIA = 3
!2)Parametros
Real,ALLOCATABLE:: cThetaBac(:) !parametro de limitacao para temperatura
Real pHmax,pHmin !parametros de limitacao para pH
Real hO2Bac,fbacAn,kbacAn !parametros de limitacao para OD
Real,ALLOCATABLE:: hAssBac(:) !parametros de limitacao para disponibilidade de DOM - conc meia-saturacao (mg/L)
Real,ALLOCATABLE:: cCDBacRef(:),cPDBacRef(:),cNDBacRef(:) !razoes de referencia para nutrientes internos bacteria
Real,ALLOCATABLE:: cPrefBacDom(:,:) !preferencia da bac por DOM
Real,ALLOCATABLE:: Ydom2bac(:,:) !eficiencia de conversao de DOM em BAC
Real,ALLOCATABLE:: MuBac(:) !taxa de crescimento (1/d)
Real,ALLOCATABLE:: kResbBac(:),fBac2CO2(:) !parametros de respiracao basal, atividade e fracao CO2
Real,ALLOCATABLE:: hPO4UptBac(:),hNH4UptBac(:) !conc meia-saturacao p/ consumo de nutrientes
Real,ALLOCATABLE:: kMortBac(:) !mortalidade
Real,ALLOCATABLE:: hSedBac(:) !meia-saturacao para sedimentacao
Real,ALLOCATABLE:: hBacMin(:)
Real fSiBac
!3)Condicoes Iniciais
Real,ALLOCATABLE:: sDBacW0(:) !Bacterioplancton na água (mgDW/l)
Real,ALLOCATABLE:: sDBacS0(:) !Bacterioplancton na sedimento (mgDW/l)
!4)Fluxos
Real,ALLOCATABLE:: wDAssBac(:,:,:), wCAssBac(:,:,:), wNAssBac(:,:,:), wPAssBac(:,:,:), wSiAssBac(:,:,:)
Real,ALLOCATABLE:: tDAssBac(:,:), tCAssBac(:,:), tNAssBac(:,:), tPAssBac(:,:)
Real,ALLOCATABLE:: wDAssBacDom(:,:,:,:),wCAssBacDom(:,:,:,:),wNAssBacDom(:,:,:,:),wPAssBacDom(:,:,:,:),wSiAssBacDom(:,:,:,:)
Real,ALLOCATABLE:: tDAssBacDom(:,:,:),tCAssBacDom(:,:,:),tNAssBacDom(:,:,:),tPAssBacDom(:,:,:)
Real:: wDRespbBac, wDRespaBac,tDRespbBac, tDRespaBac
Real,ALLOCATABLE:: wDRespBac(:,:,:), wCRespBac(:,:,:) , wCRespBac2CO2(:,:,:), wCRespBac2CH4(:,:,:)
Real,ALLOCATABLE:: tDRespBac(:,:), tCRespBac(:,:) , tCRespBac2CO2(:,:), tCRespBac2CH4(:,:)
Real,ALLOCATABLE:: wNExcrBac(:,:,:), wPExcrBac(:,:,:)
Real,ALLOCATABLE:: tNExcrBac(:,:), tPExcrBac(:,:)
Real,ALLOCATABLE:: wPUptBac(:,:,:), wNUptBac(:,:,:)
Real,ALLOCATABLE:: tPUptBac(:,:), tNUptBac(:,:)
Real,ALLOCATABLE:: wDMortBac(:,:,:), wCMortBac(:,:,:), wNMortBac(:,:,:), wPMortBac(:,:,:)
Real,ALLOCATABLE:: tDMortBac(:,:), tCMortBac(:,:), tNMortBac(:,:), tPMortBac(:,:)
Real,ALLOCATABLE:: tDSetBac(:,:,:), tCSetBac(:,:,:), tNSetBac(:,:,:), tPSetBac(:,:,:)
!5)Funcoes Auxiliares
Real:: aTLimMinBac
Real:: apHLimMinBac
Real:: aO2LimMinBac
Real:: aNutLimMinBac
Real:: aCorMinBac
Real,ALLOCATABLE:: oDFoodBacDom(:)
Real,ALLOCATABLE:: oDSetBacSum(:)
Real:: oDFoodBac
Real:: aDFoodSatBac
Real:: oDSetBac
!Real,ALLOCATABLE:: aDAssBacSub(:,:,:)
Real,ALLOCATABLE:: fDAssBacDom(:)
Real:: kCorResbBac
Real:: kCorMortBac
!7)Variaveis de Estado
Real,ALLOCATABLE:: sDBacW(:,:,:), sCBacW(:,:,:), sNBacW(:,:,:), sPBacW(:,:,:)
Real,ALLOCATABLE:: sDBacS(:,:), sCBacS(:,:), sNBacS(:,:), sPBacS(:,:)
Real,ALLOCATABLE:: sDBacWP(:,:,:),sCBacWP(:,:,:),sNBacWP(:,:,:),sPBacWP(:,:,:)
Real,ALLOCATABLE:: sDBacSP(:,:), sCBacSP(:,:), sNBacSP(:,:), sPBacSP(:,:)
Real,ALLOCATABLE:: rCDBacW(:,:,:),rNDBacW(:,:,:),rPDBacW(:,:,:)
Real,ALLOCATABLE:: rCDBacS(:,:), rNDBacS(:,:), rPDBacS(:,:)
!------------------------------------------------------------------------------------------------------------------!
! F I T O P L A N C T O N !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclPhyt !Incluir os três grupos de algas? Sim=1, Não=0
INTEGER nphy,nphydino,nphyfcyano,nphymcyano,nphychloro,nphycryto,nphymdiato,nphyfdiato !numero de grupos funcionais de fitoplancton simulados numa aplicacao
INTEGER,ALLOCATABLE:: aphy(:)
INTEGER LightMethodPhyt !
INTEGER:: DINOF = 1
INTEGER:: CYANO = 2
INTEGER:: NODUL = 3
INTEGER:: CHLOR = 4
INTEGER:: CRYPT = 5
INTEGER:: MDIAT = 6
INTEGER:: FDIAT = 7
!2)Parametros(pg)
!Produção primária
Real cExtWat !coeficiente de atenuação da luz na água (1/m)
Real cExtSpIM
Real,ALLOCATABLE:: cExtSpPom(:) !gpom
Real,ALLOCATABLE:: cExtSpDom(:) !gdom !coeficiente de atenuação da luz na água devido ao detritos (m²/gD)
Real,ALLOCATABLE:: cExtSpZoo(:) !gzoo !coeficiente de atenuação da luz na água devido ao detritos (m²/gD)
Real fPAR !Fração de radiação fotosinteticamente ativa (PAR)
Real fRefl !Fração da luz refletida na superfície (-)
Real:: cPACoefMin !coeficiente minimo de Poole-Atkins (1/dia)
Real:: cPACoefMax !coeficiente máximo de Poole-Atkins (1/dia)
Real:: hPACoef !constante de meia-saturação para o coef. de Poole-Atkins com materia organica (g/m²)
Real cfDayAve !fotoperíodo médio anual (h/24h)
Real cfDayVar !variação anual do fotoperíodo (h/24h)
Real,ALLOCATABLE:: cExtSpPhyt(:) !coeficiente de atenuação da luz na água devido a algas total (m²/gD)
Real,ALLOCATABLE:: hLRefPhyt(:) !meia-saturação do PAR para algas total a 20oC (W/m²)
Real,ALLOCATABLE:: cLOptRefPhyt(:) !otimo PAR (W/m²)
Real,ALLOCATABLE:: cMuMaxPhyt(:) !taxa máxima de crescimento das algas total (1/dia)
Real,ALLOCATABLE:: cChDPhytMax(:) !razão maxima Clorofila/D na algas total (mgChl/mgDW)
Real,ALLOCATABLE:: cChDPhytMin(:) !razão minima Clorofila/D na algas total (mgChl/mgDW)
Real,ALLOCATABLE:: hSiAssDiat(:) !meia-saturação de conc de Si para cresc. algal (mgSi/l)
!Consumo de Nutrientes
Real cTmRef !temperatura de referencia (oC)
Real,ALLOCATABLE:: cSigTmPhyt(:) !temperatura constante para Algas total-sigma na curva Gaussian (oC)
Real,ALLOCATABLE:: cTmOptPhyt(:) !temperatura otima para algas (oC)
Real,ALLOCATABLE:: cVCUptMaxPhyt(:) !Capacidade máxima de consumo de N pela algas total (mgN/mgDW/dia)
Real,ALLOCATABLE:: cVNUptMaxPhyt(:) !Capacidade máxima de consumo de N pela algas total (mgN/mgDW/dia)
Real,ALLOCATABLE:: cVPUptMaxPhyt(:) !Capacidade máxima de consumo de P pela algas total (mgP/mgDW/dia)
Real,ALLOCATABLE:: cVSiUptMaxPhyt(:) !Capacidade máxima de consumo de Si pela diatomáceas (mgN/mgDW/dia)
Real,ALLOCATABLE:: cCDPhytMin(:)
Real,ALLOCATABLE:: cCDPhytMax(:)
Real,ALLOCATABLE:: cNDPhytMax(:) !razão máxima N/D pela algas (mgN/mgDW)
Real,ALLOCATABLE:: cNDPhytMin(:) !razão mínima N/D pela algas (mgN/mgDW)
Real,ALLOCATABLE:: cPDPhytMax(:) !razão máxima P/D pela algas (mgP/mgDW)
Real,ALLOCATABLE:: cPDPhytMin(:) !razão mínima P/D pela algas (mgP/mgDW)
Real,ALLOCATABLE:: cSiDPhytMax(:) !razão máxima Si/D pela diatomaceas (mgSi/mgDW)
Real,ALLOCATABLE:: cSiDPhytMin(:) !razão mínima Si/D pela diatomaceas (mgSi/mgDW)
Real,ALLOCATABLE:: cAffCUptPhyt(:) !Afinidade de consumo de C para algas total (1/mgDW/dia)
Real,ALLOCATABLE:: cAffNUptPhyt(:) !Afinidade de consumo de N para algas total (1/mgDW/dia)
Real,ALLOCATABLE:: cAffPUptPhyt(:) !Afinidade de consumo de P para algas total (1/mgDW/dia)
Real,ALLOCATABLE:: cAffSiUptPhyt(:) !Afinidade de consumo de Si para diatomaceas (1/mgDW/dia)
!Exudacao
!Real,ALLOCATABLE:: cExdPhytW(:) !Fracao da prod primaria exudada como DOM(-)
!Respiração
Real,ALLOCATABLE:: kDRespbPhyt(:) !taxa de respiração basal para algas (1/dia)
Real,ALLOCATABLE:: alfap(:) !parcela da prod primaria respirada como CO2 (-)
!Sedimentação
Real,ALLOCATABLE:: cVSetPhyt(:) !velocidade de sedimentação para as algas total (m/dia)
!Lise
Real,ALLOCATABLE:: cCDPhytOpt(:)
Real,ALLOCATABLE:: cPDPhytOpt(:)
Real,ALLOCATABLE:: cNDPhytOpt(:)
Real,ALLOCATABLE:: cSiDPhytOpt(:)
Real,ALLOCATABLE:: cLisPhytW(:)
!Real,ALLOCATABLE:: hLisNutPhyt(:) !taxa de mortalidade das algas na água (1/dia)
Real,ALLOCATABLE:: cLisPhytS(:) !taxa de mortalidade das algas no Sed (1/dia)
!3)Condicoes Iniciais
Real,ALLOCATABLE:: sDPhytW0(:) !fitoplancton na água (mgDW/l)
Real,ALLOCATABLE:: sDPhytS0(:) !fitoplancton no sedimento (mgDW/l)
!4)Fluxos - Agua(K,gg),Sed(K,gg)
!Consumo de nutrientes
Real,ALLOCATABLE:: wCUptPhyt(:,:,:),wNUptPhyt(:,:,:),wPUptPhyt(:,:,:),wSiUptPhyt(:,:,:) !fluxo de consumo total (gP/m³/d)
Real,ALLOCATABLE:: wNUptNH4Phyt(:,:,:),wNUptNO3Phyt(:,:,:) !fluxo de consumo total de NO3 (gN/m³/d)
!Produção Primária
Real,ALLOCATABLE:: wDAssPhyt(:,:,:)
!Exudacao/Respiração
Real:: wDRespbPhyt,wDResppPhyt !basal, fotossintetica
Real,ALLOCATABLE:: wDRespPhyt(:,:,:), wCExcrPhytW(:,:,:), wPExcrPhytW(:,:,:), wNExcrPhytW(:,:,:)
Real,ALLOCATABLE:: tDRespPhytS(:,:), tCExcrPhytS(:,:), tPExcrPhytS(:,:), tNExcrPhytS(:,:)
!Resuspensão
Real:: akResusPhytRef
Real,ALLOCATABLE:: tDResusPhyt(:,:),tCResusPhyt(:,:),tPResusPhyt(:,:),tNResusPhyt(:,:),tSiResusPhyt(:,:)
!Sedimentação
Real,ALLOCATABLE:: uCorVSetPhyt(:),StokesVelPhyt(:,:),ppPhyt(:),diPhyt(:)
Real,ALLOCATABLE:: tDSetPhyt(:,:,:) !,tCSetPhyt(:,:),tPSetPhyt(:,:),tNSetPhyt(:,:),tSiSetPhyt(:,:)
!Lise
Real,ALLOCATABLE:: wDLisPhyt(:,:,:), wCLisPhyt(:,:,:), wNLisPhyt(:,:,:), wPLisPhyt(:,:,:), wSiLisPhyt(:,:,:)
!Real,ALLOCATABLE:: wPLisPhytPO4W(:,:,:),wNLisPhytNH4W(:,:,:),wCLisPhytCO2W(:,:,:)
!Real,ALLOCATABLE:: wDLisPomPhyt(:,:,:),wCLisPomPhyt(:,:,:),wNLisPomPhyt(:,:,:),wPLisPomPhyt(:,:,:),wSiLisPomPhyt(:,:,:)
!Real,ALLOCATABLE:: wDLisDomPhyt(:,:,:),wCLisDomPhyt(:,:,:),wNLisDomPhyt(:,:,:),wPLisDomPhyt(:,:,:),wSiLisDomPhyt(:,:,:)
Real,ALLOCATABLE:: tDLisPhytS(:,:), tCLisPhytS(:,:), tNLisPhytS(:,:), tPLisPhytS(:,:), tSiLisPhytS(:,:)
Real,ALLOCATABLE:: tDLisPomPhytS(:,:), tCLisPomPhytS(:,:), tNLisPomPhytS(:,:), tPLisPomPhytS(:,:), tSiLisPomPhytS(:,:)
Real,ALLOCATABLE:: tDLisDomPhytS(:,:), tCLisDomPhytS(:,:), tNLisDomPhytS(:,:), tPLisDomPhytS(:,:), tSiLisDomPhytS(:,:)
!5)Funcoes Auxiliares(gg)
!Consumo de nutrientes
Real:: uFunTmPhyt !função de temperatura para algas (-)
Real:: aVCUptMaxCorPhyt !taxa de consumo máxima (mgC/mgD/d)
Real:: aVNUptMaxCorPhyt !taxa de consumo máxima (mgN/mgD/d)
Real:: aVPUptMaxCorPhyt !taxa de consumo máxima (mgP/mgD/d)
Real:: aVSiUptMaxCorPhyt !taxa de consumo máxima (mgSi/mgD/d)
Real:: aVCUptPhyt !taxa de consumo de C especifica (mgC/mgD/d)
Real:: aVNUptPhyt !taxa de consumo de N especifica (mgN/mgD/d)
Real:: aVPUptPhyt !taxa de consumo de P especifica (mgP/mgD/d)
Real:: aVSiUptPhyt !taxa de consumo de Si especifica (mgSi/mgD/d)
Real:: ahPUptPhyt !concentração SRP de meia-saturação (mgP/l)
Real:: ahNUptPhyt !concentração SRN de meia-saturação (mgN/l)
Real:: afNH4UptPhyt !Fração de N absorvido como amonia
!Produção Primária
Real ufDay
Real aExtVeg,aPACoef
Real,ALLOCATABLE:: aExtIM(:,:),aExtPom(:,:,:),aExtDom(:,:,:),aExtZoo(:,:,:),aExtPhyt(:,:,:),aExtCoefOpen(:,:)
Real,ALLOCATABLE:: aExtCoef(:,:),aSecchi(:,:)
Real,ALLOCATABLE:: uLPAR0(:),aLPARBot(:)
Real:: aLLimPhyt,uhLPhyt
Real:: aMuTmLPhyt
Real aCLimPhyt,aPLimPhyt,aNLimPhyt,aSiLimPhyt
Real aNutLimPhyt,aMuPhyt
Real,ALLOCATABLE:: rChDPhyt(:)
!Respiração
Real ukDRespbTmPhyt
!Lise
!Real,ALLOCATABLE:: aCLisPhyt(:), aPLisPhyt(:), aNLisPhyt(:), aSiLisPhyt(:)
!Real,ALLOCATABLE:: aCLisPhytS(:),aPLisPhytS(:),aNLisPhytS(:),aSiLisPhytS(:)
!Real,ALLOCATABLE:: aNutLisPhyt(:), aLisPomPhyt(:)
!Real,ALLOCATABLE:: aNutLisPhytS(:),aLisPomPhytS(:)
!6)Derivadas
Real,ALLOCATABLE:: dDPhytW(:), dCPhytW(:), dNPhytW(:), dPPhytW(:), dSiPhytW(:)
Real,ALLOCATABLE:: dDPhytS(:), dCPhytS(:), dNPhytS(:), dPPhytS(:), dSiPhytS(:)
!7)Variaveis de Estado
Real,ALLOCATABLE:: sDPhytW(:,:,:), sCPhytW(:,:,:), sNPhytW(:,:,:), sPPhytW(:,:,:), sSiPhytW(:,:,:)
Real,ALLOCATABLE:: sDPhytS(:,:), sCPhytS(:,:), sNPhytS(:,:), sPPhytS(:,:), sSiPhytS(:,:)
Real,ALLOCATABLE:: sDPhytWP(:,:,:),sCPhytWP(:,:,:),sNPhytWP(:,:,:),sPPhytWP(:,:,:),sSiPhytWP(:,:,:)
Real,ALLOCATABLE:: sDPhytSP(:,:), sCPhytSP(:,:), sNPhytSP(:,:), sPPhytSP(:,:), sSiPhytSP(:,:)
Real,ALLOCATABLE:: rCDPhytW(:,:,:),rNDPhytW(:,:,:),rPDPhytW(:,:,:),rSiDPhytW(:,:,:)
Real,ALLOCATABLE:: rCDPhytS(:,:), rNDPhytS(:,:), rPDPhytS(:,:), rSiDPhytS(:,:)
!------------------------------------------------------------------------------------------------------------------!
! M A C R O F I T A S !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclMacr
INTEGER nmac,nmacElod,nmacCharo,nmacCera,nmacLemna,nmacNymp,nmacHelo,nmacGeral !numero de grupos funcionais de macrofitas simulados numa aplicacao
INTEGER,ALLOCATABLE:: amac(:)
INTEGER:: ELOD = 1 !Submersas
INTEGER:: CHARO = 2 !Submersas
INTEGER:: CERA = 3 !Nao enraizadas
INTEGER:: LEMNA = 4 !Nao enraizadas
INTEGER:: NYMP = 5 !Flutuantes
INTEGER:: HELO = 6 !Emergentes
INTEGER:: MACR = 7 !Geral
!2)Parametros(mg)
!Produção primária
Real,ALLOCATABLE:: cTmInitVeg(:) !temperature for initial growth
Real,ALLOCATABLE:: fRootVegWin(:)
Real,ALLOCATABLE:: fRootVegSum(:)
Real,ALLOCATABLE:: fEmergVeg(:)
Real,ALLOCATABLE:: cDLayerVeg(:)
Real,ALLOCATABLE:: fFloatVeg(:)
Real,ALLOCATABLE:: cCovSpVeg(:)
!Real,ALLOCATABLE:: cExtSpMac !coeficiente de atenuação da luz na água devido a vegetação (m²/gD)
! Real,ALLOCATABLE:: cCovSpMac !cobertura por gD/m² de elodea (%)
Real,ALLOCATABLE:: cMuMaxMac(:) !taxa máxima de crescimento da Elodea (1/dia)
!Real,ALLOCATABLE:: fDepth1Mac !limite maximo da planta, como fração da profundidade da água
!Real,ALLOCATABLE:: fDepth2Mac !limite minimo da planta, como fração da profundidade da água
Real,ALLOCATABLE:: hLRefMac(:) !meia-saturação da luz à 20oC (W/m² PAR)
Real,ALLOCATABLE:: cDCarrMac(:) !Capacidade de crescimento maxima (gD/m²)
!Real,ALLOCATABLE:: cDLayerMac !biomassa de uma simples camada de folhas flutuantes (gD/m²)
!Real,ALLOCATABLE:: fEmergMac
Real,ALLOCATABLE:: fSedUptVegMax(:)
Real,ALLOCATABLE:: fSedUptVegCoef(:)
Real,ALLOCATABLE:: fSedUptVegExp(:)
!Consumo de Nutrientes
Real,ALLOCATABLE:: cQ10ProdMac(:) !expoente de produção para a temperatura (-)
Real,ALLOCATABLE:: cVCUptMaxMac(:) !Capacidade máxima de consumo de C (mgN/mgD/dia)
Real,ALLOCATABLE:: cVNUptMaxMac(:) !Capacidade máxima de consumo de N (mgN/mgD/dia)
Real,ALLOCATABLE:: cVPUptMaxMac(:) !Capacidade máxima de consumo de P (mgP/mgD/dia)
Real,ALLOCATABLE:: cAffCUptMac(:) !Afinidade máxima de consumo de C (1/mgD/dia)
Real,ALLOCATABLE:: cAffNUptMac(:) !Afinidade máxima de consumo de N (1/mgD/dia)
Real,ALLOCATABLE:: cAffPUptMac(:) !Afinidade máxima de consumo de P (1/mgD/dia)
Real,ALLOCATABLE:: hCRoot(:),hCShoot(:) !conc de meia-saturacao para a assimilacao de C roots e shoot (mgC/L,gC/m3)
Real,ALLOCATABLE:: hNShoot(:),hNRoot(:) !conc de meia-saturacao para a assimilacao de N roots e shoot (mgN/L,gN/m3)
Real,ALLOCATABLE:: hPShoot(:),hPRoot(:) !conc de meia-saturacao para a assimilacao de P roots e shoot (mgP/L,gP/m3)
Real,ALLOCATABLE:: hNSatMac(:) !conc de satutacao de N (mgN/L,gN/m3)
Real,ALLOCATABLE:: cCDMacMax(:) !razão C/D máxima (mgC/mgD)
Real,ALLOCATABLE:: cCDMacMin (:) !razão C/D minima (mgC/mgD)
Real,ALLOCATABLE:: cNDMacMax(:) !razão N/D máxima (mgN/mgD)
Real,ALLOCATABLE:: cNDMacMin(:) !razão N/D minima (mgN/mgD)
Real,ALLOCATABLE:: cPDMacMax(:) !razão P/D máxima (mgP/mgD)
Real,ALLOCATABLE:: cPDMacMin(:) !razão P/D minima (mgP/mgD)
!Exudacao
Real,ALLOCATABLE:: fExdMac(:) !parcela da prod primaria exudada como DOM (-)
!Respiração
Real,ALLOCATABLE:: cQ10RespMac(:) !expoente de produção para a temperatura (-)
Real,ALLOCATABLE:: kDRespMac(:) !taxa de respiração no escuro (1/dia)
Real,ALLOCATABLE:: fPhotoRespMac(:) !parcela da prod primaria respirada como CO2 (-)
!Mortalidade
Real,ALLOCATABLE:: cSigTmMac(:),cTmOptMac(:) !Parametros da curva de gauss para representacao do aumento da mortalidade de MAC durante o inverno (celsius)
Real,ALLOCATABLE:: kMortMac(:) !taxa de mortalidade de vegetação
!Consumo por aves
Real,ALLOCATABLE:: hDMacBird(:) !meia-saturação de biomassa
Real,ALLOCATABLE:: cPrefMacBird(:) !comestível por aves
Real cBirdsPerha !Numéros de aves por ha do lago
Real,ALLOCATABLE:: cDGrazPerBird(:) !consumo diario de macrofitas pelas aves
Real,ALLOCATABLE:: fDAssBird(:) !Eficiencia de assimilação das aves
!Shoot<->Root
Real,ALLOCATABLE:: kroot2shoot(:) !taxa de realocacao de biomassa Shoot<->Root (1/dia)
!3)Condicoes Iniciais (mm)
Real,ALLOCATABLE:: sDMac0(:) ! biomassa de MAC(gD/m²)
Real,ALLOCATABLE:: cCDMac0(:) ! (gC/gD)
Real,ALLOCATABLE:: cNDMac0(:) ! (gN/gD)
Real,ALLOCATABLE:: cPDMac0(:) ! (gP/gD)
Real,ALLOCATABLE:: hmac(:) ! prof máxima com presenca de MAC
!4)Fluxos (mm)
!Consumo de Nutrientes
Real,ALLOCATABLE:: tCUptMacW(:,:),tNUptMacW(:,:),tPUptMacW(:,:),tNUptNH4MacW(:,:),tNUptNO3MacW(:,:)
Real,ALLOCATABLE:: tCUptMacS(:,:),tNUptMacS(:,:),tPUptMacS(:,:),tNUptNH4MacS(:,:),tNUptNO3MacS(:,:)
!Produção Primária
Real:: tDEnvMac, tDEnvProdMac,tDEnvMortMac
Real,ALLOCATABLE:: tDProdMac(:,:)
!Exudacao
Real,ALLOCATABLE:: tCExdMac(:,:),tNExdMac(:,:),tPExdMac(:,:)
Real,ALLOCATABLE:: tCExdMacW(:,:),tNExdMacW(:,:),tPExdMacW(:,:)
Real,ALLOCATABLE:: tCExdMacS(:,:),tNExdMacS(:,:),tPExdMacS(:,:)
!Respiração
Real,ALLOCATABLE:: tDRespMac(:,:),tCRespMac(:,:)
Real,ALLOCATABLE:: tDRespMacW(:,:)
Real,ALLOCATABLE:: tDRespMacS(:,:)
!Mortalidade
Real,ALLOCATABLE:: tDMortMac(:,:),tCMortMac(:,:),tNMortMac(:,:),tPMortMac(:,:)
Real,ALLOCATABLE:: tDMortMacW(:,:),tCMortMacW(:,:),tNMortMacW(:,:),tPMortMacW(:,:)
Real,ALLOCATABLE:: tDMortMacS(:,:),tCMortMacS(:,:),tNMortMacS(:,:),tPMortMacS(:,:)
!Consumo por aves
Real,ALLOCATABLE:: tDGrazMacBird(:,:),tCGrazMacBird(:,:),tNGrazMacBird(:,:),tPGrazMacBird(:,:)
Real,ALLOCATABLE:: tDEgesBird(:,:),tCEgesBird(:,:),tNEgesBird(:,:),tPEgesBird(:,:)
!oxygen
Real,ALLOCATABLE:: tO2UptNO3MacW(:,:)
Real,ALLOCATABLE:: tO2RespMacW(:,:)
Real,ALLOCATABLE:: tO2RespMacS(:,:)
Real,ALLOCATABLE:: tO2ProdMac(:,:)
Real,ALLOCATABLE:: tO2ProdMacW(:,:)
Real,ALLOCATABLE:: tO2ProdMacS(:,:)
!5)Funcoes Auxiliares (mm)
!Consumo de Nutrientes
Real:: uFunTmProdMac, uFunTmRespMac
Real:: afCovSurfVeg
Real:: aDayInitVeg,bfShootVeg,bfRootVeg,aDRootVeg,aDShootVeg,bfSubVeg,aDSubVeg,aDEmergVeg,aDFloatVeg,afCovEmergVeg,aCovVeg
Real:: afCUptVegS,afNUptVegS,afPUptVegS
Real:: aVCUptMaxCorMac,aVNUptMaxCorMac,aVPUptMaxCorMac
Real:: aVCUptMacW,aVNUptMacW,aVPUptMacW
Real:: aVCUptMacS,aVNUptMacS,aVPUptMacS
Real:: ahCUptMac,ahNUptMac,ahPUptMac
Real:: afNH4UptMacW
Real:: afNH4UptMacS
!Produção Primária
Real:: uMuMaxTmMac, aLPAR1Mac, aLPAR2Mac, uhLMac, aFunLSubMac
Real:: aMuTmLMac, aCLimMac,aPLimMac, aNLimMac, aNutLimMac
Real:: aMuMac, akDIncrMac
!Respiração
Real,ALLOCATABLE:: ukDRespTmMac
!Mortalidade
Real:: bkMortMac
!7)Variaveis de Estado (I,J,mm)
!Total
Real,ALLOCATABLE:: sDMac(:,:), sCMac(:,:), sNMac(:,:), sPMac(:,:)
Real,ALLOCATABLE:: sDMacP(:,:), sCMacP(:,:), sNMacP(:,:), sPMacP(:,:)
!Razao P/D de macrofitas na água (gP/gD)
Real,ALLOCATABLE:: rCDMac(:,:), rNDMac(:,:), rPDMac(:,:)
!------------------------------------------------------------------------------------------------------------------!
! Z O O P L A N C T O N !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclZoo !Incluir zooplântons? Sim=1, Não=0
INTEGER InclZooDist
INTEGER zzaux,zgaux
INTEGER nzoo,nzoomicro,nzoomeso,nzoomacro !numero de grupos funcionais de zooplancton simulados numa aplicacao
INTEGER,ALLOCATABLE:: azoo(:)
INTEGER:: MACRO = 1
INTEGER:: MESO = 2
INTEGER:: MICRO = 3
INTEGER:: ZOOP = 4
!2)Parametros(zg)
Real,ALLOCATABLE:: cSigTmZoo(:),cTmOptZoo(:)
Real,ALLOCATABLE:: fDAssZoo(:)
Real,ALLOCATABLE:: cPrefZooZoo(:,:) !(gzoo,gzoo)
Real,ALLOCATABLE:: cPrefZooPhyt(:,:) !(gzoo,gphy)
Real,ALLOCATABLE:: cPrefZooBac(:,:) !(gzoo,gbaz)
Real,ALLOCATABLE:: cPrefZooPom(:,:) !(gzoo,gpom)
Real,ALLOCATABLE:: cDCarrZoo(:) !(gzoo)
Real,ALLOCATABLE:: hFilt(:) !(gzoo)
Real,ALLOCATABLE:: cFiltMax(:) !(gzoo)
Real,ALLOCATABLE:: kDRespZoo(:) !(gzoo)
!Real,ALLOCATABLE:: fDMessyZoo(:) !(gzoo)
Real,ALLOCATABLE:: kPelZoo(:) !(gzoo)
Real,ALLOCATABLE:: kMortZoo(:) !(gzoo)
Real,ALLOCATABLE:: cCDZooRef(:) !(gzoo)
Real,ALLOCATABLE:: cNDZooRef(:) !(gzoo)
Real,ALLOCATABLE:: cPDZooRef(:) !(gzoo)
Real zooMinBiomass
Real,ALLOCATABLE:: ODmin(:)
!3)Condicoes Iniciais(zz)
Real,ALLOCATABLE:: sDZoo0(:) !zooplancton (mgDW/l)
!4)Fluxos(K,zz) ou (K,zz,presa)
Real,ALLOCATABLE:: wDGrzZoo(:,:), wCGrzZoo(:,:), wNGrzZoo(:,:), wPGrzZoo(:,:)
Real,ALLOCATABLE:: wDAssZoo(:,:,:), wCAssZoo(:,:,:), wNAssZoo(:,:,:), wPAssZoo(:,:,:)
Real:: wDEnvZoo
Real:: wDConsZoo,wCConsZoo,wNConsZoo,wPConsZoo
Real,ALLOCATABLE:: wDGrzZooZoo(:,:,:,:), wCGrzZooZoo(:,:,:,:), wNGrzZooZoo(:,:,:,:), wPGrzZooZoo(:,:,:,:)
Real,ALLOCATABLE:: wDGrzZooPhyt(:,:,:,:),wCGrzZooPhyt(:,:,:,:),wNGrzZooPhyt(:,:,:,:),wPGrzZooPhyt(:,:,:,:),wSiGrzZooPhyt(:,:,:,:)
Real,ALLOCATABLE:: wDGrzZooBac(:,:,:,:), wCGrzZooBac(:,:,:,:), wNGrzZooBac(:,:,:,:), wPGrzZooBac(:,:,:,:)
Real,ALLOCATABLE:: wDGrzZooPom(:,:,:,:), wCGrzZooPom(:,:,:,:), wNGrzZooPom(:,:,:,:), wPGrzZooPom(:,:,:,:)
Real,ALLOCATABLE:: wDRespZoo(:,:,:),wCRespZoo(:,:,:)
Real,ALLOCATABLE:: wDEgesZoo(:,:,:), wCEgesZoo(:,:,:), wNEgesZoo(:,:,:), wPEgesZoo(:,:,:)
Real,ALLOCATABLE:: wDMortZoo(:,:,:), wCMortZoo(:,:,:), wNMortZoo(:,:,:), wPMortZoo(:,:,:)
Real,ALLOCATABLE:: wNExcrZoo(:,:,:), wPExcrZoo(:,:,:)
Real,ALLOCATABLE:: wDMessZooOM(:,:,:), wCMessZooOM(:,:,:), wNMessZooOM(:,:,:), wPMessZooOM(:,:,:)
!5)Funcoes Auxiliares(zz)
Real:: aFilt
Real:: uFunTmZoo,aDSatZoo
Real:: oDFoodZooZoo,oDFoodZooPhyt,oDFoodZooBac,oDFoodZooPom
Real:: oDFoodZoo,oCFoodZoo,oNFoodZoo,oPFoodZoo
Real,ALLOCATABLE:: aDSatFoodZoo(:)
Real,ALLOCATABLE:: fDGrzZooZoo(:,:),fDGrzZooPhyt(:,:),fDGrzZooBac(:,:),fDGrzZooPom(:,:)
Real:: ukDRespTmZoo,aCorDRespZoo
Real:: ukDAssTmZoo
Real:: ukDIncrZoo
Real,ALLOCATABLE:: akCExcrZoo(:),akNExcrZoo(:),akPExcrZoo(:)
Real:: afCAssZoo ,afNAssZoo ,afPAssZoo
Real:: rCDFoodZoo,rNDFoodZoo,rPDFoodZoo
!7)Variaveis de Estado(I,J,K,zz)
Real,ALLOCATABLE:: sDZoo(:,:,:), sCZoo(:,:,:), sNZoo(:,:,:), sPZoo(:,:,:)
Real,ALLOCATABLE:: sDZooP(:,:,:), sCZooP(:,:,:), sNZooP(:,:,:), sPZooP(:,:,:)
Real,ALLOCATABLE:: rCDZoo(:,:,:), rNDZoo(:,:,:), rPDZoo(:,:,:)
!------------------------------------------------------------------------------------------------------------------!
! Z O O B E N T O S !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclBent !Incluir Macrobentos? Sim=1, Não=0
INTEGER nben,nbenmicro,nbenmeso,nbenmacro !numero de grupos funcionais de zoobentos simulados numa aplicacao
INTEGER,ALLOCATABLE:: aben(:)
INTEGER:: BENTOS=1
!2)Parametros(beng)
Real,ALLOCATABLE:: cSigTmBent(:),cTmOptBent(:)
Real,ALLOCATABLE:: cPrefBentPhyt(:,:) !(gben,gphy)
Real,ALLOCATABLE:: cPrefBentBac(:,:) !(gben,gbac)
Real,ALLOCATABLE:: cPrefBentPom(:,:) !gben,gpom
Real,ALLOCATABLE:: hDFoodBent(:)
Real,ALLOCATABLE:: kDAssBent(:)
Real,ALLOCATABLE:: cDCarrBent(:)
Real,ALLOCATABLE:: fDAssBent(:)
Real,ALLOCATABLE:: kDRespBent(:)
Real,ALLOCATABLE:: kPelBent(:)
Real,ALLOCATABLE:: kMortBent(:)
Real,ALLOCATABLE:: cCDBentRef(:)
Real,ALLOCATABLE:: cNDBentRef(:)
Real,ALLOCATABLE:: cPDBentRef(:)
!3)Condicoes Iniciais(ben)
Real,ALLOCATABLE:: sDBent0(:) !Bentos (mgDW/m²)
!4)Fluxos(ben)
Real,ALLOCATABLE:: tDGrzBent(:), tCGrzBent(:), tNGrzBent(:), tPGrzBent(:)
Real,ALLOCATABLE:: tDGrzBentPhyt(:,:,:),tCGrzBentPhyt(:,:,:),tNGrzBentPhyt(:,:,:),tPGrzBentPhyt(:,:,:),tSiGrzBentPhyt(:,:,:)
Real,ALLOCATABLE:: tDGrzBentBac(:,:,:), tCGrzBentBac(:,:,:), tNGrzBentBac(:,:,:), tPGrzBentBac(:,:,:)
Real,ALLOCATABLE:: tDGrzBentPom(:,:,:), tCGrzBentPom(:,:,:), tNGrzBentPom(:,:,:), tPGrzBentPom(:,:,:)
Real,ALLOCATABLE:: tDRespBent(:,:), tCRespBent(:,:)
Real,ALLOCATABLE:: tDEgesBent(:,:), tCEgesBent(:,:), tNEgesBent(:,:), tPEgesBent(:,:)
Real,ALLOCATABLE:: tDMortBent(:,:), tCMortBent(:,:), tNMortBent(:,:), tPMortBent(:,:)
Real,ALLOCATABLE:: tNExcBent(:,:), tPExcBent(:,:)
Real,ALLOCATABLE:: tDMessBentOM(:,:), tCMessBentOM(:,:), tNMessBentOM(:,:), tPMessBentOM(:,:)
!5)Funcoes Auxiliares(ben)
Real:: uFunTmBent
Real:: oDFoodBentPhyt,oDFoodBentBac,oDFoodBentPom
Real:: oDFoodBent,oCFoodBent,oNFoodBent,oPFoodBent
Real:: aDSatFoodBent
Real:: fDGrzBentPhyt,fDGrzBentBac,fDGrzBentPom
Real:: ukDRespTmBent,aCorDRespBent
Real:: aDSatBent
Real:: ukDIncrBent,tDEnvBent,tDConsBent,tDAssBent,tCAssBent,tNAssBent,tPAssBent
Real:: rCDFoodBent,tCConsBent,afCAssBent,rNDFoodBent,tNConsBent,afNAssBent,rPDFoodBent,tPConsBent,afPAssBent
!7)Variaveis de Estado(I,J,ben)
Real,ALLOCATABLE:: sDBent(:,:), sCBent(:,:), sNBent(:,:), sPBent(:,:) !Zoobentos (g/m²)
Real,ALLOCATABLE:: sDBentP(:,:), sCBentP(:,:), sNBentP(:,:), sPBentP(:,:) !Zoobentos (g/m²)
Real,ALLOCATABLE:: rCDBent(:,:), rNDBent(:,:), rPDBent(:,:) !Razao P/D e N/D de Zooplancton e Bentos na água (gP/gD)
!------------------------------------------------------------------------------------------------------------------!
! P E I X E S !
!------------------------------------------------------------------------------------------------------------------!
!1)Configuracoes Iniciais
INTEGER InclFish !Incluir Peixes? Sim=1, Não=0
INTEGER iFishMov !Include Fish movement?
INTEGER iFishRefuge !Include Fish refuge?
INTEGER iFishStage !Include Stage of Live (Juvenile and Adult)?
INTEGER ffaux,fgaux
INTEGER nfish,nfishomniv,nfishplank,nfishpisc !numero de grupos funcionais de peixes simulados numa aplicacao
INTEGER,ALLOCATABLE:: afish(:)
!2)Parametros
!Migration
Real,ALLOCATABLE:: kMigrFiAd(:)
Real,ALLOCATABLE:: cDFiAdIn(:)
Real,ALLOCATABLE:: kMigrFiJv(:)
Real,ALLOCATABLE:: cDFiJvIn(:)
!Reproduction/Aging
Real,ALLOCATABLE:: cDayReprFish(:)
Real,ALLOCATABLE:: fReprFish(:)
Real,ALLOCATABLE:: fAgeFish(:)
Real,ALLOCATABLE:: cRelVegFish(:)
Real,ALLOCATABLE::cSigTmFish(:),cTmOptFish(:)
! Real cTmRef
Real,ALLOCATABLE:: cPrefFiAdFiAd(:,:) !(gfish,gfish)
Real,ALLOCATABLE:: cPrefFiAdFiJv(:,:) !(gfish,gfish)
Real,ALLOCATABLE:: cPrefFiAdZoo(:,:) !(gfish,gzoo)
Real,ALLOCATABLE:: cPrefFiJvZoo(:,:) !(gfish,gzoo)
Real,ALLOCATABLE:: cPrefFiAdPhyt(:,:) !(gfish,gphy)
Real,ALLOCATABLE:: cPrefFiJvPhyt(:,:) !(gfish,gphy)
!Real,ALLOCATABLE:: cPrefFishBac(:,:) !(gfish,gbac)
Real,ALLOCATABLE:: cPrefFiAdBent(:,:) !(gfish,gben)
Real,ALLOCATABLE:: cPrefFiJvBent(:,:) !(gfish,gben)
Real,ALLOCATABLE:: cPrefFiAdPom(:,:) !(gfish,gpom)
Real,ALLOCATABLE:: cPrefFiJvPom(:,:) !(gfish,gpom)
Real,ALLOCATABLE:: hDFiAd(:)
Real,ALLOCATABLE:: hDFiJv(:)
Real,ALLOCATABLE:: kDAssFiAd(:)
Real,ALLOCATABLE:: kDAssFiJv(:)
Real,ALLOCATABLE:: fDAssFiAd(:)
Real,ALLOCATABLE:: fDAssFiJv(:)
Real,ALLOCATABLE:: kHarvFiAd(:)
Real,ALLOCATABLE:: kHarvFiJv(:)
Real,ALLOCATABLE:: kDRespFiAd(:)
Real,ALLOCATABLE:: kDRespFiJv(:)
!Real,ALLOCATABLE:: fDMessyFiAd(:)
!Real,ALLOCATABLE:: fDMessyFiJv(:)
Real,ALLOCATABLE:: kPelFiAd(:)
Real,ALLOCATABLE:: kPelFiJv(:)
Real,ALLOCATABLE:: kMortFiAd(:)
Real,ALLOCATABLE:: kMortFiJv(:)
Real,ALLOCATABLE:: cDCarrFish(:)
Real,ALLOCATABLE:: cCDFishRef(:)
Real,ALLOCATABLE:: cNDFishRef(:)
Real,ALLOCATABLE:: cPDFishRef(:)
Real :: fishMinBiomass
!3)Condicoes Iniciais
Real,ALLOCATABLE:: sDFiAd0(:) !Piscivoro jovem (mgDW/m²)
Real,ALLOCATABLE:: sDFiJv0(:) !Piscivoro jovem (mgDW/m²)
!4)Fluxos
Real:: wDConsFiAd,wCConsFiAd,wNConsFiAd,wPConsFiAd
Real:: wDConsFiJv,wCConsFiJv,wNConsFiJv,wPConsFiJv
Real,ALLOCATABLE:: wDMigrFiAd(:) ,wCMigrFiAd(:) ,wNMigrFiAd(:) ,wPMigrFiAd(:)
Real,ALLOCATABLE:: wDMigrFiJv(:) ,wCMigrFiJv(:) ,wNMigrFiJv(:) ,wPMigrFiJv(:)
Real,ALLOCATABLE:: wDReprFish(:) ,wCReprFish(:) ,wNReprFish(:) ,wPReprFish(:)
Real,ALLOCATABLE:: wDAgeFish(:) ,wCAgeFish(:) ,wNAgeFish(:) ,wPAgeFish(:)
Real,ALLOCATABLE:: wDAssFiAd(:,:,:),wCAssFiAd(:,:,:),wNAssFiAd(:,:,:),wPAssFiAd(:,:,:)
Real,ALLOCATABLE:: wDAssFiJv(:,:,:),wCAssFiJv(:,:,:),wNAssFiJv(:,:,:),wPAssFiJv(:,:,:)
Real,ALLOCATABLE:: wDGrzFiAdFiAd(:,:,:,:),wCGrzFiAdFiAd(:,:,:,:),wNGrzFiAdFiAd(:,:,:,:),wPGrzFiAdFiAd(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiAdFiJv(:,:,:,:),wCGrzFiAdFiJv(:,:,:,:),wNGrzFiAdFiJv(:,:,:,:),wPGrzFiAdFiJv(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiAdZoo(:,:,:,:) ,wCGrzFiAdZoo(:,:,:,:) ,wNGrzFiAdZoo(:,:,:,:) ,wPGrzFiAdZoo(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiJvZoo(:,:,:,:) ,wCGrzFiJvZoo(:,:,:,:) ,wNGrzFiJvZoo(:,:,:,:) ,wPGrzFiJvZoo(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiAdBent(:,:,:,:) ,wCGrzFiAdBent(:,:,:,:) ,wNGrzFiAdBent(:,:,:,:) ,wPGrzFiAdBent(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiJvBent(:,:,:,:) ,wCGrzFiJvBent(:,:,:,:) ,wNGrzFiJvBent(:,:,:,:) ,wPGrzFiJvBent(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiAdPhyt(:,:,:,:),wCGrzFiAdPhyt(:,:,:,:),wNGrzFiAdPhyt(:,:,:,:),wPGrzFiAdPhyt(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiJvPhyt(:,:,:,:),wCGrzFiJvPhyt(:,:,:,:),wNGrzFiJvPhyt(:,:,:,:),wPGrzFiJvPhyt(:,:,:,:)
!Real,ALLOCATABLE:: tDGrzFishBac(:,:) ,tCGrzFishBac(:,:) ,tNGrzFishBac(:,:) ,tPGrzFishBac(:,:)
!Real,ALLOCATABLE:: tDGrzFishBent(:,:),tCGrzFishBent(:,:),tNGrzFishBent(:,:),tPGrzFishBent(:,:)
Real,ALLOCATABLE:: wDGrzFiAdPom(:,:,:,:) ,wCGrzFiAdPom(:,:,:,:) ,wNGrzFiAdPom(:,:,:,:) ,wPGrzFiAdPom(:,:,:,:)
Real,ALLOCATABLE:: wDGrzFiJvPom(:,:,:,:) ,wCGrzFiJvPom(:,:,:,:) ,wNGrzFiJvPom(:,:,:,:) ,wPGrzFiJvPom(:,:,:,:)
Real,ALLOCATABLE:: wDHarvFiAd(:) ,wCHarvFiAd(:) ,wNHarvFiAd(:) ,wPHarvFiAd(:)
Real,ALLOCATABLE:: wDHarvFiJv(:) ,wCHarvFiJv(:) ,wNHarvFiJv(:) ,wPHarvFiJv(:)
Real,ALLOCATABLE:: wDRespFiAd(:,:,:) ,wCRespFiAd(:,:,:)
Real,ALLOCATABLE:: wDRespFiJv(:,:,:) ,wCRespFiJv(:,:,:)
Real,ALLOCATABLE:: wDEgesFiAd(:,:,:) ,wCEgesFiAd(:,:,:) ,wNEgesFiAd(:,:,:) ,wPEgesFiAd(:,:,:)
Real,ALLOCATABLE:: wDEgesFiJv(:,:,:) ,wCEgesFiJv(:,:,:) ,wNEgesFiJv(:,:,:) ,wPEgesFiJv(:,:,:)
Real,ALLOCATABLE:: wDMortFiAd(:,:,:) ,wCMortFiAd(:,:,:) ,wNMortFiAd(:,:,:) ,wPMortFiAd(:,:,:)
Real,ALLOCATABLE:: wDMortFiJv(:,:,:) ,wCMortFiJv(:,:,:) ,wNMortFiJv(:,:,:) ,wPMortFiJv(:,:,:)
Real,ALLOCATABLE:: wNExcrFiAd(:,:,:) ,wPExcrFiAd(:,:,:)
Real,ALLOCATABLE:: wNExcrFiJv(:,:,:) ,wPExcrFiJv(:,:,:)
Real,ALLOCATABLE:: wDMessFiAdOM(:,:,:), wCMessFiAdOM(:,:,:), wNMessFiAdOM(:,:,:), wPMessFiAdOM(:,:,:)
Real,ALLOCATABLE:: wDMessFiJvOM(:,:,:), wCMessFiJvOM(:,:,:), wNMessFiJvOM(:,:,:), wPMessFiJvOM(:,:,:)
!5)Funcoes Auxiliares
Real aDFish
Real uFunTmFish
Real:: oDFoodFiAd,oCFoodFiAd,oNFoodFiAd,oPFoodFiAd
Real:: oDFoodFiJv,oCFoodFiJv,oNFoodFiJv,oPFoodFiJv
Real:: oDFoodFiAdFish,oDFoodFiAdZoo,oDFoodFiAdPhyt,oDFoodFiAdBent,oDFoodFiAdPom
Real:: oDFoodFiJvZoo,oDFoodFiJvPhyt,oDFoodFiJvBent,oDFoodFiJvPom
Real:: oDFoodFish
Real:: ukDIncrFiAd,tDEnvFiAd,aDSatFiAd
Real:: ukDIncrFiJv,tDEnvFiJv,aDSatFiJv
Real:: rCDFoodFiAd,rNDFoodFiAd,rPDFoodFiAd
Real:: rCDFoodFiJv,rNDFoodFiJv,rPDFoodFiJv
Real:: afCAssFiAd ,afNAssFiAd ,afPAssFiAd
Real:: afCAssFiJv ,afNAssFiJv ,afPAssFiJv
Real,ALLOCATABLE:: fDGrzFishFish(:,:) ,fDGrzFishZoo(:,:), fDGrzFishPhyt(:,:), fDGrzFishBac(:,:), fDGrzFishBent(:,:), fDGrzFishPom(:,:)
!7)Variaveis de Estado
Real,ALLOCATABLE:: sDFiAd(:,:,:), sCFiAd(:,:,:), sNFiAd(:,:,:), sPFiAd(:,:,:) !Peixes Piscivoros (g/m²)
Real,ALLOCATABLE:: sDFiJv(:,:,:), sCFiJv(:,:,:), sNFiJv(:,:,:), sPFiJv(:,:,:) !Peixes Piscivoros (g/m²)
Real,ALLOCATABLE:: sDFiAdP(:,:,:), sCFiAdP(:,:,:), sNFiAdP(:,:,:), sPFiAdP(:,:,:) !Peixes Piscivoros (g/m²)
Real,ALLOCATABLE:: sDFiJvP(:,:,:), sCFiJvP(:,:,:), sNFiJvP(:,:,:), sPFiJvP(:,:,:) !Peixes Piscivoros (g/m²)
Real,ALLOCATABLE:: rCDFiAd(:,:,:), rNDFiAd(:,:,:), rPDFiAd(:,:,:)
Real,ALLOCATABLE:: rCDFiJv(:,:,:), rNDFiJv(:,:,:), rPDFiJv(:,:,:)
!------------------------------------------------------------------------------------------------------------------!
! A B I O T I C O !
!------------------------------------------------------------------------------------------------------------------!
!------------------------------------------------------------------------------------------------------------------!
! C O N F I G U R A C O E S I N I C I A I S !
!------------------------------------------------------------------------------------------------------------------!
INTEGER ndom,npom
INTEGER domg
INTEGER pomg
INTEGER:: LABIL=1
INTEGER:: REFRATARIA=2
Real :: pomMinConc = 0.001
Real :: domMinConc = 0.001
INTEGER :: nsed
INTEGER ConstDepth !A profundidade é constante? Sim=0, Não=1
!------------------------------------------------------------------------------------------------------------------!
! P A R A M E T R O S !
!------------------------------------------------------------------------------------------------------------------!
!Link BIOTICO<->ABIOTICO
!Particulate Organic Matter (POM)
Real,ALLOCATABLE:: cCDPomRef(:)
Real,ALLOCATABLE:: cNDPomRef(:)
Real,ALLOCATABLE:: cPDPomRef(:)
!Dissolved Organic Matter (DOM)
Real,ALLOCATABLE:: cCDDomRef(:)
Real,ALLOCATABLE:: cNDDomRef(:)
Real,ALLOCATABLE:: cPDDomRef(:)
Real,ALLOCATABLE:: cSiDDomRef(:)
!Real:: fDExdDomPhyt
Real:: fDLisDomPhyt
Real:: fDMessDomZoo
Real:: fDExcDomZoo
Real:: fDMessDomBen
Real:: fDEgesDomZoo
Real:: fDMortDomZoo
Real:: fDExcDomBen
Real:: fDEgesDomBen
Real:: fDMortDomBen
Real:: fDMessDomFish
Real:: fDExcDomFish
Real:: fDEgesDomFish
Real:: fDMortDomFish
Real:: fDMortDomMac
Real:: fDAssDomBird
!Sedimento
Real fLutum !Fração de lodo na matéria inorganica (g/g)
Real fLutumRef !Fração de lodo na matéria inorganica (g/g)
Real cRhoOM !Densidade da matéria organica no solido (g/m³ de sólido)
Real cRhoIM !Densidade da matéria inorganica no solido (g/m³ de sólido) (diferentes para argila (1.95x10^6) e areia(1.7x10^6))
Real cDepthS !Profundidade do topo de camada de sedimento (m)
!Infiltracao
Real cQinf !taxa de infiltração (mm/d)
Real cPBackLoad !Carga direta de P na superficie da água (mgP/l) - deposição atmosferica na holanda
Real cNBackLoad !Carga direta de N na superficie da água (mgN/l) - deposição atmosferica na holanda
Real cPO4Ground !Concentração de PO4 em camadas profundas (mgP/l)
Real cNH4Ground !Concentração de NH4 em camadas profundas (mgN/l)
Real cNO3Ground !Concentração de NO3 em camadas profundas (mgN/l)
Real cDicGround !Concentração de Dic em camadas profundas (mgN/l)
Real,ALLOCATABLE:: cDomGround(:) !gdom !Concentração de Dom em camadas profundas (mgN/l)
!Erosao
Real cDErosTot !Fluxo total de erosão (g/m²/d)
Real fSedErosIM !fração de materia inorganica erodida instantaneamente (-)
Real fDOrgSoil !fração de matéria organica no solo (-)
!Real,ALLOCATABLE:: fDErosPom(:) !gpom !fracao refrataria e particulada (-)
!Resuspension
Integer:: ResuspMethodFlag !< Resuspension Method flag: ResuspMethodFlag = 0 (No resuspension); ResuspMethodFlag = 1 (PCLake); ResuspMethodFlag = 2 (Garcia and Parker)
Real caRes !coeficientes ALFA da equação de regressão
Real cbRes !coeficientes BETA da equação de regressão
Real cSuspRef !função de referencia da materia suspensa (-)
Real cSuspMin !minimo valor da função logistica
Real cSuspMax !maximo valor da função logistica
Real cSuspSlope !inclinação da função logistica
Real hDepthSusp !valor de meia saturaçao da profundidade para a função logista
Real cFetchRef !fetch de referencia
Real cFetch !fetch na lagoa Mangueira
Real kTurbFish !resuspensao relativa aos peixes adultos (g de sedimento/g de peixe)/dia
Real kVegResus !coeficiente de atenuação da resuspenção devido a vegetação (m²/gD)
Real kResusPhytMax !resuspensao maxima do fitoplancton (/d)
Real cResusPhytExp !parametro exponencial para resuspensao do fitoplancton (d.m²/gD)
Real cThetaResus
!Sedimentation
Integer:: SetMethodFlag !< Sedimentation Method flag: SetMethodFlag = 0 (No resuspension); SetMethodFlag = 1 (PCLake); SetMethodFlag = 2 (Stokes)
Real aFunTauSet
Real uCorVSetIM
Real cThetaSet !parametro de temperatura para sedimentação (1/e^oC)
Real cVSetPom !velocidade de sedimentação maxima da materia organica particulada (m/day)
Real cVSetIM !velocidade de sedimentação maxima da materia inorganica inerte (m/day)
Real ppOM !densidade da OM
Real ppIM !densidade da IM
Real diOM !diametro da OM (m)
Real diIM !diametro da IM (m)
!Hidrolise - POM -> DOM
Real cThetaHidW
Real hBacHid
Real,ALLOCATABLE:: kHidPomW(:) !gpom
Real cThetaHidS
Real,ALLOCATABLE:: kHidPomS(:) !gpom
!Mineração - IF InclBac=0 - DOM->CO2,NH4,PO4,SiO2
Real cThetaMinAerW,cThetaMinAnaerW !Constante de temperatura exponecial de mineração na água
Real,ALLOCATABLE:: kMinAerDomW(:),kMinAnaerDomW(:) !gdom !taxa de mineralizacao de DOM na água
Real cThetaMinAerS,cThetaMinAnaerS !Constante de temperatura exponecial de mineração no Sed
Real,ALLOCATABLE:: kMinAerDomS(:),kMinAnaerDomS(:) !gdom !taxa de mineralizacao de DOM no Sed
!DBO e Coliformes
Real Kdbo1
Real Kdbo3
Real Kcol
!Desnitrificação
Real hNO3Denit !meia-saturação quadratica da conc. de NO3 para desnitrificação
Real NO3PerC !moles de NO3 denitrificados por mol de C mineralizado
!Nitrificação
Real cThetaNitr !Constante de temperatura exponecial de nitrificação
Real kNitrW !taxa de nitrificação constante na água (1/d)
Real kNitrS !taxa de nitrificação constante no Sed (1/d)
Real hO2Nitr !meia-saturação quadratica da conc. de O2 para Nitrificação mgO2/l
Real O2PerNH4 !moléculas de O2 usadas por mol de NH4 nitrificado (-)
!Adsorção do P
Real cRelPAdsD !P máximo absorvido per g matéria organica (gP/gD)
Real cRelPAdsFe !P máximo absorvido per g Fe (gP/gFe)
Real cRelPAdsAl !P máximo absorvido per g matéria organica (gP/gAl)
Real fFeDIM !Conteúdo de Fe na matéria inorganica (gFe/gD)
Real fAlDIM !Conteúdo de Al na matéria inorganica (gAl/gD)
Real fRedMax !fator de redução máxima da afinidade de absorção P
Real cKPAdsOx !afinidade de absorção P em condições oxidadas
Real kPSorp !taxa de absorção do fósforo (1/d)
Real hAdsP
!Imobilizacao do P
Real kPChemPO4 !taxa constante (1/d)
Real cPO4Max !Conc. Maxima de PO4 no sedimento
!Difusao Agua-Sed
Real fDepthDifS !Fraction of Sediment's depth with diffusion (-)
Real cThetaDif !coeficiente de temperatura devido a difusao (1/e^oC)
Real,ALLOCATABLE:: kPDifDom(:) !constante de difusao das moleculas de Dom (m²/d)
Real kCDifDic !constante de difusao das moleculas de Dic (m²/d)
Real kPDifPO4 !constante de difusao das moleculas de PO4 (m²/d)
Real kNDifNO3 !constante de difusao das moleculas de NO3 (m²/d)
Real kNDifNH4 !constante de difusao das moleculas de NH4 (m²/d)