trcnam_pisces.F90 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. MODULE trcnam_pisces
  2. !!======================================================================
  3. !! *** MODULE trcnam_pisces ***
  4. !! TOP : initialisation of some run parameters for PISCES bio-model
  5. !!======================================================================
  6. !! History : - ! 1999-10 (M.A. Foujols, M. Levy) original code
  7. !! - ! 2000-01 (L. Bopp) hamocc3, p3zd
  8. !! 1.0 ! 2003-08 (C. Ethe) module F90
  9. !! 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcnam.pisces.h90
  10. !!----------------------------------------------------------------------
  11. #if defined key_pisces || defined key_pisces_reduced
  12. !!----------------------------------------------------------------------
  13. !! 'key_pisces' : PISCES bio-model
  14. !!----------------------------------------------------------------------
  15. !! trc_nam_pisces : PISCES model namelist read
  16. !!----------------------------------------------------------------------
  17. USE oce_trc ! Ocean variables
  18. USE par_trc ! TOP parameters
  19. USE trc ! TOP variables
  20. USE sms_pisces ! sms trends
  21. USE trdtrc_oce
  22. USE iom ! I/O manager
  23. IMPLICIT NONE
  24. PRIVATE
  25. PUBLIC trc_nam_pisces ! called by trcnam.F90 module
  26. !!----------------------------------------------------------------------
  27. !! NEMO/TOP 3.3 , NEMO Consortium (2010)
  28. !! $Id: trcnam_pisces.F90 4990 2014-12-15 16:42:49Z timgraham $
  29. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  30. !!----------------------------------------------------------------------
  31. CONTAINS
  32. SUBROUTINE trc_nam_pisces
  33. !!----------------------------------------------------------------------
  34. !! *** trc_nam_pisces ***
  35. !!
  36. !! ** Purpose : read PISCES namelist
  37. !!
  38. !! ** input : file 'namelist.trc.sms' containing the following
  39. !! namelist: natext, natbio, natsms
  40. !! natkriest ("key_kriest")
  41. !!----------------------------------------------------------------------
  42. !!
  43. INTEGER :: jl, jn
  44. INTEGER :: ios ! Local integer output status for namelist read
  45. TYPE(DIAG), DIMENSION(jp_pisces_2d) :: pisdia2d
  46. TYPE(DIAG), DIMENSION(jp_pisces_3d) :: pisdia3d
  47. TYPE(DIAG), DIMENSION(jp_pisces_trd) :: pisdiabio
  48. CHARACTER(LEN=20) :: clname
  49. !!
  50. NAMELIST/nampisdia/ pisdia3d, pisdia2d ! additional diagnostics
  51. #if defined key_pisces_reduced
  52. NAMELIST/nampisdbi/ pisdiabio
  53. #endif
  54. !!----------------------------------------------------------------------
  55. IF(lwp) WRITE(numout,*)
  56. clname = 'namelist_pisces'
  57. #if defined key_pisces
  58. IF(lwp) WRITE(numout,*) ' trc_nam_pisces : read PISCES namelist'
  59. #else
  60. IF(lwp) WRITE(numout,*) ' trc_nam_pisces : read LOBSTER namelist'
  61. #endif
  62. IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~'
  63. CALL ctl_opn( numnatp_ref, TRIM( clname )//'_ref', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  64. CALL ctl_opn( numnatp_cfg, TRIM( clname )//'_cfg', 'OLD' , 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  65. IF(lwm) CALL ctl_opn( numonp , 'output.namelist.pis' , 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )
  66. !
  67. IF( .NOT.lk_iomput .AND. ln_diatrc ) THEN
  68. !
  69. ! Namelist nampisdia
  70. ! -------------------
  71. REWIND( numnatp_ref ) ! Namelist nampisdia in reference namelist : Pisces diagnostics
  72. READ ( numnatp_ref, nampisdia, IOSTAT = ios, ERR = 901)
  73. 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisdia in reference namelist', lwp )
  74. REWIND( numnatp_cfg ) ! Namelist nampisdia in configuration namelist : Pisces diagnostics
  75. READ ( numnatp_cfg, nampisdia, IOSTAT = ios, ERR = 902 )
  76. 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisdia in configuration namelist', lwp )
  77. IF(lwm) WRITE ( numonp, nampisdia )
  78. DO jl = 1, jp_pisces_2d
  79. jn = jp_pcs0_2d + jl - 1
  80. ctrc2d(jn) = pisdia2d(jl)%sname
  81. ctrc2l(jn) = pisdia2d(jl)%lname
  82. ctrc2u(jn) = pisdia2d(jl)%units
  83. END DO
  84. DO jl = 1, jp_pisces_3d
  85. jn = jp_pcs0_3d + jl - 1
  86. ctrc3d(jn) = pisdia3d(jl)%sname
  87. ctrc3l(jn) = pisdia3d(jl)%lname
  88. ctrc3u(jn) = pisdia3d(jl)%units
  89. END DO
  90. IF(lwp) THEN ! control print
  91. WRITE(numout,*)
  92. WRITE(numout,*) ' Namelist : natadd'
  93. DO jl = 1, jp_pisces_3d
  94. jn = jp_pcs0_3d + jl - 1
  95. WRITE(numout,*) ' 3d diag nb : ', jn, ' short name : ', ctrc3d(jn), &
  96. & ' long name : ', ctrc3l(jn), ' unit : ', ctrc3u(jn)
  97. END DO
  98. WRITE(numout,*) ' '
  99. DO jl = 1, jp_pisces_2d
  100. jn = jp_pcs0_2d + jl - 1
  101. WRITE(numout,*) ' 2d diag nb : ', jn, ' short name : ', ctrc2d(jn), &
  102. & ' long name : ', ctrc2l(jn), ' unit : ', ctrc2u(jn)
  103. END DO
  104. WRITE(numout,*) ' '
  105. ENDIF
  106. !
  107. ENDIF
  108. #if defined key_pisces_reduced
  109. IF( ( .NOT.lk_iomput .AND. ln_diabio ) .OR. lk_trdmxl_trc ) THEN
  110. !
  111. ! Namelist nampisdbi
  112. ! -------------------
  113. REWIND( numnatp_ref ) ! Namelist nampisdbi in reference namelist : Pisces add. diagnostics
  114. READ ( numnatp_ref, nampisdbi, IOSTAT = ios, ERR = 903)
  115. 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisdbi in reference namelist', lwp )
  116. REWIND( numnatp_cfg ) ! Namelist nampisdbi in configuration namelist : Pisces add. diagnostics
  117. READ ( numnatp_cfg, nampisdbi, IOSTAT = ios, ERR = 904 )
  118. 904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nampisdbi in configuration namelist', lwp )
  119. IF(lwm) WRITE ( numonp, nampisdbi )
  120. DO jl = 1, jp_pisces_trd
  121. jn = jp_pcs0_trd + jl - 1
  122. ctrbio(jl) = pisdiabio(jl)%sname
  123. ctrbil(jl) = pisdiabio(jl)%lname
  124. ctrbiu(jl) = pisdiabio(jl)%units
  125. END DO
  126. IF(lwp) THEN ! control print
  127. WRITE(numout,*)
  128. WRITE(numout,*) ' Namelist : nampisdbi'
  129. DO jl = 1, jp_pisces_trd
  130. jn = jp_pcs0_trd + jl - 1
  131. WRITE(numout,*) ' biological trend No : ', jn, ' short name : ', ctrbio(jn), &
  132. & ' long name : ', ctrbio(jn), ' unit : ', ctrbio(jn)
  133. END DO
  134. WRITE(numout,*) ' '
  135. END IF
  136. !
  137. END IF
  138. #endif
  139. END SUBROUTINE trc_nam_pisces
  140. #else
  141. !!----------------------------------------------------------------------
  142. !! Dummy module : No PISCES bio-model
  143. !!----------------------------------------------------------------------
  144. CONTAINS
  145. SUBROUTINE trc_nam_pisces ! Empty routine
  146. END SUBROUTINE trc_nam_pisces
  147. #endif
  148. !!======================================================================
  149. END MODULE trcnam_pisces