ROMS
Loading...
Searching...
No Matches
ad_set_zeta_mod Module Reference

Functions/Subroutines

subroutine, public ad_set_zeta (ng, tile)
 
subroutine ad_set_zeta_tile (ng, tile, lbi, ubi, lbj, ubj, imins, imaxs, jmins, jmaxs, ad_zt_avg1, ad_zeta, ad_zeta_sol)
 

Function/Subroutine Documentation

◆ ad_set_zeta()

subroutine, public ad_set_zeta_mod::ad_set_zeta ( integer, intent(in) ng,
integer, intent(in) tile )

Definition at line 26 of file ad_set_zeta.F.

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, iadm, 12, __line__, myfile)
46# endif
47 CALL ad_set_zeta_tile (ng, tile, &
48 & lbi, ubi, lbj, ubj, &
49 & imins, imaxs, jmins, jmaxs, &
50 & coupling(ng) % ad_Zt_avg1, &
51 & ocean(ng) % ad_zeta, &
52 & ocean(ng) % ad_zeta_sol)
53# ifdef PROFILE
54 CALL wclock_off (ng, iadm, 12, __line__, myfile)
55# endif
56!
57 RETURN
type(t_coupling), dimension(:), allocatable coupling
type(t_ocean), dimension(:), allocatable ocean
Definition mod_ocean.F:351
integer, parameter iadm
Definition mod_param.F:665
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

References ad_set_zeta_tile(), mod_coupling::coupling, mod_param::iadm, mod_ocean::ocean, wclock_off(), and wclock_on().

Referenced by ad_main3d().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ad_set_zeta_tile()

subroutine ad_set_zeta_mod::ad_set_zeta_tile ( integer, intent(in) ng,
integer, intent(in) tile,
integer, intent(in) lbi,
integer, intent(in) ubi,
integer, intent(in) lbj,
integer, intent(in) ubj,
integer, intent(in) imins,
integer, intent(in) imaxs,
integer, intent(in) jmins,
integer, intent(in) jmaxs,
real(r8), dimension(lbi:,lbj:), intent(inout) ad_zt_avg1,
real(r8), dimension(lbi:,lbj:,:), intent(inout) ad_zeta,
real(r8), dimension(lbi:,lbj:), intent(out) ad_zeta_sol )
private

Definition at line 61 of file ad_set_zeta.F.

65!***********************************************************************
66!
67 USE mod_param
68 USE mod_scalars
69!
71# ifdef DISTRIBUTE
73# endif
74!
75! Imported variable declarations.
76!
77 integer, intent(in) :: ng, tile
78 integer, intent(in) :: LBi, UBi, LBj, UBj
79 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
80!
81# ifdef ASSUMED_SHAPE
82 real(r8), intent(inout) :: ad_Zt_avg1(LBi:,LBj:)
83 real(r8), intent(inout) :: ad_zeta(LBi:,LBj:,:)
84
85 real(r8), intent(out) :: ad_zeta_sol(LBi:,LBj:)
86# else
87 real(r8), intent(inout) :: ad_Zt_avg1(LBi:UBi,LBj:UBj)
88 real(r8), intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,3)
89
90 real(r8), intent(out) :: ad_zeta_sol(LBi:UBi,LBj:UBj)
91# endif
92!
93! Local variable declarations.
94!
95 integer :: i, j
96
97# include "set_bounds.h"
98!
99!-----------------------------------------------------------------------
100! Prepare to time-step adjoint 2D equations: set initial free-surface
101! to its fast-time averaged values (which corresponds to the time
102! step "n").
103!-----------------------------------------------------------------------
104!
105# ifdef DISTRIBUTE
106!^ CALL mp_exchange2d (ng, tile, iTLM, 2, &
107!^ & LBi, UBi, LBj, UBj, &
108!^ & NghostPoints, &
109!^ & EWperiodic(ng), NSperiodic(ng), &
110!^ & tl_zeta(:,:,1), &
111!^ & tl_zeta(:,:,2))
112!^
113 CALL ad_mp_exchange2d (ng, tile, iadm, 2, &
114 & lbi, ubi, lbj, ubj, &
115 & nghostpoints, &
116 & ewperiodic(ng), nsperiodic(ng), &
117 & ad_zeta(:,:,1), &
118 & ad_zeta(:,:,2))
119!
120# endif
121
122 IF (ewperiodic(ng).or.nsperiodic(ng)) THEN
123!^ CALL exchange_r2d_tile (ng, tile, &
124!^ & LBi, UBi, LBj, UBj, &
125!^ & tl_zeta(:,:,2))
126!^
127 CALL ad_exchange_r2d_tile (ng, tile, &
128 & lbi, ubi, lbj, ubj, &
129 & ad_zeta(:,:,2))
130!^ CALL exchange_r2d_tile (ng, tile, &
131!^ & LBi, UBi, LBj, UBj, &
132!^ & tl_zeta(:,:,1))
133!^
134 CALL ad_exchange_r2d_tile (ng, tile, &
135 & lbi, ubi, lbj, ubj, &
136 & ad_zeta(:,:,1))
137 END IF
138!
139! Save the adjoint free-surface solution for the current time-step
140! (sum of time indices 1 and 2).
141!
142 DO j=jstrr,jendr
143 DO i=istrr,iendr
144 ad_zeta_sol(i,j)=ad_zeta(i,j,1)+ad_zeta(i,j,2)
145 END DO
146 END DO
147!
148 DO j=jstrr,jendr
149 DO i=istrr,iendr
150!^ tl_zeta(i,j,2)=tl_Zt_avg1(i,j)
151!^ tl_zeta(i,j,1)=tl_Zt_avg1(i,j)
152!^
153 ad_zt_avg1(i,j)=ad_zt_avg1(i,j)+ &
154 & ad_zeta(i,j,1)+ad_zeta(i,j,2)
155 ad_zeta(i,j,2)=0.0_r8
156 ad_zeta(i,j,1)=0.0_r8
157 END DO
158 END DO
159!
160 RETURN
subroutine ad_exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, ad_a)
integer nghostpoints
Definition mod_param.F:710
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
subroutine ad_mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, ad_a, ad_b, ad_c, ad_d)

References ad_exchange_2d_mod::ad_exchange_r2d_tile(), mp_exchange_mod::ad_mp_exchange2d(), mod_scalars::ewperiodic, mod_param::iadm, mod_param::nghostpoints, and mod_scalars::nsperiodic.

Referenced by ad_set_zeta().

Here is the call graph for this function:
Here is the caller graph for this function: