/[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.4 by jahn, Mon Nov 7 21:55:11 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 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
# Line 413  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 428  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 665  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 735  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 815  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 914  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 1120  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 1446  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

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

  ViewVC Help
Powered by ViewVC 1.1.22