3
4
5
6
7
8
9
10
11
12
13
14
17#ifdef BBL_MODEL
19#endif
20#ifdef FOUR_DVAR
22#endif
26#ifdef NESTING
28#endif
32
36#if defined FOUR_DVAR && !defined CORRELATION
38#endif
39#ifdef DISTRIBUTE
41#endif
43#ifdef WET_DRY
45#endif
46#ifdef TLM_CHECK
48#endif
49#if defined SOLVE3D && defined NONLINEAR
51#endif
53#if defined WAV_COUPLING && defined MCT_LIB
55#endif
56#ifdef NESTING
58#endif
59#ifdef SOLVE3D
64#endif
65#if defined OBSERVATIONS && !defined RBL4DVAR_FCT_SENSITIVITY
67#endif
68#ifdef MASKING
70#endif
73#ifdef WET_DRY
75#endif
76#if defined PROPAGATOR || \
77 (defined masking && (defined read_water || defined write_water))
79#endif
80
81 implicit none
82
83
84
85 logical :: update = .false.
86
87 integer :: Fcount
88 integer :: ng, thread, tile
89#ifdef NESTING
90 integer :: ig, nl
91 integer :: cr, i, m
92#endif
93
94 integer, dimension(Ngrids) :: IniRec, Tindex
95
96#if defined ADJUST_BOUNDARY || \
97 defined adjust_stflux || defined adjust_wstress
98 integer :: irec
99#endif
100
101#ifdef SP4DVAR
102 real(dp) :: my_dstart
103
104#endif
105
106 character (len=*), parameter :: MyFile = &
107 & __FILE__
108
109
110
111
112
113
115#if defined PERTURBATION
117 10 FORMAT (/,' <<<< Ensemble/Perturbation Run: ',i5.5,' >>>>',/)
118#elif defined I4DVAR || defined RBL4DVAR || \
119 defined r4dvar || defined sensitivity_4dvar || \
120 defined tl_rbl4dvar || defined tl_r4dvar
122 10 FORMAT (/,' <<<< 4D Variational Data Assimilation, ', &
123 & 'Outer = ',i3.3, ', Inner = ',i3.3,' >>>>',/)
124#endif
125 WRITE (
stdout,20)
'INITIAL: Configuring and initializing ', &
126 & 'forward nonlinear model ...'
127 20 FORMAT (/,1x,a,a,/,1x,'*******')
128 END IF
129
130
131
132
133
134
143
148#ifdef FLOATS
154#endif
155
157 tindex(ng)=1
158
161#ifdef SP4DVAR
162 IF (
initime(ng).lt.0.0_dp)
THEN
164 ELSE
165 my_dstart=
initime(ng)/86400.0_dp
166 END IF
167#else
169#endif
171
175
176
178 END DO
179
180
181
186
187#ifdef PROFILE
188
189
190
191
192
194 DO thread=thread_range
196 END DO
197 END DO
198
199#endif
200
201#ifdef FOUR_DVAR
202
203
204
205
206
207
208
209
210
211
215# ifndef CORRELATION
217# endif
218# ifdef DISTRIBUTE
220# endif
223 ini(ng)%Rindex=inirec(ng)
224 ELSE
225 inirec(ng)=
ini(ng)%Rindex
226 END IF
227 END DO
228
229# ifdef ADJUST_BOUNDARY
230
231
232
235 END DO
236# endif
237# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
238
239
240
243 END DO
244# endif
245
246
247
248
249
252 fcount=
his(ng)%Fcount
253 his(ng)%Nrec(fcount)=0
254 END DO
255
256# ifdef I4DVAR
257
258
259
260
265 END DO
266# endif
267
268#endif
269
270
271
272
273
274
279 END IF
280 END DO
281
282
283
284
285#ifndef ANA_SPONGE
286
287
288#endif
289
290
294 END DO
295
296 END DO
297
298#ifdef ANA_SPONGE
299
300
301
302
303
304
309 END DO
310
311 END IF
312 END DO
313#endif
314
315
316
317
318
319
320#ifdef TLM_CHECK
321
322
323
327 END DO
328
329 END DO
330#endif
331
332#if defined SOLVE3D && !defined INI_FILE
333
334
335
336
337
338
342 END DO
343
344 END DO
345#endif
346
347
348
349
350
351#ifdef ANA_INITIAL
352
353
354
356 IF (
nrrec(ng).eq.0)
THEN
359 END DO
360
361 END IF
362 END DO
363#endif
364
365#if defined ANA_PASSIVE && defined SOLVE3D
366
367
368
370 IF (
nrrec(ng).eq.0)
THEN
373 END DO
374
375 END IF
376 END DO
377#endif
378
379#if defined ANA_BIOLOGY && defined SOLVE3D
380
381
382
384 IF (
nrrec(ng).eq.0)
THEN
387 END DO
388
389 END IF
390 END DO
391#endif
392
393#if defined ANA_SEDIMENT && defined SOLVE3D
394
395
396
397
399 IF (
nrrec(ng).eq.0)
THEN
402 END DO
403
404 END IF
405 END DO
406#endif
407
408#if defined INI_FILE && !defined RBL4DVAR_FCT_SENSITIVITY
409
410
411
413
415
416# ifdef DISTRIBUTE
418# endif
419
422 END DO
423#else
424
425
426
428 IF (
nrrec(ng).ne.0)
THEN
429
430 CALL get_state (ng, 0, 1,
ini(ng), inirec(ng), tindex(ng))
431
432# ifdef DISTRIBUTE
434# endif
435
438 END IF
439 END DO
440#endif
441
442#ifdef WET_DRY
443
444
445
446
447
449
450
451
452 IF (
nrrec(ng).ne.0)
THEN
453
454# ifdef DISTRIBUTE
456# else
458# endif
459
460# ifdef DISTRIBUTE
462# endif
463
465 ELSE
467 CALL wetdry (ng, tile, tindex(ng), .true.)
468 END DO
469
470 END IF
471 END DO
472#endif
473
474#if defined OBSERVATIONS && !defined RBL4DVAR_FCT_SENSITIVITY
475
476
477
478
479
480
481
482
483
485
487
489 END DO
490
491#endif
492
493#if (defined ADJUST_BOUNDARY || \
494 defined adjust_stflux || \
495 defined adjust_wstress) && \
496 (defined rbl4dvar || \
497 defined rbl4dvar_ana_sensitivity || \
498 defined rbl4dvar_fct_sensitivity || \
499 defined tl_rbl4dvar)
500
501
502
503
504
505
506
509
510 CALL get_state (ng, 5, 5,
ini(ng), inirec(ng), tindex(ng))
511
512# ifdef DISTRIBUTE
514# endif
515
517 END DO
518 END IF
519#endif
520
521#ifdef TLM_CHECK
522
523
524
525
526
527
528
533 END DO
534
535 END DO
536 END IF
537#endif
538
539#ifdef SOLVE3D
540
541
542
543
544
545
546
552 END DO
553
554 END DO
555
556
557
558
559
563 END DO
564
565 END DO
566
567
568
569
570
571
572
573
578 END DO
579
580 END DO
581#endif
582
583#ifdef ANA_PSOURCE
584
585
586
587
588
589
590
591
596 END DO
597 END IF
598
599 END DO
600#endif
601
602#if defined FOUR_DVAR || !defined TANGENT || !defined ADJOINT
603
604
605
606
607
608
609
610# ifdef ADJUST_BOUNDARY
611
612
613
614
615
621 END DO
622 END DO
623 END IF
624
625
626# endif
627# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
628
629
630
631
632
638 END DO
639 END DO
640 END IF
641
642
643# endif
644# if !defined CORRELATION
645
646
647
648
649
650
651
652
654
657
658# ifdef DISTRIBUTE
660# endif
661
663 END DO
664
665
666
668
671
672# ifdef DISTRIBUTE
674# endif
675
677 END DO
678# endif
679#endif
680
681#ifdef MASKING
682
683
684
685
686
690 END DO
691
692 END DO
693#endif
694
695#if !defined CORRELATION
696# ifdef NESTING
697# if defined MASKING || defined WET_DRY
698
699
700
701
702
703
706 END DO
707# endif
708
709
710
711
712
713
714
715
721# ifndef SOLVE3D
723# endif
724 END IF
725 END DO
726 END DO
727
728# ifdef SOLVE3D
729
730
731
732
735 END DO
736
737
738
745 END IF
746 END DO
747 END DO
748# endif
749# endif
750#endif
751
752#if defined PROPAGATOR || \
753 (defined masking && (defined read_water || defined write_water ))
754
755
756
757
758
759
763 END DO
764
765 END DO
766#endif
767
768#if defined NLM_OUTER || \
769 defined rbl4dvar || \
770 defined rbl4dvar_ana_sensitivity || \
771 defined rbl4dvar_fct_sensitivity || \
772 defined tl_rbl4dvar
773
774
775
776
777
778
782
784
785
786# ifdef DISTRIBUTE
788# endif
790 END IF
791 END DO
792#endif
793
794#if defined ANA_DRAG && defined UV_DRAG_GRID
795
796
797
798
799
804 END DO
805
806 END DO
807 END IF
808#endif
809
810
811
812
813
819 END DO
820
821 END DO
822 END IF
823
824#if defined FLOATS || defined STATIONS
825
826
827
828
829
830
832
834
835
836 END DO
837#endif
838
839# if defined WAV_COUPLING && defined MCT_LIB
840
841
842
843
844
847 CALL ocn2wav_coupling (ng, tile)
848 END DO
849
851 END DO
852# endif
853
854
855
856
857
858
863 END DO
864
865#ifdef PROFILE
866
867
868
869
870
872 DO thread=thread_range
874 END DO
875
876 END DO
877#endif
878
879 RETURN
subroutine check_multifile(ng, model)
subroutine grid_coords(ng, model)
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_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 def_ini(ng)
subroutine, public get_state(ng, model, msg, s, inirec, tindex)
subroutine, public get_wetdry(ng, tile, model, inirec)
subroutine, public ini_perturb(ng, tile, linp, lout)
subroutine, public set_zeta_timeavg(ng, tile, model)
subroutine, public ini_hmixcoef(ng, tile, model)
type(t_io), dimension(:), allocatable his
type(t_io), dimension(:), allocatable tlf
type(t_io), dimension(:), allocatable ini
subroutine, public initialize_ocean(ng, tile, model)
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:,:), allocatable gridnumber
integer, dimension(:), allocatable gridsinlayer
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
integer, dimension(:), allocatable nobc
logical, dimension(:), allocatable lsponge
logical, dimension(:), allocatable setgridconfig
integer, dimension(:), allocatable next_kstp
logical, dimension(:), allocatable synchro_flag
integer, dimension(:), allocatable frcrec
logical, dimension(:), allocatable predictor_2d_step
integer, dimension(:), allocatable nfrec
logical, dimension(:), allocatable ldefini
real(dp), dimension(:), allocatable tdays
logical, dimension(:), allocatable lwrtavg
logical, dimension(:), allocatable lwsrc
integer, dimension(:), allocatable ntend
integer, dimension(:), allocatable first_time
character(len=22), dimension(:), allocatable time_code
integer, dimension(:), allocatable indx1
logical, dimension(:,:), allocatable compositegrid
integer, dimension(:), allocatable sfcount
real(dp), dimension(:,:), allocatable obc_time
logical, dimension(:), allocatable sporadicimpulse
logical, dimension(:), allocatable lwrthis
integer, dimension(:), allocatable ntfirst
logical, dimension(:), allocatable lwrtrst
real(dp), dimension(:), allocatable time
integer, dimension(:), allocatable nsff
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable step_counter
real(dp), dimension(:,:), allocatable sf_time
integer, dimension(:), allocatable nbrec
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 lnew
integer, dimension(:), allocatable krhs
integer, dimension(:), allocatable nstp
subroutine, public nesting(ng, model, isection)
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_depth0(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)