Merge remote-tracking branch 'origin/release-v4.5'
[WRF.git] / hydro / Routing / module_noah_chan_param_init_rt.F
blobb348d26b89e10aaf70b0371916b7e1cb1e74017b
2 !  Author(s)/Contact(s):
3 !  Abstract:
4 !  History Log:
5
6 !  Usage:
7 !  Parameters: <Specify typical arguments passed>
8 !  Input Files:
9 !        <list file names and briefly describe the data they include>
10 !  Output Files:
11 !        <list file names and briefly describe the information they include>
12
13 !  Condition codes:
14 !        <list exit condition or error codes returned >
15 !        If appropriate, descriptive troubleshooting instructions or
16 !        likely causes for failures could be mentioned here with the
17 !        appropriate error code
18
19 !  User controllable options: <if applicable>
21 MODULE module_noah_chan_param_init_rt
24 CONTAINS
26 !-----------------------------------------------------------------
27   SUBROUTINE CHAN_PARM_INIT (BOTWID,CHANN_K,HLINK_INIT,CHAN_SS,CHMann)
28 !  SUBROUTINE CHAN_PARM_INIT (BOTWID,CHANN_K,TOPWID,HLINK_INIT,CHAN_SS,CHMann,TOPWIDCC,NCC)
29 !-----------------------------------------------------------------
31     IMPLICIT NONE
33     integer :: IINDEX, CHANCATS
34     integer :: ORDER, IUNIT
35     integer, PARAMETER :: NCHANTYPES=50 
36     real,dimension(NCHANTYPES)    :: BOTWID,CHANN_K,TOPWID,HLINK_INIT,CHAN_SS,CHMann
37     real,dimension(NCHANTYPES)    :: TOPWIDCC, NCC
38     character(LEN=11) :: DATATYPE
40 !-----SPECIFY CHANNEL RELATED CHARACTERISTICS :
41 !             ORDER: Strahler Stream Order
42 !            BOTWID: Channel Bottom Width (meters)
43 !            CHANNK: channel conductivity (m/s)
44 !            TOPWID: Channel Top Width before becoming compound (meters)
45 !          TOPWIDCC: Channel Top Width after becoming compound (meters)
46 !            NCC   : mannings n of compound component
47 !        HLINK_INIT: Initial depth of flow in channel (meters)
48 !           CHAN_SS: Channel side slope (assuming trapezoidal channel geom)
49 !            CHMann: Channel Manning's N roughness coefficient 
52 !-----READ IN CHANNEL PROPERTIES FROM CHANPARM.TBL :
53     IUNIT = 23
54     OPEN(IUNIT, &
55 #ifndef NCEP_WCOSS
56     FILE='CHANPARM.TBL', &
57 #endif
58     FORM='FORMATTED',STATUS='OLD')
59     READ (IUNIT,*)
60     READ (IUNIT,2000,END=2002) DATATYPE
61 #ifdef HYDRO_D
62     PRINT *, DATATYPE
63 #endif
64     READ (IUNIT,*)CHANCATS,IINDEX
65 2000 FORMAT (A11)
67 !-----Read in Channel Parameters as functions of stream order...
69     IF(DATATYPE.EQ.'StreamOrder')THEN
70 #ifdef HYDRO_D
71        PRINT *, 'CHANNEL DATA SOURCE TYPE = ',DATATYPE,' FOUND',           &
72             CHANCATS,' CATEGORIES'
73 #endif
74        do ORDER=1,CHANCATS
76           read (IUNIT,*)IINDEX, BOTWID(ORDER), HLINK_INIT(ORDER), CHAN_SS(ORDER), CHMann(ORDER)
77 !          READ (IUNIT,*)IINDEX,BOTWID(ORDER),TOPWID(ORDER), &
78 !               HLINK_INIT(ORDER),CHAN_SS(ORDER),CHMann(ORDER),&
79 !               TOPWIDCC(ORDER),NCC(ORDER)
81 #ifdef HYDRO_D
82           PRINT *, IINDEX, BOTWID(ORDER), CHANN_K(ORDER), HLINK_INIT(ORDER), CHAN_SS(ORDER),  &
83                &     CHMann(ORDER)
84 !          PRINT *, IINDEX,BOTWID(ORDER),& 
85 !                HLINK_INIT(ORDER),CHAN_SS(ORDER),   &
86 !                CHMann(ORDER),TOPWIDCC(ORDER),NCC(ORDER)
87 #endif
88        ENDDO
89     ENDIF
92 !-----Read in Channel Parameters as functions of ???other method??? (TBC)...
95 2002 CONTINUE
97     CLOSE (IUNIT)
98   END SUBROUTINE CHAN_PARM_INIT
102 #ifdef MPP_LAND
103   SUBROUTINE mpp_CHAN_PARM_INIT (BOTWID,CHANN_K,HLINK_INIT,CHAN_SS,CHMann)
104 !  subroutine mpp_CHAN_PARM_INIT (BOTWID,CHANN_K,TOPWID,HLINK_INIT,CHAN_SS,CHMann,TOPWIDCC,NCC)
105     use module_mpp_land, only:  my_id, IO_id,mpp_land_bcast_int1, &
106        mpp_land_bcast_real,mpp_land_bcast_int,mpp_land_bcast_real1
107     implicit none
108     integer :: IINDEX, CHANCATS
109     integer :: ORDER
110     integer, PARAMETER :: NCHANTYPES=50 
111     real,dimension(NCHANTYPES)    :: BOTWID,CHANN_K,HLINK_INIT,CHAN_SS,CHMann
112     !real,dimension(NCHANTYPES)    :: TOPWID, TOPWIDCC, NCC  ! compound components
113     character(LEN=11) :: DATATYPE
115     if(my_id.eq.io_id) then
116        call CHAN_PARM_INIT(BOTWID,CHANN_K,HLINK_INIT,CHAN_SS,CHMann)
117 !       call CHAN_PARM_INIT(BOTWID,TOPWID,HLINK_INIT,CHAN_SS,CHMann,TOPWIDCC,NCC)
118     end if
119        call mpp_land_bcast_real(NCHANTYPES,BOTWID)
120        call mpp_land_bcast_real(NCHANTYPES,CHANN_K)
121        call mpp_land_bcast_real(NCHANTYPES,HLINK_INIT)
122        call mpp_land_bcast_real(NCHANTYPES,CHAN_SS)
123        call mpp_land_bcast_real(NCHANTYPES,CHMann)
124 !       call mpp_land_bcast_real(NCHANTYPES,TOPWID)
125 !       call mpp_land_bcast_real(NCHANTYPES,TOPWIDCC)
126 !       call mpp_land_bcast_real(NCHANTYPES,NCC)
128     return 
129     END SUBROUTINE mpp_CHAN_PARM_INIT
130 #endif
131 !-----------------------------------------------------------------
132 !-----------------------------------------------------------------
135 END MODULE module_Noah_chan_param_init_rt