Changeset 3472 for palm/trunk/SOURCE
- Timestamp:
- Oct 30, 2018 8:43:50 PM (6 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 7 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
- Property svn:mergeinfo changed
/palm/branches/mosaik_M2/Makefile (added) merged: 3363,3434,3471
r3469 r3472 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # Add virtual measurement module 23 23 # 24 24 # Former revisions: … … 696 696 vertical_nesting_mod.f90 \ 697 697 virtual_flight_mod.f90 \ 698 virtual_measurement_mod.f90 \ 698 699 wind_turbine_model_mod.f90 \ 699 700 wrd_write_string.f90 \ … … 1134 1135 uv_exposure_model_mod.o \ 1135 1136 virtual_flight_mod.o \ 1137 virtual_measurement_mod.o \ 1136 1138 wind_turbine_model_mod.o 1137 1139 init_advec.o: \ … … 1451 1453 vertical_nesting_mod.o \ 1452 1454 virtual_flight_mod.o \ 1455 virtual_measurement_mod.o \ 1453 1456 wind_turbine_model_mod.o 1454 1457 plant_canopy_model_mod.o: \ … … 1750 1753 vertical_nesting_mod.o \ 1751 1754 virtual_flight_mod.o \ 1755 virtual_measurement_mod.o \ 1752 1756 wind_turbine_model_mod.o 1753 1757 time_integration_spinup.o: \ … … 1968 1972 user_flight.o \ 1969 1973 user_init_flight.o 1974 virtual_measurement_mod.o: \ 1975 cpulog_mod.o \ 1976 mod_kinds.o \ 1977 modules.o \ 1978 netcdf_data_input_mod.o \ 1979 netcdf_interface_mod.o 1970 1980 wind_turbine_model_mod.o: \ 1971 1981 basic_constants_and_equations_mod.o \ - Property svn:mergeinfo changed
-
palm/trunk/SOURCE/check_parameters.f90
- Property svn:mergeinfo changed
/palm/branches/mosaik_M2/check_parameters.f90 (added) merged: 3363
- Property svn:mergeinfo changed
-
palm/trunk/SOURCE/init_3d_model.f90
- Property svn:mergeinfo changed
/palm/branches/mosaik_M2/init_3d_model.f90 (added) merged: 3363,3434,3471
r3469 r3472 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Add virtual measurement module 23 23 ! 24 24 ! Former revisions: … … 664 664 USE uv_exposure_model_mod, & 665 665 ONLY: uvem_init, uvem_init_arrays 666 667 USE virtual_measurement_mod, & 668 ONLY: vm_init 666 669 667 670 USE wind_turbine_model_mod, & … … 2443 2446 CALL surface_output_init 2444 2447 ENDIF 2448 ! 2449 !-- If virtual measurements should be taken, initialize all relevant 2450 !-- arrays and quantities. 2451 IF ( virtual_measurement ) CALL vm_init 2445 2452 2446 2453 ! - Property svn:mergeinfo changed
-
palm/trunk/SOURCE/modules.f90
r3469 r3472 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! +virtual_measurement 23 23 ! 24 24 ! Former revisions: … … 1398 1398 LOGICAL :: use_upstream_for_tke = .FALSE. !< namelist parameter 1399 1399 LOGICAL :: uv_exposure = .FALSE. !< switch for uv exposure model 1400 LOGICAL :: virtual_flight = .FALSE. !< use virtual flight model? 1400 LOGICAL :: virtual_flight = .FALSE. !< use virtual flight model 1401 LOGICAL :: virtual_measurement = .FALSE. !< control parameter to switch-on virtual measurements 1401 1402 LOGICAL :: wall_adjustment = .TRUE. !< namelist parameter 1402 1403 LOGICAL :: wind_turbine = .FALSE. !< flag for use of wind turbine model -
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r3467 r3472 228 228 !> Modulue contains routines to input data according to Palm input data 229 229 !> standart using dynamic and static input files. 230 !> @todo - Review Reading of netcdf files for chemistry230 !> @todo - Chemistry: revise reading of netcdf file and ajdust formatting according to standard!!! 231 231 !> @todo - Order input alphabetically 232 232 !> @todo - Revise error messages and error numbers … … 670 670 CHARACTER(LEN=100) :: input_file_dynamic = 'PIDS_DYNAMIC' !< Name of file which comprises dynamic input data 671 671 CHARACTER(LEN=100) :: input_file_chem = 'PIDS_CHEM' !< Name of file which comprises chemistry input data 672 673 CHARACTER (LEN=25), ALLOCATABLE, DIMENSION(:) :: string_values !< output of string variables read from netcdf input files 672 CHARACTER(LEN=100) :: input_file_vm = 'PIDS_VM' !< Name of file which comprises virtual measurement data 673 674 CHARACTER (LEN=25), ALLOCATABLE, DIMENSION(:) :: string_values !< output of string variables read from netcdf input files 674 675 675 INTEGER(iwp) :: id_emis !< NetCDF id of input file for chemistry emissions: TBD: It has to be removed676 INTEGER(iwp) :: id_emis !< NetCDF id of input file for chemistry emissions: TBD: It has to be removed 676 677 677 678 INTEGER(iwp) :: nc_stat !< return value of nf90 function call … … 679 680 LOGICAL :: input_pids_static = .FALSE. !< Flag indicating whether Palm-input-data-standard file containing static information exists 680 681 LOGICAL :: input_pids_dynamic = .FALSE. !< Flag indicating whether Palm-input-data-standard file containing dynamic information exists 681 LOGICAL :: input_pids_chem = .FALSE. !< Flag indicating whether Palm-input-data-standard file containing chemistry information exists 682 682 LOGICAL :: input_pids_chem = .FALSE. !< Flag indicating whether Palm-input-data-standard file containing chemistry information exists 683 LOGICAL :: input_pids_vm = .FALSE. !< Flag indicating whether input file for virtual measurements exist 684 683 685 LOGICAL :: collective_read = .FALSE. !< Enable NetCDF collective read 684 686 … … 707 709 MODULE PROCEDURE netcdf_data_input_chemistry_data 708 710 END INTERFACE netcdf_data_input_chemistry_data 711 712 INTERFACE netcdf_data_input_get_dimension_length 713 MODULE PROCEDURE netcdf_data_input_get_dimension_length 714 END INTERFACE netcdf_data_input_get_dimension_length 709 715 710 716 INTERFACE netcdf_data_input_inquire_file … … 715 721 MODULE PROCEDURE netcdf_data_input_init 716 722 END INTERFACE netcdf_data_input_init 723 724 INTERFACE netcdf_data_input_att 725 MODULE PROCEDURE netcdf_data_input_att_int 726 MODULE PROCEDURE netcdf_data_input_att_real 727 MODULE PROCEDURE netcdf_data_input_att_string 728 END INTERFACE netcdf_data_input_att 717 729 718 730 INTERFACE netcdf_data_input_init_3d … … 732 744 END INTERFACE netcdf_data_input_surface_data 733 745 734 INTERFACE netcdf_data_input_topo 735 MODULE PROCEDURE netcdf_data_input_topo 736 END INTERFACE netcdf_data_input_topo 746 INTERFACE netcdf_data_input_var 747 MODULE PROCEDURE netcdf_data_input_var_char 748 MODULE PROCEDURE netcdf_data_input_var_real_1d 749 MODULE PROCEDURE netcdf_data_input_var_real_2d 750 END INTERFACE netcdf_data_input_var 737 751 738 752 INTERFACE get_variable 739 MODULE PROCEDURE get_variable_ string753 MODULE PROCEDURE get_variable_1d_char 740 754 MODULE PROCEDURE get_variable_1d_int 741 755 MODULE PROCEDURE get_variable_1d_real … … 749 763 MODULE PROCEDURE get_variable_4d_real 750 764 MODULE PROCEDURE get_variable_5d_to_4d_real 765 MODULE PROCEDURE get_variable_string 751 766 END INTERFACE get_variable 752 767 … … 769 784 coord_ref_sys, & 770 785 init_3d, init_model, input_file_static, input_pids_static, & 771 input_pids_dynamic, leaf_area_density_f, nest_offl, & 786 input_pids_dynamic, input_pids_vm, input_file_vm, & 787 leaf_area_density_f, nest_offl, & 772 788 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f, & 773 789 root_area_density_lad_f, root_area_density_lsm_f, soil_pars_f, & … … 779 795 !-- Public subroutines 780 796 PUBLIC netcdf_data_input_check_dynamic, netcdf_data_input_check_static, & 781 netcdf_data_input_chemistry_data, netcdf_data_input_inquire_file, & 797 netcdf_data_input_chemistry_data, & 798 netcdf_data_input_get_dimension_length, & 799 netcdf_data_input_inquire_file, & 782 800 netcdf_data_input_init, netcdf_data_input_init_lsm, & 783 netcdf_data_input_init_3d, 801 netcdf_data_input_init_3d, netcdf_data_input_att, & 784 802 netcdf_data_input_interpolate, netcdf_data_input_offline_nesting, & 785 803 netcdf_data_input_surface_data, netcdf_data_input_topo, & 786 get_attribute, get_dimension_length, get_variable, open_read_file804 netcdf_data_input_var, get_attribute, get_variable, open_read_file 787 805 788 806 CONTAINS … … 802 820 803 821 #if defined ( __netcdf ) 804 INQUIRE( FILE = TRIM( input_file_static ) // TRIM( coupling_char ),&822 INQUIRE( FILE = TRIM( input_file_static ) // TRIM( coupling_char ), & 805 823 EXIST = input_pids_static ) 806 824 INQUIRE( FILE = TRIM( input_file_dynamic ) // TRIM( coupling_char ), & 807 825 EXIST = input_pids_dynamic ) 808 INQUIRE( FILE = TRIM( input_file_chem ) // TRIM( coupling_char ), &826 INQUIRE( FILE = TRIM( input_file_chem ) // TRIM( coupling_char ), & 809 827 EXIST = input_pids_chem ) 810 828 INQUIRE( FILE = TRIM( input_file_vm ) // TRIM( coupling_char ), & 829 EXIST = input_pids_vm ) 811 830 #endif 812 831 … … 933 952 934 953 END SUBROUTINE netcdf_data_input_init 954 955 !------------------------------------------------------------------------------! 956 ! Description: 957 ! ------------ 958 !> Read an array of characters. 959 !------------------------------------------------------------------------------! 960 SUBROUTINE netcdf_data_input_var_char( val, search_string, id_mod ) 961 962 IMPLICIT NONE 963 964 CHARACTER(LEN=*) :: search_string !< name of the variable 965 CHARACTER(LEN=*), DIMENSION(:) :: val !< variable which should be read 966 967 INTEGER(iwp) :: id_mod !< NetCDF id of input file 968 969 #if defined ( __netcdf ) 970 ! 971 !-- Read variable 972 CALL get_variable( id_mod, search_string, val ) 973 #endif 974 975 END SUBROUTINE netcdf_data_input_var_char 976 977 !------------------------------------------------------------------------------! 978 ! Description: 979 ! ------------ 980 !> Read an 1D array of REAL values. 981 !------------------------------------------------------------------------------! 982 SUBROUTINE netcdf_data_input_var_real_1d( val, search_string, id_mod ) 983 984 IMPLICIT NONE 985 986 CHARACTER(LEN=*) :: search_string !< name of the variable 987 988 INTEGER(iwp) :: id_mod !< NetCDF id of input file 989 990 REAL(wp), DIMENSION(:) :: val !< variable which should be read 991 992 #if defined ( __netcdf ) 993 ! 994 !-- Read variable 995 CALL get_variable( id_mod, search_string, val ) 996 #endif 997 998 END SUBROUTINE netcdf_data_input_var_real_1d 999 1000 !------------------------------------------------------------------------------! 1001 ! Description: 1002 ! ------------ 1003 !> Read an 1D array of REAL values. 1004 !------------------------------------------------------------------------------! 1005 SUBROUTINE netcdf_data_input_var_real_2d( val, search_string, & 1006 id_mod, d1s, d1e, d2s, d2e ) 1007 1008 IMPLICIT NONE 1009 1010 CHARACTER(LEN=*) :: search_string !< name of the variable 1011 1012 INTEGER(iwp) :: id_mod !< NetCDF id of input file 1013 INTEGER(iwp) :: d1e !< end index of first dimension to be read 1014 INTEGER(iwp) :: d2e !< end index of second dimension to be read 1015 INTEGER(iwp) :: d1s !< start index of first dimension to be read 1016 INTEGER(iwp) :: d2s !< start index of second dimension to be read 1017 1018 REAL(wp), DIMENSION(:,:) :: val !< variable which should be read 1019 1020 #if defined ( __netcdf ) 1021 ! 1022 !-- Read character variable 1023 CALL get_variable( id_mod, search_string, val, d1s, d1e, d2s, d2e ) 1024 #endif 1025 1026 END SUBROUTINE netcdf_data_input_var_real_2d 1027 1028 !------------------------------------------------------------------------------! 1029 ! Description: 1030 ! ------------ 1031 !> Read a global string attribute 1032 !------------------------------------------------------------------------------! 1033 SUBROUTINE netcdf_data_input_att_string( val, search_string, id_mod, & 1034 input_file, global, openclose, & 1035 variable_name ) 1036 1037 IMPLICIT NONE 1038 1039 CHARACTER(LEN=*) :: search_string !< name of the attribue 1040 CHARACTER(LEN=*) :: val !< attribute 1041 1042 CHARACTER(LEN=*) :: input_file !< name of input file 1043 CHARACTER(LEN=*) :: openclose !< string indicating whether NetCDF needs to be opend or closed 1044 CHARACTER(LEN=*) :: variable_name !< string indicating whether NetCDF needs to be opend or closed 1045 1046 INTEGER(iwp) :: id_mod !< NetCDF id of input file 1047 1048 LOGICAL :: global !< flag indicating a global or a variable's attribute 1049 1050 #if defined ( __netcdf ) 1051 ! 1052 !-- Open file in read-only mode if necessary 1053 IF ( openclose == 'open' ) THEN 1054 CALL open_read_file( TRIM( input_file ) // TRIM( coupling_char ), & 1055 id_mod ) 1056 ENDIF 1057 ! 1058 !-- Read global attribute 1059 IF ( global ) THEN 1060 CALL get_attribute( id_mod, search_string, val, global ) 1061 ! 1062 !-- Read variable attribute 1063 ELSE 1064 CALL get_attribute( id_mod, search_string, val, global, variable_name ) 1065 ENDIF 1066 ! 1067 !-- Close input file 1068 IF ( openclose == 'close' ) CALL close_input_file( id_mod ) 1069 #endif 1070 1071 END SUBROUTINE netcdf_data_input_att_string 1072 1073 !------------------------------------------------------------------------------! 1074 ! Description: 1075 ! ------------ 1076 !> Read a global integer attribute 1077 !------------------------------------------------------------------------------! 1078 SUBROUTINE netcdf_data_input_att_int( val, search_string, id_mod, & 1079 input_file, global, openclose, & 1080 variable_name ) 1081 1082 IMPLICIT NONE 1083 1084 CHARACTER(LEN=*) :: search_string !< name of the attribue 1085 1086 CHARACTER(LEN=*) :: input_file !< name of input file 1087 CHARACTER(LEN=*) :: openclose !< string indicating whether NetCDF needs to be opend or closed 1088 CHARACTER(LEN=*) :: variable_name !< string indicating whether NetCDF needs to be opend or closed 1089 1090 INTEGER(iwp) :: id_mod !< NetCDF id of input file 1091 INTEGER(iwp) :: val !< value of the attribute 1092 1093 LOGICAL :: global !< flag indicating a global or a variable's attribute 1094 1095 #if defined ( __netcdf ) 1096 ! 1097 !-- Open file in read-only mode 1098 IF ( openclose == 'open' ) THEN 1099 CALL open_read_file( TRIM( input_file ) // TRIM( coupling_char ), & 1100 id_mod ) 1101 ENDIF 1102 ! 1103 !-- Read global attribute 1104 IF ( global ) THEN 1105 CALL get_attribute( id_mod, search_string, val, global ) 1106 ! 1107 !-- Read variable attribute 1108 ELSE 1109 CALL get_attribute( id_mod, search_string, val, global, variable_name ) 1110 ENDIF 1111 ! 1112 !-- Finally, close input file 1113 IF ( openclose == 'close' ) CALL close_input_file( id_mod ) 1114 #endif 1115 1116 END SUBROUTINE netcdf_data_input_att_int 1117 1118 !------------------------------------------------------------------------------! 1119 ! Description: 1120 ! ------------ 1121 !> Read a global real attribute 1122 !------------------------------------------------------------------------------! 1123 SUBROUTINE netcdf_data_input_att_real( val, search_string, id_mod, & 1124 input_file, global, openclose, & 1125 variable_name ) 1126 1127 IMPLICIT NONE 1128 1129 CHARACTER(LEN=*) :: search_string !< name of the attribue 1130 1131 CHARACTER(LEN=*) :: input_file !< name of input file 1132 CHARACTER(LEN=*) :: openclose !< string indicating whether NetCDF needs to be opend or closed 1133 CHARACTER(LEN=*) :: variable_name !< string indicating whether NetCDF needs to be opend or closed 1134 1135 INTEGER(iwp) :: id_mod !< NetCDF id of input file 1136 1137 LOGICAL :: global !< flag indicating a global or a variable's attribute 1138 1139 REAL(wp) :: val !< value of the attribute 1140 1141 #if defined ( __netcdf ) 1142 ! 1143 !-- Open file in read-only mode 1144 IF ( openclose == 'open' ) THEN 1145 CALL open_read_file( TRIM( input_file ) // TRIM( coupling_char ), & 1146 id_mod ) 1147 ENDIF 1148 ! 1149 !-- Read global attribute 1150 IF ( global ) THEN 1151 CALL get_attribute( id_mod, search_string, val, global ) 1152 ! 1153 !-- Read variable attribute 1154 ELSE 1155 CALL get_attribute( id_mod, search_string, val, global, variable_name ) 1156 ENDIF 1157 ! 1158 !-- Finally, close input file 1159 IF ( openclose == 'close' ) CALL close_input_file( id_mod ) 1160 #endif 1161 1162 END SUBROUTINE netcdf_data_input_att_real 935 1163 936 1164 !------------------------------------------------------------------------------! … … 1022 1250 ! the other dimensions depend on the mode of the emissions or on the presence of specific components 1023 1251 !nspecies 1024 CALL get_dimension_length( id_emis, emt_att%nspec, 'nspecies' )1252 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%nspec, 'nspecies' ) 1025 1253 1026 1254 … … 1051 1279 1052 1280 !number of categories 1053 CALL get_dimension_length( id_emis, emt_att%ncat, 'ncat' )1281 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%ncat, 'ncat' ) 1054 1282 1055 1283 !-- Read EMISSION CATEGORIES INDEX … … 1064 1292 IF (TRIM(emt_att%species_name(ispec))=="VOC" .OR. TRIM(emt_att%species_name(ispec))=="voc") THEN 1065 1293 !Allocate Array 1066 CALL get_dimension_length( id_emis, emt_att%nvoc, 'nvoc' )1294 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%nvoc, 'nvoc' ) 1067 1295 ALLOCATE(emt_att%voc_name(1:emt_att%nvoc)) 1068 1296 !Read-in Variable … … 1081 1309 !-- EMISSION_PM_NAME (1-DIMENSIONAL) 1082 1310 IF (TRIM(emt_att%species_name(ispec))=="PM" .OR. TRIM(emt_att%species_name(ispec))=="pm") THEN 1083 CALL get_dimension_length( id_emis, emt_att%npm, 'npm' )1311 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%npm, 'npm' ) 1084 1312 ALLOCATE(emt_att%pm_name(1:emt_att%npm)) 1085 1313 !Read-in Variable … … 1118 1346 IF (TRIM(time_fac_type)=="HOUR" .OR. TRIM(time_fac_type)=="hour") THEN 1119 1347 !-- Allocate Array 1120 CALL get_dimension_length( id_emis, emt_att%nhoursyear, 'nhoursyear' )1348 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%nhoursyear, 'nhoursyear' ) 1121 1349 ALLOCATE(emt_att%hourly_emis_time_factor(1:emt_att%ncat,1:emt_att%nhoursyear)) 1122 1350 !Read-in Variable … … 1127 1355 ELSE IF (TRIM(time_fac_type) == "MDH" .OR. TRIM(time_fac_type) == "mdh") THEN 1128 1356 !-- Allocate Array 1129 CALL get_dimension_length( id_emis, emt_att%nmonthdayhour, 'nmonthdayhour' )1357 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%nmonthdayhour, 'nmonthdayhour' ) 1130 1358 ALLOCATE(emt_att%mdh_emis_time_factor(1:emt_att%ncat,1:emt_att%nmonthdayhour)) 1131 1359 !-- Read-in Variable … … 1176 1404 IF (TRIM(emt_att%species_name(ispec))=="VOC" .OR. TRIM(emt_att%species_name(ispec))=="voc") THEN 1177 1405 !Allocate Array 1178 CALL get_dimension_length( id_emis, emt_att%nvoc, 'nvoc' )1406 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%nvoc, 'nvoc' ) 1179 1407 ALLOCATE(emt_att%voc_name(1:emt_att%nvoc)) 1180 1408 !Read-in Variable … … 1194 1422 !-- EMISSION_VALUES (4-DIMENSIONAL) 1195 1423 !Calculate temporal dimension length 1196 CALL get_dimension_length( id_emis, emt_att%dt_emission, 'time' )1424 CALL netcdf_data_input_get_dimension_length( id_emis, emt_att%dt_emission, 'time' ) 1197 1425 1198 1426 … … 1294 1522 ! 1295 1523 !-- Inquire number of vertical vegetation layer 1296 CALL get_dimension_length( id_surf, leaf_area_density_f%nz, & 1297 'zlad' ) 1524 CALL netcdf_data_input_get_dimension_length( id_surf, & 1525 leaf_area_density_f%nz, & 1526 'zlad' ) 1298 1527 ! 1299 1528 !-- Allocate variable for leaf-area density … … 1318 1547 ! 1319 1548 !-- Inquire number of vertical vegetation layer 1320 CALL get_dimension_length( id_surf, basal_area_density_f%nz, & 1321 'zlad' ) 1549 CALL netcdf_data_input_get_dimension_length( id_surf, & 1550 basal_area_density_f%nz, & 1551 'zlad' ) 1322 1552 ! 1323 1553 !-- Allocate variable … … 1341 1571 ! 1342 1572 !-- Inquire number of vertical soil layers 1343 CALL get_dimension_length( id_surf,&1344 root_area_density_lad_f%nz,&1345 'zsoil' )1573 CALL netcdf_data_input_get_dimension_length( id_surf, & 1574 root_area_density_lad_f%nz, & 1575 'zsoil' ) 1346 1576 ! 1347 1577 !-- Allocate variable … … 1427 1657 ! 1428 1658 !-- Obtain number of soil layers from file. 1429 CALL get_dimension_length( id_surf, nz_soil, 'zsoil' ) 1659 CALL netcdf_data_input_get_dimension_length( id_surf, nz_soil, & 1660 'zsoil' ) 1430 1661 1431 1662 ALLOCATE ( soil_type_f%var_3d(0:nz_soil,nys:nyn,nxl:nxr) ) … … 1479 1710 ! 1480 1711 !-- Inquire number of surface fractions 1481 CALL get_dimension_length( id_surf,&1482 surface_fraction_f%nf,&1483 'nsurface_fraction' )1712 CALL netcdf_data_input_get_dimension_length( id_surf, & 1713 surface_fraction_f%nf, & 1714 'nsurface_fraction' ) 1484 1715 ! 1485 1716 !-- Allocate dimension array and input array for surface fractions … … 1508 1739 ! 1509 1740 !-- Inquire number of building parameters 1510 CALL get_dimension_length( id_surf,&1511 building_pars_f%np,&1512 'nbuilding_pars' )1741 CALL netcdf_data_input_get_dimension_length( id_surf, & 1742 building_pars_f%np, & 1743 'nbuilding_pars' ) 1513 1744 ! 1514 1745 !-- Allocate dimension array and input array for building parameters … … 1551 1782 ! 1552 1783 !-- Inquire number of albedo parameters 1553 CALL get_dimension_length( id_surf, albedo_pars_f%np, & 1554 'nalbedo_pars' ) 1784 CALL netcdf_data_input_get_dimension_length( id_surf, & 1785 albedo_pars_f%np, & 1786 'nalbedo_pars' ) 1555 1787 ! 1556 1788 !-- Allocate dimension array and input array for albedo parameters … … 1578 1810 ! 1579 1811 !-- Inquire number of pavement parameters 1580 CALL get_dimension_length( id_surf, pavement_pars_f%np, & 1581 'npavement_pars' ) 1812 CALL netcdf_data_input_get_dimension_length( id_surf, & 1813 pavement_pars_f%np, & 1814 'npavement_pars' ) 1582 1815 ! 1583 1816 !-- Allocate dimension array and input array for pavement parameters … … 1606 1839 ! 1607 1840 !-- Inquire number of parameters 1608 CALL get_dimension_length( id_surf,&1609 pavement_subsurface_pars_f%np,&1610 'npavement_subsurface_pars' )1841 CALL netcdf_data_input_get_dimension_length( id_surf, & 1842 pavement_subsurface_pars_f%np, & 1843 'npavement_subsurface_pars' ) 1611 1844 ! 1612 1845 !-- Inquire number of soil layers 1613 CALL get_dimension_length( id_surf,&1614 pavement_subsurface_pars_f%nz,&1615 'zsoil' )1846 CALL netcdf_data_input_get_dimension_length( id_surf, & 1847 pavement_subsurface_pars_f%nz, & 1848 'zsoil' ) 1616 1849 ! 1617 1850 !-- Allocate dimension array and input array for pavement parameters … … 1646 1879 ! 1647 1880 !-- Inquire number of vegetation parameters 1648 CALL get_dimension_length( id_surf, vegetation_pars_f%np, & 1649 'nvegetation_pars' ) 1881 CALL netcdf_data_input_get_dimension_length( id_surf, & 1882 vegetation_pars_f%np, & 1883 'nvegetation_pars' ) 1650 1884 ! 1651 1885 !-- Allocate dimension array and input array for surface fractions … … 1679 1913 ! 1680 1914 !-- Inquire number of soil parameters 1681 CALL get_dimension_length( id_surf,&1682 soil_pars_f%np,&1683 'nsoil_pars' )1915 CALL netcdf_data_input_get_dimension_length( id_surf, & 1916 soil_pars_f%np, & 1917 'nsoil_pars' ) 1684 1918 ! 1685 1919 !-- Read parameters array … … 1691 1925 !-- soil layers, allocate memory and read the respective dimension 1692 1926 IF ( soil_pars_f%lod == 2 ) THEN 1693 CALL get_dimension_length( id_surf, soil_pars_f%nz, 'zsoil' ) 1927 CALL netcdf_data_input_get_dimension_length( id_surf, & 1928 soil_pars_f%nz, & 1929 'zsoil' ) 1694 1930 1695 1931 ALLOCATE( soil_pars_f%layers(0:soil_pars_f%nz-1) ) … … 1730 1966 ! 1731 1967 !-- Inquire number of water parameters 1732 CALL get_dimension_length( id_surf,&1733 water_pars_f%np,&1734 'nwater_pars' )1968 CALL netcdf_data_input_get_dimension_length( id_surf, & 1969 water_pars_f%np, & 1970 'nwater_pars' ) 1735 1971 ! 1736 1972 !-- Allocate dimension array and input array for water parameters … … 1756 1992 ! 1757 1993 !-- Obtain number of soil layers from file and allocate variable 1758 CALL get_dimension_length( id_surf, root_area_density_lsm_f%nz, & 1759 'zsoil' ) 1994 CALL netcdf_data_input_get_dimension_length( id_surf, & 1995 root_area_density_lsm_f%nz, & 1996 'zsoil' ) 1760 1997 ALLOCATE( root_area_density_lsm_f%var & 1761 1998 (0:root_area_density_lsm_f%nz-1, & … … 2309 2546 ! 2310 2547 !-- Read x, y - dimensions. Only required for consistency checks. 2311 CALL get_dimension_length( id_topo, dim_static%nx, 'x' )2312 CALL get_dimension_length( id_topo, dim_static%ny, 'y' )2548 CALL netcdf_data_input_get_dimension_length( id_topo, dim_static%nx, 'x' ) 2549 CALL netcdf_data_input_get_dimension_length( id_topo, dim_static%ny, 'y' ) 2313 2550 ALLOCATE( dim_static%x(0:dim_static%nx-1) ) 2314 2551 ALLOCATE( dim_static%y(0:dim_static%ny-1) ) … … 2371 2608 .FALSE., 'buildings_3d' ) 2372 2609 2373 CALL get_dimension_length( id_topo, buildings_f%nz, 'z' ) 2610 CALL netcdf_data_input_get_dimension_length( id_topo, & 2611 buildings_f%nz, 'z' ) 2374 2612 ! 2375 2613 !-- Read 3D buildings … … 2609 2847 ! 2610 2848 !-- Read vertical dimension of scalar und w grid. 2611 CALL get_dimension_length( id_dynamic, init_3d%nzu, 'z' )2612 CALL get_dimension_length( id_dynamic, init_3d%nzw, 'zw' )2849 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzu, 'z' ) 2850 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzw, 'zw' ) 2613 2851 ! 2614 2852 !-- Read also the horizontal dimensions. These are used just used fo 2615 2853 !-- checking the compatibility with the PALM grid before reading. 2616 CALL get_dimension_length( id_dynamic, init_3d%nx, 'x' )2617 CALL get_dimension_length( id_dynamic, init_3d%nxu, 'xu' )2618 CALL get_dimension_length( id_dynamic, init_3d%ny, 'y' )2619 CALL get_dimension_length( id_dynamic, init_3d%nyv, 'yv' )2854 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nx, 'x' ) 2855 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nxu, 'xu' ) 2856 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%ny, 'y' ) 2857 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nyv, 'yv' ) 2620 2858 2621 2859 ! … … 3065 3303 !-- Read vertical dimension for soil depth. 3066 3304 IF ( check_existence( var_names, 'zsoil' ) ) & 3067 CALL get_dimension_length( id_dynamic, init_3d%nzs, 'zsoil' ) 3305 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nzs,& 3306 'zsoil' ) 3068 3307 ! 3069 3308 !-- Read also the horizontal dimensions required for soil initialization. … … 3071 3310 !-- these data is already available, but will be read again for the sake 3072 3311 !-- of clearness. 3073 CALL get_dimension_length( id_dynamic, init_3d%nx, 'x' ) 3074 CALL get_dimension_length( id_dynamic, init_3d%ny, 'y' ) 3312 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%nx, & 3313 'x' ) 3314 CALL netcdf_data_input_get_dimension_length( id_dynamic, init_3d%ny, & 3315 'y' ) 3075 3316 ! 3076 3317 !-- Check for correct horizontal and vertical dimension. Please note, … … 3207 3448 ! 3208 3449 !-- Read time dimension, allocate memory and finally read time array 3209 CALL get_dimension_length( id_dynamic, nest_offl%nt, 'time' ) 3450 CALL netcdf_data_input_get_dimension_length( id_dynamic, & 3451 nest_offl%nt, 'time' ) 3210 3452 3211 3453 IF ( check_existence( nest_offl%var_names, 'time' ) ) THEN … … 3215 3457 ! 3216 3458 !-- Read vertical dimension of scalar und w grid 3217 CALL get_dimension_length( id_dynamic, nest_offl%nzu, 'z' ) 3218 CALL get_dimension_length( id_dynamic, nest_offl%nzw, 'zw' ) 3459 CALL netcdf_data_input_get_dimension_length( id_dynamic, & 3460 nest_offl%nzu, 'z' ) 3461 CALL netcdf_data_input_get_dimension_length( id_dynamic, & 3462 nest_offl%nzw, 'zw' ) 3219 3463 3220 3464 IF ( check_existence( nest_offl%var_names, 'z' ) ) THEN … … 4538 4782 !> Get dimension array for a given dimension 4539 4783 !------------------------------------------------------------------------------! 4540 SUBROUTINE get_dimension_length( id, dim_len, variable_name ) 4784 SUBROUTINE netcdf_data_input_get_dimension_length( id, dim_len, & 4785 variable_name ) 4541 4786 #if defined( __netcdf ) 4542 4787 … … 4555 4800 !-- First, inquire dimension ID 4556 4801 nc_stat = NF90_INQ_DIMID( id, TRIM( variable_name ), id_dim ) 4557 CALL handle_error( 'get_dimension_length', 526, variable_name ) 4802 CALL handle_error( 'netcdf_data_input_get_dimension_length', 526, & 4803 variable_name ) 4558 4804 ! 4559 4805 !-- Inquire dimension length 4560 4806 nc_stat = NF90_INQUIRE_DIMENSION( id, id_dim, dum, LEN = dim_len ) 4561 CALL handle_error( 'get_dimension_length', 526, variable_name ) 4807 CALL handle_error( 'netcdf_data_input_get_dimension_length', 526, & 4808 variable_name ) 4562 4809 4563 4810 #endif 4564 END SUBROUTINE get_dimension_length4811 END SUBROUTINE netcdf_data_input_get_dimension_length 4565 4812 4566 4813 !------------------------------------------------------------------------------! 4567 4814 ! Description: 4568 4815 ! ------------ 4569 !> Routine for reading-in a character string from the chem emissions netcdf input file.4570 ! ------------------------------------------------------------------------------!4571 4572 SUBROUTINE get_variable_string( id, variable_name, var_string, names_number)4816 !> Routine for reading-in a character string from the chem emissions netcdf 4817 !> input file. 4818 !------------------------------------------------------------------------------! 4819 SUBROUTINE get_variable_string( id, variable_name, var_string, names_number) 4573 4820 #if defined( __netcdf ) 4574 4821 4575 USE indices4576 USE pegrid4577 4578 IMPLICIT NONE4579 4580 CHARACTER (LEN=25), ALLOCATABLE, DIMENSION(:), INTENT(INOUT) :: var_string4581 4582 CHARACTER(LEN=*) :: variable_name !> variable name4583 4584 CHARACTER (LEN=1), ALLOCATABLE, DIMENSION(:,:) :: tmp_var_string !> variable to be read4585 4586 4587 INTEGER(iwp), INTENT(IN) :: id !> file id4588 4589 INTEGER(iwp), INTENT(IN) :: names_number !> number of names4590 4591 INTEGER(iwp) :: id_var !> variable id4592 4593 INTEGER(iwp) :: i,j !> index to go through the length of the dimensions4594 4595 INTEGER(iwp) :: max_string_length=25 !> this is both the maximum length of a name, but also4822 USE indices 4823 USE pegrid 4824 4825 IMPLICIT NONE 4826 4827 CHARACTER (LEN=25), ALLOCATABLE, DIMENSION(:), INTENT(INOUT) :: var_string 4828 4829 CHARACTER(LEN=*) :: variable_name !> variable name 4830 4831 CHARACTER (LEN=1), ALLOCATABLE, DIMENSION(:,:) :: tmp_var_string !> variable to be read 4832 4833 4834 INTEGER(iwp), INTENT(IN) :: id !> file id 4835 4836 INTEGER(iwp), INTENT(IN) :: names_number !> number of names 4837 4838 INTEGER(iwp) :: id_var !> variable id 4839 4840 INTEGER(iwp) :: i,j !> index to go through the length of the dimensions 4841 4842 INTEGER(iwp) :: max_string_length=25 !> this is both the maximum length of a name, but also 4596 4843 ! the number of the components of the first dimensions 4597 4844 ! (rows) 4598 4845 4599 4846 4600 ALLOCATE(tmp_var_string(max_string_length,names_number))4601 4602 ALLOCATE(var_string(names_number))4847 ALLOCATE(tmp_var_string(max_string_length,names_number)) 4848 4849 ALLOCATE(var_string(names_number)) 4603 4850 4604 4851 !-- Inquire variable id 4605 nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )4852 nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var ) 4606 4853 4607 4854 4608 4855 !-- Get variable 4609 4856 !-- Start cycle over the emission species 4610 DO i = 1, names_number4857 DO i = 1, names_number 4611 4858 !-- read the first letter of each component 4612 nc_stat = NF90_GET_VAR( id, id_var, var_string(i), start = (/ 1,i /), &4859 nc_stat = NF90_GET_VAR( id, id_var, var_string(i), start = (/ 1,i /), & 4613 4860 count = (/ 1,1 /) ) 4614 CALL handle_error( 'get_variable_string', 701 )4861 CALL handle_error( 'get_variable_string', 701 ) 4615 4862 4616 4863 !-- Start cycle over charachters 4617 DO j = 1, max_string_length4864 DO j = 1, max_string_length 4618 4865 4619 4866 !-- read the rest of the components of the name 4620 nc_stat = NF90_GET_VAR( id, id_var, tmp_var_string(j,i), start = (/ j,i /),&4867 nc_stat = NF90_GET_VAR( id, id_var, tmp_var_string(j,i), start = (/ j,i /),& 4621 4868 count = (/ 1,1 /) ) 4622 CALL handle_error( 'get_variable_string', 702 )4623 4624 IF ( iachar(tmp_var_string(j,i) ) == 0 ) THEN4625 tmp_var_string(j,i)=''4626 ENDIF4627 4628 IF ( j>1 ) THEN4629 !-- Concatenate first letter of the name and the others4630 var_string(i)=TRIM(var_string(i)) // TRIM(tmp_var_string(j,i))4631 4632 ENDIF4633 ENDDO4634 ENDDO4869 CALL handle_error( 'get_variable_string', 702 ) 4870 4871 IF ( iachar(tmp_var_string(j,i) ) == 0 ) THEN 4872 tmp_var_string(j,i)='' 4873 ENDIF 4874 4875 IF ( j>1 ) THEN 4876 !-- Concatenate first letter of the name and the others 4877 var_string(i)=TRIM(var_string(i)) // TRIM(tmp_var_string(j,i)) 4878 4879 ENDIF 4880 ENDDO 4881 ENDDO 4635 4882 4636 4883 #endif 4637 END SUBROUTINE get_variable_string 4638 4639 4884 END SUBROUTINE get_variable_string 4885 4886 !------------------------------------------------------------------------------! 4887 ! Description: 4888 ! ------------ 4889 !> Reads a character variable in a 1D array 4890 !------------------------------------------------------------------------------! 4891 SUBROUTINE get_variable_1d_char( id, variable_name, var ) 4892 4893 USE pegrid 4894 4895 IMPLICIT NONE 4896 4897 CHARACTER(LEN=*) :: variable_name !< variable name 4898 CHARACTER(LEN=*), DIMENSION(:), INTENT(INOUT) :: var !< variable to be read 4899 4900 INTEGER(iwp) :: i !< running index over variable dimension 4901 INTEGER(iwp), INTENT(IN) :: id !< file id 4902 INTEGER(iwp) :: id_var !< dimension id 4903 4904 INTEGER(iwp), DIMENSION(2) :: dimid !< dimension IDs 4905 INTEGER(iwp), DIMENSION(2) :: dimsize !< dimension size 4906 4907 #if defined( __netcdf ) 4908 4909 ! 4910 !-- First, inquire variable ID 4911 nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var ) 4912 CALL handle_error( 'get_variable_1d_int', 527, variable_name ) 4913 ! 4914 !-- Inquire dimension IDs 4915 nc_stat = NF90_INQUIRE_VARIABLE( id, id_var, dimids = dimid(1:2) ) 4916 CALL handle_error( 'get_variable_1d_char', 527, variable_name ) 4917 ! 4918 !-- Read dimesnion length 4919 nc_stat = NF90_INQUIRE_DIMENSION( id, dimid(1), LEN = dimsize(1) ) 4920 nc_stat = NF90_INQUIRE_DIMENSION( id, dimid(2), LEN = dimsize(2) ) 4921 4922 ! 4923 !-- Read character array. Note, each element is read individually, in order 4924 !-- to better separate single strings. 4925 DO i = 1, dimsize(2) 4926 nc_stat = NF90_GET_VAR( id, id_var, var(i), & 4927 start = (/ 1, i /), & 4928 count = (/ dimsize(1), 1 /) ) 4929 CALL handle_error( 'get_variable_1d_char', 527, variable_name ) 4930 ENDDO 4931 4932 #endif 4933 END SUBROUTINE get_variable_1d_char 4934 4935 4640 4936 !------------------------------------------------------------------------------! 4641 4937 ! Description: … … 4803 5099 ELSE 4804 5100 ! 4805 !-- Allocate temporary variable according to memory access on file. 4806 ALLOCATE( tmp(is:ie,js:je) ) 4807 ! 4808 !-- Get variable 4809 nc_stat = NF90_GET_VAR( id, id_var, tmp, & 4810 start = (/ is+1, js+1 /), & 4811 count = (/ ie-is + 1, je-js+1 /) ) 4812 5101 !-- Allocate temporary variable according to memory access on file. 5102 ALLOCATE( tmp(is:ie,js:je) ) 5103 ! 5104 !-- Get variable 5105 nc_stat = NF90_GET_VAR( id, id_var, tmp, & 5106 start = (/ is+1, js+1 /), & 5107 count = (/ ie-is + 1, je-js+1 /) ) 4813 5108 CALL handle_error( 'get_variable_2d_real', 530, variable_name ) 4814 5109 ! 4815 !-- Resort data. Please note, dimension subscripts of var all start at 1.5110 !-- Resort data. Please note, dimension subscripts of var all start at 1. 4816 5111 DO i = is, ie 4817 5112 DO j = js, je … … 5089 5384 #endif 5090 5385 END SUBROUTINE get_variable_3d_real 5091 5092 !------------------------------------------------------------------------------!5093 ! Description:5094 ! ------------5095 !> Reads a 3D float array from file.5096 !------------------------------------------------------------------------------!5097 ! SUBROUTINE get_variable_3d_real_v( id, variable_name, is, ie, js, je, var )5098 !5099 ! USE indices5100 ! USE pegrid5101 !5102 ! IMPLICIT NONE5103 !5104 ! CHARACTER(LEN=*) :: variable_name !< variable name5105 !5106 ! INTEGER(iwp), INTENT(IN) :: is,ie !< index range along x direction5107 ! INTEGER(iwp), INTENT(IN) :: id !< file id5108 ! INTEGER(iwp) :: id_var !< variable id5109 ! INTEGER(iwp), INTENT(IN) :: js,je !< index range along y direction5110 ! INTEGER(iwp) :: n3 !< number of data-points along 3rd dimension5111 !5112 ! INTEGER(iwp) :: i,j,k5113 ! INTEGER(iwp), DIMENSION(3) :: id_dim5114 !5115 ! REAL(wp), DIMENSION(:,:,:), INTENT(INOUT) :: var !< variable to be read5116 ! #if defined( __netcdf )5117 ! !5118 ! !-- Inside the ...static NetCDF files, the array is stored as float.5119 ! !-- Therefore single precision is sufficiant for the temporary array5120 !5121 ! REAL(sp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_var !< temporary array to read NetCDF data in i,j,k direction5122 !5123 ! !kk Please check, if it is time consuming to do the inquire every time5124 ! !5125 ! !-- Inquire variable id5126 ! nc_stat = NF90_INQ_VARID( id, TRIM( variable_name ), id_var )5127 ! !5128 ! !-- Get length of third dimension, required for the count parameter.5129 ! !-- Therefore, first inquired dimension ids5130 ! nc_stat = NF90_INQUIRE_VARIABLE( id, id_var, DIMIDS = id_dim )5131 ! nc_stat = NF90_INQUIRE_DIMENSION( id, id_dim(3), LEN = n3 )5132 !5133 ! !5134 ! !-- Check for collective read-operation and set respective NetCDF flags if5135 ! !-- required.5136 ! IF ( collective_read ) THEN5137 ! #if defined( __netcdf4_parallel )5138 ! nc_stat = NF90_VAR_PAR_ACCESS (id, id_var, NF90_COLLECTIVE)5139 ! #endif5140 ! ENDIF5141 !5142 ! !5143 ! !-- Allocate temporary array ro read NetCDF data in i,j,k direction5144 !5145 ! ALLOCATE(tmp_var(is:ie,js:je,n3))5146 ! !5147 ! !-- Get variable5148 ! !-- Read complete local 3-D array in oone call5149 !5150 ! nc_stat = NF90_GET_VAR( id, id_var, tmp_var, &5151 ! start = (/ is+1, js+1, 1 /), &5152 ! count = (/ ie-is+1, je-js+1, n3 /) )5153 !5154 ! CALL handle_error( 'get_variable_3d_real', 532 )5155 !5156 ! !5157 ! !-- Resort data in k,j,i direction5158 !5159 ! DO i=is,ie5160 ! DO j=js,je5161 ! DO K=1,n35162 ! var (k,j-js+1,i-is+1) = tmp_var(i,j,k)5163 ! END DO5164 ! END DO5165 ! END DO5166 !5167 ! DEALLOCATE(tmp_var)5168 !5169 ! #endif5170 ! END SUBROUTINE get_variable_3d_real_v5171 5172 5386 5173 5387 !------------------------------------------------------------------------------! -
palm/trunk/SOURCE/parin.f90
r3469 r3472 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Add virtual measurement module 23 23 ! 24 24 ! Former revisions: … … 558 558 USE vertical_nesting_mod, & 559 559 ONLY: vnest_start_time 560 561 USE virtual_measurement_mod, & 562 ONLY: vm_parin 560 563 561 564 USE wind_turbine_model_mod, & … … 926 929 CALL im_parin 927 930 CALL salsa_parin 931 CALL vm_parin 928 932 ! 929 933 !-- Read user-defined variables -
palm/trunk/SOURCE/time_integration.f90
r3469 r3472 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! new module for virtual measurements introduced 23 23 ! 24 24 ! Former revisions: … … 458 458 use_initial_profile_as_reference, & 459 459 use_single_reference_value, uv_exposure, u_gtrans, v_gtrans, & 460 virtual_flight, wind_turbine, ws_scheme_mom, ws_scheme_sca 460 virtual_flight, virtual_measurement, wind_turbine, & 461 ws_scheme_mom, ws_scheme_sca 461 462 462 463 USE cpulog, & … … 581 582 vnest_deallocate, vnest_init, vnest_init_fine, & 582 583 vnest_start_time 584 585 USE virtual_measurement_mod, & 586 ONLY: vm_sampling, vm_time_start 583 587 584 588 IMPLICIT NONE … … 1458 1462 CALL data_output_flight 1459 1463 ENDIF 1464 ! 1465 !-- Take virtual measurements 1466 IF ( virtual_measurement .AND. & 1467 vm_time_start <= time_since_reference_point ) CALL vm_sampling 1460 1468 1461 1469 !
Note: See TracChangeset
for help on using the changeset viewer.