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 2949 for branches/2011/dev_r2802_MERCATOR10_diadct – NEMO

Ignore:
Timestamp:
2011-10-18T10:49:04+02:00 (12 years ago)
Author:
cbricaud
Message:

corrections

Location:
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90

    r2948 r2949  
    5151        nmesh                    ! number of cells in processor domain 
    5252     INTEGER :: itest , jtest    ! dummy integer 
    53      REAL(wp),SAVE :: zdistmesh  ! Taller cell of the mesh in ocean in degrees 
    5453     REAL(wp)      :: & 
    5554        zdistEst   , zdistNorth , zdistWest , zdistSouth ,  &! temporary scalars 
     
    105104     EstPoint    = POINT_SECTION( -1, -1 ) ; WestPoint   = POINT_SECTION( -1, -1 ) 
    106105 
    107      IF( jsec == 1 )THEN 
    108         !Find the taller cell of the mesh in ocean (used in compsec),  
    109         !unit= degrees  
    110         zdistmesh=0. 
    111         DO jj=2,jpj 
    112            DO ji=2,jpi 
    113               IF( zdistmesh .LT. & 
    114                  (e1t(ji,jj)/(cos(gphit(ji,jj))*110000))  ) THEN 
    115                  zdistmesh = e1t(ji,jj)/(cos(gphit(ji,jj))*110000) 
    116               ENDIF 
    117            ENDDO 
    118         ENDDO 
    119      
    120      ENDIF 
    121  
    122      !debug 
    123      WRITE(cltmp,'(A10,f10.3)')'zdistmesh = ',zdistmesh 
    124      CALL write_debug(jsec,cltmp) 
    125  
    126106     !===========================================================!     
    127107     !I. Find which cells of the mesh the section is  crossing  ! 
     
    157137           zdeltaj= gphif(ji,jj-1) - gphif(ji-1,jj-1) !zdeltaj=[AD] 
    158138            
    159            IF( ABS(zdeltai) .LE. 2.*zdistmesh .OR.  &  
    160                ABS(zdeltaj) .LE. 2.*zdistmesh )THEN            
    161    
    162               !intersection section/[AB]=? 
    163               coordTemp     = intersec(sec,coord_a,coord_b)     !compute intersection  
    164   
    165               IF( coordTemp%lon .NE. -9999 )THEN 
    166                  IF( nb_inmesh+1 .GT. nb_point_max )THEN 
    167                     PRINT*,"WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh 
    168                  ELSE     
    169                     nb_inmesh=nb_inmesh+1               
    170                     coordSec(nb_inmesh) = coordTemp    !store the intersection's coordinates 
    171  
    172                     !We need to know if the section crosses the overlapping band. 
    173  
    174                     !Fist we look if there is an intersection mesh/section  
    175                     !just on the left of the overlapping band:  
    176                     IF( coordTemp%lon .GT. glamf(1,1)-5  .AND. coordTemp%lon .LT. glamf(1,1) ) &  
    177                        & ll_overlap_sec_left  = .TRUE. 
    178                     !And we look if there is an intersection mesh/section  
    179                     !just on the right of the overlapping band: 
    180                     IF( coordTemp%lon .GT. glamf(jpi,1) .AND. coordTemp%lon .LT. glamf(1,1)+5 ) & 
    181                        & ll_overlap_sec_right = .TRUE. 
    182                  ENDIF 
    183               ENDIF 
     139           !intersection section/[AB]=? 
     140           coordTemp     = intersec(sec,coord_a,coord_b)     !compute intersection  
     141  
     142           IF( coordTemp%lon .NE. -9999 )THEN 
     143              IF( nb_inmesh+1 .GT. nb_point_max )THEN 
     144                 PRINT*,"WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh 
     145              ELSE     
     146                 nb_inmesh=nb_inmesh+1               
     147                 coordSec(nb_inmesh) = coordTemp    !store the intersection's coordinates 
     148 
     149                 !We need to know if the section crosses the overlapping band. 
     150 
     151                 !Fist we look if there is an intersection mesh/section  
     152                 !just on the left of the overlapping band:  
     153                 IF( coordTemp%lon .GT. glamf(1,1)-5  .AND. coordTemp%lon .LT. glamf(1,1) ) &  
     154                    & ll_overlap_sec_left  = .TRUE. 
     155                 !And we look if there is an intersection mesh/section  
     156                 !just on the right of the overlapping band: 
     157                 IF( coordTemp%lon .GT. glamf(jpi,1) .AND. coordTemp%lon .LT. glamf(1,1)+5 ) & 
     158                    & ll_overlap_sec_right = .TRUE. 
     159              ENDIF 
     160           ENDIF 
    184161               
    185               !intersection section/[AD]=? 
    186               coordTemp=intersec(sec,coord_a,coord_d)       !compute intersection 
    187               coordTemp%lon = coordTemp%lon !* zmask(ji,jj)-9999.*(1-zmask(ji,jj)) 
    188               coordTemp%lat = coordTemp%lat !* zmask(ji,jj)-9999.*(1-zmask(ji,jj)) 
    189  
    190               IF( coordTemp%lon .NE. -9999 )THEN 
    191                  IF( nb_inmesh+1 .GT. nb_point_max )THEN 
    192                     PRINT*, "WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh 
    193                  ELSE   
    194                     nb_inmesh=nb_inmesh+1 
    195                     coordSec(nb_inmesh)=coordTemp 
     162           !intersection section/[AD]=? 
     163           coordTemp=intersec(sec,coord_a,coord_d)       !compute intersection 
     164           coordTemp%lon = coordTemp%lon !* zmask(ji,jj)-9999.*(1-zmask(ji,jj)) 
     165           coordTemp%lat = coordTemp%lat !* zmask(ji,jj)-9999.*(1-zmask(ji,jj)) 
     166 
     167           IF( coordTemp%lon .NE. -9999 )THEN 
     168              IF( nb_inmesh+1 .GT. nb_point_max )THEN 
     169                 PRINT*, "WARNING diadct: nb_point_max needs to be greater than ", nb_inmesh 
     170              ELSE   
     171                 nb_inmesh=nb_inmesh+1 
     172                 coordSec(nb_inmesh)=coordTemp 
    196173                    
    197                     !We need to know if the section crosses the overlapping band: 
    198                     !same test as above  
    199                     IF( coordTemp%lon .GE. glamf(1,1)-3  .AND. coordTemp%lon .LE. glamf(1,1) ) & 
    200                          & ll_overlap_sec_left  = .TRUE. 
    201                     IF( coordTemp%lon .GE. glamf(jpi,1) .AND. coordTemp%lon .LE. glamf(jpi,1)+3) &  
    202                          & ll_overlap_sec_right = .TRUE.  
    203                  ENDIF 
    204               ENDIF 
    205   
     174                 !We need to know if the section crosses the overlapping band: 
     175                 !same test as above  
     176                 IF( coordTemp%lon .GE. glamf(1,1)-3  .AND. coordTemp%lon .LE. glamf(1,1) ) & 
     177                      & ll_overlap_sec_left  = .TRUE. 
     178                 IF( coordTemp%lon .GE. glamf(jpi,1) .AND. coordTemp%lon .LE. glamf(jpi,1)+3) &  
     179                      & ll_overlap_sec_right = .TRUE.  
     180              ENDIF 
    206181           ENDIF 
    207182          
     
    302277              zdistFirst = distance2(coord_t,coordFirst) 
    303278              zdistLast = distance2(coord_t,coordLast) 
    304               IF( zdistFirst .LT. zdistmesh .AND. zdistFirst .LT. zdistante )THEN 
     279              IF( zdistFirst .LT. zdistante )THEN 
    305280                 sec%listPoint(1) = POINT_SECTION(ji,jj) 
    306281                 zdistante=zdistFirst 
    307282              ENDIF 
    308               IF( zdistLast .LT. zdistmesh .AND. zdistLast .LT. zdistante2 )THEN 
     283              IF( zdistLast .LT. zdistante2 )THEN 
    309284                 endingPoint = POINT_SECTION(ji,jj) 
    310285                 zdistante2=zdistLast 
     
    478453              ! (test: ABS(coordTemp%lon - coordLast%lon).GT. 180) 
    479454              ! 
    480               ! If on of this 4 lines  crosses the date line, we have to add 360° its  
    481               ! extremities longitudes to compute the correct distance through the date line 
    482               ! and not around the Earth 
     455              ! If on of these lines crosses , we have to add 360° to the longitudes of the  
     456              ! extremities to compute the distance through the date line 
     457              ! and not around the Earth. 
    483458        
    484459              ! c.1 compute distWest: distance between west point and endingPoint 
  • branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90

    r2948 r2949  
    306306              zX = sec%coordSec(1)%lon 
    307307              zY = za2 * zX + zb2 
    308           ELSE IF ( za2 == 1.e20) THEN ! Case X=constante 
     308          ELSE IF ( za2 == 1.e20) THEN ! Case X=constant 
    309309              zX = coord_b%lon 
    310310              zY = za1 * zX + zb1 
Note: See TracChangeset for help on using the changeset viewer.