My Project
Functions/Subroutines | Variables
mod_wd Module Reference

Functions/Subroutines

subroutine set_wd_data
 
subroutine alloc_wd_data
 
subroutine wet_judge
 
subroutine wd_update (INCASE)
 

Variables

integer, dimension(:), allocatable iswetn
 
integer, dimension(:), allocatable iswetc
 
integer, dimension(:), allocatable iswetnt
 
integer, dimension(:), allocatable iswetct
 
integer, dimension(:), allocatable iswetce
 

Function/Subroutine Documentation

◆ alloc_wd_data()

subroutine mod_wd::alloc_wd_data ( )

Definition at line 137 of file mod_wd.f90.

137 
138 !------------------------------------------------------------------------------|
139 ! ALLOCATE AND INITIALIZE WET/DRY TREATMENT ARRAYS |
140 !------------------------------------------------------------------------------|
141 
142  USE mod_prec
143  USE all_vars
144  USE mod_par
145  IMPLICIT NONE
146  INTEGER NCT,NDB
147 
148  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "START: ALLOC_WD_DATA"
149 
150  ndb = 1 !!GWC BASE THIS ON KIND
151 
152 !-----variables controlling porosities through wet/dry determination----------------!
153 
154  ALLOCATE(iswetn(0:mt)) ; iswetn = 1
155  ALLOCATE(iswetc(0:nt)) ; iswetc = 1
156  ALLOCATE(iswetnt(0:mt)) ; iswetnt = 1
157  ALLOCATE(iswetct(0:nt)) ; iswetct = 1
158  ALLOCATE(iswetce(0:nt)) ; iswetce = 1
159 
160  memcnt = memcnt + 3*nt + 2*mt
161 
162 !! ALLOCATE(US(0:NT,KB)) ;US = ZERO !!X-VELOCITY FOR MASS CONSERVATION
163 !! ALLOCATE(VS(0:NT,KB)) ;VS = ZERO !!Y-VELOCITY FOR MASS CONSERVATION
164 
165 !! ALLOCATE(UAS(0:NT)) ;UAS = ZERO !!VERT AVGD X-VELOC FOR MASS CONSERVATION
166 !! ALLOCATE(VAS(0:NT)) ;VAS = ZERO !!VERT AVGD Y-VELOC FOR MASS CONSERVATION
167 !! ALLOCATE(UARDS(0:NT)) ;UARDS = ZERO !!UA AVGD OVER EXTERNAL INT FOR MASS CONSERVATION
168 !! ALLOCATE(VARDS(0:NT)) ;VARDS = ZERO !!VA AVGD OVER EXTERNAL INT FOR MASS CONSERVATION
169 
170 !! memcnt = memcnt + KB*NT*NDB + KB*MT*NDB +NT*4*NDB
171 
172  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "END: ALLOC_WD_DATA"
173  RETURN
integer, dimension(:), allocatable iswetce
Definition: mod_wd.f90:55
integer mt
Definition: mod_main.f90:78
integer, dimension(:), allocatable iswetct
Definition: mod_wd.f90:54
real(sp) memcnt
Definition: mod_main.f90:81
integer, dimension(:), allocatable iswetnt
Definition: mod_wd.f90:53
integer, dimension(:), allocatable iswetc
Definition: mod_wd.f90:52
integer ipt
Definition: mod_main.f90:922
integer nt
Definition: mod_main.f90:77
integer, dimension(:), allocatable iswetn
Definition: mod_wd.f90:51
Here is the caller graph for this function:

◆ set_wd_data()

subroutine mod_wd::set_wd_data ( )

Definition at line 95 of file mod_wd.f90.

95 !------------------------------------------------------------------------------|
96 ! INITIALIZE ARRAYS USED FOR WET/DRY TREATMENT |
97 !------------------------------------------------------------------------------|
98 
99  USE all_vars
100  USE mod_par
101  IMPLICIT NONE
102  INTEGER :: I
103 
104  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "START: SET_WD_DATA"
105 
107 
108 !-------- SET WET/DRY FLAGS AND MODIFY WATER SURFACE ELEVATION-----------------!
109 
110  CALL wet_judge
111 
112 !-------- EXCHANGE MODIFIED FREE SURFACE ELEVATION ACROSS PROCESSOR BOUNDS-----!
113 
114 
115 !-------- TRANSFER ELEVATION FIELD TO DEPTH AND OLD TIME LEVELS----------------!
116  el1 = elf1
117  d1 = h1 + el1
118  el = elf
119  et = el
120  d = el + h
121  dt = d
122  dtfa = d
123  et1 = el1
124  dt1 = d1
125 
126 
127  END IF
128 
129  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "END: SET_WD_DATA"
130  RETURN
real(sp), dimension(:), allocatable, target d
Definition: mod_main.f90:1132
real(sp), dimension(:), allocatable, target d1
Definition: mod_main.f90:1116
real(sp), dimension(:), allocatable, target h
Definition: mod_main.f90:1131
real(sp), dimension(:), allocatable, target dtfa
Definition: mod_main.f90:1124
real(sp), dimension(:), allocatable, target el
Definition: mod_main.f90:1134
character(len=80) startup_type
Definition: mod_main.f90:141
character(len=80), parameter startup_type_coldstart
Definition: mod_main.f90:154
real(sp), dimension(:), allocatable, target el1
Definition: mod_main.f90:1118
real(sp), dimension(:), allocatable, target et
Definition: mod_main.f90:1135
real(sp), dimension(:), allocatable, target elf
Definition: mod_main.f90:1140
subroutine wet_judge
Definition: mod_wd.f90:180
real(sp), dimension(:), allocatable, target dt1
Definition: mod_main.f90:1117
real(sp), dimension(:), allocatable, target h1
Definition: mod_main.f90:1115
real(sp), dimension(:), allocatable, target elf1
Definition: mod_main.f90:1123
integer ipt
Definition: mod_main.f90:922
real(sp), dimension(:), allocatable, target et1
Definition: mod_main.f90:1119
real(sp), dimension(:), allocatable, target dt
Definition: mod_main.f90:1133
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wd_update()

subroutine mod_wd::wd_update ( integer, intent(in)  INCASE)

Definition at line 253 of file mod_wd.f90.

253 
254 !------------------------------------------------------------------------------|
255 ! SHIFT WET/DRY VARIABLES TO NEW TIME LEVELS |
256 !------------------------------------------------------------------------------|
257 
258  USE mod_prec
259  USE all_vars
260  USE mod_par
261  IMPLICIT NONE
262  INTEGER, INTENT(IN) :: INCASE
263  INTEGER :: I
264 
265  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "START: WD_UPDATE"
266 
267  SELECT CASE(incase)
268 
269 !------------------------------------------------------------------------------!
270  CASE(1) !! SHIFT AT END OF EXTERNAL MODE
271 !------------------------------------------------------------------------------!
273 !------------------------------------------------------------------------------!
274  CASE(2) !! UPDATE NODE WET/DRY AFTER DEPTH ADJUSTMENT
275 !------------------------------------------------------------------------------!
276  DO i = 1,m
277  IF(dtfa(i)-min_depth <= 1.0e-5_sp) THEN
278  iswetn(i) = 0
279  END IF
280  END DO
281 
282 ! ------- New: Karsten Lettmann, 2017 Jan --------------------------
283 ! ----------------- end new ----------------------------------------
284 
285 !------------------------------------------------------------------------------!
286  CASE(3) !! SHIFT VARIABLES AT END OF INTERNAL MODE
287 !------------------------------------------------------------------------------!
288 
291 
292  END SELECT
293 
294  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "END: WD_UPDATE"
295  RETURN
integer, dimension(:), allocatable iswetce
Definition: mod_wd.f90:55
real(sp), dimension(:), allocatable, target dtfa
Definition: mod_main.f90:1124
integer, dimension(:), allocatable iswetct
Definition: mod_wd.f90:54
integer m
Definition: mod_main.f90:56
integer, dimension(:), allocatable iswetnt
Definition: mod_wd.f90:53
integer, dimension(:), allocatable iswetc
Definition: mod_wd.f90:52
integer ipt
Definition: mod_main.f90:922
real(sp) min_depth
Definition: mod_main.f90:210
integer, dimension(:), allocatable iswetn
Definition: mod_wd.f90:51
Here is the caller graph for this function:

◆ wet_judge()

subroutine mod_wd::wet_judge ( )

Definition at line 180 of file mod_wd.f90.

180 
181 !------------------------------------------------------------------------------|
182 ! DETERMINE IF NODES/ELEMENTS ARE WET OR DRY |
183 !------------------------------------------------------------------------------|
184 
185  USE mod_prec
186  USE all_vars
187  USE mod_par
188  IMPLICIT NONE
189  REAL(SP) :: DTMP
190  INTEGER :: ITA_TEMP
191  INTEGER :: I,IL,IA,IB,K1,K2,K3,K4,K5,K6
192 
193  integer :: KT
194 
195  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "START: WET_JUDGE"
196 !
197 !--Determine If Node Points Are Wet/Dry Based on Depth Threshold---------------!
198 !
199  iswetn = 1
200  DO i = 1, m
201  dtmp = h(i) + elf(i)
202 
203  IF((dtmp - min_depth) < 1.0e-5_sp) iswetn(i) = 0
204  END DO
205 
206 !
207 !--Determine if Cells are Wet/Dry Based on Depth Threshold---------------------!
208 !
209  iswetc = 1
210  DO i = 1, n
211  dtmp = max(elf(nv(i,1)),elf(nv(i,2)),elf(nv(i,3))) + &
212  min( h(nv(i,1)), h(nv(i,2)), h(nv(i,3)))
213 
214  IF((dtmp - min_depth) < 1.0e-5_sp) iswetc(i) = 0
215  END DO
216 
217 
218  ! ------ Karsten Lettmann, 2016, May ----------------
219  ! exchange the wet/dry information of elements between CPU
220  ! --------------------------------------------------
221 
222 !
223 !--A Secondary Condition for Nodal Dryness-(All Elements Around Node Are Dry)--!
224 !
225  DO i = 1, m
226  IF(sum(iswetc(nbve(i,1:ntve(i)))) == 0) iswetn(i) = 0
227  END DO
228 
229 !
230 !--Adjust Water Surface So It Does Not Go Below Minimum Depth------------------!
231 !
232  elf = max(elf,-h + min_depth)
233 
234 !
235 !--Recompute Element Based Depths----------------------------------------------!
236 !
237  DO i = 1, n
238  elf1(i) = one_third*(elf(nv(i,1))+elf(nv(i,2))+elf(nv(i,3)))
239  END DO
240 
241 !
242 !--Extend Element/Node Based Wet/Dry Flags to Domain Halo----------------------!
243 !
244 
245  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "END: WET_JUDGE"
246  RETURN
real(sp), dimension(:), allocatable, target h
Definition: mod_main.f90:1131
integer m
Definition: mod_main.f90:56
integer n
Definition: mod_main.f90:55
integer, dimension(:), allocatable, target ntve
Definition: mod_main.f90:1022
real(sp), dimension(:), allocatable, target elf
Definition: mod_main.f90:1140
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
integer, dimension(:), allocatable iswetc
Definition: mod_wd.f90:52
integer, dimension(:,:), allocatable, target nbve
Definition: mod_main.f90:1034
real(sp), dimension(:), allocatable, target elf1
Definition: mod_main.f90:1123
real(dp), parameter one_third
Definition: mod_main.f90:883
integer ipt
Definition: mod_main.f90:922
real(sp) min_depth
Definition: mod_main.f90:210
integer, dimension(:), allocatable iswetn
Definition: mod_wd.f90:51
Here is the caller graph for this function:

Variable Documentation

◆ iswetc

integer, dimension(:), allocatable mod_wd::iswetc

Definition at line 52 of file mod_wd.f90.

52  INTEGER , ALLOCATABLE :: ISWETC(:) !!CELL POROSITY AT CELLS FOR TIME N

◆ iswetce

integer, dimension(:), allocatable mod_wd::iswetce

Definition at line 55 of file mod_wd.f90.

55  INTEGER , ALLOCATABLE :: ISWETCE(:) !!CELL POROSITY AT CELLS FOR TIME N-1 EXTERNAL

◆ iswetct

integer, dimension(:), allocatable mod_wd::iswetct

Definition at line 54 of file mod_wd.f90.

54  INTEGER , ALLOCATABLE :: ISWETCT(:) !!CELL POROSITY AT CELLS FOR TIME N-1 INTERNAL

◆ iswetn

integer, dimension(:), allocatable mod_wd::iswetn

Definition at line 51 of file mod_wd.f90.

51  INTEGER , ALLOCATABLE :: ISWETN(:) !!NODE POROSITY AT NODES FOR TIME N

◆ iswetnt

integer, dimension(:), allocatable mod_wd::iswetnt

Definition at line 53 of file mod_wd.f90.

53  INTEGER , ALLOCATABLE :: ISWETNT(:) !!NODE POROSITY AT NODES FOR TIME N-1 INTERNAL