Changeset 2949 for branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90
- Timestamp:
- 2011-10-18T10:49:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90
r2948 r2949 51 51 nmesh ! number of cells in processor domain 52 52 INTEGER :: itest , jtest ! dummy integer 53 REAL(wp),SAVE :: zdistmesh ! Taller cell of the mesh in ocean in degrees54 53 REAL(wp) :: & 55 54 zdistEst , zdistNorth , zdistWest , zdistSouth , &! temporary scalars … … 105 104 EstPoint = POINT_SECTION( -1, -1 ) ; WestPoint = POINT_SECTION( -1, -1 ) 106 105 107 IF( jsec == 1 )THEN108 !Find the taller cell of the mesh in ocean (used in compsec),109 !unit= degrees110 zdistmesh=0.111 DO jj=2,jpj112 DO ji=2,jpi113 IF( zdistmesh .LT. &114 (e1t(ji,jj)/(cos(gphit(ji,jj))*110000)) ) THEN115 zdistmesh = e1t(ji,jj)/(cos(gphit(ji,jj))*110000)116 ENDIF117 ENDDO118 ENDDO119 120 ENDIF121 122 !debug123 WRITE(cltmp,'(A10,f10.3)')'zdistmesh = ',zdistmesh124 CALL write_debug(jsec,cltmp)125 126 106 !===========================================================! 127 107 !I. Find which cells of the mesh the section is crossing ! … … 157 137 zdeltaj= gphif(ji,jj-1) - gphif(ji-1,jj-1) !zdeltaj=[AD] 158 138 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 184 161 185 186 187 188 189 190 191 192 193 194 195 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 196 173 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 206 181 ENDIF 207 182 … … 302 277 zdistFirst = distance2(coord_t,coordFirst) 303 278 zdistLast = distance2(coord_t,coordLast) 304 IF( zdistFirst .LT. zdist mesh .AND. zdistFirst .LT. zdistante )THEN279 IF( zdistFirst .LT. zdistante )THEN 305 280 sec%listPoint(1) = POINT_SECTION(ji,jj) 306 281 zdistante=zdistFirst 307 282 ENDIF 308 IF( zdistLast .LT. zdist mesh .AND. zdistLast .LT. zdistante2 )THEN283 IF( zdistLast .LT. zdistante2 )THEN 309 284 endingPoint = POINT_SECTION(ji,jj) 310 285 zdistante2=zdistLast … … 478 453 ! (test: ABS(coordTemp%lon - coordLast%lon).GT. 180) 479 454 ! 480 ! If on of th is 4 lines crosses the date line, we have to add 360° its481 ! extremities longitudes to compute the correctdistance through the date line482 ! 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. 483 458 484 459 ! c.1 compute distWest: distance between west point and endingPoint
Note: See TracChangeset
for help on using the changeset viewer.