/[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.12 by jahn, Fri Aug 24 19:45:36 2012 UTC revision 1.20 by jahn, Fri Apr 1 00:02:17 2016 UTC
# Line 92  c ANNA define variables for wavebands Line 92  c ANNA define variables for wavebands
92         _RL PARw_k(tlam,Nr)         _RL PARw_k(tlam,Nr)
93         _RL PARwup(tlam)         _RL PARwup(tlam)
94         _RL acdom_k(Nr,tlam)         _RL acdom_k(Nr,tlam)
95           _RL Ek_nll(npmax,tlam)
96           _RL EkoverE_nll(npmax,tlam)
97  #ifdef DAR_RADTRANS  #ifdef DAR_RADTRANS
98         integer iday,iyr,imon,isec,lp,wd,mydate(4)         integer iday,iyr,imon,isec,lp,wd,mydate(4)
99         _RL Edwsf(tlam),Eswsf(tlam)         _RL Edwsf(tlam),Eswsf(tlam)
# Line 131  C      always need for diagnostics Line 133  C      always need for diagnostics
133  #ifdef GEIDER  #ifdef GEIDER
134        _RL phychl(npmax)        _RL phychl(npmax)
135        _RL phychl_k(npmax,Nr)        _RL phychl_k(npmax,Nr)
136          _RL Ekl(npmax)
137          _RL EkoverEl(npmax)
138          _RL chl2cl(npmax)
139  #ifdef DYNAMIC_CHL  #ifdef DYNAMIC_CHL
140        _RL dphychl(npmax)        _RL dphychl(npmax)
141        _RL chlup(npmax)        _RL chlup(npmax)
142          _RL accliml(npmax)
143  #endif  #endif
144  #endif  #endif
145  #ifdef ALLOW_CDOM  #ifdef ALLOW_CDOM
# Line 416  C        always fill; this will be the s Line 422  C        always fill; this will be the s
422  C        way it won't blow up for weird diagnostics periods.  C        way it won't blow up for weird diagnostics periods.
423  C        we fill before updating, so the diag is the one used in this time  C        we fill before updating, so the diag is the one used in this time
424  C        step  C        step
425           CALL DIAGNOSTICS_FILL(           IF ( useDiagnostics ) THEN
426              CALL DIAGNOSTICS_FILL(
427       &         PARday(1-Olx,1-Oly,1,bi,bj,PARiprev),'PARday  ',       &         PARday(1-Olx,1-Oly,1,bi,bj,PARiprev),'PARday  ',
428       &         0,Nr,2,bi,bj,myThid )       &         0,Nr,2,bi,bj,myThid )
429             ENDIF
430  #endif  #endif
431  #endif /* ALLOW_PAR_DAY */  #endif /* ALLOW_PAR_DAY */
432    
# Line 499  c ------------ GET INCIDENT NON-SPECTRAL Line 507  c ------------ GET INCIDENT NON-SPECTRAL
507    
508  #else /* not USE_QSW */  #else /* not USE_QSW */
509    
510           lite = sfac(j)*maskC(i,j,1,bi,bj)/86400*1 _d 6  C        convert W/m2 to uEin/s/m2
511             lite = sfac(j)*parconv*maskC(i,j,1,bi,bj)
512    
513  #endif /* not USE_QSW */  #endif /* not USE_QSW */
514  #endif /* not READ_PAR */  #endif /* not READ_PAR */
# Line 590  c sum wavebands for total PAR at the mid Line 599  c sum wavebands for total PAR at the mid
599  #else /* DAR_RADTRANS */  #else /* DAR_RADTRANS */
600  c ------------ FULL RADIATIVE TRANSFER CODE ----------------------------  c ------------ FULL RADIATIVE TRANSFER CODE ----------------------------
601           do ilam = 1,tlam           do ilam = 1,tlam
602            Edwsf(ilam) = oasim_ed(i,j,ilam,bi,bj)            Edwsf(ilam)=oasim_ed(i,j,ilam,bi,bj)*(1 _d 0-fice(i,j,bi,bj))
603            Eswsf(ilam) = oasim_es(i,j,ilam,bi,bj)            Eswsf(ilam)=oasim_es(i,j,ilam,bi,bj)*(1 _d 0-fice(i,j,bi,bj))
604           enddo           enddo
605    
606  #ifdef DAR_RADTRANS_USE_MODEL_CALENDAR  #ifdef DAR_RADTRANS_USE_MODEL_CALENDAR
# Line 601  C cos(solz) is average over daylight per Line 610  C cos(solz) is average over daylight per
610       O                       solz)       O                       solz)
611    
612  #else /* not DAR_RADTRANS_USE_MODEL_CALENDAR */  #else /* not DAR_RADTRANS_USE_MODEL_CALENDAR */
613  C use calendar date for full solar zenith angle computation  C Use calendar date for full solar zenith angle computation.
614  C oj: average light effective at noon?  C Use local noon zenith angle to avoid problems with zero cosine and
615           solz = 0.0 _d 0  C non-zero light.  One should really use a zenith angle compatible with
616           isec = 12*3600        C the light fields, in particular averaged over the same time period.
617             isec = MOD(36.*3600. - 240.*XC(i,j,bi,bj), 86400.)
618           call radtrans_sfcsolz(rad,iyr,imon,iday,isec,           call radtrans_sfcsolz(rad,iyr,imon,iday,isec,
619       I                         XC(i,j,bi,bj),YC(i,j,bi,bj),       I                         XC(i,j,bi,bj),YC(i,j,bi,bj),
620       O                         solz)       O                         solz)
# Line 885  c taking from igsm dic run - fed through Line 895  c taking from igsm dic run - fed through
895  c               pCO2local=surfaceForcingT(i,j,bi,bj)  c               pCO2local=surfaceForcingT(i,j,bi,bj)
896  c or from darwin carbon module  c or from darwin carbon module
897  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
898    #ifdef pH_3D
899                   pCO2local=pCO2(i,j,k,bi,bj)
900    #else
901                 pCO2local=pCO2(i,j,bi,bj)                 pCO2local=pCO2(i,j,bi,bj)
902    #endif
903  #else  #else
904                 pCO2local=280. _d -6                 pCO2local=280. _d -6
905  #endif  #endif
# Line 964  c set other arguments to zero Line 978  c set other arguments to zero
978                  NfixPl(np)=0. _d 0                  NfixPl(np)=0. _d 0
979  #endif  #endif
980  #endif  #endif
981    #ifdef DAR_DIAG_PARW
982                    chl2cl(np)=0. _d 0
983    #endif
984    #ifdef DAR_DIAG_EK
985                    Ekl(np)=0. _d 0
986                    EkoverEl(np)=0. _d 0
987                    do ilam=1,tlam
988                      Ek_nll(np,ilam)=0. _d 0
989                      EkoverE_nll(np,ilam)=0. _d 0
990                    enddo
991    #endif
992               enddo               enddo
993    
994    
# Line 1033  c ANNA pass extra variables if WAVEBANDS Line 1058  c ANNA pass extra variables if WAVEBANDS
1058  #endif  #endif
1059  #ifdef GEIDER  #ifdef GEIDER
1060       O                       phychl,       O                       phychl,
1061    #ifdef DAR_DIAG_EK
1062         I                       Ekl, EkoverEl,
1063    #endif
1064    #ifdef DAR_DIAG_PARW
1065         I                       chl2cl,
1066    #endif
1067  #ifdef DYNAMIC_CHL  #ifdef DYNAMIC_CHL
1068       I                       dphychl,       I                       dphychl,
1069       I                       chlup,       I                       chlup,
1070    #ifdef DAR_DIAG_EK
1071         O                       accliml,
1072    #endif
1073  #endif  #endif
1074  #ifdef ALLOW_CDOM  #ifdef ALLOW_CDOM
1075       O                       dcdoml,       O                       dcdoml,
# Line 1043  c ANNA pass extra variables if WAVEBANDS Line 1077  c ANNA pass extra variables if WAVEBANDS
1077  #endif  #endif
1078  #ifdef WAVEBANDS  #ifdef WAVEBANDS
1079       I                       PARw_k(1,k),       I                       PARw_k(1,k),
1080    #ifdef DAR_DIAG_EK
1081         I                       Ek_nll, EkoverE_nll,
1082    #endif
1083  #endif  #endif
1084  #endif  #endif
1085  #ifdef ALLOW_PAR_DAY  #ifdef ALLOW_PAR_DAY
# Line 1186  c ---- end steph's alternative Line 1223  c ---- end steph's alternative
1223                  dfetl=dfetl+fet_flx(i,j,k,bi,bj)                  dfetl=dfetl+fet_flx(i,j,k,bi,bj)
1224                  dsil=dsil+si_flx(i,j,k,bi,bj)                  dsil=dsil+si_flx(i,j,k,bi,bj)
1225  #endif  #endif
1226  c  
1227    #ifdef ALLOW_OBCS
1228              IF (useOBCS) THEN
1229                dpo4l  = dpo4l *maskInC(i,j,bi,bj)
1230                dno3l  = dno3l *maskInC(i,j,bi,bj)
1231                dfetl  = dfetl *maskInC(i,j,bi,bj)
1232                dsil   = dsil  *maskInC(i,j,bi,bj)
1233                ddopl  = ddopl *maskInC(i,j,bi,bj)
1234                ddonl  = ddonl *maskInC(i,j,bi,bj)
1235                ddofel = ddofel*maskInC(i,j,bi,bj)
1236                dpopl  = dpopl *maskInC(i,j,bi,bj)
1237                dponl  = dponl *maskInC(i,j,bi,bj)
1238                dpofel = dpofel*maskInC(i,j,bi,bj)
1239                dpsil  = dpsil *maskInC(i,j,bi,bj)
1240                dnh4l  = dnh4l *maskInC(i,j,bi,bj)
1241                dno2l  = dno2l *maskInC(i,j,bi,bj)
1242                DO nz = 1,nzmax
1243                 dzoop (nz) = dzoop (nz)*maskInC(i,j,bi,bj)
1244                 dzoon (nz) = dzoon (nz)*maskInC(i,j,bi,bj)
1245                 dzoofe(nz) = dzoofe(nz)*maskInC(i,j,bi,bj)
1246                 dzoosi(nz) = dzoosi(nz)*maskInC(i,j,bi,bj)
1247                ENDDO
1248                DO np = 1,npmax
1249                 dPhy(np) = dPhy(np)*maskInC(i,j,bi,bj)
1250    #ifdef GEIDER
1251    #ifdef DYNAMIC_CHL
1252                 dphychl(np) = dphychl(np)*maskInC(i,j,bi,bj)
1253    #endif
1254    #endif
1255                ENDDO
1256    #ifdef ALLOW_CDOM
1257                dcdoml = dcdoml*maskInC(i,j,bi,bj)
1258    #endif
1259    #ifdef ALLOW_CARBON
1260                ddicl = ddicl*maskInC(i,j,bi,bj)
1261                ddocl = ddocl*maskInC(i,j,bi,bj)
1262                dpocl = dpocl*maskInC(i,j,bi,bj)
1263                dpicl = dpicl*maskInC(i,j,bi,bj)
1264                dalkl = dalkl*maskInC(i,j,bi,bj)
1265                do2l  = do2l *maskInC(i,j,bi,bj)
1266                DO nz = 1,nzmax
1267                 dzoocl(nz) = dzoocl(nz)*maskInC(i,j,bi,bj)
1268                ENDDO
1269    #endif
1270              ENDIF
1271    #endif
1272    
1273  c now update main tracer arrays  c now update main tracer arrays
1274            dtplankton = PTRACERS_dTLev(k)/float(nsubtime)            dtplankton = PTRACERS_dTLev(k)/float(nsubtime)
1275            Ptr(i,j,k,bi,bj,iPO4 ) = Ptr(i,j,k,bi,bj,iPO4) +            Ptr(i,j,k,bi,bj,iPO4 ) = Ptr(i,j,k,bi,bj,iPO4) +
# Line 1381  c    &                       deltaTclock Line 1464  c    &                       deltaTclock
1464       &                           phychl(np)*dtplankton       &                           phychl(np)*dtplankton
1465               enddo               enddo
1466  #endif  #endif
1467    #ifdef DAR_DIAG_PARW
1468                do ilam=1,tlam
1469                   PARwave(i,j,k,bi,bj,ilam)=PARwave(i,j,k,bi,bj,ilam)+
1470         &                           PARw_k(ilam,k)*dtplankton
1471                enddo
1472                do np=1,npmax
1473                  chl2cave(i,j,k,bi,bj,np)=chl2cave(i,j,k,bi,bj,np)+
1474         &                          chl2cl(np)*dtplankton
1475                enddo
1476    #endif
1477  #ifdef DAR_DIAG_ACDOM  #ifdef DAR_DIAG_ACDOM
1478  c            print*,'acdom',k,acdom_k(k,darwin_diag_acdom_ilam)  c            print*,'acdom',k,acdom_k(k,darwin_diag_acdom_ilam)
1479               aCDOMave(i,j,k,bi,bj)=aCDOMave(i,j,k,bi,bj)+               aCDOMave(i,j,k,bi,bj)=aCDOMave(i,j,k,bi,bj)+
# Line 1446  Coj            no Eu at surface (yet) Line 1539  Coj            no Eu at surface (yet)
1539       &                                 rmud*dtplankton       &                                 rmud*dtplankton
1540               endif               endif
1541  #endif  #endif
1542    #ifdef DAR_DIAG_EK
1543                do np=1,npmax
1544                 Ekave(i,j,k,bi,bj,np)=Ekave(i,j,k,bi,bj,np)+
1545         &                        Ekl(np)*dtplankton
1546                 EkoverEave(i,j,k,bi,bj,np)=EkoverEave(i,j,k,bi,bj,np)+
1547         &                        EkoverEl(np)*dtplankton
1548                 acclimave(i,j,k,bi,bj,np)=acclimave(i,j,k,bi,bj,np)+
1549         &                        accliml(np)*dtplankton
1550                 do ilam=1,tlam
1551                    Ek_nlave(i,j,k,bi,bj,np,ilam)=
1552         &                        Ek_nlave(i,j,k,bi,bj,np,ilam)+
1553         &                        Ek_nll(np,ilam)*dtplankton
1554                    EkoverE_nlave(i,j,k,bi,bj,np,ilam)=
1555         &                        EkoverE_nlave(i,j,k,bi,bj,np,ilam)+
1556         &                        EkoverE_nll(np,ilam)*dtplankton
1557                 enddo
1558                enddo
1559    #endif
1560  #ifdef DAR_DIAG_RSTAR  #ifdef DAR_DIAG_RSTAR
1561               do np=1,npmax               do np=1,npmax
1562                 Rstarave(i,j,k,bi,bj,np)=Rstarave(i,j,k,bi,bj,np)+                 Rstarave(i,j,k,bi,bj,np)=Rstarave(i,j,k,bi,bj,np)+
# Line 1491  Coj            no Eu at surface (yet) Line 1602  Coj            no Eu at surface (yet)
1602       &                              FluxCO2(i,j,bi,bj)*dtplankton       &                              FluxCO2(i,j,bi,bj)*dtplankton
1603                SUROave(i,j,bi,bj)   =SUROave(i,j,bi,bj)+                SUROave(i,j,bi,bj)   =SUROave(i,j,bi,bj)+
1604       &                              flxO2(i,j)*dtplankton       &                              flxO2(i,j)*dtplankton
1605                 endif
1606    #ifdef pH_3D
1607                  pCO2ave(i,j,k,bi,bj)   =pCO2ave(i,j,k,bi,bj)+
1608         &                              pCO2(i,j,k,bi,bj)*dtplankton
1609                  pHave(i,j,k,bi,bj)     =pHave(i,j,k,bi,bj)+
1610         &                              pH(i,j,k,bi,bj)*dtplankton
1611    #else
1612                 if (k.eq.1) then
1613                pCO2ave(i,j,bi,bj)   =pCO2ave(i,j,bi,bj)+                pCO2ave(i,j,bi,bj)   =pCO2ave(i,j,bi,bj)+
1614       &                              pCO2(i,j,bi,bj)*dtplankton       &                              pCO2(i,j,bi,bj)*dtplankton
1615                pHave(i,j,bi,bj)     =pHave(i,j,bi,bj)+                pHave(i,j,bi,bj)     =pHave(i,j,bi,bj)+
1616       &                              pH(i,j,bi,bj)*dtplankton       &                              pH(i,j,bi,bj)*dtplankton
1617               endif               endif
1618  #endif  #endif
1619    #endif
1620            endif              endif  
1621  c end if hFac>0  c end if hFac>0
1622    
# Line 1641  c ANNA end TAVE Line 1761  c ANNA end TAVE
1761       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1762          CALL DIAGNOSTICS_FILL( flxO2(1-Olx,1-Oly), 'DICOFLX ',          CALL DIAGNOSTICS_FILL( flxO2(1-Olx,1-Oly), 'DICOFLX ',
1763       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1764    #ifdef pH_3D
1765            CALL DIAGNOSTICS_FILL( pCO2(1-Olx,1-Oly,1,bi,bj), 'DICPCO2 ',
1766         &                         0,Nr,2,bi,bj,myThid )
1767            CALL DIAGNOSTICS_FILL( pH(1-Olx,1-Oly,1,bi,bj), 'DICPHAV ',
1768         &                         0,Nr,2,bi,bj,myThid )
1769    #else
1770          CALL DIAGNOSTICS_FILL( pCO2(1-Olx,1-Oly,bi,bj), 'DICPCO2 ',          CALL DIAGNOSTICS_FILL( pCO2(1-Olx,1-Oly,bi,bj), 'DICPCO2 ',
1771       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1772          CALL DIAGNOSTICS_FILL( pH(1-Olx,1-Oly,bi,bj), 'DICPHAV ',          CALL DIAGNOSTICS_FILL( pH(1-Olx,1-Oly,bi,bj), 'DICPHAV ',
1773       &                         0,1,2,bi,bj,myThid )       &                         0,1,2,bi,bj,myThid )
1774    #endif
1775  #endif /* ALLOW_CARBON */  #endif /* ALLOW_CARBON */
1776         ENDIF         ENDIF
1777  #endif /* ALLOW_DIAGNOSTICS */  #endif /* ALLOW_DIAGNOSTICS */
# Line 1657  c determine iron partitioning  - solve f Line 1784  c determine iron partitioning  - solve f
1784  c  c
1785  #ifdef ALLOW_TIMEAVE  #ifdef ALLOW_TIMEAVE
1786  c save averages  c save averages
1787         do k=1,nR           dar_timeave(bi,bj) = dar_timeave(bi,bj) + dtplankton
          dar_timeave(bi,bj,k)=dar_timeave(bi,bj,k)  
      &                         +dtplankton  
1788  #ifdef ALLOW_CARBON  #ifdef ALLOW_CARBON
1789           dic_timeave(bi,bj,k)=dic_timeave(bi,bj,k)           dic_timeave(bi,bj) = dic_timeave(bi,bj) + dtplankton
      &                         +dtplankton  
1790  #endif  #endif
        enddo  
1791  #endif  #endif
1792  c  c
1793  c -----------------------------------------------------  c -----------------------------------------------------

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.22