forked from AquaticEcoDynamics/libaed2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aed2_core.F90
767 lines (657 loc) · 31 KB
/
aed2_core.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
!###############################################################################
!# #
!# aed2_core.F90 #
!# #
!# Developed by : #
!# AquaticEcoDynamics (AED) Group #
!# School of Agriculture and Environment #
!# The University of Western Australia #
!# #
!# http://aquatic.science.uwa.edu.au/ #
!# #
!# Copyright 2013 - 2018 - The University of Western Australia #
!# #
!# GLM is free software: you can redistribute it and/or modify #
!# it under the terms of the GNU General Public License as published by #
!# the Free Software Foundation, either version 3 of the License, or #
!# (at your option) any later version. #
!# #
!# GLM is distributed in the hope that it will be useful, #
!# but WITHOUT ANY WARRANTY; without even the implied warranty of #
!# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
!# GNU General Public License for more details. #
!# #
!# You should have received a copy of the GNU General Public License #
!# along with this program. If not, see <http://www.gnu.org/licenses/>. #
!# #
!# ----------------------------------------------------------------------- #
!# #
!# Created June 2013 #
!# #
!###############################################################################
#include "aed2.h"
MODULE aed2_core
IMPLICIT NONE
PRIVATE !# Everything defaults to private
PUBLIC aed2_model_data_t, aed2_variable_t, aed2_column_t
PUBLIC aed2_init_core, aed2_get_var, aed2_core_status, aed2_set_prefix
PUBLIC aed2_define_variable, aed2_define_sheet_variable, &
aed2_locate_sheet_variable, aed2_locate_variable, &
aed2_define_diag_variable, aed2_define_sheet_diag_variable
PUBLIC aed2_locate_global, aed2_locate_global_sheet
PUBLIC host_has_cell_vel
PUBLIC zero_, one_, nan_, misval_, secs_per_day
PUBLIC cur_model_name
!#---------------------------------------------------------------------------
TYPE :: aed2_variable_t
CHARACTER(len=64) :: name
CHARACTER(len=64) :: model_name
CHARACTER(len=128):: longname
CHARACTER(len=24) :: units
AED_REAL :: initial
AED_REAL :: minimum
AED_REAL :: maximum
AED_REAL :: mobility
AED_REAL :: light_extinction
LOGICAL :: sheet, diag, extern, found
LOGICAL :: top, bot
END TYPE aed2_variable_t
!#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!#---------------------------------------------------------------------------
TYPE :: aed2_model_data_t
INTEGER :: aed2_model_id
CHARACTER(len=64) :: aed2_model_name
CHARACTER(len=4) :: aed2_model_prefix
CLASS(aed2_model_data_t),POINTER :: next => null()
!# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CONTAINS
procedure :: define => aed2_define
procedure :: initialize => aed2_initialize
procedure :: calculate_surface => aed2_calculate_surface
procedure :: calculate => aed2_calculate
procedure :: calculate_benthic => aed2_calculate_benthic
procedure :: calculate_riparian => aed2_calculate_riparian
procedure :: calculate_dry => aed2_calculate_dry
procedure :: equilibrate => aed2_equilibrate
procedure :: light_extinction => aed2_light_extinction
procedure :: rain_loss => aed2_rain_loss
procedure :: light_shading => aed2_light_shading
procedure :: bio_drag => aed2_bio_drag
procedure :: particle_bgc => aed2_particle_bgc
procedure :: mobility => aed2_mobility
procedure :: validate => aed2_validate
procedure :: delete => aed2_delete
!# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
END TYPE aed2_model_data_t
!#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!#---------------------------------------------------------------------------
TYPE :: aed2_column_t
AED_REAL,DIMENSION(:),POINTER :: cell
AED_REAL, POINTER :: cell_sheet
AED_REAL, POINTER :: flux_atm
AED_REAL,DIMENSION(:),POINTER :: flux_pel
AED_REAL, POINTER :: flux_ben
AED_REAL, POINTER :: flux_rip
END TYPE aed2_column_t
!#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!-------------------------------------------------------------------------------
!MODULE VARIABLES
INTEGER :: cur_mod_base = 0
INTEGER :: n_aed_vars, a_vars
INTEGER :: n_vars, n_sheet_vars
INTEGER :: n_diags, n_sheet_diags
TYPE(aed2_variable_t),DIMENSION(:),ALLOCATABLE,TARGET :: all_vars
! CLASS(aed2_model_data_t), POINTER :: aed2_cur_mod => null()
CHARACTER(len=4),POINTER :: aed2_cur_prefix => null()
CHARACTER(len=80) :: base_aed_directory = '.'
CHARACTER(len=64) :: cur_model_name = ''
LOGICAL :: host_has_cell_vel = .false.
!CONSTANTS
AED_REAL,PARAMETER :: zero_ = 0., one_ = 1.
AED_REAL,PARAMETER :: secs_per_day = 86400.
AED_REAL,PARAMETER :: misval_ = -9999.
AED_REAL,PARAMETER :: nan_ = zero_ / zero_
!===============================================================================
CONTAINS
!###############################################################################
INTEGER FUNCTION aed2_init_core(dname,have_cell_vel)
!-------------------------------------------------------------------------------
! Initialise the aed model library core routines
!-------------------------------------------------------------------------------
!ARGUMENTS - none
CHARACTER(len=*) :: dname
LOGICAL,OPTIONAL :: have_cell_vel
!
!LOCAL
! AED_REAL :: tmpr = zero_
!
!-------------------------------------------------------------------------------
!BEGIN
base_aed_directory = dname
n_aed_vars = 0 ; a_vars = 0
n_vars = 0; n_sheet_vars = 0
n_diags = 0; n_sheet_diags = 0
IF (PRESENT(have_cell_vel)) host_has_cell_vel = have_cell_vel
aed2_init_core = 0
END FUNCTION aed2_init_core
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
INTEGER FUNCTION aed2_core_status(n_v, n_sv, n_d, n_sd)
!-------------------------------------------------------------------------------
! Status of the aed model library core routines
!-------------------------------------------------------------------------------
!ARGUMENTS
INTEGER,INTENT(out) :: n_v, n_sv, n_d, n_sd
!
!-------------------------------------------------------------------------------
!BEGIN
n_v = n_vars; n_sv = n_sheet_vars
n_d = n_diags; n_sd = n_sheet_diags
aed2_core_status = n_aed_vars
END FUNCTION aed2_core_status
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_set_prefix(prefix)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(len=4),POINTER :: prefix
!
!-------------------------------------------------------------------------------
!BEGIN
aed2_cur_prefix => prefix
END SUBROUTINE aed2_set_prefix
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!# These create space for the variables :
!###############################################################################
SUBROUTINE extend_allocated_variables(pcount)
!-------------------------------------------------------------------------------
!ARGUMENTS
INTEGER,INTENT(in) :: pcount
!
!LOCALS
TYPE(aed2_variable_t),DIMENSION(:),ALLOCATABLE :: tmp
INTEGER count
!
!-------------------------------------------------------------------------------
!BEGIN
count = pcount
IF ( count < 10 ) count = 10
IF ( ALLOCATED(all_vars) ) THEN
ALLOCATE(tmp(1:a_vars))
tmp = all_vars
DEALLOCATE(all_vars)
ALLOCATE(all_vars(1:a_vars+count))
all_vars(1:a_vars) = tmp(1:a_vars)
DEALLOCATE(tmp);
ELSE
ALLOCATE(all_vars(1:count))
ENDIF
all_vars(a_vars+1:a_vars+count)%initial = nan_
all_vars(a_vars+1:a_vars+count)%minimum = nan_
all_vars(a_vars+1:a_vars+count)%maximum = nan_
all_vars(a_vars+1:a_vars+count)%mobility = nan_
all_vars(a_vars+1:a_vars+count)%light_extinction = nan_
all_vars(a_vars+1:a_vars+count)%sheet = .false.
all_vars(a_vars+1:a_vars+count)%diag = .false.
all_vars(a_vars+1:a_vars+count)%extern = .false.
all_vars(a_vars+1:a_vars+count)%found = .false.
all_vars(a_vars+1:a_vars+count)%top = .false.
all_vars(a_vars+1:a_vars+count)%bot = .false.
! IF ( ALLOCATED(column) ) THEN
! ALLOCATE(tmpc(1:a_vars))
! tmpc = column
! DEALLOCATE(column)
! ALLOCATE(column(1:a_vars+count))
! column(1:a_vars) = tmpc(1:a_vars)
! DEALLOCATE(tmpc);
! ELSE
! ALLOCATE(column(1:count))
! ENDIF
a_vars = a_vars + count
END SUBROUTINE extend_allocated_variables
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!# These define names and defaults for variables, returning their index:
!###############################################################################
SUBROUTINE aed2_create_variable(name, longname, units)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name, longname, units
!
!-------------------------------------------------------------------------------
!BEGIN
!print*,"Variable '",trim(name),"' long name '",trim(longname),"' with units '",trim(units),"'"
IF (n_aed_vars .GE. a_vars) CALL extend_allocated_variables(n_aed_vars+1-a_vars)
n_aed_vars = n_aed_vars + 1
IF ( ASSOCIATED(aed2_cur_prefix) .AND. units /= '' ) THEN
all_vars(n_aed_vars)%name = TRIM(aed2_cur_prefix)//"_"//name
ELSE
all_vars(n_aed_vars)%name = name
ENDIF
all_vars(n_aed_vars)%model_name = cur_model_name
all_vars(n_aed_vars)%longname = longname
all_vars(n_aed_vars)%units = units
all_vars(n_aed_vars)%sheet = .false.
all_vars(n_aed_vars)%diag = .false.
all_vars(n_aed_vars)%extern = .false.
all_vars(n_aed_vars)%found = .false.
END SUBROUTINE aed2_create_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_define_variable(name, units, longname, initial, minimum, maximum, mobility) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name, longname, units
AED_REAL,INTENT(in),OPTIONAL :: initial, minimum, maximum
AED_REAL,INTENT(in),OPTIONAL :: mobility
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
CALL aed2_create_variable(name, longname, units)
n_vars = n_vars + 1
if ( present(initial) ) all_vars(n_aed_vars)%initial = initial
if ( present(minimum) ) all_vars(n_aed_vars)%minimum = minimum
if ( present(maximum) ) all_vars(n_aed_vars)%maximum = maximum
if ( present(mobility) ) all_vars(n_aed_vars)%mobility = mobility
! all_vars(n_aed_vars)%sheet = .false.
! all_vars(n_aed_vars)%diag = .false.
! all_vars(n_aed_vars)%extern = .false.
all_vars(n_aed_vars)%found = .true.
ret = n_aed_vars
END FUNCTION aed2_define_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_define_sheet_variable(name, units, longname, initial, minimum, maximum, surf) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name, longname, units
AED_REAL,INTENT(in),OPTIONAL :: initial, minimum, maximum
LOGICAL,INTENT(in),OPTIONAL :: surf
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
CALL aed2_create_variable(name, longname, units)
n_sheet_vars = n_sheet_vars + 1
if ( present(initial) ) all_vars(n_aed_vars)%initial = initial
if ( present(minimum) ) all_vars(n_aed_vars)%minimum = minimum
if ( present(maximum) ) all_vars(n_aed_vars)%maximum = maximum
all_vars(n_aed_vars)%sheet = .true.
! all_vars(n_aed_vars)%diag = .false.
! all_vars(n_aed_vars)%extern = .false.
all_vars(n_aed_vars)%found = .true.
IF ( PRESENT(surf) ) THEN
all_vars(n_aed_vars)%bot = .NOT. surf
all_vars(n_aed_vars)%top = surf
ELSE
all_vars(n_aed_vars)%bot = .TRUE.
ENDIF
ret = n_aed_vars
END FUNCTION aed2_define_sheet_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_define_diag_variable(name, units, longname) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name, longname, units
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
CALL aed2_create_variable(name, longname, units)
n_diags = n_diags + 1
! all_vars(n_aed_vars)%sheet = .false.
all_vars(n_aed_vars)%diag = .true.
! all_vars(n_aed_vars)%extern = .false.
all_vars(n_aed_vars)%found = .true.
ret = n_aed_vars
END FUNCTION aed2_define_diag_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_define_sheet_diag_variable(name, units, longname, surf) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name, longname, units
LOGICAL,INTENT(in),OPTIONAL :: surf
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
CALL aed2_create_variable(name, longname, units)
n_sheet_diags = n_sheet_diags + 1
all_vars(n_aed_vars)%sheet = .true.
all_vars(n_aed_vars)%diag = .true.
! all_vars(n_aed_vars)%extern = .false.
all_vars(n_aed_vars)%found = .true.
IF ( PRESENT(surf) ) THEN
all_vars(n_aed_vars)%bot = .NOT. surf
all_vars(n_aed_vars)%top = surf
ELSE
all_vars(n_aed_vars)%bot = .TRUE.
ENDIF
ret = n_aed_vars
END FUNCTION aed2_define_sheet_diag_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!# These return the index for the named variable :
!###############################################################################
FUNCTION aed2_find_variable(name) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
DO ret=1,n_aed_vars
IF ( all_vars(ret)%name == name ) RETURN
IF ( trim(all_vars(ret)%model_name)//'_'//trim(all_vars(ret)%name) == name ) RETURN
!print*,trim(name), ' is neither ', trim(all_vars(ret)%name), ' nor ', &
! trim(all_vars(ret)%model_name)//'_'//trim(all_vars(ret)%name)
ENDDO
ret = 0
END FUNCTION aed2_find_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_locate_variable(name) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
ret = aed2_find_variable(name)
IF ( ret == 0 ) THEN
!print*,'Variable ',trim(name),' not found'
!stop
CALL aed2_create_variable(name, '', '')
! all_vars(n_aed_vars)%sheet = .false.
! all_vars(n_aed_vars)%diag = .false.
! all_vars(n_aed_vars)%extern = .true.
ret = n_aed_vars
RETURN
ENDIF
IF ( all_vars(ret)%sheet .OR. all_vars(ret)%diag ) ret = 0
END FUNCTION aed2_locate_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_locate_sheet_variable(name) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
ret = aed2_find_variable(name)
IF ( ret == 0 ) THEN
CALL aed2_create_variable(name, '', '')
all_vars(n_aed_vars)%name = name
all_vars(n_aed_vars)%sheet = .true.
! all_vars(n_aed_vars)%diag = .false.
! all_vars(n_aed_vars)%extern = .true.
ret = n_aed_vars
RETURN
ENDIF
IF ( (.NOT. all_vars(ret)%sheet) .OR. all_vars(ret)%diag ) ret = 0
END FUNCTION aed2_locate_sheet_variable
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_locate_global(name) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
IF ( TRIM(name) == "cell_vel" ) THEN
ret = -1
IF ( .NOT. host_has_cell_vel ) RETURN
ENDIF
ret = aed2_find_variable(name)
IF ( ret == 0 ) THEN
! print *,"variable ",trim(name)," not found"
CALL aed2_create_variable(name, '', '')
! all_vars(n_aed_vars)%sheet = .false.
! all_vars(n_aed_vars)%diag = .false.
all_vars(n_aed_vars)%extern = .true.
ret = n_aed_vars
RETURN
ENDIF
IF ( all_vars(ret)%sheet ) ret = 0
END FUNCTION aed2_locate_global
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
FUNCTION aed2_locate_global_sheet(name) RESULT(ret)
!-------------------------------------------------------------------------------
!ARGUMENTS
CHARACTER(*),INTENT(in) :: name
!
!LOCALS
INTEGER :: ret
!
!-------------------------------------------------------------------------------
!BEGIN
ret = aed2_find_variable(name)
IF ( ret == 0 ) THEN
! print *,"sheet var ",trim(name)," not found"
CALL aed2_create_variable(name, '', '')
all_vars(n_aed_vars)%sheet = .true.
! all_vars(n_aed_vars)%diag = .false.
all_vars(n_aed_vars)%extern = .true.
ret = n_aed_vars
RETURN
ENDIF
IF ( .NOT. all_vars(ret)%sheet ) ret = 0
END FUNCTION aed2_locate_global_sheet
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
LOGICAL FUNCTION aed2_get_var(which, tvar)
!-------------------------------------------------------------------------------
!ARGUMENTS
INTEGER,INTENT(in) :: which
TYPE(aed2_variable_t),POINTER,INTENT(out) :: tvar
!
!LOCALS
!
!-------------------------------------------------------------------------------
!BEGIN
aed2_get_var = .TRUE. ; NULLIFY(tvar)
IF (which > 0 .AND. which <= n_aed_vars) THEN ; tvar => all_vars(which)
ELSE ; aed2_get_var = .FALSE. ; ENDIF
END FUNCTION aed2_get_var
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
!# #
!# These are dummies for the declarations. #
!# #
!###############################################################################
!###############################################################################
SUBROUTINE aed2_define(data, namlst)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(inout) :: data
INTEGER,INTENT(in) :: namlst
!-------------------------------------------------------------------------------
!print*,"Default aed2_define ", trim(data%aed2_model_name)
END SUBROUTINE aed2_define
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_initialize(data,column, layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_initialize ", trim(data%aed2_model_name)
END SUBROUTINE aed2_initialize
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_calculate(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_calculate ", trim(data%aed2_model_name)
END SUBROUTINE aed2_calculate
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_calculate_surface(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_calculate_surface ", trim(data%aed2_model_name)
END SUBROUTINE aed2_calculate_surface
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_calculate_benthic(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_calculate_benthic ", trim(data%aed2_model_name)
END SUBROUTINE aed2_calculate_benthic
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_calculate_riparian(data,column,layer_idx, pc_wet)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(in) :: pc_wet
!-------------------------------------------------------------------------------
!print*,"Default aed2_calculate_riparian ", trim(data%aed2_model_name)
END SUBROUTINE aed2_calculate_riparian
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_calculate_dry(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_calculate_dry ", trim(data%aed2_model_name)
END SUBROUTINE aed2_calculate_dry
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_equilibrate(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_equilibrate ", trim(data%aed2_model_name)
END SUBROUTINE aed2_equilibrate
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
LOGICAL FUNCTION aed2_validate(data,column,layer_idx)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
!-------------------------------------------------------------------------------
!print*,"Default aed2_validate ", trim(data%aed2_model_name)
aed2_validate = .TRUE.
END FUNCTION aed2_validate
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_mobility(data,column,layer_idx,mobility)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(inout) :: mobility(:)
!-------------------------------------------------------------------------------
!print*,"Default aed2_mobility ", trim(data%aed2_model_name)
END SUBROUTINE aed2_mobility
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_rain_loss(data, column, layer_idx, infil)
!-------------------------------------------------------------------------------
! Get the soil moisture deficit, so host model can infiltrate rain accordingly
!-------------------------------------------------------------------------------
!ARGUMENTS
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(inout) :: infil
!-------------------------------------------------------------------------------
!BEGIN
!print*,"Default aed2_rain_loss ", trim(data%aed2_model_name)
END SUBROUTINE aed2_rain_loss
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_light_shading(data, column, layer_idx, shade_frac)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(inout) :: shade_frac
!-------------------------------------------------------------------------------
!BEGIN
!print*,"Default aed2_light_shading ", trim(data%aed2_model_name)
END SUBROUTINE aed2_light_shading
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_bio_drag(data, column, layer_idx, drag)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(inout) :: drag
!-------------------------------------------------------------------------------
!BEGIN
!print*,"Default aed2_bio_drag ", trim(data%aed2_model_name)
END SUBROUTINE aed2_bio_drag
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_light_extinction(data,column,layer_idx,extinction)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
AED_REAL,INTENT(inout) :: extinction
!-------------------------------------------------------------------------------
!print*,"Default aed2_light_extinction ", trim(data%aed2_model_name)
END SUBROUTINE aed2_light_extinction
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_particle_bgc(data,column,layer_idx,ppid,partcl)
CLASS (aed2_model_data_t),INTENT(in) :: data
TYPE (aed2_column_t),INTENT(inout) :: column(:)
INTEGER,INTENT(in) :: layer_idx
INTEGER,INTENT(inout) :: ppid
AED_REAL,DIMENSION(:),INTENT(inout) :: partcl
!-------------------------------------------------------------------------------
!print*,"Default aed2_particle_bgc ", trim(data%aed2_model_name)
END SUBROUTINE aed2_particle_bgc
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
!###############################################################################
SUBROUTINE aed2_delete(data)
!-------------------------------------------------------------------------------
CLASS (aed2_model_data_t),INTENT(inout) :: data
!-------------------------------------------------------------------------------
!print*,"Default aed2_delete ", trim(data%aed2_model_name)
END SUBROUTINE aed2_delete
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
END MODULE aed2_core