ROMS
Loading...
Searching...
No Matches
ad_post_initial.F
Go to the documentation of this file.
1#include "cppdefs.h"
3#ifdef ADJOINT
4!
5!git $Id$
6!svn $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! On the last timestep, it computes the adjoint of initial depths and !
14! level thicknesses from the initial free-surface field. Additionally,!
15! it initializes the adjoint state variables for all time levels and !
16! and applies lateral boundary conditions. !
17! !
18!=======================================================================
19!
20 USE mod_param
21 USE mod_parallel
22# ifdef NESTING
23 USE mod_scalars
24# endif
25!
27# ifdef SOLVE3D
28 USE set_depth_mod, ONLY : set_depth
29# endif
31# ifdef SOLVE3D
33# endif
34!
35 implicit none
36!
37 PUBLIC :: ad_post_initial
38 PRIVATE
39!
40 CONTAINS
41!
42!***********************************************************************
43 SUBROUTINE ad_post_initial (ng, model)
44!***********************************************************************
45!
46! Imported variable declarations.
47!
48 integer, intent(in) :: ng, model
49!
50! Local variable declarations.
51!
52 integer :: tile
53
54# ifdef NESTING
55!
56!-----------------------------------------------------------------------
57! Extract donor grid initial data at contact points and store it in
58! REFINED structure so it can be used for the space-time interpolation.
59!-----------------------------------------------------------------------
60!
61 IF (refinedgrid(ng)) THEN
62 CALL ad_nesting (ng, model, ngetd)
63 END IF
64# endif
65!
66!-----------------------------------------------------------------------
67! Initialize other state variables.
68!-----------------------------------------------------------------------
69!
70 DO tile=last_tile(ng),first_tile(ng),-1
71 CALL ad_ini_fields (ng, tile, model)
72 END DO
73!$OMP BARRIER
74!
75!-----------------------------------------------------------------------
76! Initialize free-surface and compute initial level thicknesses and
77! depths. Here we need nonlinear 'Zt_avg1' and 'Hz' to compute initial
78! 'ad_ubar' and 'ad_vbar'.
79!-----------------------------------------------------------------------
80!
81 DO tile=first_tile(ng),last_tile(ng),+1
82 CALL set_zeta_timeavg (ng, tile, inlm)
83 CALL set_depth (ng, tile, inlm)
84 CALL ad_set_depth (ng, tile, model)
85 CALL ad_ini_zeta (ng, tile, model)
86 END DO
87!$OMP BARRIER
88!
89 RETURN
90 END SUBROUTINE ad_post_initial
91#endif
92 END MODULE ad_post_initial_mod
subroutine, public ad_ini_fields(ng, tile, model)
subroutine, public ad_ini_zeta(ng, tile, model)
subroutine, public ad_post_initial(ng, model)
subroutine, public ad_set_depth(ng, tile, model)
subroutine, public set_zeta_timeavg(ng, tile, model)
Definition ini_fields.F:986
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, parameter inlm
Definition mod_param.F:662
logical, dimension(:), allocatable refinedgrid
subroutine, public set_depth(ng, tile, model)
Definition set_depth.F:34