sms_pisces.F90 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. MODULE sms_pisces
  2. !!----------------------------------------------------------------------
  3. !! *** sms_pisces.F90 ***
  4. !! TOP : PISCES Source Minus Sink variables
  5. !!----------------------------------------------------------------------
  6. !! History : 1.0 ! 2000-02 (O. Aumont) original code
  7. !! 3.2 ! 2009-04 (C. Ethe & NEMO team) style
  8. !!----------------------------------------------------------------------
  9. #if defined key_pisces || defined key_pisces_reduced
  10. !!----------------------------------------------------------------------
  11. !! 'key_pisces' PISCES model
  12. !!----------------------------------------------------------------------
  13. USE par_oce
  14. USE par_trc
  15. IMPLICIT NONE
  16. PUBLIC
  17. INTEGER :: numnatp_ref = -1 !! Logical units for namelist pisces
  18. INTEGER :: numnatp_cfg = -1 !! Logical units for namelist pisces
  19. INTEGER :: numonp = -1 !! Logical unit for namelist pisces output
  20. !!* Biological fluxes for light : variables shared by pisces & lobster
  21. INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: neln !: number of T-levels + 1 in the euphotic layer
  22. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: heup !: euphotic layer depth
  23. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot !: par (photosynthetic available radiation)
  24. !
  25. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: xksi !: LOBSTER : zooplakton closure
  26. ! !: PISCES : silicon dependant half saturation
  27. #if defined key_pisces
  28. !!* Time variables
  29. INTEGER :: nrdttrc !: ???
  30. INTEGER :: ndayflxtr !: ???
  31. REAL(wp) :: rfact , rfactr !: ???
  32. REAL(wp) :: rfact2, rfact2r !: ???
  33. REAL(wp) :: xstep !: Time step duration for biology
  34. REAL(wp) :: ryyss !: number of seconds per year
  35. REAL(wp) :: r1_ryyss !: inverse number of seconds per year
  36. !!* Biological parameters
  37. INTEGER :: niter1max, niter2max !: Maximum number of iterations for sinking
  38. REAL(wp) :: rno3 !: ???
  39. REAL(wp) :: o2ut !: ???
  40. REAL(wp) :: po4r !: ???
  41. REAL(wp) :: rdenit !: ???
  42. REAL(wp) :: rdenita !: ???
  43. REAL(wp) :: o2nit !: ???
  44. REAL(wp) :: wsbio, wsbio2 !: ???
  45. REAL(wp) :: xkmort !: ???
  46. REAL(wp) :: ferat3 !: ???
  47. !!* diagnostic parameters
  48. REAL(wp) :: tpp !: total primary production
  49. REAL(wp) :: t_oce_co2_exp !: total carbon export
  50. REAL(wp) :: t_oce_co2_flx !: Total ocean carbon flux
  51. REAL(wp) :: t_oce_co2_flx_cum !: Cumulative Total ocean carbon flux
  52. REAL(wp) :: t_atm_co2_flx !: global mean of atmospheric pco2
  53. !!* restoring
  54. LOGICAL :: ln_pisdmp !: restoring or not of nutrients to a mean value
  55. INTEGER :: nn_pisdmp !: frequency of relaxation or not of nutrients to a mean value
  56. !!* Mass conservation
  57. LOGICAL :: ln_check_mass !: Flag to check mass conservation
  58. !!* Biological fluxes for primary production
  59. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: xksimax !: ???
  60. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xnanono3 !: ???
  61. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiatno3 !: ???
  62. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xnanonh4 !: ???
  63. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiatnh4 !: ???
  64. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xnanopo4 !: ???
  65. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiatpo4 !: ???
  66. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimphy !: ???
  67. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimdia !: ???
  68. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: concdfe !: ???
  69. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: concnfe !: ???
  70. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimnfe !: ???
  71. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimdfe !: ???
  72. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimsi !: ???
  73. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: biron !: bioavailable fraction of iron
  74. !!* SMS for the organic matter
  75. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xfracal !: ??
  76. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nitrfac !: ??
  77. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: nitrfac2 !: ??
  78. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbac !: ??
  79. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xlimbacl !: ??
  80. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xdiss !: ??
  81. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: prodcal !: Calcite production
  82. !!* Variable for chemistry of the CO2 cycle
  83. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ak13 !: ???
  84. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ak23 !: ???
  85. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aksp !: ???
  86. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hi !: ???
  87. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: excess !: ???
  88. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aphscale !:
  89. !!* Temperature dependancy of SMS terms
  90. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc !: Temp. dependancy of various biological rates
  91. REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: tgfunc2 !: Temp. dependancy of mesozooplankton rates
  92. #if defined key_kriest
  93. !!* Kriest parameter for aggregation
  94. REAL(wp) :: xkr_eta !: Sinking exponent
  95. REAL(wp) :: xkr_zeta !: N content exponent
  96. REAL(wp) :: xkr_ncontent !: N content factor
  97. REAL(wp) :: xkr_massp !:
  98. REAL(wp) :: xkr_mass_min, xkr_mass_max !: Minimum, Maximum mass for Aggregates
  99. #endif
  100. #endif
  101. !!----------------------------------------------------------------------
  102. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  103. !! $Id: sms_pisces.F90 4529 2014-03-15 11:00:04Z cetlod $
  104. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  105. !!----------------------------------------------------------------------
  106. CONTAINS
  107. INTEGER FUNCTION sms_pisces_alloc()
  108. !!----------------------------------------------------------------------
  109. !! *** ROUTINE sms_pisces_alloc ***
  110. !!----------------------------------------------------------------------
  111. USE lib_mpp , ONLY: ctl_warn
  112. INTEGER :: ierr(5) ! Local variables
  113. !!----------------------------------------------------------------------
  114. ierr(:) = 0
  115. !* Biological fluxes for light : shared variables for pisces & lobster
  116. ALLOCATE( etot(jpi,jpj,jpk), neln(jpi,jpj), heup(jpi,jpj), xksi(jpi,jpj), STAT=ierr(1) )
  117. !
  118. #if defined key_pisces
  119. !* Biological fluxes for primary production
  120. ALLOCATE( xksimax(jpi,jpj) , biron (jpi,jpj,jpk), &
  121. & xnanono3(jpi,jpj,jpk), xdiatno3(jpi,jpj,jpk), &
  122. & xnanonh4(jpi,jpj,jpk), xdiatnh4(jpi,jpj,jpk), &
  123. & xnanopo4(jpi,jpj,jpk), xdiatpo4(jpi,jpj,jpk), &
  124. & xlimphy (jpi,jpj,jpk), xlimdia (jpi,jpj,jpk), &
  125. & xlimnfe (jpi,jpj,jpk), xlimdfe (jpi,jpj,jpk), &
  126. & xlimsi (jpi,jpj,jpk), concdfe (jpi,jpj,jpk), &
  127. & concnfe (jpi,jpj,jpk), STAT=ierr(2) )
  128. !
  129. !* SMS for the organic matter
  130. ALLOCATE( xfracal (jpi,jpj,jpk), nitrfac(jpi,jpj,jpk), &
  131. & xlimbac (jpi,jpj,jpk), xdiss (jpi,jpj,jpk), &
  132. & xlimbacl(jpi,jpj,jpk), prodcal(jpi,jpj,jpk), &
  133. & nitrfac2(jpi,jpj,jpk), STAT=ierr(3) )
  134. !* Variable for chemistry of the CO2 cycle
  135. ALLOCATE( ak13 (jpi,jpj,jpk) , &
  136. & ak23(jpi,jpj,jpk) , aksp (jpi,jpj,jpk) , &
  137. & hi (jpi,jpj,jpk) , excess(jpi,jpj,jpk) , &
  138. & aphscale(jpi,jpj,jpk), STAT=ierr(4) )
  139. !
  140. !* Temperature dependancy of SMS terms
  141. ALLOCATE( tgfunc(jpi,jpj,jpk) , tgfunc2(jpi,jpj,jpk) , STAT=ierr(5) )
  142. !
  143. #endif
  144. !
  145. sms_pisces_alloc = MAXVAL( ierr )
  146. !
  147. IF( sms_pisces_alloc /= 0 ) CALL ctl_warn('sms_pisces_alloc: failed to allocate arrays')
  148. !
  149. END FUNCTION sms_pisces_alloc
  150. #else
  151. !!----------------------------------------------------------------------
  152. !! Empty module : NO PISCES model
  153. !!----------------------------------------------------------------------
  154. #endif
  155. !!======================================================================
  156. END MODULE sms_pisces