Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:40:51 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
dbd0cb352f Mart*0001 #include "GCHEM_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: GCHEM_ADD_TENDENCY
                0005 
                0006 C !INTERFACE: ==========================================================
218da37934 Jean*0007       SUBROUTINE GCHEM_ADD_TENDENCY(
                0008      U                     gPtracer,
                0009      I                     iMin,iMax,jMin,jMax, k, bi, bj,
2305125f7e Jean*0010      I                     iTr, myTime, myIter, myThid )
dbd0cb352f Mart*0011 
                0012 C !DESCRIPTION:
2305125f7e Jean*0013 C     In the case of a tracer not using GCHEM_SEPARATE_FORCING,
                0014 C     GCHEM_ADD_TENDENCY will update passive tracer tendencies gPtr with
                0015 C     gchemTendency, the latter having been computed in GCHEM_CALC_TENDENDY,
                0016 C     so that they will be incorporated into regular timestepping in
dbd0cb352f Mart*0017 C     PTRACERS_INTERGRATE.
                0018 
                0019 C !USES: ===============================================================
                0020       IMPLICIT NONE
                0021 #include "SIZE.h"
                0022 #include "EEPARAMS.h"
                0023 #include "PARAMS.h"
2305125f7e Jean*0024 #include "GCHEM.h"
                0025 #include "GCHEM_SIZE.h"
dbd0cb352f Mart*0026 #include "GCHEM_FIELDS.h"
                0027 
218da37934 Jean*0028 C !INPUT/OUTPUT PARAMETERS: ============================================
2305125f7e Jean*0029 C  gPtracer     :: the tendency array
                0030 C  k            :: vertical level
                0031 C  bi,bj        :: tile indices
                0032 C  iTr          :: ptracer number
                0033 C  myTime       :: current time
                0034 C  myIter       :: current timestep
                0035 C  myThid       :: thread number
218da37934 Jean*0036       _RL gPtracer   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0037       INTEGER iMin,iMax,jMin,jMax
2305125f7e Jean*0038       INTEGER k, bi, bj, iTr
e1fb02e8f0 Jean*0039       _RL myTime
                0040       INTEGER myIter, myThid
                0041 CEOP
dbd0cb352f Mart*0042 
2305125f7e Jean*0043 #ifdef GCHEM_ADD2TR_TENDENCY
dbd0cb352f Mart*0044 C !LOCAL VARIABLES: ====================================================
2305125f7e Jean*0045 C  jTr          :: number of corresponding tracer tendency (in gchemTendency)
                0046 C  i,j          :: loop indices
                0047       INTEGER jTr
dbd0cb352f Mart*0048       INTEGER i,j
                0049 
2305125f7e Jean*0050 C     Apply the tendencies computed in GCHEM_CALC_TENDENCY to the passive
dbd0cb352f Mart*0051 C     tracers tendendy terms. The part of the code could also go into
                0052 C     ptracers_forcing and replace the call to gchem_add_tendency there,
                0053 C     but this way, no gchem-related header files and CPP-flags are required
                0054 C     within ptracers_forcing.
2305125f7e Jean*0055       IF ( iTr.GT.gchem_sepFTr_num .AND.
                0056      &     iTr.LE.gchem_Tracer_num ) THEN
                0057        jTr = iTr - gchem_sepFTr_num
                0058        DO j=jMin,jMax
                0059         DO i=iMin,iMax
218da37934 Jean*0060          gPtracer(i,j) = gPtracer(i,j)
2305125f7e Jean*0061      &                 + gchemTendency(i,j,k,bi,bj,jTr)
                0062         ENDDO
dbd0cb352f Mart*0063        ENDDO
2305125f7e Jean*0064       ENDIF
                0065 #endif /* GCHEM_ADD2TR_TENDENCY */
dbd0cb352f Mart*0066 
                0067       RETURN
                0068       END