4
5
6
7
8
9
10
11
12
13
14
15
18# ifdef BBL_MODEL_NOT_YET
20# endif
21# ifdef ADJUST_BOUNDARY
23# endif
24# ifdef SOLVE3D
26# endif
28# ifdef FOUR_DVAR
30# endif
33# ifdef SOLVE3D
35# endif
40
42# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
43 defined opt_observations || defined sensitivity_4dvar || \
44 defined so_semi
46# endif
47# if defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3
48
49# endif
52# ifdef DISTRIBUTE
54# endif
55# ifdef WET_DRY
57# endif
59# if defined SOLVE3D && defined NONLINEAR
61# endif
63# if defined WAV_COUPLING_NOT_YET && defined MCT_LIB
65# endif
66# ifdef SOLVE3D
71# endif
72# ifdef OBSERVATIONS
74# endif
75# ifdef MASKING
77# endif
80# ifdef WET_DRY
82# endif
83# if defined PROPAGATOR || \
84 (defined masking && (defined read_water || defined write_water))
86# endif
87
88 implicit none
89
90
91
92 integer, intent(in) :: ng
93
94
95
96 logical :: update = .false.
97
98 integer :: Fcount, IniRec, Tindex
99 integer :: thread, tile
100
101 real(dp) :: my_dstart
102
103 character (len=*), parameter :: MyFile = &
104 & __FILE__
105
106
107
108
109
111# if defined PERTURBATION
113 10 FORMAT (/,' <<<< Ensemble/Perturbation Run: ',i5.5,' >>>>',/)
114# elif defined I4DVAR || defined SENSITIVITY_4DVAR || \
115 defined rbl4dvar || defined r4dvar
117 10 FORMAT (/,' <<<< 4D Variational Data Assimilation, ', &
118 & 'Outer = ',i3.3, ', Inner = ',i3.3,' >>>>',/)
119# endif
120 WRITE (
stdout,20)
'AD_INITIAL: Configuring and ', &
121 & 'initializing adjoint model ...'
122 20 FORMAT (/,1x,a,a,/)
123 END IF
124
125
126
127
128
132# if defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3
135# else
139# endif
141
143# ifdef SOLVE3D
147# endif
148# ifdef FLOATS_NOT_YET
154# endif
155
159
160# ifdef GENERIC_DSTART
161
162
163
164
165
166
167
168
169
170
171 IF (
initime(ng).lt.0.0_dp)
THEN
173 ELSE
174 my_dstart=
initime(ng)/86400.0_dp
175 END IF
181#else
187#endif
189
191 tindex=1
192
193
194
199
200# ifdef PROFILE
201
202
203
204
205
206 DO thread=thread_range
208 END DO
209# endif
210
211# if defined FOUR_DVAR && \
212
213
214
215
216
217
218
219
220
221
224 END IF
225
226
227
229
230# ifdef ADJUST_BOUNDARY
231
232
233
235# endif
236# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
237
238
239
241# endif
242# endif
243
244
245
246
247
248
252 END IF
253
254
255
256
257# ifndef ANA_SPONGE
258
259
260# endif
261
262
265 END DO
266
267# ifdef ANA_SPONGE
268
269
270
271
272
273
277 END DO
278 END IF
279# endif
280
281
282
283
284
285
286# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
287 defined opt_observations || defined so_semi
288
289
290
291
292
296# if defined SOLVE3D
299# endif
302# ifdef ADJUST_BOUNDARY
304# endif
305 END DO
306
307# elif defined FOUR_DVAR && !defined I4DVAR_ANA_SENSITIVITY
308
309
310
311
312
313
314
319# if defined SOLVE3D
322# endif
325# ifdef ADJUST_BOUNDARY
327# endif
328 END DO
329
330# else
331
332# if defined SOLVE3D && !defined INI_FILE
333
334
335
336
337
338
341 END DO
342# endif
343
344
345
346
347
348# ifdef ANA_INITIAL
349
350
351
352 IF (
nrrec(ng).eq.0)
THEN
355 END DO
356 END IF
357# endif
358
359# if defined ANA_PASSIVE && defined SOLVE3D
360
361
362
363 IF (
nrrec(ng).eq.0)
THEN
366 END DO
367 END IF
368# endif
369
370# if defined ANA_BIOLOGY && defined SOLVE3D
371
372
373
374 IF (
nrrec(ng).eq.0)
THEN
377 END DO
378 END IF
379# endif
380
381# if defined ANA_SEDIMENT_NOT_YET && defined SOLVE3D
382
383
384
385 IF (
nrrec(ng).eq.0)
THEN
388 END DO
389 END IF
390# endif
391
392
393
394# ifdef INI_FILE
397# ifdef DISTRIBUTE
399# endif
401# else
402 IF (
nrrec(ng).ne.0)
THEN
405# ifdef DISTRIBUTE
407# endif
409 END IF
410# endif
411
412# ifdef INI_FILE
413# if defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3
414
415
416
417
418
419
420# endif
421# endif
422# endif
423
424# ifdef WET_DRY
425
426
427
428
429
430
431
432 IF (
nrrec(ng).ne.0)
THEN
433# ifdef DISTRIBUTE
436# else
438# endif
440 ELSE
442 CALL wetdry (ng, tile, tindex(ng), .true.)
443 END DO
444 END IF
445# endif
446
447# ifdef OBSERVATIONS
448
449
450
451
452
453
454
455
456# ifdef RBL4DVAR_FCT_SENSITIVITY
458# ifdef OBS_SPACE
460# endif
461# endif
463# ifdef OBS_SPACE
464 END IF
465# endif
466# ifdef RBL4DVAR_FCT_SENSITIVITY
467 END IF
468# endif
470# endif
471
472# if defined ANA_PERTURB && \
473 (defined sanity_check || defined r_symmetry)
474
475
476
477
478
481 END DO
482# endif
483
484# ifdef SOLVE3D
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513# endif
514
515#ifdef ANA_PSOURCE
516
517
518
519
520
521
522
523
527 END DO
528 END IF
529#endif
530
531
532
533
534
535
536
537
538
539
542# ifdef DISTRIBUTE
544# endif
546
547
548
549
550
551
552
555# ifdef DISTRIBUTE
557# endif
559
560# if defined SOLVE3D && defined ADM_DRIVER
561
562
563
564
565
567# ifdef NONLINEAR
569# endif
571 END DO
572# endif
573
574# ifdef MASKING
575
576
577
578
579
582 END DO
583# endif
584
585# if defined PROPAGATOR || \
586 (defined masking && (defined read_water || defined write_water) )
587
588
589
590
591
592
595 END DO
596# endif
597
598# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
599 defined opt_observations || defined sensitivity_4dvar || \
600 defined so_semi
601
602
603
604
605
606
607# ifdef SENSITIVITY_4DVAR
609# endif
610# if !defined AD_IMPULSE
613 END DO
614# endif
615# ifdef SENSITIVITY_4DVAR
616 END IF
617# endif
618# endif
619
620# if defined ANA_DRAG && defined UV_DRAG_GRID
621
622
623
624
625
629 END DO
630 END IF
631# endif
632
633
634
635
636
641 END DO
642 END IF
643
644# if defined FLOATS_NOT_YET || defined STATIONS
645
646
647
648
649
650
652# endif
653
654# if defined WAV_COUPLING_NOT_YET && defined MCT_LIB
655
656
657
658
659
661 CALL ocn2wav_coupling (ng, tile)
662 END DO
663# endif
664
665
666
667
668
671
672# ifdef PROFILE
673
674
675
676
677
678 DO thread=thread_range
680 END DO
681# endif
682 RETURN
subroutine ad_get_data(ng)
subroutine ad_get_idata(ng)
subroutine check_multifile(ng, model)
subroutine grid_coords(ng, model)
subroutine, public adsen_initial(ng, tile)
subroutine ana_sediment(ng, tile, model)
subroutine ana_initial(ng, tile, model)
subroutine ana_sponge(ng, tile, model)
subroutine ana_drag(ng, tile, model)
subroutine ana_psource(ng, tile, model)
subroutine ana_perturb(ng, tile, model)
subroutine ana_biology(ng, tile, model)
subroutine ana_passive(ng, tile, model)
subroutine, public close_inp(ng, model)
subroutine, public time_string(mytime, date_string)
subroutine, public get_state(ng, model, msg, s, inirec, tindex)
subroutine, public get_wetdry(ng, tile, model, inirec)
subroutine, public set_zeta_timeavg(ng, tile, model)
subroutine, public ini_hmixcoef(ng, tile, model)
subroutine, public initialize_boundary(ng, tile, model)
subroutine, public initialize_coupling(ng, tile, model)
subroutine, public initialize_forces(ng, tile, model)
logical, dimension(:), allocatable lsenfct
logical, dimension(:), allocatable lsen4dvar
logical, dimension(:), allocatable lobspace
subroutine, public initialize_grid(ng, tile, model)
type(t_io), dimension(:), allocatable iad
subroutine, public initialize_mixing(ng, tile, model)
subroutine, public initialize_ocean(ng, tile, model)
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
logical, dimension(:), allocatable luvsrc
real(dp), parameter day2sec
integer, dimension(:), allocatable obccount
integer, dimension(:), allocatable nrrec
logical, dimension(:,:), allocatable ltracersrc
integer, dimension(:), allocatable ntimes
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable dt
logical, dimension(:), allocatable lsponge
logical, dimension(:), allocatable setgridconfig
integer, dimension(:), allocatable next_kstp
logical, dimension(:), allocatable synchro_flag
logical, dimension(:), allocatable predictor_2d_step
integer, dimension(:), allocatable nfrec
real(dp), dimension(:), allocatable tdays
logical, dimension(:), allocatable ldefadj
logical, dimension(:), allocatable lwrtadj
logical, dimension(:), allocatable lwsrc
real(dp), parameter sec2day
integer, dimension(:), allocatable ntend
integer, dimension(:), allocatable first_time
character(len=22), dimension(:), allocatable time_code
integer, dimension(:), allocatable indx1
integer, dimension(:), allocatable sfcount
integer, dimension(:), allocatable ntfirst
real(dp), dimension(:), allocatable time
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable step_counter
integer, dimension(:), allocatable iif
real(dp), dimension(:), allocatable initime
integer, dimension(:), allocatable nfm2
integer, dimension(:), allocatable kstp
integer, dimension(:), allocatable knew
integer, dimension(:), allocatable nfm1
integer, dimension(:), allocatable nrhs
integer, dimension(:), allocatable nf
integer, dimension(:), allocatable nfm3
integer, dimension(:), allocatable nnew
integer, dimension(:), allocatable nfp1
integer, dimension(:), allocatable krhs
integer, dimension(:), allocatable nstp
subroutine, public obs_initial(ng, model, backward)
subroutine, public omega(ng, tile, model)
subroutine, public rho_eos(ng, tile, model)
subroutine, public set_depth(ng, tile, model)
subroutine, public set_masks(ng, tile, model)
subroutine, public set_massflux(ng, tile, model)
subroutine, public stiffness(ng, tile, model)
logical function, public founderror(flag, noerr, line, routine)
subroutine wetdry(ng, tile, tindex, linitialize)
subroutine set_grid(ng, model)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)
subroutine wpoints(ng, tile, model)