Changeset 440 for IOIPSL/trunk/src/mathelp.f90
- Timestamp:
- 11/26/08 11:58:38 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/mathelp.f90
r386 r440 10 10 !- 11 11 PRIVATE 12 PUBLIC :: mathop,moycum, trans_buff,buildop12 PUBLIC :: mathop,moycum,buildop 13 13 !- 14 14 INTERFACE mathop … … 3113 3113 END SUBROUTINE moycum 3114 3114 !=== 3115 SUBROUTINE trans_buff (ox,sx,oy,sy,oz,sz,xsz,ysz,zsz,v3d,sl,v1d)3116 !---------------------------------------------------------------------3117 !- This subroutine extracts from the full 3D variable the slab of3118 !- data that will be used later. Perhaps there are hardware routines3119 !- for this task on some computers. This routine will be obsolete in3120 !- a F90 environnement3121 !-3122 !-sc V1d = reshape(V3id (ox:ox-1+sx,oy:oy-1+sy,oz:oz-1+sz),3123 !-sc SHAPE= (/sx*sy*sz/) )3124 !-3125 !- INPUT3126 !- ox : Origin of slab of data in X3127 !- sx : Size of slab in X3128 !- oy : Origin of slab of data in Y3129 !- sy : Size of slab in Y3130 !- oz : Origin of slab of data in Z3131 !- sz : Size of slab in Z3132 !- xsz,ysz,zsz : 3 sizes of full variable v3d3133 !- v3d : The full 3D variable3134 !- sl : size of variable v1d3135 !- v1d : The 1D variable containing the slab3136 !-3137 !- VERSION3138 !-3139 !---------------------------------------------------------------------3140 IMPLICIT NONE3141 !-3142 INTEGER :: ox,sx,oy,sy,oz,sz3143 INTEGER :: xsz,ysz,zsz3144 INTEGER :: sl3145 REAL :: v3d(xsz,ysz,zsz)3146 REAL :: v1d(sl)3147 !-3148 INTEGER :: ix,iy,iz,ic3149 !---------------------------------------------------------------------3150 !-3151 ! We have to consider the case where the zoom starts at (1,1,1)3152 ! but does not go over the full size.3153 !-3154 IF ( (ox .EQ. 1).AND.(oy.EQ. 1).AND.(oz.EQ. 1) &3155 & .AND.(sx .EQ. xsz).AND.(sy .EQ. ysz).AND.(sz .EQ. zsz) ) THEN3156 DO ic=1,MAX(sx,1)*MAX(sy,1)*MAX(sz,1)3157 v1d(ic) = v3d(ic,1,1)3158 ENDDO3159 ELSE IF ( (ox .EQ. 1).AND.(oy .EQ. 1) &3160 & .AND.(sx .EQ. xsz).AND.(sy .EQ. ysz)) THEN3161 DO iz=oz,(oz-1+sz)3162 DO ic=1,MAX(sx,1)*MAX(sy,1)3163 v1d(ic) = v3d(ic,1,iz)3164 ENDDO3165 ENDDO3166 ELSE3167 ic = 03168 DO iz=oz,(oz-1+sz)3169 DO iy=oy,(oy-1+sy)3170 DO ix=ox,(ox-1+sx)3171 ic = ic+13172 v1d(ic) = v3d(ix, iy, iz)3173 ENDDO3174 ENDDO3175 ENDDO3176 ENDIF3177 !------------------------3178 END SUBROUTINE trans_buff3179 !===3180 3115 !----------------- 3181 3116 END MODULE mathelp
Note: See TracChangeset
for help on using the changeset viewer.