My Project
depth_check.f90
Go to the documentation of this file.
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 !/===========================================================================/
13 ! Copyright (c) 2007, The University of Massachusetts Dartmouth
14 ! Produced at the School of Marine Science & Technology
15 ! Marine Ecosystem Dynamics Modeling group
16 ! All rights reserved.
17 !
18 ! FVCOM has been developed by the joint UMASSD-WHOI research team. For
19 ! details of authorship and attribution of credit please see the FVCOM
20 ! technical manual or contact the MEDM group.
21 !
22 !
23 ! This file is part of FVCOM. For details, see http://fvcom.smast.umassd.edu
24 ! The full copyright notice is contained in the file COPYRIGHT located in the
25 ! root directory of the FVCOM code. This original header must be maintained
26 ! in all distributed versions.
27 !
28 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30 ! THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31 ! PURPOSE ARE DISCLAIMED.
32 !
33 !/---------------------------------------------------------------------------/
34 ! CVS VERSION INFORMATION
35 ! $Id$
36 ! $Name$
37 ! $Revision$
38 !/===========================================================================/
39 
40 !==============================================================================|
41 ! ENSURE DEPTH IS GREATER THAN MIN_DEPTH |
42 ! IF THIS CONDITION IS VIOLATED, HALT THE PROGRAM AND WRITE A WARNING |
43 ! MESSAGE TO THE SCREEN |
44 !==============================================================================|
45 
46 SUBROUTINE depth_check
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 
93  END SUBROUTINE depth_check
94 !==============================================================================|
real(sp), dimension(:), allocatable, target d
Definition: mod_main.f90:1132
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
subroutine pstop
Definition: mod_utils.f90:273
subroutine depth_check
Definition: depth_check.f90:47
integer, dimension(:), pointer ngid
Definition: mod_par.f90:61
integer, parameter dbg_sbr
Definition: mod_utils.f90:69