222 & LBi, UBi, LBj, UBj, LBij, UBij, &
223 & IminS, ImaxS, JminS, JmaxS, &
225 & innLoop, outLoop, Ltrace, &
227 & rmask, umask, vmask, &
229# ifdef ADJUST_BOUNDARY
231 & nl_t_obc, nl_u_obc, nl_v_obc, &
233 & nl_ubar_obc, nl_vbar_obc, &
236# ifdef ADJUST_WSTRESS
237 & nl_ustr, nl_vstr, &
243 & nl_t, nl_u, nl_v, &
244# if defined WEAK_CONSTRAINT && defined TIME_CONV
245 & nl_ubar, nl_vbar, &
248 & nl_ubar, nl_vbar, &
251# ifdef ADJUST_BOUNDARY
253 & tl_t_obc, tl_u_obc, tl_v_obc, &
255 & tl_ubar_obc, tl_vbar_obc, &
258# ifdef ADJUST_WSTRESS
259 & tl_ustr, tl_vstr, &
265 & tl_t, tl_u, tl_v, &
266# if defined WEAK_CONSTRAINT && defined TIME_CONV
267 & tl_ubar, tl_vbar, &
270 & tl_ubar, tl_vbar, &
273# ifdef ADJUST_BOUNDARY
275 & d_t_obc, d_u_obc, d_v_obc, &
277 & d_ubar_obc, d_vbar_obc, &
280# ifdef ADJUST_WSTRESS
281 & d_sustr, d_svstr, &
288# if defined WEAK_CONSTRAINT && defined TIME_CONV
295# ifdef ADJUST_BOUNDARY
297 & ad_t_obc, ad_u_obc, ad_v_obc, &
299 & ad_ubar_obc, ad_vbar_obc, &
302# ifdef ADJUST_WSTRESS
303 & ad_ustr, ad_vstr, &
309 & ad_t, ad_u, ad_v, &
310# if defined WEAK_CONSTRAINT && defined TIME_CONV
311 & ad_ubar, ad_vbar, &
314 & ad_ubar, ad_vbar, &
321 integer,
intent(in) :: ng, tile, model
322 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
323 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
324 integer,
intent(in) :: Lold, Lnew
325 integer,
intent(in) :: innLoop, outLoop
326 logical,
intent(in) :: Ltrace
330 real(r8),
intent(in) :: rmask(LBi:,LBj:)
331 real(r8),
intent(in) :: umask(LBi:,LBj:)
332 real(r8),
intent(in) :: vmask(LBi:,LBj:)
334# ifdef ADJUST_BOUNDARY
336 real(r8),
intent(inout) :: ad_t_obc(LBij:,:,:,:,:,:)
337 real(r8),
intent(inout) :: ad_u_obc(LBij:,:,:,:,:)
338 real(r8),
intent(inout) :: ad_v_obc(LBij:,:,:,:,:)
340 real(r8),
intent(inout) :: ad_ubar_obc(LBij:,:,:,:)
341 real(r8),
intent(inout) :: ad_vbar_obc(LBij:,:,:,:)
342 real(r8),
intent(inout) :: ad_zeta_obc(LBij:,:,:,:)
344# ifdef ADJUST_WSTRESS
345 real(r8),
intent(inout) :: ad_ustr(LBi:,LBj:,:,:)
346 real(r8),
intent(inout) :: ad_vstr(LBi:,LBj:,:,:)
350 real(r8),
intent(inout) :: ad_tflux(LBi:,LBj:,:,:,:)
352 real(r8),
intent(inout) :: ad_t(LBi:,LBj:,:,:,:)
353 real(r8),
intent(inout) :: ad_u(LBi:,LBj:,:,:)
354 real(r8),
intent(inout) :: ad_v(LBi:,LBj:,:,:)
355# if defined WEAK_CONSTRAINT && defined TIME_CONV
356 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
357 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
360 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
361 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
363 real(r8),
intent(inout) :: ad_zeta(LBi:,LBj:,:)
364# ifdef ADJUST_BOUNDARY
366 real(r8),
intent(inout) :: d_t_obc(LBij:,:,:,:,:)
367 real(r8),
intent(inout) :: d_u_obc(LBij:,:,:,:)
368 real(r8),
intent(inout) :: d_v_obc(LBij:,:,:,:)
370 real(r8),
intent(inout) :: d_ubar_obc(LBij:,:,:)
371 real(r8),
intent(inout) :: d_vbar_obc(LBij:,:,:)
372 real(r8),
intent(inout) :: d_zeta_obc(LBij:,:,:)
374# ifdef ADJUST_WSTRESS
375 real(r8),
intent(inout) :: d_sustr(LBi:,LBj:,:)
376 real(r8),
intent(inout) :: d_svstr(LBi:,LBj:,:)
380 real(r8),
intent(inout) :: d_stflx(LBi:,LBj:,:,:)
382 real(r8),
intent(inout) :: d_t(LBi:,LBj:,:,:)
383 real(r8),
intent(inout) :: d_u(LBi:,LBj:,:)
384 real(r8),
intent(inout) :: d_v(LBi:,LBj:,:)
385# if defined WEAK_CONSTRAINT && defined TIME_CONV
386 real(r8),
intent(inout) :: d_ubar(LBi:,LBj:)
387 real(r8),
intent(inout) :: d_vbar(LBi:,LBj:)
390 real(r8),
intent(inout) :: d_ubar(LBi:,LBj:)
391 real(r8),
intent(inout) :: d_vbar(LBi:,LBj:)
393 real(r8),
intent(inout) :: d_zeta(LBi:,LBj:)
394# ifdef ADJUST_BOUNDARY
396 real(r8),
intent(inout) :: nl_t_obc(LBij:,:,:,:,:,:)
397 real(r8),
intent(inout) :: nl_u_obc(LBij:,:,:,:,:)
398 real(r8),
intent(inout) :: nl_v_obc(LBij:,:,:,:,:)
400 real(r8),
intent(inout) :: nl_ubar_obc(LBij:,:,:,:)
401 real(r8),
intent(inout) :: nl_vbar_obc(LBij:,:,:,:)
402 real(r8),
intent(inout) :: nl_zeta_obc(LBij:,:,:,:)
404# ifdef ADJUST_WSTRESS
405 real(r8),
intent(inout) :: nl_ustr(LBi:,LBj:,:,:)
406 real(r8),
intent(inout) :: nl_vstr(LBi:,LBj:,:,:)
410 real(r8),
intent(inout) :: nl_tflux(LBi:,LBj:,:,:,:)
412 real(r8),
intent(inout) :: nl_t(LBi:,LBj:,:,:,:)
413 real(r8),
intent(inout) :: nl_u(LBi:,LBj:,:,:)
414 real(r8),
intent(inout) :: nl_v(LBi:,LBj:,:,:)
415# if defined WEAK_CONSTRAINT && defined TIME_CONV
416 real(r8),
intent(inout) :: nl_ubar(LBi:,LBj:,:)
417 real(r8),
intent(inout) :: nl_vbar(LBi:,LBj:,:)
420 real(r8),
intent(inout) :: nl_ubar(LBi:,LBj:,:)
421 real(r8),
intent(inout) :: nl_vbar(LBi:,LBj:,:)
423 real(r8),
intent(inout) :: nl_zeta(LBi:,LBj:,:)
424# ifdef ADJUST_BOUNDARY
426 real(r8),
intent(inout) :: tl_t_obc(LBij:,:,:,:,:,:)
427 real(r8),
intent(inout) :: tl_u_obc(LBij:,:,:,:,:)
428 real(r8),
intent(inout) :: tl_v_obc(LBij:,:,:,:,:)
430 real(r8),
intent(inout) :: tl_ubar_obc(LBij:,:,:,:)
431 real(r8),
intent(inout) :: tl_vbar_obc(LBij:,:,:,:)
432 real(r8),
intent(inout) :: tl_zeta_obc(LBij:,:,:,:)
434# ifdef ADJUST_WSTRESS
435 real(r8),
intent(inout) :: tl_ustr(LBi:,LBj:,:,:)
436 real(r8),
intent(inout) :: tl_vstr(LBi:,LBj:,:,:)
440 real(r8),
intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
442 real(r8),
intent(inout) :: tl_t(LBi:,LBj:,:,:,:)
443 real(r8),
intent(inout) :: tl_u(LBi:,LBj:,:,:)
444 real(r8),
intent(inout) :: tl_v(LBi:,LBj:,:,:)
445# if defined WEAK_CONSTRAINT && defined TIME_CONV
446 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
447 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
450 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
451 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
453 real(r8),
intent(inout) :: tl_zeta(LBi:,LBj:,:)
458 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
459 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
460 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
462# ifdef ADJUST_BOUNDARY
464 real(r8),
intent(inout) :: ad_t_obc(LBij:UBij,N(ng),4, &
465 & Nbrec(ng),2,NT(ng))
466 real(r8),
intent(inout) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
467 real(r8),
intent(inout) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
469 real(r8),
intent(inout) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
470 real(r8),
intent(inout) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
471 real(r8),
intent(inout) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
473# ifdef ADJUST_WSTRESS
474 real(r8),
intent(inout) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
475 real(r8),
intent(inout) :: ad_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
479 real(r8),
intent(inout) :: ad_tflux(LBi:UBi,LBj:UBj, &
480 & Nfrec(ng),2,NT(ng))
482 real(r8),
intent(inout) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
483 real(r8),
intent(inout) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
484 real(r8),
intent(inout) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
485# if defined WEAK_CONSTRAINT && defined TIME_CONV
486 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
487 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
490 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
491 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
493 real(r8),
intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,:)
494# ifdef ADJUST_BOUNDARY
496 real(r8),
intent(inout) :: d_t_obc(LBij:UBij,N(ng),4, &
498 real(r8),
intent(inout) :: d_u_obc(LBij:UBij,N(ng),4,Nbrec(ng))
499 real(r8),
intent(inout) :: d_v_obc(LBij:UBij,N(ng),4,Nbrec(ng))
501 real(r8),
intent(inout) :: d_ubar_obc(LBij:UBij,4,Nbrec(ng))
502 real(r8),
intent(inout) :: d_vbar_obc(LBij:UBij,4,Nbrec(ng))
503 real(r8),
intent(inout) :: d_zeta_obc(LBij:UBij,4,Nbrec(ng))
505# ifdef ADJUST_WSTRESS
506 real(r8),
intent(inout) :: d_sustr(LBi:UBi,LBj:UBj,Nfrec(ng))
507 real(r8),
intent(inout) :: d_svstr(LBi:UBi,LBj:UBj,Nfrec(ng))
511 real(r8),
intent(inout) :: d_stflx(LBi:UBi,LBj:UBj, &
514 real(r8),
intent(inout) :: d_t(LBi:UBi,LBj:UBj,N(ng),NT(ng))
515 real(r8),
intent(inout) :: d_u(LBi:UBi,LBj:UBj,N(ng))
516 real(r8),
intent(inout) :: d_v(LBi:UBi,LBj:UBj,N(ng))
517# if defined WEAK_CONSTRAINT && defined TIME_CONV
518 real(r8),
intent(inout) :: d_ubar(LBi:UBi,LBj:UBj)
519 real(r8),
intent(inout) :: d_vbar(LBi:UBi,LBj:UBj)
522 real(r8),
intent(inout) :: d_ubar(LBi:UBi,LBj:UBj)
523 real(r8),
intent(inout) :: d_vbar(LBi:UBi,LBj:UBj)
525 real(r8),
intent(inout) :: d_zeta(LBi:UBi,LBj:UBj)
526# ifdef ADJUST_BOUNDARY
528 real(r8),
intent(inout) :: nl_t_obc(LBij:UBij,N(ng),4, &
529 & Nbrec(ng),2,NT(ng))
530 real(r8),
intent(inout) :: nl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
531 real(r8),
intent(inout) :: nl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
533 real(r8),
intent(inout) :: nl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
534 real(r8),
intent(inout) :: nl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
535 real(r8),
intent(inout) :: nl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
537# ifdef ADJUST_WSTRESS
538 real(r8),
intent(inout) :: nl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
539 real(r8),
intent(inout) :: nl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
543 real(r8),
intent(inout) :: nl_tflux(LBi:UBi,LBj:UBj, &
544 & Nfrec(ng),2,NT(ng))
546 real(r8),
intent(inout) :: nl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
547 real(r8),
intent(inout) :: nl_u(LBi:UBi,LBj:UBj,N(ng),2)
548 real(r8),
intent(inout) :: nl_v(LBi:UBi,LBj:UBj,N(ng),2)
549# if defined WEAK_CONSTRAINT && defined TIME_CONV
550 real(r8),
intent(inout) :: nl_ubar(LBi:UBi,LBj:UBj,:)
551 real(r8),
intent(inout) :: nl_vbar(LBi:UBi,LBj:UBj,:)
554 real(r8),
intent(inout) :: nl_ubar(LBi:UBi,LBj:UBj,:)
555 real(r8),
intent(inout) :: nl_vbar(LBi:UBi,LBj:UBj,:)
557 real(r8),
intent(inout) :: nl_zeta(LBi:UBi,LBj:UBj,:)
558# ifdef ADJUST_BOUNDARY
560 real(r8),
intent(inout) :: tl_t_obc(LBij:UBij,N(ng),4, &
561 & Nbrec(ng),2,NT(ng))
562 real(r8),
intent(inout) :: tl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
563 real(r8),
intent(inout) :: tl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
565 real(r8),
intent(inout) :: tl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
566 real(r8),
intent(inout) :: tl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
567 real(r8),
intent(inout) :: tl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
569# ifdef ADJUST_WSTRESS
570 real(r8),
intent(inout) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
571 real(r8),
intent(inout) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
575 real(r8),
intent(inout) :: tl_tflux(LBi:UBi,LBj:UBj, &
576 & Nfrec(ng),2,NT(ng))
578 real(r8),
intent(inout) :: tl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
579 real(r8),
intent(inout) :: tl_u(LBi:UBi,LBj:UBj,N(ng),2)
580 real(r8),
intent(inout) :: tl_v(LBi:UBi,LBj:UBj,N(ng),2)
581# if defined WEAK_CONSTRAINT && defined TIME_CONV
582 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
583 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
586 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
587 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
589 real(r8),
intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,:)
599 integer :: Linp, Lout, Lscale, Lwrk, Lwrk1, i, j, ic
600 integer :: info, itheta1
602 real(r8) :: norm, zbeta
604 real(r8),
dimension(2*NpostI-2) :: work
607 real(r8),
dimension(0:NstateVar(ng)) :: dot
610 character (len=13) :: string
612 character (len=*),
parameter :: MyFile = &
613 & __FILE__//
", posterior_tile"
615# include "set_bounds.h"
628 IF (innloop.eq.0)
THEN
635 & lbi, ubi, lbj, ubj, lbij, ubij, &
637# ifdef ADJUST_BOUNDARY
639 & ad_t_obc, tl_t_obc, &
640 & ad_u_obc, tl_u_obc, &
641 & ad_v_obc, tl_v_obc, &
643 & ad_ubar_obc, tl_ubar_obc, &
644 & ad_vbar_obc, tl_vbar_obc, &
645 & ad_zeta_obc, tl_zeta_obc, &
647# ifdef ADJUST_WSTRESS
648 & ad_ustr, tl_ustr, &
649 & ad_vstr, tl_vstr, &
653 & ad_tflux, tl_tflux, &
658# if defined WEAK_CONSTRAINT && defined TIME_CONV
659 & ad_ubar, tl_ubar, &
660 & ad_vbar, tl_vbar, &
663 & ad_ubar, tl_ubar, &
664 & ad_vbar, tl_vbar, &
669 IF ((innloop.gt.0).or.ltrace)
THEN
682 & lbi, ubi, lbj, ubj, lbij, ubij, &
685 & rmask, umask, vmask, &
687# ifdef ADJUST_BOUNDARY
689 & tl_t_obc(:,:,:,:,lold,:), &
690 & tl_t_obc(:,:,:,:,lnew,:), &
691 & tl_u_obc(:,:,:,:,lold), &
692 & tl_u_obc(:,:,:,:,lnew), &
693 & tl_v_obc(:,:,:,:,lold), &
694 & tl_v_obc(:,:,:,:,lnew), &
696 & tl_ubar_obc(:,:,:,lold), &
697 & tl_ubar_obc(:,:,:,lnew), &
698 & tl_vbar_obc(:,:,:,lold), &
699 & tl_vbar_obc(:,:,:,lnew), &
700 & tl_zeta_obc(:,:,:,lold), &
701 & tl_zeta_obc(:,:,:,lnew), &
703# ifdef ADJUST_WSTRESS
704 & tl_ustr(:,:,:,lold), tl_ustr(:,:,:,lnew), &
705 & tl_vstr(:,:,:,lold), tl_vstr(:,:,:,lnew), &
709 & tl_tflux(:,:,:,lold,:), &
710 & tl_tflux(:,:,:,lnew,:), &
712 & tl_t(:,:,:,lold,:), tl_t(:,:,:,lnew,:), &
713 & tl_u(:,:,:,lold), tl_u(:,:,:,lnew), &
714 & tl_v(:,:,:,lold), tl_v(:,:,:,lnew), &
716 & tl_ubar(:,:,lold), tl_ubar(:,:,lnew), &
717 & tl_vbar(:,:,lold), tl_vbar(:,:,lnew), &
719 & tl_zeta(:,:,lold), tl_zeta(:,:,lnew))
737 & lbi, ubi, lbj, ubj, lbij, ubij, &
739# ifdef ADJUST_BOUNDARY
741 & ad_t_obc, tl_t_obc, &
742 & ad_u_obc, tl_u_obc, &
743 & ad_v_obc, tl_v_obc, &
745 & ad_ubar_obc, tl_ubar_obc, &
746 & ad_vbar_obc, tl_vbar_obc, &
747 & ad_zeta_obc, tl_zeta_obc, &
749# ifdef ADJUST_WSTRESS
750 & ad_ustr, tl_ustr, &
751 & ad_vstr, tl_vstr, &
755 & ad_tflux, tl_tflux, &
760# if defined WEAK_CONSTRAINT && defined TIME_CONV
761 & ad_ubar, tl_ubar, &
762 & ad_vbar, tl_vbar, &
765 & ad_ubar, tl_ubar, &
766 & ad_vbar, tl_vbar, &
771 IF ((innloop.gt.0).or.ltrace)
THEN
775 & lbi, ubi, lbj, ubj, lbij, ubij, &
776 & imins, imaxs, jmins, jmaxs, &
777 & linp, lout, lwrk, &
778 & innloop, outloop, &
780 & rmask, umask, vmask, &
782# ifdef ADJUST_BOUNDARY
784 & ad_t_obc, ad_u_obc, ad_v_obc, &
786 & ad_ubar_obc, ad_vbar_obc, &
789# ifdef ADJUST_WSTRESS
790 & ad_ustr, ad_vstr, &
796 & ad_t, ad_u, ad_v, &
798 & ad_ubar, ad_vbar, &
801# ifdef ADJUST_BOUNDARY
803 & tl_t_obc, tl_u_obc, tl_v_obc, &
805 & tl_ubar_obc, tl_vbar_obc, &
808# ifdef ADJUST_WSTRESS
809 & tl_ustr, tl_vstr, &
815 & tl_t, tl_u, tl_v, &
817 & tl_ubar, tl_vbar, &
820# ifdef ADJUST_BOUNDARY
822 & nl_t_obc, nl_u_obc, nl_v_obc, &
824 & nl_ubar_obc, nl_vbar_obc, &
827# ifdef ADJUST_WSTRESS
828 & nl_ustr, nl_vstr, &
834 & nl_t, nl_u, nl_v, &
836 & nl_ubar, nl_vbar, &
848 SELECT CASE (
hss(ng)%IOtype)
851 &
'ae_trace',
ae_trace(innloop+1:), &
852 & (/innloop+1/), (/1/), &
853 & ncid =
hss(ng)%ncid)
855# if defined PIO_LIB && defined DISTRIBUTE
860 & (/innloop+1/), (/1/), &
861 & piofile =
hss(ng)%pioFile)
867 WRITE (
stdout,10) outloop, innloop, &
869 10
FORMAT (1x,
'(',i3.3,
',',i3.3,
'): ', &
870 &
'Analysis Error Trace Estimate, ae_trace = ', &
875 IF (
ae_delta(innloop,outloop).le.0.0_r8)
THEN
876 WRITE (
stdout,*)
' AE_DELTA not positive.'
878 &
', outer = ', outloop,
', inner = ', innloop
888 CALL lanczos (ng, tile, model, &
889 & lbi, ubi, lbj, ubj, lbij, ubij, &
890 & imins, imaxs, jmins, jmaxs, &
891 & linp, lout, lwrk, &
892 & innloop, outloop, &
894 & rmask, umask, vmask, &
896# ifdef ADJUST_BOUNDARY
898 & tl_t_obc, tl_u_obc, tl_v_obc, &
900 & tl_ubar_obc, tl_vbar_obc, &
903# ifdef ADJUST_WSTRESS
904 & tl_ustr, tl_vstr, &
910 & tl_t, tl_u, tl_v, &
912 & tl_ubar, tl_vbar, &
915# ifdef ADJUST_BOUNDARY
917 & ad_t_obc, ad_u_obc, ad_v_obc, &
919 & ad_ubar_obc, ad_vbar_obc, &
922# ifdef ADJUST_WSTRESS
923 & ad_ustr, ad_vstr, &
929 & ad_t, ad_u, ad_v, &
931 & ad_ubar, ad_vbar, &
941 & lbi, ubi, lbj, ubj, lbij, ubij, &
942 & imins, imaxs, jmins, jmaxs, &
945 & rmask, umask, vmask, &
947# ifdef ADJUST_BOUNDARY
949 & ad_t_obc, ad_u_obc, ad_v_obc, &
951 & ad_ubar_obc, ad_vbar_obc, &
954# ifdef ADJUST_WSTRESS
955 & ad_ustr, ad_vstr, &
961 & ad_t, ad_u, ad_v, &
963 & ad_ubar, ad_vbar, &
966# ifdef ADJUST_BOUNDARY
968 & d_t_obc, d_u_obc, d_v_obc, &
970 & d_ubar_obc, d_vbar_obc, &
973# ifdef ADJUST_WSTRESS
974 & d_sustr, d_svstr, &
993 IF (innloop.gt.0)
THEN
1014 WRITE (
stdout,*)
' Error in DSTEQR: info = ', info
1033 IF (
ae_ritz(i,outloop).lt.0.0_r8)
THEN
1034 WRITE (
stdout,*)
' Negative Ritz value found.'
1042 IF (innloop.eq.
nposti)
THEN
1052 & lbi, ubi, lbj, ubj, lbij, ubij, &
1053 & imins, imaxs, jmins, jmaxs, &
1054 & linp, lout, lwrk, &
1055 & innloop, outloop, &
1057 & rmask, umask, vmask, &
1059# ifdef ADJUST_BOUNDARY
1061 & nl_t_obc, nl_u_obc, nl_v_obc, &
1063 & nl_ubar_obc, nl_vbar_obc, &
1066# ifdef ADJUST_WSTRESS
1067 & nl_ustr, nl_vstr, &
1070# ifdef ADJUST_STFLUX
1073 & nl_t, nl_u, nl_v, &
1075 & nl_ubar, nl_vbar, &
1078# ifdef ADJUST_BOUNDARY
1080 & tl_t_obc, tl_u_obc, tl_v_obc, &
1082 & tl_ubar_obc, tl_vbar_obc, &
1085# ifdef ADJUST_WSTRESS
1086 & tl_ustr, tl_vstr, &
1089# ifdef ADJUST_STFLUX
1092 & tl_t, tl_u, tl_v, &
1094 & tl_ubar, tl_vbar, &
1097# ifdef ADJUST_BOUNDARY
1099 & ad_t_obc, ad_u_obc, ad_v_obc, &
1101 & ad_ubar_obc, ad_vbar_obc, &
1104# ifdef ADJUST_WSTRESS
1105 & ad_ustr, ad_vstr, &
1108# ifdef ADJUST_STFLUX
1111 & ad_t, ad_u, ad_v, &
1113 & ad_ubar, ad_vbar, &
1118 WRITE(
stdout,*)
' No converged Hesssian eigenvectors found.'
1132 & lbi, ubi, lbj, ubj, lbij, ubij, &
1133 & imins, imaxs, jmins, jmaxs, &
1135 & innloop, outloop, &
1137 & rmask, umask, vmask, &
1139# ifdef ADJUST_BOUNDARY
1141 & d_t_obc, d_u_obc, d_v_obc, &
1143 & d_ubar_obc, d_vbar_obc, &
1146# ifdef ADJUST_WSTRESS
1147 & d_sustr, d_svstr, &
1150# ifdef ADJUST_STFLUX
1158# ifdef ADJUST_BOUNDARY
1160 & tl_t_obc, tl_u_obc, tl_v_obc, &
1162 & tl_ubar_obc, tl_vbar_obc, &
1165# ifdef ADJUST_WSTRESS
1166 & tl_ustr, tl_vstr, &
1169# ifdef ADJUST_STFLUX
1172 & tl_t, tl_u, tl_v, &
1174 & tl_ubar, tl_vbar, &
1177# ifdef ADJUST_BOUNDARY
1179 & ad_t_obc, ad_u_obc, ad_v_obc, &
1181 & ad_ubar_obc, ad_vbar_obc, &
1184# ifdef ADJUST_WSTRESS
1185 & ad_ustr, ad_vstr, &
1188# ifdef ADJUST_STFLUX
1191 & ad_t, ad_u, ad_v, &
1193 & ad_ubar, ad_vbar, &
1202 IF (
inner.eq.0)
THEN
1203 WRITE (
stdout,20) outloop, innloop, &
1205 20
FORMAT (/,1x,
'(',i3.3,
',',i3.3,
'): ', &
1206 &
'Analysis Error gradient norm, ae_Gnorm = ', &
1209 IF (innloop.gt.0)
THEN
1211 30
FORMAT (/,
' Ritz Eigenvalues and relative accuracy: ', &
1212 &
'RitzMaxErr = ',1p,e14.7,/)
1220 & trim(adjustl(string)), ic
1221 40
FORMAT(5x,i3.3,2x,1p,e14.7,2x,1p,e14.7,2x,a,2x, &
1224 string=
'not converged'
1227 & trim(adjustl(string))
1228 50
FORMAT(5x,i3.3,2x,1p,e14.7,2x,1p,e14.7,2x,a)
1240 & LBi, UBi, LBj, UBj, LBij, UBij, &
1241 & IminS, ImaxS, JminS, JmaxS, &
1243 & innLoop, outLoop, &
1245 & rmask, umask, vmask, &
1247# ifdef ADJUST_BOUNDARY
1249 & d_t_obc, d_u_obc, d_v_obc, &
1251 & d_ubar_obc, d_vbar_obc, &
1254# ifdef ADJUST_WSTRESS
1255 & d_sustr, d_svstr, &
1258# ifdef ADJUST_STFLUX
1266# ifdef ADJUST_BOUNDARY
1268 & tl_t_obc, tl_u_obc, tl_v_obc, &
1270 & tl_ubar_obc, tl_vbar_obc, &
1273# ifdef ADJUST_WSTRESS
1274 & tl_ustr, tl_vstr, &
1277# ifdef ADJUST_STFLUX
1280 & tl_t, tl_u, tl_v, &
1282 & tl_ubar, tl_vbar, &
1285# ifdef ADJUST_BOUNDARY
1287 & ad_t_obc, ad_u_obc, ad_v_obc, &
1289 & ad_ubar_obc, ad_vbar_obc, &
1292# ifdef ADJUST_WSTRESS
1293 & ad_ustr, ad_vstr, &
1296# ifdef ADJUST_STFLUX
1299 & ad_t, ad_u, ad_v, &
1301 & ad_ubar, ad_vbar, &
1308 integer,
intent(in) :: ng, tile, model
1309 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
1310 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
1311 integer,
intent(in) :: Linp, Lout
1312 integer,
intent(in) :: innLoop, outLoop
1314# ifdef ASSUMED_SHAPE
1316 real(r8),
intent(in) :: rmask(LBi:,LBj:)
1317 real(r8),
intent(in) :: umask(LBi:,LBj:)
1318 real(r8),
intent(in) :: vmask(LBi:,LBj:)
1320# ifdef ADJUST_BOUNDARY
1322 real(r8),
intent(inout) :: d_t_obc(LBij:,:,:,:,:)
1323 real(r8),
intent(inout) :: d_u_obc(LBij:,:,:,:)
1324 real(r8),
intent(inout) :: d_v_obc(LBij:,:,:,:)
1326 real(r8),
intent(inout) :: d_ubar_obc(LBij:,:,:)
1327 real(r8),
intent(inout) :: d_vbar_obc(LBij:,:,:)
1328 real(r8),
intent(inout) :: d_zeta_obc(LBij:,:,:)
1330# ifdef ADJUST_WSTRESS
1331 real(r8),
intent(in) :: d_sustr(LBi:,LBj:,:)
1332 real(r8),
intent(in) :: d_svstr(LBi:,LBj:,:)
1335# ifdef ADJUST_STFLUX
1336 real(r8),
intent(in) :: d_stflx(LBi:,LBj:,:,:)
1338 real(r8),
intent(in) :: d_t(LBi:,LBj:,:,:)
1339 real(r8),
intent(in) :: d_u(LBi:,LBj:,:)
1340 real(r8),
intent(in) :: d_v(LBi:,LBj:,:)
1342 real(r8),
intent(in) :: d_ubar(LBi:,LBj:)
1343 real(r8),
intent(in) :: d_vbar(LBi:,LBj:)
1345 real(r8),
intent(in) :: d_zeta(LBi:,LBj:)
1346# ifdef ADJUST_BOUNDARY
1348 real(r8),
intent(inout) :: ad_t_obc(LBij:,:,:,:,:,:)
1349 real(r8),
intent(inout) :: ad_u_obc(LBij:,:,:,:,:)
1350 real(r8),
intent(inout) :: ad_v_obc(LBij:,:,:,:,:)
1352 real(r8),
intent(inout) :: ad_ubar_obc(LBij:,:,:,:)
1353 real(r8),
intent(inout) :: ad_vbar_obc(LBij:,:,:,:)
1354 real(r8),
intent(inout) :: ad_zeta_obc(LBij:,:,:,:)
1356# ifdef ADJUST_WSTRESS
1357 real(r8),
intent(inout) :: ad_ustr(LBi:,LBj:,:,:)
1358 real(r8),
intent(inout) :: ad_vstr(LBi:,LBj:,:,:)
1361# ifdef ADJUST_STFLUX
1362 real(r8),
intent(inout) :: ad_tflux(LBi:,LBj:,:,:,:)
1364 real(r8),
intent(inout) :: ad_t(LBi:,LBj:,:,:,:)
1365 real(r8),
intent(inout) :: ad_u(LBi:,LBj:,:,:)
1366 real(r8),
intent(inout) :: ad_v(LBi:,LBj:,:,:)
1368 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
1369 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
1371 real(r8),
intent(inout) :: ad_zeta(LBi:,LBj:,:)
1372# ifdef ADJUST_BOUNDARY
1374 real(r8),
intent(inout) :: tl_t_obc(LBij:,:,:,:,:,:)
1375 real(r8),
intent(inout) :: tl_u_obc(LBij:,:,:,:,:)
1376 real(r8),
intent(inout) :: tl_v_obc(LBij:,:,:,:,:)
1378 real(r8),
intent(inout) :: tl_ubar_obc(LBij:,:,:,:)
1379 real(r8),
intent(inout) :: tl_vbar_obc(LBij:,:,:,:)
1380 real(r8),
intent(inout) :: tl_zeta_obc(LBij:,:,:,:)
1382# ifdef ADJUST_WSTRESS
1383 real(r8),
intent(inout) :: tl_ustr(LBi:,LBj:,:,:)
1384 real(r8),
intent(inout) :: tl_vstr(LBi:,LBj:,:,:)
1387# ifdef ADJUST_STFLUX
1388 real(r8),
intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
1390 real(r8),
intent(inout) :: tl_t(LBi:,LBj:,:,:,:)
1391 real(r8),
intent(inout) :: tl_u(LBi:,LBj:,:,:)
1392 real(r8),
intent(inout) :: tl_v(LBi:,LBj:,:,:)
1394 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
1395 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
1397 real(r8),
intent(inout) :: tl_zeta(LBi:,LBj:,:)
1402 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
1403 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
1404 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
1406# ifdef ADJUST_BOUNDARY
1408 real(r8),
intent(in) :: d_t_obc(LBij:UBij,N(ng),4, &
1410 real(r8),
intent(in) :: d_u_obc(LBij:UBij,N(ng),4,Nbrec(ng))
1411 real(r8),
intent(in) :: d_v_obc(LBij:UBij,N(ng),4,Nbrec(ng))
1413 real(r8),
intent(in) :: d_ubar_obc(LBij:UBij,4,Nbrec(ng))
1414 real(r8),
intent(in) :: d_vbar_obc(LBij:UBij,4,Nbrec(ng))
1415 real(r8),
intent(in) :: d_zeta_obc(LBij:UBij,4,Nbrec(ng))
1417# ifdef ADJUST_WSTRESS
1418 real(r8),
intent(in) :: d_sustr(LBi:UBi,LBj:UBj,Nfrec(ng))
1419 real(r8),
intent(in) :: d_svstr(LBi:UBi,LBj:UBj,Nfrec(ng))
1422# ifdef ADJUST_STFLUX
1423 real(r8),
intent(in) :: d_stflx(LBi:UBi,LBj:UBj, &
1426 real(r8),
intent(in) :: d_t(LBi:UBi,LBj:UBj,N(ng),NT(ng))
1427 real(r8),
intent(in) :: d_u(LBi:UBi,LBj:UBj,N(ng))
1428 real(r8),
intent(in) :: d_v(LBi:UBi,LBj:UBj,N(ng))
1430 real(r8),
intent(in) :: d_ubar(LBi:UBi,LBj:UBj)
1431 real(r8),
intent(in) :: d_vbar(LBi:UBi,LBj:UBj)
1433 real(r8),
intent(in) :: d_zeta(LBi:UBi,LBj:UBj)
1434# ifdef ADJUST_BOUNDARY
1436 real(r8),
intent(inout) :: ad_t_obc(LBij:UBij,N(ng),4, &
1437 & Nbrec(ng),2,NT(ng))
1438 real(r8),
intent(inout) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
1439 real(r8),
intent(inout) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
1441 real(r8),
intent(inout) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
1442 real(r8),
intent(inout) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
1443 real(r8),
intent(inout) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
1445# ifdef ADJUST_WSTRESS
1446 real(r8),
intent(inout) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
1447 real(r8),
intent(inout) :: ad_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
1450# ifdef ADJUST_STFLUX
1451 real(r8),
intent(inout) :: ad_tflux(LBi:UBi,LBj:UBj, &
1452 & Nfrec(ng),2,NT(ng))
1454 real(r8),
intent(inout) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
1455 real(r8),
intent(inout) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
1456 real(r8),
intent(inout) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
1458 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
1459 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
1461 real(r8),
intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,:)
1462# ifdef ADJUST_BOUNDARY
1464 real(r8),
intent(inout) :: tl_t_obc(LBij:UBij,N(ng),4, &
1465 & Nbrec(ng),2,NT(ng))
1466 real(r8),
intent(inout) :: tl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
1467 real(r8),
intent(inout) :: tl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
1469 real(r8),
intent(inout) :: tl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
1470 real(r8),
intent(inout) :: tl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
1471 real(r8),
intent(inout) :: tl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
1473# ifdef ADJUST_WSTRESS
1474 real(r8),
intent(inout) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
1475 real(r8),
intent(inout) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
1478# ifdef ADJUST_STFLUX
1479 real(r8),
intent(inout) :: tl_tflux(LBi:UBi,LBj:UBj, &
1480 & Nfrec(ng),2,NT(ng))
1482 real(r8),
intent(inout) :: tl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
1483 real(r8),
intent(inout) :: tl_u(LBi:UBi,LBj:UBj,N(ng),2)
1484 real(r8),
intent(inout) :: tl_v(LBi:UBi,LBj:UBj,N(ng),2)
1486 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
1487 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
1489 real(r8),
intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,:)
1494 integer :: i, j, k, lstr, rec
1495 integer :: ib, ir, it
1497 real(r8) :: fac, fac1, fac2
1499# include "set_bounds.h"
1509 tl_zeta(i,j,lout)=d_zeta(i,j)
1511 tl_zeta(i,j,lout)=tl_zeta(i,j,lout)*rmask(i,j)
1516# ifdef ADJUST_BOUNDARY
1523 &
domain(ng)%Western_Edge(tile))
THEN
1526 tl_zeta_obc(j,ib,ir,lout)=d_zeta_obc(j,ib,ir)
1528 tl_zeta_obc(j,ib,ir,lout)=tl_zeta_obc(j,ib,ir,lout)* &
1534 &
domain(ng)%Eastern_Edge(tile))
THEN
1537 tl_zeta_obc(j,ib,ir,lout)=d_zeta_obc(j,ib,ir)
1539 tl_zeta_obc(j,ib,ir,lout)=tl_zeta_obc(j,ib,ir,lout)* &
1545 &
domain(ng)%Southern_Edge(tile))
THEN
1548 tl_zeta_obc(i,ib,ir,lout)=d_zeta_obc(i,ib,ir)
1550 tl_zeta_obc(i,ib,ir,lout)=tl_zeta_obc(i,ib,ir,lout)* &
1556 &
domain(ng)%Northern_Edge(tile))
THEN
1559 tl_zeta_obc(i,ib,ir,lout)=d_zeta_obc(i,ib,ir)
1561 tl_zeta_obc(i,ib,ir,lout)=tl_zeta_obc(i,ib,ir,lout)* &
1576 tl_ubar(i,j,lout)=d_ubar(i,j)
1578 tl_ubar(i,j,lout)=tl_ubar(i,j,lout)*umask(i,j)
1584# ifdef ADJUST_BOUNDARY
1591 &
domain(ng)%Western_Edge(tile))
THEN
1594 tl_ubar_obc(j,ib,ir,lout)=d_ubar_obc(j,ib,ir)
1596 tl_ubar_obc(j,ib,ir,lout)=tl_ubar_obc(j,ib,ir,lout)* &
1602 &
domain(ng)%Eastern_Edge(tile))
THEN
1605 tl_ubar_obc(j,ib,ir,lout)=d_ubar_obc(j,ib,ir)
1607 tl_ubar_obc(j,ib,ir,lout)=tl_ubar_obc(j,ib,ir,lout)* &
1613 &
domain(ng)%Southern_Edge(tile))
THEN
1616 tl_ubar_obc(i,ib,ir,lout)=d_ubar_obc(i,ib,ir)
1618 tl_ubar_obc(i,ib,ir,lout)=tl_ubar_obc(i,ib,ir,lout)* &
1624 &
domain(ng)%Northern_Edge(tile))
THEN
1627 tl_ubar_obc(i,ib,ir,lout)=d_ubar_obc(i,ib,ir)
1629 tl_ubar_obc(i,ib,ir,lout)=tl_ubar_obc(i,ib,ir,lout)* &
1644 tl_vbar(i,j,lout)=d_vbar(i,j)
1646 tl_vbar(i,j,lout)=tl_vbar(i,j,lout)*vmask(i,j)
1652# ifdef ADJUST_BOUNDARY
1659 &
domain(ng)%Western_Edge(tile))
THEN
1662 tl_vbar_obc(j,ib,ir,lout)=d_vbar_obc(j,ib,ir)
1664 tl_vbar_obc(j,ib,ir,lout)=tl_vbar_obc(j,ib,ir,lout)* &
1670 &
domain(ng)%Eastern_Edge(tile))
THEN
1673 tl_vbar_obc(j,ib,ir,lout)=d_vbar_obc(j,ib,ir)
1675 tl_vbar_obc(j,ib,ir,lout)=tl_vbar_obc(j,ib,ir,lout)* &
1681 &
domain(ng)%Southern_Edge(tile))
THEN
1684 tl_vbar_obc(i,ib,ir,lout)=d_vbar_obc(i,ib,ir)
1686 tl_vbar_obc(i,ib,ir,lout)=tl_vbar_obc(i,ib,ir,lout)* &
1692 &
domain(ng)%Northern_Edge(tile))
THEN
1695 tl_vbar_obc(i,ib,ir,lout)=d_vbar_obc(i,ib,ir)
1697 tl_vbar_obc(i,ib,ir,lout)=tl_vbar_obc(i,ib,ir,lout)* &
1706# ifdef ADJUST_WSTRESS
1713 tl_ustr(i,j,ir,lout)=d_sustr(i,j,ir)
1715 tl_ustr(i,j,ir,lout)=tl_ustr(i,j,ir,lout)*umask(i,j)
1721 tl_vstr(i,j,ir,lout)=d_svstr(i,j,ir)
1723 tl_vstr(i,j,ir,lout)=tl_vstr(i,j,ir,lout)*vmask(i,j)
1737 tl_u(i,j,k,lout)=d_u(i,j,k)
1739 tl_u(i,j,k,lout)=tl_u(i,j,k,lout)*umask(i,j)
1745# ifdef ADJUST_BOUNDARY
1752 &
domain(ng)%Western_Edge(tile))
THEN
1756 tl_u_obc(j,k,ib,ir,lout)=d_u_obc(j,k,ib,ir)
1758 tl_u_obc(j,k,ib,ir,lout)=tl_u_obc(j,k,ib,ir,lout)* &
1765 &
domain(ng)%Eastern_Edge(tile))
THEN
1769 tl_u_obc(j,k,ib,ir,lout)=d_u_obc(j,k,ib,ir)
1771 tl_u_obc(j,k,ib,ir,lout)=tl_u_obc(j,k,ib,ir,lout)* &
1778 &
domain(ng)%Southern_Edge(tile))
THEN
1782 tl_u_obc(i,k,ib,ir,lout)=d_u_obc(i,k,ib,ir)
1784 tl_u_obc(i,k,ib,ir,lout)=tl_u_obc(i,k,ib,ir,lout)* &
1791 &
domain(ng)%Northern_Edge(tile))
THEN
1795 tl_u_obc(i,k,ib,ir,lout)=d_u_obc(i,k,ib,ir)
1797 tl_u_obc(i,k,ib,ir,lout)=tl_u_obc(i,k,ib,ir,lout)* &
1812 tl_v(i,j,k,lout)=d_v(i,j,k)
1814 tl_v(i,j,k,lout)=tl_v(i,j,k,lout)*vmask(i,j)
1820# ifdef ADJUST_BOUNDARY
1827 &
domain(ng)%Western_Edge(tile))
THEN
1831 tl_v_obc(j,k,ib,ir,lout)=d_v_obc(j,k,ib,ir)
1833 tl_v_obc(j,k,ib,ir,lout)=tl_v_obc(j,k,ib,ir,lout)* &
1840 &
domain(ng)%Eastern_Edge(tile))
THEN
1844 tl_v_obc(j,k,ib,ir,lout)=d_v_obc(j,k,ib,ir)
1846 tl_v_obc(j,k,ib,ir,lout)=tl_v_obc(j,k,ib,ir,lout)* &
1853 &
domain(ng)%Southern_Edge(tile))
THEN
1857 tl_v_obc(i,k,ib,ir,lout)=d_v_obc(i,k,ib,ir)
1859 tl_v_obc(i,k,ib,ir,lout)=tl_v_obc(i,k,ib,ir,lout)* &
1866 &
domain(ng)%Northern_Edge(tile))
THEN
1870 tl_v_obc(i,k,ib,ir,lout)=d_v_obc(i,k,ib,ir)
1872 tl_v_obc(i,k,ib,ir,lout)=tl_v_obc(i,k,ib,ir,lout)* &
1888 tl_t(i,j,k,lout,it)=d_t(i,j,k,it)
1890 tl_t(i,j,k,lout,it)=tl_t(i,j,k,lout,it)*rmask(i,j)
1897# ifdef ADJUST_BOUNDARY
1905 &
domain(ng)%Western_Edge(tile))
THEN
1909 tl_t_obc(j,k,ib,ir,lout,it)=d_t_obc(j,k,ib,ir,it)
1911 tl_t_obc(j,k,ib,ir,lout,it)= &
1912 & tl_t_obc(j,k,ib,ir,lout,it)*rmask(istr-1,j)
1918 &
domain(ng)%Eastern_Edge(tile))
THEN
1922 tl_t_obc(j,k,ib,ir,lout,it)=d_t_obc(j,k,ib,ir,it)
1924 tl_t_obc(j,k,ib,ir,lout,it)= &
1925 & tl_t_obc(j,k,ib,ir,lout,it)*rmask(iend+1,j)
1931 &
domain(ng)%Southern_Edge(tile))
THEN
1935 tl_t_obc(i,k,ib,ir,lout,it)=d_t_obc(i,k,ib,ir,it)
1937 tl_t_obc(i,k,ib,ir,lout,it)= &
1938 & tl_t_obc(i,k,ib,ir,lout,it)*rmask(i,jstr-1)
1944 &
domain(ng)%Northern_Edge(tile))
THEN
1948 tl_t_obc(i,k,ib,ir,lout,it)=d_t_obc(i,k,ib,ir,it)
1950 tl_t_obc(i,k,ib,ir,lout,it)= &
1951 & tl_t_obc(i,k,ib,ir,lout,it)*rmask(i,jend+1)
1961# ifdef ADJUST_STFLUX
1970 tl_tflux(i,j,ir,lout,it)=d_stflx(i,j,ir,it)
1972 tl_tflux(i,j,ir,lout,it)=tl_tflux(i,j,ir,lout,it)* &
1989 & LBi, UBi, LBj, UBj, LBij, UBij, &
1990 & IminS, ImaxS, JminS, JmaxS, &
1993 & rmask, umask, vmask, &
1995# ifdef ADJUST_BOUNDARY
1997 & ad_t_obc, ad_u_obc, ad_v_obc, &
1999 & ad_ubar_obc, ad_vbar_obc, &
2002# ifdef ADJUST_WSTRESS
2003 & ad_ustr, ad_vstr, &
2006# ifdef ADJUST_STFLUX
2009 & ad_t, ad_u, ad_v, &
2011 & ad_ubar, ad_vbar, &
2014# ifdef ADJUST_BOUNDARY
2016 & d_t_obc, d_u_obc, d_v_obc, &
2018 & d_ubar_obc, d_vbar_obc, &
2021# ifdef ADJUST_WSTRESS
2022 & d_sustr, d_svstr, &
2025# ifdef ADJUST_STFLUX
2037 integer,
intent(in) :: ng, tile, model
2038 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
2039 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
2040 integer,
intent(in) :: Lold, Lnew
2042# ifdef ASSUMED_SHAPE
2044 real(r8),
intent(in) :: rmask(LBi:,LBj:)
2045 real(r8),
intent(in) :: umask(LBi:,LBj:)
2046 real(r8),
intent(in) :: vmask(LBi:,LBj:)
2048# ifdef ADJUST_BOUNDARY
2050 real(r8),
intent(in) :: ad_t_obc(LBij:,:,:,:,:,:)
2051 real(r8),
intent(in) :: ad_u_obc(LBij:,:,:,:,:)
2052 real(r8),
intent(in) :: ad_v_obc(LBij:,:,:,:,:)
2054 real(r8),
intent(in) :: ad_ubar_obc(LBij:,:,:,:)
2055 real(r8),
intent(in) :: ad_vbar_obc(LBij:,:,:,:)
2056 real(r8),
intent(in) :: ad_zeta_obc(LBij:,:,:,:)
2058# ifdef ADJUST_WSTRESS
2059 real(r8),
intent(in) :: ad_ustr(LBi:,LBj:,:,:)
2060 real(r8),
intent(in) :: ad_vstr(LBi:,LBj:,:,:)
2063# ifdef ADJUST_STFLUX
2064 real(r8),
intent(in) :: ad_tflux(LBi:,LBj:,:,:,:)
2066 real(r8),
intent(in) :: ad_t(LBi:,LBj:,:,:,:)
2067 real(r8),
intent(in) :: ad_u(LBi:,LBj:,:,:)
2068 real(r8),
intent(in) :: ad_v(LBi:,LBj:,:,:)
2070 real(r8),
intent(in) :: ad_ubar(LBi:,LBj:,:)
2071 real(r8),
intent(in) :: ad_vbar(LBi:,LBj:,:)
2073 real(r8),
intent(in) :: ad_zeta(LBi:,LBj:,:)
2074# ifdef ADJUST_BOUNDARY
2076 real(r8),
intent(inout) :: d_t_obc(LBij:,:,:,:,:)
2077 real(r8),
intent(inout) :: d_u_obc(LBij:,:,:,:)
2078 real(r8),
intent(inout) :: d_v_obc(LBij:,:,:,:)
2080 real(r8),
intent(inout) :: d_ubar_obc(LBij:,:,:)
2081 real(r8),
intent(inout) :: d_vbar_obc(LBij:,:,:)
2082 real(r8),
intent(inout) :: d_zeta_obc(LBij:,:,:)
2084# ifdef ADJUST_WSTRESS
2085 real(r8),
intent(inout) :: d_sustr(LBi:,LBj:,:)
2086 real(r8),
intent(inout) :: d_svstr(LBi:,LBj:,:)
2089# ifdef ADJUST_STFLUX
2090 real(r8),
intent(inout) :: d_stflx(LBi:,LBj:,:,:)
2092 real(r8),
intent(inout) :: d_t(LBi:,LBj:,:,:)
2093 real(r8),
intent(inout) :: d_u(LBi:,LBj:,:)
2094 real(r8),
intent(inout) :: d_v(LBi:,LBj:,:)
2096 real(r8),
intent(inout) :: d_ubar(LBi:,LBj:)
2097 real(r8),
intent(inout) :: d_vbar(LBi:,LBj:)
2099 real(r8),
intent(inout) :: d_zeta(LBi:,LBj:)
2104 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
2105 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
2106 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
2108# ifdef ADJUST_BOUNDARY
2110 real(r8),
intent(in) :: ad_t_obc(LBij:UBij,N(ng),4, &
2111 & Nbrec(ng),2,NT(ng))
2112 real(r8),
intent(in) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2113 real(r8),
intent(in) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2115 real(r8),
intent(in) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
2116 real(r8),
intent(in) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
2117 real(r8),
intent(in) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
2119# ifdef ADJUST_WSTRESS
2120 real(r8),
intent(in) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2121 real(r8),
intent(in) :: ad_vstr(LBi:UBI,LBj:UBj,Nfrec(ng),2)
2124# ifdef ADJUST_STFLUX
2125 real(r8),
intent(in) :: ad_tflux(LBi:UBi,LBj:UBj, &
2126 & Nfrec(ng),2,NT(ng))
2128 real(r8),
intent(in) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
2129 real(r8),
intent(in) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
2130 real(r8),
intent(in) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
2132 real(r8),
intent(in) :: ad_ubar(LBi:UBi,LBj:UBj,:)
2133 real(r8),
intent(in) :: ad_vbar(LBi:UBi,LBj:UBj,:)
2135 real(r8),
intent(in) :: ad_zeta(LBi:UBi,LBj:UBj,:)
2136# ifdef ADJUST_BOUNDARY
2138 real(r8),
intent(inout) :: d_t_obc(LBij:UBij,N(ng),4, &
2140 real(r8),
intent(inout) :: d_u_obc(LBij:UBij,N(ng),4,Nbrec(ng))
2141 real(r8),
intent(inout) :: d_v_obc(LBij:UBij,N(ng),4,Nbrec(ng))
2143 real(r8),
intent(inout) :: d_ubar_obc(LBij:UBij,4,Nbrec(ng))
2144 real(r8),
intent(inout) :: d_vbar_obc(LBij:UBij,4,Nbrec(ng))
2145 real(r8),
intent(inout) :: d_zeta_obc(LBij:UBij,4,Nbrec(ng))
2147# ifdef ADJUST_WSTRESS
2148 real(r8),
intent(inout) :: d_sustr(LBi:UBi,LBj:UBj,Nfrec(ng))
2149 real(r8),
intent(inout) :: d_svstr(LBi:UBI,LBj:UBj,Nfrec(ng))
2152# ifdef ADJUST_STFLUX
2153 real(r8),
intent(inout) :: d_stflx(LBi:UBi,LBj:UBj, &
2156 real(r8),
intent(inout) :: d_t(LBi:UBi,LBj:UBj,N(ng),NT(ng))
2157 real(r8),
intent(inout) :: d_u(LBi:UBi,LBj:UBj,N(ng))
2158 real(r8),
intent(inout) :: d_v(LBi:UBi,LBj:UBj,N(ng))
2160 real(r8),
intent(inout) :: d_ubar(LBi:UBi,LBj:UBj)
2161 real(r8),
intent(inout) :: d_vbar(LBi:UBi,LBj:UBj)
2163 real(r8),
intent(inout) :: d_zeta(LBi:UBi,LBj:UBj)
2169 integer :: ib, ir, it
2171# include "set_bounds.h"
2182 d_zeta(i,j)=ad_zeta(i,j,lnew)
2184 d_zeta(i,j)=d_zeta(i,j)*rmask(i,j)
2189# ifdef ADJUST_BOUNDARY
2196 &
domain(ng)%Western_Edge(tile))
THEN
2199 d_zeta_obc(j,ib,ir)=ad_zeta_obc(j,ib,ir,lnew)
2201 d_zeta_obc(j,ib,ir)=d_zeta_obc(j,ib,ir)* &
2207 &
domain(ng)%Eastern_Edge(tile))
THEN
2210 d_zeta_obc(j,ib,ir)=ad_zeta_obc(j,ib,ir,lnew)
2212 d_zeta_obc(j,ib,ir)=d_zeta_obc(j,ib,ir)* &
2218 &
domain(ng)%Southern_Edge(tile))
THEN
2221 d_zeta_obc(i,ib,ir)=ad_zeta_obc(i,ib,ir,lnew)
2223 d_zeta_obc(i,ib,ir)=d_zeta_obc(i,ib,ir)* &
2229 &
domain(ng)%Northern_Edge(tile))
THEN
2232 d_zeta_obc(i,ib,ir)=ad_zeta_obc(i,ib,ir,lnew)
2234 d_zeta_obc(i,ib,ir)=d_zeta_obc(i,ib,ir)* &
2249 d_ubar(i,j)=ad_ubar(i,j,lnew)
2251 d_ubar(i,j)=d_ubar(i,j)*umask(i,j)
2257# ifdef ADJUST_BOUNDARY
2264 &
domain(ng)%Western_Edge(tile))
THEN
2267 d_ubar_obc(j,ib,ir)=ad_ubar_obc(j,ib,ir,lnew)
2269 d_ubar_obc(j,ib,ir)=d_ubar_obc(j,ib,ir)* &
2275 &
domain(ng)%Eastern_Edge(tile))
THEN
2278 d_ubar_obc(j,ib,ir)=ad_ubar_obc(j,ib,ir,lnew)
2280 d_ubar_obc(j,ib,ir)=d_ubar_obc(j,ib,ir)* &
2286 &
domain(ng)%Southern_Edge(tile))
THEN
2289 d_ubar_obc(i,ib,ir)=ad_ubar_obc(i,ib,ir,lnew)
2291 d_ubar_obc(i,ib,ir)=d_ubar_obc(i,ib,ir)* &
2297 &
domain(ng)%Northern_Edge(tile))
THEN
2300 d_ubar_obc(i,ib,ir)=ad_ubar_obc(i,ib,ir,lnew)
2302 d_ubar_obc(i,ib,ir)=d_ubar_obc(i,ib,ir)* &
2317 d_vbar(i,j)=ad_vbar(i,j,lnew)
2319 d_vbar(i,j)=d_vbar(i,j)*vmask(i,j)
2325# ifdef ADJUST_BOUNDARY
2332 &
domain(ng)%Western_Edge(tile))
THEN
2335 d_vbar_obc(j,ib,ir)=ad_vbar_obc(j,ib,ir,lnew)
2337 d_vbar_obc(j,ib,ir)=d_vbar_obc(j,ib,ir)* &
2343 &
domain(ng)%Eastern_Edge(tile))
THEN
2346 d_vbar_obc(j,ib,ir)=ad_vbar_obc(j,ib,ir,lnew)
2348 d_vbar_obc(j,ib,ir)=d_vbar_obc(j,ib,ir)* &
2354 &
domain(ng)%Southern_Edge(tile))
THEN
2357 d_vbar_obc(i,ib,ir)=ad_vbar_obc(i,ib,ir,lnew)
2359 d_vbar_obc(i,ib,ir)=d_vbar_obc(i,ib,ir)* &
2365 &
domain(ng)%Northern_Edge(tile))
THEN
2368 d_vbar_obc(i,ib,ir)=ad_vbar_obc(i,ib,ir,lnew)
2370 d_vbar_obc(i,ib,ir)=d_vbar_obc(i,ib,ir)* &
2379# ifdef ADJUST_WSTRESS
2386 d_sustr(i,j,ir)=ad_ustr(i,j,ir,lnew)
2388 d_sustr(i,j,ir)=d_sustr(i,j,ir)*umask(i,j)
2394 d_svstr(i,j,ir)=ad_vstr(i,j,ir,lnew)
2396 d_svstr(i,j,ir)=d_svstr(i,j,ir)*vmask(i,j)
2410 d_u(i,j,k)=ad_u(i,j,k,lnew)
2412 d_u(i,j,k)=d_u(i,j,k)*umask(i,j)
2418# ifdef ADJUST_BOUNDARY
2425 &
domain(ng)%Western_Edge(tile))
THEN
2429 d_u_obc(j,k,ib,ir)=ad_u_obc(j,k,ib,ir,lnew)
2431 d_u_obc(j,k,ib,ir)=d_u_obc(j,k,ib,ir)* &
2438 &
domain(ng)%Eastern_Edge(tile))
THEN
2442 d_u_obc(j,k,ib,ir)=ad_u_obc(j,k,ib,ir,lnew)
2444 d_u_obc(j,k,ib,ir)=d_u_obc(j,k,ib,ir)* &
2451 &
domain(ng)%Southern_Edge(tile))
THEN
2455 d_u_obc(i,k,ib,ir)=ad_u_obc(i,k,ib,ir,lnew)
2457 d_u_obc(i,k,ib,ir)=d_u_obc(i,k,ib,ir)* &
2464 &
domain(ng)%Northern_Edge(tile))
THEN
2468 d_u_obc(i,k,ib,ir)=ad_u_obc(i,k,ib,ir,lnew)
2470 d_u_obc(i,k,ib,ir)=d_u_obc(i,k,ib,ir)* &
2485 d_v(i,j,k)=ad_v(i,j,k,lnew)
2487 d_v(i,j,k)=d_v(i,j,k)*vmask(i,j)
2493# ifdef ADJUST_BOUNDARY
2500 &
domain(ng)%Western_Edge(tile))
THEN
2504 d_v_obc(j,k,ib,ir)=ad_v_obc(j,k,ib,ir,lnew)
2506 d_v_obc(j,k,ib,ir)=d_v_obc(j,k,ib,ir)* &
2513 &
domain(ng)%Eastern_Edge(tile))
THEN
2517 d_v_obc(j,k,ib,ir)=ad_v_obc(j,k,ib,ir,lnew)
2519 d_v_obc(j,k,ib,ir)=d_v_obc(j,k,ib,ir)* &
2526 &
domain(ng)%Southern_Edge(tile))
THEN
2530 d_v_obc(i,k,ib,ir)=ad_v_obc(i,k,ib,ir,lnew)
2532 d_v_obc(i,k,ib,ir)=d_v_obc(i,k,ib,ir)* &
2539 &
domain(ng)%Northern_Edge(tile))
THEN
2543 d_v_obc(i,k,ib,ir)=ad_v_obc(i,k,ib,ir,lnew)
2545 d_v_obc(i,k,ib,ir)=d_v_obc(i,k,ib,ir)* &
2561 d_t(i,j,k,it)=ad_t(i,j,k,lnew,it)
2563 d_t(i,j,k,it)=d_t(i,j,k,it)*rmask(i,j)
2570# ifdef ADJUST_BOUNDARY
2578 &
domain(ng)%Western_Edge(tile))
THEN
2582 d_t_obc(j,k,ib,ir,it)=ad_t_obc(j,k,ib,ir,lnew,it)
2584 d_t_obc(j,k,ib,ir,it)=d_t_obc(j,k,ib,ir,it)* &
2591 &
domain(ng)%Eastern_Edge(tile))
THEN
2595 d_t_obc(j,k,ib,ir,it)=ad_t_obc(j,k,ib,ir,lnew,it)
2597 d_t_obc(j,k,ib,ir,it)=d_t_obc(j,k,ib,ir,it)* &
2604 &
domain(ng)%Southern_Edge(tile))
THEN
2608 d_t_obc(i,k,ib,ir,it)=ad_t_obc(i,k,ib,ir,lnew,it)
2610 d_t_obc(i,k,ib,ir,it)=d_t_obc(i,k,ib,ir,it)* &
2617 &
domain(ng)%Northern_Edge(tile))
THEN
2621 d_t_obc(i,k,ib,ir,it)=ad_t_obc(i,k,ib,ir,lnew,it)
2623 d_t_obc(i,k,ib,ir,it)=d_t_obc(i,k,ib,ir,it)* &
2634# ifdef ADJUST_STFLUX
2643 d_stflx(i,j,ir,it)=ad_tflux(i,j,ir,lnew,it)
2645 d_stflx(i,j,ir,it)=d_stflx(i,j,ir,it)*rmask(i,j)
2660 & LBi, UBi, LBj, UBj, LBij, UBij, &
2661 & IminS, ImaxS, JminS, JmaxS, &
2662 & Lold, Lnew, Lwrk, &
2663 & innLoop, outLoop, &
2665 & rmask, umask, vmask, &
2667# ifdef ADJUST_BOUNDARY
2669 & ad_t_obc, ad_u_obc, ad_v_obc, &
2671 & ad_ubar_obc, ad_vbar_obc, &
2674# ifdef ADJUST_WSTRESS
2675 & ad_ustr, ad_vstr, &
2678# ifdef ADJUST_STFLUX
2681 & ad_t, ad_u, ad_v, &
2682# if defined WEAK_CONSTRAINT && defined TIME_CONV
2683 & ad_ubar, ad_vbar, &
2686 & ad_ubar, ad_vbar, &
2689# ifdef ADJUST_BOUNDARY
2691 & tl_t_obc, tl_u_obc, tl_v_obc, &
2693 & tl_ubar_obc, tl_vbar_obc, &
2696# ifdef ADJUST_WSTRESS
2697 & tl_ustr, tl_vstr, &
2700# ifdef ADJUST_STFLUX
2703 & tl_t, tl_u, tl_v, &
2704# if defined WEAK_CONSTRAINT && defined TIME_CONV
2705 & tl_ubar, tl_vbar, &
2708 & tl_ubar, tl_vbar, &
2711# ifdef ADJUST_BOUNDARY
2713 & nl_t_obc, nl_u_obc, nl_v_obc, &
2715 & nl_ubar_obc, nl_vbar_obc, &
2718# ifdef ADJUST_WSTRESS
2719 & nl_ustr, nl_vstr, &
2722# ifdef ADJUST_STFLUX
2725 & nl_t, nl_u, nl_v, &
2726# if defined WEAK_CONSTRAINT && defined TIME_CONV
2727 & nl_ubar, nl_vbar, &
2730 & nl_ubar, nl_vbar, &
2737 integer,
intent(in) :: ng, tile, model
2738 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
2739 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
2740 integer,
intent(in) :: Lold, Lnew, Lwrk
2741 integer,
intent(in) :: innLoop, outLoop
2743# ifdef ASSUMED_SHAPE
2745 real(r8),
intent(in) :: rmask(LBi:,LBj:)
2746 real(r8),
intent(in) :: umask(LBi:,LBj:)
2747 real(r8),
intent(in) :: vmask(LBi:,LBj:)
2749# ifdef ADJUST_BOUNDARY
2751 real(r8),
intent(inout) :: ad_t_obc(LBij:,:,:,:,:,:)
2752 real(r8),
intent(inout) :: ad_u_obc(LBij:,:,:,:,:)
2753 real(r8),
intent(inout) :: ad_v_obc(LBij:,:,:,:,:)
2755 real(r8),
intent(inout) :: ad_ubar_obc(LBij:,:,:,:)
2756 real(r8),
intent(inout) :: ad_vbar_obc(LBij:,:,:,:)
2757 real(r8),
intent(inout) :: ad_zeta_obc(LBij:,:,:,:)
2759# ifdef ADJUST_WSTRESS
2760 real(r8),
intent(inout) :: ad_ustr(LBi:,LBj:,:,:)
2761 real(r8),
intent(inout) :: ad_vstr(LBi:,LBj:,:,:)
2764# ifdef ADJUST_STFLUX
2765 real(r8),
intent(inout) :: ad_tflux(LBi:,LBj:,:,:,:)
2767 real(r8),
intent(inout) :: ad_t(LBi:,LBj:,:,:,:)
2768 real(r8),
intent(inout) :: ad_u(LBi:,LBj:,:,:)
2769 real(r8),
intent(inout) :: ad_v(LBi:,LBj:,:,:)
2770# if defined WEAK_CONSTRAINT && defined TIME_CONV
2771 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
2772 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
2775 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
2776 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
2778 real(r8),
intent(inout) :: ad_zeta(LBi:,LBj:,:)
2779# ifdef ADJUST_BOUNDARY
2781 real(r8),
intent(inout) :: tl_t_obc(LBij:,:,:,:,:,:)
2782 real(r8),
intent(inout) :: tl_u_obc(LBij:,:,:,:,:)
2783 real(r8),
intent(inout) :: tl_v_obc(LBij:,:,:,:,:)
2785 real(r8),
intent(inout) :: tl_ubar_obc(LBij:,:,:,:)
2786 real(r8),
intent(inout) :: tl_vbar_obc(LBij:,:,:,:)
2787 real(r8),
intent(inout) :: tl_zeta_obc(LBij:,:,:,:)
2789# ifdef ADJUST_WSTRESS
2790 real(r8),
intent(inout) :: tl_ustr(LBi:,LBj:,:,:)
2791 real(r8),
intent(inout) :: tl_vstr(LBi:,LBj:,:,:)
2794# ifdef ADJUST_STFLUX
2795 real(r8),
intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
2797 real(r8),
intent(inout) :: tl_t(LBi:,LBj:,:,:,:)
2798 real(r8),
intent(inout) :: tl_u(LBi:,LBj:,:,:)
2799 real(r8),
intent(inout) :: tl_v(LBi:,LBj:,:,:)
2800# if defined WEAK_CONSTRAINT && defined TIME_CONV
2801 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
2802 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
2805 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
2806 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
2808 real(r8),
intent(inout) :: tl_zeta(LBi:,LBj:,:)
2809# ifdef ADJUST_BOUNDARY
2811 real(r8),
intent(inout) :: nl_t_obc(LBij:,:,:,:,:,:)
2812 real(r8),
intent(inout) :: nl_u_obc(LBij:,:,:,:,:)
2813 real(r8),
intent(inout) :: nl_v_obc(LBij:,:,:,:,:)
2815 real(r8),
intent(inout) :: nl_ubar_obc(LBij:,:,:,:)
2816 real(r8),
intent(inout) :: nl_vbar_obc(LBij:,:,:,:)
2817 real(r8),
intent(inout) :: nl_zeta_obc(LBij:,:,:,:)
2819# ifdef ADJUST_WSTRESS
2820 real(r8),
intent(inout) :: nl_ustr(LBi:,LBj:,:,:)
2821 real(r8),
intent(inout) :: nl_vstr(LBi:,LBj:,:,:)
2824# ifdef ADJUST_STFLUX
2825 real(r8),
intent(inout) :: nl_tflux(LBi:,LBj:,:,:,:)
2827 real(r8),
intent(inout) :: nl_t(LBi:,LBj:,:,:,:)
2828 real(r8),
intent(inout) :: nl_u(LBi:,LBj:,:,:)
2829 real(r8),
intent(inout) :: nl_v(LBi:,LBj:,:,:)
2830# if defined WEAK_CONSTRAINT && defined TIME_CONV
2831 real(r8),
intent(inout) :: nl_ubar(LBi:,LBj:,:)
2832 real(r8),
intent(inout) :: nl_vbar(LBi:,LBj:,:)
2835 real(r8),
intent(inout) :: nl_ubar(LBi:,LBj:,:)
2836 real(r8),
intent(inout) :: nl_vbar(LBi:,LBj:,:)
2838 real(r8),
intent(inout) :: nl_zeta(LBi:,LBj:,:)
2843 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
2844 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
2845 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
2847# ifdef ADJUST_BOUNDARY
2849 real(r8),
intent(inout) :: ad_t_obc(LBij:UBij,N(ng),4, &
2850 & Nbrec(ng),2,NT(ng))
2851 real(r8),
intent(inout) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2852 real(r8),
intent(inout) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2854 real(r8),
intent(inout) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
2855 real(r8),
intent(inout) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
2856 real(r8),
intent(inout) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
2858# ifdef ADJUST_WSTRESS
2859 real(r8),
intent(inout) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2860 real(r8),
intent(inout) :: ad_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2863# ifdef ADJUST_STFLUX
2864 real(r8),
intent(inout) :: ad_tflux(LBi:UBi,LBj:UBj, &
2865 & Nfrec(ng),2,NT(ng))
2867 real(r8),
intent(inout) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
2868 real(r8),
intent(inout) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
2869 real(r8),
intent(inout) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
2870# if defined WEAK_CONSTRAINT && defined TIME_CONV
2871 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
2872 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
2875 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
2876 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
2878 real(r8),
intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,:)
2879# ifdef ADJUST_BOUNDARY
2881 real(r8),
intent(inout) :: tl_t_obc(LBij:UBij,N(ng),4, &
2882 & Nbrec(ng),2,NT(ng))
2883 real(r8),
intent(inout) :: tl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2884 real(r8),
intent(inout) :: tl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2886 real(r8),
intent(inout) :: tl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
2887 real(r8),
intent(inout) :: tl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
2888 real(r8),
intent(inout) :: tl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
2890# ifdef ADJUST_WSTRESS
2891 real(r8),
intent(inout) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2892 real(r8),
intent(inout) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2895# ifdef ADJUST_STFLUX
2896 real(r8),
intent(inout) :: tl_tflux(LBi:UBi,LBj:UBj, &
2897 & Nfrec(ng),2,NT(ng))
2899 real(r8),
intent(inout) :: tl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
2900 real(r8),
intent(inout) :: tl_u(LBi:UBi,LBj:UBj,N(ng),2)
2901 real(r8),
intent(inout) :: tl_v(LBi:UBi,LBj:UBj,N(ng),2)
2902# if defined WEAK_CONSTRAINT && defined TIME_CONV
2903 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
2904 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
2907 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
2908 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
2910 real(r8),
intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,:)
2911# ifdef ADJUST_BOUNDARY
2913 real(r8),
intent(inout) :: nl_t_obc(LBij:UBij,N(ng),4, &
2914 & Nbrec(ng),2,NT(ng))
2915 real(r8),
intent(inout) :: nl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2916 real(r8),
intent(inout) :: nl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
2918 real(r8),
intent(inout) :: nl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
2919 real(r8),
intent(inout) :: nl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
2920 real(r8),
intent(inout) :: nl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
2922# ifdef ADJUST_WSTRESS
2923 real(r8),
intent(inout) :: nl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2924 real(r8),
intent(inout) :: nl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
2927# ifdef ADJUST_STFLUX
2928 real(r8),
intent(inout) :: nl_tflux(LBi:UBi,LBj:UBj, &
2929 & Nfrec(ng),2,NT(ng))
2931 real(r8),
intent(inout) :: nl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
2932 real(r8),
intent(inout) :: nl_u(LBi:UBi,LBj:UBj,N(ng),2)
2933 real(r8),
intent(inout) :: nl_v(LBi:UBi,LBj:UBj,N(ng),2)
2934# if defined WEAK_CONSTRAINT && defined TIME_CONV
2935 real(r8),
intent(inout) :: nl_ubar(LBi:UBi,LBj:UBj,:)
2936 real(r8),
intent(inout) :: nl_vbar(LBi:UBi,LBj:UBj,:)
2939 real(r8),
intent(inout) :: nl_ubar(LBi:UBi,LBj:UBj,:)
2940 real(r8),
intent(inout) :: nl_vbar(LBi:UBi,LBj:UBj,:)
2942 real(r8),
intent(inout) :: nl_zeta(LBi:UBi,LBj:UBj,:)
2947 integer :: i, j, k, lstr
2948 integer :: ib, ir, it, ivec, Ltmp1, Ltmp2, rec
2950 real(r8) :: fac, fac1, fac2, zbet
2952 real(r8),
dimension(0:NstateVar(ng)) :: dot
2953 real(r8),
dimension(1:Ninner) :: DotProd
2955 real(r8),
dimension(Ninner) :: zu, zgam
2957 character (len=256) :: ncname
2959 character (len=*),
parameter :: MyFile = &
2960 & __FILE__//
", analysis_error"
2962# include "set_bounds.h"
2989 & lbi, ubi, lbj, ubj, lbij, ubij, &
2991 & 0,
hss(ng)%ncid, ncname, &
2993 & rmask, umask, vmask, &
2995# ifdef ADJUST_BOUNDARY
2997 & nl_t_obc, nl_u_obc, nl_v_obc, &
2999 & nl_ubar_obc, nl_vbar_obc, &
3002# ifdef ADJUST_WSTRESS
3003 & nl_ustr, nl_vstr, &
3006# ifdef ADJUST_STFLUX
3009 & nl_t, nl_u, nl_v, &
3011 & nl_ubar, nl_vbar, &
3018 & lbi, ubi, lbj, ubj, lbij, ubij, &
3021 & rmask, umask, vmask, &
3023# ifdef ADJUST_BOUNDARY
3025 & ad_t_obc(:,:,:,:,lnew,:), &
3026 & nl_t_obc(:,:,:,:,ltmp1,:), &
3027 & ad_u_obc(:,:,:,:,lnew), &
3028 & nl_u_obc(:,:,:,:,ltmp1), &
3029 & ad_v_obc(:,:,:,:,lnew), &
3030 & nl_v_obc(:,:,:,:,ltmp1), &
3032 & ad_ubar_obc(:,:,:,lnew), &
3033 & nl_ubar_obc(:,:,:,ltmp1), &
3034 & ad_vbar_obc(:,:,:,lnew), &
3035 & nl_vbar_obc(:,:,:,ltmp1), &
3036 & ad_zeta_obc(:,:,:,lnew), &
3037 & nl_zeta_obc(:,:,:,ltmp1), &
3039# ifdef ADJUST_WSTRESS
3040 & ad_ustr(:,:,:,lnew), nl_ustr(:,:,:,ltmp1), &
3041 & ad_vstr(:,:,:,lnew), nl_vstr(:,:,:,ltmp1), &
3044# ifdef ADJUST_STFLUX
3045 & ad_tflux(:,:,:,lnew,:), &
3046 & nl_tflux(:,:,:,ltmp1,:), &
3048 & ad_t(:,:,:,lnew,:), nl_t(:,:,:,ltmp1,:), &
3049 & ad_u(:,:,:,lnew), nl_u(:,:,:,ltmp1), &
3050 & ad_v(:,:,:,lnew), nl_v(:,:,:,ltmp1), &
3052 & ad_ubar(:,:,lnew), nl_ubar(:,:,ltmp1), &
3053 & ad_vbar(:,:,lnew), nl_vbar(:,:,ltmp1), &
3055 & ad_zeta(:,:,lnew), nl_zeta(:,:,ltmp1))
3057 dotprod(ivec)=dot(0)
3064 zu(1)=dotprod(1)/zbet
3066 zgam(ivec)=
cg_beta(ivec,outloop)/zbet
3068 zu(ivec)=(dotprod(ivec)-
cg_beta(ivec,outloop)* &
3073 zu(ivec)=zu(ivec)-zgam(ivec+1)*zu(ivec+1)
3085 & lbi, ubi, lbj, ubj, lbij, ubij, &
3088 & rmask, umask, vmask, &
3090# ifdef ADJUST_BOUNDARY
3092 & nl_t_obc, nl_u_obc, nl_v_obc, &
3094 & nl_ubar_obc, nl_vbar_obc, &
3097# ifdef ADJUST_WSTRESS
3098 & nl_ustr, nl_vstr, &
3101# ifdef ADJUST_STFLUX
3104 & nl_t, nl_u, nl_v, &
3106 & nl_ubar, nl_vbar, &
3118 & lbi, ubi, lbj, ubj, lbij, ubij, &
3120 & 0,
hss(ng)%ncid, ncname, &
3122 & rmask, umask, vmask, &
3124# ifdef ADJUST_BOUNDARY
3126 & nl_t_obc, nl_u_obc, nl_v_obc, &
3128 & nl_ubar_obc, nl_vbar_obc, &
3131# ifdef ADJUST_WSTRESS
3132 & nl_ustr, nl_vstr, &
3135# ifdef ADJUST_STFLUX
3138 & nl_t, nl_u, nl_v, &
3140 & nl_ubar, nl_vbar, &
3152 & lbi, ubi, lbj, ubj, lbij, ubij, &
3153 & ltmp2, ltmp1, ltmp2, fac1, fac2, &
3155 & rmask, umask, vmask, &
3157# ifdef ADJUST_BOUNDARY
3159 & nl_t_obc, nl_t_obc, &
3160 & nl_u_obc, nl_u_obc, &
3161 & nl_v_obc, nl_v_obc, &
3163 & nl_ubar_obc, nl_ubar_obc, &
3164 & nl_vbar_obc, nl_vbar_obc, &
3165 & nl_zeta_obc, nl_zeta_obc, &
3167# ifdef ADJUST_WSTRESS
3168 & nl_ustr, nl_ustr, &
3169 & nl_vstr, nl_vstr, &
3172# ifdef ADJUST_STFLUX
3173 & nl_tflux, nl_tflux, &
3178# if defined WEAK_CONSTRAINT && defined TIME_CONV
3179 & nl_ubar, nl_ubar, &
3180 & nl_vbar, nl_vbar, &
3183 & nl_ubar, nl_ubar, &
3184 & nl_vbar, nl_vbar, &
3192 & lbi, ubi, lbj, ubj, lbij, ubij, &
3194# ifdef ADJUST_BOUNDARY
3196 & ad_t_obc, nl_t_obc, &
3197 & ad_u_obc, nl_u_obc, &
3198 & ad_v_obc, nl_v_obc, &
3200 & ad_ubar_obc, nl_ubar_obc, &
3201 & ad_vbar_obc, nl_vbar_obc, &
3202 & ad_zeta_obc, nl_zeta_obc, &
3204# ifdef ADJUST_WSTRESS
3205 & ad_ustr, nl_ustr, &
3206 & ad_vstr, nl_vstr, &
3209# ifdef ADJUST_STFLUX
3210 & ad_tflux, nl_tflux, &
3215# if defined WEAK_CONSTRAINT && defined TIME_CONV
3216 & ad_ubar, nl_ubar, &
3217 & ad_vbar, nl_vbar, &
3220 & ad_ubar, nl_ubar, &
3221 & ad_vbar, nl_vbar, &
3235 ad_zeta(i,j,lnew)=tl_zeta(i,j,lnew)-ad_zeta(i,j,lnew)
3237 ad_zeta(i,j,lnew)=ad_zeta(i,j,lnew)*rmask(i,j)
3242# ifdef ADJUST_BOUNDARY
3249 &
domain(ng)%Western_Edge(tile))
THEN
3252 ad_zeta_obc(j,ib,ir,lnew)=tl_zeta_obc(j,ib,ir,lnew)- &
3253 & ad_zeta_obc(j,ib,ir,lnew)
3255 ad_zeta_obc(j,ib,ir,lnew)=ad_zeta_obc(j,ib,ir,lnew)* &
3261 &
domain(ng)%Eastern_Edge(tile))
THEN
3264 ad_zeta_obc(j,ib,ir,lnew)=tl_zeta_obc(j,ib,ir,lnew)- &
3265 & ad_zeta_obc(j,ib,ir,lnew)
3267 ad_zeta_obc(j,ib,ir,lnew)=ad_zeta_obc(j,ib,ir,lnew)* &
3273 &
domain(ng)%Southern_Edge(tile))
THEN
3276 ad_zeta_obc(i,ib,ir,lnew)=tl_zeta_obc(i,ib,ir,lnew)- &
3277 & ad_zeta_obc(i,ib,ir,lnew)
3279 ad_zeta_obc(i,ib,ir,lnew)=ad_zeta_obc(i,ib,ir,lnew)* &
3285 &
domain(ng)%Northern_Edge(tile))
THEN
3288 ad_zeta_obc(i,ib,ir,lnew)=tl_zeta_obc(i,ib,ir,lnew)- &
3289 & ad_zeta_obc(i,ib,ir,lnew)
3291 ad_zeta_obc(i,ib,ir,lnew)=ad_zeta_obc(i,ib,ir,lnew)* &
3306 ad_ubar(i,j,lnew)=tl_ubar(i,j,lnew)-ad_ubar(i,j,lnew)
3308 ad_ubar(i,j,lnew)=ad_ubar(i,j,lnew)*umask(i,j)
3314# ifdef ADJUST_BOUNDARY
3321 &
domain(ng)%Western_Edge(tile))
THEN
3324 ad_ubar_obc(j,ib,ir,lnew)=tl_ubar_obc(j,ib,ir,lnew)- &
3325 & ad_ubar_obc(j,ib,ir,lnew)
3327 ad_ubar_obc(j,ib,ir,lnew)=ad_ubar_obc(j,ib,ir,lnew)* &
3333 &
domain(ng)%Eastern_Edge(tile))
THEN
3336 ad_ubar_obc(j,ib,ir,lnew)=tl_ubar_obc(j,ib,ir,lnew)- &
3337 & ad_ubar_obc(j,ib,ir,lnew)
3339 ad_ubar_obc(j,ib,ir,lnew)=ad_ubar_obc(j,ib,ir,lnew)* &
3345 &
domain(ng)%Southern_Edge(tile))
THEN
3348 ad_ubar_obc(i,ib,ir,lnew)=tl_ubar_obc(i,ib,ir,lnew)- &
3349 & ad_ubar_obc(i,ib,ir,lnew)
3351 ad_ubar_obc(i,ib,ir,lnew)=ad_ubar_obc(i,ib,ir,lnew)* &
3357 &
domain(ng)%Northern_Edge(tile))
THEN
3360 ad_ubar_obc(i,ib,ir,lnew)=tl_ubar_obc(i,ib,ir,lnew)- &
3361 & ad_ubar_obc(i,ib,ir,lnew)
3363 ad_ubar_obc(i,ib,ir,lnew)=ad_ubar_obc(i,ib,ir,lnew)* &
3378 ad_vbar(i,j,lnew)=tl_vbar(i,j,lnew)-ad_vbar(i,j,lnew)
3380 ad_vbar(i,j,lnew)=ad_vbar(i,j,lnew)*vmask(i,j)
3386# ifdef ADJUST_BOUNDARY
3393 &
domain(ng)%Western_Edge(tile))
THEN
3396 ad_vbar_obc(j,ib,ir,lnew)=tl_vbar_obc(j,ib,ir,lnew)- &
3397 & ad_vbar_obc(j,ib,ir,lnew)
3399 ad_vbar_obc(j,ib,ir,lnew)=ad_vbar_obc(j,ib,ir,lnew)* &
3405 &
domain(ng)%Eastern_Edge(tile))
THEN
3408 ad_vbar_obc(j,ib,ir,lnew)=tl_vbar_obc(j,ib,ir,lnew)- &
3409 & ad_vbar_obc(j,ib,ir,lnew)
3411 ad_vbar_obc(j,ib,ir,lnew)=ad_vbar_obc(j,ib,ir,lnew)* &
3417 &
domain(ng)%Southern_Edge(tile))
THEN
3420 ad_vbar_obc(i,ib,ir,lnew)=tl_vbar_obc(i,ib,ir,lnew)- &
3421 & ad_vbar_obc(i,ib,ir,lnew)
3423 ad_vbar_obc(i,ib,ir,lnew)=ad_vbar_obc(i,ib,ir,lnew)* &
3429 &
domain(ng)%Northern_Edge(tile))
THEN
3432 ad_vbar_obc(i,ib,ir,lnew)=tl_vbar_obc(i,ib,ir,lnew)- &
3433 & ad_vbar_obc(i,ib,ir,lnew)
3435 ad_vbar_obc(i,ib,ir,lnew)=ad_vbar_obc(i,ib,ir,lnew)* &
3444# ifdef ADJUST_WSTRESS
3451 ad_ustr(i,j,ir,lnew)=tl_ustr(i,j,ir,lnew)- &
3452 & ad_ustr(i,j,ir,lnew)
3454 ad_ustr(i,j,ir,lnew)=ad_ustr(i,j,ir,lnew)*umask(i,j)
3460 ad_vstr(i,j,ir,lnew)=tl_vstr(i,j,ir,lnew)- &
3461 & ad_vstr(i,j,ir,lnew)
3463 ad_vstr(i,j,ir,lnew)=ad_vstr(i,j,ir,lnew)*vmask(i,j)
3477 ad_u(i,j,k,lnew)=tl_u(i,j,k,lnew)-ad_u(i,j,k,lnew)
3479 ad_u(i,j,k,lnew)=ad_u(i,j,k,lnew)*umask(i,j)
3485# ifdef ADJUST_BOUNDARY
3492 &
domain(ng)%Western_Edge(tile))
THEN
3496 ad_u_obc(j,k,ib,ir,lnew)=tl_u_obc(j,k,ib,ir,lnew)- &
3497 & ad_u_obc(j,k,ib,ir,lnew)
3499 ad_u_obc(j,k,ib,ir,lnew)=ad_u_obc(j,k,ib,ir,lnew)* &
3506 &
domain(ng)%Eastern_Edge(tile))
THEN
3510 ad_u_obc(j,k,ib,ir,lnew)=tl_u_obc(j,k,ib,ir,lnew)- &
3511 & ad_u_obc(j,k,ib,ir,lnew)
3513 ad_u_obc(j,k,ib,ir,lnew)=ad_u_obc(j,k,ib,ir,lnew)* &
3520 &
domain(ng)%Southern_Edge(tile))
THEN
3524 ad_u_obc(i,k,ib,ir,lnew)=tl_u_obc(i,k,ib,ir,lnew)- &
3525 & ad_u_obc(i,k,ib,ir,lnew)
3527 ad_u_obc(i,k,ib,ir,lnew)=ad_u_obc(i,k,ib,ir,lnew)* &
3534 &
domain(ng)%Northern_Edge(tile))
THEN
3538 ad_u_obc(i,k,ib,ir,lnew)=tl_u_obc(i,k,ib,ir,lnew)- &
3539 & ad_u_obc(i,k,ib,ir,lnew)
3541 ad_u_obc(i,k,ib,ir,lnew)=ad_u_obc(i,k,ib,ir,lnew)* &
3556 ad_v(i,j,k,lnew)=tl_v(i,j,k,lnew)-ad_v(i,j,k,lnew)
3558 ad_v(i,j,k,lnew)=ad_v(i,j,k,lnew)*vmask(i,j)
3564# ifdef ADJUST_BOUNDARY
3571 &
domain(ng)%Western_Edge(tile))
THEN
3575 ad_v_obc(j,k,ib,ir,lnew)=tl_v_obc(j,k,ib,ir,lnew)- &
3576 & ad_v_obc(j,k,ib,ir,lnew)
3578 ad_v_obc(j,k,ib,ir,lnew)=ad_v_obc(j,k,ib,ir,lnew)* &
3585 &
domain(ng)%Eastern_Edge(tile))
THEN
3589 ad_v_obc(j,k,ib,ir,lnew)=tl_v_obc(j,k,ib,ir,lnew)- &
3590 & ad_v_obc(j,k,ib,ir,lnew)
3592 ad_v_obc(j,k,ib,ir,lnew)=ad_v_obc(j,k,ib,ir,lnew)* &
3599 &
domain(ng)%Southern_Edge(tile))
THEN
3603 ad_v_obc(i,k,ib,ir,lnew)=tl_v_obc(i,k,ib,ir,lnew)- &
3604 & ad_v_obc(i,k,ib,ir,lnew)
3606 ad_v_obc(i,k,ib,ir,lnew)=ad_v_obc(i,k,ib,ir,lnew)* &
3613 &
domain(ng)%Northern_Edge(tile))
THEN
3617 ad_v_obc(i,k,ib,ir,lnew)=tl_v_obc(i,k,ib,ir,lnew)- &
3618 & ad_v_obc(i,k,ib,ir,lnew)
3620 ad_v_obc(i,k,ib,ir,lnew)=ad_v_obc(i,k,ib,ir,lnew)* &
3636 ad_t(i,j,k,lnew,it)=tl_t(i,j,k,lnew,it)- &
3637 & ad_t(i,j,k,lnew,it)
3639 ad_t(i,j,k,lnew,it)=ad_t(i,j,k,lnew,it)*rmask(i,j)
3646# ifdef ADJUST_BOUNDARY
3654 &
domain(ng)%Western_Edge(tile))
THEN
3658 ad_t_obc(j,k,ib,ir,lnew,it)= &
3659 & tl_t_obc(j,k,ib,ir,lnew,it)- &
3660 & ad_t_obc(j,k,ib,ir,lnew,it)
3662 ad_t_obc(j,k,ib,ir,lnew,it)= &
3663 & ad_t_obc(j,k,ib,ir,lnew,it)*rmask(istr-1,j)
3669 &
domain(ng)%Eastern_Edge(tile))
THEN
3673 ad_t_obc(j,k,ib,ir,lnew,it)= &
3674 & tl_t_obc(j,k,ib,ir,lnew,it)- &
3675 & ad_t_obc(j,k,ib,ir,lnew,it)
3677 ad_t_obc(j,k,ib,ir,lnew,it)= &
3678 & ad_t_obc(j,k,ib,ir,lnew,it)*rmask(iend+1,j)
3684 &
domain(ng)%Southern_Edge(tile))
THEN
3688 ad_t_obc(i,k,ib,ir,lnew,it)= &
3689 & tl_t_obc(i,k,ib,ir,lnew,it)- &
3690 & ad_t_obc(i,k,ib,ir,lnew,it)
3692 ad_t_obc(i,k,ib,ir,lnew,it)= &
3693 & ad_t_obc(i,k,ib,ir,lnew,it)*rmask(i,jstr-1)
3699 &
domain(ng)%Northern_Edge(tile))
THEN
3703 ad_t_obc(i,k,ib,ir,lnew,it)= &
3704 & tl_t_obc(i,k,ib,ir,lnew,it)- &
3705 & ad_t_obc(i,k,ib,ir,lnew,it)
3707 ad_t_obc(i,k,ib,ir,lnew,it)= &
3708 & ad_t_obc(i,k,ib,ir,lnew,it)*rmask(i,jend+1)
3718# ifdef ADJUST_STFLUX
3727 ad_tflux(i,j,ir,lnew,it)=tl_tflux(i,j,ir,lnew,it)- &
3728 & ad_tflux(i,j,ir,lnew,it)
3730 ad_tflux(i,j,ir,lnew,it)=ad_tflux(i,j,ir,lnew,it)* &
3752 & lbi, ubi, lbj, ubj, lbij, ubij, &
3755 & rmask, umask, vmask, &
3757# ifdef ADJUST_BOUNDARY
3759 & ad_t_obc(:,:,:,:,lnew,:), &
3760 & tl_t_obc(:,:,:,:,lwrk,:), &
3761 & ad_u_obc(:,:,:,:,lnew), &
3762 & tl_u_obc(:,:,:,:,lwrk), &
3763 & ad_v_obc(:,:,:,:,lnew), &
3764 & tl_v_obc(:,:,:,:,lwrk), &
3766 & ad_ubar_obc(:,:,:,lnew), &
3767 & tl_ubar_obc(:,:,:,lwrk), &
3768 & ad_vbar_obc(:,:,:,lnew), &
3769 & tl_vbar_obc(:,:,:,lwrk), &
3770 & ad_zeta_obc(:,:,:,lnew), &
3771 & tl_zeta_obc(:,:,:,lwrk), &
3773# ifdef ADJUST_WSTRESS
3774 & ad_ustr(:,:,:,lnew), tl_ustr(:,:,:,lwrk), &
3775 & ad_vstr(:,:,:,lnew), tl_vstr(:,:,:,lwrk), &
3778# ifdef ADJUST_STFLUX
3779 & ad_tflux(:,:,:,lnew,:), &
3780 & tl_tflux(:,:,:,lwrk,:), &
3782 & ad_t(:,:,:,lnew,:), tl_t(:,:,:,lwrk,:), &
3783 & ad_u(:,:,:,lnew), tl_u(:,:,:,lwrk), &
3784 & ad_v(:,:,:,lnew), tl_v(:,:,:,lwrk), &
3786 & ad_ubar(:,:,lnew), tl_ubar(:,:,lwrk), &
3787 & ad_vbar(:,:,lnew), tl_vbar(:,:,lwrk), &
3789 & ad_zeta(:,:,lnew), tl_zeta(:,:,lwrk))
3798 & LBi, UBi, LBj, UBj, LBij, UBij, &
3799 & IminS, ImaxS, JminS, JmaxS, &
3800 & Lold, Lnew, Lwrk, &
3801 & innLoop, outLoop, &
3803 & rmask, umask, vmask, &
3805# ifdef ADJUST_BOUNDARY
3807 & tl_t_obc, tl_u_obc, tl_v_obc, &
3809 & tl_ubar_obc, tl_vbar_obc, &
3812# ifdef ADJUST_WSTRESS
3813 & tl_ustr, tl_vstr, &
3816# ifdef ADJUST_STFLUX
3819 & tl_t, tl_u, tl_v, &
3820# if defined WEAK_CONSTRAINT && defined TIME_CONV
3821 & tl_ubar, tl_vbar, &
3824 & tl_ubar, tl_vbar, &
3827# ifdef ADJUST_BOUNDARY
3829 & ad_t_obc, ad_u_obc, ad_v_obc, &
3831 & ad_ubar_obc, ad_vbar_obc, &
3834# ifdef ADJUST_WSTRESS
3835 & ad_ustr, ad_vstr, &
3838# ifdef ADJUST_STFLUX
3841 & ad_t, ad_u, ad_v, &
3842# if defined WEAK_CONSTRAINT && defined TIME_CONV
3843 & ad_ubar, ad_vbar, &
3846 & ad_ubar, ad_vbar, &
3853 integer,
intent(in) :: ng, tile, model
3854 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
3855 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
3856 integer,
intent(in) :: Lold, Lnew, Lwrk
3857 integer,
intent(in) :: innLoop, outLoop
3859# ifdef ASSUMED_SHAPE
3861 real(r8),
intent(in) :: rmask(LBi:,LBj:)
3862 real(r8),
intent(in) :: umask(LBi:,LBj:)
3863 real(r8),
intent(in) :: vmask(LBi:,LBj:)
3865# ifdef ADJUST_BOUNDARY
3867 real(r8),
intent(inout) :: ad_t_obc(LBij:,:,:,:,:,:)
3868 real(r8),
intent(inout) :: ad_u_obc(LBij:,:,:,:,:)
3869 real(r8),
intent(inout) :: ad_v_obc(LBij:,:,:,:,:)
3871 real(r8),
intent(inout) :: ad_ubar_obc(LBij:,:,:,:)
3872 real(r8),
intent(inout) :: ad_vbar_obc(LBij:,:,:,:)
3873 real(r8),
intent(inout) :: ad_zeta_obc(LBij:,:,:,:)
3875# ifdef ADJUST_WSTRESS
3876 real(r8),
intent(inout) :: ad_ustr(LBi:,LBj:,:,:)
3877 real(r8),
intent(inout) :: ad_vstr(LBi:,LBj:,:,:)
3880# ifdef ADJUST_STFLUX
3881 real(r8),
intent(inout) :: ad_tflux(LBi:,LBj:,:,:,:)
3883 real(r8),
intent(inout) :: ad_t(LBi:,LBj:,:,:,:)
3884 real(r8),
intent(inout) :: ad_u(LBi:,LBj:,:,:)
3885 real(r8),
intent(inout) :: ad_v(LBi:,LBj:,:,:)
3886# if defined WEAK_CONSTRAINT && defined TIME_CONV
3887 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
3888 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
3891 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
3892 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
3894 real(r8),
intent(inout) :: ad_zeta(LBi:,LBj:,:)
3895# ifdef ADJUST_BOUNDARY
3897 real(r8),
intent(inout) :: tl_t_obc(LBij:,:,:,:,:,:)
3898 real(r8),
intent(inout) :: tl_u_obc(LBij:,:,:,:,:)
3899 real(r8),
intent(inout) :: tl_v_obc(LBij:,:,:,:,:)
3901 real(r8),
intent(inout) :: tl_ubar_obc(LBij:,:,:,:)
3902 real(r8),
intent(inout) :: tl_vbar_obc(LBij:,:,:,:)
3903 real(r8),
intent(inout) :: tl_zeta_obc(LBij:,:,:,:)
3905# ifdef ADJUST_WSTRESS
3906 real(r8),
intent(inout) :: tl_ustr(LBi:,LBj:,:,:)
3907 real(r8),
intent(inout) :: tl_vstr(LBi:,LBj:,:,:)
3910# ifdef ADJUST_STFLUX
3911 real(r8),
intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
3913 real(r8),
intent(inout) :: tl_t(LBi:,LBj:,:,:,:)
3914 real(r8),
intent(inout) :: tl_u(LBi:,LBj:,:,:)
3915 real(r8),
intent(inout) :: tl_v(LBi:,LBj:,:,:)
3916# if defined WEAK_CONSTRAINT && defined TIME_CONV
3917 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
3918 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
3921 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
3922 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
3924 real(r8),
intent(inout) :: tl_zeta(LBi:,LBj:,:)
3929 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
3930 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
3931 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
3933# ifdef ADJUST_BOUNDARY
3935 real(r8),
intent(inout) :: ad_t_obc(LBij:UBij,N(ng),4, &
3936 & Nbrec(ng),2,NT(ng))
3937 real(r8),
intent(inout) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
3938 real(r8),
intent(inout) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
3940 real(r8),
intent(inout) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
3941 real(r8),
intent(inout) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
3942 real(r8),
intent(inout) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
3944# ifdef ADJUST_WSTRESS
3945 real(r8),
intent(inout) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
3946 real(r8),
intent(inout) :: ad_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
3949# ifdef ADJUST_STFLUX
3950 real(r8),
intent(inout) :: ad_tflux(LBi:UBi,LBj:UBj, &
3951 & Nfrec(ng),2,NT(ng))
3953 real(r8),
intent(inout) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
3954 real(r8),
intent(inout) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
3955 real(r8),
intent(inout) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
3956# if defined WEAK_CONSTRAINT && defined TIME_CONV
3957 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
3958 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
3961 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
3962 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
3964 real(r8),
intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,:)
3965# ifdef ADJUST_BOUNDARY
3967 real(r8),
intent(inout) :: tl_t_obc(LBij:UBij,N(ng),4, &
3968 & Nbrec(ng),2,NT(ng))
3969 real(r8),
intent(inout) :: tl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
3970 real(r8),
intent(inout) :: tl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
3972 real(r8),
intent(inout) :: tl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
3973 real(r8),
intent(inout) :: tl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
3974 real(r8),
intent(inout) :: tl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
3976# ifdef ADJUST_WSTRESS
3977 real(r8),
intent(inout) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
3978 real(r8),
intent(inout) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
3981# ifdef ADJUST_STFLUX
3982 real(r8),
intent(inout) :: tl_tflux(LBi:UBi,LBj:UBj, &
3983 & Nfrec(ng),2,NT(ng))
3985 real(r8),
intent(inout) :: tl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
3986 real(r8),
intent(inout) :: tl_u(LBi:UBi,LBj:UBj,N(ng),2)
3987 real(r8),
intent(inout) :: tl_v(LBi:UBi,LBj:UBj,N(ng),2)
3988# if defined WEAK_CONSTRAINT && defined TIME_CONV
3989 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
3990 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
3993 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
3994 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
3996 real(r8),
intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,:)
4001 integer :: i, j, lstr, rec
4003 real(r8) :: fac, fac1, fac2
4005 real(r8),
dimension(0:NstateVar(ng)) :: dot
4006 real(r8),
dimension(0:NpostI) :: DotProd, dot_new, dot_old
4008 character (len=256) :: ncname
4010 character (len=*),
parameter :: MyFile = &
4011 & __FILE__//
", lanczos"
4013# include "set_bounds.h"
4034 IF (innloop.gt.0)
THEN
4044 & lbi, ubi, lbj, ubj, lbij, ubij, &
4045 & lnew, lwrk, lnew, fac1, fac2, &
4047 & rmask, umask, vmask, &
4049# ifdef ADJUST_BOUNDARY
4051 & ad_t_obc, tl_t_obc, &
4052 & ad_u_obc, tl_u_obc, &
4053 & ad_v_obc, tl_v_obc, &
4055 & ad_ubar_obc, tl_ubar_obc, &
4056 & ad_vbar_obc, tl_vbar_obc, &
4057 & ad_zeta_obc, tl_zeta_obc, &
4059# ifdef ADJUST_WSTRESS
4060 & ad_ustr, tl_ustr, &
4061 & ad_vstr, tl_vstr, &
4064# ifdef ADJUST_STFLUX
4065 & ad_tflux, tl_tflux, &
4070# if defined WEAK_CONSTRAINT && defined TIME_CONV
4071 & ad_ubar, tl_ubar, &
4072 & ad_vbar, tl_vbar, &
4075 & ad_ubar, tl_ubar, &
4076 & ad_vbar, tl_vbar, &
4083 IF (innloop.gt.1)
THEN
4092 & lbi, ubi, lbj, ubj, lbij, ubij, &
4093 & lwrk, innloop-1, &
4096 & rmask, umask, vmask, &
4098# ifdef ADJUST_BOUNDARY
4100 & tl_t_obc, tl_u_obc, tl_v_obc, &
4102 & tl_ubar_obc, tl_vbar_obc, &
4105# ifdef ADJUST_WSTRESS
4106 & tl_ustr, tl_vstr, &
4109# ifdef ADJUST_STFLUX
4112 & tl_t, tl_u, tl_v, &
4114 & tl_ubar, tl_vbar, &
4124 fac2=-
ae_beta(innloop,outloop)
4127 & lbi, ubi, lbj, ubj, lbij, ubij, &
4128 & lnew, lwrk, lnew, fac1, fac2, &
4130 & rmask, umask, vmask, &
4132# ifdef ADJUST_BOUNDARY
4134 & ad_t_obc, tl_t_obc, &
4135 & ad_u_obc, tl_u_obc, &
4136 & ad_v_obc, tl_v_obc, &
4138 & ad_ubar_obc, tl_ubar_obc, &
4139 & ad_vbar_obc, tl_vbar_obc, &
4140 & ad_zeta_obc, tl_zeta_obc, &
4142# ifdef ADJUST_WSTRESS
4143 & ad_ustr, tl_ustr, &
4144 & ad_vstr, tl_vstr, &
4147# ifdef ADJUST_STFLUX
4148 & ad_tflux, tl_tflux, &
4153# if defined WEAK_CONSTRAINT && defined TIME_CONV
4154 & ad_ubar, tl_ubar, &
4155 & ad_vbar, tl_vbar, &
4158 & ad_ubar, tl_ubar, &
4159 & ad_vbar, tl_vbar, &
4183 & lbi, ubi, lbj, ubj, lbij, ubij, &
4187 & rmask, umask, vmask, &
4189# ifdef ADJUST_BOUNDARY
4191 & tl_t_obc, tl_u_obc, tl_v_obc, &
4193 & tl_ubar_obc, tl_vbar_obc, &
4196# ifdef ADJUST_WSTRESS
4197 & tl_ustr, tl_vstr, &
4200# ifdef ADJUST_STFLUX
4203 & tl_t, tl_u, tl_v, &
4205 & tl_ubar, tl_vbar, &
4213 & lbi, ubi, lbj, ubj, lbij, ubij, &
4216 & rmask, umask, vmask, &
4218# ifdef ADJUST_BOUNDARY
4220 & ad_t_obc(:,:,:,:,lnew,:), &
4221 & tl_t_obc(:,:,:,:,lwrk,:), &
4222 & ad_u_obc(:,:,:,:,lnew), &
4223 & tl_u_obc(:,:,:,:,lwrk), &
4224 & ad_v_obc(:,:,:,:,lnew), &
4225 & tl_v_obc(:,:,:,:,lwrk), &
4227 & ad_ubar_obc(:,:,:,lnew), &
4228 & tl_ubar_obc(:,:,:,lwrk), &
4229 & ad_vbar_obc(:,:,:,lnew), &
4230 & tl_vbar_obc(:,:,:,lwrk), &
4231 & ad_zeta_obc(:,:,:,lnew), &
4232 & tl_zeta_obc(:,:,:,lwrk), &
4234# ifdef ADJUST_WSTRESS
4235 & ad_ustr(:,:,:,lnew), tl_ustr(:,:,:,lwrk), &
4236 & ad_vstr(:,:,:,lnew), tl_vstr(:,:,:,lwrk), &
4239# ifdef ADJUST_STFLUX
4240 & ad_tflux(:,:,:,lnew,:), &
4241 & tl_tflux(:,:,:,lwrk,:), &
4243 & ad_t(:,:,:,lnew,:), tl_t(:,:,:,lwrk,:), &
4244 & ad_u(:,:,:,lnew), tl_u(:,:,:,lwrk), &
4245 & ad_v(:,:,:,lnew), tl_v(:,:,:,lwrk), &
4247 & ad_ubar(:,:,lnew), tl_ubar(:,:,lwrk), &
4248 & ad_vbar(:,:,lnew), tl_vbar(:,:,lwrk), &
4250 & ad_zeta(:,:,lnew), tl_zeta(:,:,lwrk))
4264 & lbi, ubi, lbj, ubj, lbij, ubij, &
4265 & lnew, lwrk, lnew, fac1, fac2, &
4267 & rmask, umask, vmask, &
4269# ifdef ADJUST_BOUNDARY
4271 & ad_t_obc, tl_t_obc, &
4272 & ad_u_obc, tl_u_obc, &
4273 & ad_v_obc, tl_v_obc, &
4275 & ad_ubar_obc, tl_ubar_obc, &
4276 & ad_vbar_obc, tl_vbar_obc, &
4277 & ad_zeta_obc, tl_zeta_obc, &
4279# ifdef ADJUST_WSTRESS
4280 & ad_ustr, tl_ustr, &
4281 & ad_vstr, tl_vstr, &
4284# ifdef ADJUST_STFLUX
4285 & ad_tflux, tl_tflux, &
4290# if defined WEAK_CONSTRAINT && defined TIME_CONV
4291 & ad_ubar, tl_ubar, &
4292 & ad_vbar, tl_vbar, &
4295 & ad_ubar, tl_ubar, &
4296 & ad_vbar, tl_vbar, &
4306 & lbi, ubi, lbj, ubj, lbij, ubij, &
4309 & rmask, umask, vmask, &
4311# ifdef ADJUST_BOUNDARY
4313 & ad_t_obc(:,:,:,:,lnew,:), &
4314 & ad_t_obc(:,:,:,:,lnew,:), &
4315 & ad_u_obc(:,:,:,:,lnew), &
4316 & ad_u_obc(:,:,:,:,lnew), &
4317 & ad_v_obc(:,:,:,:,lnew), &
4318 & ad_v_obc(:,:,:,:,lnew), &
4320 & ad_ubar_obc(:,:,:,lnew), &
4321 & ad_ubar_obc(:,:,:,lnew), &
4322 & ad_vbar_obc(:,:,:,lnew), &
4323 & ad_vbar_obc(:,:,:,lnew), &
4324 & ad_zeta_obc(:,:,:,lnew), &
4325 & ad_zeta_obc(:,:,:,lnew), &
4327# ifdef ADJUST_WSTRESS
4328 & ad_ustr(:,:,:,lnew), ad_ustr(:,:,:,lnew), &
4329 & ad_vstr(:,:,:,lnew), ad_vstr(:,:,:,lnew), &
4332# ifdef ADJUST_STFLUX
4333 & ad_tflux(:,:,:,lnew,:), &
4334 & ad_tflux(:,:,:,lnew,:), &
4336 & ad_t(:,:,:,lnew,:), ad_t(:,:,:,lnew,:), &
4337 & ad_u(:,:,:,lnew), ad_u(:,:,:,lnew), &
4338 & ad_v(:,:,:,lnew), ad_v(:,:,:,lnew), &
4340 & ad_ubar(:,:,lnew), ad_ubar(:,:,lnew), &
4341 & ad_vbar(:,:,lnew), ad_vbar(:,:,lnew), &
4343 & ad_zeta(:,:,lnew), ad_zeta(:,:,lnew))
4347 IF (innloop.eq.0)
THEN
4350 ae_beta(innloop+1,outloop)=sqrt(dot(0))
4355 fac=1.0_r8/sqrt(dot(0))
4358 & lbi, ubi, lbj, ubj, lbij, ubij, &
4359 & lnew, lnew, fac, &
4361 & rmask, umask, vmask, &
4363# ifdef ADJUST_BOUNDARY
4365 & ad_t_obc, ad_u_obc, ad_v_obc, &
4367 & ad_ubar_obc, ad_vbar_obc, &
4370# ifdef ADJUST_WSTRESS
4371 & ad_ustr, ad_vstr, &
4374# ifdef ADJUST_STFLUX
4377 & ad_t, ad_u, ad_v, &
4379 & ad_ubar, ad_vbar, &
4383# ifdef TEST_ORTHOGONALIZATION
4401 & lbi, ubi, lbj, ubj, lbij, ubij, &
4405 & rmask, umask, vmask, &
4407# ifdef ADJUST_BOUNDARY
4409 & tl_t_obc, tl_u_obc, tl_v_obc, &
4411 & tl_ubar_obc, tl_vbar_obc, &
4414# ifdef ADJUST_WSTRESS
4415 & tl_ustr, tl_vstr, &
4418# ifdef ADJUST_STFLUX
4421 & tl_t, tl_u, tl_v, &
4423 & tl_ubar, tl_vbar, &
4429 & lbi, ubi, lbj, ubj, lbij, ubij, &
4432 & rmask, umask, vmask, &
4434# ifdef ADJUST_BOUNDARY
4436 & ad_t_obc(:,:,:,:,lnew,:), &
4437 & tl_t_obc(:,:,:,:,lwrk,:), &
4438 & ad_u_obc(:,:,:,:,lnew), &
4439 & tl_u_obc(:,:,:,:,lwrk), &
4440 & ad_v_obc(:,:,:,:,lnew), &
4441 & tl_v_obc(:,:,:,:,lwrk), &
4443 & ad_ubar_obc(:,:,:,lnew), &
4444 & tl_ubar_obc(:,:,:,lwrk), &
4445 & ad_vbar_obc(:,:,:,lnew), &
4446 & tl_vbar_obc(:,:,:,lwrk), &
4447 & ad_zeta_obc(:,:,:,lnew), &
4448 & tl_zeta_obc(:,:,:,lwrk), &
4450# ifdef ADJUST_WSTRESS
4451 & ad_ustr(:,:,:,lnew), tl_ustr(:,:,:,lwrk), &
4452 & ad_vstr(:,:,:,lnew), tl_vstr(:,:,:,lwrk), &
4455# ifdef ADJUST_STFLUX
4456 & ad_tflux(:,:,:,lnew,:), &
4457 & tl_tflux(:,:,:,lwrk,:), &
4459 & ad_t(:,:,:,lnew,:), tl_t(:,:,:,lwrk,:), &
4460 & ad_u(:,:,:,lnew), tl_u(:,:,:,lwrk), &
4461 & ad_v(:,:,:,lnew), tl_v(:,:,:,lwrk), &
4463 & ad_ubar(:,:,lnew), tl_ubar(:,:,lwrk), &
4464 & ad_vbar(:,:,lnew), tl_vbar(:,:,lwrk), &
4466 & ad_zeta(:,:,lnew), tl_zeta(:,:,lwrk))
4474 WRITE (
stdout,20) outloop, innloop
4476 WRITE (
stdout,30) dotprod(rec), rec-1
4480 WRITE (
stdout,40) innloop, rec-1, dot_new(rec), &
4481 & rec-1, rec-1, dot_old(rec)
4483 20
FORMAT (/,1x,
'(',i3.3,
',',i3.3,
'): ', &
4484 &
'Gramm-Schmidt Orthogonalization:',/)
4485 30
FORMAT (12x,
'Orthogonalization Factor = ',1p,e19.12,3x, &
4486 &
'(Iter=',i3.3,
')')
4487 40
FORMAT (2x,
'Ortho Test: ', &
4488 &
'<G(',i3.3,
'),G(',i3.3,
')> = ',1p,e15.8,1x, &
4489 &
'<G(',i3.3,
'),G(',i3.3,
')> = ',1p,e15.8)
4498 & LBi, UBi, LBj, UBj, LBij, UBij, &
4499 & IminS, ImaxS, JminS, JmaxS, &
4500 & Lold, Lnew, Lwrk, &
4501 & innLoop, outLoop, &
4503 & rmask, umask, vmask, &
4505# ifdef ADJUST_BOUNDARY
4507 & nl_t_obc, nl_u_obc, nl_v_obc, &
4509 & nl_ubar_obc, nl_vbar_obc, &
4512# ifdef ADJUST_WSTRESS
4513 & nl_ustr, nl_vstr, &
4516# ifdef ADJUST_STFLUX
4519 & nl_t, nl_u, nl_v, &
4520# if defined WEAK_CONSTRAINT && defined TIME_CONV
4521 & nl_ubar, nl_vbar, &
4524 & nl_ubar, nl_vbar, &
4527# ifdef ADJUST_BOUNDARY
4529 & tl_t_obc, tl_u_obc, tl_v_obc, &
4531 & tl_ubar_obc, tl_vbar_obc, &
4534# ifdef ADJUST_WSTRESS
4535 & tl_ustr, tl_vstr, &
4538# ifdef ADJUST_STFLUX
4541 & tl_t, tl_u, tl_v, &
4542# if defined WEAK_CONSTRAINT && defined TIME_CONV
4543 & tl_ubar, tl_vbar, &
4546 & tl_ubar, tl_vbar, &
4549# ifdef ADJUST_BOUNDARY
4551 & ad_t_obc, ad_u_obc, ad_v_obc, &
4553 & ad_ubar_obc, ad_vbar_obc, &
4556# ifdef ADJUST_WSTRESS
4557 & ad_ustr, ad_vstr, &
4560# ifdef ADJUST_STFLUX
4563 & ad_t, ad_u, ad_v, &
4564# if defined WEAK_CONSTRAINT && defined TIME_CONV
4565 & ad_ubar, ad_vbar, &
4568 & ad_ubar, ad_vbar, &
4575 integer,
intent(in) :: ng, tile, model
4576 integer,
intent(in) :: LBi, UBi, LBj, UBj, LBij, UBij
4577 integer,
intent(in) :: IminS, ImaxS, JminS, JmaxS
4578 integer,
intent(in) :: Lold, Lnew, Lwrk
4579 integer,
intent(in) :: innLoop, outLoop
4581# ifdef ASSUMED_SHAPE
4583 real(r8),
intent(in) :: rmask(LBi:,LBj:)
4584 real(r8),
intent(in) :: umask(LBi:,LBj:)
4585 real(r8),
intent(in) :: vmask(LBi:,LBj:)
4587# ifdef ADJUST_BOUNDARY
4589 real(r8),
intent(inout) :: ad_t_obc(LBij:,:,:,:,:,:)
4590 real(r8),
intent(inout) :: ad_u_obc(LBij:,:,:,:,:)
4591 real(r8),
intent(inout) :: ad_v_obc(LBij:,:,:,:,:)
4593 real(r8),
intent(inout) :: ad_ubar_obc(LBij:,:,:,:)
4594 real(r8),
intent(inout) :: ad_vbar_obc(LBij:,:,:,:)
4595 real(r8),
intent(inout) :: ad_zeta_obc(LBij:,:,:,:)
4597# ifdef ADJUST_WSTRESS
4598 real(r8),
intent(inout) :: ad_ustr(LBi:,LBj:,:,:)
4599 real(r8),
intent(inout) :: ad_vstr(LBi:,LBj:,:,:)
4602# ifdef ADJUST_STFLUX
4603 real(r8),
intent(inout) :: ad_tflux(LBi:,LBj:,:,:,:)
4605 real(r8),
intent(inout) :: ad_t(LBi:,LBj:,:,:,:)
4606 real(r8),
intent(inout) :: ad_u(LBi:,LBj:,:,:)
4607 real(r8),
intent(inout) :: ad_v(LBi:,LBj:,:,:)
4609 real(r8),
intent(inout) :: ad_ubar(LBi:,LBj:,:)
4610 real(r8),
intent(inout) :: ad_vbar(LBi:,LBj:,:)
4612 real(r8),
intent(inout) :: ad_zeta(LBi:,LBj:,:)
4613# ifdef ADJUST_BOUNDARY
4615 real(r8),
intent(inout) :: tl_t_obc(LBij:,:,:,:,:,:)
4616 real(r8),
intent(inout) :: tl_u_obc(LBij:,:,:,:,:)
4617 real(r8),
intent(inout) :: tl_v_obc(LBij:,:,:,:,:)
4619 real(r8),
intent(inout) :: tl_ubar_obc(LBij:,:,:,:)
4620 real(r8),
intent(inout) :: tl_vbar_obc(LBij:,:,:,:)
4621 real(r8),
intent(inout) :: tl_zeta_obc(LBij:,:,:,:)
4623# ifdef ADJUST_WSTRESS
4624 real(r8),
intent(inout) :: tl_ustr(LBi:,LBj:,:,:)
4625 real(r8),
intent(inout) :: tl_vstr(LBi:,LBj:,:,:)
4628# ifdef ADJUST_STFLUX
4629 real(r8),
intent(inout) :: tl_tflux(LBi:,LBj:,:,:,:)
4631 real(r8),
intent(inout) :: tl_t(LBi:,LBj:,:,:,:)
4632 real(r8),
intent(inout) :: tl_u(LBi:,LBj:,:,:)
4633 real(r8),
intent(inout) :: tl_v(LBi:,LBj:,:,:)
4635 real(r8),
intent(inout) :: tl_ubar(LBi:,LBj:,:)
4636 real(r8),
intent(inout) :: tl_vbar(LBi:,LBj:,:)
4638 real(r8),
intent(inout) :: tl_zeta(LBi:,LBj:,:)
4639# ifdef ADJUST_BOUNDARY
4641 real(r8),
intent(inout) :: nl_t_obc(LBij:,:,:,:,:,:)
4642 real(r8),
intent(inout) :: nl_u_obc(LBij:,:,:,:,:)
4643 real(r8),
intent(inout) :: nl_v_obc(LBij:,:,:,:,:)
4645 real(r8),
intent(inout) :: nl_ubar_obc(LBij:,:,:,:)
4646 real(r8),
intent(inout) :: nl_vbar_obc(LBij:,:,:,:)
4647 real(r8),
intent(inout) :: nl_zeta_obc(LBij:,:,:,:)
4649# ifdef ADJUST_WSTRESS
4650 real(r8),
intent(inout) :: nl_ustr(LBi:,LBj:,:,:)
4651 real(r8),
intent(inout) :: nl_vstr(LBi:,LBj:,:,:)
4654# ifdef ADJUST_STFLUX
4655 real(r8),
intent(inout) :: nl_tflux(LBi:,LBj:,:,:,:)
4657 real(r8),
intent(inout) :: nl_t(LBi:,LBj:,:,:,:)
4658 real(r8),
intent(inout) :: nl_u(LBi:,LBj:,:,:)
4659 real(r8),
intent(inout) :: nl_v(LBi:,LBj:,:,:)
4661 real(r8),
intent(inout) :: nl_ubar(LBi:,LBj:,:)
4662 real(r8),
intent(inout) :: nl_vbar(LBi:,LBj:,:)
4664 real(r8),
intent(inout) :: nl_zeta(LBi:,LBj:,:)
4669 real(r8),
intent(in) :: rmask(LBi:UBi,LBj:UBj)
4670 real(r8),
intent(in) :: umask(LBi:UBi,LBj:UBj)
4671 real(r8),
intent(in) :: vmask(LBi:UBi,LBj:UBj)
4673# ifdef ADJUST_BOUNDARY
4675 real(r8),
intent(inout) :: ad_t_obc(LBij:UBij,N(ng),4, &
4676 & Nbrec(ng),2,NT(ng))
4677 real(r8),
intent(inout) :: ad_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4678 real(r8),
intent(inout) :: ad_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4680 real(r8),
intent(inout) :: ad_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
4681 real(r8),
intent(inout) :: ad_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
4682 real(r8),
intent(inout) :: ad_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
4684# ifdef ADJUST_WSTRESS
4685 real(r8),
intent(inout) :: ad_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4686 real(r8),
intent(inout) :: ad_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4689# ifdef ADJUST_STFLUX
4690 real(r8),
intent(inout) :: ad_tflux(LBi:UBi,LBj:UBj, &
4691 & Nfrec(ng),2,NT(ng))
4693 real(r8),
intent(inout) :: ad_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
4694 real(r8),
intent(inout) :: ad_u(LBi:UBi,LBj:UBj,N(ng),2)
4695 real(r8),
intent(inout) :: ad_v(LBi:UBi,LBj:UBj,N(ng),2)
4697 real(r8),
intent(inout) :: ad_ubar(LBi:UBi,LBj:UBj,:)
4698 real(r8),
intent(inout) :: ad_vbar(LBi:UBi,LBj:UBj,:)
4700 real(r8),
intent(inout) :: ad_zeta(LBi:UBi,LBj:UBj,:)
4701# ifdef ADJUST_BOUNDARY
4703 real(r8),
intent(inout) :: tl_t_obc(LBij:UBij,N(ng),4, &
4704 & Nbrec(ng),2,NT(ng))
4705 real(r8),
intent(inout) :: tl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4706 real(r8),
intent(inout) :: tl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4708 real(r8),
intent(inout) :: tl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
4709 real(r8),
intent(inout) :: tl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
4710 real(r8),
intent(inout) :: tl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
4712# ifdef ADJUST_WSTRESS
4713 real(r8),
intent(inout) :: tl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4714 real(r8),
intent(inout) :: tl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4717# ifdef ADJUST_STFLUX
4718 real(r8),
intent(inout) :: tl_tflux(LBi:UBi,LBj:UBj, &
4719 & Nfrec(ng),2,NT(ng))
4721 real(r8),
intent(inout) :: tl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
4722 real(r8),
intent(inout) :: tl_u(LBi:UBi,LBj:UBj,N(ng),2)
4723 real(r8),
intent(inout) :: tl_v(LBi:UBi,LBj:UBj,N(ng),2)
4725 real(r8),
intent(inout) :: tl_ubar(LBi:UBi,LBj:UBj,:)
4726 real(r8),
intent(inout) :: tl_vbar(LBi:UBi,LBj:UBj,:)
4728 real(r8),
intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,:)
4729# ifdef ADJUST_BOUNDARY
4731 real(r8),
intent(inout) :: nl_t_obc(LBij:UBij,N(ng),4, &
4732 & Nbrec(ng),2,NT(ng))
4733 real(r8),
intent(inout) :: nl_u_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4734 real(r8),
intent(inout) :: nl_v_obc(LBij:UBij,N(ng),4,Nbrec(ng),2)
4736 real(r8),
intent(inout) :: nl_ubar_obc(LBij:UBij,4,Nbrec(ng),2)
4737 real(r8),
intent(inout) :: nl_vbar_obc(LBij:UBij,4,Nbrec(ng),2)
4738 real(r8),
intent(inout) :: nl_zeta_obc(LBij:UBij,4,Nbrec(ng),2)
4740# ifdef ADJUST_WSTRESS
4741 real(r8),
intent(inout) :: nl_ustr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4742 real(r8),
intent(inout) :: nl_vstr(LBi:UBi,LBj:UBj,Nfrec(ng),2)
4745# ifdef ADJUST_STFLUX
4746 real(r8),
intent(inout) :: nl_tflux(LBi:UBi,LBj:UBj, &
4747 & Nfrec(ng),2,NT(ng))
4749 real(r8),
intent(inout) :: nl_t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
4750 real(r8),
intent(inout) :: nl_u(LBi:UBi,LBj:UBj,N(ng),2)
4751 real(r8),
intent(inout) :: nl_v(LBi:UBi,LBj:UBj,N(ng),2)
4753 real(r8),
intent(inout) :: nl_ubar(LBi:UBi,LBj:UBj,:)
4754 real(r8),
intent(inout) :: nl_vbar(LBi:UBi,LBj:UBj,:)
4756 real(r8),
intent(inout) :: nl_zeta(LBi:UBi,LBj:UBj,:)
4761 integer :: i, ingood, lstr, nvec, rec, status, varid
4763 integer :: start(4), total(4)
4765 real(r8) :: fac, fac1, fac2
4767 real(r8),
dimension(NpostI) :: RitzErr
4769 real(r8),
dimension(0:NstateVar(ng)) :: dot
4771 character (len=256) :: ncname
4773 character (len=*),
parameter :: MyFile = &
4774 & __FILE__//
", posterior_eofs"
4776# include "set_bounds.h"
4803 SELECT CASE (
hss(ng)%IOtype)
4808 & ncid =
hss(ng)%ncid)
4810# if defined PIO_LIB && defined DISTRIBUTE
4815 & piofile =
hss(ng)%pioFile)
4831 columns :
DO nvec=innloop,1,-1
4838 & lbi, ubi, lbj, ubj, lbij, ubij, &
4841 & rmask, umask, vmask, &
4843# ifdef ADJUST_BOUNDARY
4845 & ad_t_obc, ad_u_obc, ad_v_obc, &
4847 & ad_ubar_obc, ad_vbar_obc, &
4850# ifdef ADJUST_WSTRESS
4851 & ad_ustr, ad_vstr, &
4854# ifdef ADJUST_STFLUX
4857 & ad_t, ad_u, ad_v, &
4859 & ad_ubar, ad_vbar, &
4867 rows :
DO rec=1,innloop
4873 & lbi, ubi, lbj, ubj, lbij, ubij, &
4877 & rmask, umask, vmask, &
4879# ifdef ADJUST_BOUNDARY
4881 & tl_t_obc, tl_u_obc, tl_v_obc, &
4883 & tl_ubar_obc, tl_vbar_obc, &
4886# ifdef ADJUST_WSTRESS
4887 & tl_ustr, tl_vstr, &
4890# ifdef ADJUST_STFLUX
4893 & tl_t, tl_u, tl_v, &
4895 & tl_ubar, tl_vbar, &
4905 fac2=
ae_zv(rec,nvec)
4908 & lbi, ubi, lbj, ubj, lbij, ubij, &
4909 & lold, lwrk, lold, fac1, fac2, &
4911 & rmask, umask, vmask, &
4913# ifdef ADJUST_BOUNDARY
4915 & ad_t_obc, tl_t_obc, &
4916 & ad_u_obc, tl_u_obc, &
4917 & ad_v_obc, tl_v_obc, &
4919 & ad_ubar_obc, tl_ubar_obc, &
4920 & ad_vbar_obc, tl_vbar_obc, &
4921 & ad_zeta_obc, tl_zeta_obc, &
4923# ifdef ADJUST_WSTRESS
4924 & ad_ustr, tl_ustr, &
4925 & ad_vstr, tl_vstr, &
4928# ifdef ADJUST_STFLUX
4929 & ad_tflux, tl_tflux, &
4934# if defined WEAK_CONSTRAINT && defined TIME_CONV
4935 & ad_ubar, tl_ubar, &
4936 & ad_vbar, tl_vbar, &
4939 & ad_ubar, tl_ubar, &
4940 & ad_vbar, tl_vbar, &
4976 & lbi, ubi, lbj, ubj, lbij, ubij, &
4978 & 0,
hss(ng)%ncid, ncname, &
4980 & rmask, umask, vmask, &
4982# ifdef ADJUST_BOUNDARY
4984 & ad_t_obc, ad_u_obc, ad_v_obc, &
4986 & ad_ubar_obc, ad_vbar_obc, &
4989# ifdef ADJUST_WSTRESS
4990 & ad_ustr, ad_vstr, &
4993# ifdef ADJUST_STFLUX
4996 & ad_t, ad_u, ad_v, &
4998 & ad_ubar, ad_vbar, &
5011 & lbi, ubi, lbj, ubj, lbij, ubij, &
5013# ifdef ADJUST_BOUNDARY
5015 & nl_t_obc, ad_t_obc, &
5016 & nl_u_obc, ad_u_obc, &
5017 & nl_v_obc, ad_v_obc, &
5019 & nl_ubar_obc, ad_ubar_obc, &
5020 & nl_vbar_obc, ad_vbar_obc, &
5021 & nl_zeta_obc, ad_zeta_obc, &
5023# ifdef ADJUST_WSTRESS
5024 & nl_ustr, ad_ustr, &
5025 & nl_vstr, ad_vstr, &
5028# ifdef ADJUST_STFLUX
5029 & nl_tflux, ad_tflux, &
5034# if defined WEAK_CONSTRAINT && defined TIME_CONV
5035 & nl_ubar, ad_ubar, &
5036 & nl_vbar, ad_vbar, &
5039 & nl_ubar, ad_ubar, &
5040 & nl_vbar, ad_vbar, &
5052 & lbi, ubi, lbj, ubj, lbij, ubij, &
5054 & 0,
hss(ng)%ncid, ncname, &
5056 & rmask, umask, vmask, &
5058# ifdef ADJUST_BOUNDARY
5060 & tl_t_obc, tl_u_obc, tl_v_obc, &
5062 & tl_ubar_obc, tl_vbar_obc, &
5065# ifdef ADJUST_WSTRESS
5066 & tl_ustr, tl_vstr, &
5069# ifdef ADJUST_STFLUX
5072 & tl_t, tl_u, tl_v, &
5074 & tl_ubar, tl_vbar, &
5082 & lbi, ubi, lbj, ubj, lbij, ubij, &
5085 & rmask, umask, vmask, &
5087# ifdef ADJUST_BOUNDARY
5089 & ad_t_obc(:,:,:,:,lold,:), &
5090 & tl_t_obc(:,:,:,:,lwrk,:), &
5091 & ad_u_obc(:,:,:,:,lold), &
5092 & tl_u_obc(:,:,:,:,lwrk), &
5093 & ad_v_obc(:,:,:,:,lold), &
5094 & tl_v_obc(:,:,:,:,lwrk), &
5096 & ad_ubar_obc(:,:,:,lold), &
5097 & tl_ubar_obc(:,:,:,lwrk), &
5098 & ad_vbar_obc(:,:,:,lold), &
5099 & tl_vbar_obc(:,:,:,lwrk), &
5100 & ad_zeta_obc(:,:,:,lold), &
5101 & tl_zeta_obc(:,:,:,lwrk), &
5103# ifdef ADJUST_WSTRESS
5104 & ad_ustr(:,:,:,lold), tl_ustr(:,:,:,lwrk), &
5105 & ad_vstr(:,:,:,lold), tl_vstr(:,:,:,lwrk), &
5108# ifdef ADJUST_STFLUX
5109 & ad_tflux(:,:,:,lold,:), &
5110 & tl_tflux(:,:,:,lwrk,:), &
5112 & ad_t(:,:,:,lold,:), tl_t(:,:,:,lwrk,:), &
5113 & ad_u(:,:,:,lold), tl_u(:,:,:,lwrk), &
5114 & ad_v(:,:,:,lold), tl_v(:,:,:,lwrk), &
5116 & ad_ubar(:,:,lold), tl_ubar(:,:,lwrk), &
5117 & ad_vbar(:,:,lold), tl_vbar(:,:,lwrk), &
5119 & ad_zeta(:,:,lold), tl_zeta(:,:,lwrk))
5129 & lbi, ubi, lbj, ubj, lbij, ubij, &
5130 & l1, lwrk, l1, fac1, fac2, &
5132 & rmask, umask, vmask, &
5134# ifdef ADJUST_BOUNDARY
5136 & nl_t_obc, tl_t_obc, &
5137 & nl_u_obc, tl_u_obc, &
5138 & nl_v_obc, tl_v_obc, &
5140 & nl_ubar_obc, tl_ubar_obc, &
5141 & nl_vbar_obc, tl_vbar_obc, &
5142 & nl_zeta_obc, tl_zeta_obc, &
5144# ifdef ADJUST_WSTRESS
5145 & nl_ustr, tl_ustr, &
5146 & nl_vstr, tl_vstr, &
5149# ifdef ADJUST_STFLUX
5150 & nl_tflux, tl_tflux, &
5155# if defined WEAK_CONSTRAINT && defined TIME_CONV
5156 & nl_ubar, tl_ubar, &
5157 & nl_vbar, tl_vbar, &
5160 & nl_ubar, tl_ubar, &
5161 & nl_vbar, tl_vbar, &
5169 & lbi, ubi, lbj, ubj, lbij, ubij, &
5172 & rmask, umask, vmask, &
5174# ifdef ADJUST_BOUNDARY
5176 & nl_t_obc(:,:,:,:,l1,:), &
5177 & nl_t_obc(:,:,:,:,l1,:), &
5178 & nl_u_obc(:,:,:,:,l1), &
5179 & nl_u_obc(:,:,:,:,l1), &
5180 & nl_v_obc(:,:,:,:,l1), &
5181 & nl_v_obc(:,:,:,:,l1), &
5183 & nl_ubar_obc(:,:,:,l1), &
5184 & nl_ubar_obc(:,:,:,l1), &
5185 & nl_vbar_obc(:,:,:,l1), &
5186 & nl_vbar_obc(:,:,:,l1), &
5187 & nl_zeta_obc(:,:,:,l1), &
5188 & nl_zeta_obc(:,:,:,l1), &
5190# ifdef ADJUST_WSTRESS
5191 & nl_ustr(:,:,:,l1), nl_ustr(:,:,:,l1), &
5192 & nl_vstr(:,:,:,l1), nl_vstr(:,:,:,l1), &
5195# ifdef ADJUST_STFLUX
5196 & nl_tflux(:,:,:,l1,:), &
5197 & nl_tflux(:,:,:,l1,:), &
5199 & nl_t(:,:,:,l1,:), nl_t(:,:,:,l1,:), &
5200 & nl_u(:,:,:,l1), nl_u(:,:,:,l1), &
5201 & nl_v(:,:,:,l1), nl_v(:,:,:,l1), &
5203 & nl_ubar(:,:,l1), nl_ubar(:,:,l1), &
5204 & nl_vbar(:,:,l1), nl_vbar(:,:,l1), &
5206 & nl_zeta(:,:,l1), nl_zeta(:,:,l1))
5212 fac=1.0_r8/sqrt(dot(0))
5215 & lbi, ubi, lbj, ubj, lbij, ubij, &
5218 & rmask, umask, vmask, &
5220# ifdef ADJUST_BOUNDARY
5222 & nl_t_obc, nl_u_obc, nl_v_obc, &
5224 & nl_ubar_obc, nl_vbar_obc, &
5227# ifdef ADJUST_WSTRESS
5228 & nl_ustr, nl_vstr, &
5231# ifdef ADJUST_STFLUX
5234 & nl_t, nl_u, nl_v, &
5236 & nl_ubar, nl_vbar, &
5243 & lbi, ubi, lbj, ubj, lbij, ubij, &
5245# ifdef ADJUST_BOUNDARY
5247 & ad_t_obc, nl_t_obc, &
5248 & ad_u_obc, nl_u_obc, &
5249 & ad_v_obc, nl_v_obc, &
5251 & ad_ubar_obc, nl_ubar_obc, &
5252 & ad_vbar_obc, nl_vbar_obc, &
5253 & ad_zeta_obc, nl_zeta_obc, &
5255# ifdef ADJUST_WSTRESS
5256 & ad_ustr, nl_ustr, &
5257 & ad_vstr, nl_vstr, &
5260# ifdef ADJUST_STFLUX
5261 & ad_tflux, nl_tflux, &
5266# if defined WEAK_CONSTRAINT && defined TIME_CONV
5267 & ad_ubar, nl_ubar, &
5268 & ad_vbar, nl_vbar, &
5271 & ad_ubar, nl_ubar, &
5272 & ad_vbar, nl_vbar, &
5278 SELECT CASE (
hss(ng)%IOtype)
5281 &
'Ritz',
ritz(nvec:), &
5282 & (/nvec/), (/1/), &
5283 & ncid =
hss(ng)%ncid)
5287 &
'Ritz_error', ritzerr(nvec:), &
5288 & (/nvec/), (/1/), &
5289 & ncid =
hss(ng)%ncid)
5292# if defined PIO_LIB && defined DISTRIBUTE
5295 &
'Ritz',
ritz(nvec:), &
5296 & (/nvec/), (/1/), &
5297 & piofile =
hss(ng)%pioFile)
5301 &
'Ritz_error', ritzerr(nvec:), &
5302 & (/nvec/), (/1/), &
5303 & piofile =
hss(ng)%pioFile)
5311 hss(ng)%Rindex=nvec-1
5323 10
FORMAT (/,
' Computing converged analysis error eofs...',/)
5324 20
FORMAT (a,
'_',i3.3,
'.nc')
5325 30
FORMAT (/,
' Orthonormalizing converged analysis error eofs...',/)