From 5341e86d2064f5e36b1acf5dfc94866b2d99d0de Mon Sep 17 00:00:00 2001 From: dkobashi Date: Mon, 29 Jun 2020 11:11:24 -0500 Subject: [PATCH 1/3] add wind velocity input for offline oil floats --- ROMS/Modules/mod_clima.F | 34 ++++++++++++++++++++ ROMS/Nonlinear/get_data.F | 27 ++++++++++++++++ ROMS/Nonlinear/set_data.F | 67 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) diff --git a/ROMS/Modules/mod_clima.F b/ROMS/Modules/mod_clima.F index 16e7ae0..2f5e050 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 OFFLINE_FLOATS + 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 391b7e2..c67789b 100755 --- a/ROMS/Nonlinear/set_data.F +++ b/ROMS/Nonlinear/set_data.F @@ -2303,6 +2303,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 ! !----------------------------------------------------------------------- From 606f7462fbd14f96b57df4807c402ac3c8b5b3d6 Mon Sep 17 00:00:00 2001 From: dkobashi Date: Mon, 29 Jun 2020 11:17:25 -0500 Subject: [PATCH 2/3] modify mod_clima.F --- ROMS/Modules/mod_clima.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROMS/Modules/mod_clima.F b/ROMS/Modules/mod_clima.F index 2f5e050..2225f4f 100755 --- a/ROMS/Modules/mod_clima.F +++ b/ROMS/Modules/mod_clima.F @@ -629,7 +629,7 @@ SUBROUTINE initialize_clima (ng, tile) ! END DO !#endif -#if defined OFFLINE && defined_FLOAT_OIL +#if defined OFFLINE && defined FLOAT_OIL DO j=Jmin,Jmax DO i=Imin,Imax CLIMA(ng) % Uwind(i,j) = IniVal From 90bedf85eb660921fc3e7c07cbc09177be25dc1d Mon Sep 17 00:00:00 2001 From: dkobashi Date: Mon, 29 Jun 2020 11:19:47 -0500 Subject: [PATCH 3/3] modify mod_clima.F again --- ROMS/Modules/mod_clima.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROMS/Modules/mod_clima.F b/ROMS/Modules/mod_clima.F index 2225f4f..f20320d 100755 --- a/ROMS/Modules/mod_clima.F +++ b/ROMS/Modules/mod_clima.F @@ -145,7 +145,7 @@ MODULE mod_clima ! real(r8), pointer :: AclmG(:,:,:,:) !#endif -#if defined OFFLINE && defined OFFLINE_FLOATS +#if defined OFFLINE && defined FLOAT_OIL real(r8), pointer :: Uwind(:,:) real(r8), pointer :: Vwind(:,:) # ifdef ANA_WINDS