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.
Changeset 12962 – NEMO

Changeset 12962


Ignore:
Timestamp:
2020-05-22T16:18:18+02:00 (4 years ago)
Author:
hadcv
Message:

Update with [12960] fixes

Location:
NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg

    r12377 r12962  
    8989   !           !  file name              ! frequency (hours) ! variable  ! time interp.!  clim  ! 'yearly'/ !       weights filename               ! rotation ! land/sea mask ! 
    9090   !           !                         !  (if <0  months)  !   name    !   (logical) !  (T/F) ! 'monthly' !                                      ! pairing  !    filename   ! 
    91    sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Uwnd'   , '' 
    92    sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bicubic_noc.nc'  , 'Vwnd'   , '' 
    93    sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    94    sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    95    sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    96    sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    97    sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    98    sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    99    sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core_orca2_bilinear_noc.nc' , ''       , '' 
    100 / 
    101 !----------------------------------------------------------------------- 
    102 &namsbc_cpl    !   coupled ocean/atmosphere model                       ("key_oasis3") 
    103 !----------------------------------------------------------------------- 
     91   sn_wndi     = 'u_10.15JUNE2009_fill'       ,    6.        , 'U_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Uwnd'   , '' 
     92   sn_wndj     = 'v_10.15JUNE2009_fill'       ,    6.        , 'V_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bicub'  , 'Vwnd'   , '' 
     93   sn_qsr      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'SWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     94   sn_qlw      = 'ncar_rad.15JUNE2009_fill'   ,   24.        , 'LWDN_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     95   sn_tair     = 't_10.15JUNE2009_fill'       ,    6.        , 'T_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     96   sn_humi     = 'q_10.15JUNE2009_fill'       ,    6.        , 'Q_10_MOD',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     97   sn_prec     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'PRC_MOD1',   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     98   sn_snow     = 'ncar_precip.15JUNE2009_fill',   -1.        , 'SNOW'    ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
     99   sn_slp      = 'slp.15JUNE2009_fill'        ,    6.        , 'SLP'     ,   .false.   , .true. , 'yearly'  , 'weights_core2_orca2_bilin' , ''       , '' 
    104100/ 
    105101!----------------------------------------------------------------------- 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/DOM/dom_oce.F90

    r12958 r12962  
    9797   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig0       !: local ==> global domain, excluding halos (Ni0glo), i-index 
    9898   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mjg0       !: local ==> global domain, excluding halos (Nj0glo), j-index 
     99   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mig0_oldcmp !: local ==> global domain, excluding halos (Ni0glo), i-index 
     100   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mjg0_oldcmp !: local ==> global domain, excluding halos (Nj0glo), j-index 
    99101   INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   mi0, mi1   !: global, including halos (jpiglo) ==> local domain i-index 
    100102   !                                                                !:    (mi0=1 and mi1=0 if global index not in local domain) 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/DOM/domain.F90

    r12958 r12962  
    217217      !!              - mig0, mjg0: local  domain indices ==> global domain, excluding halos, indices 
    218218      !!              - mi0 , mi1 : global domain indices ==> local  domain indices 
    219       !!              - mj0,, mj1   (global point not in the local domain ==> mi0>mi1 and/or mj0>mj1) 
     219      !!              - mj0 , mj1   (if global point not in the local domain ==> mi0>mi1 and/or mj0>mj1) 
    220220      !!---------------------------------------------------------------------- 
    221221      INTEGER ::   ji, jj   ! dummy loop argument 
     
    230230      !                              ! local domain indices ==> global domain, excluding halos, indices 
    231231      ! 
     232      mig0(:) = mig(:) - nn_hls 
     233      mjg0(:) = mjg(:) - nn_hls   
    232234      ! WARNING: to keep compatibility with the trunk that was including periodocity into the input data,  
    233235      ! we must define mig0 and mjg0 as bellow. 
    234236      ! Once we decide to forget trunk compatibility, we must simply define mig0 and mjg0 as: 
    235 !!$      mig0(:) = mig(:) - nn_hls 
    236 !!$      mjg0(:) = mjg(:) - nn_hls   
    237       mig0(:) = mig(:) - nn_hls + COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) ) 
    238       mjg0(:) = mjg(:) - nn_hls + COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) 
     237      mig0_oldcmp(:) = mig0(:) + COUNT( (/ jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 /) ) 
     238      mjg0_oldcmp(:) = mjg0(:) + COUNT( (/ jperio == 2 .OR. jperio == 7 /) ) 
    239239      ! 
    240240      !                              ! global domain, including halos, indices ==> local domain indices 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/DOM/domvvl.F90

    r12958 r12962  
    261261            IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN 
    262262               IF( nn_cfg == 3 ) THEN   ! ORCA2: Suppress ztilde in the Foxe Basin for ORCA2 
    263                   ii0 = 103   ;   ii1 = 111        
    264                   ij0 = 128   ;   ij1 = 135   ;    
     263                  ii0 = 103 + nn_hls - 1   ;   ii1 = 111 + nn_hls - 1       
     264                  ij0 = 128 + nn_hls       ;   ij1 = 135 + nn_hls 
    265265                  frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp 
    266266                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rn_Dt 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/DOM/dtatsd.F90

    r12377 r12962  
    153153         IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN    ! some hand made alterations 
    154154            ! 
    155             ij0 = 101   ;   ij1 = 109                       ! Reduced T & S in the Alboran Sea 
    156             ii0 = 141   ;   ii1 = 155 
     155            ij0 = 101 + nn_hls       ;   ij1 = 109 + nn_hls                       ! Reduced T & S in the Alboran Sea 
     156            ii0 = 141 + nn_hls - 1   ;   ii1 = 155 + nn_hls - 1 
    157157            DO jj = mj0(ij0), mj1(ij1) 
    158158               DO ji = mi0(ii0), mi1(ii1) 
     
    167167               END DO 
    168168            END DO 
    169             ij0 =  87   ;   ij1 =  96                          ! Reduced temperature in Red Sea 
    170             ii0 = 148   ;   ii1 = 160 
     169            ij0 =  87 + nn_hls       ;   ij1 =  96 + nn_hls                       ! Reduced temperature in Red Sea 
     170            ii0 = 148 + nn_hls - 1   ;   ii1 = 160 + nn_hls - 1 
    171171            sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ,  4:10 ) = 7.0_wp 
    172172            sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/IOM/iom.F90

    r12958 r12962  
    119119      INTEGER ::   Nis0_save, Nie0_save    !:      and close boundaries in output files 
    120120      INTEGER ::   Njs0_save, Nje0_save    !: 
     121      INTEGER ::   Ni_0_save, Nj_0_save    !: 
    121122      LOGICAL ::   ll_closedef = .TRUE. 
    122123      !!---------------------------------------------------------------------- 
     
    129130         Nis0_save = Nis0   ;   Nie0_save = Nie0 
    130131         Njs0_save = Njs0   ;   Nje0_save = Nje0 
    131          IF( nimpp           ==      1 ) Nis0 = 1 
    132          IF( nimpp + jpi - 1 == jpiglo ) Nie0 = jpi 
    133          IF( njmpp           ==      1 ) Njs0 = 1 
    134          IF( njmpp + jpj - 1 == jpjglo ) Nje0 = jpj 
     132         Ni_0_save = Ni_0   ;   Nj_0_save = Nj_0 
     133         IF( mig( 1 ) ==      1 ) Nis0 = 1 
     134         IF( mig(jpi) == jpiglo ) Nie0 = jpi 
     135         IF( mjg( 1 ) ==      1 ) Njs0 = 1 
     136         IF( mjg(jpj) == jpjglo ) Nje0 = jpj 
     137         Ni_0 = Nie0 - Nis0 + 1 
     138         Nj_0 = Nje0 - Njs0 + 1 
    135139      ENDIF 
    136140      IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef 
     
    150154 
    151155      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    152       CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), & 
    153           &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
    154       CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), & 
    155           &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
    156       CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(irefyear,irefmonth,irefday,00,00,00), & 
    157           &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     156      CASE ( 1)   ;   CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),  & 
     157          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) ) 
     158      CASE ( 0)   ;   CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),  & 
     159          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) ) 
     160      CASE (30)   ;   CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(irefyear,irefmonth,irefday,0,0,0),  & 
     161          &                                                          start_date  = xios_date(   nyear,   nmonth,   nday,0,0,0) ) 
    158162      END SELECT 
    159163 
     
    284288         Nis0 = Nis0_save   ;   Nie0 = Nie0_save 
    285289         Njs0 = Njs0_save   ;   Nje0 = Nje0_save 
     290         Ni_0 = Ni_0_save   ;   Nj_0 = Nj_0_save 
    286291      ENDIF 
    287292#endif 
     
    11621167            ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown 
    11631168               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0  
    1164                IF( idom == jpdom_global )   istart(1:2) = (/ mig(Nis0)-nn_hls, mjg(Njs0)-nn_hls /) 
     1169               IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /) 
    11651170               icnt(1:2) = (/ Ni_0, Nj_0 /) 
    11661171               IF( PRESENT(pv_r3d) ) THEN 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/LBC/mppini.F90

    r12807 r12962  
    88   !!            8.0  !  1998-05  (M. Imbard, J. Escobar, L. Colombet )  SHMEM and MPI versions 
    99   !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1 
    10    !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom 
    11    !!            3.   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication  
     10   !!            3.4  !  2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom 
     11   !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication  
    1212   !!            4.0  !  2016-06  (G. Madec)  use domain configuration file instead of bathymetry file 
    1313   !!            4.0  !  2017-06  (J.M. Molines, T. Lovato) merge of mppini and mppini_2 
     
    10551055      !!                  ***  ROUTINE mpp_init_nboce  *** 
    10561056      !! 
    1057       !! ** Purpose : check for a mpi domain decomposition knbi x knbj which 
    1058       !!              subdomains contain at least 1 ocean point 
     1057      !! ** Purpose : Check for a mpi domain decomposition knbi x knbj which 
     1058      !!              subdomains, including 1 halo (even if nn_hls>1), contain 
     1059      !!              at least 1 ocean point. 
     1060      !!              We must indeed ensure that each subdomain that is a neighbour 
     1061      !!              of a land subdomain as only land points on its boundary 
     1062      !!              (inside the inner subdomain) with the land subdomain. 
     1063      !!              This is needed to get the proper bondary conditions on 
     1064      !!              a subdomain with a closed boundary. 
    10591065      !! 
    10601066      !! ** Method  : read knbj strips (of length Ni0glo) of the land-sea mask 
     
    10661072      INTEGER, DIMENSION(knbi*knbj) ::   inboce_1d 
    10671073      INTEGER :: idiv, iimax, ijmax, iarea 
     1074      INTEGER :: inx, iny, inry, isty 
    10681075      INTEGER :: ji, jn 
    10691076      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce                  ! lloce(i,j) = .true. if the point (i,j) is ocean  
     
    10861093      DO jn = 0, (knbj-1)/mppsize   ! if mppsize < knbj : more strips than mpi processes (because of potential land domains) 
    10871094         ! 
    1088          iarea = (narea-1)/idiv + jn * mppsize   ! involed process number (starting counting at 0) 
    1089          IF( MOD( narea-1, idiv ) == 0 .AND. iarea < knbj ) THEN   ! beware idiv can be = to 1 
     1095         iarea = (narea-1)/idiv + jn * mppsize + 1                     ! involed process number (starting counting at 1) 
     1096         IF( MOD( narea-1, idiv ) == 0 .AND. iarea <= knbj ) THEN      ! beware idiv can be = to 1 
    10901097            ! 
    10911098            ALLOCATE( iimppt(knbi,knbj), ijmppt(knbi,knbj), ijpi(knbi,knbj), ijpj(knbi,knbj) ) 
    10921099            CALL basic_decomposition( Ni0glo, Nj0glo, 0, knbi, knbj, iimax, ijmax, iimppt, ijmppt, ijpi, ijpj ) 
    10931100            ! 
    1094             ALLOCATE( lloce(Ni0glo, ijpj(1,iarea+1)) )                       ! allocate the strip 
    1095             CALL readbot_strip( ijmppt(1,iarea+1), ijpj(1,iarea+1), lloce )           ! read the strip 
     1101            inx = Ni0glo + 2   ;   iny = ijpj(1,iarea) + 2             ! strip size + 1 halo on each direction (even if nn_hls>1) 
     1102            ALLOCATE( lloce(inx, iny) )                                ! allocate the strip 
     1103            inry = iny - COUNT( (/ iarea == 1, iarea == knbj /) )      ! number of point to read in y-direction 
     1104            isty = 1 + COUNT( (/ iarea == 1 /) )                       ! read from the first or the second line? 
     1105            CALL readbot_strip( ijmppt(1,iarea) - 2 + isty, inry, lloce(2:inx-1, isty:inry+isty-1) )   ! read the strip 
     1106            !  
     1107            IF( iarea == 1    ) THEN                                   ! the first line was not read 
     1108               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity 
     1109                  CALL readbot_strip( Nj0glo, 1, lloce(2:inx-1, 1) )   !   read the last line -> first line of lloce 
     1110               ELSE 
     1111                  lloce(2:inx-1,  1) = .FALSE.                         !   closed boundary 
     1112               ENDIF 
     1113            ENDIF 
     1114            IF( iarea == knbj ) THEN                                   ! the last line was not read 
     1115               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity 
     1116                  CALL readbot_strip( 1, 1, lloce(2:inx-1,iny) )       !   read the first line -> last line of lloce 
     1117               ELSE 
     1118                  lloce(2:inx-1,iny) = .FALSE.                         !   closed boundary 
     1119               ENDIF 
     1120            ENDIF 
     1121            !                                                          ! first and last column were not read 
     1122            IF( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7 ) THEN 
     1123               lloce(1,:) = lloce(inx-1,:)   ;   lloce(inx,:) = lloce(2,:)   ! east-west periodocity 
     1124            ELSE 
     1125               lloce(1,:) = .FALSE.          ;   lloce(inx,:) = .FALSE.      ! closed boundary 
     1126            ENDIF 
     1127            ! 
    10961128            DO  ji = 1, knbi 
    1097                inboce(ji,iarea+1) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ijpi(ji,1)-1,:) )   ! number of ocean point in subdomain 
     1129               inboce(ji,iarea) = COUNT( lloce(iimppt(ji,1):iimppt(ji,1)+ijpi(ji,1)+1,:) )   ! lloce as 2 points more than Ni0glo 
    10981130            END DO 
    10991131            ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/SBC/fldread.F90

    r12866 r12962  
    5353      LOGICAL              ::   ln_tint     ! time interpolation or not (T/F) 
    5454      LOGICAL              ::   ln_clim     ! climatology or not (T/F) 
    55       CHARACTER(len = 8)   ::   cltype      ! type of data file 'daily', 'monthly' or yearly' 
     55      CHARACTER(len = 8)   ::   clftyp      ! type of data file 'daily', 'monthly' or yearly' 
    5656      CHARACTER(len = 256) ::   wname       ! generic name of a NetCDF weights file to be used, blank if not 
    5757      CHARACTER(len = 34)  ::   vcomp       ! symbolic component name if a vector that needs rotation 
     
    6969      LOGICAL                         ::   ln_tint      ! time interpolation or not (T/F) 
    7070      LOGICAL                         ::   ln_clim      ! climatology or not (T/F) 
    71       CHARACTER(len = 8)              ::   cltype       ! type of data file 'daily', 'monthly' or yearly' 
     71      CHARACTER(len = 8)              ::   clftyp       ! type of data file 'daily', 'monthly' or yearly' 
     72      CHARACTER(len = 1)              ::   cltype       ! nature of grid-points: T, U, V... 
     73      REAL(wp)                        ::   zsgn         ! -1. the sign change across the north fold, =  1. otherwise 
    7274      INTEGER                         ::   num          ! iom id of the jpfld files to be read 
    7375      INTEGER , DIMENSION(2,2)        ::   nrec         ! before/after record (1: index, 2: second since Jan. 1st 00h of yr nit000) 
    7476      INTEGER                         ::   nbb          ! index of before values 
    7577      INTEGER                         ::   naa          ! index of after  values 
    76       INTEGER , ALLOCATABLE, DIMENSION(:      ) ::   nrecsec   !  
    77       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step 
    78       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields 
     78      INTEGER , ALLOCATABLE, DIMENSION(:) ::   nrecsec   !  
     79      REAL(wp), POINTER, DIMENSION(:,:,:  ) ::   fnow   ! input fields interpolated to now time step 
     80      REAL(wp), POINTER, DIMENSION(:,:,:,:) ::   fdta   ! 2 consecutive record of input fields 
    7981      CHARACTER(len = 256)            ::   wgtname      ! current name of the NetCDF weight file acting as a key 
    8082      !                                                 ! into the WGTLIST structure 
     
    351353      INTEGER ::   iaa      ! shorter name for sdjf%naa 
    352354      INTEGER ::   iw       ! index into wgts array 
    353       INTEGER ::   ipdom    ! index of the domain 
    354355      INTEGER ::   idvar    ! variable ID 
    355356      INTEGER ::   idmspc   ! number of spatial dimensions 
    356357      LOGICAL ::   lmoor    ! C1D case: point data 
    357       !!--------------------------------------------------------------------- 
    358       ! 
    359       ipk = SIZE( sdjf%fnow, 3 ) 
     358      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_alias   ! short cut 
     359      !!--------------------------------------------------------------------- 
    360360      iaa = sdjf%naa 
    361361      ! 
    362       IF( ASSOCIATED(sdjf%imap) ) THEN 
    363          IF( sdjf%ln_tint ) THEN   ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa),   & 
    364             &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm ) 
    365          ELSE                      ;   CALL fld_map( sdjf%num, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa),   & 
    366             &                                        sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm ) 
    367          ENDIF 
    368       ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN 
     362      IF( sdjf%ln_tint ) THEN   ;   dta_alias => sdjf%fdta(:,:,:,iaa) 
     363      ELSE                      ;   dta_alias => sdjf%fnow(:,:,:    ) 
     364      ENDIF 
     365      ipk = SIZE( dta_alias, 3 ) 
     366      ! 
     367      IF( ASSOCIATED(sdjf%imap) ) THEN              ! BDY case  
     368         CALL fld_map( sdjf%num, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   & 
     369            &          sdjf%imap, sdjf%igrd, sdjf%ibdy, sdjf%ltotvel, sdjf%lzint, Kmm ) 
     370      ELSE IF( LEN(TRIM(sdjf%wgtname)) > 0 ) THEN   ! On-the-fly interpolation 
    369371         CALL wgt_list( sdjf, iw ) 
    370          IF( sdjf%ln_tint ) THEN   ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fdta(:,:,:,iaa),   &  
    371             &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname ) 
    372             CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa), 'T', 1._wp, kfillmode = jpfillcopy ) 
    373          ELSE                      ;   CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, sdjf%fnow(:,:,:    ),   & 
    374             &                                                                          sdjf%nrec(1,iaa), sdjf%lsmname ) 
    375             CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:    ), 'T', 1._wp, kfillmode = jpfillcopy ) 
    376          ENDIF 
    377       ELSE 
    378          IF( SIZE(sdjf%fnow, 1) == jpi ) THEN   ;   ipdom = jpdom_global 
    379          ELSE                                   ;   ipdom = jpdom_unknown 
    380          ENDIF 
     372         CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, dta_alias(:,:,:), sdjf%nrec(1,iaa), sdjf%lsmname ) 
     373         CALL lbc_lnk( 'fldread', dta_alias(:,:,:), sdjf%cltype, sdjf%zsgn, kfillmode = jpfillcopy ) 
     374      ELSE                                          ! default case 
    381375         ! C1D case: If product of spatial dimensions == ipk, then x,y are of 
    382376         ! size 1 (point/mooring data): this must be read onto the central grid point 
    383377         idvar  = iom_varid( sdjf%num, sdjf%clvar ) 
    384378         idmspc = iom_file ( sdjf%num )%ndims( idvar ) 
    385          IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1 
    386          lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  ) 
    387          ! 
    388          SELECT CASE( ipk ) 
    389          CASE(1) 
    390             IF( lk_c1d .AND. lmoor ) THEN 
    391                IF( sdjf%ln_tint ) THEN 
    392                   CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fdta(2,2,1,iaa), sdjf%nrec(1,iaa) ) 
    393                   CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,1,iaa),'T',1., kfillmode = jpfillcopy ) 
    394                ELSE 
    395                   CALL iom_get( sdjf%num, sdjf%clvar, sdjf%fnow(2,2,1    ), sdjf%nrec(1,iaa) ) 
    396                   CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,1    ),'T',1., kfillmode = jpfillcopy ) 
    397                ENDIF 
    398             ELSE 
    399                IF( sdjf%ln_tint ) THEN 
    400                   CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,1,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy ) 
    401                ELSE 
    402                   CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,1    ), sdjf%nrec(1,iaa), kfill = jpfillcopy ) 
    403                ENDIF 
    404             ENDIF 
    405          CASE DEFAULT 
    406             IF(lk_c1d .AND. lmoor ) THEN 
    407                IF( sdjf%ln_tint ) THEN 
    408                   CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fdta(2,2,:,iaa), sdjf%nrec(1,iaa) ) 
    409                   CALL lbc_lnk( 'fldread', sdjf%fdta(:,:,:,iaa),'T',1., kfillmode = jpfillcopy ) 
    410                ELSE 
    411                   CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, sdjf%fnow(2,2,:   ), sdjf%nrec(1,iaa) ) 
    412                   CALL lbc_lnk( 'fldread', sdjf%fnow(:,:,:   ),'T',1., kfillmode = jpfillcopy ) 
    413                ENDIF 
    414             ELSE 
    415                IF( sdjf%ln_tint ) THEN 
    416                   CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fdta(:,:,:,iaa), sdjf%nrec(1,iaa), kfill = jpfillcopy ) 
    417                ELSE 
    418                   CALL iom_get( sdjf%num, ipdom, sdjf%clvar, sdjf%fnow(:,:,:    ), sdjf%nrec(1,iaa), kfill = jpfillcopy ) 
    419                ENDIF 
    420             ENDIF 
    421          END SELECT 
     379         IF( iom_file( sdjf%num )%luld( idvar ) )   idmspc = idmspc - 1   ! id of the last spatial dimension 
     380         lmoor  = (  idmspc == 0 .OR. PRODUCT( iom_file( sdjf%num )%dimsz( 1:MAX(idmspc,1) ,idvar ) ) == ipk  )     
     381         ! 
     382         IF( lk_c1d .AND. lmoor ) THEN 
     383            CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, dta_alias(2,2,:), sdjf%nrec(1,iaa) )   ! jpdom_unknown -> no lbc_lnk 
     384            CALL lbc_lnk( 'fldread', dta_alias(:,:,:), 'T', 1., kfillmode = jpfillcopy ) 
     385         ELSE 
     386            CALL iom_get( sdjf%num,  jpdom_global, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   & 
     387               &          sdjf%cltype, sdjf%zsgn, kfill = jpfillcopy ) 
     388         ENDIF 
    422389      ENDIF 
    423390      ! 
     
    458425      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_z  ! work space local data requiring vertical interpolation 
    459426      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   zdta_read_dz ! work space local data requiring vertical interpolation 
    460       CHARACTER(LEN=1),DIMENSION(3)             ::   clgrid 
     427      CHARACTER(LEN=1),DIMENSION(3)             ::   cltype 
    461428      LOGICAL                                   ::   lluld        ! is the variable using the unlimited dimension 
    462429      LOGICAL                                   ::   llzint       ! local value of ldzint 
    463430      !!--------------------------------------------------------------------- 
    464431      ! 
    465       clgrid = (/'t','u','v'/) 
     432      cltype = (/'t','u','v'/) 
    466433      ! 
    467434      ipi = SIZE( pdta, 1 ) 
     
    498465         IF( ipkb /= ipk .OR. llzint ) THEN   ! boundary data not on model vertical grid : vertical interpolation 
    499466            ! 
    500             IF( ipk == jpk .AND. iom_varid(knum,'gdep'//clgrid(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//clgrid(kgrd)) /= -1 ) THEN 
     467            IF( ipk == jpk .AND. iom_varid(knum,'gdep'//cltype(kgrd)) /= -1 .AND. iom_varid(knum,'e3'//cltype(kgrd)) /= -1 ) THEN 
    501468                
    502469               ALLOCATE( zdta_read(ipi,ipj,ipkb), zdta_read_z(ipi,ipj,ipkb), zdta_read_dz(ipi,ipj,ipkb) ) 
    503470                 
    504471               CALL fld_map_core( zz_read, kmap, zdta_read ) 
    505                CALL iom_get ( knum, jpdom_unknown, 'gdep'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution? 
     472               CALL iom_get ( knum, jpdom_unknown, 'gdep'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution? 
    506473               CALL fld_map_core( zz_read, kmap, zdta_read_z ) 
    507                CALL iom_get ( knum, jpdom_unknown,   'e3'//clgrid(kgrd), zz_read )   ! read only once? Potential temporal evolution? 
     474               CALL iom_get ( knum, jpdom_unknown,   'e3'//cltype(kgrd), zz_read )   ! read only once? Potential temporal evolution? 
    508475               CALL fld_map_core( zz_read, kmap, zdta_read_dz ) 
    509476                
     
    515482               IF( ipk /= jpk ) CALL ctl_stop( 'fld_map : this should be an impossible case...' ) 
    516483               WRITE(ctmp1,*) 'fld_map : vertical interpolation for bdy variable '//TRIM(cdvar)//' requires '  
    517                IF( iom_varid(knum, 'gdep'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//clgrid(kgrd)//' variable' ) 
    518                IF( iom_varid(knum,   'e3'//clgrid(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//clgrid(kgrd)//' variable' ) 
     484               IF( iom_varid(knum, 'gdep'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//'gdep'//cltype(kgrd)//' variable' ) 
     485               IF( iom_varid(knum,   'e3'//cltype(kgrd)) == -1 ) CALL ctl_stop( ctmp1//  'e3'//cltype(kgrd)//' variable' ) 
    519486 
    520487            ENDIF 
     
    739706      CHARACTER (LEN=100)          ::   clcomp       ! dummy weight name 
    740707      REAL(wp), DIMENSION(jpi,jpj) ::   utmp, vtmp   ! temporary arrays for vector rotation 
     708      REAL(wp), DIMENSION(:,:,:), POINTER ::   dta_u, dta_v    ! short cut 
    741709      !!--------------------------------------------------------------------- 
    742710      ! 
     
    758726                  END DO 
    759727                  IF( iv > 0 ) THEN   ! fields ju and iv are two components which need to be rotated together 
     728                     IF( sd(ju)%ln_tint ) THEN   ;   dta_u => sd(ju)%fdta(:,:,:,jn)   ;   dta_v => sd(iv)%fdta(:,:,:,jn)  
     729                     ELSE                        ;   dta_u => sd(ju)%fnow(:,:,:   )   ;   dta_v => sd(iv)%fnow(:,:,:   ) 
     730                     ENDIF 
    760731                     DO jk = 1, SIZE( sd(ju)%fnow, 3 ) 
    761                         IF( sd(ju)%ln_tint )THEN 
    762                            CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->i', utmp(:,:) ) 
    763                            CALL rot_rep( sd(ju)%fdta(:,:,jk,jn), sd(iv)%fdta(:,:,jk,jn), 'T', 'en->j', vtmp(:,:) ) 
    764                            sd(ju)%fdta(:,:,jk,jn) = utmp(:,:)   ;   sd(iv)%fdta(:,:,jk,jn) = vtmp(:,:) 
    765                         ELSE  
    766                            CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->i', utmp(:,:) ) 
    767                            CALL rot_rep( sd(ju)%fnow(:,:,jk   ), sd(iv)%fnow(:,:,jk   ), 'T', 'en->j', vtmp(:,:) ) 
    768                            sd(ju)%fnow(:,:,jk   ) = utmp(:,:)   ;   sd(iv)%fnow(:,:,jk   ) = vtmp(:,:) 
    769                         ENDIF 
     732                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->i', utmp(:,:) ) 
     733                        CALL rot_rep( dta_u(:,:,jk), dta_v(:,:,jk), 'T', 'en->j', vtmp(:,:) ) 
     734                        dta_u(:,:,jk) = utmp(:,:)   ;   dta_v(:,:,jk) = vtmp(:,:) 
    770735                     END DO 
    771736                     sd(ju)%rotn(jn) = .TRUE.               ! vector was rotated  
     
    813778 
    814779      ! current file parameters 
    815       IF( sdjf%cltype(1:4) == 'week' ) THEN          ! find the day of the beginning of the current week 
    816          isecwk = ksec_week( sdjf%cltype(6:8) )     ! seconds between the beginning of the week and half of current time step 
    817          llprevmt = isecwk > nsec_month               ! longer time since beginning of the current week than the current month 
     780      IF( sdjf%clftyp(1:4) == 'week' ) THEN         ! find the day of the beginning of the current week 
     781         isecwk = ksec_week( sdjf%clftyp(6:8) )     ! seconds between the beginning of the week and half of current time step 
     782         llprevmt = isecwk > nsec_month             ! longer time since beginning of the current week than the current month 
    818783         llprevyr = llprevmt .AND. nmonth == 1 
    819784         iyr = nyear  - COUNT((/llprevyr/)) 
    820785         imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/)) 
    821786         idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec 
    822          isecwk = nsec_year - isecwk              ! seconds between 00h jan 1st of current year and current week beginning 
     787         isecwk = nsec_year - isecwk                ! seconds between 00h jan 1st of current year and current week beginning 
    823788      ELSE 
    824789         iyr = nyear 
     
    830795      ! previous file parameters 
    831796      IF( llprev ) THEN 
    832          IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of previous week 
    833             isecwk = isecwk + 7 * idaysec         ! seconds between the beginning of previous week and half of the time step 
    834             llprevmt = isecwk > nsec_month            ! longer time since beginning of the previous week than the current month 
     797         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of previous week 
     798            isecwk = isecwk + 7 * idaysec           ! seconds between the beginning of previous week and half of the time step 
     799            llprevmt = isecwk > nsec_month          ! longer time since beginning of the previous week than the current month 
    835800            llprevyr = llprevmt .AND. nmonth == 1 
    836801            iyr = nyear  - COUNT((/llprevyr/)) 
    837802            imt = nmonth - COUNT((/llprevmt/)) + 12 * COUNT((/llprevyr/)) 
    838803            idy = nday + nmonth_len(nmonth-1) * COUNT((/llprevmt/)) - isecwk / idaysec 
    839             isecwk = nsec_year - isecwk           ! seconds between 00h jan 1st of current year and previous week beginning 
     804            isecwk = nsec_year - isecwk             ! seconds between 00h jan 1st of current year and previous week beginning 
    840805         ELSE 
    841             idy = nday   - COUNT((/ sdjf%cltype == 'daily'                 /)) 
    842             imt = nmonth - COUNT((/ sdjf%cltype == 'monthly' .OR. idy == 0 /)) 
    843             iyr = nyear  - COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 0 /)) 
     806            idy = nday   - COUNT((/ sdjf%clftyp == 'daily'                 /)) 
     807            imt = nmonth - COUNT((/ sdjf%clftyp == 'monthly' .OR. idy == 0 /)) 
     808            iyr = nyear  - COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 0 /)) 
    844809            IF( idy == 0 ) idy = nmonth_len(imt) 
    845810            IF( imt == 0 ) imt = 12 
     
    850815      ! next file parameters 
    851816      IF( llnext ) THEN 
    852          IF( sdjf%cltype(1:4) == 'week'    ) THEN     ! find the day of the beginning of next week 
    853             isecwk = 7 * idaysec - isecwk         ! seconds between half of the time step and the beginning of next week 
     817         IF( sdjf%clftyp(1:4) == 'week'    ) THEN   ! find the day of the beginning of next week 
     818            isecwk = 7 * idaysec - isecwk           ! seconds between half of the time step and the beginning of next week 
    854819            llnextmt = isecwk > ( nmonth_len(nmonth)*idaysec - nsec_month )   ! larger than the seconds to the end of the month 
    855820            llnextyr = llnextmt .AND. nmonth == 12 
     
    857822            imt = nmonth + COUNT((/llnextmt/)) - 12 * COUNT((/llnextyr/)) 
    858823            idy = nday - nmonth_len(nmonth) * COUNT((/llnextmt/)) + isecwk / idaysec + 1 
    859             isecwk = nsec_year + isecwk           ! seconds between 00h jan 1st of current year and next week beginning 
     824            isecwk = nsec_year + isecwk             ! seconds between 00h jan 1st of current year and next week beginning 
    860825         ELSE 
    861             idy = nday   + COUNT((/ sdjf%cltype == 'daily'                                 /)) 
    862             imt = nmonth + COUNT((/ sdjf%cltype == 'monthly' .OR. idy > nmonth_len(nmonth) /)) 
    863             iyr = nyear  + COUNT((/ sdjf%cltype == 'yearly'  .OR. imt == 13                /)) 
     826            idy = nday   + COUNT((/ sdjf%clftyp == 'daily'                                 /)) 
     827            imt = nmonth + COUNT((/ sdjf%clftyp == 'monthly' .OR. idy > nmonth_len(nmonth) /)) 
     828            iyr = nyear  + COUNT((/ sdjf%clftyp == 'yearly'  .OR. imt == 13                /)) 
    864829            IF( idy > nmonth_len(nmonth) )   idy = 1 
    865830            IF( imt == 13                )   imt = 1 
     
    878843      IF    ( NINT(sdjf%freqh) == -12 ) THEN            ;   ireclast = 1    ! yearly mean: consider only 1 record 
    879844      ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                ! monthly mean: 
    880          IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record 
     845         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = 1    !  consider that the file has  1 record 
    881846         ELSE                                           ;   ireclast = 12   !  consider that the file has 12 record 
    882847         ENDIF 
    883848      ELSE                                                                  ! higher frequency mean (in hours) 
    884          IF(     sdjf%cltype      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh ) 
    885          ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh ) 
    886          ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh ) 
     849         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   ireclast = NINT( 24. * REAL(nmonth_len(indexmt), wp) / sdjf%freqh ) 
     850         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   ireclast = NINT( 24. * 7.                            / sdjf%freqh ) 
     851         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   ireclast = NINT( 24.                                 / sdjf%freqh ) 
    887852         ELSE                                           ;   ireclast = NINT( 24. * REAL( nyear_len(indexyr), wp) / sdjf%freqh ) 
    888853         ENDIF 
     
    902867         sdjf%nrecsec(1) = sdjf%nrecsec(0) + nyear_len( indexyr ) * idaysec 
    903868      ELSEIF( NINT(sdjf%freqh) ==  -1 ) THEN                                     ! monthly mean: 
    904          IF(     sdjf%cltype      == 'monthly' ) THEN                            !    monthly file 
     869         IF(     sdjf%clftyp      == 'monthly' ) THEN                            !    monthly file 
    905870            sdjf%nrecsec(0   ) = nsec1jan000 + nmonth_beg(indexmt  ) 
    906871            sdjf%nrecsec(1   ) = nsec1jan000 + nmonth_beg(indexmt+1) 
     
    910875         ENDIF 
    911876      ELSE                                                                       ! higher frequency mean (in hours) 
    912          IF(     sdjf%cltype      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) 
    913          ELSEIF( sdjf%cltype(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk 
    914          ELSEIF( sdjf%cltype      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec 
     877         IF(     sdjf%clftyp      == 'monthly' ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) 
     878         ELSEIF( sdjf%clftyp(1:4) == 'week'    ) THEN   ;   istart = nsec1jan000 + isecwk 
     879         ELSEIF( sdjf%clftyp      == 'daily'   ) THEN   ;   istart = nsec1jan000 + nmonth_beg(indexmt) + ( idy - 1 ) * idaysec 
    915880         ELSEIF( indexyr          == 0         ) THEN   ;   istart = nsec1jan000 - nyear_len( 0 ) * idaysec 
    916881         ELSEIF( indexyr          == 2         ) THEN   ;   istart = nsec1jan000 + nyear_len( 1 ) * idaysec 
     
    1008973         sdf(jf)%ln_tint    = sdf_n(jf)%ln_tint 
    1009974         sdf(jf)%ln_clim    = sdf_n(jf)%ln_clim 
    1010          sdf(jf)%cltype     = sdf_n(jf)%cltype 
     975         sdf(jf)%clftyp     = sdf_n(jf)%clftyp 
     976         sdf(jf)%cltype     = 'T'   ! by default don't do any call to lbc_lnk in iom_get 
     977         sdf(jf)%zsgn       = 1.    ! by default don't do change signe across the north fold 
    1011978         sdf(jf)%num        = -1 
    1012979         sdf(jf)%nbb        = 1  ! start with before data in 1 
     
    1018985         sdf(jf)%vcomp      = sdf_n(jf)%vcomp 
    1019986         sdf(jf)%rotn(:)    = .TRUE.   ! pretend to be rotated -> won't try to rotate data before the first call to fld_get 
    1020          IF( sdf(jf)%cltype(1:4) == 'week' .AND. nn_leapy == 0  )   & 
     987         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. nn_leapy == 0  )   & 
    1021988            &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs nn_leapy = 1') 
    1022          IF( sdf(jf)%cltype(1:4) == 'week' .AND. sdf(jf)%ln_clim )   & 
     989         IF( sdf(jf)%clftyp(1:4) == 'week' .AND. sdf(jf)%ln_clim )   & 
    1023990            &   CALL ctl_stop('fld_clopn: weekly file ('//TRIM(sdf(jf)%clrootname)//') needs ln_clim = .FALSE.') 
    1024991         sdf(jf)%nreclast   = -1 ! Set to non zero default value to avoid errors, is updated to meaningful value during fld_clopn 
     
    10461013            WRITE(numout,*) '         weights: '        , TRIM( sdf(jf)%wgtname    ),   & 
    10471014               &                  '   pairing: '        , TRIM( sdf(jf)%vcomp      ),   & 
    1048                &                  '   data type: '      ,       sdf(jf)%cltype      ,   & 
     1015               &                  '   data type: '      ,       sdf(jf)%clftyp      ,   & 
    10491016               &                  '   land/sea mask:'   , TRIM( sdf(jf)%lsmname    ) 
    10501017            call flush(numout) 
     
    12021169            CALL iom_get ( inum, jpdom_global, clname, data_tmp(:,:), cd_type = 'Z' )   !  no call to lbc_lnk 
    12031170            DO_2D_00_00 
    1204 !!$               isrc = NINT(data_tmp(ji,jj)) - 1 
    1205                isrc = INT(data_tmp(ji,jj)) - 1 
     1171               isrc = NINT(data_tmp(ji,jj)) - 1 
    12061172               ref_wgts(nxt_wgt)%data_jpi(ji,jj,jn) = 1 + MOD(isrc,  ref_wgts(nxt_wgt)%ddims(1)) 
    12071173               ref_wgts(nxt_wgt)%data_jpj(ji,jj,jn) = 1 +     isrc / ref_wgts(nxt_wgt)%ddims(1) 
     
    15891555      IF( .NOT. sdjf%ln_clim ) THEN    
    15901556                                         WRITE(clname, '(a,"_y",i4.4)' ) TRIM( sdjf%clrootname ), kyear    ! add year 
    1591          IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month 
     1557         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a, "m",i2.2)' ) TRIM( clname          ), kmonth   ! add month 
    15921558      ELSE 
    15931559         ! build the new filename if climatological data 
    1594          IF( sdjf%cltype /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month 
    1595       ENDIF 
    1596       IF(    sdjf%cltype == 'daily' .OR. sdjf%cltype(1:4) == 'week' ) & 
     1560         IF( sdjf%clftyp /= 'yearly' )   WRITE(clname, '(a,"_m",i2.2)' ) TRIM( sdjf%clrootname ), kmonth   ! add month 
     1561      ENDIF 
     1562      IF(    sdjf%clftyp == 'daily' .OR. sdjf%clftyp(1:4) == 'week' ) & 
    15971563         &                               WRITE(clname, '(a,"d" ,i2.2)' ) TRIM( clname          ), kday     ! add day 
    15981564 
     
    16181584         IF( cl_week(ijul) == TRIM(cdday) ) EXIT 
    16191585      END DO 
    1620       IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%cltype(6:8): '//TRIM(cdday) ) 
     1586      IF( ijul .GT. 7 )   CALL ctl_stop( 'ksec_week: wrong day for sdjf%clftyp(6:8): '//TRIM(cdday) ) 
    16211587      ! 
    16221588      ishift = ijul * NINT(rday) 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/SBC/sbcrnf.F90

    r12810 r12962  
    353353         rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 
    354354         IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year  
    355             IF( sn_dep_rnf%cltype == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
     355            IF( sn_dep_rnf%clftyp == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
    356356         ENDIF 
    357357         CALL iom_open ( rn_dep_file, inum )                             ! open file 
     
    518518      cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname ) 
    519519      IF( .NOT. sn_cnf%ln_clim ) THEN   ;   WRITE(cl_rnfile, '(a,"_y",i4)' ) TRIM( cl_rnfile ), nyear    ! add year 
    520          IF( sn_cnf%cltype == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month 
     520         IF( sn_cnf%clftyp == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month 
    521521      ENDIF 
    522522      ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/USR/usrdef_fmask.F90

    r12866 r12962  
    6868            ! 
    6969            IF(lwp) WRITE(numout,*) '      Gibraltar ' 
    70             ij0 = 101+1   ;   ij1 = 101+1           ! Gibraltar strait  : partial slip (pfmsk=0.5) 
    71             ii0 = 139   ;   ii1 = 140   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp 
    72             ij0 = 102+1   ;   ij1 = 102+1 
    73             ii0 = 139   ;   ii1 = 140   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp 
     70            ij0 = 101 + nn_hls       ;   ij1 = 101 + nn_hls           ! Gibraltar strait  : partial slip (pfmsk=0.5) 
     71            ii0 = 139 + nn_hls - 1   ;   ii1 = 140 + nn_hls - 1 
     72            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp 
     73            ij0 = 102 + nn_hls       ;   ij1 = 102 + nn_hls 
     74            ii0 = 139 + nn_hls - 1   ;   ii1 = 140 + nn_hls - 1 
     75            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  0.5_wp 
    7476            ! 
    7577            IF(lwp) WRITE(numout,*) '      Bab el Mandeb ' 
    76             ij0 =  87+1   ;   ij1 =  88+1           ! Bab el Mandeb : partial slip (pfmsk=1) 
    77             ii0 = 160   ;   ii1 = 160   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp 
    78             ij0 =  88+1   ;   ij1 =  88+1 
    79             ii0 = 159   ;   ii1 = 159   ;   pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp 
     78            ij0 =  87 + nn_hls       ;   ij1 =  88  + nn_hls          ! Bab el Mandeb : partial slip (pfmsk=1) 
     79            ii0 = 160  + nn_hls - 1  ;   ii1 = 160 + nn_hls - 1 
     80            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp 
     81            ij0 =  88 + nn_hls       ;   ij1 =  88 + nn_hls 
     82            ii0 = 159 + nn_hls - 1   ;   ii1 = 159 + nn_hls - 1 
     83            pfmsk( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 1:jpk ) =  1._wp 
    8084            ! 
    8185            ! We keep this as an example but it is instable in this case  
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OCE/ZDF/zdfiwm.F90

    r12510 r12962  
    139139      !!---------------------------------------------------------------------- 
    140140      ! 
    141       !                       !* Set to zero the 1st and last vertical levels of appropriate variables 
    142       zemx_iwm (:,:,1) = 0._wp   ;   zemx_iwm (:,:,jpk) = 0._wp 
    143       zav_ratio(:,:,1) = 0._wp   ;   zav_ratio(:,:,jpk) = 0._wp 
    144       zav_wave (:,:,1) = 0._wp   ;   zav_wave (:,:,jpk) = 0._wp 
     141      !                        
     142      ! Set to zero the 1st and last vertical levels of appropriate variables 
     143      IF( iom_use("emix_iwm") ) THEN 
     144         DO_2D_00_00 
     145            zemx_iwm (ji,jj,1) = 0._wp   ;   zemx_iwm (ji,jj,jpk) = 0._wp 
     146         END_2D 
     147         zemx_iwm (           1:nn_hls,:,:) = 0._wp   ;   zemx_iwm (:,           1:nn_hls,:) = 0._wp 
     148         zemx_iwm (jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zemx_iwm (:,jpj-nn_hls+1:   jpj,:) = 0._wp 
     149      ENDIF 
     150      IF( iom_use("av_ratio") ) THEN 
     151         DO_2D_00_00 
     152            zav_ratio(ji,jj,1) = 0._wp   ;   zav_ratio(ji,jj,jpk) = 0._wp 
     153         END_2D 
     154         zav_ratio(           1:nn_hls,:,:) = 0._wp   ;   zav_ratio(:,           1:nn_hls,:) = 0._wp 
     155         zav_ratio(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zav_ratio(:,jpj-nn_hls+1:   jpj,:) = 0._wp 
     156      ENDIF 
     157      IF( iom_use("av_wave") ) THEN 
     158         DO_2D_00_00 
     159            zav_wave (ji,jj,1) = 0._wp   ;   zav_wave (ji,jj,jpk) = 0._wp 
     160         END_2D 
     161         zav_wave(           1:nn_hls,:,:) = 0._wp   ;   zav_wave(:,           1:nn_hls,:) = 0._wp 
     162         zav_wave(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   zav_wave(:,jpj-nn_hls+1:   jpj,:) = 0._wp 
     163      ENDIF 
    145164      ! 
    146165      !                       ! ----------------------------- ! 
     
    150169      !                       !* Critical slope mixing: distribute energy over the time-varying ocean depth, 
    151170      !                                                 using an exponential decay from the seafloor. 
    152       DO_2D_11_11 
     171      DO_2D_00_00 
    153172         zhdep(ji,jj) = gdepw_0(ji,jj,mbkt(ji,jj)+1)       ! depth of the ocean 
    154173         zfact(ji,jj) = rho0 * (  1._wp - EXP( -zhdep(ji,jj) / hcri_iwm(ji,jj) )  ) 
     
    156175      END_2D 
    157176!!gm gde3w ==>>>  check for ssh taken into account.... seem OK gde3w_n=gdept(:,:,:,Kmm) - ssh(:,:,Kmm) 
    158       DO_3D_11_11( 2, jpkm1 ) 
     177      DO_3D_00_00( 2, jpkm1 ) 
    159178         IF ( zfact(ji,jj) == 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization 
    160179            zemx_iwm(ji,jj,jk) = 0._wp 
     
    176195      CASE ( 1 )               ! Dissipation scales as N (recommended) 
    177196         ! 
    178          zfact(:,:) = 0._wp 
    179          DO jk = 2, jpkm1              ! part independent of the level 
    180             zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
    181          END DO 
    182          ! 
    183          DO_2D_11_11 
     197         DO_2D_00_00 
     198            zfact(ji,jj) = 0._wp 
     199         END_2D 
     200         DO_3D_00_00( 2, jpkm1 )       ! part independent of the level 
     201            zfact(ji,jj) = zfact(ji,jj) + e3w(ji,jj,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk) 
     202         END_3D 
     203         ! 
     204         DO_2D_00_00 
    184205            IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_iwm(ji,jj) / ( rho0 * zfact(ji,jj) ) 
    185206         END_2D 
    186207         ! 
    187          DO jk = 2, jpkm1              ! complete with the level-dependent part 
    188             zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zfact(:,:) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
    189          END DO 
     208         DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part 
     209            zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zfact(ji,jj) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk) 
     210         END_3D 
    190211         ! 
    191212      CASE ( 2 )               ! Dissipation scales as N^2 
    192213         ! 
    193          zfact(:,:) = 0._wp 
    194          DO jk = 2, jpkm1              ! part independent of the level 
    195             zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
    196          END DO 
    197          ! 
    198          DO_2D_11_11 
     214         DO_2D_00_00 
     215            zfact(ji,jj) = 0._wp 
     216         END_2D 
     217         DO_3D_00_00( 2, jpkm1 )       ! part independent of the level 
     218            zfact(ji,jj) = zfact(ji,jj) + e3w(ji,jj,jk,Kmm) * MAX( 0._wp, rn2(ji,jj,jk) ) * wmask(ji,jj,jk) 
     219         END_3D 
     220         ! 
     221         DO_2D_00_00 
    199222            IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = epyc_iwm(ji,jj) / ( rho0 * zfact(ji,jj) ) 
    200223         END_2D 
    201224         ! 
    202          DO jk = 2, jpkm1              ! complete with the level-dependent part 
    203             zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zfact(:,:) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
    204          END DO 
     225         DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part 
     226            zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zfact(ji,jj) * MAX( 0._wp, rn2(ji,jj,jk) ) * wmask(ji,jj,jk) 
     227         END_3D 
    205228         ! 
    206229      END SELECT 
     
    209232      !                        !* ocean depth as proportional to rn2 * exp(-z_wkb/rn_hbot) 
    210233      ! 
    211       zwkb (:,:,:) = 0._wp 
    212       zfact(:,:)   = 0._wp 
    213       DO jk = 2, jpkm1 
    214          zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
    215          zwkb(:,:,jk) = zfact(:,:) 
    216       END DO 
    217 !!gm even better: 
    218 !      DO jk = 2, jpkm1 
    219 !         zwkb(:,:) = zwkb(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) 
    220 !      END DO 
    221 !      zfact(:,:) = zwkb(:,:,jpkm1) 
    222 !!gm or just use zwkb(k=jpk-1) instead of zfact... 
    223 !!gm 
    224       ! 
    225       DO_3D_11_11( 2, jpkm1 ) 
     234      DO_2D_00_00 
     235         zwkb(ji,jj,1) = 0._wp 
     236      END_2D 
     237      DO_3D_00_00( 2, jpkm1 ) 
     238         zwkb(ji,jj,jk) = zwkb(ji,jj,jk-1) + e3w(ji,jj,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(ji,jj,jk) )  ) * wmask(ji,jj,jk) 
     239      END_3D 
     240      DO_2D_00_00 
     241         zfact(ji,jj) = zwkb(ji,jj,jpkm1) 
     242      END_2D 
     243      ! 
     244      DO_3D_00_00( 2, jpkm1 ) 
    226245         IF( zfact(ji,jj) /= 0 )   zwkb(ji,jj,jk) = zhdep(ji,jj) * ( zfact(ji,jj) - zwkb(ji,jj,jk) )   & 
    227246            &                                     * wmask(ji,jj,jk) / zfact(ji,jj) 
    228247      END_3D 
    229       zwkb(:,:,1) = zhdep(:,:) * wmask(:,:,1) 
    230       ! 
    231       DO_3D_11_11( 2, jpkm1 ) 
    232          IF ( rn2(ji,jj,jk) <= 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization 
     248      DO_2D_00_00 
     249         zwkb (ji,jj,1) = zhdep(ji,jj) * wmask(ji,jj,1) 
     250      END_2D 
     251      ! 
     252      DO_3D_00_00( 2, jpkm1 ) 
     253         IF ( rn2(ji,jj,jk) <= 0._wp .OR. wmask(ji,jj,jk) == 0._wp ) THEN   ! optimization: EXP coast a lot 
    233254            zweight(ji,jj,jk) = 0._wp 
    234255         ELSE 
     
    238259      END_3D 
    239260      ! 
    240       zfact(:,:) = 0._wp 
    241       DO jk = 2, jpkm1              ! part independent of the level 
    242          zfact(:,:) = zfact(:,:) + zweight(:,:,jk) 
    243       END DO 
    244       ! 
    245       DO_2D_11_11 
     261      DO_2D_00_00 
     262         zfact(ji,jj) = 0._wp 
     263      END_2D 
     264      DO_3D_00_00( 2, jpkm1 )       ! part independent of the level 
     265         zfact(ji,jj) = zfact(ji,jj) + zweight(ji,jj,jk) 
     266      END_3D 
     267      ! 
     268      DO_2D_00_00 
    246269         IF( zfact(ji,jj) /= 0 )   zfact(ji,jj) = ebot_iwm(ji,jj) / ( rho0 * zfact(ji,jj) ) 
    247270      END_2D 
    248271      ! 
    249       DO jk = 2, jpkm1              ! complete with the level-dependent part 
    250          zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zweight(:,:,jk) * zfact(:,:) * wmask(:,:,jk)   & 
    251             &                                / ( gde3w(:,:,jk) - gde3w(:,:,jk-1) ) 
    252 !!gm  use of e3t(:,:,:,Kmm) just above? 
    253       END DO 
     272      DO_3D_00_00( 2, jpkm1 )       ! complete with the level-dependent part 
     273         zemx_iwm(ji,jj,jk) = zemx_iwm(ji,jj,jk) + zweight(ji,jj,jk) * zfact(ji,jj) * wmask(ji,jj,jk)   & 
     274            &                                                        / ( gde3w(ji,jj,jk) - gde3w(ji,jj,jk-1) ) 
     275!!gm  use of e3t(ji,jj,:,Kmm) just above? 
     276      END_3D 
    254277      ! 
    255278!!gm  this is to be replaced by just a constant value znu=1.e-6 m2/s 
    256279      ! Calculate molecular kinematic viscosity 
    257       znu_t(:,:,:) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * ts(:,:,:,jp_tem,Kmm) + 0.00694_wp * ts(:,:,:,jp_tem,Kmm) * ts(:,:,:,jp_tem,Kmm)  & 
    258          &                                  + 0.02305_wp * ts(:,:,:,jp_sal,Kmm)  ) * tmask(:,:,:) * r1_rho0 
    259       DO jk = 2, jpkm1 
    260          znu_w(:,:,jk) = 0.5_wp * ( znu_t(:,:,jk-1) + znu_t(:,:,jk) ) * wmask(:,:,jk) 
    261       END DO 
     280      DO_3D_00_00( 1, jpkm1 ) 
     281         znu_t(ji,jj,jk) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * ts(ji,jj,jk,jp_tem,Kmm)   & 
     282            &                                     + 0.00694_wp * ts(ji,jj,jk,jp_tem,Kmm) * ts(ji,jj,jk,jp_tem,Kmm)  & 
     283            &                                     + 0.02305_wp * ts(ji,jj,jk,jp_sal,Kmm)  ) * tmask(ji,jj,jk) * r1_rho0 
     284      END_3D 
     285      DO_3D_00_00( 2, jpkm1 ) 
     286         znu_w(ji,jj,jk) = 0.5_wp * ( znu_t(ji,jj,jk-1) + znu_t(ji,jj,jk) ) * wmask(ji,jj,jk) 
     287      END_3D 
    262288!!gm end 
    263289      ! 
    264290      ! Calculate turbulence intensity parameter Reb 
    265       DO jk = 2, jpkm1 
    266          zReb(:,:,jk) = zemx_iwm(:,:,jk) / MAX( 1.e-20_wp, znu_w(:,:,jk) * rn2(:,:,jk) ) 
    267       END DO 
     291      DO_3D_00_00( 2, jpkm1 ) 
     292         zReb(ji,jj,jk) = zemx_iwm(ji,jj,jk) / MAX( 1.e-20_wp, znu_w(ji,jj,jk) * rn2(ji,jj,jk) ) 
     293      END_3D 
    268294      ! 
    269295      ! Define internal wave-induced diffusivity 
    270       DO jk = 2, jpkm1 
    271          zav_wave(:,:,jk) = znu_w(:,:,jk) * zReb(:,:,jk) * r1_6   ! This corresponds to a constant mixing efficiency of 1/6 
    272       END DO 
     296      DO_3D_00_00( 2, jpkm1 ) 
     297         zav_wave(ji,jj,jk) = znu_w(ji,jj,jk) * zReb(ji,jj,jk) * r1_6   ! This corresponds to a constant mixing efficiency of 1/6 
     298      END_3D 
    273299      ! 
    274300      IF( ln_mevar ) THEN              ! Variable mixing efficiency case : modify zav_wave in the 
    275          DO_3D_11_11( 2, jpkm1 ) 
     301         DO_3D_00_00( 2, jpkm1 ) 
    276302            IF( zReb(ji,jj,jk) > 480.00_wp ) THEN 
    277303               zav_wave(ji,jj,jk) = 3.6515_wp * znu_w(ji,jj,jk) * SQRT( zReb(ji,jj,jk) ) 
     
    282308      ENDIF 
    283309      ! 
    284       DO jk = 2, jpkm1                 ! Bound diffusivity by molecular value and 100 cm2/s 
    285          zav_wave(:,:,jk) = MIN(  MAX( 1.4e-7_wp, zav_wave(:,:,jk) ), 1.e-2_wp  ) * wmask(:,:,jk) 
    286       END DO 
     310      DO_3D_00_00( 2, jpkm1 )          ! Bound diffusivity by molecular value and 100 cm2/s 
     311         zav_wave(ji,jj,jk) = MIN(  MAX( 1.4e-7_wp, zav_wave(ji,jj,jk) ), 1.e-2_wp  ) * wmask(ji,jj,jk) 
     312      END_3D 
    287313      ! 
    288314      IF( kt == nit000 ) THEN        !* Control print at first time-step: diagnose the energy consumed by zav_wave 
    289315         zztmp = 0._wp 
    290316!!gm used of glosum 3D.... 
    291          DO_3D_11_11( 2, jpkm1 ) 
     317         DO_3D_00_00( 2, jpkm1 ) 
    292318            zztmp = zztmp + e3w(ji,jj,jk,Kmm) * e1e2t(ji,jj)   & 
    293319               &          * MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) 
     
    311337      IF( ln_tsdiff ) THEN          !* Option for differential mixing of salinity and temperature 
    312338         ztmp1 = 0.505_wp + 0.495_wp * TANH( 0.92_wp * ( LOG10( 1.e-20_wp ) - 0.60_wp ) ) 
    313          DO_3D_11_11( 2, jpkm1 ) 
     339         DO_3D_00_00( 2, jpkm1 ) 
    314340            ztmp2 = zReb(ji,jj,jk) * 5._wp * r1_6 
    315341            IF ( ztmp2 > 1.e-20_wp .AND. wmask(ji,jj,jk) == 1._wp ) THEN 
     
    320346         END_3D 
    321347         CALL iom_put( "av_ratio", zav_ratio ) 
    322          DO jk = 2, jpkm1           !* update momentum & tracer diffusivity with wave-driven mixing 
    323             p_avs(:,:,jk) = p_avs(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk) 
    324             p_avt(:,:,jk) = p_avt(:,:,jk) + zav_wave(:,:,jk) 
    325             p_avm(:,:,jk) = p_avm(:,:,jk) + zav_wave(:,:,jk) 
    326          END DO 
     348         DO_3D_00_00( 2, jpkm1 )    !* update momentum & tracer diffusivity with wave-driven mixing 
     349            p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_wave(ji,jj,jk) * zav_ratio(ji,jj,jk) 
     350            p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_wave(ji,jj,jk) 
     351            p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_wave(ji,jj,jk) 
     352         END_3D 
    327353         ! 
    328354      ELSE                          !* update momentum & tracer diffusivity with wave-driven mixing 
    329          DO jk = 2, jpkm1 
    330             p_avs(:,:,jk) = p_avs(:,:,jk) + zav_wave(:,:,jk) 
    331             p_avt(:,:,jk) = p_avt(:,:,jk) + zav_wave(:,:,jk) 
    332             p_avm(:,:,jk) = p_avm(:,:,jk) + zav_wave(:,:,jk) 
    333          END DO 
     355         DO_3D_00_00( 2, jpkm1 ) 
     356            p_avs(ji,jj,jk) = p_avs(ji,jj,jk) + zav_wave(ji,jj,jk) 
     357            p_avt(ji,jj,jk) = p_avt(ji,jj,jk) + zav_wave(ji,jj,jk) 
     358            p_avm(ji,jj,jk) = p_avm(ji,jj,jk) + zav_wave(ji,jj,jk) 
     359         END_3D 
    334360      ENDIF 
    335361 
     
    341367      IF( iom_use("bflx_iwm") .OR. iom_use("pcmap_iwm") ) THEN 
    342368         ALLOCATE( z2d(jpi,jpj) , z3d(jpi,jpj,jpk) ) 
    343          z3d(:,:,:) = MAX( 0._wp, rn2(:,:,:) ) * zav_wave(:,:,:) 
    344          z2d(:,:) = 0._wp 
    345          DO jk = 2, jpkm1 
    346             z2d(:,:) = z2d(:,:) + e3w(:,:,jk,Kmm) * z3d(:,:,jk) * wmask(:,:,jk) 
    347          END DO 
    348          z2d(:,:) = rho0 * z2d(:,:) 
    349          CALL iom_put( "bflx_iwm", z3d ) 
     369         ! Initialisation for iom_put 
     370         DO_2D_00_00 
     371            z3d(ji,jj,1) = 0._wp   ;   z3d(ji,jj,jpk) = 0._wp 
     372         END_2D 
     373         z3d(           1:nn_hls,:,:) = 0._wp   ;   z3d(:,           1:nn_hls,:) = 0._wp 
     374         z3d(jpi-nn_hls+1:jpi   ,:,:) = 0._wp   ;   z3d(:,jpj-nn_hls+1:   jpj,:) = 0._wp 
     375         z2d(           1:nn_hls,:  ) = 0._wp   ;   z2d(:,           1:nn_hls  ) = 0._wp 
     376         z2d(jpi-nn_hls+1:jpi   ,:  ) = 0._wp   ;   z2d(:,jpj-nn_hls+1:   jpj  ) = 0._wp 
     377 
     378         DO_3D_00_00( 2, jpkm1 ) 
     379            z3d(ji,jj,jk) = MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) 
     380         END_3D 
     381         DO_2D_00_00 
     382            z2d(ji,jj) = 0._wp 
     383         END_2D 
     384         DO_3D_00_00( 2, jpkm1 )  
     385            z2d(ji,jj) = z2d(ji,jj) + e3w(ji,jj,jk,Kmm) * z3d(ji,jj,jk) * wmask(ji,jj,jk) 
     386         END_3D 
     387         DO_2D_00_00 
     388            z2d(ji,jj) = rho0 * z2d(ji,jj) 
     389         END_2D 
     390         CALL iom_put(  "bflx_iwm", z3d ) 
    350391         CALL iom_put( "pcmap_iwm", z2d ) 
    351392         DEALLOCATE( z2d , z3d ) 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OFF/dtadyn.F90

    r12866 r12962  
    6565   INTEGER  , SAVE      ::   jf_uwd         ! index of u-transport 
    6666   INTEGER  , SAVE      ::   jf_vwd         ! index of v-transport 
    67    INTEGER  , SAVE      ::   jf_wwd         ! index of v-transport 
     67   INTEGER  , SAVE      ::   jf_wwd         ! index of w-transport 
    6868   INTEGER  , SAVE      ::   jf_avt         ! index of Kz 
    6969   INTEGER  , SAVE      ::   jf_mld         ! index of mixed layer deptht 
     
    283283      !                                         ! fill sf with slf_i and control print 
    284284      CALL fld_fill( sf_dyn, slf_d, cn_dir, 'dta_dyn_init', 'Data in file', 'namdta_dyn' ) 
     285      sf_dyn(jf_uwd)%cltype = 'U'   ;   sf_dyn(jf_uwd)%zsgn = -1._wp   
     286      sf_dyn(jf_vwd)%cltype = 'V'   ;   sf_dyn(jf_vwd)%zsgn = -1._wp   
     287      sf_dyn(jf_ubl)%cltype = 'U'   ;   sf_dyn(jf_ubl)%zsgn =  1._wp   
     288      sf_dyn(jf_vbl)%cltype = 'V'   ;   sf_dyn(jf_vbl)%zsgn =  1._wp   
    285289      ! 
    286290      ! Open file for each variable to get his number of dimension 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/OFF/nemogcm.F90

    r12958 r12962  
    278278      ! 
    279279      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
    280          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     280         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    281281      ELSE                                ! user-defined namelist 
    282          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     282         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    283283      ENDIF 
    284284      ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/SAO/nemogcm.F90

    r12958 r12962  
    207207      ! 
    208208      IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file 
    209          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     209         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    210210      ELSE                              ! user-defined namelist 
    211          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     211         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    212212      ENDIF 
    213213      ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/SAS/nemogcm.F90

    r12958 r12962  
    329329      ! 
    330330      IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file 
    331          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     331         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    332332      ELSE                              ! user-defined namelist 
    333          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     333         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    334334      ENDIF 
    335335      ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/SAS/sbcssm.F90

    r12958 r12962  
    290290            !                                         ! fill sf with slf_i and control print 
    291291            CALL fld_fill( sf_ssm_3d, slf_3d, cn_dir, 'sbc_ssm_init', '3D Data in file', 'namsbc_ssm' ) 
     292            sf_ssm_3d(jf_usp)%cltype = 'U'   ;   sf_ssm_3d(jf_usp)%zsgn = -1._wp 
     293            sf_ssm_3d(jf_vsp)%cltype = 'V'   ;   sf_ssm_3d(jf_vsp)%zsgn = -1._wp 
    292294         ENDIF 
    293295         ! 
     
    306308            ! 
    307309            CALL fld_fill( sf_ssm_2d, slf_2d, cn_dir, 'sbc_ssm_init', '2D Data in file', 'namsbc_ssm' ) 
     310            IF( .NOT. ln_3d_uve ) THEN 
     311               sf_ssm_2d(jf_usp)%cltype = 'U'   ;   sf_ssm_2d(jf_usp)%zsgn = -1._wp 
     312               sf_ssm_2d(jf_vsp)%cltype = 'V'   ;   sf_ssm_2d(jf_vsp)%zsgn = -1._wp 
     313            ENDIF 
    308314         ENDIF 
    309315         ! 
  • NEMO/branches/UKMO/dev_r12866_HPC-02_Daley_Tiling_trial_extra_halo/src/TOP/trcini.F90

    r12377 r12962  
    9393      INTEGER             ::  jk, jn  ! dummy loop indices 
    9494      CHARACTER (len=25) :: charout 
     95      REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: zzmsk 
     96      CHARACTER (len=25), DIMENSION(jptra) :: clseb   
    9597      !!---------------------------------------------------------------------- 
    9698      ! 
     
    128130         CALL prt_ctl_trc_info( charout ) 
    129131         CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kmm), mask=tmask, clinfo=ctrcnm ) 
     132         DO jn = 1, jptra 
     133            zzmsk(:,:,:,jn) = tmask(:,:,:) 
     134            WRITE(clseb(jn),'(a,i2.2)') 'seb ', jn 
     135         END DO 
     136         CALL prt_ctl_trc( tab4d=zzmsk, mask=tmask, clinfo=clseb ) 
    130137      ENDIF 
    1311389000  FORMAT('      tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
Note: See TracChangeset for help on using the changeset viewer.