ROMS
Loading...
Searching...
No Matches
symmetry.h
Go to the documentation of this file.
1 MODULE roms_kernel_mod
2!
3!git $Id$
4!================================================== Hernan G. Arango ===
5! Copyright (c) 2002-2025 The ROMS Group !
6! Licensed under a MIT/X style license !
7! See License_ROMS.md !
8!=======================================================================
9! !
10! ROMS Representer Driver: !
11! !
12! This driver executes ROMS weak constraint 4DVAR inner loop and !
13! checks the symmetry of the H R R' H' operator, where R' and H' are !
14! transpose of R and H, respectively. The R' H' term is computed by !
15! integrating the adjoint model backwards while the H R is computed !
16! integrating forward the tangent linear model. !
17! !
18! It controls the initialization, time-stepping, and finalization of !
19! the model execution following ESMF conventions: !
20! !
21! ROMS_initialize !
22! ROMS_run !
23! ROMS_finalize !
24! !
25!=======================================================================
26!
27 USE mod_param
28 USE mod_parallel
29 USE mod_arrays
30 USE mod_fourdvar
31 USE mod_iounits
32 USE mod_ncparam
33 USE mod_ocean
34 USE mod_scalars
35 USE mod_stepping
36!
40 USE def_norm_mod, ONLY : def_norm
41#ifdef DISTRIBUTE
42 USE distribute_mod, ONLY : mp_bcastf
43#endif
44 USE get_state_mod, ONLY : get_state
45 USE inp_par_mod, ONLY : inp_par
48 USE strings_mod, ONLY : founderror
49 USE tl_def_ini_mod, ONLY : tl_def_ini
51 USE wrt_rst_mod, ONLY : wrt_rst
52!
53 implicit none
54!
55 PUBLIC :: roms_initialize
56 PUBLIC :: roms_run
57 PUBLIC :: roms_finalize
58!
59 CONTAINS
60!
61 SUBROUTINE roms_initialize (first, mpiCOMM)
62!
63!=======================================================================
64! !
65! This routine allocates and initializes ROMS state variables !
66! and internal and external parameters. !
67! !
68!=======================================================================
69!
70! Imported variable declarations.
71!
72 logical, intent(inout) :: first
73!
74 integer, intent(in), optional :: mpiCOMM
75!
76! Local variable declarations.
77!
78 logical :: allocate_vars = .true.
79!
80#ifdef DISTRIBUTE
81 integer :: MyError, MySize
82#endif
83 integer :: STDrec, Tindex
84 integer :: chunk_size, ng, thread
85#ifdef _OPENMP
86 integer :: my_threadnum
87#endif
88!
89 character (len=*), parameter :: MyFile = &
90 & __FILE__//", ROMS_initialize"
91
92#ifdef DISTRIBUTE
93!
94!-----------------------------------------------------------------------
95! Set distribute-memory (mpi) world communictor.
96!-----------------------------------------------------------------------
97!
98 IF (PRESENT(mpicomm)) THEN
99 ocn_comm_world=mpicomm
100 ELSE
101 ocn_comm_world=mpi_comm_world
102 END IF
103 CALL mpi_comm_rank (ocn_comm_world, myrank, myerror)
104 CALL mpi_comm_size (ocn_comm_world, mysize, myerror)
105#endif
106!
107!-----------------------------------------------------------------------
108! On first pass, initialize model parameters a variables for all
109! nested/composed grids. Notice that the logical switch "first"
110! is used to allow multiple calls to this routine during ensemble
111! configurations.
112!-----------------------------------------------------------------------
113!
114 IF (first) THEN
115 first=.false.
116!
117! Initialize parallel control switches. These scalars switches are
118! independent from standard input parameters.
119!
121!
122! Set the ROMS standard output unit to write verbose execution info.
123! Notice that the default standard out unit in Fortran is 6.
124!
125! In some applications like coupling or disjointed mpi-communications,
126! it is advantageous to write standard output to a specific filename
127! instead of the default Fortran standard output unit 6. If that is
128! the case, it opens such formatted file for writing.
129!
130 IF (set_stdoutunit) THEN
132 set_stdoutunit=.false.
133 END IF
134!
135! Read in model tunable parameters from standard input. Allocate and
136! initialize variables in several modules after the number of nested
137! grids and dimension parameters are known.
138!
139 CALL inp_par (inlm)
140 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
141!
142! Set domain decomposition tile partition range. This range is
143! computed only once since the "first_tile" and "last_tile" values
144! are private for each parallel thread/node.
145!
146#if defined _OPENMP
147 mythread=my_threadnum()
148#elif defined DISTRIBUTE
150#else
151 mythread=0
152#endif
153 DO ng=1,ngrids
154 chunk_size=(ntilex(ng)*ntilee(ng)+numthreads-1)/numthreads
155 first_tile(ng)=mythread*chunk_size
156 last_tile(ng)=first_tile(ng)+chunk_size-1
157 END DO
158!
159! Initialize internal wall clocks. Notice that the timings does not
160! includes processing standard input because several parameters are
161! needed to allocate clock variables.
162!
163 IF (master) THEN
164 WRITE (stdout,10)
165 10 FORMAT (/,' Process Information:',/)
166 END IF
167!
168 DO ng=1,ngrids
169 DO thread=thread_range
170 CALL wclock_on (ng, inlm, 0, __line__, myfile)
171 END DO
172 END DO
173!
174! Allocate and initialize modules variables.
175!
176 CALL roms_allocate_arrays (allocate_vars)
178 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
179
180 END IF
181!
182!-----------------------------------------------------------------------
183! Read in standard deviation factors for error covariance.
184!-----------------------------------------------------------------------
185!
186! Initial conditions standard deviation. They are loaded in Tindex=1
187! of the e_var(...,Tindex) state variables.
188!
189 stdrec=1
190 tindex=1
191 DO ng=1,ngrids
192 CALL get_state (ng, 10, 10, std(1,ng), stdrec, tindex)
193 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
194 END DO
195!
196! Model error standard deviation. They are loaded in Tindex=2
197! of the e_var(...,Tindex) state variables.
198!
199 stdrec=1
200 tindex=2
201 IF (nsa.eq.2) THEN
202 DO ng=1,ngrids
203 CALL get_state (ng, 11, 11, std(2,ng), stdrec, tindex)
204 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
205 END DO
206 END IF
207
208#ifdef ADJUST_BOUNDARY
209!
210! Open boundary conditions standard deviation.
211!
212 stdrec=1
213 tindex=1
214 DO ng=1,ngrids
215 CALL get_state (ng, 12, 12, std(3,ng), stdrec, tindex)
216 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
217 END DO
218#endif
219#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
220!
221! Surface forcing standard deviation.
222!
223 stdrec=1
224 tindex=1
225 DO ng=1,ngrids
226 CALL get_state (ng, 13, 13, std(4,ng), stdrec, tindex)
227 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
228 END DO
229#endif
230!
231 RETURN
232 END SUBROUTINE roms_initialize
233!
234 SUBROUTINE roms_run (RunInterval)
235!
236!=======================================================================
237! !
238! This routine time-steps ROMS weak constraint 4DVAR inner loop. !
239! !
240!=======================================================================
241!
242! Imported variable declarations
243!
244 real(dp), intent(in) :: RunInterval ! seconds
245!
246! Local variable declarations.
247!
248 logical :: BOUNDED_TL, Lposterior
249!
250 integer :: i, j, ng, tile
251 integer :: Lbck, Lini, Lstate, NRMrec, Rec1, Rec2
252 integer :: Fcount
253 integer :: IperAD, JperAD, KperAD, ivarAD
254 integer :: IoutTL, JoutTL, KoutTL, ivarTL
255#ifdef DISTRIBUTE
256 integer :: Istr, Iend, Jstr, Jend
257#endif
258 integer, dimension(Ngrids) :: Nrec
259
260 integer, allocatable :: StateVar(:)
261!
262 real(r8), allocatable :: R(:,:,:), Rerr(:,:)
263!
264 character (len=8 ) :: driver
265 character (len=24) :: frmt
266
267 character (len=*), parameter :: MyFile = &
268 & __FILE__//", ROMS_run"
269!
270!-----------------------------------------------------------------------
271! Run nonlinear model and compute basic state tracjectory.
272!-----------------------------------------------------------------------
273!
274 lini=1 ! NLM initial conditions record in INI
275 lbck=1 ! background record in INI
276 rec1=1
277 rec2=2
278 driver='symmetry'
279!
280! Initialize and set nonlinear model initial conditions.
281!
282 DO ng=1,ngrids
283 wrtnlmod(ng)=.false.
284 wrtrpmod(ng)=.false.
285 wrttlmod(ng)=.false.
286 END DO
287 CALL initial
288 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
289!
290! Run nonlinear model and compute basic state trajectory.
291!
292 DO ng=1,ngrids
293 IF (master) THEN
294 WRITE (stdout,10) 'NL', ng, ntstart(ng), ntend(ng)
295 END IF
296 END DO
297!
298#ifdef SOLVE3D
299 CALL main3d (runinterval)
300#else
301 CALL main2d (runinterval)
302#endif
303 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
304!
305! Set structure for the nonlinear forward trajectory to be processed
306! by the tangent linear and adjoint models. Also, set switches to
307! process the FWD structure in routine "check_multifile". Notice that
308! it is possible to split solution into multiple NetCDF files to reduce
309! their size.
310!
311 CALL edit_multifile ('HIS2FWD')
312 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
313 DO ng=1,ngrids
314 lreadfwd(ng)=.true.
315 END DO
316
317#ifdef FORWARD_FLUXES
318!
319! Set the BLK structure to contain the nonlinear model surface fluxes
320! needed by the tangent linear and adjoint models. Also, set switches
321! to process that structure in routine "check_multifile". Notice that
322! it is possible to split the solution into multiple NetCDF files to
323! reduce their size.
324!
325! The switch LreadFRC is deactivated because all the atmospheric
326! forcing, including shortwave radiation, is read from the NLM
327! surface fluxes or is assigned during ESM coupling. Such fluxes
328! are available from the QCK structure. There is no need for reading
329! and processing from the FRC structure input forcing-files.
330!
331 CALL edit_multifile ('QCK2BLK')
332 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
333 DO ng=1,ngrids
334 lreadblk(ng)=.true.
335 lreadfrc(ng)=.false.
336 END DO
337#endif
338!
339!-----------------------------------------------------------------------
340! Compute or read in background-error correlations normalization
341! factors.
342!-----------------------------------------------------------------------
343!
344! If computing, write out factors to NetCDF. This is an expensive
345! computation and needs to be computed once for a particular
346! application grid.
347!
348 DO ng=1,ngrids
349 IF (any(lwrtnrm(:,ng))) THEN
350 CALL def_norm (ng, inlm, 1)
351 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
352
353 IF (nsa.eq.2) THEN
354 CALL def_norm (ng, inlm, 2)
355 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
356 END IF
357#ifdef ADJUST_BOUNDARY
358 CALL def_norm (ng, inlm, 3)
359 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
360#endif
361#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
362 CALL def_norm (ng, inlm, 4)
363 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
364#endif
365
366 DO tile=first_tile(ng),last_tile(ng),+1
367 CALL normalization (ng, tile, 2)
368 END DO
369 ldefnrm(1:4,ng)=.false.
370 lwrtnrm(1:4,ng)=.false.
371 ELSE
372 nrmrec=1
373 CALL get_state (ng, 14, 14, nrm(1,ng), nrmrec, 1)
374 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
375
376 IF (nsa.eq.2) THEN
377 CALL get_state (ng, 15, 15, nrm(2,ng), nrmrec, 2)
378 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
379 END IF
380#ifdef ADJUST_BOUNDARY
381 CALL get_state (ng, 16, 16, nrm(3,ng), nrmrec, 1)
382 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
383#endif
384#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
385 CALL get_state (ng, 17, 17, nrm(4,ng), nrmrec, 1)
386 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
387#endif
388 END IF
389 END DO
390!
391! Define TLM impulse forcing NetCDF file.
392!
393 DO ng=1,ngrids
394 ldeftlf(ng)=.true.
395 CALL def_impulse (ng)
396 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
397 END DO
398!
399!=======================================================================
400! Perturb the adjoint state variable, one at the time, with a delta
401! function at the specified perturbation point. Integrate the adjoint
402! model backwards and the force the tangent linear model with the
403! result. Then, store tangent linear solution at the requested point
404! for each state variable.
405!=======================================================================
406!
407! Determine variables to perturb.
408!
409#ifdef SOLVE3D
410 allocate ( statevar(maxval(nstatevar)-2) )
411 statevar(1)=isfsur
412 statevar(2)=isuvel
413 statevar(3)=isvvel
414 DO i=1,mt
415 statevar(3+i)=istvar(i)
416 END DO
417 lstate=maxval(statevar)
418#else
419 allocate ( statevar(maxval(nstatevar)) )
420 statevar(1)=isfsur
421 statevar(2)=isubar
422 statevar(3)=isvbar
423 lstate=3
424#endif
425 allocate ( r(lstate,lstate,ngrids) )
426 allocate ( rerr(lstate,lstate) )
427!
428! Initialize sample representer matrix to report.
429!
430 r(1:lstate,1:lstate,1:ngrids)=0.0_r8
431!
432! Set point to perturb and point to report.
433!
434 ivartl=int(user(1))
435 ivarad=int(user(2))
436 iouttl=int(user(3))
437 iperad=int(user(4))
438 jouttl=int(user(5))
439 jperad=int(user(6))
440 kouttl=int(user(7))
441 kperad=int(user(8))
442!
443! Open tangent linear initial conditions NetCDF file (ITL struc) and
444! inquire about its variables IDs.
445!
446 DO ng=1,ngrids
447 ldefitl(ng)=.false.
448 CALL tl_def_ini (ng)
449 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
450 END DO
451!
452! Determine number of perturbation iterations.
453!
454 erstr=1
455#ifdef SOLVE3D
456 erend=minval(nstatevar)-2
457#else
458 erend=minval(nstatevar)
459#endif
460!
461 pert_loop : DO nrun=erstr,erend
462 user(2)=statevar(nrun)
463!
464!-----------------------------------------------------------------------
465! Time-step the adjoint model.
466!-----------------------------------------------------------------------
467!
468! Perturb the adjoint model at specified point.
469!
470 admodel=.true.
471 tlmodel=.false.
472 DO ng=1,ngrids
473 lold(ng)=1
474 CALL ad_initial (ng)
475 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
476 fcount=adm(ng)%load
477 adm(ng)%Nrec(fcount)=0
478 adm(ng)%Rindex=0
479 END DO
480!
481! Time-step adjoint model backwards forced with current PSI vector.
482!
483 DO ng=1,ngrids
484 IF (master) THEN
485 WRITE (stdout,10) 'AD', ng, ntstart(ng), ntend(ng)
486 END IF
487 END DO
488!
489#ifdef SOLVE3D
490 CALL ad_main3d (runinterval)
491#else
492 CALL ad_main2d (runinterval)
493#endif
494 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
495!
496!-----------------------------------------------------------------------
497! Convolve adjoint trajectory with model-error covariance and convert
498! to impulse forcing.
499!-----------------------------------------------------------------------
500!
501 lposterior=.false.
502 CALL error_covariance (itlm, driver, -1, -1, &
503 & lbck, lini, lold, lnew, &
504 & rec1, rec2, lposterior)
505 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
506!
507! Convert convolved adjoint solution to impulse forcing. Write out
508! impulse forcing into TLF(ng)%name NetCDF file. To facilitate the
509! forcing by the TLM and RPM, the forcing is process and written in
510! increasing time coordinates.
511!
512 DO ng=1,ngrids
513 tlf(ng)%Rindex=0
514#ifdef DISTRIBUTE
515 tile=myrank
516#else
517 tile=-1
518#endif
519 CALL wrt_impulse (ng, tile, iadm, adm(ng)%name)
520 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
521 END DO
522!
523!-----------------------------------------------------------------------
524! Integrate tangent linear model forced by the convolved adjoint
525! trajectory (impulse forcing) to compute R_n * PSI at observation
526! points.
527!-----------------------------------------------------------------------
528!
529! Initialize tangent linear model from rest. The initial contribution
530! from the adjoint model will be added as impulse forcing in
531! "tl_forcing".
532!
533 admodel=.false.
534 tlmodel=.false.
535 DO ng=1,ngrids
536 wrttlmod(ng)=.false.
537 CALL tl_initial (ng)
538 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
539 END DO
540!
541! Run tangent linear model forward and force with convolved adjoint
542! trajectory impulses. Compute R_n * PSI at observation points which
543! are used in the conjugate gradient algorithm.
544!
545 DO ng=1,ngrids
546 IF (master) THEN
547 WRITE (stdout,10) 'TL', ng, ntstart(ng), ntend(ng)
548 END IF
549 END DO
550!
551#ifdef SOLVE3D
552 CALL tl_main3d (runinterval)
553#else
554 CALL tl_main2d (runinterval)
555#endif
556 IF (founderror(exit_flag, noerror, __line__, myfile)) RETURN
557!
558! Extract solution at requested points.
559!
560 DO ng=1,ngrids
561#ifdef DISTRIBUTE
562 istr=bounds(ng)%Istr(myrank)
563 iend=bounds(ng)%Iend(myrank)
564 jstr=bounds(ng)%Jstr(myrank)
565 jend=bounds(ng)%Jend(myrank)
566 bounded_tl=((istr.le.iouttl).and.(iouttl.le.iend)).and. &
567 & ((jstr.le.jouttl).and.(jouttl.le.jend))
568#else
569 bounded_tl=.true.
570#endif
571 r(1,nrun,ng)=ocean(ng)%tl_zeta(iouttl,jouttl,knew(ng))
572#ifndef SOLVE3D
573 r(2,nrun,ng)=ocean(ng)%tl_ubar(iouttl,jouttl,knew(ng))
574 r(3,nrun,ng)=ocean(ng)%tl_vbar(iouttl,jouttl,knew(ng))
575#else
576 r(2,nrun,ng)=ocean(ng)%tl_u(iouttl,jouttl,kouttl,nstp(ng))
577 r(3,nrun,ng)=ocean(ng)%tl_v(iouttl,jouttl,kouttl,nstp(ng))
578 DO i=1,nt(ng)
579 r(i+3,nrun,ng)=ocean(ng)%tl_t(iouttl,jouttl,kouttl, &
580 & nstp(ng),i)
581 END DO
582#endif
583 END DO
584
585 END DO pert_loop
586!
587! Report sampled representer matrix and report symmetry.
588!
589 DO ng=1,ngrids
590#ifdef DISTRIBUTE
591 CALL mp_bcastf (ng, itlm, r(:,:,ng))
592#endif
593 IF (master) THEN
594 WRITE (stdout,20) 'Representer Matrix Symmetry Test: ', &
595 & 'Perturbing Point: ', &
596 & iperad, jperad, kperad, &
597 & 'Sampling Point: ', &
598 & iouttl, jouttl, kouttl
599 WRITE (stdout,30) 'Sampled Representer Matrix: '
600 WRITE (frmt,'(a,i0,a)') '(', lstate, '(1x,1p,e14.7,0p))'
601!! WRITE (frmt,'(a)') '(*(1x,1p,e14.7,0p))' ! FORTRAN 2008
602 WRITE (stdout,'(a,a)') 'My Format: ', frmt
603 DO i=1,lstate
604 DO j=1,lstate
605 rerr(i,j)=r(i,j,ng)-r(j,i,ng)
606 END DO
607 END DO
608 DO i=1,lstate
609 WRITE (stdout,frmt) (r(i,j,ng),j=1,lstate)
610 END DO
611 WRITE (stdout,30) 'Representer Matrix Symmetry Error: '
612 DO i=1,lstate
613 WRITE (stdout,frmt) (rerr(i,j),j=1,lstate)
614 END DO
615 END IF
616 END DO
617!
618 10 FORMAT (/,1x,a,1x,'ROMS: started time-stepping:', &
619 & ' (Grid: ',i2.2,' TimeSteps: ',i8.8,' - ',i8.8,')',/)
620 20 FORMAT (/,1x,a,/,/,3x,a,' i = ',i4.4,' j = ',i4.4,' k = ',i4.4, &
621 & /,3x,a,' i = ',i4.4,' j = ',i4.4,' k = ',i4.4)
622 30 FORMAT (/,1x,a,/)
623!
624 RETURN
625 END SUBROUTINE roms_run
626!
627 SUBROUTINE roms_finalize
628!
629!=======================================================================
630! !
631! This routine terminates ROMS nonlinear model execution. !
632! !
633!=======================================================================
634!
635 USE mod_param
636 USE mod_parallel
637 USE mod_iounits
638 USE mod_ncparam
639 USE mod_scalars
640!
641! Local variable declarations.
642!
643 integer :: Fcount, ng, thread
644!
645 character (len=*), parameter :: MyFile = &
646 & __FILE__//", ROMS_finalize"
647!
648!-----------------------------------------------------------------------
649! If blowing-up, save latest model state into RESTART NetCDF file.
650!-----------------------------------------------------------------------
651!
652! If cycling restart records, write solution into the next record.
653!
654 IF (exit_flag.eq.1) THEN
655 DO ng=1,ngrids
656 IF (lwrtrst(ng)) THEN
657 IF (master) WRITE (stdout,10)
658 10 FORMAT (/,' Blowing-up: Saving latest model state into ', &
659 & ' RESTART file',/)
660 fcount=rst(ng)%load
661 IF (lcyclerst(ng).and.(rst(ng)%Nrec(fcount).ge.2)) THEN
662 rst(ng)%Rindex=2
663 lcyclerst(ng)=.false.
664 END IF
667#ifdef DISTRIBUTE
668 CALL wrt_rst (ng, myrank)
669#else
670 CALL wrt_rst (ng, -1)
671#endif
672 END IF
673 END DO
674 END IF
675!
676!-----------------------------------------------------------------------
677! Stop model and time profiling clocks, report memory requirements, and
678! close output NetCDF files.
679!-----------------------------------------------------------------------
680!
681! Stop time clocks.
682!
683 IF (master) THEN
684 WRITE (stdout,20)
685 20 FORMAT (/,'Elapsed wall CPU time for each process (seconds):',/)
686 END IF
687!
688 DO ng=1,ngrids
689 DO thread=thread_range
690 CALL wclock_off (ng, inlm, 0, __line__, myfile)
691 END DO
692 END DO
693!
694! Report dynamic memory and automatic memory requirements.
695!
696 CALL memory
697!
698! Close IO files.
699!
700 DO ng=1,ngrids
701 CALL close_inp (ng, inlm)
702 END DO
703 CALL close_out
704!
705 RETURN
706 END SUBROUTINE roms_finalize
707
708 END MODULE roms_kernel_mod
subroutine ad_initial(ng)
Definition ad_initial.F:4
subroutine ad_main2d
Definition ad_main2d.F:586
subroutine ad_main3d(runinterval)
Definition ad_main3d.F:4
subroutine edit_multifile(task)
subroutine initial
Definition initial.F:3
subroutine main2d
Definition main2d.F:746
subroutine main3d(runinterval)
Definition main3d.F:4
subroutine memory
Definition memory.F:3
subroutine, public close_out
Definition close_io.F:175
subroutine, public close_inp(ng, model)
Definition close_io.F:92
subroutine, public error_covariance(model, driver, outloop, innloop, rbck, rini, rold, rnew, rec1, rec2, lposterior)
Definition convolve.F:215
subroutine, public def_impulse(ng)
Definition def_impulse.F:49
subroutine, public def_norm(ng, model, ifile)
Definition def_norm.F:53
subroutine, public get_state(ng, model, msg, s, inirec, tindex)
Definition get_state.F:90
subroutine, public inp_par(model)
Definition inp_par.F:56
subroutine, public roms_initialize_arrays
Definition mod_arrays.F:351
subroutine, public roms_allocate_arrays(allocate_vars)
Definition mod_arrays.F:114
logical, dimension(:), allocatable wrtrpmod
logical, dimension(:), allocatable wrttlmod
logical, dimension(:), allocatable wrtnlmod
integer, dimension(:), allocatable nstatevar
type(t_io), dimension(:,:), allocatable std
type(t_io), dimension(:,:), allocatable nrm
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable tlf
type(t_io), dimension(:), allocatable rst
integer stdout
integer isvvel
integer isvbar
integer, dimension(:), allocatable istvar
integer isuvel
integer isfsur
integer isubar
type(t_ocean), dimension(:), allocatable ocean
Definition mod_ocean.F:351
subroutine, public initialize_parallel
integer numthreads
integer, dimension(:), allocatable first_tile
integer mythread
logical master
integer, dimension(:), allocatable last_tile
integer ocn_comm_world
integer, parameter inlm
Definition mod_param.F:662
type(t_bounds), dimension(:), allocatable bounds
Definition mod_param.F:232
integer, dimension(:), allocatable ntilex
Definition mod_param.F:685
integer, parameter iadm
Definition mod_param.F:665
integer ngrids
Definition mod_param.F:113
integer, dimension(:), allocatable ntilee
Definition mod_param.F:686
integer mt
Definition mod_param.F:490
integer, parameter itlm
Definition mod_param.F:663
integer, dimension(:), allocatable nt
Definition mod_param.F:489
integer nsa
Definition mod_param.F:612
logical, dimension(:,:), allocatable lwrtnrm
logical, dimension(:), allocatable ldefitl
logical tlmodel
integer blowup
logical, dimension(:), allocatable ldeftlf
real(r8), dimension(:), allocatable user
integer erend
logical, dimension(:), allocatable lreadfrc
logical admodel
integer, dimension(:), allocatable ntend
logical, dimension(:,:), allocatable ldefnrm
integer exit_flag
integer erstr
logical, dimension(:), allocatable lwrtrst
integer, dimension(:), allocatable ntstart
integer nrun
logical, dimension(:), allocatable lreadfwd
integer noerror
logical, dimension(:), allocatable lcyclerst
logical, dimension(:), allocatable lreadblk
integer, dimension(:), allocatable lold
integer, dimension(:), allocatable knew
integer, dimension(:), allocatable lnew
integer, dimension(:), allocatable nstp
subroutine, public normalization(ng, tile, ifac)
subroutine, public roms_finalize
Definition ad_roms.h:283
subroutine, public roms_run(runinterval)
Definition ad_roms.h:239
subroutine, public roms_initialize(first, mpicomm)
Definition ad_roms.h:52
integer function, public stdout_unit(mymaster)
Definition stdout_mod.F:48
logical, save set_stdoutunit
Definition stdout_mod.F:41
logical function, public founderror(flag, noerr, line, routine)
Definition strings.F:52
subroutine, public tl_def_ini(ng)
Definition tl_def_ini.F:43
subroutine, public wrt_impulse(ng, tile, model, inpncname)
Definition wrt_impulse.F:59
subroutine, public wrt_rst(ng, tile)
Definition wrt_rst.F:63
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
subroutine tl_initial(ng)
Definition tl_initial.F:4
subroutine tl_main2d
Definition tl_main2d.F:429
subroutine tl_main3d(runinterval)
Definition tl_main3d.F:4