INTERFACE:
module observationsDESCRIPTION:
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.11) 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. privatePUBLIC MEMBER FUNCTIONS:
public init_observations, get_all_obs, read_obs, read_profiles,&
clean_observations
PUBLIC DATA MEMBERS:
logical, public :: init_saved_vars=.true. '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=0.,dpdx=0.,dpdy=0.,h_press=0 vertical advection velocity REALTYPE, public :: w_adv=0.,w_height Parameters for water classification - default Jerlov type I REALTYPE, public :: A=0.58,g1=0.35,g2=23.0 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=0 integer, public :: s_analyt_method=1 character(LEN=PATH_MAX) :: s_prof_file='sprof.dat' REALTYPE :: z_s1,s_1,z_s2,s_2 REALTYPE :: s_obs_NN REALTYPE :: SRelaxTauM=0. REALTYPE :: SRelaxTauS=0. REALTYPE :: SRelaxTauB=0. REALTYPE :: SRelaxSurf=0. REALTYPE :: SRelaxBott=0. Temperature profile(s) integer, public :: t_prof_method=0 integer, public :: t_analyt_method=1 character(LEN=PATH_MAX) :: t_prof_file='tprof.dat' REALTYPE :: z_t1,t_1,z_t2,t_2 REALTYPE :: t_obs_NN REALTYPE :: TRelaxTauM=0. REALTYPE :: TRelaxTauS=0. REALTYPE :: TRelaxTauB=0. REALTYPE :: TRelaxSurf=0. REALTYPE :: TRelaxBott=0. Oxygen profile(s) integer, public :: o2_prof_method=0 integer, public :: o2_units=1 character(LEN=PATH_MAX) :: o2_prof_file='o2.dat' External pressure - 'press' namelist integer, public :: ext_press_method=0,ext_press_mode=0 character(LEN=PATH_MAX) :: ext_press_file='' REALTYPE, public :: PressConstU=0. REALTYPE, public :: PressConstV=0. REALTYPE, public :: PressHeight=0. REALTYPE, public :: PeriodM=44714. REALTYPE, public :: AmpMu=0. REALTYPE, public :: AmpMv=0. REALTYPE, public :: PhaseMu=0. REALTYPE, public :: PhaseMv=0. REALTYPE, public :: PeriodS=43200. REALTYPE, public :: AmpSu=0. REALTYPE, public :: AmpSv=0. REALTYPE, public :: PhaseSu=0. REALTYPE, public :: PhaseSv=0. Internal pressure - 'internal_pressure' namelist integer, public :: int_press_method=0 character(LEN=PATH_MAX) :: int_press_file='' REALTYPE, public :: const_dsdx=0. REALTYPE, public :: const_dsdy=0. REALTYPE, public :: const_dtdx=0. REALTYPE, public :: const_dtdy=0. logical, public :: s_adv=.false. logical, public :: t_adv=.false. Light extinction - the 'extinct' namelist integer :: extinct_method=1 character(LEN=PATH_MAX) :: extinct_file='extinction.dat' Vertical advection velocity - 'w_advspec' namelist integer, public :: w_adv_method=0 REALTYPE, public :: w_adv0=0. REALTYPE, public :: w_adv_height0=0. character(LEN=PATH_MAX) :: w_adv_file='w_adv.dat' integer, public :: w_adv_discr=1 Sea surface elevations - 'zetaspec' namelist integer,public :: zeta_method=0 character(LEN=PATH_MAX) :: zeta_file='zeta.dat' REALTYPE, public :: zeta_0=0. REALTYPE, public :: period_1=44714. REALTYPE, public :: amp_1=0. REALTYPE, public :: phase_1=0. REALTYPE, public :: period_2=43200. REALTYPE, public :: amp_2=0. REALTYPE, public :: phase_2=0. Wind waves - 'wave_nml' namelist integer,public :: wave_method=0 character(LEN=PATH_MAX) :: wave_file='wave.dat' REALTYPE, public :: Hs=_ZERO_ REALTYPE, public :: Tz=_ZERO_ REALTYPE, public :: phiw=_ZERO_ Observed velocity profile profiles - typically from ADCP integer :: vel_prof_method=0 CHARACTER(LEN=PATH_MAX) :: vel_prof_file='velprof.dat' REALTYPE, public :: vel_relax_tau=3600. REALTYPE, public :: vel_relax_ramp=86400. Observed dissipation profiles integer :: e_prof_method=0 REALTYPE :: e_obs_const=1.e-12 CHARACTER(LEN=PATH_MAX) :: e_prof_file='eprof.dat' Buoyancy - 'bprofile' namelist REALTYPE, public :: b_obs_surf=0.,b_obs_NN=0. REALTYPE, public :: b_obs_sbf=0. ifdef BIO Observed biological profiles integer, public :: bio_prof_method=1 CHARACTER(LEN=PATH_MAX) :: bio_prof_file='bioprofs.dat' endif REALTYPE,public, parameter:: pi=3.141592654DEFINED 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=3REVISION HISTORY:
Original author(s): Karsten Bolding & Hans Burchard $Log: observations.F90,v $ 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