Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kthyng committed Nov 3, 2020
2 parents 41b81a3 + 3625469 commit 5488c3f
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![DOI](https://zenodo.org/badge/250098905.svg)](https://zenodo.org/badge/latestdoi/250098905)

# ROMS-OIL
Oil plume model coupled with ROMS

Expand Down
34 changes: 34 additions & 0 deletions ROMS/Modules/mod_clima.F
Original file line number Diff line number Diff line change
Expand Up @@ -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(:,:,:,:)
Expand Down Expand Up @@ -304,6 +314,15 @@ SUBROUTINE allocate_clima (ng, LBi, UBi, LBj, UBj)
#endif

!Added by DJ ------------------------
#if defined OFFLINE && defined 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
Expand Down Expand Up @@ -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)
Expand Down
27 changes: 27 additions & 0 deletions ROMS/Nonlinear/get_data.F
Original file line number Diff line number Diff line change
Expand Up @@ -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), &
Expand Down
67 changes: 67 additions & 0 deletions ROMS/Nonlinear/set_data.F
Original file line number Diff line number Diff line change
Expand Up @@ -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
!
!-----------------------------------------------------------------------
Expand Down
21 changes: 21 additions & 0 deletions ROMS/Nonlinear/vwalk_floats.F
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,18 @@ SUBROUTINE vwalk_floats_tile (ng, Lstr, Lend, &
logical, intent(in) :: Predictor
!
# ifdef ASSUMED_SHAPE
!MMMM added by Xu Chen

! logical, intent(in) :: bounded(:)

#if defined OFFLINE_FLOATS && defined FLOAT_VWALK
logical, intent(inout) :: bounded(:)
# else
logical, intent(in) :: bounded(:)
# endif

!WWWW added by Xu Chen

logical, intent(in) :: my_thread(Lstr:)

real(r8), intent(in) :: Tinfo(0:,:)
Expand All @@ -130,7 +141,17 @@ SUBROUTINE vwalk_floats_tile (ng, Lstr, Lend, &
real(r8), intent(inout) :: nudg(Lstr:)
real(r8), intent(inout) :: track(:,0:,:)
# else

!MMMM added by Xu Chen
! logical, intent(in) :: bounded(Nfloats(ng))

#if defined OFFLINE_FLOATS && defined FLOAT_VWALK
logical, intent(inout) :: bounded(Nfloats(ng))
# else
logical, intent(in) :: bounded(Nfloats(ng))
# endif
!WWWW added by Xu Chen

logical, intent(in) :: my_thread(Lstr:Lend)

real(r8), intent(in) :: Tinfo(0:izrhs,Nfloats(ng))
Expand Down

0 comments on commit 5488c3f

Please sign in to comment.