Changeset 3435 for palm/trunk/SOURCE/netcdf_interface_mod.f90
- Timestamp:
- Oct 26, 2018 6:25:44 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3421 r3435 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Bugfix: corrected order of calls to define_netcdf_grid for masked output 28 ! Add vertical dimensions to masked output in case of terrain-following output 29 ! 30 ! 3421 2018-10-24 18:39:32Z gronemeier 27 31 ! Bugfix: move ocean output variables to ocean_mod 28 32 ! Renamed output variables … … 589 593 do3d_time_count, domask_time_count, end_time, land_surface, & 590 594 mask_size_l, mask_i, mask_i_global, mask_j, mask_j_global, & 591 mask_k_global, message_string, mid, ntdim_2d_xy, ntdim_2d_xz, & 595 mask_k_global, mask_surface, & 596 message_string, mid, ntdim_2d_xy, ntdim_2d_xz, & 592 597 ntdim_2d_yz, ntdim_3d, nz_do3d, ocean_mode, plant_canopy, & 593 598 run_description_header, section, simulated_time, & … … 873 878 ! 874 879 !-- Define spatial dimensions and coordinates: 875 !-- Define vertical coordinate grid (zu grid) 876 CALL netcdf_create_dim( id_set_mask(mid,av), 'zu_3d', & 877 mask_size(mid,3), id_dim_zu_mask(mid,av), & 878 470 ) 879 CALL netcdf_create_var( id_set_mask(mid,av), & 880 (/ id_dim_zu_mask(mid,av) /), 'zu_3d', & 881 NF90_DOUBLE, id_var_zu_mask(mid,av), & 882 'meters', '', 471, 472, 000 ) 883 ! 884 !-- Define vertical coordinate grid (zw grid) 885 CALL netcdf_create_dim( id_set_mask(mid,av), 'zw_3d', & 886 mask_size(mid,3), id_dim_zw_mask(mid,av), & 887 473 ) 888 CALL netcdf_create_var( id_set_mask(mid,av), & 889 (/ id_dim_zw_mask(mid,av) /), 'zw_3d', & 890 NF90_DOUBLE, id_var_zw_mask(mid,av), & 891 'meters', '', 474, 475, 000 ) 880 IF ( mask_surface(mid) ) THEN 881 ! 882 !-- In case of terrain-following output, the vertical dimensions are 883 !-- indices, not meters 884 CALL netcdf_create_dim( id_set_mask(mid,av), 'ku_above_surf', & 885 mask_size(mid,3), id_dim_zu_mask(mid,av), & 886 470 ) 887 CALL netcdf_create_var( id_set_mask(mid,av), & 888 (/ id_dim_zu_mask(mid,av) /), & 889 'ku_above_surf', & 890 NF90_DOUBLE, id_var_zu_mask(mid,av), & 891 '1', 'grid point above terrain', & 892 471, 472, 000 ) 893 CALL netcdf_create_dim( id_set_mask(mid,av), 'kw_above_surf', & 894 mask_size(mid,3), id_dim_zw_mask(mid,av), & 895 473 ) 896 CALL netcdf_create_var( id_set_mask(mid,av), & 897 (/ id_dim_zw_mask(mid,av) /), & 898 'kw_above_surf', & 899 NF90_DOUBLE, id_var_zw_mask(mid,av), & 900 '1', 'grid point above terrain', & 901 474, 475, 000 ) 902 ELSE 903 ! 904 !-- Define vertical coordinate grid (zu grid) 905 CALL netcdf_create_dim( id_set_mask(mid,av), 'zu_3d', & 906 mask_size(mid,3), id_dim_zu_mask(mid,av), & 907 470 ) 908 CALL netcdf_create_var( id_set_mask(mid,av), & 909 (/ id_dim_zu_mask(mid,av) /), 'zu_3d', & 910 NF90_DOUBLE, id_var_zu_mask(mid,av), & 911 'meters', '', 471, 472, 000 ) 912 ! 913 !-- Define vertical coordinate grid (zw grid) 914 CALL netcdf_create_dim( id_set_mask(mid,av), 'zw_3d', & 915 mask_size(mid,3), id_dim_zw_mask(mid,av), & 916 473 ) 917 CALL netcdf_create_var( id_set_mask(mid,av), & 918 (/ id_dim_zw_mask(mid,av) /), 'zw_3d', & 919 NF90_DOUBLE, id_var_zw_mask(mid,av), & 920 'meters', '', 474, 475, 000 ) 921 ENDIF 892 922 ! 893 923 !-- Define x-axis (for scalar position) … … 1068 1098 ! 1069 1099 !-- Check for quantities defined in other modules 1100 CALL tcm_define_netcdf_grid( domask( mid,av,i), found, & 1101 grid_x, grid_y, grid_z ) 1102 1070 1103 IF ( .NOT. found .AND. air_chemistry ) THEN 1071 1104 CALL chem_define_netcdf_grid( domask(mid,av,i), found, & … … 1105 1138 grid_z ) 1106 1139 ENDIF 1107 1108 CALL tcm_define_netcdf_grid( domask( mid,av,i), found, &1109 grid_x, grid_y, grid_z )1110 1111 1140 ! 1112 1141 !-- Now check for user-defined quantities … … 1343 1372 ALLOCATE( netcdf_data(mask_size(mid,3)) ) 1344 1373 1345 netcdf_data = zu( mask_k_global(mid,:mask_size(mid,3)) ) 1346 1347 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zu_mask(mid,av), & 1348 netcdf_data, start = (/ 1 /), & 1349 count = (/ mask_size(mid,3) /) ) 1350 CALL netcdf_handle_error( 'netcdf_define_header', 503 ) 1351 1352 netcdf_data = zw( mask_k_global(mid,:mask_size(mid,3)) ) 1353 1354 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zw_mask(mid,av), & 1355 netcdf_data, start = (/ 1 /), & 1356 count = (/ mask_size(mid,3) /) ) 1357 CALL netcdf_handle_error( 'netcdf_define_header', 504 ) 1374 IF ( mask_surface(mid) ) THEN 1375 1376 netcdf_data = mask_k_global(mid,:mask_size(mid,3)) 1377 1378 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zu_mask(mid,av), & 1379 netcdf_data, start = (/ 1 /), & 1380 count = (/ mask_size(mid,3) /) ) 1381 CALL netcdf_handle_error( 'netcdf_define_header', 503 ) 1382 1383 netcdf_data = mask_k_global(mid,:mask_size(mid,3)) 1384 1385 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zw_mask(mid,av), & 1386 netcdf_data, start = (/ 1 /), & 1387 count = (/ mask_size(mid,3) /) ) 1388 CALL netcdf_handle_error( 'netcdf_define_header', 504 ) 1389 1390 ELSE 1391 1392 netcdf_data = zu( mask_k_global(mid,:mask_size(mid,3)) ) 1393 1394 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zu_mask(mid,av), & 1395 netcdf_data, start = (/ 1 /), & 1396 count = (/ mask_size(mid,3) /) ) 1397 CALL netcdf_handle_error( 'netcdf_define_header', 503 ) 1398 1399 netcdf_data = zw( mask_k_global(mid,:mask_size(mid,3)) ) 1400 1401 nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_zw_mask(mid,av), & 1402 netcdf_data, start = (/ 1 /), & 1403 count = (/ mask_size(mid,3) /) ) 1404 CALL netcdf_handle_error( 'netcdf_define_header', 504 ) 1405 1406 ENDIF 1358 1407 1359 1408 DEALLOCATE( netcdf_data )
Note: See TracChangeset
for help on using the changeset viewer.