Changeset 3529 for palm/trunk/SOURCE/netcdf_interface_mod.f90
- Timestamp:
- Nov 15, 2018 9:03:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3525 r3529 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - set time units 28 ! - add additional global attributes, 29 ! - add additinal variable attributes 30 ! - move definition of UTM and geographic coordinates into subroutine 31 ! - change fill_value 32 ! 33 ! 3525 2018-11-14 16:06:14Z kanani 27 34 ! Changes related to clean-up of biometeorology (dom_dwd_user) 28 35 ! … … 551 558 INTEGER(iwp), DIMENSION(1:max_masks,0:1,100) :: id_var_domask 552 559 553 REAL(wp) :: fill_value = -999 .0_wp !< value for the _FillValue attribute560 REAL(wp) :: fill_value = -9999.0_wp !< value for the _FillValue attribute 554 561 555 562 … … 584 591 MODULE PROCEDURE netcdf_create_var 585 592 END INTERFACE netcdf_create_var 593 594 INTERFACE netcdf_create_att 595 MODULE PROCEDURE netcdf_create_att_string 596 END INTERFACE netcdf_create_att 586 597 587 598 INTERFACE netcdf_define_header … … 895 906 ! 896 907 !-- Define some global attributes of the dataset 897 CALL netcdf_create_global_atts( id_set_mask(mid,av), 464 )898 899 908 IF ( av == 0 ) THEN 909 CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 ) 900 910 time_average_text = ' ' 901 911 ELSE 902 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 903 averaging_interval 904 ENDIF 905 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'title', & 906 TRIM( run_description_header ) // & 907 TRIM( time_average_text ) ) 908 CALL netcdf_handle_error( 'netcdf_define_header', 465 ) 909 IF ( av == 1 ) THEN 912 CALL netcdf_create_global_atts( id_set_mask(mid,av), 'podsmasked', TRIM( run_description_header ), 464 ) 910 913 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 911 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, &912 'time_avg',TRIM( time_average_text ) )914 nc_stat = NF90_PUT_ATT( id_set_mask(mid,av), NF90_GLOBAL, 'time_avg', & 915 TRIM( time_average_text ) ) 913 916 CALL netcdf_handle_error( 'netcdf_define_header', 466 ) 914 917 ENDIF … … 921 924 (/ id_dim_time_mask(mid,av) /), 'time', & 922 925 NF90_DOUBLE, id_var_time_mask(mid,av), & 923 'seconds', '', 468, 469, 000 ) 926 'seconds since '//TRIM(init_model%origin_time), 'time', 468, 469, 000 ) 927 CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'standard_name', 'time', 000) 928 CALL netcdf_create_att( id_set_mask(mid,av), id_var_time_mask(mid,av), 'axis', 'T', 000) 929 924 930 ! 925 931 !-- Define spatial dimensions and coordinates: … … 999 1005 'meters', '', 486, 487, 000 ) 1000 1006 ! 1001 !-- Define UTM coordinates 1002 IF ( init_model%rotation_angle == 0.0_wp ) THEN 1003 CALL netcdf_create_var( id_set_mask(mid,av), & 1004 (/ id_dim_x_mask(mid,av) /), & 1005 'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0), & 1006 'm', 'projection_x_coordinate', 000, 000, 000 ) 1007 CALL netcdf_create_var( id_set_mask(mid,av), & 1008 (/ id_dim_y_mask(mid,av) /), & 1009 'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0), & 1010 'm', 'projection_y_coordinate', 000, 000, 000 ) 1011 CALL netcdf_create_var( id_set_mask(mid,av), & 1012 (/ id_dim_xu_mask(mid,av) /), & 1013 'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1), & 1014 'm', 'projection_x_coordinate', 000, 000, 000 ) 1015 CALL netcdf_create_var( id_set_mask(mid,av), & 1016 (/ id_dim_y_mask(mid,av) /), & 1017 'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1), & 1018 'm', 'projection_y_coordinate', 000, 000, 000 ) 1019 CALL netcdf_create_var( id_set_mask(mid,av), & 1020 (/ id_dim_x_mask(mid,av) /), & 1021 'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2), & 1022 'm', 'projection_x_coordinate', 000, 000, 000 ) 1023 CALL netcdf_create_var( id_set_mask(mid,av), & 1024 (/ id_dim_yv_mask(mid,av) /), & 1025 'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2), & 1026 'm', 'projection_y_coordinate', 000, 000, 000 ) 1027 ELSE 1028 CALL netcdf_create_var( id_set_mask(mid,av), & 1029 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), & 1030 'E_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,0), & 1031 'm', 'projection_x_coordinate', 000, 000, 000 ) 1032 CALL netcdf_create_var( id_set_mask(mid,av), & 1033 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), & 1034 'N_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,0), & 1035 'm', 'projection_y_coordinate', 000, 000, 000 ) 1036 CALL netcdf_create_var( id_set_mask(mid,av), & 1037 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),& 1038 'Eu_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,1), & 1039 'm', 'projection_x_coordinate', 000, 000, 000 ) 1040 CALL netcdf_create_var( id_set_mask(mid,av), & 1041 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),& 1042 'Nu_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,1), & 1043 'm', 'projection_y_coordinate', 000, 000, 000 ) 1044 CALL netcdf_create_var( id_set_mask(mid,av), & 1045 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),& 1046 'Ev_UTM', NF90_DOUBLE, id_var_eutm_mask(mid,av,2), & 1047 'm', 'projection_x_coordinate', 000, 000, 000 ) 1048 CALL netcdf_create_var( id_set_mask(mid,av), & 1049 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),& 1050 'Nv_UTM', NF90_DOUBLE, id_var_nutm_mask(mid,av,2), & 1051 'm', 'projection_y_coordinate', 000, 000, 000 ) 1052 ENDIF 1053 ! 1054 !-- Define geographic coordinates 1055 CALL netcdf_create_var( id_set_mask(mid,av), & 1056 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), & 1057 'lon', NF90_DOUBLE, id_var_lon_mask(mid,av,0), & 1058 'degrees_east', 'longitude', 000, 000, 000 ) 1059 CALL netcdf_create_var( id_set_mask(mid,av), & 1060 (/ id_dim_x_mask(mid,av), id_dim_y_mask(mid,av) /), & 1061 'lat', NF90_DOUBLE, id_var_lat_mask(mid,av,0), & 1062 'degrees_north', 'latitude', 000, 000, 000 ) 1063 CALL netcdf_create_var( id_set_mask(mid,av), & 1064 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),& 1065 'lonu', NF90_DOUBLE, id_var_lon_mask(mid,av,1), & 1066 'degrees_east', 'longitude', 000, 000, 000 ) 1067 CALL netcdf_create_var( id_set_mask(mid,av), & 1068 (/ id_dim_xu_mask(mid,av), id_dim_y_mask(mid,av) /),& 1069 'latu', NF90_DOUBLE, id_var_lat_mask(mid,av,1), & 1070 'degrees_north', 'latitude', 000, 000, 000 ) 1071 CALL netcdf_create_var( id_set_mask(mid,av), & 1072 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),& 1073 'lonv', NF90_DOUBLE, id_var_lon_mask(mid,av,2), & 1074 'degrees_east', 'longitude', 000, 000, 000 ) 1075 CALL netcdf_create_var( id_set_mask(mid,av), & 1076 (/ id_dim_x_mask(mid,av), id_dim_yv_mask(mid,av) /),& 1077 'latv', NF90_DOUBLE, id_var_lat_mask(mid,av,2), & 1078 'degrees_north', 'latitude', 000, 000, 000 ) 1007 !-- Define UTM and geographic coordinates 1008 CALL define_geo_coordinates( id_set_mask(mid,av), & 1009 (/ id_dim_x_mask(mid,av), id_dim_xu_mask(mid,av) /), & 1010 (/ id_dim_y_mask(mid,av), id_dim_yv_mask(mid,av) /), & 1011 id_var_eutm_mask(mid,av,:), id_var_nutm_mask(mid,av,:), & 1012 id_var_lat_mask(mid,av,:), id_var_lon_mask(mid,av,:) ) 1079 1013 ! 1080 1014 !-- Define coordinate-reference system … … 1748 1682 ! 1749 1683 !-- Define some global attributes of the dataset 1750 CALL netcdf_create_global_atts( id_set_3d(av), 62 )1751 1752 1684 IF ( av == 0 ) THEN 1685 CALL netcdf_create_global_atts( id_set_3d(av), '3d', TRIM( run_description_header ), 62 ) 1753 1686 time_average_text = ' ' 1754 1687 ELSE 1755 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 1756 averaging_interval 1757 ENDIF 1758 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'title', & 1759 TRIM( run_description_header ) // & 1760 TRIM( time_average_text ) ) 1761 CALL netcdf_handle_error( 'netcdf_define_header', 63 ) 1762 IF ( av == 1 ) THEN 1688 CALL netcdf_create_global_atts( id_set_3d(av), '3d_av', TRIM( run_description_header ), 62 ) 1763 1689 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 1764 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg', &1690 nc_stat = NF90_PUT_ATT( id_set_3d(av), NF90_GLOBAL, 'time_avg', & 1765 1691 TRIM( time_average_text ) ) 1766 1692 CALL netcdf_handle_error( 'netcdf_define_header', 63 ) … … 1781 1707 CALL netcdf_create_var( id_set_3d(av), (/ id_dim_time_3d(av) /), & 1782 1708 'time', NF90_DOUBLE, id_var_time_3d(av), & 1783 'seconds', '', 65, 66, 00 ) 1709 'seconds since '//TRIM(init_model%origin_time), 'time', 65, 66, 00 ) 1710 CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'standard_name', 'time', 000) 1711 CALL netcdf_create_att( id_set_3d(av), id_var_time_3d(av), 'axis', 'T', 000) 1784 1712 ! 1785 1713 !-- Define spatial dimensions and coordinates: … … 1826 1754 362, 363, 000 ) 1827 1755 ! 1828 !-- Define UTM coordinates 1829 IF ( init_model%rotation_angle == 0.0_wp ) THEN 1830 CALL netcdf_create_var( id_set_3d(av), & 1831 (/ id_dim_x_3d(av) /), & 1832 'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0), & 1833 'm', 'projection_x_coordinate', 000, 000, 000 ) 1834 CALL netcdf_create_var( id_set_3d(av), & 1835 (/ id_dim_y_3d(av) /), & 1836 'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0), & 1837 'm', 'projection_y_coordinate', 000, 000, 000 ) 1838 CALL netcdf_create_var( id_set_3d(av), & 1839 (/ id_dim_xu_3d(av) /), & 1840 'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), & 1841 'm', 'projection_x_coordinate', 000, 000, 000 ) 1842 CALL netcdf_create_var( id_set_3d(av), & 1843 (/ id_dim_y_3d(av) /), & 1844 'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), & 1845 'm', 'projection_y_coordinate', 000, 000, 000 ) 1846 CALL netcdf_create_var( id_set_3d(av), & 1847 (/ id_dim_x_3d(av) /), & 1848 'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), & 1849 'm', 'projection_x_coordinate', 000, 000, 000 ) 1850 CALL netcdf_create_var( id_set_3d(av), & 1851 (/ id_dim_yv_3d(av) /), & 1852 'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), & 1853 'm', 'projection_y_coordinate', 000, 000, 000 ) 1854 ELSE 1855 CALL netcdf_create_var( id_set_3d(av), & 1856 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 1857 'E_UTM', NF90_DOUBLE, id_var_eutm_3d(av,0), & 1858 'm', 'projection_x_coordinate', 000, 000, 000 ) 1859 CALL netcdf_create_var( id_set_3d(av), & 1860 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 1861 'N_UTM', NF90_DOUBLE, id_var_nutm_3d(av,0), & 1862 'm', 'projection_y_coordinate', 000, 000, 000 ) 1863 CALL netcdf_create_var( id_set_3d(av), & 1864 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /), & 1865 'Eu_UTM', NF90_DOUBLE, id_var_eutm_3d(av,1), & 1866 'm', 'projection_x_coordinate', 000, 000, 000 ) 1867 CALL netcdf_create_var( id_set_3d(av), & 1868 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /), & 1869 'Nu_UTM', NF90_DOUBLE, id_var_nutm_3d(av,1), & 1870 'm', 'projection_y_coordinate', 000, 000, 000 ) 1871 CALL netcdf_create_var( id_set_3d(av), & 1872 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /), & 1873 'Ev_UTM', NF90_DOUBLE, id_var_eutm_3d(av,2), & 1874 'm', 'projection_x_coordinate', 000, 000, 000 ) 1875 CALL netcdf_create_var( id_set_3d(av), & 1876 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /), & 1877 'Nv_UTM', NF90_DOUBLE, id_var_nutm_3d(av,2), & 1878 'm', 'projection_y_coordinate', 000, 000, 000 ) 1879 ENDIF 1880 ! 1881 !-- Define geographic coordinates 1882 CALL netcdf_create_var( id_set_3d(av), & 1883 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 1884 'lon', NF90_DOUBLE, id_var_lon_3d(av,0), & 1885 'degrees_east', 'longitude', 000, 000, 000 ) 1886 CALL netcdf_create_var( id_set_3d(av), & 1887 (/ id_dim_x_3d(av), id_dim_y_3d(av) /), & 1888 'lat', NF90_DOUBLE, id_var_lat_3d(av,0), & 1889 'degrees_north', 'latitude', 000, 000, 000 ) 1890 CALL netcdf_create_var( id_set_3d(av), & 1891 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /), & 1892 'lonu', NF90_DOUBLE, id_var_lon_3d(av,1), & 1893 'degrees_east', 'longitude', 000, 000, 000 ) 1894 CALL netcdf_create_var( id_set_3d(av), & 1895 (/ id_dim_xu_3d(av), id_dim_y_3d(av) /), & 1896 'latu', NF90_DOUBLE, id_var_lat_3d(av,1), & 1897 'degrees_north', 'latitude', 000, 000, 000 ) 1898 CALL netcdf_create_var( id_set_3d(av), & 1899 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /), & 1900 'lonv', NF90_DOUBLE, id_var_lon_3d(av,2), & 1901 'degrees_east', 'longitude', 000, 000, 000 ) 1902 CALL netcdf_create_var( id_set_3d(av), & 1903 (/ id_dim_x_3d(av), id_dim_yv_3d(av) /), & 1904 'latv', NF90_DOUBLE, id_var_lat_3d(av,2), & 1905 'degrees_north', 'latitude', 000, 000, 000 ) 1756 !-- Define UTM and geographic coordinates 1757 CALL define_geo_coordinates( id_set_3d(av), & 1758 (/ id_dim_x_3d(av), id_dim_xu_3d(av) /), & 1759 (/ id_dim_y_3d(av), id_dim_yv_3d(av) /), & 1760 id_var_eutm_3d(av,:), id_var_nutm_3d(av,:), & 1761 id_var_lat_3d(av,:), id_var_lon_3d(av,:) ) 1906 1762 ! 1907 1763 !-- Define coordinate-reference system … … 2651 2507 2652 2508 CALL netcdf_create_var( id_set_agt, (/ id_dim_time_agt /), 'time', & 2653 NF90_REAL4, id_var_time_agt, 'seconds ', '', &2509 NF90_REAL4, id_var_time_agt, 'seconds since '//TRIM(init_model%origin_time), 'time', & 2654 2510 332, 333, 000 ) 2511 CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'standard_name', 'time', 000) 2512 CALL netcdf_create_att( id_set_agt, id_var_time_agt, 'axis', 'T', 000) 2655 2513 2656 2514 CALL netcdf_create_dim( id_set_agt, 'agent_number', & … … 2762 2620 ! 2763 2621 !-- Define some global attributes of the dataset 2764 CALL netcdf_create_global_atts( id_set_xy(av), 97 )2765 2766 2622 IF ( av == 0 ) THEN 2623 CALL netcdf_create_global_atts( id_set_xy(av), 'xy', TRIM( run_description_header ), 97 ) 2767 2624 time_average_text = ' ' 2768 2625 ELSE 2769 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 2770 averaging_interval 2771 ENDIF 2772 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'title', & 2773 TRIM( run_description_header ) // & 2774 TRIM( time_average_text ) ) 2775 CALL netcdf_handle_error( 'netcdf_define_header', 98 ) 2776 IF ( av == 1 ) THEN 2626 CALL netcdf_create_global_atts( id_set_xy(av), 'xy_av', TRIM( run_description_header ), 97 ) 2777 2627 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 2778 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg', &2628 nc_stat = NF90_PUT_ATT( id_set_xy(av), NF90_GLOBAL, 'time_avg', & 2779 2629 TRIM( time_average_text ) ) 2780 2630 CALL netcdf_handle_error( 'netcdf_define_header', 98 ) … … 2795 2645 CALL netcdf_create_var( id_set_xy(av), (/ id_dim_time_xy(av) /), & 2796 2646 'time', NF90_DOUBLE, id_var_time_xy(av), & 2797 'seconds', '', 100, 101, 000 ) 2647 'seconds since '//TRIM(init_model%origin_time), 'time', 100, 101, 000 ) 2648 CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'standard_name', 'time', 000) 2649 CALL netcdf_create_att( id_set_xy(av), id_var_time_xy(av), 'axis', 'T', 000) 2798 2650 ! 2799 2651 !-- Define the spatial dimensions and coordinates for xy-sections. … … 2884 2736 365, 366, 000 ) 2885 2737 ! 2886 !-- Define UTM coordinates 2887 IF ( init_model%rotation_angle == 0.0_wp ) THEN 2888 CALL netcdf_create_var( id_set_xy(av), & 2889 (/ id_dim_x_xy(av) /), & 2890 'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0), & 2891 'm', 'projection_x_coordinate', 000, 000, 000 ) 2892 CALL netcdf_create_var( id_set_xy(av), & 2893 (/ id_dim_y_xy(av) /), & 2894 'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0), & 2895 'm', 'projection_y_coordinate', 000, 000, 000 ) 2896 CALL netcdf_create_var( id_set_xy(av), & 2897 (/ id_dim_xu_xy(av) /), & 2898 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), & 2899 'm', 'projection_x_coordinate', 000, 000, 000 ) 2900 CALL netcdf_create_var( id_set_xy(av), & 2901 (/ id_dim_y_xy(av) /), & 2902 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), & 2903 'm', 'projection_y_coordinate', 000, 000, 000 ) 2904 CALL netcdf_create_var( id_set_xy(av), & 2905 (/ id_dim_x_xy(av) /), & 2906 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), & 2907 'm', 'projection_x_coordinate', 000, 000, 000 ) 2908 CALL netcdf_create_var( id_set_xy(av), & 2909 (/ id_dim_yv_xy(av) /), & 2910 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), & 2911 'm', 'projection_y_coordinate', 000, 000, 000 ) 2912 ELSE 2913 CALL netcdf_create_var( id_set_xy(av), & 2914 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 2915 'E_UTM', NF90_DOUBLE, id_var_eutm_xy(av,0), & 2916 'm', 'projection_x_coordinate', 000, 000, 000 ) 2917 CALL netcdf_create_var( id_set_xy(av), & 2918 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 2919 'N_UTM', NF90_DOUBLE, id_var_nutm_xy(av,0), & 2920 'm', 'projection_y_coordinate', 000, 000, 000 ) 2921 CALL netcdf_create_var( id_set_xy(av), & 2922 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /), & 2923 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xy(av,1), & 2924 'm', 'projection_x_coordinate', 000, 000, 000 ) 2925 CALL netcdf_create_var( id_set_xy(av), & 2926 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /), & 2927 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xy(av,1), & 2928 'm', 'projection_y_coordinate', 000, 000, 000 ) 2929 CALL netcdf_create_var( id_set_xy(av), & 2930 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /), & 2931 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xy(av,2), & 2932 'm', 'projection_x_coordinate', 000, 000, 000 ) 2933 CALL netcdf_create_var( id_set_xy(av), & 2934 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /), & 2935 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xy(av,2), & 2936 'm', 'projection_y_coordinate', 000, 000, 000 ) 2937 ENDIF 2938 ! 2939 !-- Define geographic coordinates 2940 CALL netcdf_create_var( id_set_xy(av), & 2941 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 2942 'lon', NF90_DOUBLE, id_var_lon_xy(av,0), & 2943 'degrees_east', 'longitude', 000, 000, 000 ) 2944 CALL netcdf_create_var( id_set_xy(av), & 2945 (/ id_dim_x_xy(av), id_dim_y_xy(av) /), & 2946 'lat', NF90_DOUBLE, id_var_lat_xy(av,0), & 2947 'degrees_north', 'latitude', 000, 000, 000 ) 2948 CALL netcdf_create_var( id_set_xy(av), & 2949 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /), & 2950 'lonu', NF90_DOUBLE, id_var_lon_xy(av,1), & 2951 'degrees_east', 'longitude', 000, 000, 000 ) 2952 CALL netcdf_create_var( id_set_xy(av), & 2953 (/ id_dim_xu_xy(av), id_dim_y_xy(av) /), & 2954 'latu', NF90_DOUBLE, id_var_lat_xy(av,1), & 2955 'degrees_north', 'latitude', 000, 000, 000 ) 2956 CALL netcdf_create_var( id_set_xy(av), & 2957 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /), & 2958 'lonv', NF90_DOUBLE, id_var_lon_xy(av,2), & 2959 'degrees_east', 'longitude', 000, 000, 000 ) 2960 CALL netcdf_create_var( id_set_xy(av), & 2961 (/ id_dim_x_xy(av), id_dim_yv_xy(av) /), & 2962 'latv', NF90_DOUBLE, id_var_lat_xy(av,2), & 2963 'degrees_north', 'latitude', 000, 000, 000 ) 2738 !-- Define UTM and geographic coordinates 2739 CALL define_geo_coordinates( id_set_xy(av), & 2740 (/ id_dim_x_xy(av), id_dim_xu_xy(av) /), & 2741 (/ id_dim_y_xy(av), id_dim_yv_xy(av) /), & 2742 id_var_eutm_xy(av,:), id_var_nutm_xy(av,:), & 2743 id_var_lat_xy(av,:), id_var_lon_xy(av,:) ) 2964 2744 ! 2965 2745 !-- Define coordinate-reference system … … 3800 3580 ! 3801 3581 !-- Define some global attributes of the dataset 3802 CALL netcdf_create_global_atts( id_set_xz(av), 140 )3803 3804 3582 IF ( av == 0 ) THEN 3583 CALL netcdf_create_global_atts( id_set_xz(av), 'xz', TRIM( run_description_header ), 140 ) 3805 3584 time_average_text = ' ' 3806 3585 ELSE 3807 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 3808 averaging_interval 3809 ENDIF 3810 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'title', & 3811 TRIM( run_description_header ) // & 3812 TRIM( time_average_text ) ) 3813 CALL netcdf_handle_error( 'netcdf_define_header', 141 ) 3814 IF ( av == 1 ) THEN 3586 CALL netcdf_create_global_atts( id_set_xz(av), 'xz_av', TRIM( run_description_header ), 140 ) 3815 3587 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 3816 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg', &3588 nc_stat = NF90_PUT_ATT( id_set_xz(av), NF90_GLOBAL, 'time_avg', & 3817 3589 TRIM( time_average_text ) ) 3818 3590 CALL netcdf_handle_error( 'netcdf_define_header', 141 ) … … 3833 3605 CALL netcdf_create_var( id_set_xz(av), (/ id_dim_time_xz(av) /), & 3834 3606 'time', NF90_DOUBLE, id_var_time_xz(av), & 3835 'seconds', '', 143, 144, 000 ) 3607 'seconds since '//TRIM(init_model%origin_time), 'time', 143, 144, 000 ) 3608 CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'standard_name', 'time', 000) 3609 CALL netcdf_create_att( id_set_xz(av), id_var_time_xz(av), 'axis', 'T', 000) 3836 3610 ! 3837 3611 !-- Define the spatial dimensions and coordinates for xz-sections. … … 3895 3669 157, 158, 000 ) 3896 3670 ! 3897 !-- Define UTM coordinates 3898 IF ( init_model%rotation_angle == 0.0_wp ) THEN 3899 CALL netcdf_create_var( id_set_xz(av), & 3900 (/ id_dim_x_xz(av) /), & 3901 'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0), & 3902 'm', 'projection_x_coordinate', 000, 000, 000 ) 3903 CALL netcdf_create_var( id_set_xz(av), & 3904 (/ id_dim_y_xz(av) /), & 3905 'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0), & 3906 'm', 'projection_y_coordinate', 000, 000, 000 ) 3907 CALL netcdf_create_var( id_set_xz(av), & 3908 (/ id_dim_xu_xz(av) /), & 3909 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), & 3910 'm', 'projection_x_coordinate', 000, 000, 000 ) 3911 CALL netcdf_create_var( id_set_xz(av), & 3912 (/ id_dim_y_xz(av) /), & 3913 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), & 3914 'm', 'projection_y_coordinate', 000, 000, 000 ) 3915 CALL netcdf_create_var( id_set_xz(av), & 3916 (/ id_dim_x_xz(av) /), & 3917 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), & 3918 'm', 'projection_x_coordinate', 000, 000, 000 ) 3919 CALL netcdf_create_var( id_set_xz(av), & 3920 (/ id_dim_yv_xz(av) /), & 3921 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), & 3922 'm', 'projection_y_coordinate', 000, 000, 000 ) 3923 ELSE 3924 CALL netcdf_create_var( id_set_xz(av), & 3925 (/ id_dim_x_xz(av), id_dim_y_xz(av) /), & 3926 'E_UTM', NF90_DOUBLE, id_var_eutm_xz(av,0), & 3927 'm', 'projection_x_coordinate', 000, 000, 000 ) 3928 CALL netcdf_create_var( id_set_xz(av), & 3929 (/ id_dim_x_xz(av), id_dim_y_xz(av) /), & 3930 'N_UTM', NF90_DOUBLE, id_var_nutm_xz(av,0), & 3931 'm', 'projection_y_coordinate', 000, 000, 000 ) 3932 CALL netcdf_create_var( id_set_xz(av), & 3933 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /), & 3934 'Eu_UTM', NF90_DOUBLE, id_var_eutm_xz(av,1), & 3935 'm', 'projection_x_coordinate', 000, 000, 000 ) 3936 CALL netcdf_create_var( id_set_xz(av), & 3937 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /), & 3938 'Nu_UTM', NF90_DOUBLE, id_var_nutm_xz(av,1), & 3939 'm', 'projection_y_coordinate', 000, 000, 000 ) 3940 CALL netcdf_create_var( id_set_xz(av), & 3941 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /), & 3942 'Ev_UTM', NF90_DOUBLE, id_var_eutm_xz(av,2), & 3943 'm', 'projection_x_coordinate', 000, 000, 000 ) 3944 CALL netcdf_create_var( id_set_xz(av), & 3945 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /), & 3946 'Nv_UTM', NF90_DOUBLE, id_var_nutm_xz(av,2), & 3947 'm', 'projection_y_coordinate', 000, 000, 000 ) 3948 ENDIF 3949 ! 3950 !-- Define geographic coordinates 3951 CALL netcdf_create_var( id_set_xz(av), & 3952 (/ id_dim_x_xz(av), id_dim_y_xz(av) /), & 3953 'lon', NF90_DOUBLE, id_var_lon_xz(av,0), & 3954 'degrees_east', 'longitude', 000, 000, 000 ) 3955 CALL netcdf_create_var( id_set_xz(av), & 3956 (/ id_dim_x_xz(av), id_dim_y_xz(av) /), & 3957 'lat', NF90_DOUBLE, id_var_lat_xz(av,0), & 3958 'degrees_north', 'latitude', 000, 000, 000 ) 3959 CALL netcdf_create_var( id_set_xz(av), & 3960 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /), & 3961 'lonu', NF90_DOUBLE, id_var_lon_xz(av,1), & 3962 'degrees_east', 'longitude', 000, 000, 000 ) 3963 CALL netcdf_create_var( id_set_xz(av), & 3964 (/ id_dim_xu_xz(av), id_dim_y_xz(av) /), & 3965 'latu', NF90_DOUBLE, id_var_lat_xz(av,1), & 3966 'degrees_north', 'latitude', 000, 000, 000 ) 3967 CALL netcdf_create_var( id_set_xz(av), & 3968 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /), & 3969 'lonv', NF90_DOUBLE, id_var_lon_xz(av,2), & 3970 'degrees_east', 'longitude', 000, 000, 000 ) 3971 CALL netcdf_create_var( id_set_xz(av), & 3972 (/ id_dim_x_xz(av), id_dim_yv_xz(av) /), & 3973 'latv', NF90_DOUBLE, id_var_lat_xz(av,2), & 3974 'degrees_north', 'latitude', 000, 000, 000 ) 3671 !-- Define UTM and geographic coordinates 3672 CALL define_geo_coordinates( id_set_xz(av), & 3673 (/ id_dim_x_xz(av), id_dim_xu_xz(av) /), & 3674 (/ id_dim_y_xz(av), id_dim_yv_xz(av) /), & 3675 id_var_eutm_xz(av,:), id_var_nutm_xz(av,:), & 3676 id_var_lat_xz(av,:), id_var_lon_xz(av,:) ) 3975 3677 ! 3976 3678 !-- Define coordinate-reference system … … 4737 4439 ! 4738 4440 !-- Define some global attributes of the dataset 4739 CALL netcdf_create_global_atts( id_set_yz(av), 179 )4740 4741 4441 IF ( av == 0 ) THEN 4442 CALL netcdf_create_global_atts( id_set_yz(av), 'yz', TRIM( run_description_header ), 179 ) 4742 4443 time_average_text = ' ' 4743 4444 ELSE 4744 WRITE (time_average_text, '('', '',F7.1,'' s average'')') & 4745 averaging_interval 4746 ENDIF 4747 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'title', & 4748 TRIM( run_description_header ) // & 4749 TRIM( time_average_text ) ) 4750 CALL netcdf_handle_error( 'netcdf_define_header', 180 ) 4751 IF ( av == 1 ) THEN 4445 CALL netcdf_create_global_atts( id_set_yz(av), 'yz_av', TRIM( run_description_header ), 179 ) 4752 4446 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval 4753 4447 nc_stat = NF90_PUT_ATT( id_set_yz(av), NF90_GLOBAL, 'time_avg', & … … 4770 4464 CALL netcdf_create_var( id_set_yz(av), (/ id_dim_time_yz(av) /), & 4771 4465 'time', NF90_DOUBLE, id_var_time_yz(av), & 4772 'seconds', '', 182, 183, 000 ) 4466 'seconds since '//TRIM(init_model%origin_time), 'time', 182, 183, 000 ) 4467 CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'standard_name', 'time', 000) 4468 CALL netcdf_create_att( id_set_yz(av), id_var_time_yz(av), 'axis', 'T', 000) 4773 4469 ! 4774 4470 !-- Define the spatial dimensions and coordinates for yz-sections. … … 4833 4529 196, 197, 000 ) 4834 4530 ! 4835 !-- Define UTM coordinates 4836 IF ( init_model%rotation_angle == 0.0_wp ) THEN 4837 CALL netcdf_create_var( id_set_yz(av), & 4838 (/ id_dim_x_yz(av) /), & 4839 'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0), & 4840 'm', 'projection_x_coordinate', 000, 000, 000 ) 4841 CALL netcdf_create_var( id_set_yz(av), & 4842 (/ id_dim_y_yz(av) /), & 4843 'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0), & 4844 'm', 'projection_y_coordinate', 000, 000, 000 ) 4845 CALL netcdf_create_var( id_set_yz(av), & 4846 (/ id_dim_xu_yz(av) /), & 4847 'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), & 4848 'm', 'projection_x_coordinate', 000, 000, 000 ) 4849 CALL netcdf_create_var( id_set_yz(av), & 4850 (/ id_dim_y_yz(av) /), & 4851 'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), & 4852 'm', 'projection_y_coordinate', 000, 000, 000 ) 4853 CALL netcdf_create_var( id_set_yz(av), & 4854 (/ id_dim_x_yz(av) /), & 4855 'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), & 4856 'm', 'projection_x_coordinate', 000, 000, 000 ) 4857 CALL netcdf_create_var( id_set_yz(av), & 4858 (/ id_dim_yv_yz(av) /), & 4859 'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), & 4860 'm', 'projection_y_coordinate', 000, 000, 000 ) 4861 ELSE 4862 CALL netcdf_create_var( id_set_yz(av), & 4863 (/ id_dim_x_yz(av), id_dim_y_yz(av) /), & 4864 'E_UTM', NF90_DOUBLE, id_var_eutm_yz(av,0), & 4865 'm', 'projection_x_coordinate', 000, 000, 000 ) 4866 CALL netcdf_create_var( id_set_yz(av), & 4867 (/ id_dim_x_yz(av), id_dim_y_yz(av) /), & 4868 'N_UTM', NF90_DOUBLE, id_var_nutm_yz(av,0), & 4869 'm', 'projection_y_coordinate', 000, 000, 000 ) 4870 CALL netcdf_create_var( id_set_yz(av), & 4871 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /), & 4872 'Eu_UTM', NF90_DOUBLE, id_var_eutm_yz(av,1), & 4873 'm', 'projection_x_coordinate', 000, 000, 000 ) 4874 CALL netcdf_create_var( id_set_yz(av), & 4875 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /), & 4876 'Nu_UTM', NF90_DOUBLE, id_var_nutm_yz(av,1), & 4877 'm', 'projection_y_coordinate', 000, 000, 000 ) 4878 CALL netcdf_create_var( id_set_yz(av), & 4879 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /), & 4880 'Ev_UTM', NF90_DOUBLE, id_var_eutm_yz(av,2), & 4881 'm', 'projection_x_coordinate', 000, 000, 000 ) 4882 CALL netcdf_create_var( id_set_yz(av), & 4883 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /), & 4884 'Nv_UTM', NF90_DOUBLE, id_var_nutm_yz(av,2), & 4885 'm', 'projection_y_coordinate', 000, 000, 000 ) 4886 ENDIF 4887 ! 4888 !-- Define geographic coordinates 4889 CALL netcdf_create_var( id_set_yz(av), & 4890 (/ id_dim_x_yz(av), id_dim_y_yz(av) /), & 4891 'lon', NF90_DOUBLE, id_var_lon_yz(av,0), & 4892 'degrees_east', 'longitude', 000, 000, 000 ) 4893 CALL netcdf_create_var( id_set_yz(av), & 4894 (/ id_dim_x_yz(av), id_dim_y_yz(av) /), & 4895 'lat', NF90_DOUBLE, id_var_lat_yz(av,0), & 4896 'degrees_north', 'latitude', 000, 000, 000 ) 4897 CALL netcdf_create_var( id_set_yz(av), & 4898 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /), & 4899 'lonu', NF90_DOUBLE, id_var_lon_yz(av,1), & 4900 'degrees_east', 'longitude', 000, 000, 000 ) 4901 CALL netcdf_create_var( id_set_yz(av), & 4902 (/ id_dim_xu_yz(av), id_dim_y_yz(av) /), & 4903 'latu', NF90_DOUBLE, id_var_lat_yz(av,1), & 4904 'degrees_north', 'latitude', 000, 000, 000 ) 4905 CALL netcdf_create_var( id_set_yz(av), & 4906 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /), & 4907 'lonv', NF90_DOUBLE, id_var_lon_yz(av,2), & 4908 'degrees_east', 'longitude', 000, 000, 000 ) 4909 CALL netcdf_create_var( id_set_yz(av), & 4910 (/ id_dim_x_yz(av), id_dim_yv_yz(av) /), & 4911 'latv', NF90_DOUBLE, id_var_lat_yz(av,2), & 4912 'degrees_north', 'latitude', 000, 000, 000 ) 4531 !-- Define UTM and geographic coordinates 4532 CALL define_geo_coordinates( id_set_yz(av), & 4533 (/ id_dim_x_yz(av), id_dim_xu_yz(av) /), & 4534 (/ id_dim_y_yz(av), id_dim_yv_yz(av) /), & 4535 id_var_eutm_yz(av,:), id_var_nutm_yz(av,:), & 4536 id_var_lat_yz(av,:), id_var_lon_yz(av,:) ) 4913 4537 ! 4914 4538 !-- Define coordinate-reference system … … 5661 5285 ! 5662 5286 !-- Define some global attributes of the dataset 5663 CALL netcdf_create_global_atts( id_set_pr, 451 )5664 5287 5665 5288 IF ( averaging_interval_pr /= 0.0_wp ) THEN 5666 WRITE (time_average_text,'('', '',F7.1,'' s average'')') & 5667 averaging_interval_pr 5668 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title', & 5669 TRIM( run_description_header ) // & 5670 TRIM( time_average_text ) ) 5671 CALL netcdf_handle_error( 'netcdf_define_header', 218 ) 5672 5289 CALL netcdf_create_global_atts( id_set_pr, 'podsprav', TRIM( run_description_header ), 451 ) 5673 5290 WRITE ( time_average_text,'(F7.1,'' s avg'')' ) averaging_interval_pr 5674 5291 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'time_avg', & 5675 5292 TRIM( time_average_text ) ) 5676 5293 ELSE 5677 nc_stat = NF90_PUT_ATT( id_set_pr, NF90_GLOBAL, 'title', & 5678 TRIM( run_description_header ) ) 5294 CALL netcdf_create_global_atts( id_set_pr, 'podspr', TRIM( run_description_header ), 451 ) 5679 5295 ENDIF 5680 5296 CALL netcdf_handle_error( 'netcdf_define_header', 219 ) 5681 5682 5297 ! 5683 5298 !-- Write number of columns and rows of coordinate systems to be plotted … … 5831 5446 id_dim_time_pr, 220 ) 5832 5447 CALL netcdf_create_var( id_set_pr, (/ id_dim_time_pr /), 'time', & 5833 NF90_DOUBLE, id_var_time_pr, 'seconds ', '', &5448 NF90_DOUBLE, id_var_time_pr, 'seconds since '//TRIM(init_model%origin_time), 'time', & 5834 5449 221, 222, 000 ) 5450 CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'standard_name', 'time', 000) 5451 CALL netcdf_create_att( id_set_pr, id_var_time_pr, 'axis', 'T', 000) 5835 5452 ! 5836 5453 !-- Define the variables … … 6071 5688 ! 6072 5689 !-- Define some global attributes of the dataset 6073 CALL netcdf_create_global_atts( id_set_ts, 329 )6074 6075 nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', &6076 TRIM( run_description_header ) )6077 CALL netcdf_handle_error( 'netcdf_define_header', 249 )5690 CALL netcdf_create_global_atts( id_set_ts, 'podsts', TRIM(run_description_header), 329 ) 5691 5692 ! nc_stat = NF90_PUT_ATT( id_set_ts, NF90_GLOBAL, 'title', & 5693 ! TRIM( run_description_header ) ) 5694 ! CALL netcdf_handle_error( 'netcdf_define_header', 249 ) 6078 5695 6079 5696 ! … … 6082 5699 id_dim_time_ts, 250 ) 6083 5700 CALL netcdf_create_var( id_set_ts, (/ id_dim_time_ts /), 'time', & 6084 NF90_DOUBLE, id_var_time_ts, 'seconds ', '', &5701 NF90_DOUBLE, id_var_time_ts, 'seconds since '//TRIM(init_model%origin_time), 'time', & 6085 5702 251, 252, 000 ) 5703 CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'standard_name', 'time', 000) 5704 CALL netcdf_create_att( id_set_ts, id_var_time_ts, 'axis', 'T', 000) 6086 5705 ! 6087 5706 !-- Define the variables … … 6277 5896 id_dim_time_sp, 270 ) 6278 5897 CALL netcdf_create_var( id_set_sp, (/ id_dim_time_sp /), 'time', & 6279 NF90_DOUBLE, id_var_time_sp, 'seconds ', '', &5898 NF90_DOUBLE, id_var_time_sp, 'seconds since '//TRIM(init_model%origin_time), 'time', & 6280 5899 271, 272, 000 ) 5900 CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'standard_name', 'time', 000) 5901 CALL netcdf_create_att( id_set_sp, id_var_time_sp, 'axis', 'T', 000) 6281 5902 ! 6282 5903 !-- Define the spatial dimensions and coordinates for spectra. … … 6766 6387 id_dim_time_pts, 397 ) 6767 6388 CALL netcdf_create_var( id_set_pts, (/ id_dim_time_pts /), 'time', & 6768 NF90_DOUBLE, id_var_time_pts, 'seconds ', '', &6389 NF90_DOUBLE, id_var_time_pts, 'seconds since '//TRIM(init_model%origin_time), 'time', & 6769 6390 398, 399, 000 ) 6391 CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'standard_name', 'time', 000) 6392 CALL netcdf_create_att( id_set_pts, id_var_time_pts, 'axis', 'T', 000) 6770 6393 ! 6771 6394 !-- Define the variables. If more than one particle group is defined, … … 6962 6585 id_dim_time_fl, 250 ) 6963 6586 CALL netcdf_create_var( id_set_fl, (/ id_dim_time_fl /), 'time', & 6964 NF90_DOUBLE, id_var_time_fl, 'seconds ', '', &6587 NF90_DOUBLE, id_var_time_fl, 'seconds since '//TRIM(init_model%origin_time), 'time', & 6965 6588 251, 252, 000 ) 6589 CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'standard_name', 'time', 000) 6590 CALL netcdf_create_att( id_set_fl, id_var_time_fl, 'axis', 'T', 000) 6966 6591 6967 6592 DO l = 1, num_leg … … 7389 7014 ! Description: 7390 7015 ! ------------ 7016 !> Write attributes to file. 7017 !------------------------------------------------------------------------------! 7018 SUBROUTINE netcdf_create_att_string( ncid, varid, name, value, err ) 7019 7020 IMPLICIT NONE 7021 7022 CHARACTER(LEN=*), INTENT(IN) :: name !< attribute name 7023 CHARACTER(LEN=*), INTENT(IN) :: value !< attribute value 7024 7025 INTEGER, INTENT(IN) :: err !< error id 7026 INTEGER, INTENT(IN) :: ncid !< file id 7027 7028 INTEGER, INTENT(IN), OPTIONAL :: varid !< variable id 7029 7030 #if defined( __netcdf ) 7031 IF ( PRESENT( varid ) ) THEN 7032 nc_stat = NF90_PUT_ATT( ncid, varid, TRIM( name ), TRIM( value ) ) 7033 ELSE 7034 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( name ), TRIM( value ) ) 7035 ENDIF 7036 CALL netcdf_handle_error( 'netcdf_create_att_string', err ) 7037 #endif 7038 7039 END SUBROUTINE netcdf_create_att_string 7040 7041 7042 !------------------------------------------------------------------------------! 7043 ! Description: 7044 ! ------------ 7391 7045 !> Write a set of global attributes to file. 7392 7046 !------------------------------------------------------------------------------! 7393 SUBROUTINE netcdf_create_global_atts( ncid, error_no ) 7047 SUBROUTINE netcdf_create_global_atts( ncid, data_content, title, error_no ) 7048 7049 USE control_parameters, & 7050 ONLY: revision, run_date, run_time, run_zone, runnr, version 7051 7052 USE netcdf_data_input_mod, & 7053 ONLY: input_file_atts 7394 7054 7395 7055 IMPLICIT NONE 7056 7057 CHARACTER(LEN=*), INTENT(IN) :: data_content !< describes the type of data in file 7058 CHARACTER(LEN=*), INTENT(IN) :: title !< file title 7396 7059 7397 7060 INTEGER, INTENT(IN) :: error_no !< error number … … 7399 7062 7400 7063 #if defined( __netcdf ) 7401 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions', & 7402 'COARDS' ) 7064 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'title', TRIM( title ) ) 7403 7065 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7404 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat', & 7405 init_model%latitude ) 7066 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'Conventions', 'CF-1.7' ) 7406 7067 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7407 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon', & 7408 init_model%longitude ) 7068 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'creation_time', TRIM( run_date )//' '//TRIM( run_time )//' '//run_zone(1:3) ) 7409 7069 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7410 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x', & 7411 init_model%origin_x ) 7070 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'data_content', TRIM(data_content) ) 7412 7071 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7413 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y', & 7414 init_model%origin_y ) 7072 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'version', runnr+1 ) 7415 7073 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7416 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', & 7417 init_model%origin_z)7074 7075 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_time', init_model%origin_time ) 7418 7076 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7419 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', & 7420 init_model%rotation_angle ) 7077 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lat', init_model%latitude ) 7421 7078 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7079 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_lon', init_model%longitude ) 7080 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7081 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_x', init_model%origin_x ) 7082 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7083 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_y', init_model%origin_y ) 7084 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7085 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'origin_z', init_model%origin_z ) 7086 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7087 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'rotation_angle', init_model%rotation_angle ) 7088 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7089 7090 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'dependencies', '' ) 7091 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7092 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'history', '' ) 7093 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7094 7095 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%author_char ), TRIM( input_file_atts%author ) ) 7096 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7097 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%contact_person_char ), TRIM( input_file_atts%contact_person ) ) 7098 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7099 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%institution_char ), TRIM( input_file_atts%institution ) ) 7100 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7101 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%acronym_char ), TRIM( input_file_atts%acronym ) ) 7102 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7103 7104 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%campaign_char ), TRIM( input_file_atts%campaign ) ) 7105 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7106 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%location_char ), TRIM( input_file_atts%location ) ) 7107 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7108 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%site_char ), TRIM( input_file_atts%site ) ) 7109 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7110 7111 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, 'source', TRIM( version )//' '//TRIM( revision ) ) 7112 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7113 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%references_char ), TRIM( input_file_atts%references ) ) 7114 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7115 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%keywords_char ), TRIM( input_file_atts%keywords ) ) 7116 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7117 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%licence_char ), TRIM( input_file_atts%licence ) ) 7118 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7119 nc_stat = NF90_PUT_ATT( ncid, NF90_GLOBAL, TRIM( input_file_atts%comment_char ), TRIM( input_file_atts%comment ) ) 7120 CALL netcdf_handle_error( 'netcdf_create_global_atts', error_no ) 7121 7422 7122 #endif 7423 7123 … … 7493 7193 7494 7194 #endif 7495 END SUBROUTINE netcdf_create_crs 7195 END SUBROUTINE netcdf_create_crs 7196 7197 7198 !------------------------------------------------------------------------------! 7199 ! Description: 7200 ! ------------ 7201 !> Define UTM coordinates and longitude and latitude in file. 7202 !------------------------------------------------------------------------------! 7203 SUBROUTINE define_geo_coordinates( id_set, id_dim_x, id_dim_y, id_var_eutm, id_var_nutm, id_var_lat, id_var_lon ) 7204 7205 IMPLICIT NONE 7206 7207 INTEGER :: i !< loop index 7208 INTEGER, INTENT(IN) :: id_set !< file id 7209 7210 INTEGER(iwp), DIMENSION(0:1), INTENT(IN) :: id_dim_x !< dimension id of x and xu 7211 INTEGER(iwp), DIMENSION(0:1), INTENT(IN) :: id_dim_y !< dimension id of y and yv 7212 7213 INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) :: id_var_eutm !< variable id for E_UTM coordinates 7214 INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) :: id_var_lat !< variable id for latitude coordinates 7215 INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) :: id_var_lon !< variable id for longitude coordinates 7216 INTEGER(iwp), DIMENSION(0:2), INTENT(OUT) :: id_var_nutm !< variable id for N_UTM coordinates 7217 7218 #if defined( __netcdf ) 7219 7220 ! 7221 !-- Define UTM coordinates 7222 IF ( init_model%rotation_angle == 0.0_wp ) THEN 7223 CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 ) 7224 CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 ) 7225 CALL netcdf_create_var( id_set, (/ id_dim_x(1) /), 'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 ) 7226 CALL netcdf_create_var( id_set, (/ id_dim_y(0) /), 'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 ) 7227 CALL netcdf_create_var( id_set, (/ id_dim_x(0) /), 'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 ) 7228 CALL netcdf_create_var( id_set, (/ id_dim_y(1) /), 'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 ) 7229 ELSE 7230 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), & 7231 'E_UTM', NF90_DOUBLE, id_var_eutm(0), 'm', 'easting', 000, 000, 000 ) 7232 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), & 7233 'N_UTM', NF90_DOUBLE, id_var_nutm(0), 'm', 'northing', 000, 000, 000 ) 7234 CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), & 7235 'Eu_UTM', NF90_DOUBLE, id_var_eutm(1), 'm', 'easting', 000, 000, 000 ) 7236 CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), & 7237 'Nu_UTM', NF90_DOUBLE, id_var_nutm(1), 'm', 'northing', 000, 000, 000 ) 7238 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), & 7239 'Ev_UTM', NF90_DOUBLE, id_var_eutm(2), 'm', 'easting', 000, 000, 000 ) 7240 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), & 7241 'Nv_UTM', NF90_DOUBLE, id_var_nutm(2), 'm', 'northing', 000, 000, 000 ) 7242 ENDIF 7243 ! 7244 !-- Define geographic coordinates 7245 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lon', NF90_DOUBLE, id_var_lon(0), & 7246 'degrees_east', 'longitude', 000, 000, 000 ) 7247 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(0) /), 'lat', NF90_DOUBLE, id_var_lat(0), & 7248 'degrees_north', 'latitude', 000, 000, 000 ) 7249 CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'lonu', NF90_DOUBLE, id_var_lon(1), & 7250 'degrees_east', 'longitude', 000, 000, 000 ) 7251 CALL netcdf_create_var( id_set, (/ id_dim_x(1), id_dim_y(0) /), 'latu', NF90_DOUBLE, id_var_lat(1), & 7252 'degrees_north', 'latitude', 000, 000, 000 ) 7253 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'lonv', NF90_DOUBLE, id_var_lon(2), & 7254 'degrees_east', 'longitude', 000, 000, 000 ) 7255 CALL netcdf_create_var( id_set, (/ id_dim_x(0), id_dim_y(1) /), 'latv', NF90_DOUBLE, id_var_lat(2), & 7256 'degrees_north', 'latitude', 000, 000, 000 ) 7257 7258 DO i = 0, 2 7259 CALL netcdf_create_att( id_set, id_var_eutm(i), 'standard_name', 'projection_x_coordinate', 000) 7260 CALL netcdf_create_att( id_set, id_var_nutm(i), 'standard_name', 'projection_y_coordinate', 000) 7261 7262 CALL netcdf_create_att( id_set, id_var_lat(i), 'standard_name', 'latitude', 000) 7263 CALL netcdf_create_att( id_set, id_var_lon(i), 'standard_name', 'longitude', 000) 7264 ENDDO 7265 7266 #endif 7267 END SUBROUTINE define_geo_coordinates 7496 7268 7497 7269
Note: See TracChangeset
for help on using the changeset viewer.