289 |
kkey = (ikey-1)*(Nr-2+1) + (k-2) + 1 |
kkey = (ikey-1)*(Nr-2+1) + (k-2) + 1 |
290 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
291 |
|
|
|
#ifdef ALLOW_OBCS |
|
|
C-- Calculate future values on open boundaries |
|
|
IF (openBoundaries) THEN |
|
|
Caja CALL CYCLE_OBCS( k, bi, bj, myThid ) |
|
|
c new args! CALL SET_OBCS( k, bi, bj, myTime, myThid ) |
|
|
c +deltaT? |
|
|
ENDIF |
|
|
#endif |
|
|
|
|
292 |
C-- Integrate continuity vertically for vertical velocity |
C-- Integrate continuity vertically for vertical velocity |
293 |
CALL INTEGRATE_FOR_W( |
CALL INTEGRATE_FOR_W( |
294 |
I bi, bj, k, uVel, vVel, |
I bi, bj, k, uVel, vVel, |
295 |
O wVel, |
O wVel, |
296 |
I myThid ) |
I myThid ) |
297 |
#ifdef ALLOW_OBCS |
|
298 |
|
#ifdef ALLOW_OBCS |
299 |
|
C-- Calculate future values on open boundaries |
300 |
IF (openBoundaries) THEN |
IF (openBoundaries) THEN |
301 |
c new subr CALL OBCS_APPLY_W( bi, bj, k, wVel, myThid ) |
#ifdef ALLOW_NONHYDROSTATIC |
302 |
|
IF (nonHydrostatic) THEN |
303 |
|
CALL OBCS_APPLY_W( bi, bj, k, wVel, myThid ) |
304 |
|
ENDIF |
305 |
|
#endif /* ALLOW_NONHYDROSTATIC */ |
306 |
|
CALL OBCS_CALC( bi, bj, k, myTime+deltaT, myThid ) |
307 |
ENDIF |
ENDIF |
308 |
#endif |
#endif /* ALLOW_OBCS */ |
309 |
|
|
310 |
C-- Calculate gradients of potential density for isoneutral |
C-- Calculate gradients of potential density for isoneutral |
311 |
C slope terms (e.g. GM/Redi tensor or IVDC diffusivity) |
C slope terms (e.g. GM/Redi tensor or IVDC diffusivity) |
443 |
U gSnm1, |
U gSnm1, |
444 |
I myIter, myThid) |
I myIter, myThid) |
445 |
ENDIF |
ENDIF |
446 |
#ifdef ALLOW_OBCS |
|
447 |
|
#ifdef ALLOW_OBCS |
448 |
C-- Apply open boundary conditions |
C-- Apply open boundary conditions |
449 |
IF (openBoundaries) THEN |
IF (openBoundaries) THEN |
450 |
#ifdef ALLOW_AUTODIFF_TAMC |
CALL OBCS_APPLY_TS( bi, bj, k, gTnm1, gSnm1, myThid ) |
|
CADJ STORE gwnm1(:,:,k,bi,bj) = comlev1_bibj_k |
|
|
CADJ & , key = kkey, byte = isbyte |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
|
|
c new subr CALL OBCS_APPLY_TS( bi, bj, k, myThid ) |
|
451 |
END IF |
END IF |
452 |
#endif |
#endif /* ALLOW_OBCS */ |
453 |
|
|
454 |
C-- Freeze water |
C-- Freeze water |
455 |
IF (allowFreezing) THEN |
IF (allowFreezing) THEN |
456 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
495 |
I myThid ) |
I myThid ) |
496 |
ENDIF |
ENDIF |
497 |
|
|
498 |
|
#ifdef ALLOW_OBCS |
499 |
|
C-- Apply open boundary conditions |
500 |
|
IF (openBoundaries) THEN |
501 |
|
DO K=1,Nr |
502 |
|
CALL OBCS_APPLY_TS( bi, bj, k, gTnm1, gSnm1, myThid ) |
503 |
|
ENDDO |
504 |
|
END IF |
505 |
|
#endif /* ALLOW_OBCS */ |
506 |
|
|
507 |
C-- End If implicitDiffusion |
C-- End If implicitDiffusion |
508 |
ENDIF |
ENDIF |
509 |
|
|
561 |
CALL TIMESTEP( |
CALL TIMESTEP( |
562 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
I bi,bj,iMin,iMax,jMin,jMax,k, |
563 |
I myIter, myThid) |
I myIter, myThid) |
564 |
|
|
565 |
|
#ifdef ALLOW_OBCS |
566 |
|
C-- Apply open boundary conditions |
567 |
|
IF (openBoundaries) THEN |
568 |
|
CALL OBCS_APPLY_UV( bi, bj, k, gUnm1, gVnm1, myThid ) |
569 |
|
END IF |
570 |
|
#endif /* ALLOW_OBCS */ |
571 |
|
|
572 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
573 |
#ifdef INCLUDE_CD_CODE |
#ifdef INCLUDE_CD_CODE |
574 |
ELSE |
ELSE |
607 |
U gVNm1, |
U gVNm1, |
608 |
I myThid ) |
I myThid ) |
609 |
|
|
610 |
|
#ifdef ALLOW_OBCS |
611 |
|
C-- Apply open boundary conditions |
612 |
|
IF (openBoundaries) THEN |
613 |
|
DO K=1,Nr |
614 |
|
CALL OBCS_APPLY_UV( bi, bj, k, gUnm1, gVnm1, myThid ) |
615 |
|
ENDDO |
616 |
|
END IF |
617 |
|
#endif /* ALLOW_OBCS */ |
618 |
|
|
619 |
#ifdef INCLUDE_CD_CODE |
#ifdef INCLUDE_CD_CODE |
620 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
621 |
idkey = iikey + 5 |
idkey = iikey + 5 |