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.
limtab.F90 in branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/UKMO/dev_r5785_SSS_obsoper/NEMOGCM/NEMO/LIM_SRC_3/limtab.F90 @ 7773

Last change on this file since 7773 was 7773, checked in by mattmartin, 7 years ago

Committing updates after doing the following:

  • merging the branch dev_r4650_general_vert_coord_obsoper@7763 into this branch
  • updating it so that the following OBS changes were implemented correctly on top of the simplification changes:
    • generalised vertical coordinate for profile obs. This was done so that is now the default option.
    • sst bias correction implemented with the new simplified obs code.
    • included the biogeochemical obs types int he new simplified obs code.
    • included the changes to exclude obs in the boundary for limited area models
    • included other changes for the efficiency of the obs operator to remove global arrays.
File size: 3.5 KB
RevLine 
[825]1MODULE limtab
2   !!======================================================================
3   !!                       ***  MODULE limtab   ***
[3625]4   !!   LIM ice model : transform 1D (2D) array to a 2D (1D) table
[825]5   !!======================================================================
6#if defined key_lim3
7   !!----------------------------------------------------------------------
[834]8   !!   'key_lim3'                                      LIM3 sea-ice model
9   !!----------------------------------------------------------------------
[2715]10   !!   tab_2d_1d  : 2-D <==> 1-D
11   !!   tab_1d_2d  : 1-D <==> 2-D
[825]12   !!----------------------------------------------------------------------
13   USE par_kind
14
15   IMPLICIT NONE
16   PRIVATE
17
[2715]18   PUBLIC   tab_2d_1d   ! called by limthd
19   PUBLIC   tab_1d_2d   ! called by limthd
[825]20
21   !!----------------------------------------------------------------------
[4161]22   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2010)
[1156]23   !! $Id$
[2715]24   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[825]25   !!----------------------------------------------------------------------
26CONTAINS
27
[2715]28   SUBROUTINE tab_2d_1d( ndim1d, tab1d, tab2d, ndim2d_x, ndim2d_y, tab_ind )
29      !!----------------------------------------------------------------------
30      !!                  ***  ROUTINE tab_2d_1d  ***
31      !!----------------------------------------------------------------------
32      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1d & 2D sizes
33      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(in   ) ::   tab2d                        ! input 2D field
34      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
35      REAL(wp), DIMENSION(ndim1d)           , INTENT(  out) ::   tab1d                        ! output 1D field
36      !
37      INTEGER ::   jn , jid, jjd
38      !!----------------------------------------------------------------------
[825]39      DO jn = 1, ndim1d
[2715]40         jid        = MOD( tab_ind(jn) - 1 , ndim2d_x ) + 1
41         jjd        =    ( tab_ind(jn) - 1 ) / ndim2d_x + 1
[825]42         tab1d( jn) = tab2d( jid, jjd)
[921]43      END DO
[825]44   END SUBROUTINE tab_2d_1d
45
46
[2715]47   SUBROUTINE tab_1d_2d( ndim1d, tab2d, tab_ind, tab1d, ndim2d_x, ndim2d_y )
48      !!----------------------------------------------------------------------
49      !!                  ***  ROUTINE tab_2d_1d  ***
50      !!----------------------------------------------------------------------
51      INTEGER                               , INTENT(in   ) ::   ndim1d, ndim2d_x, ndim2d_y   ! 1d & 2D sizes
52      REAL(wp), DIMENSION(ndim1d)           , INTENT(in   ) ::   tab1d                        ! input 1D field
53      INTEGER , DIMENSION(ndim1d)           , INTENT(in   ) ::   tab_ind                      ! input index
54      REAL(wp), DIMENSION(ndim2d_x,ndim2d_y), INTENT(  out) ::   tab2d                        ! output 2D field
55      !
56      INTEGER ::   jn , jid, jjd
57      !!----------------------------------------------------------------------
[825]58      DO jn = 1, ndim1d
[2715]59         jid             = MOD( tab_ind(jn) - 1 ,  ndim2d_x ) + 1
[825]60         jjd             =    ( tab_ind(jn) - 1 ) / ndim2d_x  + 1
61         tab2d(jid, jjd) = tab1d( jn)
62      END DO
63   END SUBROUTINE tab_1d_2d
64
[2715]65#else
66   !!----------------------------------------------------------------------
67   !!   Default option        Dummy module             NO LIM sea-ice model
68   !!----------------------------------------------------------------------
[825]69#endif
[2715]70   !!======================================================================
[825]71END MODULE limtab
Note: See TracBrowser for help on using the repository browser.