Fortran: Module Interface observations -- the 'real' world (Source File: observations.F90)


INTERFACE:

    module observations
DESCRIPTION:

This module provides the necessary subroutines for communicating `observations' to GOTM. The module operates according to the general philosophy used in GOTM, i.e. it provides init_observations() to be called in the overall initialisation routine and get_all_obs() to be called in the time loop to actually obtain the `observations'. In addition to these subroutines the module also provides two routines for reading scalar-type observations and profile-type observations. Each observation has a date stamp with the format yyyy-mm-dd hh:dd:mm. The module uses the time module (see section 8.5) to convert the time string to the internal time representation of GOTM. Profiles are interpolated to the actual GOTM model grid. Free format is used for reading-in the actual data.


USES:

    IMPLICIT NONE
 
    default: all is private.
    private
PUBLIC MEMBER FUNCTIONS:
    public init_observations, get_all_obs, read_obs, read_profiles,&
           clean_observations
 #ifdef _PRINTSTATE_
    public print_state_observations
 #endif
PUBLIC DATA MEMBERS:
    logical, public                               :: init_saved_vars
    'observed' salinity profile
    REALTYPE, public, dimension(:), allocatable   :: sprof
 
    'observed' temperature profile
    REALTYPE, public, dimension(:), allocatable   :: tprof
 
    'observed' oxygen profile
    REALTYPE, public, dimension(:), allocatable   :: o2_prof
 
    'observed' horizontal salinity  gradients
    REALTYPE, public, dimension(:), allocatable   :: dsdx,dsdy
 
    'observed' horizontal temperarure  gradients
    REALTYPE, public, dimension(:), allocatable   :: dtdx,dtdy
 
    internal horizontal pressure gradients
    REALTYPE, public, dimension(:), allocatable   :: idpdx,idpdy
 
    horizontal velocity profiles
    REALTYPE, public, dimension(:), allocatable   :: uprof,vprof
 
    observed profile of turbulent dissipation rates
    REALTYPE, public, dimension(:), allocatable   :: epsprof
 
    ralaxation times for salinity and temperature
    REALTYPE, public, dimension(:), allocatable   :: SRelaxTau,TRelaxTau
 
    sea surface elevation, sea surface gradients and height of velocity obs.
    REALTYPE, public          :: zeta,dpdx,dpdy,h_press
 
    vertical advection velocity
    REALTYPE, public          :: w_adv,w_height
 
    Parameters for water classification - default Jerlov type I
    REALTYPE, public          :: A,g1,g2
 
 #ifdef BIO
    'observed' biological profiles
    REALTYPE, public, dimension(:,:), allocatable :: bioprofs
 #endif
 
  ------------------------------------------------------------------------------
   the following data are not all public,
   but have been included for clarity here
  ------------------------------------------------------------------------------
 
    Salinity profile(s)
    integer, public           :: s_prof_method
    integer, public           :: s_analyt_method
    character(LEN=PATH_MAX)   :: s_prof_file
    REALTYPE                  :: z_s1,s_1,z_s2,s_2
    REALTYPE                  :: s_obs_NN
    REALTYPE                  :: SRelaxTauM
    REALTYPE                  :: SRelaxTauS
    REALTYPE                  :: SRelaxTauB
    REALTYPE                  :: SRelaxSurf
    REALTYPE                  :: SRelaxBott
 
    Temperature profile(s)
    integer, public           :: t_prof_method
    integer, public           :: t_analyt_method
    character(LEN=PATH_MAX)   :: t_prof_file
    REALTYPE                  :: z_t1,t_1,z_t2,t_2
    REALTYPE                  :: t_obs_NN
    REALTYPE                  :: TRelaxTauM
    REALTYPE                  :: TRelaxTauS
    REALTYPE                  :: TRelaxTauB
    REALTYPE                  :: TRelaxSurf
    REALTYPE                  :: TRelaxBott
 
    Oxygen profile(s)
    integer, public           :: o2_prof_method
    integer, public           :: o2_units
    character(LEN=PATH_MAX)   :: o2_prof_file
 
    External pressure - 'press' namelist
    integer, public           :: ext_press_method,ext_press_mode
    character(LEN=PATH_MAX)   :: ext_press_file
    REALTYPE, public          :: PressConstU
    REALTYPE, public          :: PressConstV
    REALTYPE, public          :: PressHeight
    REALTYPE, public          :: PeriodM
    REALTYPE, public          :: AmpMu
    REALTYPE, public          :: AmpMv
    REALTYPE, public          :: PhaseMu
    REALTYPE, public          :: PhaseMv
    REALTYPE, public          :: PeriodS
    REALTYPE, public          :: AmpSu
    REALTYPE, public          :: AmpSv
    REALTYPE, public          :: PhaseSu
    REALTYPE, public          :: PhaseSv
 
    Internal pressure - 'internal_pressure' namelist
    integer, public           :: int_press_method
    character(LEN=PATH_MAX)   :: int_press_file
    REALTYPE, public          :: const_dsdx
    REALTYPE, public          :: const_dsdy
    REALTYPE, public          :: const_dtdx
    REALTYPE, public          :: const_dtdy
    logical, public           :: s_adv
    logical, public           :: t_adv
 
    Light extinction - the 'extinct' namelist
    integer                   :: extinct_method
    character(LEN=PATH_MAX)   :: extinct_file
 
    Vertical advection velocity - 'w_advspec' namelist
    integer, public           :: w_adv_method
    REALTYPE, public          :: w_adv0
    REALTYPE, public          :: w_adv_height0
    character(LEN=PATH_MAX)   :: w_adv_file
    integer, public           :: w_adv_discr
 
    Sea surface elevations - 'zetaspec' namelist
    integer,public            :: zeta_method
    character(LEN=PATH_MAX)   :: zeta_file
    REALTYPE, public          :: zeta_0
    REALTYPE, public          :: period_1
    REALTYPE, public          :: amp_1
    REALTYPE, public          :: phase_1
    REALTYPE, public          :: period_2
    REALTYPE, public          :: amp_2
    REALTYPE, public          :: phase_2
 
    Wind waves - 'wave_nml' namelist
    integer,public            :: wave_method
    character(LEN=PATH_MAX)   :: wave_file
    REALTYPE, public          :: Hs
    REALTYPE, public          :: Tz
    REALTYPE, public          :: phiw
 
    Observed velocity profile profiles - typically from ADCP
    integer                   :: vel_prof_method
    CHARACTER(LEN=PATH_MAX)   :: vel_prof_file
    REALTYPE, public          :: vel_relax_tau
    REALTYPE, public          :: vel_relax_ramp
 
    Observed dissipation profiles
    integer                   :: e_prof_method
    REALTYPE                  :: e_obs_const
    CHARACTER(LEN=PATH_MAX)   :: e_prof_file
 
    Buoyancy - 'bprofile' namelist
    REALTYPE, public          :: b_obs_surf,b_obs_NN
    REALTYPE, public          :: b_obs_sbf
 
 #ifdef BIO
    Observed biological profiles
    integer, public           :: bio_prof_method
    CHARACTER(LEN=PATH_MAX)   :: bio_prof_file
 #endif
 
    REALTYPE,public, parameter:: pi=3.141592654d0
DEFINED PARAMETERS:
 
    Unit numbers for reading observations/data.
    integer, parameter        :: s_prof_unit=30
    integer, parameter        :: t_prof_unit=31
    integer, parameter        :: ext_press_unit=32
    integer, parameter        :: int_press_unit=33
    integer, parameter        :: extinct_unit=34
    integer, parameter        :: w_adv_unit=35
    integer, parameter        :: zeta_unit=36
    integer, parameter        :: wave_unit=37
    integer, parameter        :: vel_prof_unit=38
    integer, parameter        :: e_prof_unit=39
    integer, parameter        :: o2_prof_unit=40
 #ifdef BIO
    integer, parameter        :: bio_prof_unit=41
 #endif
 
    pre-defined parameters
    integer, parameter        :: READ_SUCCESS=1
    integer, parameter        :: END_OF_FILE=-1
    integer, parameter        :: READ_ERROR=-2
    integer, parameter        :: NOTHING=0
    integer, parameter        :: ANALYTICAL=1
    integer, parameter        :: CONSTANT=1
    integer, parameter        :: FROMFILE=2
    integer, parameter        :: CONST_PROF=1
    integer, parameter        :: TWO_LAYERS=2
    integer, parameter        :: CONST_NN=3
REVISION HISTORY:
    Original author(s): Karsten Bolding & Hans Burchard
    $Log: observations.F90,v $
    Revision 1.23  2010-09-17 12:53:51  jorn
    extensive code clean-up to ensure proper initialization and clean-up of all variables
    Revision 1.22  2009-01-07 07:25:38  kb
    fixed various compilation warnings found by gfortran
    Revision 1.21  2007-12-07 10:10:51  kb
    allow longer lines in obs files
    Revision 1.20  2007-11-02 09:51:17  jorn
    Fixed: error on compiling without bio support
    Revision 1.19  2007-06-26 18:24:30  jorn
    fixed typos related to biological profiles
    Revision 1.18  2007-06-19 10:38:03  kbk
    initialise biological profiles from external file
    Revision 1.17  2007-01-06 11:57:07  kbk
    PressMethod --> ext_press_mode
    Revision 1.16  2007-01-06 11:49:15  kbk
    namelist file extension changed .inp --> .nml
    Revision 1.15  2007-01-04 12:08:12  kbk
    adding surface waves
    Revision 1.14  2006-11-27 09:25:18  kbk
    use logical var init_saved_vars to initialise saved variables
    Revision 1.13  2006-11-24 15:13:41  kbk
    de-allocate memory and close open files
    Revision 1.12  2005-12-23 14:10:34  kbk
    support for reading oxygen profiles
    Revision 1.11  2005/11/15 11:02:32  lars
    documentation finish for print
    Revision 1.10  2005/08/15 11:54:01  hb
    sequence of reading w_adv and w_height changed,
    w_adv_height0 introduced, documentation extended
    Revision 1.9  2005/07/06 16:20:14  kbk
    updated documentation - added const_NNT and const_NNS
    Revision 1.8  2004/07/30 09:26:01  hb
    Simple exponential light absorption added --> Wilfried Kuehn
    Revision 1.7  2003/03/28 09:20:35  kbk
    added new copyright to files
    Revision 1.6  2003/03/28 08:08:21  kbk
    removed tabs
    Revision 1.5  2003/03/10 13:51:08  lars
    changed intent(out) to intent(inout) for lines in read_profiles()
    Revision 1.4  2003/03/10 08:51:58  gotm
    Improved documentation and cleaned up code
    Revision 1.3  2001/11/27 15:35:55  gotm
    zeta_method now public - used by updategrid()
    Revision 1.1.1.1  2001/02/12 15:55:58  gotm
    initial import into CVS



Subsections

Karsten Bolding 2012-01-24