4
5
6
7
8
9
10
11
12
13
14
15
16
17# if defined STEP2D_FB_LF_AM3
18
19# elif defined STEP2D_FB_LF_AM3
20
21# else
22
23# endif
24
25
26
29# if defined MODEL_COUPLING && defined MCT_LIB
31# endif
33# ifdef NESTING
35# endif
38
39# ifdef ANA_VMIX
41# endif
42# ifdef BIOLOGY
44# endif
45# ifdef BBL_MODEL
47# endif
48# ifdef BULK_FLUXES
50# endif
51# ifdef BVF_MIXING
53# endif
56# ifdef TLM_CHECK
58# endif
59# ifdef TIDE_GENERATING_FORCES
61# endif
62# if defined NLM_OUTER || \
63 defined rbl4dvar || \
64 defined rbl4dvar_ana_sensitivity || \
65 defined rbl4dvar_fct_sensitivity || \
66 defined sp4dvar
68# endif
69# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
71# endif
72# ifdef GLS_MIXING
75# endif
76# if defined NLM_OUTER || defined RBL4DVAR || \
77 defined rbl4dvar_ana_sensitivity || defined rbl4dvar_fct_sensitivity
79# endif
80# if defined DIFF_3DCOEF || defined VISC_3DCOEF
81 USE hmixing_mod, ONLY : hmixing
82# endif
83# if defined ICE_MODEL && defined ALBEDO && defined SHORTWAVE
85# endif
86# ifdef LMD_MIXING
88# endif
89# if defined ATM_COUPLING && defined MCT_LIB
91# endif
92# if defined WAV_COUPLING && defined MCT_LIB
94# endif
95# ifdef MY25_MIXING
98# endif
99# ifdef NESTING
101# ifndef ONE_WAY
103# endif
104# endif
105# if defined ADJUST_BOUNDARY
107# endif
110# ifndef TS_FIXED
112# endif
114# ifdef ICE_MODEL
116# endif
117# ifdef SEDIMENT
119# endif
120# ifdef AVERAGES
122# endif
125# if defined SSH_TIDES || defined UV_TIDES
127# endif
129# if !(defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3)
131# endif
133# ifndef TS_FIXED
135# endif
137# ifdef FLOATS
139# endif
141# ifdef WEC_VF
142# if defined WDISS_THORGUZA || defined WDISS_CHURTHOR
143 USE wec_dissip_mod, ONLY : wec_dissip
144# endif
145# ifdef WEC_ROLLER
146 USE wec_roller_mod, ONLY : wec_roller
147# endif
148 USE wec_stokes_mod, ONLY : wec_stokes
149 USE wec_vf_mod, ONLY : wec_vf
150# ifdef WAVE_MIXING
151 USE wec_wave_mix_mod, ONLY : wec_wave_mix
152# endif
153# endif
154# ifdef WEC
155 USE wec_wvelocity_mod, ONLY : wec_wvelocity
156# endif
158
159 implicit none
160
161
162
163 real(dp), intent(in) :: RunInterval
164
165
166
167 logical :: DoNestLayer, Time_Step
168
169 integer :: Nsteps, Rsteps
170 integer :: ig, il, istep, ng, nl, tile
171 integer :: my_iif, next_indx1
172# ifdef FLOATS
173 integer :: Lend, Lstr, chunk_size
174# endif
175
176 character (len=*), parameter :: MyFile = &
177 & __FILE__
178
179
180
181
182
183
184
185
186 time_step=.true.
187 donestlayer=.true.
188
189 kernel_loop : DO WHILE (time_step)
190
191
192
193
194
195
196 nl=0
197#ifdef NESTING
199#endif
200
201 nest_layer : DO WHILE (donestlayer)
202
203
204
205
206
207
208
209
213
214
215
216 step_loop : DO istep=1,nsteps
217
218
219
225# ifdef JEDI
228# endif
231 END DO
232
233
234
235
236
239
242 END IF
243
244
246 & __line__, myfile)) RETURN
247 END DO
248
249
250
251
252
253
259 END DO
260 END IF
261
262 END DO
264
265# if defined NLM_OUTER || \
266 defined rbl4dvar || \
267 defined rbl4dvar_ana_sensitivity || \
268 defined rbl4dvar_fct_sensitivity
269
270
271
272
273
274
275
276
277
280# ifdef RPCG
284 END IF
286# endif
287# if defined WEAK_NOINTERP
288 IF ((
iic(ng).gt.1).and.(
iic(ng).ne.
ntend(ng)+1).and. &
289 & (mod(
iic(ng)-1,
nadj(ng)).eq.0))
THEN
291 WRITE (
stdout,*)
' FORCING NLM at iic = ',
iic(ng)
292 END IF
293# endif
294# ifdef RPCG
298 END DO
299 END IF
303 END DO
304
305# else
310 END DO
311
312 END IF
313# endif
314# if defined WEAK_NOINTERP
315 END IF
316# endif
317# ifdef RPCG
318 END IF
319# endif
320 END DO
321# endif
322
323# ifndef JEDI
324
325
326
327
328
329
330
331
336 END IF
337 END DO
338# endif
339
340
341
342
343
344
349# ifndef TS_FIXED
351# endif
352# ifdef TIDE_GENERATING_FORCES
353 CALL equilibrium_tide (ng, tile,
inlm)
354# endif
356# ifdef TLM_CHECK
358# endif
359 END DO
360
361 END DO
363
364# if defined ATM_COUPLING && defined MCT_LIB
365
366
367
368
369
370
376 CALL ocn2atm_coupling (ng, tile)
377 END DO
378
379 END IF
380 END DO
381# endif
382
383# if defined WAV_COUPLING && defined MCT_LIB
384
385
386
387
388
389
395 CALL ocn2wav_coupling (ng, tile)
396 END DO
397
398 END IF
399 END DO
400# endif
401
402# ifdef WEC_VF
403
404
405
406
407
411# if defined WDISS_THORGUZA || defined WDISS_CHURTHOR
412 CALL wec_dissip (ng, tile)
413# endif
414# ifdef WEC_ROLLER
415 CALL wec_roller (ng, tile)
416# endif
417 CALL wec_stokes (ng, tile)
418 END DO
419
420 END DO
422# endif
423
424
425
426
427
428
432# ifdef BULK_FLUXES
433# if defined ICE_MODEL && defined ALBEDO && defined SHORTWAVE
434 CALL ice_albedo (ng, tile,
inlm)
435# endif
436# if defined FOUR_DVAR && defined PRIOR_BULK_FLUXES
438# else
440# endif
441# endif
442# ifdef BBL_MODEL
444# endif
446# if defined SSH_TIDES || defined UV_TIDES
448# endif
449 END DO
450
451 END DO
452
453# ifdef NESTING
454
455
456
457
462 END IF
463 END DO
464# endif
465
466# if defined ICE_MODEL
467
468
469
470
471
473# endif
474
475# ifdef ADJUST_BOUNDARY
476
477
478
479
480
481
482
489 END DO
490
491 END IF
492 END DO
493# endif
494
495# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
496
497
498
499
500
501
502
509 END DO
510
511 END IF
512 END DO
513# endif
514
515
516
517
518
519
520
524# if defined ANA_VMIX
526# elif defined LMD_MIXING
528# elif defined BVF_MIXING
530# endif
531# if defined DIFF_3DCOEF || defined VISC_3DCOEF
532 CALL hmixing (ng, tile)
533# endif
536# ifdef WEC
537 CALL wec_wvelocity (ng, tile,
nstp(ng))
538# endif
539 END DO
540
541 END DO
542
543# if !(defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3) || \
544 defined diagnostics || defined averages
545
546
547
548
549
550
551
555# if !(defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3)
557# endif
558# ifdef DIAGNOSTICS
560# endif
561# ifdef AVERAGES
563# endif
564 END DO
565
566 END DO
567# endif
568
569# ifdef NESTING
570
571
572
573
578 END IF
579 END DO
580# endif
581
582
583
584
585
586
587
590
592
593
596 RETURN
597 END IF
598 END DO
599
600# ifdef NESTING
601
602
603
604
605# ifdef NESTING_DEBUG
606
607
608
609
610
611# endif
612
613
618# ifdef NESTING_DEBUG
620# endif
621 END IF
622 END DO
623# endif
624
625
626
627
628
632 CALL rhs3d (ng, tile)
633# ifdef MY25_MIXING
635# elif defined GLS_MIXING
637# endif
638 END DO
639
640 END DO
641
642# ifdef NESTING
643
644
645
646
647
652 END IF
653 END DO
654# endif
655
656# ifdef STEP2D_FB_AB3_AM4
657
658
659
660
661
662
663
664
665
666 loop_2d :
DO my_iif=1,maxval(
nfast)
667
670 IF (my_iif.le.
nfast(ng))
THEN
675
676 IF (mod(
knew(ng),2).eq.0)
THEN
679 END DO
680
681 ELSE
684 END DO
685
686 END IF
687 END IF
688 END DO
689
690# ifdef NESTING
691
692
693
694
695
700 END IF
701 END DO
702# endif
703 END DO loop_2d
704
705# else
706
707# ifdef STEP2D_FB_LF_AM3
708
709
710
711
712
713
714
715
716
717 loop_2d :
DO my_iif=1,maxval(
nfast)
718
719
720
723 IF (my_iif.le.
nfast(ng))
THEN
727
730 END DO
731
732 END IF
733 END DO
734
735# ifdef NESTING
736
737
738
739
740# ifdef NESTING_DEBUG
741
742
743
744
745# endif
746
751 END IF
752# ifdef NESTING_DEBUG
755 END IF
756# endif
757 END DO
758# endif
759
760
761
764 IF (my_iif.le.
nfast(ng))
THEN
767
770 END DO
771
772 END IF
773 END DO
774
775# ifdef NESTING
776
777
778
779
780# ifdef NESTING_DEBUG
781
782
783
784
785# endif
786
791 END IF
792# ifdef NESTING_DEBUG
795 END IF
796# endif
797 END DO
798# endif
799 END DO loop_2d
800
801# else
802
803
804
805
806
807
808
809
810 loop_2d :
DO my_iif=1,maxval(
nfast)+1
811
812
813
814
817 next_indx1=3-
indx1(ng)
819 & my_iif.le.(
nfast(ng)+1))
THEN
822 IF (first_2d_step) THEN
824 ELSE
826 END IF
829 END IF
830
831
832
833
834
835
836
837 IF (my_iif.le.(
nfast(ng)+1))
THEN
840 END DO
841
842 END IF
843 END DO
844
845# ifdef NESTING
846
847
848
849
850# ifdef NESTING_DEBUG
851
852
853
854
855# endif
856
861 END IF
862# ifdef NESTING_DEBUG
865 END IF
866# endif
867 END DO
868# endif
869
870
871
880 END IF
881
882
883
884
885
889 END DO
890
891 END IF
892 END DO
893
894# ifdef NESTING
895
896
897
898
899# ifdef NESTING_DEBUG
900
901
902
903
904# endif
905
910 END IF
911# ifdef NESTING_DEBUG
914 END IF
915# endif
916 END DO
917# endif
918 END DO loop_2d
919# endif
920
921# endif
922
923# ifdef NESTING
924# if defined MASKING && defined WET_DRY
925
926
927
928
929
930
931
932
936 END DO
937# endif
938
939
940
941
942
943
944
949 END IF
950 END DO
951# endif
952
953# if !(defined STEP2D_FB_AB3_AM4 || defined STEP2D_FB_LF_AM3)
954
955
956
957
958
959
964 END DO
965
966 END DO
967# endif
968
969# ifdef NESTING
970
971
972
973
976
977 END DO
978# endif
979
980
981
982
983
984
985
986
991 END DO
992
993 END DO
994
995# ifdef NESTING
996
997
998
999
1000
1005 END IF
1006 END DO
1007# endif
1008
1009
1010
1011
1012
1013
1018# ifdef MY25_MIXING
1020# elif defined GLS_MIXING
1022# endif
1023# if defined WEC_VF && defined WAVE_MIXING
1024 CALL wec_wave_mix (ng, tile)
1025# endif
1026# ifdef BIOLOGY
1028# endif
1029# ifdef SEDIMENT
1031# endif
1032 END DO
1033
1034 END DO
1035
1036# ifndef TS_FIXED
1037
1038
1039
1040
1041
1046 END DO
1047
1048 END DO
1049
1050# ifdef NESTING
1051
1052
1053
1054
1059 END IF
1060 END DO
1061# endif
1062# endif
1063
1064# ifdef NESTING
1065# ifndef ONE_WAY
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1081 IF (do_twoway(
inlm, nl, il, ng, istep))
THEN
1083 END IF
1084 END DO
1085 END DO
1086# endif
1087
1088
1089
1090
1091
1092
1093
1094
1095
1100 END IF
1101 END DO
1102# endif
1103
1104# ifdef FLOATS
1105
1106
1107
1108
1109
1110
1111
1112
1113
1117# ifdef _OPENMP
1120 lend=min(
nfloats(ng),lstr+chunk_size-1)
1121# else
1122 lstr=1
1124# endif
1126
1127
1128
1129
1135 END IF
1136 END DO
1137# endif
1138
1139
1140
1141
1142
1149 END DO
1150
1151 END DO step_loop
1152
1153 END DO nest_layer
1154
1155 END DO kernel_loop
1156
1157 RETURN
subroutine ana_vmix(ng, tile, model)
subroutine, public bblm(ng, tile)
subroutine, public biology(ng, tile)
subroutine, public bulk_flux(ng, tile)
subroutine, public bvf_mix(ng, tile)
subroutine, public time_string(mytime, date_string)
subroutine, public diag(ng, tile)
subroutine, public nl_dotproduct(ng, tile, linp)
subroutine, public forcing(ng, tile, kfrc, nfrc)
subroutine, public load_frc(ng, tile, lout)
subroutine, public frc_adjust(ng, tile, linp)
subroutine, public frc_iau(ng, tile, irec)
subroutine, public gls_corstep(ng, tile)
subroutine, public gls_prestep(ng, tile)
subroutine, public lmd_vmix(ng, tile)
integer, dimension(:,:), allocatable couplesteps
real(r8), dimension(:), allocatable twowayinterval
logical, dimension(:), allocatable donortofiner
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:), allocatable nfloats
integer, dimension(:,:), allocatable gridnumber
integer, dimension(:), allocatable gridsinlayer
logical, dimension(:), allocatable lfloats
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable dt
real(dp), dimension(:), allocatable timeiau
integer, dimension(:), allocatable next_kstp
logical, dimension(:), allocatable predictor_2d_step
integer, dimension(:), allocatable jic
real(dp), dimension(:), allocatable tdays
logical, dimension(:), allocatable frequentimpulse
integer, dimension(:), allocatable nfast
real(dp), parameter sec2day
integer, dimension(:), allocatable ntend
character(len=22), dimension(:), allocatable time_code
logical, dimension(:), allocatable iauswitch
real(dp), dimension(:), allocatable time4jedi
integer, dimension(:), allocatable indx1
logical, dimension(:,:), allocatable compositegrid
real(dp), dimension(:), allocatable time
logical, dimension(:), allocatable refinedgrid
integer, dimension(:), allocatable refinescale
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable step_counter
logical, dimension(:), allocatable processinputdata
integer, dimension(:), allocatable nadj
integer, dimension(:), allocatable iif
integer, dimension(:), allocatable nfm2
integer, dimension(:), allocatable lbout
integer, dimension(:), allocatable kstp
integer, dimension(:), allocatable knew
integer, dimension(:), allocatable nfm1
integer, dimension(:), allocatable nrhs
integer, dimension(:), allocatable lfinp
integer, dimension(:), allocatable lbinp
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 lfout
integer, dimension(:), allocatable nstp
subroutine, public my25_corstep(ng, tile)
subroutine, public my25_prestep(ng, tile)
subroutine, public nesting(ng, model, isection)
subroutine, public obc_adjust(ng, tile, linp)
subroutine, public load_obc(ng, tile, lout)
subroutine, public omega(ng, tile, model)
subroutine, public post_initial(ng, model)
subroutine, public rho_eos(ng, tile, model)
subroutine, public rhs3d(ng, tile)
subroutine, public sediment(ng, tile)
subroutine, public set_avg(ng, tile)
subroutine, public set_depth(ng, tile, model)
subroutine, public set_massflux(ng, tile, model)
subroutine, public set_tides(ng, tile)
subroutine, public set_vbc(ng, tile)
subroutine, public set_zeta(ng, tile)
subroutine, public step2d(ng, tile)
subroutine, public step3d_t(ng, tile)
subroutine, public step3d_uv(ng, tile)
subroutine, public step_floats(ng, lstr, lend)
logical function, public founderror(flag, noerr, line, routine)
subroutine, public wvelocity(ng, tile, ninp)
subroutine ntimesteps(model, runinterval, nl, nsteps, rsteps)
subroutine set_data(ng, tile)
subroutine set_diags(ng, tile)