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.
sao_data.F90 in branches/2014/dev_r4650_UKMO14.12_STAND_ALONE_OBSOPER/NEMOGCM/NEMO/SAO_SRC – NEMO

source: branches/2014/dev_r4650_UKMO14.12_STAND_ALONE_OBSOPER/NEMOGCM/NEMO/SAO_SRC/sao_data.F90 @ 5600

Last change on this file since 5600 was 5063, checked in by andrewryan, 9 years ago

gross simplification of stand alone observation operator

File size: 3.1 KB
RevLine 
[4849]1MODULE sao_data
[4110]2   !! =================================================================
[4849]3   !!                    *** MODULE sao_data ***
[4110]4   !! =================================================================
[4030]5   USE par_kind, ONLY: lc
[4844]6   USE lib_mpp         ! distributed memory computing
[4110]7
[4030]8   IMPLICIT NONE
[4110]9
10   !! Public data
11
[4030]12   INTEGER, PARAMETER :: MaxNumFiles = 1000
[4048]13
[4846]14   !! Stand Alone Observation operator settings
[4030]15   CHARACTER(len=lc) :: &
[4846]16      & sao_files(MaxNumFiles)         !: model files
[4030]17   INTEGER            :: &
[4048]18      & n_files, &                     !: number of files
[4846]19      & nn_sao_idx(MaxNumFiles), &     !: time_counter indices
20      & nn_sao_freq                    !: read frequency in time steps
[4030]21CONTAINS
[5063]22   SUBROUTINE sao_data_init()
[4030]23      !!----------------------------------------------------------------------
[4849]24      !!                    ***  SUBROUTINE sao_data_init ***
[4030]25      !!
26      !! ** Purpose : To read namelists and initialise offline_oper run.
27      !!
28      !!----------------------------------------------------------------------
29      USE in_out_manager
30      INTEGER            :: &
31         & jf                           !: file dummy loop index
32      LOGICAL :: lmask(MaxNumFiles)     !: Logical mask used for counting
[4844]33      INTEGER :: ios
[4030]34
35      ! Standard offline obs_oper information
[4846]36      NAMELIST/namsao/sao_files, nn_sao_idx, nn_sao_freq
[4030]37
38      ! Standard offline obs_oper initialisation
[4048]39      n_files = 0                   !: number of files to cycle through
[4846]40      sao_files(:) = ''             !: list of files to read in
41      nn_sao_idx(:) = 0             !: list of indices inside each file
42      nn_sao_freq = -1              !: input frequency in time steps
[4030]43
44      ! Standard offline obs_oper settings
[4844]45      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark
[4846]46      READ  ( numnam_ref, namsao, IOSTAT = ios, ERR = 901 )
47901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in reference namelist', .TRUE. )
[4030]48
[4844]49      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark
[4846]50      READ  ( numnam_cfg, namsao, IOSTAT = ios, ERR = 902 )
51902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsao in configuration namelist', .TRUE. )
[4844]52
53
[4048]54      ! count input files
[4030]55      lmask(:) = .FALSE.
[4846]56      WHERE (sao_files(:) /= '') lmask(:) = .TRUE.
[4048]57      n_files = COUNT(lmask)
[4030]58
[4048]59      !! Initialise sub obs window frequency
[4846]60      IF (nn_sao_freq == -1) THEN
[4048]61         !! Run length
[4846]62         nn_sao_freq = nitend - nit000 + 1
[4048]63      ENDIF
64
65      !! Print summary of settings
[4030]66      IF(lwp) THEN
67         WRITE(numout,*)
68         WRITE(numout,*) 'offline obs_oper : Initialization'
69         WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
[5063]70         WRITE(numout,*) '   Namelist namsao : set stand alone obs_oper parameters'
[4048]71         DO jf = 1, n_files
[4030]72            WRITE(numout,'(1X,2A)') '   Input forecast file name          forecastfile = ', &
[4846]73               TRIM(sao_files(jf))
[4030]74            WRITE(numout,*) '   Input forecast file index        forecastindex = ', &
[4846]75               nn_sao_idx(jf)
[4030]76         END DO
77      END IF
78
[4849]79   END SUBROUTINE sao_data_init
[4030]80
[4849]81END MODULE sao_data
[4030]82
Note: See TracBrowser for help on using the repository browser.