Changeset 3485 for palm/trunk/SOURCE/netcdf_interface_mod.f90
- Timestamp:
- Nov 3, 2018 5:09:40 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3467 r3485 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Write geographic coordinates as global attributes to file. 28 ! 29 ! 3467 2018-10-30 19:05:21Z suehring 27 30 ! - Salsa implemented 28 31 ! - Bugfix convert_utm_to... … … 338 341 339 342 USE netcdf_data_input_mod, & 340 ONLY: coord_ref_sys 343 ONLY: coord_ref_sys, init_model 341 344 342 345 PRIVATE … … 644 647 USE land_surface_model_mod, & 645 648 ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs 646 647 USE netcdf_data_input_mod, &648 ONLY: init_model649 649 650 650 USE ocean_mod, & … … 892 892 ! 893 893 !-- Define some global attributes of the dataset 894 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, & 895 'Conventions', 'COARDS' ) 896 CALL netcdf_handle_error( 'netcdf_define_header', 464 ) 894 CALL netcdf_create_global_atts( id_set_mask(mid,av), 464 ) 897 895 898 896 IF ( av == 0 ) THEN … … 1747 1745 ! 1748 1746 !-- Define some global attributes of the dataset 1749 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'Conventions', & 1750 'COARDS' ) 1751 CALL netcdf_handle_error( 'netcdf_define_header', 62 ) 1747 CALL netcdf_create_global_atts( id_set_3d(av), 62 ) 1752 1748 1753 1749 IF ( av == 0 ) THEN … … 2763 2759 ! 2764 2760 !-- Define some global attributes of the dataset 2765 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'Conventions', & 2766 'COARDS' ) 2767 CALL netcdf_handle_error( 'netcdf_define_header', 97 ) 2761 CALL netcdf_create_global_atts( id_set_xy(av), 97 ) 2768 2762 2769 2763 IF ( av == 0 ) THEN … … 3803 3797 ! 3804 3798 !-- Define some global attributes of the dataset 3805 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'Conventions', & 3806 'COARDS' ) 3807 CALL netcdf_handle_error( 'netcdf_define_header', 140 ) 3799 CALL netcdf_create_global_atts( id_set_xz(av), 140 ) 3808 3800 3809 3801 IF ( av == 0 ) THEN … … 4742 4734 ! 4743 4735 !-- Define some global attributes of the dataset 4744 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'Conventions', & 4745 'COARDS' ) 4746 CALL netcdf_handle_error( 'netcdf_define_header', 179 ) 4736 CALL netcdf_create_global_atts( id_set_yz(av), 179 ) 4747 4737 4748 4738 IF ( av == 0 ) THEN … … 5668 5658 ! 5669 5659 !-- Define some global attributes of the dataset 5660 CALL netcdf_create_global_atts( id_set_pr, 451 ) 5661 5670 5662 IF ( averaging_interval_pr /= 0.0_wp ) THEN 5671 5663 WRITE (time_average_text,'('', '',F7.1,'' s average'')') & … … 6076 6068 ! 6077 6069 !-- Define some global attributes of the dataset 6070 CALL netcdf_create_global_atts( id_set_ts, 329 ) 6071 6078 6072 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', & 6079 6073 TRIM( run_description_header ) ) … … 7392 7386 ! Description: 7393 7387 ! ------------ 7388 !> Write a set of global attributes to file. 7389 !------------------------------------------------------------------------------! 7390 SUBROUTINE netcdf_create_global_atts( ncid, error_no ) 7391 7392 IMPLICIT NONE 7393 7394 INTEGER, INTENT(IN) :: error_no !< error number 7395 INTEGER, INTENT(IN) :: ncid !< file id 7396 7397 #if defined( __netcdf ) 7398 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions', & 7399 'COARDS' ) 7400 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7401 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat', & 7402 init_model%latitude ) 7403 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7404 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon', & 7405 init_model%longitude ) 7406 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7407 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x', & 7408 init_model%origin_x ) 7409 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7410 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y', & 7411 init_model%origin_y ) 7412 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7413 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', & 7414 init_model%origin_z ) 7415 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7416 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', & 7417 init_model%rotation_angle ) 7418 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7419 #endif 7420 7421 END SUBROUTINE netcdf_create_global_atts 7422 7423 !------------------------------------------------------------------------------! 7424 ! Description: 7425 ! ------------ 7394 7426 !> Create a variable holding the coordinate-reference-system information. 7395 7427 !------------------------------------------------------------------------------! 7396 7428 SUBROUTINE netcdf_create_crs( ncid, error_no ) 7397 7429 7398 #if defined( __netcdf )7399 7430 IMPLICIT NONE 7400 7431 … … 7403 7434 INTEGER :: var_id !< variable id 7404 7435 7436 #if defined( __netcdf ) 7405 7437 ! 7406 7438 !-- Define variable
Note: See TracChangeset
for help on using the changeset viewer.