My Project
Functions/Subroutines
depth_check.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine depth_check
 

Function/Subroutine Documentation

◆ depth_check()

subroutine depth_check ( )

Definition at line 47 of file depth_check.f90.

47 
48  !==============================================================================|
49  USE all_vars
50  USE mod_utils
51  USE mod_par
52  IMPLICIT NONE
53  INTEGER, DIMENSION(NPROCS) :: SBUF,RBUF
54  INTEGER :: I,II,MLOC,IERR, RECV
55  REAL(SP) :: DMIN
56  !==============================================================================|
57 
58  IF(dbg_set(dbg_sbr)) WRITE(ipt,*) "Start: depth_check"
59 !--Calculate Minimum Depth and Set Global Node Number if Min Depth < MIN_DEPTH
60  sbuf = 0
61  mloc = 0
62  ierr = 0
63  dmin = minval(d(1:m))
64  ! NGID NOW EXISTS FOR BOTH SERIAL AND PARALLEL
65  IF(dmin < min_depth) mloc = ngid(minloc(d(1:m),dim=1))
66 
67 !--Reduce in Master Processor Array and Dump To Screen
68  sbuf(myid) = mloc
69  rbuf = sbuf
70 
71 
72 !--If Depth Condition is Violated Write Warning and Halt User
73  IF(msr)THEN
74  IF(sum(rbuf) /= 0) THEN
75  DO i=1,nprocs
76  ii = rbuf(i)
77  IF(ii /= 0)THEN
78  ! WRITE(*,*)'DEPTH IN NODE: ',II,' AT ',XG(II)+VXMIN,YG(II)+VYMIN, &
79  ! ' IS LESS THAN MIN_DEPTH'
80 
81  WRITE(*,*)'DEPTH IN NODE: ',ii,'; IS LESS THAN MIN_DEPTH'
82  WRITE(*,*)'ADJUST BATHYMETRY AT THIS (THESE) LOCATION(S) OR'
83  WRITE(*,*)'RECOMPILE FVCOM WITH FLOODING/DRYING FORMULATION'
84  WRITE(*,*)'STOPPING....'
85  CALL pstop
86  END IF
87  END DO
88  END IF
89  END IF
90 
91  IF(dbg_set(dbg_sbr)) WRITE(ipt,*) "End: depth_check"
92 
real(sp), dimension(:), allocatable, target d
Definition: mod_main.f90:1132
logical msr
Definition: mod_main.f90:101
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
integer myid
Definition: mod_main.f90:67
integer, target nprocs
Definition: mod_main.f90:72
integer m
Definition: mod_main.f90:56
subroutine pstop
Definition: mod_utils.f90:273
integer, dimension(:), pointer ngid
Definition: mod_par.f90:61
integer ipt
Definition: mod_main.f90:922
integer, parameter dbg_sbr
Definition: mod_utils.f90:69
real(sp) min_depth
Definition: mod_main.f90:210
Here is the call graph for this function: