Changeset 3209 for palm/trunk/SOURCE/land_surface_model_mod.f90
- Timestamp:
- Aug 27, 2018 4:58:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/land_surface_model_mod.f90
r3196 r3209 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Enable optional initialization of soil properties directly from dynamic 23 ! input file. 23 24 ! 24 25 ! Former revisions: … … 465 466 USE netcdf_data_input_mod, & 466 467 ONLY : building_type_f, init_3d, input_pids_static, & 467 netcdf_data_input_interpolate, 468 netcdf_data_input_interpolate, netcdf_data_input_init_lsm, & 468 469 pavement_pars_f, pavement_subsurface_pars_f, pavement_type_f, & 469 470 root_area_density_lsm_f, soil_pars_f, soil_type_f, & … … 2454 2455 IMPLICIT NONE 2455 2456 2456 LOGICAL :: init_soil_ dynamically_in_child!< flag controlling initialization of soil in child domains2457 LOGICAL :: init_soil_from_parent !< flag controlling initialization of soil in child domains 2457 2458 2458 2459 INTEGER(iwp) :: i !< running index … … 4020 4021 IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN 4021 4022 ! 4022 !-- In case of nested runs, check if soil is initialized via dynamic 4023 !-- input file in root domain and distribute this information 4024 !-- to all embedded child domains. This case, soil moisture and 4025 !-- temperature will be initialized via root domain. 4026 init_soil_dynamically_in_child = .FALSE. 4023 !-- Read soil properties from dynamic input file 4024 CALL netcdf_data_input_init_lsm 4025 ! 4026 !-- In case no dynamic input is available for a child domain but root 4027 !-- domain is initialized with dynamic input file, the different soil 4028 !-- properties can lead to significant discrepancies in the atmospheric 4029 !-- surface forcing. For this reason, the child domain 4030 !-- is initialized with mean soil profiles from the root domain. 4031 init_soil_from_parent = .FALSE. 4027 4032 IF ( nested_run ) THEN 4028 4033 #if defined( __parallel ) 4029 4034 CALL MPI_ALLREDUCE( init_3d%from_file_tsoil .OR. & 4030 4035 init_3d%from_file_msoil, & 4031 init_soil_ dynamically_in_child,&4036 init_soil_from_parent, & 4032 4037 1, MPI_LOGICAL, MPI_LOR, MPI_COMM_WORLD, ierr ) 4033 4038 #endif 4034 4039 ENDIF 4035 4036 4040 ! 4037 4041 !-- First, initialize soil temperature and moisture. … … 4065 4069 ! 4066 4070 !-- Initialization of soil moisture and temperature from file. 4067 !-- In case of n ested runs, only root parent reads dynamic input file.4068 !-- This case, transfer respective soil information provide4069 !-- by dynamic input file from root parent domain onto all otherdomains.4070 IF ( init_soil_ dynamically_in_child) THEN4071 !-- In case of no dynamic input file is available for the child domain, 4072 !-- transfer soil mean profiles from the root-parent domain onto all 4073 !-- child domains. 4074 IF ( init_soil_from_parent ) THEN 4071 4075 ! 4072 4076 !-- Child domains will be only initialized with horizontally … … 4079 4083 4080 4084 DO k = 0, init_3d%nzs-1 4081 pr_soil_init(k) = SUM( init_3d%msoil (k,nys:nyn,nxl:nxr) )4085 pr_soil_init(k) = SUM( init_3d%msoil_3d(k,nys:nyn,nxl:nxr) ) 4082 4086 ENDDO 4083 4087 ! 4084 4088 !-- Allocate 1D array for soil-moisture profile (will not be 4085 4089 !-- allocated in lod==2 case). 4086 ALLOCATE( init_3d%msoil_ init(0:init_3d%nzs-1) )4087 init_3d%msoil_ init= 0.0_wp4090 ALLOCATE( init_3d%msoil_1d(0:init_3d%nzs-1) ) 4091 init_3d%msoil_1d = 0.0_wp 4088 4092 #if defined( __parallel ) 4089 CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%msoil_ init(0),&4093 CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%msoil_1d(0), & 4090 4094 SIZE(pr_soil_init), & 4091 4095 MPI_REAL, MPI_SUM, comm2d, ierr ) 4092 4096 #endif 4093 init_3d%msoil_ init = init_3d%msoil_init /&4097 init_3d%msoil_1d = init_3d%msoil_1d / & 4094 4098 REAL( ( nx + 1 ) * ( ny + 1), KIND=wp ) 4095 4099 DEALLOCATE( pr_soil_init ) … … 4099 4103 4100 4104 DO k = 0, init_3d%nzs-1 4101 pr_soil_init(k) = SUM( init_3d%tsoil (k,nys:nyn,nxl:nxr) )4105 pr_soil_init(k) = SUM( init_3d%tsoil_3d(k,nys:nyn,nxl:nxr) ) 4102 4106 ENDDO 4103 4107 ! 4104 4108 !-- Allocate 1D array for soil-temperature profile (will not be 4105 4109 !-- allocated in lod==2 case). 4106 ALLOCATE( init_3d%tsoil_ init(0:init_3d%nzs-1) )4107 init_3d%tsoil_ init= 0.0_wp4110 ALLOCATE( init_3d%tsoil_1d(0:init_3d%nzs-1) ) 4111 init_3d%tsoil_1d = 0.0_wp 4108 4112 #if defined( __parallel ) 4109 CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%tsoil_ init(0),&4113 CALL MPI_ALLREDUCE( pr_soil_init(0), init_3d%tsoil_1d(0), & 4110 4114 SIZE(pr_soil_init), & 4111 4115 MPI_REAL, MPI_SUM, comm2d, ierr ) 4112 4116 #endif 4113 init_3d%tsoil_ init = init_3d%tsoil_init /&4117 init_3d%tsoil_1d = init_3d%tsoil_1d / & 4114 4118 REAL( ( nx + 1 ) * ( ny + 1), KIND=wp ) 4115 4119 DEALLOCATE( pr_soil_init ) … … 4132 4136 ! 4133 4137 !-- ALLOCATE arrays on child domains and set control attributes. 4134 IF ( .NOT. init_3d%from_file_msoil ) THEN 4135 ALLOCATE( init_3d%msoil_init(0:init_3d%nzs-1) ) 4136 init_3d%lod_msoil = 1 4138 !-- Note, 1d soil profiles are allocated even though soil information 4139 !-- is already read from dynamic file in one child domain. 4140 !-- This case, however, data is not used for further initialization 4141 !-- since the LoD=2. 4142 IF ( .NOT. ALLOCATED( init_3d%msoil_1d ) ) THEN 4143 ALLOCATE( init_3d%msoil_1d(0:init_3d%nzs-1) ) 4144 IF( .NOT. init_3d%from_file_msoil ) init_3d%lod_msoil = 1 4137 4145 init_3d%from_file_msoil = .TRUE. 4138 4146 ENDIF 4139 IF ( .NOT. init_3d%from_file_tsoil) THEN4140 ALLOCATE( init_3d%tsoil_ init(0:init_3d%nzs-1) )4141 init_3d%lod_tsoil = 14147 IF ( .NOT. ALLOCATED( init_3d%tsoil_1d ) ) THEN 4148 ALLOCATE( init_3d%tsoil_1d(0:init_3d%nzs-1) ) 4149 IF( .NOT. init_3d%from_file_tsoil ) init_3d%lod_tsoil = 1 4142 4150 init_3d%from_file_tsoil = .TRUE. 4143 4151 ENDIF … … 4147 4155 ! 4148 4156 !-- Distribute soil profiles from root to all childs 4149 CALL MPI_BCAST( init_3d%msoil_ init, SIZE(init_3d%msoil_init),&4157 CALL MPI_BCAST( init_3d%msoil_1d, SIZE(init_3d%msoil_1d), & 4150 4158 MPI_REAL, 0, MPI_COMM_WORLD, ierr ) 4151 CALL MPI_BCAST( init_3d%tsoil_ init, SIZE(init_3d%tsoil_init),&4159 CALL MPI_BCAST( init_3d%tsoil_1d, SIZE(init_3d%tsoil_1d), & 4152 4160 MPI_REAL, 0, MPI_COMM_WORLD, ierr ) 4153 4161 #endif … … 4155 4163 ENDIF 4156 4164 ! 4157 !-- Proceed with Level 2 initialization. Information from dynamic input 4158 !-- is now available on all processes. 4165 !-- Proceed with Level 2 initialization. 4159 4166 IF ( init_3d%from_file_msoil ) THEN 4160 4167 … … 4164 4171 CALL netcdf_data_input_interpolate( & 4165 4172 m_soil_h%var_2d(nzb_soil:nzt_soil,m), & 4166 init_3d%msoil_ init(:),&4173 init_3d%msoil_1d(:), & 4167 4174 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4168 4175 nzb_soil, nzt_soil, & … … 4174 4181 CALL netcdf_data_input_interpolate( & 4175 4182 m_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),& 4176 init_3d%msoil_ init(:),&4183 init_3d%msoil_1d(:), & 4177 4184 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4178 4185 nzb_soil, nzt_soil, & … … 4186 4193 j = surf_lsm_h%j(m) 4187 4194 4188 IF ( init_3d%msoil (0,j,i) /= init_3d%fill_msoil )&4195 IF ( init_3d%msoil_3d(0,j,i) /= init_3d%fill_msoil ) & 4189 4196 CALL netcdf_data_input_interpolate( & 4190 4197 m_soil_h%var_2d(nzb_soil:nzt_soil,m), & 4191 init_3d%msoil (:,j,i),&4198 init_3d%msoil_3d(:,j,i), & 4192 4199 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4193 4200 nzb_soil, nzt_soil, & … … 4201 4208 surf_lsm_v(l)%building_covered(m) ) 4202 4209 4203 IF ( init_3d%msoil (0,j,i) /= init_3d%fill_msoil )&4210 IF ( init_3d%msoil_3d(0,j,i) /= init_3d%fill_msoil ) & 4204 4211 CALL netcdf_data_input_interpolate( & 4205 4212 m_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),& 4206 init_3d%msoil (:,j,i),&4213 init_3d%msoil_3d(:,j,i), & 4207 4214 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4208 4215 nzb_soil, nzt_soil, & … … 4221 4228 CALL netcdf_data_input_interpolate( & 4222 4229 t_soil_h%var_2d(nzb_soil:nzt_soil,m), & 4223 init_3d%tsoil_ init(:),&4230 init_3d%tsoil_1d(:), & 4224 4231 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4225 4232 nzb_soil, nzt_soil, & … … 4232 4239 CALL netcdf_data_input_interpolate( & 4233 4240 t_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),& 4234 init_3d%tsoil_ init(:),&4241 init_3d%tsoil_1d(:), & 4235 4242 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4236 4243 nzb_soil, nzt_soil, & … … 4246 4253 j = surf_lsm_h%j(m) 4247 4254 4248 IF ( init_3d% msoil(0,j,i) /= init_3d%fill_msoil )&4255 IF ( init_3d%tsoil_3d(0,j,i) /= init_3d%fill_tsoil ) & 4249 4256 CALL netcdf_data_input_interpolate( & 4250 4257 t_soil_h%var_2d(nzb_soil:nzt_soil,m), & 4251 init_3d%tsoil (:,j,i),&4258 init_3d%tsoil_3d(:,j,i), & 4252 4259 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4253 4260 nzb_soil, nzt_soil, & … … 4262 4269 surf_lsm_v(l)%building_covered(m) ) 4263 4270 4264 IF ( init_3d% msoil(0,j,i) /= init_3d%fill_msoil )&4271 IF ( init_3d%tsoil_3d(0,j,i) /= init_3d%fill_tsoil ) & 4265 4272 CALL netcdf_data_input_interpolate( & 4266 4273 t_soil_v(l)%var_2d(nzb_soil:nzt_soil,m),& 4267 init_3d%tsoil (:,j,i),&4274 init_3d%tsoil_3d(:,j,i), & 4268 4275 zs(nzb_soil:nzt_soil), init_3d%z_soil, & 4269 4276 nzb_soil, nzt_soil, & … … 4311 4318 surf_lsm_h%shf(m) = - surf_lsm_h%us(m) * surf_lsm_h%ts(m) & 4312 4319 * rho_surface 4313 ENDDO4314 ! 4315 !-- Vertical surfaces4316 DO l = 0, 34320 ENDDO 4321 ! 4322 !-- Vertical surfaces 4323 DO l = 0, 3 4317 4324 DO m = 1, surf_lsm_v(l)%ns 4318 4325 i = surf_lsm_v(l)%i(m)
Note: See TracChangeset
for help on using the changeset viewer.