|
|
◆ vg6d_c2a()
| subroutine, public volgrid6d_class::vg6d_c2a |
( |
type(volgrid6d), dimension(:), intent(inout) |
this | ) |
|
Convert grids type C to type A.
Use this to interpolate data from grid type C to grid type A Grids type are defined by Arakawa.
We need to find these types of area in a vg6d array T area of points with temterature etc. U area of points with u components of winds V area of points with v components of winds
this method works if it finds two volumes: 1) volume U and volume V: compute H and traslate on it 2) volume U/V and volume H : translate U/V on H three volumes: translate U and V on H
try to work well on more datasets at once
- Parametri
-
| [in,out] | this | vettor of volumes volgrid6d to elaborate |
Definizione alla linea 3205 del file volgrid6d_class.F90.
3205 step_lat=(ymax-ymin)/dble(this%griddim%dim%ny-1) 3206 ymin=ymin-step_lat/2.d0 3207 ymax=ymax-step_lat/2.d0 3208 call set_val(this%griddim, ymin=ymin, ymax=ymax) 3210 CALL griddim_setsteps(this%griddim) 3214 call l4f_category_log(this%category,l4f_fatal, "C grid type not known") 3215 call raise_fatal_error () 3222 call griddim_unproj(this%griddim) 3225 end subroutine vg6d_c2a_grid 3228 subroutine vg6d_c2a_mat(this,cgrid) 3230 type(volgrid6d), intent(inout) :: this 3231 integer, intent(in) :: cgrid 3233 INTEGER :: i, j, k, iv, stallo 3234 REAL, ALLOCATABLE :: tmp_arr(:,:) 3235 REAL, POINTER :: voldatiuv(:,:) 3238 IF (cgrid == 0) RETURN 3239 IF (cgrid /= 1 .AND. cgrid /= 2) THEN 3240 CALL l4f_category_log(this%category,l4f_fatal, "C grid type "// & 3241 trim(to_char(cgrid))// " not known") 3247 ALLOCATE(tmp_arr(this%griddim%dim%nx, this%griddim%dim%ny),stat=stallo) 3249 call l4f_log(l4f_fatal, "allocating memory") 3250 call raise_fatal_error() 3254 IF (.NOT. ASSOCIATED(this%voldati)) THEN 3255 ALLOCATE(voldatiuv(this%griddim%dim%nx, this%griddim%dim%ny), stat=stallo) 3256 IF (stallo /= 0) THEN 3257 CALL l4f_log(l4f_fatal, "allocating memory") 3258 CALL raise_fatal_error() 3262 IF (cgrid == 1) THEN 3263 DO iv = 1, SIZE(this%var) 3264 DO k = 1, SIZE(this%timerange) 3265 DO j = 1, SIZE(this%time) 3266 DO i = 1, SIZE(this%level) 3267 tmp_arr(:,:) = rmiss 3268 CALL volgrid_get_vol_2d(this, i, j, k, iv, voldatiuv) 3271 WHERE(voldatiuv(1,:) /= rmiss .AND. voldatiuv(2,:) /= rmiss) 3272 tmp_arr(1,:) = voldatiuv(1,:) - (voldatiuv(2,:) - voldatiuv(1,:)) / 2. 3276 WHERE(voldatiuv(1:this%griddim%dim%nx-1,:) /= rmiss .AND. & 3277 voldatiuv(2:this%griddim%dim%nx,:) /= rmiss) 3278 tmp_arr(2:this%griddim%dim%nx,:) = & 3279 (voldatiuv(1:this%griddim%dim%nx-1,:) + & 3280 voldatiuv(2:this%griddim%dim%nx,:)) / 2. 3283 voldatiuv(:,:) = tmp_arr 3284 CALL volgrid_set_vol_2d(this, i, j, k, iv, voldatiuv) 3290 ELSE IF (cgrid == 2) THEN 3291 DO iv = 1, SIZE(this%var) 3292 DO k = 1, SIZE(this%timerange) 3293 DO j = 1, SIZE(this%time) 3294 DO i = 1, SIZE(this%level) 3295 tmp_arr(:,:) = rmiss 3296 CALL volgrid_get_vol_2d(this, i, j, k, iv, voldatiuv) 3299 WHERE(voldatiuv(:,1) /= rmiss .AND. voldatiuv(:,2) /= rmiss) 3300 tmp_arr(:,1) = voldatiuv(:,1) - (voldatiuv(:,2) - voldatiuv(:,1)) / 2. 3304 WHERE(voldatiuv(:,1:this%griddim%dim%ny-1) /= rmiss .AND. & 3305 voldatiuv(:,2:this%griddim%dim%ny) /= rmiss) 3306 tmp_arr(:,2:this%griddim%dim%ny) = & 3307 (voldatiuv(:,1:this%griddim%dim%ny-1) + & 3308 voldatiuv(:,2:this%griddim%dim%ny)) / 2. 3311 voldatiuv(:,:) = tmp_arr 3312 CALL volgrid_set_vol_2d(this, i, j, k, iv, voldatiuv) 3319 IF (.NOT. ASSOCIATED(this%voldati)) THEN 3320 DEALLOCATE(voldatiuv) 3322 DEALLOCATE (tmp_arr) 3324 end subroutine vg6d_c2a_mat
|