ROMS
Loading...
Searching...
No Matches
tl_set_zeta.F
Go to the documentation of this file.
1#include "cppdefs.h"
3
4#if defined TANGENT && defined SOLVE3D
5!
6!git $Id$
7!================================================== Hernan G. Arango ===
8! Copyright (c) 2002-2025 The ROMS Group !
9! Licensed under a MIT/X style license !
10! See License_ROMS.md !
11!=======================================================================
12! !
13! This routine sets tangent linear free-surface to its fast-time !
14! averaged value. !
15! !
16!=======================================================================
17!
18 implicit none
19!
20 PRIVATE
21 PUBLIC :: tl_set_zeta
22!
23 CONTAINS
24!
25!***********************************************************************
26 SUBROUTINE tl_set_zeta (ng, tile)
27!***********************************************************************
28!
29 USE mod_param
30 USE mod_coupling
31 USE mod_ocean
32!
33! Imported variable declarations.
34!
35 integer, intent(in) :: ng, tile
36!
37! Local variable declarations.
38!
39 character (len=*), parameter :: myfile = &
40 & __FILE__
41!
42# include "tile.h"
43!
44# ifdef PROFILE
45 CALL wclock_on (ng, itlm, 12, __line__, myfile)
46# endif
47 CALL tl_set_zeta_tile (ng, tile, &
48 & lbi, ubi, lbj, ubj, &
49 & imins, imaxs, jmins, jmaxs, &
50 & coupling(ng) % tl_Zt_avg1, &
51 & ocean(ng) % tl_zeta)
52# ifdef PROFILE
53 CALL wclock_off (ng, itlm, 12, __line__, myfile)
54# endif
55!
56 RETURN
57 END SUBROUTINE tl_set_zeta
58!
59!***********************************************************************
60 SUBROUTINE tl_set_zeta_tile (ng, tile, &
61 & LBi, UBi, LBj, UBj, &
62 & IminS, ImaxS, JminS, JmaxS, &
63 & tl_Zt_avg1, tl_zeta)
64!***********************************************************************
65!
66 USE mod_param
67 USE mod_scalars
68!
70# ifdef DISTRIBUTE
72# endif
73!
74! Imported variable declarations.
75!
76 integer, intent(in) :: ng, tile
77 integer, intent(in) :: LBi, UBi, LBj, UBj
78 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
79!
80# ifdef ASSUMED_SHAPE
81 real(r8), intent(in) :: tl_Zt_avg1(LBi:,LBj:)
82
83 real(r8), intent(out) :: tl_zeta(LBi:,LBj:,:)
84# else
85 real(r8), intent(in) :: tl_Zt_avg1(LBi:UBi,LBj:UBj)
86
87 real(r8), intent(out) :: tl_zeta(LBi:UBi,LBj:UBj,3)
88# endif
89!
90! Local variable declarations.
91!
92 integer :: i, j
93
94# include "set_bounds.h"
95!
96!-----------------------------------------------------------------------
97! Prepare to time-step 2D equations: set initial free-surface
98! to its fast-time averaged values (which corresponds to the time
99! step "n").
100!-----------------------------------------------------------------------
101!
102 DO j=jstrr,jendr
103 DO i=istrr,iendr
104!^ zeta(i,j,1)=Zt_avg1(i,j)
105!^ zeta(i,j,2)=Zt_avg1(i,j)
106!^
107 tl_zeta(i,j,1)=tl_zt_avg1(i,j)
108 tl_zeta(i,j,2)=tl_zt_avg1(i,j)
109 END DO
110 END DO
111
112 IF (ewperiodic(ng).or.nsperiodic(ng)) THEN
113!^ CALL exchange_r2d_tile (ng, tile, &
114!^ & LBi, UBi, LBj, UBj, &
115!^ & zeta(:,:,1))
116!^
117 CALL exchange_r2d_tile (ng, tile, &
118 & lbi, ubi, lbj, ubj, &
119 & tl_zeta(:,:,1))
120!^ CALL exchange_r2d_tile (ng, tile, &
121!^ & LBi, UBi, LBj, UBj, &
122!^ & zeta(:,:,2))
123!^
124 CALL exchange_r2d_tile (ng, tile, &
125 & lbi, ubi, lbj, ubj, &
126 & tl_zeta(:,:,2))
127 END IF
128
129# ifdef DISTRIBUTE
130!^ CALL mp_exchange2d (ng, tile, iNLM, 2, &
131!^ & LBi, UBi, LBj, UBj, &
132!^ & NghostPoints, &
133!^ & EWperiodic(ng), NSperiodic(ng), &
134!^ & zeta(:,:,1), &
135!^ & zeta(:,:,2))
136!^
137 CALL mp_exchange2d (ng, tile, itlm, 2, &
138 & lbi, ubi, lbj, ubj, &
139 & nghostpoints, &
140 & ewperiodic(ng), nsperiodic(ng), &
141 & tl_zeta(:,:,1), &
142 & tl_zeta(:,:,2))
143# endif
144
145 RETURN
146 END SUBROUTINE tl_set_zeta_tile
147#endif
148 END MODULE tl_set_zeta_mod
subroutine exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
type(t_coupling), dimension(:), allocatable coupling
type(t_ocean), dimension(:), allocatable ocean
Definition mod_ocean.F:351
integer nghostpoints
Definition mod_param.F:710
integer, parameter itlm
Definition mod_param.F:663
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
subroutine mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine, public tl_set_zeta(ng, tile)
Definition tl_set_zeta.F:27
subroutine tl_set_zeta_tile(ng, tile, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, tl_zt_avg1, tl_zeta)
Definition tl_set_zeta.F:64
recursive subroutine wclock_off(ng, model, region, line, routine)
Definition timers.F:148
recursive subroutine wclock_on(ng, model, region, line, routine)
Definition timers.F:3