Newer
Older
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
MODULE sao_data
!!======================================================================
!! *** MODULE sao_data ***
!!======================================================================
!! History : 3.6 ! 2015-12 (A. Ryan) Original code
!!----------------------------------------------------------------------
USE par_kind, ONLY: lc
USE lib_mpp ! distributed memory computing
USE in_out_manager
IMPLICIT NONE
INTEGER, PARAMETER :: MaxNumFiles = 1000
!! Stand Alone Observation operator settings
CHARACTER(len=lc) :: sao_files(MaxNumFiles) !: model files
INTEGER :: n_files !: number of files
INTEGER :: nn_sao_idx(MaxNumFiles) !: time_counter indices
INTEGER :: nn_sao_freq !: read frequency in time steps
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: sao_data.F90 12377 2020-02-12 14:39:06Z acc $
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE sao_data_init()
!!----------------------------------------------------------------------
!! *** SUBROUTINE sao_data_init ***
!!
!! ** Purpose : To read namelists and initialise offline_oper run.
!!
!!----------------------------------------------------------------------
INTEGER :: jf ! file dummy loop index
LOGICAL :: lmask(MaxNumFiles) ! Logical mask used for counting
INTEGER :: ios
!!
NAMELIST/namsao/sao_files, nn_sao_idx, nn_sao_freq
!!----------------------------------------------------------------------
IF(lwp) THEN
WRITE(numout,*)
WRITE(numout,*) 'sao_data_init : offline obs operator initialization'
WRITE(numout,*) '~~~~~~~~~~~~~'
ENDIF
! Standard offline obs_oper initialisation
n_files = 0 ! number of files to cycle through
sao_files(:) = '' ! list of files to read in
nn_sao_idx(:) = 0 ! list of indices inside each file
nn_sao_freq = -1 ! input frequency in time steps
! Standard offline obs_oper settings
READ ( numnam_ref, namsao, IOSTAT = ios, ERR = 901 )
901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in reference namelist' )
READ ( numnam_cfg, namsao, IOSTAT = ios, ERR = 902 )
902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsao in configuration namelist' )
lmask(:) = .FALSE. ! count input files
WHERE( sao_files(:) /= '' ) lmask(:) = .TRUE.
n_files = COUNT(lmask)
!
IF(nn_sao_freq == -1) THEN ! Initialise sub obs window frequency
nn_sao_freq = nitend - nit000 + 1 ! Run length
ENDIF
!
IF(lwp) THEN ! Print summary of settings
WRITE(numout,*) ' Namelist namsao : set stand alone obs_oper parameters'
DO jf = 1, n_files
WRITE(numout,'(1X,2A)') ' Input forecast file name forecastfile = ', TRIM(sao_files(jf))
WRITE(numout,*) ' Input forecast file index forecastindex = ', nn_sao_idx(jf)
END DO
END IF
!
END SUBROUTINE sao_data_init
!!======================================================================
END MODULE sao_data