Back to home page

darwin3

 
 

    


File indexing completed on 2025-12-02 20:42:57 UTC

view on githubraw file Latest commit a092808e on 2025-12-02 20:09:45 UTC
8fbfd1f382 Oliv*0001 #include "DARWIN_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: DARWIN_TEMPFUNC
                0005 
                0006 C !INTERFACE: ==========================================================
                0007       SUBROUTINE DARWIN_TEMPFUNC(
                0008      I                  Temp,
3f05298721 Oliv*0009      O                  photoFun, hetFun, grazFun,
                0010      O                  reminFun, mortFun, mort2Fun,
a092808e6b shlo*0011      O                  uptakeFun, macromolFun,
8fbfd1f382 Oliv*0012      I                  myThid)
                0013 
                0014 C !DESCRIPTION: ========================================================
                0015 C     Compute temperature functions for darwin model.
                0016 C
                0017 C     DARWIN_TEMP_VERSION 1 used in Follows et al (2007) - without max of 1
                0018 C     DARWIN_TEMP_VERSION 2 used in Dutkiewicz et al (2009), Hickman et al, 
                0019 C                            Monteiro etal, Barton et al
                0020 C     DARWIN_TEMP_RANGE gives all phyto a  specific temperature range
                0021 C                if undefined, then full Eppley/Arrenhius curve used
                0022 
                0023 C !USES: ===============================================================
                0024       IMPLICIT NONE
                0025 #include "DARWIN_SIZE.h"
                0026 #include "DARWIN_INDICES.h"
                0027 #include "DARWIN_PARAMS.h"
                0028 #include "DARWIN_TRAITS.h"
                0029 
                0030 C !INPUT PARAMETERS: ===================================================
                0031 C  myThid               :: thread number
                0032       INTEGER myThid
                0033       _RL Temp
                0034 
                0035 C !OUTPUT PARAMETERS: ==================================================
                0036 C grazFun :: the prey entries are for quota-style grazing,
                0037 C            the predator ones for monod-style grazing
                0038       _RL photoFun(nplank)
3f05298721 Oliv*0039       _RL hetFun(nplank)
8fbfd1f382 Oliv*0040       _RL grazFun(nplank)
                0041       _RL reminFun
                0042       _RL mortFun
                0043       _RL mort2Fun
                0044       _RL uptakeFun
a092808e6b shlo*0045       _RL macromolFun
8fbfd1f382 Oliv*0046 CEOP
                0047 
                0048 #ifdef ALLOW_DARWIN
                0049 
                0050 c !LOCAL VARIABLES: ====================================================
                0051       _RL Tkel
                0052       _RL TempAe, Tempref, TempCoeff
                0053       INTEGER j
                0054 
                0055 #ifdef DARWIN_NOTEMP
                0056 
                0057       photoFun = 1.0 _d 0
                0058       grazFun  = 1.0 _d 0
                0059       reminFun = 1.0 _d 0
                0060       mortFun  = 1.0 _d 0
                0061       mort2Fun = 1.0 _d 0
                0062       uptakeFun = 1.0 _d 0
a092808e6b shlo*0063       macromolFun = 1.0 _d 0
8fbfd1f382 Oliv*0064 
                0065 #elif DARWIN_TEMP_VERSION == 1
                0066 
                0067 c +++++++++++++++++++ VERSION 1 +++++++++++++++++++++++++++++++++++++++
09b16dd232 Oliv*0068 c steph s version 1 (pseudo-Eppley)
8fbfd1f382 Oliv*0069 c plankton growth function (unitless)
                0070       DO j = 1, nPhoto
                0071 cswd -- this gives Eppley curve only
                0072         photoFun(j) = phytoTempExp1(j)**Temp
                0073 # ifdef DARWIN_TEMP_RANGE
                0074 cswd -- temperature range
                0075         photoFun(j) = photoFun(j) *
                0076      &      exp(-phytoTempExp2(j)*
                0077      &           abs(Temp - phytoTempOptimum(j))**phytoDecayPower(j))
                0078 # endif
                0079         photoFun(j) = photoFun(j) - tempnorm
                0080         photoFun(j) = phytoTempCoeff(j)*
                0081      &                  max(photoFun(j), 1. _d -10)
                0082         photoFun(j) = min(photoFun(j),1. _d 0)
                0083       ENDDO
                0084       DO j = 1,nplank
3f05298721 Oliv*0085         hetFun(j) = 1.0 _d 0
8fbfd1f382 Oliv*0086 c       grazFun(j) = zooTempCoeff(j)*EXP(
                0087 c    &             zooTempExp(j)*(Temp - zooTempOptimum(j)))
                0088         grazFun(j) = 1.0 _d 0
                0089       ENDDO
                0090       reminFun = 1.0 _d 0
                0091       mortFun  = 1.0 _d 0
                0092       mort2Fun = 1.0 _d 0
                0093       uptakeFun = 1.0 _d 0
a092808e6b shlo*0094       macromolFun = 1.0 _d 0
8fbfd1f382 Oliv*0095 c ++++++++++++++ END VERSION 1 +++++++++++++++++++++++++++++++++++++++
                0096 
                0097 #elif DARWIN_TEMP_VERSION == 2
                0098 
                0099 c +++++++++++++++++++ VERSION 2 +++++++++++++++++++++++++++++++++++++++
09b16dd232 Oliv*0100 c steph s version 2 (pseudo-Arrenhius)
8fbfd1f382 Oliv*0101       Tkel      =   273.15 _d 0
                0102 !      TempAe    = -4000.0 _d 0
                0103 !      Tempref   =   293.15 _d 0
                0104 !      TempCoeff =     0.5882 _d 0
                0105       DO j = 1, nPhoto
                0106 cswd -- this gives Arrenhius curve only
                0107         photoFun(j) = exp(TempAeArr*(1. _d 0/(Temp+Tkel) -
                0108      &                                  1. _d 0/(TemprefArr) ) )
                0109 # ifdef DARWIN_TEMP_RANGE
                0110 cswd -- temperature range
                0111         photoFun(j) = photoFun(j) *
                0112      &      exp(-phytoTempExp2(j)*
                0113      &           abs(Temp - phytoTempOptimum(j))**phytoDecayPower(j))
                0114 # endif
                0115         photoFun(j) = photoFun(j)
                0116         photoFun(j) = TempCoeffArr*
                0117      &               max(photoFun(j), 1. _d -10)
                0118 C
                0119       ENDDO
                0120       reminFun = exp(TempAeArr*(1.0 _d 0/(Temp+Tkel) -
                0121      &                       1.0 _d 0/(TemprefArr) ) )
                0122       reminFun = TempCoeffArr*
                0123      &               max(reminFun, 1. _d -10)
                0124       DO j = 1, nplank
3f05298721 Oliv*0125         hetFun(j) = reminFun
8fbfd1f382 Oliv*0126         grazFun(j) = reminFun
                0127 c       grazFun(j) = 1. _d 0
                0128       ENDDO
                0129 c     reminFun = 1. _d 0
                0130       mortFun = reminFun
                0131       mort2Fun = reminFun
                0132 c      mortFun = 1.0 _d 0
                0133 c      mort2Fun = 1.0 _d 0
                0134       uptakeFun = 1.0 _d 0
a092808e6b shlo*0135       macromolFun = exp(TempAeArrMacromol*(1.0 _d 0/(Temp+Tkel) -
                0136      &                                     1.0 _d 0/(TemprefArr) ) )
                0137       macromolFun =  max(macromolFun , 1. _d -10)
8fbfd1f382 Oliv*0138 c ++++++++++++++ END VERSION 2 +++++++++++++++++++++++++++++++++++++++
                0139 
                0140 #elif DARWIN_TEMP_VERSION == 3
                0141 
                0142 c +++++++++++++++++++ VERSION 3 +++++++++++++++++++++++++++++++++++++++
09b16dd232 Oliv*0143 c ben s version 3 from quota model
8fbfd1f382 Oliv*0144       TempAe    =   0.05 _d 0
                0145       Tempref   =  20.0 _d 0
                0146       reminFun = MAX(1 _d -10, EXP(TempAe*(Temp-Tempref)))
                0147       DO j = 1, nplank
                0148         photoFun(j) = MAX(1 _d -10, EXP(TempAe*(Temp-Tempref)))
3f05298721 Oliv*0149         hetFun(j) = reminFun
8fbfd1f382 Oliv*0150         grazFun(j) = reminFun
                0151       ENDDO
                0152       mortFun = reminFun
                0153       mort2Fun = reminFun
                0154       uptakeFun = reminFun
                0155 c ++++++++++++++ END VERSION 3 +++++++++++++++++++++++++++++++++++++++
                0156 
09b16dd232 Oliv*0157 #elif DARWIN_TEMP_VERSION == 4
                0158 
                0159 c +++++++++++++++++++ VERSION 4 +++++++++++++++++++++++++++++++++++++++
                0160 c exponential set so mumax is at 20C
                0161 c plankton growth function (unitless)
                0162       Tempref = 20 _d 0
                0163       DO j = 1, nPhoto
                0164         photoFun(j) = EXP(phytoTempAe(j)*(Temp - Tempref))
                0165 # ifdef DARWIN_TEMP_RANGE
                0166 cswd -- temperature range
                0167         photoFun(j) = photoFun(j) *
                0168      &      EXP(-phytoTempExp2(j)*
                0169      &           ABS(Temp - phytoTempOptimum(j))**phytoDecayPower(j))
                0170 # endif
                0171       ENDDO
                0172       DO j = 1, nplank
                0173         hetFun(j) = EXP(hetTempAe(j)*(Temp - Tempref))
                0174 # ifdef DARWIN_TEMP_RANGE
                0175         hetFun(j) = hetFun(j) *
                0176      &      EXP(-hetTempExp2(j)*
                0177      &           ABS(Temp - hetTempOptimum(j))**hetDecayPower(j))
                0178 # endif
                0179         grazFun(j) = EXP(grazTempAe(j)*(Temp - Tempref))
                0180 # ifdef DARWIN_TEMP_RANGE
                0181         grazFun(j) = grazFun(j) *
                0182      &      EXP(-grazTempExp2(j)*
                0183      &           ABS(Temp - grazTempOptimum(j))**grazDecayPower(j))
                0184 # endif
                0185       ENDDO
                0186       reminFun  = EXP(reminTempAe*(Temp - Tempref))
                0187       mortFun   = EXP(mortTempAe*(Temp - Tempref))
                0188       mort2Fun  = EXP(mort2TempAe*(Temp - Tempref))
                0189       uptakeFun = EXP(uptakeTempAe*(Temp - Tempref))
                0190 c ++++++++++++++ END VERSION 4 +++++++++++++++++++++++++++++++++++++++
                0191 
8fbfd1f382 Oliv*0192 #else
3321fbc6f4 Oliv*0193 #error "DARWIN_TEMP_VERSION must be 1, 2, 3 or 4 in DARWIN_OPTIONS.h"
8fbfd1f382 Oliv*0194 #endif
                0195 
                0196 #ifdef DARWIN_NOZOOTEMP
                0197       DO j = 1, nplank
                0198        grazFun(j) = 1.0 _d 0
                0199       ENDDO
                0200 #endif
                0201 
                0202 #endif  /* ALLOW_DARWIN */
                0203 
                0204       RETURN
                0205       END SUBROUTINE