/[MITgcm]/MITgcm/pkg/dic/bio_export.F
ViewVC logotype

Diff of /MITgcm/pkg/dic/bio_export.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.28 by mlosch, Mon Aug 2 07:10:52 2010 UTC revision 1.29 by jmc, Tue Nov 4 17:16:33 2014 UTC
# Line 12  C !INTERFACE: ========================== Line 12  C !INTERFACE: ==========================
12       I           PTR_FE,       I           PTR_FE,
13  #endif  #endif
14       I           bioac,       I           bioac,
15       I           bi,bj,imin,imax,jmin,jmax,       I           bi,bj,iMin,iMax,jMin,jMax,
16       I           myIter,myTime,myThid)       I           myIter,myTime,myThid)
17    
18  c !DESCRIPTION:  c !DESCRIPTION:
# Line 43  C  PTR_FE               :: iron tracer f Line 43  C  PTR_FE               :: iron tracer f
43  #ifdef ALLOW_FE  #ifdef ALLOW_FE
44        _RL  PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL  PTR_FE(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
45  #endif  #endif
46        INTEGER imin, imax, jmin, jmax, bi, bj        INTEGER iMin, iMax, jMin, jMax, bi, bj
   
47    
48  C !OUTPUT PARAMETERS: ==================================================  C !OUTPUT PARAMETERS: ==================================================
49  C  bioac               :: biological productivity (will be split  C  bioac               :: biological productivity (will be split
# Line 55  C                         between export Line 54  C                         between export
54    
55  C !LOCAL VARIABLES: ====================================================  C !LOCAL VARIABLES: ====================================================
56  C  i,j,k                  :: loop indices  C  i,j,k                  :: loop indices
57         INTEGER I,J,k         INTEGER i,j,k
58        _RL sfac    (1-OLy:sNy+OLy)        _RL sfac    (1-OLy:sNy+OLy)
59        _RL lit     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL lit     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60        _RL atten        _RL kall, atten
61        _RL nutlimit        _RL nutlimit
62        _RL tmppo4        _RL tmppo4
63  #ifdef ALLOW_FE        #ifdef ALLOW_FE
64        _RL tmpfe        _RL tmpfe
65  #endif  #endif
66  #ifdef AD_SAFE  #ifdef AD_SAFE
# Line 69  C  i,j,k                  :: loop indice Line 68  C  i,j,k                  :: loop indice
68  #endif  #endif
69  CEOP  CEOP
70    
   
71  #ifndef READ_PAR  #ifndef READ_PAR
72  #ifndef USE_QSW  #ifndef USE_QSW
73        CALL INSOL(myTime,sfac,bi,bj,myThid)        CALL INSOL(myTime,sfac,bi,bj,myThid)
# Line 80  cph: set in dic_init_fixed.F (ALLOW_AUTO Line 78  cph: set in dic_init_fixed.F (ALLOW_AUTO
78  C$TAF INIT bio_export = static, nsx*nsy*nr  C$TAF INIT bio_export = static, nsx*nsy*nr
79  C FORTRAN-77 dynamic memory uses adstore adresto  C FORTRAN-77 dynamic memory uses adstore adresto
80  CRG C$TAF INIT bio_export = memory  CRG C$TAF INIT bio_export = memory
81        DO j=jmin,jmax        DO j=jMin,jMax
82         DO i=imin,imax         DO i=iMin,iMax
83  #ifdef READ_PAR  #ifdef READ_PAR
84          lit(i,j)=PAR(i,j,bi,bj)          lit(i,j)=PAR(i,j,bi,bj)
85  #elif (defined USE_QSW)  #elif (defined USE_QSW)
# Line 89  CRG C$TAF INIT bio_export = memory Line 87  CRG C$TAF INIT bio_export = memory
87  #else  #else
88          lit(i,j)=sfac(j)          lit(i,j)=sfac(j)
89  #endif  #endif
   
90          IF ( .NOT. QSW_underice ) THEN          IF ( .NOT. QSW_underice ) THEN
91  c if using Qsw but not seaice/thsice or coupled, then  c if using Qsw but not seaice/thsice or coupled, then
92  c ice fraction needs to be taken into account  c ice fraction needs to be taken into account
# Line 97  c ice fraction needs to be taken into ac Line 94  c ice fraction needs to be taken into ac
94          ENDIF          ENDIF
95         ENDDO         ENDDO
96        ENDDO        ENDDO
97  c  
98          kall = k0
99        DO k=1,nlev        DO k=1,nlev
100  C$TAF STORE lit = bio_export  C$TAF STORE lit = bio_export
101         DO j=jmin,jmax         DO j=jMin,jMax
102          DO i=imin,imax          DO i=iMin,iMax
103           atten=(k0*drF(k)*hFacC(i,j,k,bi,bj)*.5 _d 0)  #ifdef LIGHT_CHL
104           if (k.gt.1) atten=atten+(k0*drF(k-1)  c   Add self-shading effects to light attenuation coefficient
105       &                         *hFacC(i,j,k-1,bi,bj)*.5 _d 0)           kall = k0+kchl*CHL(i,j,bi,bj)
106    #endif
107             atten = kall*drF(k)*hFacC(i,j,k,bi,bj)*.5 _d 0
108             if (k.gt.1) atten = atten
109         &         +( kall*drF(k-1)*hFacC(i,j,k-1,bi,bj)*.5 _d 0 )
110           lit(i,j)=lit(i,j)*exp(-atten)           lit(i,j)=lit(i,j)*exp(-atten)
111  #ifndef TARGET_NEC_SX  #ifndef TARGET_NEC_SX
112  C     this statement breaks vectorization and causes a dramatic  C     this statement breaks vectorization and causes a dramatic
113  C     performance drop on vector computers  C     performance drop on vector computers
114           IF (lit(i,j).LT.0. _d 0.OR.lit(i,j).GT.350. _d 0) THEN            IF (lit(i,j).LT.0. _d 0.OR.lit(i,j).GT.350. _d 0) THEN
115            print*,'QQ lit',i,j,lit(i,j)             print*,'QQ lit',i,j,lit(i,j)
116           ENDIF            ENDIF
117  #endif  #endif
   
118  #ifdef DIC_NO_NEG  #ifdef DIC_NO_NEG
119           tmppo4=max(0. _d 0, PTR_PO4(i,j,k))           tmppo4=max(0. _d 0, PTR_PO4(i,j,k))
120           lit(i,j)=max(0. _d 0,lit(i,j))           lit(i,j)=max(0. _d 0,lit(i,j))

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.22