Page 1 Source Listing W3SBT1 2014-09-16 16:54 w3sbt1md.f90 1 !/ ------------------------------------------------------------------- / 2 MODULE W3SBT1MD 3 !/ 4 !/ +-----------------------------------+ 5 !/ | WAVEWATCH III NOAA/NCEP | 6 !/ | H. L. Tolman | 7 !/ | FORTRAN 90 | 8 !/ | Last update : 29-May-2009 | 9 !/ +-----------------------------------+ 10 !/ 11 !/ For updates see W3SBT1 documentation. 12 !/ 13 ! 1. Purpose : 14 ! 15 ! JONSWAP bottom friction routine. 16 ! 17 ! 2. Variables and types : 18 ! 19 ! 3. Subroutines and functions : 20 ! 21 ! Name Type Scope Description 22 ! ---------------------------------------------------------------- 23 ! W3SBT1 Subr. Public JONSWAP source term. 24 ! ---------------------------------------------------------------- 25 ! 26 ! 4. Subroutines and functions used : 27 ! 28 ! See subroutine documentation. 29 ! 30 ! 5. Remarks : 31 ! 32 ! 6. Switches : 33 ! 34 ! See subroutine documentation. 35 ! 36 ! 7. Source code : 37 !/ 38 !/ ------------------------------------------------------------------- / 39 !/ 40 PUBLIC 41 !/ 42 CONTAINS 43 !/ ------------------------------------------------------------------- / 44 SUBROUTINE W3SBT1 (A, CG, WN, DEPTH, S, D) 45 !/ 46 !/ +-----------------------------------+ 47 !/ | WAVEWATCH III NOAA/NCEP | 48 !/ | H. L. Tolman | 49 !/ | FORTRAN 90 | 50 !/ | Last update : 29-May-2009 | 51 !/ +-----------------------------------+ 52 !/ 53 !/ 05-Dec-1996 : Final FORTRAN 77. ( version 1.18 ) 54 !/ 08-Dec-1999 : Upgrade to FORTRAN 90. ( version 2.00 ) 55 !/ 20-Dec-2004 : Multiple model version. ( version 3.06 ) 56 !/ 29-May-2009 : Preparing distribution version. ( version 3.14 ) 57 !/ Page 2 Source Listing W3SBT1 2014-09-16 16:54 w3sbt1md.f90 58 !/ Copyright 2009 National Weather Service (NWS), 59 !/ National Oceanic and Atmospheric Administration. All rights 60 !/ reserved. WAVEWATCH III is a trademark of the NWS. 61 !/ No unauthorized use without permission. 62 !/ 63 ! 1. Purpose : 64 ! 65 ! Bottom friction source term according to the empirical JONSWAP 66 ! formulation. 67 ! 68 ! 2. Method : 69 ! 70 ! 2 GAMMA / CG \ SBTC1 / \ . 71 ! Sbt = ---------- | ------- - 0.5 | E = ----- | ... | E (1) 72 ! GRAV DEPTH \ SI/WN / DEPTH \ / 73 ! 74 ! Where GAMMA = -0.038 m2/s3 (JONSWAP) 75 ! = -0.067 m2/s3 (Bouws and Komen 1983) 76 ! 77 ! In the routine, the constant 2 GAMMA / GRAV = SBTC1. 78 ! D(IS) = (SBTC1 / DEPTH) * (CG(IK)*WN(IK)/SIG(IK)-0.5) 79 ! 80 ! However, note that in the code, we have 81 ! S = D * A 82 ! rather than 83 ! S = D * E 84 ! This suggests that the calling routine is 85 ! expecting "S/sigma" not "S" 86 ! 87 ! 3. Parameters : 88 ! 89 ! Parameter list 90 ! ---------------------------------------------------------------- 91 ! A R.A. I Action density spectrum (1-D) 92 ! CG R.A. I Group velocities. 93 ! WN R.A. I Wavenumbers. 94 ! DEPTH Real I Mean water depth. 95 ! S R.A. O Source term (1-D version). 96 ! D R.A. O Diagonal term of derivative (1-D version). 97 ! ---------------------------------------------------------------- 98 ! 99 ! 4. Subroutines used : 100 ! 101 ! Name Type Module Description 102 ! ---------------------------------------------------------------- 103 ! STRACE Subr. W3SERVMD Subroutine tracing (!/S switch). 104 ! PRT2DS Subr. W3ARRYMD Print plot output (!/T1 switch). 105 ! OUTMAT Subr. W3ARRYMD Matrix output (!/T2 switch). 106 ! ---------------------------------------------------------------- 107 ! 108 ! 5. Called by : 109 ! 110 ! Name Type Module Description 111 ! ---------------------------------------------------------------- 112 ! W3SRCE Subr. W3SRCEMD Source term integration. 113 ! W3EXPO Subr. N/A Point output post-processor. 114 ! GXEXPO Subr. N/A GrADS point output post-processor. Page 3 Source Listing W3SBT1 2014-09-16 16:54 w3sbt1md.f90 115 ! ---------------------------------------------------------------- 116 ! 117 ! 6. Error messages : 118 ! 119 ! None. 120 ! 121 ! 7. Remarks : 122 ! 123 ! 8. Structure : 124 ! 125 ! See source code. 126 ! 127 ! 9. Switches : 128 ! 129 ! !/S Enable subroutine tracing. 130 ! !/T Enable general test output. 131 ! !/T0 2-D print plot of source term. 132 ! !/T1 Print arrays. 133 ! 134 ! 10. Source code : 135 ! 136 !/ ------------------------------------------------------------------- / 137 USE W3GDATMD, ONLY: NK, NTH, NSPEC, SIG, MAPWN, SBTC1 138 ! 139 IMPLICIT NONE 140 !/ 141 !/ ------------------------------------------------------------------- / 142 !/ Parameter list 143 !/ 144 REAL, INTENT(IN) :: CG(NK), WN(NK), DEPTH, A(NSPEC) 145 REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC) 146 !/ 147 !/ ------------------------------------------------------------------- / 148 !/ Local parameters 149 !/ 150 INTEGER :: IS, IK, NSCUT 151 REAL :: FACTOR, CBETA(NK) 152 !/ 153 !/ ------------------------------------------------------------------- / 154 !/ 155 ! 156 ! 1. Deep water ===================================================== * 157 ! 158 IF ( DEPTH*WN(1) .GT. 6 ) THEN 159 ! 160 D = 0. 161 S = 0. 162 ! 163 ! 2. Shallow water ================================================== * 164 ! 165 ELSE 166 167 ! 168 ! 2.a Set constant 169 ! 170 FACTOR = SBTC1 / DEPTH 171 ! Page 4 Source Listing W3SBT1 2014-09-16 16:54 w3sbt1md.f90 172 ! 2.b Wavenumber dependent part. 173 ! 174 DO IK=1, NK 175 IF ( WN(IK)*DEPTH .GT. 6. ) EXIT 176 CBETA(IK) = FACTOR * & 177 MAX(0., (CG(IK)*WN(IK)/SIG(IK)-0.5) ) 178 END DO 179 ! 180 ! 2.c Fill diagional matrix 181 ! 182 NSCUT = (IK-1)*NTH 183 ! 184 DO IS=1, NSCUT 185 D(IS) = CBETA(MAPWN(IS)) 186 END DO 187 ! 188 DO IS=NSCUT+1, NSPEC 189 D(IS) = 0. 190 END DO 191 ! 192 S = D * A 193 ! 194 END IF 195 ! 196 ! ... Test output of arrays 197 ! 198 RETURN 199 ! 200 ! Formats 201 ! 202 !/ 203 !/ End of W3SBT1 ----------------------------------------------------- / 204 !/ 205 END SUBROUTINE W3SBT1 Page 5 Source Listing W3SBT1 2014-09-16 16:54 Entry Points w3sbt1md.f90 ENTRY POINTS Name w3sbt1md_mp_w3sbt1_ SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References A Dummy 44 R(4) 4 1 0 ARG,IN 192 CBETA Local 151 R(4) 4 1 0 176,185 CG Dummy 44 R(4) 4 1 0 ARG,IN 177 D Dummy 44 R(4) 4 1 0 ARG,OUT 160,185,189,192 DEPTH Dummy 44 R(4) 4 scalar ARG,IN 158,170,175 FACTOR Local 151 R(4) 4 scalar 170,176 IK Local 150 I(4) 4 scalar 174,175,176,177,182 IS Local 150 I(4) 4 scalar 184,185,188,189 MAPWN Local 137 I(4) 4 1 1 PTR 137,185 MAX Func 177 scalar 177 NK Local 137 I(4) 4 scalar PTR 137,144,151,174 NSCUT Local 150 I(4) 4 scalar 182,184,188 NSPEC Local 137 I(4) 4 scalar PTR 137,144,145,188 NTH Local 137 I(4) 4 scalar PTR 137,182 S Dummy 44 R(4) 4 1 0 ARG,OUT 161,192 SBTC1 Local 137 R(4) 4 scalar PTR 137,170 SIG Local 137 R(4) 4 1 1 PTR 137,177 W3GDATMD Module 137 137 W3SBT1 Subr 44 WN Dummy 44 R(4) 4 1 0 ARG,IN 158,175,177 Page 6 Source Listing W3SBT1 2014-09-16 16:54 w3sbt1md.f90 206 !/ 207 !/ End of module W3SBT1MD -------------------------------------------- / 208 !/ 209 END MODULE W3SBT1MD SYMBOL CROSS REFERENCE Name Object Declared Type Bytes Dimen Elements Attributes References W3SBT1MD Module 2 Page 7 Source Listing W3SBT1 2014-09-16 16:54 Subprograms/Common Blocks w3sbt1md.f90 SUBPROGRAMS/COMMON BLOCKS Name Object Declared Type Bytes Dimen Elements Attributes References W3SBT1 Subr 44 W3SBT1MD 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 W3SBT1 2014-09-16 16:54 w3sbt1md.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 : w3sbt1md.lst -o filename : none COMPILER: Intel(R) Fortran 12.1-2100