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 1200 for trunk/AGRIF/AGRIF_FILES/modupdate.F – NEMO

Ignore:
Timestamp:
2008-09-24T15:05:20+02:00 (16 years ago)
Author:
rblod
Message:

Adapt Agrif to the new SBC and correct several bugs for agrif (restart writing and reading), see ticket #133
Note : this fix does not work yet on NEC computerq (sxf90/360)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AGRIF/AGRIF_FILES/modupdate.F

    r898 r1200  
    6868      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    6969      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    70       INTEGER :: deb,fin                      ! Positions where interpolations  
     70      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    7171                                              ! are done on the fine grid        
    7272      External :: procname 
     
    8686C       
    8787C     Values on the current grid used for the update 
    88       childtemp % var % array1 => tab      
     88      childtemp % var % array1 => tab 
     89       
     90      childtemp % var % lb = child % var % lb 
     91      childtemp % var % ub = child % var % ub              
    8992       
    9093C      childtemp % var % list_update => child%var%list_update 
     
    129132      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    130133      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    131       INTEGER :: deb,fin                      ! Positions where interpolations  
     134      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    132135                                              ! are done on the fine grid  
    133136                                               
     
    151154C       
    152155C     Values on the current grid used for the update 
    153       childtemp % var % array2 => tab       
     156      childtemp % var % array2 => tab  
     157       
     158      childtemp % var % lb = child % var % lb 
     159      childtemp % var % ub = child % var % ub              
    154160       
    155161C      childtemp % var % list_update => child%var%list_update       
     
    191197      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    192198      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    193       INTEGER :: deb,fin                      ! Positions where interpolations  
     199      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    194200                                              ! are done on the fine grid     
    195201      External :: procname 
     
    215221      childtemp % var % array3 => tab      
    216222       
     223      childtemp % var % lb = child % var % lb 
     224      childtemp % var % ub = child % var % ub   
     225             
     226       
    217227C      childtemp % var % list_update => child%var%list_update       
    218228C 
     
    253263      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    254264      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    255       INTEGER :: deb,fin                      ! Positions where interpolations  
     265      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    256266                                              ! are done on the fine grid      
    257267      External :: procname 
     
    277287      childtemp % var % array4 => tab      
    278288       
     289      childtemp % var % lb = child % var % lb 
     290      childtemp % var % ub = child % var % ub   
     291             
     292       
    279293C      childtemp % var % list_update => child%var%list_update 
    280294             
     
    316330      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    317331      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    318       INTEGER :: deb,fin                      ! Positions where interpolations  
     332      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    319333                                              ! are done on the fine grid      
    320334      External :: procname 
     
    342356      childtemp % var % array5 => tab       
    343357       
     358      childtemp % var % lb = child % var % lb 
     359      childtemp % var % ub = child % var % ub         
     360       
    344361C      childtemp % var % list_update => child%var%list_update       
    345362C 
     
    381398      TYPE(AGRIF_PVariable) :: child         ! Variable on the child grid 
    382399      TYPE(AGRIF_PVariable) :: childtemp     ! Temporary variable on the child 
    383       INTEGER :: deb,fin                      ! Positions where interpolations  
     400      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    384401                                              ! are done on the fine grid        
    385402      REAL, DIMENSION( 
     
    404421C     Values on the current grid used for the update 
    405422      childtemp % var % array6 => tab       
     423       
     424      childtemp % var % lb = child % var % lb 
     425      childtemp % var % ub = child % var % ub   
     426             
    406427C      childtemp % var % list_update => child%var%list_update 
    407428C 
     
    439460      TYPE(AGRIF_PVariable) :: parent   ! Variable on the parent grid 
    440461      TYPE(AGRIF_PVariable) :: child    ! Variable on the child grid  
    441       INTEGER               :: deb,fin  ! Positions where boundary conditions 
     462      INTEGER, DIMENSION(6) :: deb,fin       ! Positions where interpolations  
    442463                                        !    are calculated      
    443464      External :: procname 
     
    532553 
    533554      wholeupdate = .FALSE. 
    534  
    535       IF ((deb == -99) .AND. (deb == fin)) THEN 
    536        wholeupdate = .TRUE. 
    537       ENDIF 
    538  
    539       IF ((deb > fin)) THEN 
    540        wholeupdate = .TRUE. 
    541       ENDIF 
     555       
     556      do n=1,nbdim 
     557      if (loctab_child(n) /= -3) then 
     558        if (deb(n)>fin(n)) wholeupdate = .TRUE. 
     559        if ((deb(n) == -99).AND.(deb(n)==fin(n))) wholeupdate=.TRUE. 
     560      endif 
     561      enddo 
    542562      
    543563       IF (present(procname)) THEN 
     
    620640      TYPE(AGRIF_PVariable)    :: child              ! Variable on the child 
    621641                                                     !    grid  
    622       INTEGER :: deb, fin 
     642      INTEGER, DIMENSION(6) :: deb, fin 
    623643      INTEGER                  :: nbdim              ! Number of dimensions of 
    624644                                                     !    the grid variable 
     
    677697        ENDIF 
    678698 
    679         IF (deb > fin) THEN 
    680           debloc = deb 
    681           finloc = finloc - deb 
     699        IF (deb(i) > fin(i)) THEN 
     700          debloc = deb(i) 
     701          finloc = finloc - deb(i) 
    682702        ENDIF 
    683703 
     
    810830      TYPE(AGRIF_PVariable)    :: child              ! Variable on the child 
    811831                                                     !   grid  
    812       INTEGER                  :: deb,fin            ! Positions where 
    813                                                      !   interpolations are done 
     832      INTEGER, DIMENSION(6) :: deb, fin 
    814833      INTEGER                  :: nbdim              ! Number of dimensions of 
    815834                                                     !   the grid variable 
     
    859878      DO i = 1, nbdim 
    860879        coeffraf = nint(ds_Parent(i)/ds_Child(i)) 
    861         indtab(i,1,1) = pttab_child(i) + (deb + 1) * coeffraf 
    862         indtab(i,1,2) = pttab_child(i) + (fin + 1) * coeffraf 
     880        indtab(i,1,1) = pttab_child(i) + (deb(i) + 1) * coeffraf 
     881        indtab(i,1,2) = pttab_child(i) + (fin(i) + 1) * coeffraf 
    863882 
    864883        indtab(i,2,1) = pttab_child(i) + nbtab_child(i) 
    865      &    - (fin + 1) *  coeffraf 
     884     &    - (fin(i) + 1) *  coeffraf 
    866885        indtab(i,2,2) = pttab_child(i) + nbtab_child(i) 
    867      &    - (deb + 1) *  coeffraf 
     886     &    - (deb(i) + 1) *  coeffraf 
    868887 
    869888        IF (posvartab_child(i) == 1) THEN 
Note: See TracChangeset for help on using the changeset viewer.