SUBROUTINE ana_wwave (ng, tile, model) ! !! svn $Id: ana_wwave.h 1794 2009-01-09 21:42:17Z arango $ !!====================================================================== !! Copyright (c) 2002-2009 The ROMS/TOMS Group ! !! Licensed under a MIT/X style license ! !! See License_ROMS.txt ! !======================================================================= ! ! ! This subroutine sets wind induced wave amplitude, direction and ! ! period to be used in the bottom boundary layer formulation. ! ! ! !======================================================================= ! USE mod_param USE mod_forces USE mod_grid USE mod_ncparam ! ! Imported variable declarations. ! integer, intent(in) :: ng, tile, model #include "tile.h" ! CALL ana_wwave_tile (ng, tile, model, & & LBi, UBi, LBj, UBj, & & IminS, ImaxS, JminS, JmaxS, & #if defined BBL_MODEL || defined NEARSHORE_MELLOR & FORCES(ng) % Dwave, & #endif #ifdef WAVES_HEIGHT & FORCES(ng) % Hwave, & #endif #ifdef WAVES_LENGTH & FORCES(ng) % Lwave, & #endif #ifdef WAVES_TOP_PERIOD & FORCES(ng) % Pwave_top, & #endif #ifdef WAVES_BOT_PERIOD & FORCES(ng) % Pwave_bot, & #endif #ifdef WAVES_UB & FORCES(ng) % Ub_swan, & #endif #ifdef TKE_WAVEDISS & FORCES(ng) % wave_dissip, & #endif & GRID(ng) % angler, & & GRID(ng) % h) ! ! Set analytical header file name used. ! #ifdef DISTRIBUTE IF (Lanafile) THEN #else IF (Lanafile.and.(tile.eq.0)) THEN #endif ANANAME(37)=__FILE__ END IF RETURN END SUBROUTINE ana_wwave ! !*********************************************************************** SUBROUTINE ana_wwave_tile (ng, tile, model, & & LBi, UBi, LBj, UBj, & & IminS, ImaxS, JminS, JmaxS, & #if defined BBL_MODEL || defined NEARSHORE_MELLOR & Dwave, & #endif #ifdef WAVES_HEIGHT & Hwave, & #endif #ifdef WAVES_LENGTH & Lwave, & #endif #ifdef WAVES_TOP_PERIOD & Pwave_top, & #endif #ifdef WAVES_BOT_PERIOD & Pwave_bot, & #endif #ifdef WAVES_UB & Ub_swan, & #endif #ifdef TKE_WAVEDISS & wave_dissip, & #endif & angler, h) !*********************************************************************** ! USE mod_param USE mod_scalars ! #if defined EW_PERIODIC || defined NS_PERIODIC USE exchange_2d_mod, ONLY : exchange_r2d_tile #endif #ifdef DISTRIBUTE USE mp_exchange_mod, ONLY : mp_exchange2d #endif ! ! Imported variable declarations. ! integer, intent(in) :: ng, tile, model integer, intent(in) :: LBi, UBi, LBj, UBj integer, intent(in) :: IminS, ImaxS, JminS, JmaxS ! #ifdef ASSUMED_SHAPE real(r8), intent(in) :: angler(LBi:,LBj:) real(r8), intent(in) :: h(LBi:,LBj:) # if defined BBL_MODEL || defined NEARSHORE_MELLOR real(r8), intent(inout) :: Dwave(LBi:,LBj:) # endif # ifdef WAVES_HEIGHT real(r8), intent(inout) :: Hwave(LBi:,LBj:) # endif # ifdef WAVES_LENGTH real(r8), intent(inout) :: Lwave(LBi:,LBj:) # endif # ifdef WAVES_TOP_PERIOD real(r8), intent(inout) :: Pwave_top(LBi:,LBj:) # endif # ifdef WAVES_BOT_PERIOD real(r8), intent(inout) :: Pwave_bot(LBi:,LBj:) # endif # ifdef WAVES_UB real(r8), intent(inout) :: Ub_swan(LBi:,LBj:) # endif # ifdef TKE_WAVEDISS real(r8), intent(inout) :: wave_dissip(LBi:,LBj:) # endif #else real(r8), intent(in) :: angler(LBi:UBi,LBj:UBj) real(r8), intent(in) :: h(LBi:UBi,LBj:UBj) # if defined BBL_MODEL || defined NEARSHORE_MELLOR real(r8), intent(inout) :: Dwave(LBi:UBi,LBj:UBj) # endif # ifdef WAVES_HEIGHT real(r8), intent(inout) :: Hwave(LBi:UBi,LBj:UBj) # endif # ifdef WAVES_LENGTH real(r8), intent(inout) :: Lwave(LBi:UBi,LBj:UBj) # endif # ifdef WAVES_TOP_PERIOD real(r8), intent(inout) :: Pwave_top(LBi:UBi,LBj:UBj) # endif # ifdef WAVES_BOT_PERIOD real(r8), intent(inout) :: Pwave_bot(LBi:UBi,LBj:UBj) # endif # ifdef WAVES_UB real(r8), intent(inout) :: Ub_swan(LBi:UBi,LBj:UBj) # endif # ifdef TKE_WAVEDISS real(r8), intent(inout) :: wave_dissip(LBi:UBi,LBj:UBj) # endif #endif ! ! Local variable declarations. ! #ifdef DISTRIBUTE # ifdef EW_PERIODIC logical :: EWperiodic=.TRUE. # else logical :: EWperiodic=.FALSE. # endif # ifdef NS_PERIODIC logical :: NSperiodic=.TRUE. # else logical :: NSperiodic=.FALSE. # endif #endif integer :: i, j real(r8) :: cff, wdir #if defined LAKE_SIGNELL real(r8) :: cff1, mxst, ramp_u, ramp_time, ramp_d #endif #include "set_bounds.h" ! !----------------------------------------------------------------------- ! Set wind induced wave amplitude (m), direction (radians) and ! period (s) at RHO-points. !----------------------------------------------------------------------- ! #if defined BL_TEST wdir=210.0_r8*deg2rad DO j=JstrR,JendR DO i=IstrR,IendR Hwave(i,j)=0.5_r8 Dwave(i,j)=wdir Pwave_bot(i,j)=8.0_r8 END DO END DO #elif defined SWF_FUGATE wdir=210.0_r8*deg2rad DO j=JstrR,JendR DO i=IstrR,IendR Hwave(i,j)=0.1_r8 Dwave(i,j)=wdir Pwave_bot(i,j)=8.0_r8 ! Pwave_top(i,j)=8.0_r8 ! Ub_swan(i,j)=0.05_r8 Lwave(i,j)=20.0_r8 END DO END DO #elif defined LAKE_SIGNELL mxst=0.25_r8 ! Wave amplitude (1/2 wave height) (meters) ramp_u=15.0_r8 ! start ramp UP at RAMP_UP (hours) ramp_time=10.0_r8 ! ramp from 0 to 1 over RAMP_TIME (hours) ramp_d=50.0_r8 ! start ramp DOWN at RAMP_DOWN (hours) DO j=JstrR,JendR DO i=Istr,IendR Dwave(i,j)=270.0_r8*deg2rad Pwave_bot(i,j)=5.0_r8 ! wave period (seconds) cff1=MIN((0.5_r8*(TANH((time(ng)/3600.0_r8-ramp_u)/ & & (ramp_time/5.0_r8))+1.0_r8)), & & (1.0_r8-(0.5_r8*(TANH((time(ng)/3600.0_r8-ramp_d)/ & & (ramp_time/5.0_r8))+1.0_r8)))) Hwave(i,j)=MAX((cff1*mxst),0.01_r8) END DO END DO #elif defined NJ_BIGHT !! wdir=210.0_r8*deg2rad wdir=150.0_r8*deg2rad IF ((tdays(ng)-dstart).lt.1.5_r8) THEN cff=TANH(0.5_r8*(tdays(ng)-dstart)) cff=1.0_r8 ELSE cff=1.0_r8 END IF DO j=JstrR,JendR DO i=IstrR,IendR Hwave(i,j)=0.12_r8 Dwave(i,j)=wdir-angler(i,j) Pwave_bot(i,j)=10.0_r8 END DO END DO #elif defined SED_TOY DO j=JstrR,JendR DO i=IstrR,IendR Hwave(i,j)=2.0_r8 Dwave(i,j)=90.0_r8*deg2rad Pwave_bot(i,j)=8.0_r8 Lwave(i,j)=20.0_r8 END DO END DO #else ana_wwave: No values provided for Hwave, Dwave, Pwave, Lwave. #endif #if defined EW_PERIODIC || defined NS_PERIODIC # if defined WAVES_DIR CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Dwave) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Dwave) # endif # endif # ifdef WAVES_HEIGHT CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Hwave) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Hwave) # endif # endif # ifdef WAVES_LENGTH CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Lwave) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Lwave) # endif # endif # ifdef WAVES_TOP_PERIOD CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Pwave_top) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Pwave_top) # endif # endif # ifdef WAVES_BOT_PERIOD CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Pwave_bot) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Pwave_bot) # endif # endif # ifdef WAVES_UB CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & Ub_swan) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & Ub_swan) # endif # endif # ifdef TKE_WAVEDISS CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & wave_dissip) # ifdef DISTRIBUTE CALL mp_exchange2d (ng, tile, model, 3, & & LBi, UBi, LBj, UBj, & & NghostPoints, EWperiodic, NSperiodic, & & wave_dissip) # endif # endif #endif RETURN END SUBROUTINE ana_wwave_tile