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 13370 for vendors/AGRIF/dev_r12970_AGRIF_CMEMS – NEMO

Ignore:
Timestamp:
2020-07-31T11:00:33+02:00 (4 years ago)
Author:
jchanut
Message:

#2222, changes to allow less vertical levels over child grid than parent

Location:
vendors/AGRIF/dev_r12970_AGRIF_CMEMS/AGRIF_FILES
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vendors/AGRIF/dev_r12970_AGRIF_CMEMS/AGRIF_FILES/modarrays.F90

    r13027 r13370  
    133133! 
    134134!=================================================================================================== 
    135 subroutine Agrif_get_var_global_bounds( var, lubglob, nbdim ) 
    136 !--------------------------------------------------------------------------------------------------- 
    137     type(Agrif_Variable),        intent(in)  :: var 
     135subroutine Agrif_get_var_global_bounds( var, lubglob, nbdim, pvar ) 
     136!--------------------------------------------------------------------------------------------------- 
     137    type(Agrif_Variable),          intent(in)  :: var 
     138    type(Agrif_Variable),optional, intent(in)  :: pvar 
    138139    integer, dimension(nbdim,2), intent(out) :: lubglob 
    139140    integer,                     intent(in)  :: nbdim 
     
    147148! 
    148149#if !defined AGRIF_MPI 
    149     call Agrif_get_var_bounds_array(var, lubglob(:,1), lubglob(:,2), nbdim) 
     150    if (present(pvar)) then 
     151      call Agrif_get_var_bounds_array(var, lubglob(:,1), lubglob(:,2), nbdim, pvar) 
     152    else 
     153      call Agrif_get_var_bounds_array(var, lubglob(:,1), lubglob(:,2), nbdim) 
     154    endif 
    150155#else 
    151     call Agrif_get_var_bounds_array(var, lb, ub, nbdim) 
     156    if (present(pvar)) then 
     157      call Agrif_get_var_bounds_array(var, lb, ub, nbdim, pvar) 
     158    else 
     159      call Agrif_get_var_bounds_array(var, lb, ub, nbdim) 
     160    endif 
    152161 
    153162    do i = 1,nbdim 
     
    171180!> Gets the lower and the upper boundaries of a variable, for one particular direction. 
    172181!--------------------------------------------------------------------------------------------------- 
    173 subroutine Agrif_get_var_bounds ( variable, lower, upper, index ) 
    174 !--------------------------------------------------------------------------------------------------- 
    175     type(Agrif_Variable), intent(in)    :: variable   !< Variable for which we want to extract boundaries 
     182!  subroutine Agrif_get_var_bounds 
     183! 
     184!> Gets the lower and the upper boundaries of a variable, for one particular direction. 
     185!--------------------------------------------------------------------------------------------------- 
     186subroutine Agrif_get_var_bounds ( variable, lower, upper, index, pvariable ) 
     187!--------------------------------------------------------------------------------------------------- 
     188    type(Agrif_Variable),           intent(in)    :: variable   !< Variable for which we want to extract boundaries 
     189    type(Agrif_Variable), optional, intent(in)    :: pvariable   !< parent Variable for which we want to extract boundaries 
    176190    integer,              intent(out)   :: lower      !< Lower bound 
    177191    integer,              intent(out)   :: upper      !< Upper bound 
    178192    integer,              intent(in)    :: index      !< Direction for wich we want to know the boundaries 
    179193! 
    180     lower = variable % lb(index) 
    181     upper = variable % ub(index) 
     194 
     195 
     196    if (present(pvariable)) then 
     197     if (variable%root_var%interptab(index) == 'N') then 
     198        lower = pvariable%lb(index) 
     199        upper = pvariable%ub(index) 
     200      endif 
     201    else 
     202      lower = variable % lb(index) 
     203      upper = variable % ub(index)       
     204    endif 
     205 
    182206!--------------------------------------------------------------------------------------------------- 
    183207end subroutine Agrif_get_var_bounds 
     
    189213!> Gets the lower and the upper boundaries of a table. 
    190214!--------------------------------------------------------------------------------------------------- 
    191 subroutine Agrif_get_var_bounds_array ( variable, lower, upper, nbdim ) 
    192 !--------------------------------------------------------------------------------------------------- 
    193     type(Agrif_Variable),      intent(in)   :: variable   !< Variable for which we want to extract boundaries 
     215subroutine Agrif_get_var_bounds_array ( variable, lower, upper, nbdim, pvariable ) 
     216!--------------------------------------------------------------------------------------------------- 
     217    type(Agrif_Variable),               intent(in)   :: variable   !< Variable for which we want to extract boundaries 
     218    type(Agrif_Variable), optional,     intent(in)   :: pvariable   !< Parent Variable for which we want to extract boundaries 
    194219    integer, dimension(nbdim), intent(out)  :: lower      !< Lower bounds array 
    195220    integer, dimension(nbdim), intent(out)  :: upper      !< Upper bounds array 
    196221    integer, intent(in)                     :: nbdim      !< Numer of dimensions of the variable 
    197222! 
     223    integer :: nb 
     224 
    198225    lower = variable % lb(1:nbdim) 
    199226    upper = variable % ub(1:nbdim) 
     227 
     228    if (present(pvariable)) then 
     229        do nb=1,nbdim 
     230            if (variable%root_var%interptab(nb) == 'N') then 
     231                lower(nb) = pvariable%lb(nb) 
     232                upper(nb) = pvariable%ub(nb) 
     233            endif 
     234        enddo 
     235    endif 
    200236!--------------------------------------------------------------------------------------------------- 
    201237end subroutine Agrif_get_var_bounds_array 
  • vendors/AGRIF/dev_r12970_AGRIF_CMEMS/AGRIF_FILES/modbc.F90

    r13027 r13370  
    188188    END WHERE 
    189189! 
    190     call Agrif_get_var_global_bounds(child,lubglob,nbdim) 
     190    call Agrif_get_var_global_bounds(child,lubglob,nbdim,parent) 
    191191! 
    192192    indtruetab(1:nbdim,1,1) = max(indtab(1:nbdim,1,1), lubglob(1:nbdim,1)) 
     
    229229! 
    230230#if defined AGRIF_MPI 
    231                 call Agrif_get_var_bounds_array(child,lower,upper,nbdim) 
     231                call Agrif_get_var_bounds_array(child,lower,upper,nbdim,parent) 
    232232 
    233233                do i = 1,nbdim 
  • vendors/AGRIF/dev_r12970_AGRIF_CMEMS/AGRIF_FILES/modinterp.F90

    r13144 r13370  
    199199    if (.not.find_list_interp) then 
    200200! 
    201         call Agrif_get_var_bounds_array(child, lowerbound, upperbound, nbdim) 
     201        call Agrif_get_var_bounds_array(child, lowerbound, upperbound, nbdim, parent) 
    202202        call Agrif_Childbounds(nbdim, lowerbound, upperbound,               & 
    203203                               pttab, petab, Agrif_Procrank, coords,        & 
     
    968968            end select 
    969969! 
    970             call Agrif_get_var_bounds_array(child,lowerbound,upperbound,nbdim) 
     970            call Agrif_get_var_bounds_array(child,lowerbound,upperbound,nbdim,parent) 
    971971 
    972972#if defined AGRIF_MPI 
Note: See TracChangeset for help on using the changeset viewer.