|
◆ 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 3156 del file volgrid6d_class.F90.
3161 end subroutine vg6d_c2a_grid 3164 subroutine vg6d_c2a_mat(this,cgrid) 3166 type(volgrid6d), intent(inout) :: this 3167 integer, intent(in) :: cgrid 3169 INTEGER :: i, j, k, iv, stallo 3170 REAL, ALLOCATABLE :: tmp_arr(:,:) 3171 REAL, POINTER :: voldatiuv(:,:) 3174 IF (cgrid == 0) RETURN 3175 IF (cgrid /= 1 .AND. cgrid /= 2) THEN 3176 CALL l4f_category_log(this%category,l4f_fatal, "C grid type "// & 3177 trim( to_char(cgrid))// " not known") 3183 ALLOCATE(tmp_arr(this%griddim%dim%nx, this%griddim%dim%ny),stat=stallo) 3185 call l4f_log(l4f_fatal, "allocating memory") 3186 call raise_fatal_error() 3190 IF (.NOT. ASSOCIATED(this%voldati)) THEN 3191 ALLOCATE(voldatiuv(this%griddim%dim%nx, this%griddim%dim%ny), stat=stallo 3192 IF (stallo /= 0) THEN 3193 CALL l4f_log(l4f_fatal, "allocating memory") 3194 CALL raise_fatal_error() 3198 IF (cgrid == 1) THEN 3199 DO iv = 1, SIZE(this%var) 3200 DO k = 1, SIZE(this%timerange) 3201 DO j = 1, SIZE(this%time) 3202 DO i = 1, SIZE(this%level) 3203 tmp_arr(:,:) = rmiss 3204 CALL volgrid_get_vol_2d(this, i, j, k, iv, voldatiuv) 3207 WHERE(voldatiuv(1,:) /= rmiss .AND. voldatiuv(2,:) /= rmiss) 3208 tmp_arr(1,:) = voldatiuv(1,:) - (voldatiuv(2,:) - voldatiuv( 3212 WHERE(voldatiuv(1:this%griddim%dim%nx-1,:) /= rmiss .AND. & 3213 voldatiuv(2:this%griddim%dim%nx,:) /= rmiss) 3214 tmp_arr(2:this%griddim%dim%nx,:) = & 3215 (voldatiuv(1:this%griddim%dim%nx-1,:) + & 3216 voldatiuv(2:this%griddim%dim%nx,:)) / 2. 3219 voldatiuv(:,:) = tmp_arr 3220 CALL volgrid_set_vol_2d(this, i, j, k, iv, voldatiuv) 3226 ELSE IF (cgrid == 2) THEN 3227 DO iv = 1, SIZE(this%var) 3228 DO k = 1, SIZE(this%timerange) 3229 DO j = 1, SIZE(this%time) 3230 DO i = 1, SIZE(this%level) 3231 tmp_arr(:,:) = rmiss 3232 CALL volgrid_get_vol_2d(this, i, j, k, iv, voldatiuv) 3235 WHERE(voldatiuv(:,1) /= rmiss .AND. voldatiuv(:,2) /= rmiss) 3236 tmp_arr(:,1) = voldatiuv(:,1) - (voldatiuv(:,2) - voldatiuv( 3240 WHERE(voldatiuv(:,1:this%griddim%dim%ny-1) /= rmiss .AND. & 3241 voldatiuv(:,2:this%griddim%dim%ny) /= rmiss) 3242 tmp_arr(:,2:this%griddim%dim%ny) = & 3243 (voldatiuv(:,1:this%griddim%dim%ny-1) + & 3244 voldatiuv(:,2:this%griddim%dim%ny)) / 2. 3247 voldatiuv(:,:) = tmp_arr 3248 CALL volgrid_set_vol_2d(this, i, j, k, iv, voldatiuv) 3255 IF (.NOT. ASSOCIATED(this%voldati)) THEN 3256 DEALLOCATE(voldatiuv) 3258 DEALLOCATE (tmp_arr) 3260 end subroutine vg6d_c2a_mat 3266 subroutine display_volgrid6d (this) 3268 TYPE(volgrid6d), intent(in) :: this 3275 print*, "----------------------- volgrid6d display ---------------------" 3278 IF ( ASSOCIATED(this%time)) then 3279 print*, "---- time vector ----" Restituiscono il valore dell'oggetto in forma di stringa stampabile.
|