/[MITgcm]/MITgcm_contrib/darwin2/pkg/monod/monod_forcing.F
ViewVC logotype

Diff of /MITgcm_contrib/darwin2/pkg/monod/monod_forcing.F

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

revision 1.1 by jahn, Wed Apr 13 18:56:25 2011 UTC revision 1.6 by stephd, Thu May 31 21:08:25 2012 UTC
# Line 68  c plankton arrays Line 68  c plankton arrays
68        _RL  Phy_k(npmax,Nr)        _RL  Phy_k(npmax,Nr)
69        _RL  Phyup(npmax)        _RL  Phyup(npmax)
70        _RL  part_k(Nr)        _RL  part_k(Nr)
71    #ifdef ALLOW_CDOM
72          _RL cdom_k(Nr)
73    #endif
74  c iron partitioning  c iron partitioning
75        _RL  freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL  freefe(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
76  c some working variables  c some working variables
# Line 111  C      always need for diagnostics Line 114  C      always need for diagnostics
114        _RL  Diver2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL  Diver2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
115        _RL  Diver3(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL  Diver3(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
116        _RL  Diver4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL  Diver4(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
117          _RL Shannon(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
118          _RL Simpson(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
119    
120        _RL  tmpphy(npmax)        _RL  tmpphy(npmax)
121        _RL  totphy, biotot, maxphy, phymax        _RL  totphy, biotot, maxphy, phymax
# Line 124  C      always need for diagnostics Line 129  C      always need for diagnostics
129        _RL chlup(npmax)        _RL chlup(npmax)
130  #endif  #endif
131  #endif  #endif
132    #ifdef ALLOW_CDOM
133          _RL cdoml  
134          _RL dcdoml
135    #endif
136    
137  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
138  COJ for diagnostics  COJ for diagnostics
# Line 248  c tendencies Line 257  c tendencies
257         _RL do2l         _RL do2l
258         _RL dZooCl(nzmax)         _RL dZooCl(nzmax)
259  c air-sea fluxes  c air-sea fluxes
260         _RL flxCO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)         _RL flxCO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
261         _RL flxALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)         _RL flxALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
262         _RL flxO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)         _RL flxO2(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
263  #endif  #endif
264    
265         _RL tot_Nfix         _RL tot_Nfix
# Line 277  c Line 286  c
286             Diver2(i,j,k)=0. _d 0             Diver2(i,j,k)=0. _d 0
287             Diver3(i,j,k)=0. _d 0             Diver3(i,j,k)=0. _d 0
288             Diver4(i,j,k)=0. _d 0             Diver4(i,j,k)=0. _d 0
289               Shannon(i,j,k)=0. _d 0
290               Simpson(i,j,k)=1. _d 0
291  #endif  #endif
292    
293  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
294  COJ for diagnostics  COJ for diagnostics
295             PParr(i,j,k) = 0. _d 0             PParr(i,j,k) = 0. _d 0
296             Nfixarr(i,j,k) = 0. _d 0             Nfixarr(i,j,k) = 0. _d 0
297    #ifdef DAR_DIAG_CHL
298               GeiderChlarr(i,j,k) = 0. _d 0
299               GeiderChl2Carr(i,j,k) = 0. _d 0
300               DoneyChlarr(i,j,k) = 0. _d 0
301               DoneyChl2Carr(i,j,k) = 0. _d 0
302               CloernChlarr(i,j,k) = 0. _d 0
303               CloernChl2Carr(i,j,k) = 0. _d 0
304    #endif
305  c ANNA_TAVE  c ANNA_TAVE
306  #ifdef WAVES_DIAG_PCHL  #ifdef WAVES_DIAG_PCHL
307             DO np=1,npmax             DO np=1,npmax
# Line 405  C ========================== i,j loops = Line 424  C ========================== i,j loops =
424  c ------------ these are convenient ------------------------------------  c ------------ these are convenient ------------------------------------
425           DO k=1,Nr           DO k=1,Nr
426            part_k(k)  = max(Ptr(i,j,k,bi,bj,iPOP),0. _d 0)            part_k(k)  = max(Ptr(i,j,k,bi,bj,iPOP),0. _d 0)
427    #ifdef ALLOW_CDOM
428              cdom_k(k)  = max(Ptr(i,j,k,bi,bj,iCDOM),0. _d 0)
429    #endif
430            DO np = 1,npmax            DO np = 1,npmax
431              Phy_k(np,k) = max(Ptr(i,j,k,bi,bj,iPhy+np-1),0. _d 0)              Phy_k(np,k) = max(Ptr(i,j,k,bi,bj,iPhy+np-1),0. _d 0)
432  #ifdef GEIDER  #ifdef GEIDER
# Line 420  c ------------ these are convenient ---- Line 442  c ------------ these are convenient ----
442  c ------------ GET CDOM_k FOR WAVEBANDS_3D and RADTRANS ----------------  c ------------ GET CDOM_k FOR WAVEBANDS_3D and RADTRANS ----------------
443  #ifdef WAVEBANDS  #ifdef WAVEBANDS
444  #if defined(DAR_CALC_ACDOM) || defined(DAR_RADTRANS)  #if defined(DAR_CALC_ACDOM) || defined(DAR_RADTRANS)
445    #ifdef ALLOW_CDOM
446            call MONOD_ACDOM(cdom_k,
447         O                     acdom_k,
448         I                     myThid)
449    #else
450           call MONOD_ACDOM(phychl_k,aphy_chl,aw,           call MONOD_ACDOM(phychl_k,aphy_chl,aw,
451       O                     acdom_k,       O                     acdom_k,
452       I                     myThid)       I                     myThid)
453    #endif
454  #else  #else
455           DO k=1,Nr           DO k=1,Nr
456            DO ilam = 1,tlam            DO ilam = 1,tlam
# Line 657  c brute force... Line 685  c brute force...
685               psil  = max(Ptr(i,j,k,bi,bj,iPOSi ),0. _d 0)               psil  = max(Ptr(i,j,k,bi,bj,iPOSi ),0. _d 0)
686               NH4l  = max(Ptr(i,j,k,bi,bj,iNH4  ),0. _d 0)               NH4l  = max(Ptr(i,j,k,bi,bj,iNH4  ),0. _d 0)
687               NO2l  = max(Ptr(i,j,k,bi,bj,iNO2  ),0. _d 0)               NO2l  = max(Ptr(i,j,k,bi,bj,iNO2  ),0. _d 0)
688    #ifdef ALLOW_CDOM
689                 cdoml = max(Ptr(i,j,k,bi,bj,iCDOM  ),0. _d 0)
690    #endif
691  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
692               dicl  = max(Ptr(i,j,k,bi,bj,iDIC  ),0. _d 0)               dicl  = max(Ptr(i,j,k,bi,bj,iDIC  ),0. _d 0)
693               docl  = max(Ptr(i,j,k,bi,bj,iDOC  ),0. _d 0)               docl  = max(Ptr(i,j,k,bi,bj,iDOC  ),0. _d 0)
# Line 727  c ratio of maximum species Line 758  c ratio of maximum species
758                      Diver4(i,j,k)=Diver4(i,j,k)+1. _d 0                      Diver4(i,j,k)=Diver4(i,j,k)+1. _d 0
759                   endif                   endif
760                 enddo                 enddo
761    c           totphy > thresh0
762                endif
763    c Shannon and Simpson indices
764                Shannon(i,j,k) = 0. _d 0
765    c note: minimal valid value is 1, but we set to zero below threshold
766                Simpson(i,j,k) = 0. _d 0
767                if (totphy.gt.shannon_thresh) then
768                  do np=1,npmax
769                   if (Phy(np) .gt. 0. _d 0) then
770                    tmpphy(np) = Phy(np)/totphy
771                    Shannon(i,j,k)=Shannon(i,j,k)+tmpphy(np)*LOG(tmpphy(np))
772                    Simpson(i,j,k)=Simpson(i,j,k)+tmpphy(np)*tmpphy(np)
773                   endif
774                  enddo
775                  Shannon(i,j,k) = -Shannon(i,j,k)
776                  Simpson(i,j,k) = 1./Simpson(i,j,k)
777              endif              endif
778  #endif  #endif
779    
# Line 807  c set tendencies to 0 Line 854  c set tendencies to 0
854                 dphychl(np)=0. _d 0                 dphychl(np)=0. _d 0
855               enddo               enddo
856  #endif  #endif
857    #ifdef ALLOW_CDOM
858                dcdoml=0. _d 0
859    #endif
860  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
861               ddicl=0. _d 0               ddicl=0. _d 0
862               ddocl=0. _d 0               ddocl=0. _d 0
# Line 906  c ANNA pass extra variables if WAVEBANDS Line 956  c ANNA pass extra variables if WAVEBANDS
956       I                       dphychl,       I                       dphychl,
957       I                       chlup,       I                       chlup,
958  #endif  #endif
959    #ifdef ALLOW_CDOM
960         O                       dcdoml,
961         I                       cdoml,
962    #endif
963  #ifdef WAVEBANDS  #ifdef WAVEBANDS
964       I                       PARw_k(1,k),       I                       PARw_k(1,k),
965  #endif  #endif
# Line 931  c            endif Line 985  c            endif
985  c  c
986  #ifdef IRON_SED_SOURCE  #ifdef IRON_SED_SOURCE
987  c only above minimum depth (continental shelf)  c only above minimum depth (continental shelf)
988               if (rF(k).lt.depthfesed) then               if (rF(k).gt.-depthfesed) then
989  c only if bottom layer  c only if bottom layer
990                 if (bottom.eq.1.0 _d 0) then                 if (bottom.eq.1.0 _d 0) then
991  #ifdef IRON_SED_SOURCE_VARIABLE  #ifdef IRON_SED_SOURCE_VARIABLE
# Line 966  c Line 1020  c
1020               picupl = PICl               picupl = PICl
1021  c include surface forcing  c include surface forcing
1022               if (k.eq.1) then               if (k.eq.1) then
1023                ddicl  =  ddicl  + flxCO2(i,j,bi,bj)                ddicl  =  ddicl  + flxCO2(i,j)
1024                dalkl  =  dalkl  + flxALK(i,j,bi,bj)                dalkl  =  dalkl  + flxALK(i,j)
1025                do2l   =  do2l   + flxO2(i,j,bi,bj)                do2l   =  do2l   + flxO2(i,j)
1026               endif               endif
1027  #endif  #endif
1028  c  c
# Line 1112  c in darwin_plankton this is stored for Line 1166  c in darwin_plankton this is stored for
1166  #endif  #endif
1167  #endif  #endif
1168           ENDDO           ENDDO
1169    #ifdef ALLOW_CDOM
1170              Ptr(i,j,k,bi,bj,iCDOM ) = Ptr(i,j,k,bi,bj,iCDOM ) +
1171         &                                  dtplankton*dcdoml
1172    #endif
1173  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
1174            Ptr(i,j,k,bi,bj,iDIC ) = Ptr(i,j,k,bi,bj,iDIC ) +            Ptr(i,j,k,bi,bj,iDIC ) = Ptr(i,j,k,bi,bj,iDIC ) +
1175       &                                  dtplankton*ddicl       &                                  dtplankton*ddicl
# Line 1331  Coj            no Eu at surface (yet) Line 1389  Coj            no Eu at surface (yet)
1389  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
1390               if (k.eq.1) then               if (k.eq.1) then
1391                SURave(i,j,bi,bj)    =SURave(i,j,bi,bj)+                SURave(i,j,bi,bj)    =SURave(i,j,bi,bj)+
1392       &                              flxCO2(i,j,bi,bj)*dtplankton       &                              flxCO2(i,j)*dtplankton
1393                SURCave(i,j,bi,bj)    =SURCave(i,j,bi,bj)+                SURCave(i,j,bi,bj)    =SURCave(i,j,bi,bj)+
1394       &                              FluxCO2(i,j,bi,bj)*dtplankton       &                              FluxCO2(i,j,bi,bj)*dtplankton
1395                SUROave(i,j,bi,bj)   =SUROave(i,j,bi,bj)+                SUROave(i,j,bi,bj)   =SUROave(i,j,bi,bj)+
1396       &                              flxO2(i,j,bi,bj)*dtplankton       &                              flxO2(i,j)*dtplankton
1397                pCO2ave(i,j,bi,bj)   =pCO2ave(i,j,bi,bj)+                pCO2ave(i,j,bi,bj)   =pCO2ave(i,j,bi,bj)+
1398       &                              pCO2(i,j,bi,bj)*dtplankton       &                              pCO2(i,j,bi,bj)*dtplankton
1399                pHave(i,j,bi,bj)     =pHave(i,j,bi,bj)+                pHave(i,j,bi,bj)     =pHave(i,j,bi,bj)+
# Line 1438  c ANNA end TAVE Line 1496  c ANNA end TAVE
1496          WRITE(diagname,'(A8)') 'Diver4  '          WRITE(diagname,'(A8)') 'Diver4  '
1497          CALL DIAGNOSTICS_FILL( Diver4(1-Olx,1-Oly,1), diagname,          CALL DIAGNOSTICS_FILL( Diver4(1-Olx,1-Oly,1), diagname,
1498       &                         0,Nr,2,bi,bj,myThid )       &                         0,Nr,2,bi,bj,myThid )
1499            WRITE(diagname,'(A8)') 'Shannon '
1500            CALL DIAGNOSTICS_FILL( Shannon(1-Olx,1-Oly,1), diagname,
1501         &                         0,Nr,2,bi,bj,myThid )
1502            WRITE(diagname,'(A8)') 'Simpson '
1503            CALL DIAGNOSTICS_FILL( Simpson(1-Olx,1-Oly,1), diagname,
1504         &                         0,Nr,2,bi,bj,myThid )
1505  #endif  #endif
1506  #ifdef ALLOW_DIAZ  #ifdef ALLOW_DIAZ
1507  #ifdef DAR_DIAG_NFIXP  #ifdef DAR_DIAG_NFIXP
# Line 1463  c ANNA end TAVE Line 1527  c ANNA end TAVE
1527       &                         0,Nr,2,bi,bj,myThid )       &                         0,Nr,2,bi,bj,myThid )
1528  #endif  #endif
1529  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
1530          CALL DIAGNOSTICS_FILL( flxCO2(1-Olx,1-Oly,bi,bj), 'DICTFLX ',          CALL DIAGNOSTICS_FILL( flxCO2(1-Olx,1-Oly), 'DICTFLX ',
1531       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1532          CALL DIAGNOSTICS_FILL( FluxCO2(1-Olx,1-Oly,bi,bj), 'DICCFLX ',          CALL DIAGNOSTICS_FILL( FluxCO2(1-Olx,1-Oly,bi,bj), 'DICCFLX ',
1533       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1534          CALL DIAGNOSTICS_FILL( flxO2(1-Olx,1-Oly,bi,bj), 'DICOFLX ',          CALL DIAGNOSTICS_FILL( flxO2(1-Olx,1-Oly), 'DICOFLX ',
1535       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1536          CALL DIAGNOSTICS_FILL( pCO2(1-Olx,1-Oly,bi,bj), 'DICPCO2 ',          CALL DIAGNOSTICS_FILL( pCO2(1-Olx,1-Oly,bi,bj), 'DICPCO2 ',
1537       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.22