Page 1 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 1 !/ ------------------------------------------------------------------- / 2 MODULE W3SDB1MD 3 !/ 4 !/ +-----------------------------------+ 5 !/ | WAVEWATCH III NOAA/NCEP | 6 !/ | J. H. Alves | 7 !/ | H. L. Tolman | 8 !/ | FORTRAN 90 | 9 !/ | Last update : 29-May-2009 | 10 !/ +-----------------------------------+ 11 !/ 12 !/ 25-Apr-2007 : Origination of module. ( version 3.11 ) 13 !/ 29-May-2009 : Preparing distribution version. ( version 3.14 ) 14 !/ 15 !/ Copyright 2009 National Weather Service (NWS), 16 !/ National Oceanic and Atmospheric Administration. All rights 17 !/ reserved. WAVEWATCH III is a trademark of the NWS. 18 !/ No unauthorized use without permission. 19 !/ 20 ! 1. Purpose : 21 ! 22 ! Dummy slot for bottom friction source term. 23 ! 24 ! 2. Variables and types : 25 ! 26 ! 3. Subroutines and functions : 27 ! 28 ! Name Type Scope Description 29 ! ---------------------------------------------------------------- 30 ! W3SDB1 Subr. Public Battjes and Janssen depth-induced 31 ! breaking. 32 ! ---------------------------------------------------------------- 33 ! 34 ! 4. Subroutines and functions used : 35 ! 36 ! See subroutine documentation. 37 ! 38 ! 5. Remarks : 39 ! 40 ! 6. Switches : 41 ! 42 ! See subroutine documentation. 43 ! 44 ! 7. Source code : 45 !/ 46 !/ ------------------------------------------------------------------- / 47 !/ 48 PUBLIC 49 !/ 50 CONTAINS 51 !/ ------------------------------------------------------------------- / 52 SUBROUTINE W3SDB1 (A, K, DEPTH, EMEAN, FMEAN, WNMEAN, S, D ) 53 !/ 54 !/ +-----------------------------------+ 55 !/ | WAVEWATCH III NOAA/NCEP | 56 !/ | FORTRAN 90 | 57 !/ | J. H. Alves | Page 2 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 58 !/ | H. L. Tolman | 59 !/ | Last update : 25-Apr-2007 | 60 !/ +-----------------------------------+ 61 !/ 62 !/ 25-Apr-2007 : Origination of module. ( version 3.11 ) 63 !/ 64 ! 1. Purpose : 65 ! 66 ! Compute depth-induced breaking using Battjes and Janssen bore 67 ! model approach 68 ! 69 ! 2. Method : 70 ! 71 ! Sdb = - CDB * FMEAN * QB * B * B * SPEC 72 ! 73 ! Where CDB = 2.00 74 ! B = HM / HRMS 75 ! HM = GAMMA * DEP 76 ! GAMMA = 0.73 (average Battjes and Janssen value) 77 ! 78 ! And QB is estimated by iterations using the nonlinear expression 79 ! 80 ! 1 - QB = HRMS**2 81 ! ------ ------- 82 ! ln QB HM**2 83 ! 84 ! 3. Parameters : 85 ! 86 ! Parameter list 87 ! ---------------------------------------------------------------- 88 ! A R.A. I Action density spectrum (1-D) 89 ! K R.A. I Wavenumber for entire spectrum. *) 90 ! EMEAN Real I Mean wave energy. 91 ! FMEAN Real I Mean wave frequency. 92 ! WNMEAN Real I Mean wave number. 93 ! DEPTH Real I Mean water depth. 94 ! S R.A. O Source term (1-D version). 95 ! D R.A. O Diagonal term of derivative (1-D version). 96 ! ---------------------------------------------------------------- 97 ! 98 ! 4. Subroutines used : 99 ! 100 ! STRACE Subroutine tracing (!/S switch). 101 ! 102 ! 5. Called by : 103 ! 104 ! W3SRCE Source term integration. 105 ! W3EXPO Point output post-processor. 106 ! GXEXPO GrADS point output post-processor. 107 ! 108 ! 6. Error messages : 109 ! 110 ! None. 111 ! 112 ! 7. Remarks : 113 ! 114 ! - Note that the Miche criterion con influence wave growth. Page 3 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 115 ! 116 ! 8. Structure : 117 ! 118 ! See source code. 119 ! 120 ! 9. Switches : 121 ! 122 ! !/S Enable subroutine tracing. 123 ! !/Tn Enable test output. 124 ! 125 ! 10. Source code : 126 ! 127 !/ ------------------------------------------------------------------- / 128 !/ 129 USE CONSTANTS 130 USE W3GDATMD, ONLY: NK, NTH, NSPEC, SDBC1, SDBC2, FDONLY 131 USE W3ODATMD, ONLY: NDST 132 !/ 133 IMPLICIT NONE 134 !/ 135 !/ ------------------------------------------------------------------- / 136 !/ Parameter list 137 !/ 138 REAL, INTENT(IN) :: A(NSPEC), K(NSPEC), & 139 EMEAN, FMEAN, WNMEAN, DEPTH 140 REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC) 141 !/ 142 !/ ------------------------------------------------------------------- / 143 !/ Local parameters 144 !/ 145 INTEGER :: IS 146 REAL :: HM, BB, ARG, Q0, QB, B, CBJ, HRMS 147 !/ 148 !/ ------------------------------------------------------------------- / 149 !/ 150 ! 151 ! 0. Initialzations ------------------------------------------------- / 152 ! 153 ! 1. Source term parameters ------------------------------------------ / 154 ! 155 ! 1.a. Maximum wave height 156 ! 1.a.1. Simple limit 157 ! 158 IF ( FDONLY ) THEN 159 HM = SDBC2 * DEPTH 160 ELSE 161 ! 162 ! 1.a.2. Miche style criterion 163 ! 164 HM = SDBC2 / WNMEAN * TANH ( WNMEAN * MAX(DEPTH,0.) ) 165 END IF 166 ! 167 ! 1.b. Hrms and ratio Hrms / Hmax 168 ! 169 HRMS = SQRT ( 8. * MAX(0.,EMEAN) ) 170 IF ( HM .GT. 1.E-20 ) THEN 171 BB = HRMS * HRMS / ( HM * HM ) Page 4 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 172 B = SQRT(BB) 173 ELSE 174 B = 0. 175 END IF 176 ! 177 ! 2. Fraction of breaking waves -------------------------------------- / 178 ! 2.a. First guess breaking fraction 179 ! 180 IF ( B .LE. 0.5 ) THEN 181 Q0 = 0. 182 ELSE IF ( B .LE. 1.0 ) THEN 183 Q0 = ( 2. * B - 1. ) ** 2 184 END IF 185 ! 186 ! 2.b. Iterate to obtain actual breaking fraction 187 ! 188 IF ( B .LE. 0.2 ) THEN 189 QB = 0. 190 ELSE IF ( B .LT. 1.0 ) THEN 191 ARG = EXP (( Q0 - 1. ) / BB ) 192 QB = Q0 - BB * ( Q0 - ARG ) / ( BB - ARG ) 193 DO IS=1, 3 194 QB = EXP((QB-1.)/BB) 195 END DO 196 ELSE 197 QB = 1.0 - 1.E-20 198 END IF 199 ! 200 ! 3. Estimate the breaking coefficient ------------------------------- / 201 ! 202 IF ( ( BB .GT. 0. ) .AND. ( ABS ( BB - QB ) .GT. 0. ) ) THEN 203 IF ( BB .LT. 1.0 ) THEN 204 CBJ = SDBC1 * QB * FMEAN * HM * HM / EMEAN 205 ELSE 206 CBJ = SDBC1 * FMEAN / EMEAN 207 END IF 208 ELSE 209 CBJ = 0. 210 END IF 211 ! 212 ! 4. Source and diagonal terms --------------------------------------- / 213 ! 214 D = -1. * ( CBJ ) 215 S = D * A 216 ! 217 ! ... Test output of arrays 218 ! 219 RETURN 220 ! 221 ! Formats 222 ! 223 !/ 224 !/ End of W3SDB1 ----------------------------------------------------- / 225 !/ 226 END SUBROUTINE W3SDB1 Page 5 Source Listing W3SDB1 2014-09-16 16:53 Entry Points w3sdb1md.f90 ENTRY POINTS Name w3sdb1md_mp_w3sdb1_ SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References A Dummy 52 R(4) 4 1 0 ARG,IN 215 ABS Func 202 scalar 202 ARG Local 146 R(4) 4 scalar 191,192 B Local 146 R(4) 4 scalar 172,174,180,182,183,188,190 BB Local 146 R(4) 4 scalar 171,172,191,192,194,202,203 CBJ Local 146 R(4) 4 scalar 204,206,209,214 CONSTANTS Module 129 129 D Dummy 52 R(4) 4 1 0 ARG,OUT 214,215 DEPTH Dummy 52 R(4) 4 scalar ARG,IN 159,164 EMEAN Dummy 52 R(4) 4 scalar ARG,IN 169,204,206 EXP Func 191 scalar 191,194 FDONLY Local 130 L(4) 4 scalar PTR 130,158 FMEAN Dummy 52 R(4) 4 scalar ARG,IN 204,206 HM Local 146 R(4) 4 scalar 159,164,170,171,204 HRMS Local 146 R(4) 4 scalar 169,171 IS Local 145 I(4) 4 scalar 193 K Dummy 52 R(4) 4 1 0 ARG,IN MAX Func 164 scalar 164,169 NDST Local 131 I(4) 4 scalar PTR 131 NK Local 130 I(4) 4 scalar PTR 130 NSPEC Local 130 I(4) 4 scalar PTR 130,138,140 NTH Local 130 I(4) 4 scalar PTR 130 Q0 Local 146 R(4) 4 scalar 181,183,191,192 QB Local 146 R(4) 4 scalar 189,192,194,197,202,204 S Dummy 52 R(4) 4 1 0 ARG,OUT 215 SDBC1 Local 130 R(4) 4 scalar PTR 130,204,206 SDBC2 Local 130 R(4) 4 scalar PTR 130,159,164 SQRT Func 169 scalar 169,172 TANH Func 164 scalar 164 W3GDATMD Module 130 130 W3ODATMD Module 131 131 W3SDB1 Subr 52 WNMEAN Dummy 52 R(4) 4 scalar ARG,IN 164 Page 6 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 227 !/ 228 !/ End of module W3SDB1MD -------------------------------------------- / 229 !/ 230 END MODULE W3SDB1MD SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References W3SDB1MD Module 2 Page 7 Source Listing W3SDB1 2014-09-16 16:53 Subprograms/Common Blocks w3sdb1md.f90 SUBPROGRAMS/COMMON BLOCKS Name Object Declared Type Bytes Dimen Elements Attributes References W3SDB1 Subr 52 W3SDB1MD Module 2 COMPILER OPTIONS BEING USED -align nocommons -align nodcommons -align noqcommons -align records -align nosequence -align norec1byte -align norec2byte -align norec4byte -align norec8byte -align norec16byte -altparam -assume accuracy_sensitive -assume nobscc -assume nobuffered_io -assume byterecl -assume nocc_omp -assume nocstring -assume nodummy_aliases -assume nofpe_summary -assume noieee_fpe_flags -assume nominus0 -assume noold_boz -assume old_unit_star -assume old_ldout_format -assume noold_logical_ldio -assume old_maxminloc -assume old_xor -assume protect_constants -assume noprotect_parens -assume split_common -assume source_include -assume nostd_intent_in -assume nostd_mod_proc_name -assume norealloc_lhs -assume underscore -assume no2underscores -auto no -auto_scalar no -bintext -ccdefault default -check noargs -check noarg_temp_created -check nobounds -check noformat -check nooutput_conversion -check nooverflow -check nopointers -check power -check noshape -check nounderflow -check nouninitialized -coarray-num-procs 0 no -coarray-config-file -convert big_endian -cross_reference -D __INTEL_COMPILER=1210 -D __unix__ -D __unix -D __linux__ -D __linux -D __gnu_linux__ -D unix -D linux -D __ELF__ -D __x86_64 -D __x86_64__ -D _MT -D __INTEL_COMPILER_BUILD_DATE=20120612 -D __pentium4 -D __pentium4__ -D __tune_pentium4__ -D __SSE2__ -D __SSE3__ -D __SSSE3__ -D __SSE4_1__ -D __SSE4_2__ -D __SSE__ -D __MMX__ -D __AVX__ -double_size 64 no -d_lines no -Qdyncom -error_limit 30 no -f66 no -f77rtl no -fast -fpscomp nofilesfromcmd -fpscomp nogeneral -fpscomp noioformat -fpscomp noldio_spacing -fpscomp nologicals no -fpconstant Page 8 Source Listing W3SDB1 2014-09-16 16:53 w3sdb1md.f90 -fpe3 -fprm nearest no -ftz -fp_model noprecise -fp_model fast -fp_model nostrict -fp_model nosource -fp_model nodouble -fp_model noextended -fp_model novery_fast -fp_model noexcept -fp_model nono_except -heap_arrays 0 no -threadprivate_compat -free -g0 -iface nomixed_str_len_arg -iface nono_mixed_str_len_arg no -intconstant -integer_size 32 no -mixed_str_len_arg no -module -names lowercase no -noinclude -O2 no -pad_source -real_size 32 no -recursive -reentrancy none no -sharable_localsaves -vec=simd -show noinclude -show map -show options no -syntax_only no -threadcom no -U no -vms -w noall -w nonone -w alignments -w noargument_checking -w nodeclarations -w general -w noignore_bounds -w noignore_loc -w nointerfaces -w notruncated_source -w uncalled -w uninitialized -w nounused -w usage -includepath : /gpfs/gp1/usrx/local/intel/composer_xe_2011_sp1.11.339/compiler/include/,.f,./.f,/usrx/local/intel/composerxe/mkl/include/.f, /usrx/local/intel/composerxe/tbb/include/.f,/gpfs/gp1/usrx/local/intel/composer_xe_2011_sp1.11.339/compiler/include/intel64/.f, /gpfs/gp1/usrx/local/intel/composer_xe_2011_sp1.11.339/compiler/include/.f,/usr/local/include/.f,/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/.f, /usr/include/.f,/usr/include/.f -list filename : w3sdb1md.lst -o filename : none COMPILER: Intel(R) Fortran 12.1-2100