bio_template.F90 6.98 KB
Newer Older
dumoda01's avatar
dumoda01 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
!$Id: bio_template.F90,v 1.5 2007-01-06 11:49:15 kbk Exp $
#include"cppdefs.h"
!-----------------------------------------------------------------------
!BOP
!
! !MODULE: bio_template --- template bio model \label{sec:biotemplate}
!
! !INTERFACE:
   module bio_template
!
! !DESCRIPTION:
! This is a template for including new biogeochemical models into
! GOTM. It has the full structural functionality of a GOTM
! biogeochemical model, but is terminated  in {\tt do\_bio\-template},
! where the right hand sides should be calculated.
!
! !USES:
!  default: all is private.
   use bio_var
   private
!
! !PUBLIC MEMBER FUNCTIONS:
   public init_bio_template, init_var_template, var_info_template, &
          light_template, do_bio_template, end_bio_template
!
! !PRIVATE DATA MEMBERS:
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard & Karsten Bolding
!
!  $Log: bio_template.F90,v $
!  Revision 1.5  2007-01-06 11:49:15  kbk
!  namelist file extension changed .inp --> .nml
!
!  Revision 1.4  2006-10-26 13:12:46  kbk
!  updated bio models to new ode_solver
!
!  Revision 1.3  2005-12-02 20:57:27  hb
!  Documentation updated and some bugs fixed
!
!  Revision 1.2  2004/07/30 09:22:20  hb
!  use bio_var in specific bio models - simpliefied internal interface
!
!  Revision 1.1  2003/07/23 12:27:31  hb
!  more generic support for different bio models
!
!
!EOP
!-----------------------------------------------------------------------

   contains

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Initialise the template bio module
!
! !INTERFACE:
   subroutine init_bio_template(namlst,fname,unit)
!
! !DESCRIPTION:
!  Here, the bio namelist {\tt bio\_template.nml} should be read and
!  various variables (rates and settling velocities)
!  should be transformed into SI units.
!
! !USES:
   IMPLICIT NONE
!
! !INPUT PARAMETERS:
   integer,          intent(in)   :: namlst
   character(len=*), intent(in)   :: fname
   integer,          intent(in)   :: unit
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard & Karsten Bolding
!
!EOP
!-----------------------------------------------------------------------
!BOC
   LEVEL2 'init_bio_template'

   numc=5

   LEVEL3 'TEMPLATE bio module initialised ...'

   return

   end subroutine init_bio_template
!EOC

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Initialise the concentration variables
!
! !INTERFACE:
   subroutine init_var_template(nlev)
!
! !DESCRIPTION:
!  Here, the the initial conditions should be set and the settling 
!  velocities should be
!  transferred to all vertical levels. Non-negative concentrations 
!  should be declared  as non-negative variables, 
!  and it should be defined which variables would be
!  taken up by benthic filter feeders.
!
! !USES:
   IMPLICIT NONE
!
! !INPUT PARAMETERS:
   integer, intent(in)                 :: nlev
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard & Karsten Bolding

! !LOCAL VARIABLES:
!EOP
!-----------------------------------------------------------------------
!BOC

   LEVEL3 'TEMPLATE bio model should be initialised here ...'

   return
   end subroutine init_var_template
!EOC

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Providing info on variables
!
! !INTERFACE:
   subroutine var_info_template()
!
! !DESCRIPTION:
!  This subroutine provides information about the variable names as they
!  will be used when storing data in NetCDF files.
!
! !USES:
   IMPLICIT NONE
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard & Karsten Bolding
!
!EOP
!-----------------------------------------------------------------------
!BOC
   var_names(1) = 'name_1'
   var_units(1) = 'units_1'
   var_long(1)  = 'long_1'

   var_names(2) = 'name_2'
   var_units(2) = 'units_2'
   var_long(2)  = 'long_2'

   var_names(3) = 'name_3'
   var_units(3) = 'units_3'
   var_long(3)  = 'long_3'

   var_names(4) = 'name_4'
   var_units(4) = 'units_4'
   var_long(4)  = 'long_4'

   var_names(5) = 'name_5'
   var_units(5) = 'units_5'
   var_long(5)  = 'long_5'

   return
   end subroutine var_info_template
!EOC

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Light properties for the template model
!
! !INTERFACE:
   subroutine light_template(nlev,bioshade_feedback)
!
! !DESCRIPTION:
! Here, the photosynthetically available radiation should be calculated
! by simply assuming that the short wave part of the total
! radiation is available for photosynthesis. The user should make
! sure that this is consistent with the light class given in the
! {\tt extinct} namelist of the {\tt obs.nml} file.
! The self-shading effect should also be calculated in this subroutine,
! which may be used to consider the effect of bio-turbidity also
! in the temperature equation (if {\tt bioshade\_feedback} is set
! to true in {\tt bio.nml}). For details, see section \ref{sec:do-bio}.
!
! !USES:
   IMPLICIT NONE
!
! !INPUT PARAMETERS:
   integer, intent(in)                 :: nlev
   logical, intent(in)                 :: bioshade_feedback
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard, Karsten Bolding
!
! !LOCAL VARIABLES:
!EOP
!-----------------------------------------------------------------------
!BOC

   STDERR 'TEMPLATE light properties are calculated here.'

   end subroutine light_template
!EOC

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Right hand sides of geobiochemical model
!
! !INTERFACE:
   subroutine do_bio_template(numc,nlev)
!
! !DESCRIPTION:
! Here, the source and sink terms for the right hand sides need to be
! defined. Since this is a template file only, nothing is done here,
! and the execution of the program is terminated here. 
!
! !USES:
   IMPLICIT NONE
!
! !INPUT PARAMETERS:
  integer                              :: numc,nlev
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard, Karsten Bolding
!
! !LOCAL VARIABLES:
!EOP
!-----------------------------------------------------------------------
!BOC

   STDERR 'Here the biological process model is defined.'
   STDERR 'Since this is only a template the program is now terminated.'
   stop 'do_bio_template()'
   return
   end subroutine do_bio_template
!EOC

!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: Finish the bio calculations
!
! !INTERFACE:
   subroutine end_bio_template
!
! !DESCRIPTION:
!  Nothing done yet --- supplied for completeness.
!
! !USES:
   IMPLICIT NONE
!
! !REVISION HISTORY:
!  Original author(s): Hans Burchard & Karsten Bolding
!
!EOP
!-----------------------------------------------------------------------
!BOC

   return
   end subroutine end_bio_template
!EOC

!-----------------------------------------------------------------------

   end module bio_template

!-----------------------------------------------------------------------
! Copyright by the GOTM-team under the GNU Public License - www.gnu.org
!-----------------------------------------------------------------------