C $Header: /home/ubuntu/mnt/e9_copy/MITgcm_contrib/dcarroll/highres_darwin/code/ptracers_apply_forcing.F,v 1.1 2019/09/22 21:23:47 dcarroll Exp $ C $Name: $ #include "PTRACERS_OPTIONS.h" CBOP C !ROUTINE: PTRACERS_APPLY_FORCING C !INTERFACE: ========================================================== SUBROUTINE PTRACERS_APPLY_FORCING( U gPtracer, I surfForcPtr, I iMin,iMax,jMin,jMax, k, bi, bj, I iTracer, myTime, myIter, myThid ) C !DESCRIPTION: C Apply passive tracer forcing, i.e., sources and sinks of tracer, C by adding forcing terms to the tendency array C !USES: =============================================================== IMPLICIT NONE #include "SIZE.h" #include "EEPARAMS.h" #include "PARAMS.h" #include "GRID.h" #include "PTRACERS_SIZE.h" #include "PTRACERS_PARAMS.h" #include "PTRACERS_FIELDS.h" C !INPUT PARAMETERS: =================================================== C gPtracer :: the tendency array C surfForcPtr :: surface forcing term C iMin iMax jMin jMax :: working range of tile for applying forcing C k :: vertical level number C bi,bj :: tile indices C iTracer :: tracer number C myIter :: time-step number C myTime :: model time C myThid :: thread number _RL gPtracer (1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL surfForcPtr(1-OLx:sNx+OLx,1-OLy:sNy+OLy) _RL gTR_arr (1-OLx:sNx+OLx,1-OLy:sNy+OLy) INTEGER iMin,iMax,jMin,jMax INTEGER k, bi,bj, iTracer _RL myTime INTEGER myIter INTEGER myThid C !OUTPUT PARAMETERS: ================================================== C gPtracer :: updates tendency array #ifdef ALLOW_PTRACERS C !LOCAL VARIABLES: ==================================================== C i,j :: loop indices INTEGER i,j INTEGER ptracerFlag CEOP if (iTracer.EQ.1) then ptracerFlag = 1. _d 0 CALL SHELFICE_FORCING_TR( O gTR_arr, I ptracerFlag,iMin,iMax,jMin,jMax,k,bi,bj, I myTime,0,myThid) DO j=jMin,jMax DO i=iMin,iMax gPtracer(i,j) = gPtracer(i,j) + & gTR_arr(i,j) ENDDO ENDDO endif /* iTracer.EQ.1 */ if (iTracer.EQ.2) then ptracerFlag = 2. _d 0 CALL SHELFICE_FORCING_TR( O gTR_arr, I ptracerFlag,iMin,iMax,jMin,jMax,k,bi,bj, I myTime,0,myThid) DO j=jMin,jMax DO i=iMin,iMax gPtracer(i,j) = gPtracer(i,j) + & gTR_arr(i,j) ENDDO ENDDO endif /* iTracer.EQ.2 */ if (iTracer.EQ.3) then ptracerFlag = 3. _d 0 CALL SHELFICE_FORCING_TR( O gTR_arr, I ptracerFlag,iMin,iMax,jMin,jMax,k,bi,bj, I myTime,0,myThid) DO j=jMin,jMax DO i=iMin,iMax gPtracer(i,j) = gPtracer(i,j) + & gTR_arr(i,j) ENDDO ENDDO endif /* iTracer.EQ.3 */ #endif /* ALLOW_PTRACERS */ RETURN END