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 8787 for branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90 – NEMO

Ignore:
Timestamp:
2017-11-22T15:38:33+01:00 (7 years ago)
Author:
clem
Message:

for BDY purposes, add the possibility to have a number of categories at the lateral boundaries different than the number of categories in the regional domain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8183_ICEMODEL/NEMOGCM/NEMO/OPA_SRC/BDY/bdydta.F90

    r8563 r8787  
    4848 
    4949#if defined key_lim3 
    50    LOGICAL :: ll_bdylim3                  ! determine whether ice input is 1cat (F) or Xcat (T) type 
     50   INTEGER :: nice_cat                    ! number of categories in the input file 
    5151   INTEGER :: jfld_hti, jfld_hts, jfld_ai ! indices of ice thickness, snow thickness and concentration in bf structure 
    5252#endif 
     
    175175 
    176176#if defined key_lim3 
    177             IF( nn_ice_lim_dta(ib_bdy) == 0 ) THEN  
     177            IF( nn_ice_lim_dta(ib_bdy) == 0 ) THEN ! set ice to initial values 
    178178               ilen1(:) = nblen(:) 
    179179               IF( dta%ll_a_i ) THEN 
     
    343343               ENDIF 
    344344#if defined key_lim3 
    345                IF( .NOT. ll_bdylim3 .AND. cn_ice_lim(ib_bdy) /= 'none' .AND. nn_ice_lim_dta(ib_bdy) == 1 ) THEN ! bdy ice input (case input is 1cat) 
    346                 CALL ice_var_itd ( bf(jfld_hti)%fnow(:,1,1), bf(jfld_hts)%fnow(:,1,1), bf(jfld_ai)%fnow(:,1,1), & 
    347                                   & dta_bdy(ib_bdy)%h_i,     dta_bdy(ib_bdy)%h_s,     dta_bdy(ib_bdy)%a_i     ) 
     345               IF( cn_ice_lim(ib_bdy) /= 'none' .AND. nn_ice_lim_dta(ib_bdy) == 1 ) THEN 
     346                  IF( nice_cat == 1 ) THEN ! case input cat = 1 
     347                     CALL ice_var_itd ( bf(jfld_hti)%fnow(:,1,1), bf(jfld_hts)%fnow(:,1,1), bf(jfld_ai)%fnow(:,1,1), & 
     348                        &               dta_bdy(ib_bdy)%h_i     , dta_bdy(ib_bdy)%h_s     , dta_bdy(ib_bdy)%a_i    ) 
     349                  ELSEIF( nice_cat /= 1 .AND. nice_cat /= jpl ) THEN ! case input cat /=1 and /=jpl 
     350                     CALL ice_var_itd2( bf(jfld_hti)%fnow(:,1,:), bf(jfld_hts)%fnow(:,1,:), bf(jfld_ai)%fnow(:,1,:), & 
     351                        &               dta_bdy(ib_bdy)%h_i     , dta_bdy(ib_bdy)%h_s     , dta_bdy(ib_bdy)%a_i    ) 
     352                  ENDIF 
    348353               ENDIF 
    349354#endif 
     
    413418      TYPE(OBC_DATA), POINTER                ::   dta           ! short cut 
    414419#if defined key_lim3 
    415       INTEGER               ::   zndims   ! number of dimensions in an array (i.e. 3 = wo ice cat; 4 = w ice cat) 
     420      INTEGER               ::   kndims   ! number of dimensions in an array (i.e. 3 = wo ice cat; 4 = w ice cat) 
     421      INTEGER, DIMENSION(4) ::   kdimsz   ! size   of dimensions 
    416422      INTEGER               ::   inum,id1 ! local integer 
    417423#endif 
     
    619625               ! 
    620626               CALL iom_open  ( clname, inum ) 
    621                id1 = iom_varid( inum, bn_a_i%clvar, kndims=zndims, ldstop = .FALSE. ) 
     627               id1 = iom_varid( inum, bn_a_i%clvar, kdimsz=kdimsz, kndims=kndims, ldstop = .FALSE. ) 
    622628               CALL iom_close ( inum ) 
    623629 
    624                 IF ( zndims == 4 ) THEN 
    625                  ll_bdylim3 = .TRUE.   ! Xcat input 
     630                IF ( kndims == 4 ) THEN 
     631                 nice_cat = kdimsz(4)   ! Xcat input 
    626632               ELSE 
    627                  ll_bdylim3 = .FALSE.  ! 1cat input       
     633                 nice_cat = 1           ! 1cat input       
    628634               ENDIF 
    629635               ! End test 
     
    632638                  jfld = jfld + 1 
    633639                  blf_i(jfld) = bn_a_i 
    634                   ibdy(jfld) = ib_bdy 
     640                  ibdy(jfld)  = ib_bdy 
    635641                  igrid(jfld) = 1 
    636642                  ilen1(jfld) = nblen(igrid(jfld)) 
    637                   IF ( ll_bdylim3 ) THEN ; ilen3(jfld)=jpl ; ELSE ; ilen3(jfld)=1 ; ENDIF 
     643                  ilen3(jfld) = nice_cat 
    638644               ENDIF 
    639645 
     
    641647                  jfld = jfld + 1 
    642648                  blf_i(jfld) = bn_h_i 
    643                   ibdy(jfld) = ib_bdy 
     649                  ibdy(jfld)  = ib_bdy 
    644650                  igrid(jfld) = 1 
    645651                  ilen1(jfld) = nblen(igrid(jfld)) 
    646                   IF ( ll_bdylim3 ) THEN ; ilen3(jfld)=jpl ; ELSE ; ilen3(jfld)=1 ; ENDIF 
     652                  ilen3(jfld) = nice_cat 
    647653               ENDIF 
    648654 
    649655               IF( dta%ll_h_s ) THEN 
    650656                  jfld = jfld + 1 
    651                    blf_i(jfld) = bn_h_s 
    652                   ibdy(jfld) = ib_bdy 
     657                  blf_i(jfld) = bn_h_s 
     658                  ibdy(jfld)  = ib_bdy 
    653659                  igrid(jfld) = 1 
    654660                  ilen1(jfld) = nblen(igrid(jfld)) 
    655                   IF ( ll_bdylim3 ) THEN ; ilen3(jfld)=jpl ; ELSE ; ilen3(jfld)=1 ; ENDIF 
     661                  ilen3(jfld) = nice_cat 
    656662               ENDIF 
    657663 
     
    789795               ALLOCATE( dta_bdy(ib_bdy)%h_s(nblen(1),jpl) ) 
    790796            ELSE 
    791                IF ( ll_bdylim3 ) THEN ! case input is Xcat 
     797               IF ( nice_cat == jpl ) THEN ! case input cat = jpl 
    792798                  jfld = jfld + 1 
    793799                  dta_bdy(ib_bdy)%a_i => bf(jfld)%fnow(:,1,:) 
     
    796802                  jfld = jfld + 1 
    797803                  dta_bdy(ib_bdy)%h_s => bf(jfld)%fnow(:,1,:) 
    798                ELSE ! case input is 1cat 
     804               ELSE                        ! case input cat = 1 OR (/=1 and /=jpl) 
    799805                  jfld_ai  = jfld + 1 
    800806                  jfld_hti = jfld + 2 
Note: See TracChangeset for help on using the changeset viewer.