diff --git a/ROMS/Modules/mod_clima.F b/ROMS/Modules/mod_clima.F index 16e7ae0..f20320d 100755 --- a/ROMS/Modules/mod_clima.F +++ b/ROMS/Modules/mod_clima.F @@ -144,6 +144,16 @@ MODULE mod_clima ! real(r8), pointer :: Aclm(:,:,:) ! real(r8), pointer :: AclmG(:,:,:,:) !#endif + +#if defined OFFLINE && defined FLOAT_OIL + real(r8), pointer :: Uwind(:,:) + real(r8), pointer :: Vwind(:,:) +# ifdef ANA_WINDS + real(r8), pointer :: UwindG(:,:,:) + real(r8), pointer :: VwindG(:,:,:) +# endif +#endif + #if defined AKTCLIMATOLOGY || defined AKXCLIMATOLOGY real(r8), pointer :: AKtclm(:,:,:) real(r8), pointer :: AKtclmG(:,:,:,:) @@ -304,6 +314,15 @@ SUBROUTINE allocate_clima (ng, LBi, UBi, LBj, UBj) #endif !Added by DJ ------------------------ +#if defined OFFLINE && FLOAT_OIL + allocate ( CLIMA(ng) % Uwind(LBi:UBi,LBj:UBj) ) + allocate ( CLIMA(ng) % Vwind(LBi:UBi,LBj:UBj) ) +# ifdef ANA_WINDS + allocate ( CLIMA(ng) % UwindG(LBi:UBi,LBj:UBj,2) ) + allocate ( CLIMA(ng) % VwindG(LBi:UBi,LBj:UBj,2) ) +# endif +#endif + #if defined AKTCLIMATOLOGY || defined AKXCLIMATOLOGY allocate ( CLIMA(ng) % AKtclm(LBi:UBi,LBj:UBj,0:N(ng)) ) #endif @@ -610,6 +629,21 @@ SUBROUTINE initialize_clima (ng, tile) ! END DO !#endif +#if defined OFFLINE && defined FLOAT_OIL + DO j=Jmin,Jmax + DO i=Imin,Imax + CLIMA(ng) % Uwind(i,j) = IniVal + CLIMA(ng) % Vwind(i,j) = IniVal +#ifdef ANA_WINDS + CLIMA(ng) % UwindG(i,j,1) = IniVal + CLIMA(ng) % UwindG(i,j,2) = IniVal + CLIMA(ng) % VwindG(i,j,1) = IniVal + CLIMA(ng) % VwindG(i,j,2) = IniVal +#endif + END DO + END DO +#endif + #ifdef AKTCLIMATOLOGY DO j=Jmin,Jmax DO k=0,N(ng) diff --git a/ROMS/Nonlinear/get_data.F b/ROMS/Nonlinear/get_data.F index 68a1132..f70a2d1 100755 --- a/ROMS/Nonlinear/get_data.F +++ b/ROMS/Nonlinear/get_data.F @@ -1852,6 +1852,33 @@ SUBROUTINE get_data (ng) ! Added by DJ ------------------------------------ +#if defined OFFLINE && defined FLOAT_OIL +!----------------------------------------------------------------------- +! Surface wind components (necessary to include weathering effects on +! oil transport) +!----------------------------------------------------------------------- +! + CALL get_2dfld (ng, iNLM, idUair, ncFRCid(idUair,ng), & + & nFfiles(ng), FRC(1,ng), update(1), & + & LBi, UBi, LBj, UBj, 2, 1, & +# ifdef MASKING + & GRID(ng) % rmask, & +# endif + & FORCES(ng) % UwindG) + IF (FoundError(exit_flag, NoError, __LINE__, & + & __FILE__)) RETURN + + CALL get_2dfld (ng , iNLM, idVair, ncFRCid(idVair,ng), & + & nFfiles(ng), FRC(1,ng), update(1), & + & LBi, UBi, LBj, UBj, 2, 1, & +# ifdef MASKING + & GRID(ng) % rmask, & +# endif + & FORCES(ng) % VwindG) + IF (FoundError(exit_flag, NoError, __LINE__, & + & __FILE__)) RETURN +#endif + !# if !defined ANA_AKTCLIMA && defined AKTCLIMATOLOGY ! write(*,*) 'reading AKt in climatology file' ! CALL get_3dfld (ng, iNLM, idAclm, ncCLMid(idAclm,ng), & diff --git a/ROMS/Nonlinear/set_data.F b/ROMS/Nonlinear/set_data.F index d5c099a..98750e0 100755 --- a/ROMS/Nonlinear/set_data.F +++ b/ROMS/Nonlinear/set_data.F @@ -2337,6 +2337,73 @@ SUBROUTINE set_data_tile (ng, tile, & # endif # endif + +# if defined OFFLINE && defined FLOAT_OIL + +!----------------------------------------------------------------------- +! Set surface winds (m/s). +!----------------------------------------------------------------------- +! +# ifdef ANA_WINDS + CALL ana_winds (ng, tile, iNLM) +# else + CALL set_2dfld_tile (ng, tile, iNLM, idUair, & + & LBi, UBi, LBj, UBj, & + & FORCES(ng)%UwindG, & + & FORCES(ng)%Uwind, & + & update) + IF (FoundError(exit_flag, NoError, __LINE__, & + & __FILE__)) RETURN + + CALL set_2dfld_tile (ng, tile, iNLM, idVair, & + & LBi, UBi, LBj, UBj, & + & FORCES(ng)%VwindG, & + & FORCES(ng)%Vwind, & + & update) + IF (FoundError(exit_flag, NoError, __LINE__, & + & __FILE__)) RETURN + +# ifdef CURVGRID +! +! If input point surface winds or interpolated from coarse data, rotate +! to curvilinear grid. +! + IF (.not.Linfo(1,idUair,ng).or. & + & (Iinfo(5,idUair,ng).ne.Lm(ng)+2).or. & + & (Iinfo(6,idUair,ng).ne.Mm(ng)+2)) THEN + DO j=JstrR,JendR + DO i=IstrR,IendR + cff1=FORCES(ng)%Uwind(i,j)*GRID(ng)%CosAngler(i,j)+ & + & FORCES(ng)%Vwind(i,j)*GRID(ng)%SinAngler(i,j) + cff2=FORCES(ng)%Vwind(i,j)*GRID(ng)%CosAngler(i,j)- & + & FORCES(ng)%Uwind(i,j)*GRID(ng)%SinAngler(i,j) + FORCES(ng)%Uwind(i,j)=cff1 + FORCES(ng)%Vwind(i,j)=cff2 + END DO + END DO + + IF (EWperiodic(ng).or.NSperiodic(ng)) THEN + CALL exchange_r2d_tile (ng, tile, & + & LBi, UBi, LBj, UBj, & + & FORCES(ng)%UWind) + CALL exchange_r2d_tile (ng, tile, & + & LBi, UBi, LBj, UBj, & + & FORCES(ng)%VWind) + END IF + +# ifdef DISTRIBUTE + CALL mp_exchange2d (ng, tile, iNLM, 2, & + & LBi, UBi, LBj, UBj, & + & NghostPoints, & + & EWperiodic(ng), NSperiodic(ng), & + & FORCES(ng)%UWind, & + & FORCES(ng)%VWind) +# endif + END IF +# endif +# endif +# endif + # if defined SOLVE3D && defined OFFLINE ! !-----------------------------------------------------------------------