New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
ooo_utils.F90 in branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC – NEMO

source: branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/NEMO/OOO_SRC/ooo_utils.F90 @ 4110

Last change on this file since 4110 was 4110, checked in by andrewryan, 11 years ago

Added headers to each module in OOO_SRC and corrected positions of IMPLICIT NONE and PUBLIC subroutines.

File size: 3.6 KB
Line 
1MODULE ooo_utils
2   !! =================================================================
3   !!                    *** MODULE ooo_utils ***
4   !! =================================================================
5
6   USE obs_utils, ONLY: chkerr
7   USE obs_const, ONLY: obfillflt
8   USE par_oce
9   USE obs_types, ONLY: cwmonam1770
10   USE obs_sla, ONLY: nslasets
11
12   IMPLICIT NONE
13
14   ! Define double precision obfillflt
15   REAL(kind=dp), PARAMETER :: obfilldbl=99999.
16
17   CONTAINS
18
19   SUBROUTINE yyyymmdd_to_ref_date(indate, intime, outstring)
20      !----------------------------------------
21      ! Routine to create reference date string
22      !----------------------------------------
23      ! Routine arguments
24      CHARACTER(len=8),  INTENT(IN)  :: indate    ! yyyymmdd
25      CHARACTER(len=6),  INTENT(IN)  :: intime    ! hhmmss
26      CHARACTER(len=23), INTENT(OUT) :: outstring ! yyyy-mm-dd hh:mm:ss utc
27      ! Local variables
28      CHARACTER(len=4)  :: year      ! yyyy
29      CHARACTER(len=2)  :: month     ! mm
30      CHARACTER(len=2)  :: day       ! dd
31      CHARACTER(len=2)  :: hour      ! hh
32      CHARACTER(len=2)  :: minute    ! mm
33      CHARACTER(len=2)  :: second    ! ss
34
35      year   = indate(1:4)
36      month  = indate(5:6)
37      day    = indate(7:8)
38      hour   = intime(1:2)
39      minute = intime(3:4)
40      second = intime(5:6)
41
42      outstring = year//"-"//month//"-"//day//" "//hour//":"//minute//":"//second//" utc"
43     
44   END SUBROUTINE yyyymmdd_to_ref_date
45
46   SUBROUTINE date_format(date_str)
47      !---------------------------------------
48      ! Routine to create creation date string
49      !---------------------------------------
50
51      ! Routine arguments
52      CHARACTER(len=*), INTENT(OUT) :: date_str
53      ! Local variables
54      CHARACTER(8)  :: date
55      CHARACTER(10) :: time
56
57      CHARACTER(10)  :: date_part
58      CHARACTER(8)  :: time_part
59
60      CALL date_and_time(DATE=date)
61      CALL date_and_time(TIME=time)
62      date_part  = date(1:4)//'/'//date(5:6)//'/'//date(7:8)
63      time_part  = time(1:2)//':'//time(3:4)//':'//time(5:6)
64
65      date_str   = date_part//' '//time_part
66
67   END SUBROUTINE date_format
68
69   SUBROUTINE inst_converter(wmo_inst_list, nprofs, obs_names)
70      !---------------------------------------
71      ! Routine to convert WMO_INST_TYPE to
72      ! 'ARGO', 'TESAC', 'XBT', 'BUOYS'
73      !---------------------------------------
74
75      !! Routine arguments
76      INTEGER,                             INTENT(IN) :: nprofs
77      CHARACTER(len=*),DIMENSION(nprofs),  INTENT(IN) :: wmo_inst_list     
78      CHARACTER(len=128),DIMENSION(nprofs),INTENT(OUT):: obs_names
79
80      !! Local variables
81      INTEGER :: inam !: loop over name
82
83      !! Initialise obs_names
84      obs_names(:) = ''
85
86      !! Convert number to text
87      DO inam = 1,nprofs
88         IF (trim(adjustl(wmo_inst_list(inam))) .EQ. '820') THEN
89            obs_names(inam) = 'BUOYS'
90         ELSEIF (trim(adjustl(wmo_inst_list(inam))) .EQ. '401') THEN
91            obs_names(inam) = 'XBT'
92         ELSEIF (trim(adjustl(wmo_inst_list(inam))) .EQ. '741') THEN
93            obs_names(inam) = 'TESAC'
94         ELSEIF (trim(adjustl(wmo_inst_list(inam))) .EQ. '831') THEN
95            obs_names(inam) = 'ARGO'
96         ELSEIF (trim(adjustl(wmo_inst_list(inam))) .EQ. '22') THEN ! Special case for AATSR
97            obs_names(inam) = '22'
98         ELSEIF (trim(adjustl(wmo_inst_list(inam))) .EQ. '') THEN
99            obs_names(inam) = 'UNKNOWN'
100         ELSE
101            obs_names(inam) = adjustl(wmo_inst_list(inam)) ! For all other cases
102         ENDIF
103      ENDDO
104
105   END SUBROUTINE inst_converter
106
107END MODULE ooo_utils
Note: See TracBrowser for help on using the repository browser.