Changeset 3910
 Timestamp:
 Apr 17, 2019 11:46:56 AM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/virtual_measurement_mod.f90
r3904 r3910 25 25 !  26 26 ! $Id$ 27 ! Bugfix in rotation of UTM coordinates 28 ! 29 ! 3904 20190416 18:22:51Z gronemeier 27 30 ! Rotate coordinates of stations by given rotation_angle 28 31 ! … … 465 468 REAL(wp) :: fill_zag !< _FillValue for height coordinate 466 469 467 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e_utm !< easting UTM coordinate, temporary variable 468 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: n_utm !< northing UTM coordinate, temporary variable, 469 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: z_ag !< height coordinate relative to origin_z, temporary variable 470 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e_utm !< easting UTM coordinate, temporary variable 471 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: n_utm !< northing UTM coordinate, temporary variable 472 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: e_utm_tmp !< EUTM coordinate before rotation 473 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: n_utm_tmp !< NUTM coordinate before rotation 474 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: z_ag !< height coordinate relative to origin_z, temporary variable 470 475 ! 471 476 ! Obtain number of sites. Also, pass the 'open' string, in order to initially … … 474 479 vmea_general%id_vm, input_file_vm, & 475 480 global_attribute, 'open', '' ) 476 477 481 ! 478 482 ! Allocate data structure which encompass all required information, such as … … 589 593 ENDIF 590 594 ENDDO 595 596 591 597 ! 592 598 ! Allocate array for the measured variables names for the respective site. … … 658 664 ALLOCATE( n_utm(1:vmea(l)%ntraj,1:dim_ntime) ) 659 665 ALLOCATE( z_ag(1:vmea(l)%ntraj,1:dim_ntime) ) 666 667 ALLOCATE( e_utm_tmp(1:vmea(l)%ntraj,1:dim_ntime) ) 668 ALLOCATE( n_utm_tmp(1:vmea(l)%ntraj,1:dim_ntime) ) 660 669 ! 661 670 ! Read _FillValue attributes of the coordinate dimensions. … … 704 713 ! between UTM coordinates. Note, if the origin is not correct, the 705 714 ! virtual sites will be misplaced. 706 e_utm (t,1:dim_ntime) = e_utm(t,1:dim_ntime)  init_model%origin_x707 n_utm (t,1:dim_ntime) = n_utm(t,1:dim_ntime)  init_model%origin_y715 e_utm_tmp(t,1:dim_ntime) = e_utm(t,1:dim_ntime)  init_model%origin_x 716 n_utm_tmp(t,1:dim_ntime) = n_utm(t,1:dim_ntime)  init_model%origin_y 708 717 e_utm(t,1:dim_ntime) = COS( init_model%rotation_angle * pi / 180.0_wp ) & 709 * e_utm (t,1:dim_ntime)&718 * e_utm_tmp(t,1:dim_ntime) & 710 719  SIN( init_model%rotation_angle * pi / 180.0_wp ) & 711 * n_utm (t,1:dim_ntime)720 * n_utm_tmp(t,1:dim_ntime) 712 721 n_utm(t,1:dim_ntime) = SIN( init_model%rotation_angle * pi / 180.0_wp ) & 713 * e_utm (t,1:dim_ntime)&722 * e_utm_tmp(t,1:dim_ntime) & 714 723 + COS( init_model%rotation_angle * pi / 180.0_wp ) & 715 * n_utm (t,1:dim_ntime)724 * n_utm_tmp(t,1:dim_ntime) 716 725 ! 717 726 ! Determine the individual time coordinate length for each station and … … 791 800 ALLOCATE( vmea(l)%j(1:vmea(l)%ns) ) 792 801 ALLOCATE( vmea(l)%k(1:vmea(l)%ns) ) 793 ALLOCATE( vmea(l)%z_ag(1:vmea(l)%ns) ) 802 ALLOCATE( vmea(l)%z_ag(1:vmea(l)%ns) ) 794 803 ! 795 804 ! Based on the flag array store the grid indices which correspond to … … 889 898 ! 890 899 ! Deallocate temporary coordinate arrays 891 IF ( ALLOCATED( e_utm ) ) DEALLOCATE( e_utm ) 892 IF ( ALLOCATED( n_utm ) ) DEALLOCATE( n_utm ) 893 IF ( ALLOCATED( z_ag ) ) DEALLOCATE( z_ag ) 894 IF ( ALLOCATED( z_ag ) ) DEALLOCATE( vmea(l)%dim_t ) 900 IF ( ALLOCATED( e_utm ) ) DEALLOCATE( e_utm ) 901 IF ( ALLOCATED( n_utm ) ) DEALLOCATE( n_utm ) 902 IF ( ALLOCATED( e_utm_tmp ) ) DEALLOCATE( e_utm_tmp ) 903 IF ( ALLOCATED( n_utm_tmp ) ) DEALLOCATE( n_utm_tmp ) 904 IF ( ALLOCATED( n_utm ) ) DEALLOCATE( n_utm ) 905 IF ( ALLOCATED( z_ag ) ) DEALLOCATE( z_ag ) 906 IF ( ALLOCATED( z_ag ) ) DEALLOCATE( vmea(l)%dim_t ) 895 907 ENDIF 896 908 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.