-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathmosart_cpl_indices.F90
More file actions
112 lines (91 loc) · 5.68 KB
/
mosart_cpl_indices.F90
File metadata and controls
112 lines (91 loc) · 5.68 KB
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
module mosart_cpl_indices
!-----------------------------------------------------------------------
! DESCRIPTION:
! Module containing the indices for the fields passed between MOSART and
! the driver.
!-----------------------------------------------------------------------
! USES:
implicit none
private ! By default make data private
! PUBLIC MEMBER FUNCTIONS:
public :: mosart_cpl_indices_set ! Set the coupler indices
! PUBLIC DATA MEMBERS:
integer, public :: index_x2r_Flrl_rofsur = 0 ! lnd->rof liquid surface runoff forcing from land
integer, public :: index_x2r_Flrl_rofgwl = 0 ! lnd->rof liquid gwl runoff from land
integer, public :: index_x2r_Flrl_rofsub = 0 ! lnd->rof liquid subsurface runoff from land
integer, public :: index_x2r_Flrl_rofdto = 0 ! lnd->rof liquid direct to ocean runoff
integer, public :: index_x2r_Flrl_rofi = 0 ! lnd->rof ice runoff forcing from land
integer, public :: index_x2r_Flrl_irrig = 0 ! lnd->rof fraction of volr to be removed for irrigation
integer, public :: index_x2r_Flrl_dom_withd = 0 ! lnd->rof fraction of volr to be removed for domestic usage
integer, public :: index_x2r_Flrl_dom_rf = 0 ! lnd->rof fraction of volr to be returned after domestic usage
integer, public :: index_x2r_Flrl_liv_withd = 0 ! lnd->rof fraction of volr to be removed for livestock usage
integer, public :: index_x2r_Flrl_liv_rf = 0 ! lnd->rof fraction of volr to be returned after livestock usage
integer, public :: index_x2r_Flrl_elec_withd = 0 ! lnd->rof fraction of volr to be removed for thermoelectric usage
integer, public :: index_x2r_Flrl_elec_rf = 0 ! lnd->rof fraction of volr to be returned after thermoelectric usage
integer, public :: index_x2r_Flrl_mfc_withd = 0 ! lnd->rof fraction of volr to be removed for manufacturing usage
integer, public :: index_x2r_Flrl_mfc_rf = 0 ! lnd->rof fraction of volr to be returned after manufacturing usage
integer, public :: index_x2r_Flrl_min_withd = 0 ! lnd->rof fraction of volr to be removed for mining usage
integer, public :: index_x2r_Flrl_min_rf = 0 ! lnd->rof fraction of volr to be returned after mining usage
integer, public :: nflds_x2r = 0
! roff to driver (part of land for now) (optional if ROF is off)
integer, public :: index_r2x_Forr_rofl = 0 ! rof->ocn liquid runoff to ocean
integer, public :: index_r2x_Forr_rofi = 0 ! rof->ocn ice runoff to ocean
integer, public :: index_r2x_Flrr_flood = 0 ! rof->lnd flood runoff (>fthresh) back to land
integer, public :: index_r2x_Flrr_volr = 0 ! rof->lnd volr total volume back to land
integer, public :: index_r2x_Flrr_volrmch = 0 ! rof->lnd volr main channel back to land
integer, public :: nflds_r2x = 0
!=======================================================================
contains
!=======================================================================
subroutine mosart_cpl_indices_set(flds_x2r, flds_r2x )
!-----------------------------------------------------------------------
! Description:
! Set the indices needed by the mosart model coupler interface.
! (mosart -> ocn) and (mosart->lnd)
!
use mct_mod, only: mct_aVect, mct_aVect_init, mct_avect_indexra
use mct_mod, only: mct_aVect_clean, mct_avect_nRattr
!
! Arguments:
character(len=*), intent(in) :: flds_x2r
character(len=*), intent(in) :: flds_r2x
!
! Local variables:
type(mct_aVect) :: avtmp ! temporary av
character(len=32) :: subname = 'mosart_cpl_indices_set' ! subroutine name
!-----------------------------------------------------------------------
!-------------------------------------------------------------
! driver -> mosart
!-------------------------------------------------------------
call mct_aVect_init(avtmp, rList=flds_x2r, lsize=1)
index_x2r_Flrl_rofsur = mct_avect_indexra(avtmp,'Flrl_rofsur')
index_x2r_Flrl_rofgwl = mct_avect_indexra(avtmp,'Flrl_rofgwl')
index_x2r_Flrl_rofsub = mct_avect_indexra(avtmp,'Flrl_rofsub')
index_x2r_Flrl_rofdto = mct_avect_indexra(avtmp,'Flrl_rofdto')
index_x2r_Flrl_rofi = mct_avect_indexra(avtmp,'Flrl_rofi')
index_x2r_Flrl_irrig = mct_avect_indexra(avtmp,'Flrl_irrig')
index_x2r_Flrl_dom_withd = mct_avect_indexra(avtmp,'Flrl_dom_withd')
index_x2r_Flrl_dom_rf = mct_avect_indexra(avtmp,'Flrl_dom_rf')
index_x2r_Flrl_liv_withd = mct_avect_indexra(avtmp,'Flrl_liv_withd')
index_x2r_Flrl_liv_rf = mct_avect_indexra(avtmp,'Flrl_liv_rf')
index_x2r_Flrl_elec_withd = mct_avect_indexra(avtmp,'Flrl_elec_withd')
index_x2r_Flrl_elec_rf = mct_avect_indexra(avtmp,'Flrl_elec_rf')
index_x2r_Flrl_mfc_withd = mct_avect_indexra(avtmp,'Flrl_mfc_withd')
index_x2r_Flrl_mfc_rf = mct_avect_indexra(avtmp,'Flrl_mfc_rf')
index_x2r_Flrl_min_withd = mct_avect_indexra(avtmp,'Flrl_min_withd')
index_x2r_Flrl_min_rf = mct_avect_indexra(avtmp,'Flrl_min_rf')
nflds_x2r = mct_avect_nRattr(avtmp)
call mct_aVect_clean(avtmp)
!-------------------------------------------------------------
! mosart -> driver
!-------------------------------------------------------------
call mct_aVect_init(avtmp, rList=flds_r2x, lsize=1)
index_r2x_Forr_rofl = mct_avect_indexra(avtmp,'Forr_rofl')
index_r2x_Forr_rofi = mct_avect_indexra(avtmp,'Forr_rofi')
index_r2x_Flrr_flood = mct_avect_indexra(avtmp,'Flrr_flood')
index_r2x_Flrr_volr = mct_avect_indexra(avtmp,'Flrr_volr')
index_r2x_Flrr_volrmch = mct_avect_indexra(avtmp,'Flrr_volrmch')
nflds_r2x = mct_avect_nRattr(avtmp)
call mct_aVect_clean(avtmp)
end subroutine mosart_cpl_indices_set
end module mosart_cpl_indices