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_data.F90 in branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OOO_SRC – NEMO

source: branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/NEMO/OOO_SRC/ooo_data.F90 @ 7795

Last change on this file since 7795 was 5602, checked in by cbricaud, 9 years ago

merge change from trunk rev 5003 to 5519 ( rev where branche 3.6_stable were created )

  • Property svn:keywords set to Id
File size: 6.1 KB
Line 
1MODULE ooo_data
2   !! =================================================================
3   !!                    *** MODULE ooo_data ***
4   !! =================================================================
5   USE par_kind, ONLY: lc
6
7   IMPLICIT NONE
8
9   !! Public data
10
11   INTEGER, PARAMETER :: MaxNumFiles = 1000
12
13   !! Class 4 file settings
14   INTEGER :: &
15           & cl4_fcst_idx(MaxNumFiles), & !: forecast indices
16           & cl4_match_len, &             !: number of match types
17           & cl4_fcst_len                 !: number of forecast days
18   CHARACTER(len=lc) :: &
19           & cl4_vars(MaxNumFiles), &  !: class 4 variables
20           & cl4_sys, &                !: class 4 system
21           & cl4_cfg, &                !: class 4 configuration
22           & cl4_date, &               !: class 4 date
23           & cl4_vn,  &                !: class 4 version
24           & cl4_prefix, &             !: class 4 prefix
25           & cl4_contact, &            !: class 4 contact
26           & cl4_inst                  !: class 4 institute
27   REAL ::   cl4_modjuld               !: model Julian day
28   REAL :: &
29      & cl4_leadtime(MaxNumFiles)      !: Lead time data
30
31   !! Offline obs_oper settings
32   CHARACTER(len=lc) :: &
33      & ooo_files(MaxNumFiles)         !: model files
34   INTEGER            :: &
35      & jifile, &                      !: current file list index
36      & n_files, &                     !: number of files
37      & jimatch, &                     !: current match
38      & nn_ooo_idx(MaxNumFiles), &     !: time_counter indices
39      & nn_ooo_freq                    !: read frequency in time steps
40   CHARACTER(len=128) :: &
41      & alt_file                       !: altimeter file
42   !! $Id$
43CONTAINS
44   SUBROUTINE ooo_data_init( ld_cl4 )
45      !!----------------------------------------------------------------------
46      !!                    ***  SUBROUTINE ooo_data_init ***
47      !!
48      !! ** Purpose : To read namelists and initialise offline_oper run.
49      !!
50      !!----------------------------------------------------------------------
51      USE in_out_manager
52      INTEGER            :: &
53         & jf                           !: file dummy loop index
54      LOGICAL :: lmask(MaxNumFiles)     !: Logical mask used for counting
55      LOGICAL, INTENT(IN) :: ld_cl4     !: Logical class 4 on/off
56
57      ! Standard offline obs_oper information
58      NAMELIST/namooo/ooo_files, nn_ooo_idx, nn_ooo_freq
59
60      ! Class 4 file specifiers
61      NAMELIST/namcl4/cl4_vars, cl4_sys, cl4_cfg, cl4_date, cl4_vn, &
62         &            cl4_prefix, cl4_contact, cl4_inst, cl4_leadtime, &
63         &            cl4_fcst_idx, cl4_fcst_len, cl4_match_len
64
65      ! Standard offline obs_oper initialisation
66      jimatch = 0                   !: match-up iteration variable
67      jifile = 1                    !: input file iteration variable
68      n_files = 0                   !: number of files to cycle through
69      ooo_files(:) = ''             !: list of files to read in
70      nn_ooo_idx(:) = 0             !: list of indices inside each file
71      nn_ooo_freq = -1              !: input frequency in time steps
72
73      ! Class 4 initialisation
74      cl4_leadtime(:) = 0           !: Lead time axis value for each file
75      cl4_fcst_len = 0              !: Length of the forecast dimension
76      cl4_match_len = 1             !: Number of match types
77      cl4_fcst_idx(:) = 0           !: output file forecast index
78      cl4_vars(:) = ''              !: output file variable names
79      cl4_sys = ''                  !: output file system
80      cl4_cfg = ''                  !: output file configuration
81      cl4_date = ''                 !: output file date string
82      cl4_vn = ''                   !: output file version
83      cl4_prefix = 'class4'         !: output file prefix
84      cl4_contact = ''              !: output file contact details
85      cl4_inst = ''                 !: output file institution
86
87      ! Standard offline obs_oper settings
88      READ(numnam, namooo)
89
90      ! Read class 4 output settings
91      IF (ld_cl4) THEN
92         READ(numnam, namcl4)
93      ENDIF
94
95      ! count input files
96      lmask(:) = .FALSE.
97      WHERE (ooo_files(:) /= '') lmask(:) = .TRUE.
98      n_files = COUNT(lmask)
99
100      !! Initialise sub obs window frequency
101      IF (nn_ooo_freq == -1) THEN
102         !! Run length
103         nn_ooo_freq = nitend - nit000 + 1
104      ENDIF
105
106      !! Print summary of settings
107      IF(lwp) THEN
108         WRITE(numout,*)
109         WRITE(numout,*) 'offline obs_oper : Initialization'
110         WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
111         WRITE(numout,*) '   Namelist namooo : set offline obs_oper parameters' 
112         DO jf = 1, n_files
113            WRITE(numout,'(1X,2A)') '   Input forecast file name          forecastfile = ', &
114               TRIM(ooo_files(jf))
115            WRITE(numout,*) '   Input forecast file index        forecastindex = ', &
116               nn_ooo_idx(jf)
117            WRITE(numout,*) '   Output forecast leadtime index   leadtimeindex = ', &
118               cl4_fcst_idx(jf)
119            WRITE(numout,*) '   Output forecast leadtime value   leadtimevalue = ', &
120               cl4_leadtime(jf)
121            WRITE(numout,'(1X,2A)') '   Input class 4 variable       class 4 parameter = ', &
122               TRIM(cl4_vars(jf))
123         END DO
124         WRITE(numout, '(1X,2A)') '   Input class 4 system            class 4 system = ', &
125            TRIM(cl4_sys)
126         WRITE(numout, '(1X,2A)') '   Input class 4 config            class 4 config = ', &
127            TRIM(cl4_cfg)
128         WRITE(numout, '(1X,2A)') '   Input class 4 date                class 4 date = ', &
129            TRIM(cl4_date)
130         WRITE(numout, '(1X,2A)') '   Input class 4 version          class 4 version = ', &
131            TRIM(cl4_vn)
132         WRITE(numout, '(1X,2A)') '   Input class 4 prefix            class 4 prefix = ', &
133            TRIM(cl4_prefix)
134         WRITE(numout, '(1X,2A)') '   Input class 4 contact          class 4 contact = ', &
135            TRIM(cl4_contact)
136         WRITE(numout, '(1X,2A)') '   Input class 4 institute      class 4 institute = ', &
137            TRIM(cl4_inst)
138      END IF
139
140   END SUBROUTINE ooo_data_init
141
142END MODULE ooo_data
143
Note: See TracBrowser for help on using the repository browser.