SUBROUTINE ana_stflux (ng, tile, model, itrc) ! !! git $Id$ !! svn $Id: ana_stflux.h 1151 2023-02-09 03:08:53Z arango $ !!====================================================================== !! Copyright (c) 2002-2023 The ROMS/TOMS Group ! !! Licensed under a MIT/X style license ! !! See License_ROMS.md ! !======================================================================= ! ! ! Sets surface flux of tracer type variables stflux(:,:,itrc) using ! ! analytical expressions (TracerUnits m/s). The surface fluxes are ! ! processed and loaded to state variable "stflx" in "set_vbc". ! ! ! !======================================================================= ! USE mod_param USE mod_forces USE mod_ncparam ! ! Imported variable declarations. ! integer, intent(in) :: ng, tile, model, itrc ! ! Local variable declarations. ! character (len=*), parameter :: MyFile = & & __FILE__ ! #include "tile.h" ! CALL ana_stflux_tile (ng, tile, model, itrc, & & LBi, UBi, LBj, UBj, & & IminS, ImaxS, JminS, JmaxS, & #ifdef SHORTWAVE & FORCES(ng) % srflx, & #endif & FORCES(ng) % stflux) ! ! Set analytical header file name used. ! #ifdef DISTRIBUTE IF (Lanafile) THEN #else IF (Lanafile.and.(tile.eq.0)) THEN #endif ANANAME(31)=MyFile END IF ! RETURN END SUBROUTINE ana_stflux ! !*********************************************************************** SUBROUTINE ana_stflux_tile (ng, tile, model, itrc, & & LBi, UBi, LBj, UBj, & & IminS, ImaxS, JminS, JmaxS, & #ifdef SHORTWAVE & srflx, & #endif & stflux) !*********************************************************************** ! USE mod_param USE mod_scalars ! USE exchange_2d_mod, ONLY : exchange_r2d_tile #ifdef DISTRIBUTE USE mp_exchange_mod, ONLY : mp_exchange2d #endif ! ! Imported variable declarations. ! integer, intent(in) :: ng, tile, model, itrc integer, intent(in) :: LBi, UBi, LBj, UBj integer, intent(in) :: IminS, ImaxS, JminS, JmaxS ! #ifdef ASSUMED_SHAPE # ifdef SHORTWAVE real(r8), intent(in) :: srflx(LBi:,LBj:) # endif real(r8), intent(inout) :: stflux(LBi:,LBj:,:) #else # ifdef SHORTWAVE real(r8), intent(in) :: srflx(LBi:UBi,LBj:UBj) # endif real(r8), intent(inout) :: stflux(LBi:UBi,LBj:UBj,NT(ng)) #endif ! ! Local variable declarations. ! integer :: i, j #include "set_bounds.h" ! !----------------------------------------------------------------------- ! Set surface net heat flux (degC m/s) at horizontal RHO-points. !----------------------------------------------------------------------- ! IF (itrc.eq.itemp) THEN #if defined MY_APPLICATION DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=??? END DO END DO #else DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=0.0_r8 END DO END DO #endif ! !----------------------------------------------------------------------- ! Set surface freshwater flux (m/s) at horizontal RHO-points. The ! scaling by surface salinity is done in "set_vbc". !----------------------------------------------------------------------- ! ELSE IF (itrc.eq.isalt) THEN #if defined MY_APPLICATION DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=??? END DO END DO #else DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=0.0_r8 END DO END DO #endif ! !----------------------------------------------------------------------- ! Set surface flux (Tunits m/s) of passive tracers at RHO-points, ! if any. !----------------------------------------------------------------------- ! ELSE #if defined MY_APPLICATION DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=??? END DO END DO END IF #else DO j=JstrT,JendT DO i=IstrT,IendT stflux(i,j,itrc)=0.0_r8 END DO END DO END IF #endif ! ! Exchange boundary data. ! IF (EWperiodic(ng).or.NSperiodic(ng)) THEN CALL exchange_r2d_tile (ng, tile, & & LBi, UBi, LBj, UBj, & & stflux(:,:,itrc)) END IF #ifdef DISTRIBUTE ! CALL mp_exchange2d (ng, tile, model, 1, & & LBi, UBi, LBj, UBj, & & NghostPoints, & & EWperiodic(ng), NSperiodic(ng), & & stflux(:,:,itrc)) #endif ! RETURN END SUBROUTINE ana_stflux_tile