[1682] | 1 | !> @file read_3d_binary.f90 |
---|
[1036] | 2 | !--------------------------------------------------------------------------------! |
---|
| 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | ! either version 3 of the License, or (at your option) any later version. |
---|
| 8 | ! |
---|
| 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | ! |
---|
| 13 | ! You should have received a copy of the GNU General Public License along with |
---|
| 14 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | ! |
---|
[1691] | 16 | ! Copyright 1997-2015 Leibniz Universitaet Hannover |
---|
[1036] | 17 | !--------------------------------------------------------------------------------! |
---|
| 18 | ! |
---|
[257] | 19 | ! Current revisions: |
---|
[1] | 20 | ! ----------------- |
---|
[1401] | 21 | ! |
---|
[1758] | 22 | ! |
---|
[1321] | 23 | ! Former revisions: |
---|
| 24 | ! ----------------- |
---|
| 25 | ! $Id: read_3d_binary.f90 1758 2016-02-22 15:53:28Z hoffmann $ |
---|
| 26 | ! |
---|
[1758] | 27 | ! 1757 2016-02-22 15:49:32Z maronga |
---|
| 28 | ! Bugfix in allocation of radiative heating rates |
---|
| 29 | ! |
---|
[1710] | 30 | ! 1709 2015-11-04 14:47:01Z maronga |
---|
| 31 | ! Added rad_lw_out_change_0, increased binary_version |
---|
| 32 | ! |
---|
[1692] | 33 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
| 34 | ! Added output of radiative heating rates and Obukhov length. Removed output of |
---|
| 35 | ! rif. |
---|
| 36 | ! |
---|
[1683] | 37 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 38 | ! Code annotations made doxygen readable |
---|
| 39 | ! |
---|
[1586] | 40 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
| 41 | ! Adapted for RRTMG |
---|
| 42 | ! |
---|
[1552] | 43 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
| 44 | ! Added support for binary input of land surface and radiation model data. In the |
---|
| 45 | ! course of this work, new temporary arrays tmp_3d_soil1, tmp_3d_soil2 were |
---|
| 46 | ! required. |
---|
| 47 | ! |
---|
[1469] | 48 | ! 1468 2014-09-24 14:06:57Z maronga |
---|
| 49 | ! Adapted for use on up to 6-digit processor cores |
---|
| 50 | ! |
---|
[1401] | 51 | ! 1400 2014-05-09 14:03:54Z knoop |
---|
| 52 | ! reading of arrays for random_generator_parallel added |
---|
| 53 | ! |
---|
[1321] | 54 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 55 | ! ONLY-attribute added to USE-statements, |
---|
| 56 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 57 | ! kinds are defined in new module kinds, |
---|
| 58 | ! old module precision_kind is removed, |
---|
| 59 | ! revision history before 2012 removed, |
---|
| 60 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 61 | ! all variable declaration statements |
---|
[226] | 62 | ! |
---|
[1319] | 63 | ! 1318 2014-03-17 13:35:16Z raasch |
---|
| 64 | ! module interfaces removed |
---|
| 65 | ! |
---|
[1116] | 66 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
| 67 | ! unused variables removed |
---|
| 68 | ! |
---|
[1054] | 69 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
| 70 | ! necessary expansions according to the two new prognostic equations (nr, qr) |
---|
| 71 | ! of the two-moment cloud physics scheme: |
---|
| 72 | ! +prr, prr_av, *, *_av, *s, *sws, *swst |
---|
| 73 | ! |
---|
[1037] | 74 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 75 | ! code put under GPL (PALM 3.9) |
---|
| 76 | ! |
---|
[1002] | 77 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
| 78 | ! all actions concerning leapfrog scheme removed |
---|
| 79 | ! |
---|
[979] | 80 | ! 978 2012-08-09 08:28:32Z fricke |
---|
| 81 | ! +z0h, z0h_av |
---|
| 82 | ! |
---|
[1] | 83 | ! Revision 1.1 2004/04/30 12:47:27 raasch |
---|
| 84 | ! Initial revision |
---|
| 85 | ! |
---|
| 86 | ! |
---|
| 87 | ! Description: |
---|
| 88 | ! ------------ |
---|
[1682] | 89 | !> Binary input of variables and arrays from restart file |
---|
[1] | 90 | !------------------------------------------------------------------------------! |
---|
[1682] | 91 | SUBROUTINE read_3d_binary |
---|
| 92 | |
---|
[1] | 93 | |
---|
[1320] | 94 | USE arrays_3d, & |
---|
[1691] | 95 | ONLY: e, kh, km, ol, p, pt, q, ql, qc, nr, nrs, nrsws, nrswst, qr, & |
---|
| 96 | qrs, qrsws, qrswst, qs, qsws, qswst, sa, saswsb, saswst, & |
---|
[1320] | 97 | rif_wall, shf, ts, tswst, u, u_m_l, u_m_n, u_m_r, u_m_s, us, & |
---|
| 98 | usws, uswst, v, v_m_l, v_m_n, v_m_r, v_m_s, vpt, vsws, vswst, & |
---|
| 99 | w, w_m_l, w_m_n, w_m_r, w_m_s, z0, z0h |
---|
| 100 | |
---|
[1] | 101 | USE averaging |
---|
[1320] | 102 | |
---|
| 103 | USE cloud_parameters, & |
---|
| 104 | ONLY: prr, precipitation_amount |
---|
| 105 | |
---|
| 106 | USE control_parameters, & |
---|
[1359] | 107 | ONLY: iran, message_string, outflow_l, outflow_n, outflow_r, outflow_s |
---|
[1320] | 108 | |
---|
| 109 | USE cpulog, & |
---|
| 110 | ONLY: cpu_log, log_point_s |
---|
| 111 | |
---|
| 112 | USE indices, & |
---|
| 113 | ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, nx_on_file, ny, nys, nysg, nyn, & |
---|
| 114 | nyng, ny_on_file, nzb, nzt |
---|
| 115 | |
---|
| 116 | USE kinds |
---|
| 117 | |
---|
[1551] | 118 | USE land_surface_model_mod, & |
---|
| 119 | ONLY: c_liq_av, c_soil_av, c_veg, c_veg_av, ghf_eb_av, lai_av, & |
---|
| 120 | qsws_eb_av, qsws_liq_eb_av, qsws_soil_eb_av, qsws_veg_eb_av, & |
---|
| 121 | land_surface, m_liq_eb, m_liq_eb_av, m_soil, m_soil_av, & |
---|
| 122 | nzb_soil, nzt_soil, shf_eb_av, t_soil, t_soil_av |
---|
| 123 | |
---|
[1320] | 124 | USE particle_attributes, & |
---|
| 125 | ONLY: iran_part |
---|
| 126 | |
---|
[1] | 127 | USE pegrid |
---|
| 128 | |
---|
[1551] | 129 | USE radiation_model_mod, & |
---|
[1585] | 130 | ONLY: rad_net, rad_net_av, rad_lw_in, rad_lw_in_av, rad_lw_out, & |
---|
[1691] | 131 | rad_lw_cs_hr, rad_lw_cs_hr_av, rad_lw_hr, rad_lw_hr_av, & |
---|
[1709] | 132 | rad_lw_out_av, rad_lw_out_change_0, rad_sw_in, rad_sw_in_av, & |
---|
| 133 | rad_sw_out, rad_sw_out_av, rad_sw_cs_hr, rad_sw_cs_hr_av, & |
---|
| 134 | rad_sw_hr, rad_sw_hr_av |
---|
[1551] | 135 | |
---|
[1320] | 136 | USE random_function_mod, & |
---|
| 137 | ONLY: random_iv, random_iy |
---|
| 138 | |
---|
[1400] | 139 | USE random_generator_parallel, & |
---|
| 140 | ONLY: id_random_array, seq_random_array |
---|
| 141 | |
---|
[1320] | 142 | USE statistics, & |
---|
| 143 | ONLY: spectrum_x, spectrum_y |
---|
| 144 | |
---|
| 145 | |
---|
[1] | 146 | IMPLICIT NONE |
---|
| 147 | |
---|
[1468] | 148 | CHARACTER (LEN=7) :: myid_char_save |
---|
[1320] | 149 | CHARACTER (LEN=10) :: binary_version |
---|
| 150 | CHARACTER (LEN=10) :: version_on_file |
---|
[1] | 151 | CHARACTER (LEN=20) :: field_chr |
---|
| 152 | |
---|
[1682] | 153 | INTEGER(iwp) :: files_to_be_opened !< |
---|
| 154 | INTEGER(iwp) :: i !< |
---|
| 155 | INTEGER(iwp) :: j !< |
---|
| 156 | INTEGER(iwp) :: k !< |
---|
| 157 | INTEGER(iwp) :: myid_on_file !< |
---|
| 158 | INTEGER(iwp) :: numprocs_on_file !< |
---|
| 159 | INTEGER(iwp) :: nxlc !< |
---|
| 160 | INTEGER(iwp) :: nxlf !< |
---|
| 161 | INTEGER(iwp) :: nxlpr !< |
---|
| 162 | INTEGER(iwp) :: nxl_on_file !< |
---|
| 163 | INTEGER(iwp) :: nxrc !< |
---|
| 164 | INTEGER(iwp) :: nxrf !< |
---|
| 165 | INTEGER(iwp) :: nxrpr !< |
---|
| 166 | INTEGER(iwp) :: nxr_on_file !< |
---|
| 167 | INTEGER(iwp) :: nync !< |
---|
| 168 | INTEGER(iwp) :: nynf !< |
---|
| 169 | INTEGER(iwp) :: nynpr !< |
---|
| 170 | INTEGER(iwp) :: nyn_on_file !< |
---|
| 171 | INTEGER(iwp) :: nysc !< |
---|
| 172 | INTEGER(iwp) :: nysf !< |
---|
| 173 | INTEGER(iwp) :: nyspr !< |
---|
| 174 | INTEGER(iwp) :: nys_on_file !< |
---|
| 175 | INTEGER(iwp) :: nzb_on_file !< |
---|
| 176 | INTEGER(iwp) :: nzt_on_file !< |
---|
| 177 | INTEGER(iwp) :: offset_x !< |
---|
| 178 | INTEGER(iwp) :: offset_y !< |
---|
| 179 | INTEGER(iwp) :: shift_x !< |
---|
| 180 | INTEGER(iwp) :: shift_y !< |
---|
[1] | 181 | |
---|
[1682] | 182 | INTEGER(iwp), DIMENSION(numprocs_previous_run) :: file_list !< |
---|
| 183 | INTEGER(iwp), DIMENSION(numprocs_previous_run) :: overlap_count !< |
---|
[146] | 184 | |
---|
[1682] | 185 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxlfa !< |
---|
| 186 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxrfa !< |
---|
| 187 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nynfa !< |
---|
| 188 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nysfa !< |
---|
| 189 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_xa !< |
---|
| 190 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_ya !< |
---|
[216] | 191 | |
---|
[1320] | 192 | REAL(wp) :: rdummy |
---|
[146] | 193 | |
---|
[1682] | 194 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmp_2d !< temporary array for storing 2D data |
---|
| 195 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d !< temporary array for storing 3D data |
---|
| 196 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d_soil1!< temporary array for storing 3D soil model data |
---|
| 197 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3d_soil2!< temporary array for storing 3D soil model data |
---|
| 198 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwul !< |
---|
| 199 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwun !< |
---|
| 200 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwur !< |
---|
| 201 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwus !< |
---|
| 202 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwvl !< |
---|
| 203 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwvn !< |
---|
| 204 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwvr !< |
---|
| 205 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwvs !< |
---|
| 206 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwwl !< |
---|
| 207 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwwn !< |
---|
| 208 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwwr !< |
---|
| 209 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: tmp_3dwws !< |
---|
[146] | 210 | |
---|
[1682] | 211 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE :: tmp_4d !< |
---|
[1320] | 212 | |
---|
| 213 | |
---|
[1] | 214 | ! |
---|
[146] | 215 | !-- Read data from previous model run. |
---|
[1] | 216 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'start' ) |
---|
| 217 | |
---|
| 218 | ! |
---|
[146] | 219 | !-- Check which of the restart files contain data needed for the subdomain |
---|
| 220 | !-- of this PE |
---|
| 221 | files_to_be_opened = 0 |
---|
[143] | 222 | |
---|
[146] | 223 | DO i = 1, numprocs_previous_run |
---|
[216] | 224 | ! |
---|
| 225 | !-- Store array bounds of the previous run ("pr") in temporary scalars |
---|
[147] | 226 | nxlpr = hor_index_bounds_previous_run(1,i-1) |
---|
| 227 | nxrpr = hor_index_bounds_previous_run(2,i-1) |
---|
| 228 | nyspr = hor_index_bounds_previous_run(3,i-1) |
---|
| 229 | nynpr = hor_index_bounds_previous_run(4,i-1) |
---|
| 230 | |
---|
[143] | 231 | ! |
---|
[147] | 232 | !-- Determine the offsets. They may be non-zero in case that the total domain |
---|
| 233 | !-- on file is smaller than the current total domain. |
---|
| 234 | offset_x = ( nxl / ( nx_on_file + 1 ) ) * ( nx_on_file + 1 ) |
---|
| 235 | offset_y = ( nys / ( ny_on_file + 1 ) ) * ( ny_on_file + 1 ) |
---|
| 236 | |
---|
| 237 | ! |
---|
[216] | 238 | !-- Start with this offset and then check, if the subdomain on file |
---|
| 239 | !-- matches another time(s) in the current subdomain by shifting it |
---|
| 240 | !-- for nx_on_file+1, ny_on_file+1 respectively |
---|
[667] | 241 | |
---|
[216] | 242 | shift_y = 0 |
---|
[667] | 243 | j = 0 |
---|
| 244 | DO WHILE ( nyspr+shift_y <= nyn-offset_y ) |
---|
| 245 | |
---|
| 246 | IF ( nynpr+shift_y >= nys-offset_y ) THEN |
---|
[146] | 247 | |
---|
[667] | 248 | shift_x = 0 |
---|
| 249 | DO WHILE ( nxlpr+shift_x <= nxr-offset_x ) |
---|
| 250 | |
---|
| 251 | IF ( nxrpr+shift_x >= nxl-offset_x ) THEN |
---|
| 252 | j = j +1 |
---|
| 253 | IF ( j > 1000 ) THEN |
---|
[147] | 254 | ! |
---|
[667] | 255 | !-- Array bound exceeded |
---|
| 256 | message_string = 'data from subdomain of previous' // & |
---|
| 257 | ' run mapped more than 1000 times' |
---|
| 258 | CALL message( 'read_3d_binary', 'PA0284', 2, 2, -1, & |
---|
| 259 | 6, 1 ) |
---|
| 260 | ENDIF |
---|
[147] | 261 | |
---|
[667] | 262 | IF ( j == 1 ) THEN |
---|
| 263 | files_to_be_opened = files_to_be_opened + 1 |
---|
| 264 | file_list(files_to_be_opened) = i-1 |
---|
| 265 | ENDIF |
---|
| 266 | |
---|
| 267 | offset_xa(files_to_be_opened,j) = offset_x + shift_x |
---|
| 268 | offset_ya(files_to_be_opened,j) = offset_y + shift_y |
---|
[147] | 269 | ! |
---|
[667] | 270 | !-- Index bounds of overlapping data |
---|
| 271 | nxlfa(files_to_be_opened,j) = MAX( nxl-offset_x-shift_x, nxlpr ) |
---|
| 272 | nxrfa(files_to_be_opened,j) = MIN( nxr-offset_x-shift_x, nxrpr ) |
---|
| 273 | nysfa(files_to_be_opened,j) = MAX( nys-offset_y-shift_y, nyspr ) |
---|
| 274 | nynfa(files_to_be_opened,j) = MIN( nyn-offset_y-shift_y, nynpr ) |
---|
[147] | 275 | |
---|
[667] | 276 | ENDIF |
---|
[147] | 277 | |
---|
[667] | 278 | shift_x = shift_x + ( nx_on_file + 1 ) |
---|
| 279 | ENDDO |
---|
| 280 | |
---|
| 281 | ENDIF |
---|
| 282 | |
---|
| 283 | shift_y = shift_y + ( ny_on_file + 1 ) |
---|
[216] | 284 | ENDDO |
---|
[667] | 285 | |
---|
[216] | 286 | IF ( j > 0 ) overlap_count(files_to_be_opened) = j |
---|
[147] | 287 | |
---|
| 288 | ! |
---|
[216] | 289 | !-- Test output, to be removed later |
---|
| 290 | IF ( j > 0 ) THEN |
---|
| 291 | WRITE (9,*) '*** reading from file: ', i, j, ' times' |
---|
[667] | 292 | WRITE (9,*) ' nxl = ', nxl, ' nxr = ', nxr, ' nys = ', & |
---|
| 293 | nys, ' nyn = ', nyn |
---|
[216] | 294 | WRITE (9,*) ' ' |
---|
| 295 | DO k = 1, j |
---|
| 296 | WRITE (9,*) 'k = ', k |
---|
[667] | 297 | WRITE (9,'(6(A,I4))') 'nxlfa = ', nxlfa(files_to_be_opened,k),& |
---|
| 298 | ' nxrfa = ', nxrfa(files_to_be_opened,k), & |
---|
| 299 | ' offset_xa = ', offset_xa(files_to_be_opened,k), & |
---|
| 300 | ' nysfa = ', nysfa(files_to_be_opened,k), & |
---|
| 301 | ' nynfa = ', nynfa(files_to_be_opened,k), & |
---|
| 302 | ' offset_ya = ', offset_ya(files_to_be_opened,k) |
---|
[216] | 303 | ENDDO |
---|
[147] | 304 | CALL local_flush( 9 ) |
---|
| 305 | ENDIF |
---|
| 306 | |
---|
[667] | 307 | |
---|
[146] | 308 | ENDDO |
---|
[667] | 309 | |
---|
[147] | 310 | ! |
---|
| 311 | !-- Save the id-string of the current process, since myid_char may now be used |
---|
| 312 | !-- to open files created by PEs with other id. |
---|
[667] | 313 | myid_char_save = myid_char |
---|
[146] | 314 | |
---|
[147] | 315 | ! |
---|
| 316 | !-- Test output (remove later) |
---|
[667] | 317 | |
---|
[146] | 318 | DO i = 1, numprocs_previous_run |
---|
| 319 | WRITE (9,*) 'i=',i-1, ' ibs= ',hor_index_bounds_previous_run(1:4,i-1) |
---|
| 320 | ENDDO |
---|
| 321 | CALL local_flush( 9 ) |
---|
| 322 | |
---|
| 323 | IF ( files_to_be_opened /= 1 .OR. numprocs /= numprocs_previous_run ) & |
---|
| 324 | THEN |
---|
[274] | 325 | WRITE( message_string, * ) 'number of PEs or virtual PE-grid changed ', & |
---|
| 326 | 'in restart run& PE', myid, ' will read from files ', & |
---|
| 327 | file_list(1:files_to_be_opened) |
---|
[257] | 328 | CALL message( 'read_3d_binary', 'PA0285', 0, 0, 0, 6, 0 ) |
---|
[1] | 329 | ENDIF |
---|
| 330 | |
---|
| 331 | ! |
---|
[146] | 332 | !-- Read data from all restart files determined above |
---|
| 333 | DO i = 1, files_to_be_opened |
---|
[1] | 334 | |
---|
[146] | 335 | j = file_list(i) |
---|
| 336 | ! |
---|
| 337 | !-- Set the filename (underscore followed by four digit processor id) |
---|
[1468] | 338 | WRITE (myid_char,'(''_'',I6.6)') j |
---|
[146] | 339 | WRITE (9,*) 'myid=',myid,' opening file "',myid_char,'"' |
---|
| 340 | CALL local_flush( 9 ) |
---|
[1] | 341 | |
---|
[146] | 342 | ! |
---|
[1468] | 343 | !-- Open the restart file. If this file has been created by PE0 (_000000), |
---|
[146] | 344 | !-- the global variables at the beginning of the file have to be skipped |
---|
| 345 | !-- first. |
---|
| 346 | CALL check_open( 13 ) |
---|
[147] | 347 | WRITE (9,*) 'before skipping' |
---|
| 348 | CALL local_flush( 9 ) |
---|
[146] | 349 | IF ( j == 0 ) CALL skip_var_list |
---|
[147] | 350 | WRITE (9,*) 'skipping done' |
---|
| 351 | CALL local_flush( 9 ) |
---|
[1] | 352 | |
---|
[146] | 353 | ! |
---|
| 354 | !-- First compare the version numbers |
---|
| 355 | READ ( 13 ) version_on_file |
---|
[1709] | 356 | binary_version = '4.2' |
---|
[146] | 357 | IF ( TRIM( version_on_file ) /= TRIM( binary_version ) ) THEN |
---|
[274] | 358 | WRITE( message_string, * ) 'version mismatch concerning data ', & |
---|
| 359 | 'from prior run', & |
---|
| 360 | '&version on file = "', TRIM( version_on_file ), '"', & |
---|
| 361 | '&version in program = "', TRIM( binary_version ), '"' |
---|
[257] | 362 | CALL message( 'read_3d_binary', 'PA0286', 1, 2, 0, 6, 0 ) |
---|
[146] | 363 | ENDIF |
---|
| 364 | |
---|
| 365 | ! |
---|
| 366 | !-- Read number of processors, processor-id, and array ranges. |
---|
| 367 | !-- Compare the array ranges with those stored in the index bound array. |
---|
| 368 | READ ( 13 ) numprocs_on_file, myid_on_file, nxl_on_file, nxr_on_file, & |
---|
| 369 | nys_on_file, nyn_on_file, nzb_on_file, nzt_on_file |
---|
| 370 | |
---|
| 371 | IF ( nxl_on_file /= hor_index_bounds_previous_run(1,j) ) THEN |
---|
[274] | 372 | WRITE( message_string, * ) 'problem with index bound nxl on ', & |
---|
| 373 | 'restart file "', myid_char, '"', & |
---|
| 374 | '&nxl = ', nxl_on_file, ' but it should be', & |
---|
| 375 | '&= ', hor_index_bounds_previous_run(1,j), & |
---|
| 376 | '&from the index bound information array' |
---|
[277] | 377 | CALL message( 'read_3d_binary', 'PA0287', 2, 2, -1, 6, 1 ) |
---|
[146] | 378 | ENDIF |
---|
[1] | 379 | |
---|
[146] | 380 | IF ( nxr_on_file /= hor_index_bounds_previous_run(2,j) ) THEN |
---|
[274] | 381 | WRITE( message_string, * ) 'problem with index bound nxr on ', & |
---|
| 382 | 'restart file "', myid_char, '"' , & |
---|
| 383 | '&nxr = ', nxr_on_file, ' but it should be', & |
---|
| 384 | '&= ', hor_index_bounds_previous_run(2,j), & |
---|
| 385 | '&from the index bound information array' |
---|
[277] | 386 | CALL message( 'read_3d_binary', 'PA0288', 2, 2, -1, 6, 1 ) |
---|
[257] | 387 | |
---|
[146] | 388 | ENDIF |
---|
[1] | 389 | |
---|
[146] | 390 | IF ( nys_on_file /= hor_index_bounds_previous_run(3,j) ) THEN |
---|
[274] | 391 | WRITE( message_string, * ) 'problem with index bound nys on ', & |
---|
| 392 | 'restart file "', myid_char, '"', & |
---|
| 393 | '&nys = ', nys_on_file, ' but it should be', & |
---|
| 394 | '&= ', hor_index_bounds_previous_run(3,j), & |
---|
[257] | 395 | '&from the index bound information array' |
---|
[277] | 396 | CALL message( 'read_3d_binary', 'PA0289', 2, 2, -1, 6, 1 ) |
---|
[146] | 397 | ENDIF |
---|
[1] | 398 | |
---|
[146] | 399 | IF ( nyn_on_file /= hor_index_bounds_previous_run(4,j) ) THEN |
---|
[274] | 400 | WRITE( message_string, * ) 'problem with index bound nyn on ', & |
---|
| 401 | 'restart file "', myid_char, '"', & |
---|
| 402 | '&nyn = ', nyn_on_file, ' but it should be', & |
---|
| 403 | '&= ', hor_index_bounds_previous_run(4,j), & |
---|
| 404 | '&from the index bound information array' |
---|
[277] | 405 | CALL message( 'read_3d_binary', 'PA0290', 2, 2, -1, 6, 1 ) |
---|
[146] | 406 | ENDIF |
---|
[1] | 407 | |
---|
[146] | 408 | IF ( nzb_on_file /= nzb ) THEN |
---|
[257] | 409 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
| 410 | '&from prior run on PE ', myid, & |
---|
| 411 | '&nzb on file = ', nzb_on_file, & |
---|
| 412 | '&nzb = ', nzb |
---|
| 413 | CALL message( 'read_3d_binary', 'PA0291', 1, 2, 0, 6, 0 ) |
---|
[146] | 414 | ENDIF |
---|
[1] | 415 | |
---|
[146] | 416 | IF ( nzt_on_file /= nzt ) THEN |
---|
[257] | 417 | WRITE( message_string, * ) 'mismatch between actual data and data ', & |
---|
| 418 | '&from prior run on PE ', myid, & |
---|
| 419 | '&nzt on file = ', nzt_on_file, & |
---|
| 420 | '&nzt = ', nzt |
---|
| 421 | CALL message( 'read_3d_binary', 'PA0292', 1, 2, 0, 6, 0 ) |
---|
[146] | 422 | ENDIF |
---|
[1] | 423 | |
---|
| 424 | ! |
---|
[146] | 425 | !-- Allocate temporary arrays sized as the arrays on the restart file |
---|
[1551] | 426 | ALLOCATE( tmp_2d(nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 427 | nxl_on_file-nbgp:nxr_on_file+nbgp), & |
---|
| 428 | tmp_3d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
[667] | 429 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[1] | 430 | |
---|
| 431 | ! |
---|
[1551] | 432 | !-- If the land surface model is used, allocate array for storing soil model |
---|
| 433 | !-- data |
---|
| 434 | IF ( land_surface ) THEN |
---|
| 435 | ALLOCATE( tmp_3d_soil1(nzb_soil:nzt_soil+1, & |
---|
| 436 | nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 437 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
| 438 | ALLOCATE( tmp_3d_soil2(nzb_soil:nzt_soil, & |
---|
| 439 | nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 440 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
| 441 | ENDIF |
---|
| 442 | ! |
---|
[146] | 443 | !-- Read arrays |
---|
| 444 | !-- ATTENTION: If the following read commands have been altered, the |
---|
| 445 | !-- ---------- version number of the variable binary_version must be altered, |
---|
| 446 | !-- too. Furthermore, the output list of arrays in write_3d_binary |
---|
| 447 | !-- must also be altered accordingly. |
---|
| 448 | READ ( 13 ) field_chr |
---|
| 449 | DO WHILE ( TRIM( field_chr ) /= '*** end ***' ) |
---|
[1] | 450 | |
---|
[216] | 451 | ! |
---|
| 452 | !-- Map data on file as often as needed (data are read only for k=1) |
---|
| 453 | DO k = 1, overlap_count(i) |
---|
[1] | 454 | |
---|
[216] | 455 | ! |
---|
| 456 | !-- Get the index range of the subdomain on file which overlap with the |
---|
| 457 | !-- current subdomain |
---|
| 458 | nxlf = nxlfa(i,k) |
---|
| 459 | nxlc = nxlfa(i,k) + offset_xa(i,k) |
---|
| 460 | nxrf = nxrfa(i,k) |
---|
| 461 | nxrc = nxrfa(i,k) + offset_xa(i,k) |
---|
| 462 | nysf = nysfa(i,k) |
---|
| 463 | nysc = nysfa(i,k) + offset_ya(i,k) |
---|
| 464 | nynf = nynfa(i,k) |
---|
| 465 | nync = nynfa(i,k) + offset_ya(i,k) |
---|
| 466 | |
---|
| 467 | |
---|
| 468 | WRITE (9,*) 'var = ', field_chr |
---|
| 469 | CALL local_flush( 9 ) |
---|
| 470 | |
---|
| 471 | SELECT CASE ( TRIM( field_chr ) ) |
---|
| 472 | |
---|
[1551] | 473 | CASE ( 'c_liq_av' ) |
---|
| 474 | IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN |
---|
| 475 | ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 476 | ENDIF |
---|
| 477 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 478 | c_liq_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 479 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 480 | |
---|
| 481 | CASE ( 'c_soil_av' ) |
---|
| 482 | IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN |
---|
| 483 | ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 484 | ENDIF |
---|
| 485 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 486 | c_soil_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 487 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 488 | |
---|
| 489 | CASE ( 'c_veg_av' ) |
---|
| 490 | IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN |
---|
| 491 | ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 492 | ENDIF |
---|
| 493 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 494 | c_veg_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 495 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 496 | |
---|
[216] | 497 | CASE ( 'e' ) |
---|
| 498 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 499 | e(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 500 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1] | 501 | |
---|
[216] | 502 | CASE ( 'e_av' ) |
---|
| 503 | IF ( .NOT. ALLOCATED( e_av ) ) THEN |
---|
[667] | 504 | ALLOCATE( e_av(nzb:nzt+1,nys-nbgp:nyn+nbgp,nxl-nbgp:nxr+nbgp) ) |
---|
[216] | 505 | ENDIF |
---|
| 506 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 507 | e_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 508 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 509 | |
---|
[1551] | 510 | CASE ( 'ghf_eb_av' ) |
---|
| 511 | IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN |
---|
| 512 | ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 513 | ENDIF |
---|
| 514 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 515 | ghf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 516 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 517 | |
---|
[216] | 518 | CASE ( 'iran' ) ! matching random numbers is still unresolved |
---|
| 519 | ! issue |
---|
| 520 | IF ( k == 1 ) READ ( 13 ) iran, iran_part |
---|
[146] | 521 | |
---|
[1551] | 522 | CASE ( 'lai_av' ) |
---|
| 523 | IF ( .NOT. ALLOCATED( lai_av ) ) THEN |
---|
| 524 | ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 525 | ENDIF |
---|
| 526 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 527 | lai_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 528 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 529 | |
---|
[216] | 530 | CASE ( 'kh' ) |
---|
| 531 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 532 | kh(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 533 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 534 | |
---|
[216] | 535 | CASE ( 'km' ) |
---|
| 536 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 537 | km(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 538 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 539 | |
---|
[771] | 540 | CASE ( 'lpt_av' ) |
---|
| 541 | IF ( .NOT. ALLOCATED( lpt_av ) ) THEN |
---|
| 542 | ALLOCATE( lpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) |
---|
| 543 | ENDIF |
---|
| 544 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 545 | lpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 546 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 547 | |
---|
[216] | 548 | CASE ( 'lwp_av' ) |
---|
| 549 | IF ( .NOT. ALLOCATED( lwp_av ) ) THEN |
---|
[667] | 550 | ALLOCATE( lwp_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 551 | ENDIF |
---|
| 552 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 553 | lwp_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 554 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 555 | |
---|
[1551] | 556 | CASE ( 'm_liq_eb' ) |
---|
| 557 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 558 | m_liq_eb(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 559 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 560 | CASE ( 'm_liq_eb_av' ) |
---|
| 561 | IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN |
---|
| 562 | ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 563 | ENDIF |
---|
| 564 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 565 | m_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 566 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 567 | |
---|
| 568 | CASE ( 'm_soil' ) |
---|
| 569 | IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:) |
---|
| 570 | m_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 571 | tmp_3d_soil2(nzb_soil:nzt_soil,nysf-nbgp:nynf & |
---|
| 572 | +nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 573 | |
---|
| 574 | CASE ( 'm_soil_av' ) |
---|
| 575 | IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN |
---|
| 576 | ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
| 577 | ENDIF |
---|
| 578 | IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:) |
---|
| 579 | m_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 580 | tmp_3d_soil2(nzb_soil:nzt_soil,nysf & |
---|
| 581 | -nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 582 | |
---|
[1115] | 583 | CASE ( 'nr' ) |
---|
| 584 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 585 | nr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 586 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 587 | |
---|
| 588 | CASE ( 'nr_av' ) |
---|
| 589 | IF ( .NOT. ALLOCATED( nr_av ) ) THEN |
---|
| 590 | ALLOCATE( nr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 591 | ENDIF |
---|
| 592 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 593 | nr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 594 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 595 | |
---|
| 596 | CASE ( 'nrs' ) |
---|
| 597 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 598 | nrs(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 599 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 600 | |
---|
| 601 | CASE ( 'nrsws' ) |
---|
| 602 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 603 | nrsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 604 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 605 | |
---|
| 606 | CASE ( 'nrswst' ) |
---|
| 607 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 608 | nrswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 609 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1691] | 610 | CASE ( 'ol' ) |
---|
| 611 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 612 | ol(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 613 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1115] | 614 | |
---|
[216] | 615 | CASE ( 'p' ) |
---|
| 616 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 617 | p(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 618 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 619 | |
---|
[216] | 620 | CASE ( 'p_av' ) |
---|
| 621 | IF ( .NOT. ALLOCATED( p_av ) ) THEN |
---|
[667] | 622 | ALLOCATE( p_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 623 | ENDIF |
---|
| 624 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 625 | p_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 626 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 627 | |
---|
[216] | 628 | CASE ( 'pc_av' ) |
---|
| 629 | IF ( .NOT. ALLOCATED( pc_av ) ) THEN |
---|
[667] | 630 | ALLOCATE( pc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 631 | ENDIF |
---|
| 632 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 633 | pc_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 634 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 635 | |
---|
[216] | 636 | CASE ( 'pr_av' ) |
---|
| 637 | IF ( .NOT. ALLOCATED( pr_av ) ) THEN |
---|
[667] | 638 | ALLOCATE( pr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 639 | ENDIF |
---|
| 640 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 641 | pr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 642 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 643 | |
---|
[1053] | 644 | CASE ( 'prr' ) |
---|
| 645 | IF ( .NOT. ALLOCATED( prr ) ) THEN |
---|
| 646 | ALLOCATE( prr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 647 | ENDIF |
---|
| 648 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 649 | prr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 650 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 651 | |
---|
| 652 | CASE ( 'prr_av' ) |
---|
| 653 | IF ( .NOT. ALLOCATED( prr_av ) ) THEN |
---|
| 654 | ALLOCATE( prr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 655 | ENDIF |
---|
| 656 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 657 | prr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 658 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 659 | |
---|
[216] | 660 | CASE ( 'precipitation_amount' ) |
---|
| 661 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 662 | precipitation_amount(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 663 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 664 | |
---|
[216] | 665 | CASE ( 'precipitation_rate_a' ) |
---|
| 666 | IF ( .NOT. ALLOCATED( precipitation_rate_av ) ) THEN |
---|
[667] | 667 | ALLOCATE( precipitation_rate_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 668 | ENDIF |
---|
| 669 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 670 | precipitation_rate_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 671 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 672 | |
---|
[216] | 673 | CASE ( 'pt' ) |
---|
| 674 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 675 | pt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 676 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 677 | |
---|
[216] | 678 | CASE ( 'pt_av' ) |
---|
| 679 | IF ( .NOT. ALLOCATED( pt_av ) ) THEN |
---|
[667] | 680 | ALLOCATE( pt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 681 | ENDIF |
---|
| 682 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 683 | pt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 684 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 685 | |
---|
[216] | 686 | CASE ( 'q' ) |
---|
| 687 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 688 | q(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 689 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 690 | |
---|
[216] | 691 | CASE ( 'q_av' ) |
---|
| 692 | IF ( .NOT. ALLOCATED( q_av ) ) THEN |
---|
[667] | 693 | ALLOCATE( q_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg )) |
---|
[216] | 694 | ENDIF |
---|
| 695 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 696 | q_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 697 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 698 | |
---|
[1115] | 699 | CASE ( 'qc' ) |
---|
| 700 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 701 | qc(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 702 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 703 | |
---|
| 704 | CASE ( 'qc_av' ) |
---|
| 705 | IF ( .NOT. ALLOCATED( qc_av ) ) THEN |
---|
| 706 | ALLOCATE( qc_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 707 | ENDIF |
---|
| 708 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 709 | qc_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 710 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 711 | |
---|
[216] | 712 | CASE ( 'ql' ) |
---|
| 713 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 714 | ql(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 715 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 716 | |
---|
[216] | 717 | CASE ( 'ql_av' ) |
---|
| 718 | IF ( .NOT. ALLOCATED( ql_av ) ) THEN |
---|
[667] | 719 | ALLOCATE( ql_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 720 | ENDIF |
---|
| 721 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 722 | ql_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 723 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 724 | |
---|
[1053] | 725 | CASE ( 'qr' ) |
---|
| 726 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 727 | qr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 728 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 729 | |
---|
| 730 | CASE ( 'qr_av' ) |
---|
| 731 | IF ( .NOT. ALLOCATED( qr_av ) ) THEN |
---|
| 732 | ALLOCATE( qr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 733 | ENDIF |
---|
| 734 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 735 | qr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 736 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 737 | |
---|
| 738 | CASE ( 'qrs' ) |
---|
| 739 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 740 | qrs(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 741 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 742 | |
---|
| 743 | CASE ( 'qrsws' ) |
---|
| 744 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 745 | qrsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 746 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 747 | |
---|
| 748 | CASE ( 'qrswst' ) |
---|
| 749 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 750 | qrswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 751 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 752 | |
---|
[216] | 753 | CASE ( 'ql_c_av' ) |
---|
| 754 | IF ( .NOT. ALLOCATED( ql_c_av ) ) THEN |
---|
[667] | 755 | ALLOCATE( ql_c_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 756 | ENDIF |
---|
| 757 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 758 | ql_c_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 759 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 760 | |
---|
[216] | 761 | CASE ( 'ql_v_av' ) |
---|
| 762 | IF ( .NOT. ALLOCATED( ql_v_av ) ) THEN |
---|
[667] | 763 | ALLOCATE( ql_v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 764 | ENDIF |
---|
| 765 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 766 | ql_v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 767 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 768 | |
---|
[216] | 769 | CASE ( 'ql_vp_av' ) |
---|
| 770 | IF ( .NOT. ALLOCATED( ql_vp_av ) ) THEN |
---|
[667] | 771 | ALLOCATE( ql_vp_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 772 | ENDIF |
---|
| 773 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 774 | ql_vp_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 775 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 776 | |
---|
[216] | 777 | CASE ( 'qs' ) |
---|
| 778 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 779 | qs(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 780 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 781 | |
---|
[216] | 782 | CASE ( 'qsws' ) |
---|
| 783 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 784 | qsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 785 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 786 | |
---|
[354] | 787 | CASE ( 'qsws_av' ) |
---|
| 788 | IF ( .NOT. ALLOCATED( qsws_av ) ) THEN |
---|
[667] | 789 | ALLOCATE( qsws_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 790 | ENDIF |
---|
| 791 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 792 | qsws_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 793 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[354] | 794 | |
---|
[216] | 795 | CASE ( 'qswst' ) |
---|
| 796 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 797 | qswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 798 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 799 | |
---|
[1551] | 800 | CASE ( 'qsws_eb_av' ) |
---|
| 801 | IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN |
---|
| 802 | ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 803 | ENDIF |
---|
| 804 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 805 | qsws_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 806 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 807 | |
---|
| 808 | CASE ( 'qsws_liq_eb_av' ) |
---|
| 809 | IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
| 810 | ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 811 | ENDIF |
---|
| 812 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 813 | qsws_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 814 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 815 | CASE ( 'qsws_soil_eb_av' ) |
---|
| 816 | IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
| 817 | ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 818 | ENDIF |
---|
| 819 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 820 | qsws_soil_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 821 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 822 | |
---|
| 823 | CASE ( 'qsws_veg_eb_av' ) |
---|
| 824 | IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
| 825 | ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 826 | ENDIF |
---|
| 827 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 828 | qsws_veg_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 829 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 830 | |
---|
[216] | 831 | CASE ( 'qv_av' ) |
---|
| 832 | IF ( .NOT. ALLOCATED( qv_av ) ) THEN |
---|
[667] | 833 | ALLOCATE( qv_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 834 | ENDIF |
---|
| 835 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 836 | qv_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 837 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 838 | |
---|
[1585] | 839 | CASE ( 'rad_net' ) |
---|
| 840 | IF ( .NOT. ALLOCATED( rad_net ) ) THEN |
---|
| 841 | ALLOCATE( rad_net(nysg:nyng,nxlg:nxrg) ) |
---|
| 842 | ENDIF |
---|
| 843 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 844 | rad_net(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 845 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 846 | |
---|
[1551] | 847 | CASE ( 'rad_net_av' ) |
---|
| 848 | IF ( .NOT. ALLOCATED( rad_net_av ) ) THEN |
---|
| 849 | ALLOCATE( rad_net_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 850 | ENDIF |
---|
| 851 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 852 | rad_net_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 853 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1585] | 854 | CASE ( 'rad_lw_in' ) |
---|
| 855 | IF ( .NOT. ALLOCATED( rad_lw_in ) ) THEN |
---|
| 856 | ALLOCATE( rad_lw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 857 | ENDIF |
---|
| 858 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 859 | rad_lw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 860 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1551] | 861 | |
---|
[1585] | 862 | CASE ( 'rad_lw_in_av' ) |
---|
| 863 | IF ( .NOT. ALLOCATED( rad_lw_in_av ) ) THEN |
---|
| 864 | ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 865 | ENDIF |
---|
| 866 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 867 | rad_lw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 868 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 869 | |
---|
| 870 | CASE ( 'rad_lw_out' ) |
---|
| 871 | IF ( .NOT. ALLOCATED( rad_lw_out ) ) THEN |
---|
| 872 | ALLOCATE( rad_lw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 873 | ENDIF |
---|
| 874 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 875 | rad_lw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 876 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 877 | |
---|
| 878 | CASE ( 'rad_lw_out_av' ) |
---|
| 879 | IF ( .NOT. ALLOCATED( rad_lw_out_av ) ) THEN |
---|
| 880 | ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 881 | ENDIF |
---|
| 882 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 883 | rad_lw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 884 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 885 | |
---|
[1709] | 886 | CASE ( 'rad_lw_out_change_0' ) |
---|
| 887 | IF ( .NOT. ALLOCATED( rad_lw_out_change_0 ) ) THEN |
---|
| 888 | ALLOCATE( rad_lw_out_change_0(nysg:nyng,nxlg:nxrg) ) |
---|
| 889 | ENDIF |
---|
| 890 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 891 | rad_lw_out_change_0(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp)& |
---|
| 892 | = tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 893 | |
---|
[1691] | 894 | CASE ( 'rad_lw_cs_hr' ) |
---|
| 895 | IF ( .NOT. ALLOCATED( rad_lw_cs_hr ) ) THEN |
---|
| 896 | ALLOCATE( rad_lw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 897 | ENDIF |
---|
| 898 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 899 | rad_lw_cs_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 900 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 901 | |
---|
| 902 | CASE ( 'rad_lw_cs_hr_av' ) |
---|
[1757] | 903 | IF ( .NOT. ALLOCATED( rad_lw_cs_hr_av ) ) THEN |
---|
[1691] | 904 | ALLOCATE( rad_lw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 905 | ENDIF |
---|
| 906 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 907 | rad_lw_cs_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 908 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 909 | |
---|
| 910 | CASE ( 'rad_lw_hr' ) |
---|
| 911 | IF ( .NOT. ALLOCATED( rad_lw_hr ) ) THEN |
---|
| 912 | ALLOCATE( rad_lw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 913 | ENDIF |
---|
| 914 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 915 | rad_lw_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 916 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 917 | |
---|
| 918 | CASE ( 'rad_lw_hr_av' ) |
---|
| 919 | IF ( .NOT. ALLOCATED( rad_lw_hr_av ) ) THEN |
---|
| 920 | ALLOCATE( rad_lw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 921 | ENDIF |
---|
| 922 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 923 | rad_lw_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 924 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 925 | |
---|
[1585] | 926 | CASE ( 'rad_sw_in' ) |
---|
| 927 | IF ( .NOT. ALLOCATED( rad_sw_in ) ) THEN |
---|
| 928 | ALLOCATE( rad_sw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 929 | ENDIF |
---|
| 930 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 931 | rad_sw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 932 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 933 | |
---|
[1551] | 934 | CASE ( 'rad_sw_in_av' ) |
---|
| 935 | IF ( .NOT. ALLOCATED( rad_sw_in_av ) ) THEN |
---|
[1585] | 936 | ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[1551] | 937 | ENDIF |
---|
[1585] | 938 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 939 | rad_sw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 940 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1551] | 941 | |
---|
[1585] | 942 | CASE ( 'rad_sw_out' ) |
---|
| 943 | IF ( .NOT. ALLOCATED( rad_sw_out ) ) THEN |
---|
| 944 | ALLOCATE( rad_sw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 945 | ENDIF |
---|
| 946 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 947 | rad_sw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 948 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 949 | |
---|
| 950 | CASE ( 'rad_sw_out_av' ) |
---|
| 951 | IF ( .NOT. ALLOCATED( rad_sw_out_av ) ) THEN |
---|
| 952 | ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 953 | ENDIF |
---|
| 954 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 955 | rad_sw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 956 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 957 | |
---|
[1691] | 958 | CASE ( 'rad_sw_cs_hr' ) |
---|
| 959 | IF ( .NOT. ALLOCATED( rad_sw_cs_hr ) ) THEN |
---|
| 960 | ALLOCATE( rad_sw_cs_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 961 | ENDIF |
---|
| 962 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 963 | rad_sw_cs_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 964 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 965 | |
---|
| 966 | CASE ( 'rad_sw_cs_hr_av' ) |
---|
[1757] | 967 | IF ( .NOT. ALLOCATED( rad_sw_cs_hr_av ) ) THEN |
---|
[1691] | 968 | ALLOCATE( rad_sw_cs_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 969 | ENDIF |
---|
| 970 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 971 | rad_sw_cs_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 972 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 973 | |
---|
| 974 | CASE ( 'rad_sw_hr' ) |
---|
| 975 | IF ( .NOT. ALLOCATED( rad_sw_hr ) ) THEN |
---|
| 976 | ALLOCATE( rad_sw_hr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 977 | ENDIF |
---|
| 978 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 979 | rad_sw_hr(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 980 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 981 | |
---|
| 982 | CASE ( 'rad_sw_hr_av' ) |
---|
| 983 | IF ( .NOT. ALLOCATED( rad_sw_hr_av ) ) THEN |
---|
| 984 | ALLOCATE( rad_sw_hr_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
| 985 | ENDIF |
---|
| 986 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
| 987 | rad_lw_hr_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 988 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 989 | |
---|
[216] | 990 | CASE ( 'random_iv' ) ! still unresolved issue |
---|
| 991 | IF ( k == 1 ) READ ( 13 ) random_iv |
---|
| 992 | IF ( k == 1 ) READ ( 13 ) random_iy |
---|
[1400] | 993 | |
---|
| 994 | CASE ( 'seq_random_array' ) ! still unresolved issue |
---|
| 995 | IF ( k == 1 ) READ ( 13 ) id_random_array |
---|
| 996 | IF ( k == 1 ) READ ( 13 ) seq_random_array |
---|
[146] | 997 | |
---|
[216] | 998 | CASE ( 'rho_av' ) |
---|
| 999 | IF ( .NOT. ALLOCATED( rho_av ) ) THEN |
---|
[667] | 1000 | ALLOCATE( rho_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1001 | ENDIF |
---|
| 1002 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1003 | rho_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1004 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1005 | |
---|
[216] | 1006 | CASE ( 'rif_wall' ) |
---|
| 1007 | IF ( k == 1 ) THEN |
---|
[667] | 1008 | ALLOCATE( tmp_4d(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp, & |
---|
| 1009 | nxl_on_file-nbgp:nxr_on_file+nbgp,1:4) ) |
---|
[216] | 1010 | READ ( 13 ) tmp_4d |
---|
| 1011 | ENDIF |
---|
[667] | 1012 | rif_wall(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp,:) = & |
---|
| 1013 | tmp_4d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp,:) |
---|
[146] | 1014 | |
---|
[216] | 1015 | CASE ( 's_av' ) |
---|
| 1016 | IF ( .NOT. ALLOCATED( s_av ) ) THEN |
---|
[667] | 1017 | ALLOCATE( s_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) |
---|
[216] | 1018 | ENDIF |
---|
| 1019 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1020 | s_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1021 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1022 | |
---|
[216] | 1023 | CASE ( 'sa' ) |
---|
| 1024 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1025 | sa(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1026 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1027 | |
---|
[216] | 1028 | CASE ( 'sa_av' ) |
---|
| 1029 | IF ( .NOT. ALLOCATED( sa_av ) ) THEN |
---|
[667] | 1030 | ALLOCATE( sa_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1031 | ENDIF |
---|
| 1032 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1033 | sa_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1034 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1035 | |
---|
[216] | 1036 | CASE ( 'saswsb' ) |
---|
| 1037 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1038 | saswsb(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1039 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1040 | |
---|
[216] | 1041 | CASE ( 'saswst' ) |
---|
| 1042 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1043 | saswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1044 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1045 | |
---|
[216] | 1046 | CASE ( 'shf' ) |
---|
| 1047 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1048 | shf(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1049 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1050 | |
---|
[354] | 1051 | CASE ( 'shf_av' ) |
---|
| 1052 | IF ( .NOT. ALLOCATED( shf_av ) ) THEN |
---|
[667] | 1053 | ALLOCATE( shf_av(nysg:nyng,nxlg:nxrg) ) |
---|
[354] | 1054 | ENDIF |
---|
| 1055 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1056 | shf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1057 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[1001] | 1058 | |
---|
[1551] | 1059 | CASE ( 'shf_eb_av' ) |
---|
| 1060 | IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN |
---|
| 1061 | ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 1062 | ENDIF |
---|
| 1063 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 1064 | shf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1065 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 1066 | |
---|
[216] | 1067 | CASE ( 'spectrum_x' ) |
---|
| 1068 | IF ( k == 1 ) THEN |
---|
| 1069 | IF ( nx_on_file /= nx ) THEN |
---|
[274] | 1070 | message_string = 'read_3d_binary: spectrum_x ' // & |
---|
| 1071 | 'on restart file ignored because' // & |
---|
| 1072 | '&total numbers of grid points (nx) ' // & |
---|
| 1073 | 'do not match' |
---|
| 1074 | CALL message( 'read_3d_binary', 'PA0293',& |
---|
| 1075 | 0, 1, 0, 6, 0 ) |
---|
[216] | 1076 | READ ( 13 ) rdummy |
---|
| 1077 | ELSE |
---|
| 1078 | READ ( 13 ) spectrum_x |
---|
| 1079 | ENDIF |
---|
| 1080 | ENDIF |
---|
[146] | 1081 | |
---|
[216] | 1082 | CASE ( 'spectrum_y' ) |
---|
| 1083 | IF ( k == 1 ) THEN |
---|
| 1084 | IF ( ny_on_file /= ny ) THEN |
---|
[274] | 1085 | message_string = 'read_3d_binary: spectrum_y ' // & |
---|
| 1086 | 'on restart file ignored because' // & |
---|
| 1087 | '&total numbers of grid points (ny) '// & |
---|
| 1088 | 'do not match' |
---|
| 1089 | CALL message( 'read_3d_binary', 'PA0294', & |
---|
| 1090 | 0, 1, 0, 6, 0 ) |
---|
| 1091 | READ ( 13 ) rdummy |
---|
[216] | 1092 | ELSE |
---|
| 1093 | READ ( 13 ) spectrum_y |
---|
| 1094 | ENDIF |
---|
| 1095 | ENDIF |
---|
[146] | 1096 | |
---|
[216] | 1097 | CASE ( 'ts' ) |
---|
| 1098 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1099 | ts(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1100 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1101 | |
---|
[216] | 1102 | CASE ( 'ts_av' ) |
---|
| 1103 | IF ( .NOT. ALLOCATED( ts_av ) ) THEN |
---|
[667] | 1104 | ALLOCATE( ts_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1105 | ENDIF |
---|
| 1106 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1107 | ts_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1108 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1109 | |
---|
[216] | 1110 | CASE ( 'tswst' ) |
---|
| 1111 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1112 | tswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1113 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1114 | |
---|
[1551] | 1115 | CASE ( 't_soil' ) |
---|
| 1116 | IF ( k == 1 ) READ ( 13 ) tmp_3d_soil1 |
---|
| 1117 | t_soil(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1118 | tmp_3d_soil1(:,nysf-nbgp:nynf+nbgp, & |
---|
| 1119 | nxlf-nbgp:nxrf+nbgp) |
---|
| 1120 | |
---|
| 1121 | CASE ( 't_soil_av' ) |
---|
| 1122 | IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN |
---|
| 1123 | ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
| 1124 | ENDIF |
---|
| 1125 | IF ( k == 1 ) READ ( 13 ) tmp_3d_soil2(:,:,:) |
---|
| 1126 | t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1127 | tmp_3d_soil2(:,nysf-nbgp:nynf+nbgp, & |
---|
| 1128 | nxlf-nbgp:nxrf+nbgp) |
---|
| 1129 | |
---|
[216] | 1130 | CASE ( 'u' ) |
---|
| 1131 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1132 | u(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1133 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1134 | |
---|
[216] | 1135 | CASE ( 'u_av' ) |
---|
| 1136 | IF ( .NOT. ALLOCATED( u_av ) ) THEN |
---|
[667] | 1137 | ALLOCATE( u_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1138 | ENDIF |
---|
| 1139 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1140 | u_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1141 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1142 | |
---|
[216] | 1143 | CASE ( 'u_m_l' ) |
---|
| 1144 | IF ( k == 1 ) THEN |
---|
| 1145 | ALLOCATE( tmp_3dwul(nzb:nzt+1, & |
---|
[667] | 1146 | nys_on_file-nbgp:nyn_on_file+nbgp,1:2) ) |
---|
[216] | 1147 | READ ( 13 ) tmp_3dwul |
---|
| 1148 | ENDIF |
---|
| 1149 | IF ( outflow_l ) THEN |
---|
[667] | 1150 | u_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwul(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1151 | ENDIF |
---|
[146] | 1152 | |
---|
[216] | 1153 | CASE ( 'u_m_n' ) |
---|
| 1154 | IF ( k == 1 ) THEN |
---|
| 1155 | ALLOCATE( tmp_3dwun(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 1156 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1157 | READ ( 13 ) tmp_3dwun |
---|
| 1158 | ENDIF |
---|
| 1159 | IF ( outflow_n ) THEN |
---|
[667] | 1160 | u_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwun(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1161 | ENDIF |
---|
[146] | 1162 | |
---|
[216] | 1163 | CASE ( 'u_m_r' ) |
---|
| 1164 | IF ( k == 1 ) THEN |
---|
| 1165 | ALLOCATE( tmp_3dwur(nzb:nzt+1,& |
---|
[667] | 1166 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 1167 | READ ( 13 ) tmp_3dwur |
---|
| 1168 | ENDIF |
---|
| 1169 | IF ( outflow_r ) THEN |
---|
[667] | 1170 | u_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwur(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1171 | ENDIF |
---|
[146] | 1172 | |
---|
[216] | 1173 | CASE ( 'u_m_s' ) |
---|
| 1174 | IF ( k == 1 ) THEN |
---|
| 1175 | ALLOCATE( tmp_3dwus(nzb:nzt+1,0:1, & |
---|
[667] | 1176 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1177 | READ ( 13 ) tmp_3dwus |
---|
| 1178 | ENDIF |
---|
| 1179 | IF ( outflow_s ) THEN |
---|
[667] | 1180 | u_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwus(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1181 | ENDIF |
---|
[146] | 1182 | |
---|
[216] | 1183 | CASE ( 'us' ) |
---|
| 1184 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1185 | us(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1186 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1187 | |
---|
[216] | 1188 | CASE ( 'usws' ) |
---|
| 1189 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1190 | usws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1191 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1192 | |
---|
[216] | 1193 | CASE ( 'uswst' ) |
---|
| 1194 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1195 | uswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1196 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1197 | |
---|
[216] | 1198 | CASE ( 'us_av' ) |
---|
| 1199 | IF ( .NOT. ALLOCATED( us_av ) ) THEN |
---|
[667] | 1200 | ALLOCATE( us_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1201 | ENDIF |
---|
| 1202 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1203 | us_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1204 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1205 | |
---|
[216] | 1206 | CASE ( 'v' ) |
---|
| 1207 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1208 | v(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1209 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1210 | |
---|
[216] | 1211 | CASE ( 'v_av' ) |
---|
| 1212 | IF ( .NOT. ALLOCATED( v_av ) ) THEN |
---|
[667] | 1213 | ALLOCATE( v_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1214 | ENDIF |
---|
| 1215 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1216 | v_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1217 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1218 | |
---|
[216] | 1219 | CASE ( 'v_m_l' ) |
---|
| 1220 | IF ( k == 1 ) THEN |
---|
| 1221 | ALLOCATE( tmp_3dwvl(nzb:nzt+1,& |
---|
[667] | 1222 | nys_on_file-nbgp:nyn_on_file+nbgp,0:1) ) |
---|
[216] | 1223 | READ ( 13 ) tmp_3dwvl |
---|
| 1224 | ENDIF |
---|
| 1225 | IF ( outflow_l ) THEN |
---|
[667] | 1226 | v_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwvl(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1227 | ENDIF |
---|
[146] | 1228 | |
---|
[216] | 1229 | CASE ( 'v_m_n' ) |
---|
| 1230 | IF ( k == 1 ) THEN |
---|
| 1231 | ALLOCATE( tmp_3dwvn(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 1232 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1233 | READ ( 13 ) tmp_3dwvn |
---|
| 1234 | ENDIF |
---|
| 1235 | IF ( outflow_n ) THEN |
---|
[667] | 1236 | v_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwvn(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1237 | ENDIF |
---|
[146] | 1238 | |
---|
[216] | 1239 | CASE ( 'v_m_r' ) |
---|
| 1240 | IF ( k == 1 ) THEN |
---|
| 1241 | ALLOCATE( tmp_3dwvr(nzb:nzt+1,& |
---|
[667] | 1242 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 1243 | READ ( 13 ) tmp_3dwvr |
---|
| 1244 | ENDIF |
---|
| 1245 | IF ( outflow_r ) THEN |
---|
[667] | 1246 | v_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwvr(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1247 | ENDIF |
---|
[146] | 1248 | |
---|
[216] | 1249 | CASE ( 'v_m_s' ) |
---|
| 1250 | IF ( k == 1 ) THEN |
---|
| 1251 | ALLOCATE( tmp_3dwvs(nzb:nzt+1,1:2, & |
---|
[667] | 1252 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1253 | READ ( 13 ) tmp_3dwvs |
---|
| 1254 | ENDIF |
---|
| 1255 | IF ( outflow_s ) THEN |
---|
[667] | 1256 | v_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwvs(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1257 | ENDIF |
---|
[146] | 1258 | |
---|
[216] | 1259 | CASE ( 'vpt' ) |
---|
| 1260 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1261 | vpt(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1262 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1263 | |
---|
[216] | 1264 | CASE ( 'vpt_av' ) |
---|
| 1265 | IF ( .NOT. ALLOCATED( vpt_av ) ) THEN |
---|
[667] | 1266 | ALLOCATE( vpt_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1267 | ENDIF |
---|
| 1268 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1269 | vpt_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1270 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1271 | |
---|
[216] | 1272 | CASE ( 'vsws' ) |
---|
| 1273 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1274 | vsws(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1275 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1276 | |
---|
[216] | 1277 | CASE ( 'vswst' ) |
---|
| 1278 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1279 | vswst(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1280 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1281 | |
---|
[216] | 1282 | CASE ( 'w' ) |
---|
| 1283 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1284 | w(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1285 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1286 | |
---|
[216] | 1287 | CASE ( 'w_av' ) |
---|
| 1288 | IF ( .NOT. ALLOCATED( w_av ) ) THEN |
---|
[667] | 1289 | ALLOCATE( w_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1290 | ENDIF |
---|
| 1291 | IF ( k == 1 ) READ ( 13 ) tmp_3d |
---|
[667] | 1292 | w_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1293 | tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1294 | |
---|
[216] | 1295 | CASE ( 'w_m_l' ) |
---|
| 1296 | IF ( k == 1 ) THEN |
---|
| 1297 | ALLOCATE( tmp_3dwwl(nzb:nzt+1,& |
---|
[667] | 1298 | nys_on_file-nbgp:nyn_on_file+nbgp,0:1) ) |
---|
[216] | 1299 | READ ( 13 ) tmp_3dwwl |
---|
| 1300 | ENDIF |
---|
| 1301 | IF ( outflow_l ) THEN |
---|
[667] | 1302 | w_m_l(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwwl(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1303 | ENDIF |
---|
[146] | 1304 | |
---|
[216] | 1305 | CASE ( 'w_m_n' ) |
---|
| 1306 | IF ( k == 1 ) THEN |
---|
| 1307 | ALLOCATE( tmp_3dwwn(nzb:nzt+1,ny-1:ny, & |
---|
[667] | 1308 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1309 | READ ( 13 ) tmp_3dwwn |
---|
| 1310 | ENDIF |
---|
| 1311 | IF ( outflow_n ) THEN |
---|
[667] | 1312 | w_m_n(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwwn(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1313 | ENDIF |
---|
[146] | 1314 | |
---|
[216] | 1315 | CASE ( 'w_m_r' ) |
---|
| 1316 | IF ( k == 1 ) THEN |
---|
| 1317 | ALLOCATE( tmp_3dwwr(nzb:nzt+1,& |
---|
[667] | 1318 | nys_on_file-nbgp:nyn_on_file+nbgp,nx-1:nx) ) |
---|
[216] | 1319 | READ ( 13 ) tmp_3dwwr |
---|
| 1320 | ENDIF |
---|
| 1321 | IF ( outflow_r ) THEN |
---|
[667] | 1322 | w_m_r(:,nysc-nbgp:nync+nbgp,:) = tmp_3dwwr(:,nysf-nbgp:nynf+nbgp,:) |
---|
[216] | 1323 | ENDIF |
---|
[146] | 1324 | |
---|
[216] | 1325 | CASE ( 'w_m_s' ) |
---|
| 1326 | IF ( k == 1 ) THEN |
---|
| 1327 | ALLOCATE( tmp_3dwws(nzb:nzt+1,0:1, & |
---|
[667] | 1328 | nxl_on_file-nbgp:nxr_on_file+nbgp) ) |
---|
[216] | 1329 | READ ( 13 ) tmp_3dwws |
---|
| 1330 | ENDIF |
---|
| 1331 | IF ( outflow_s ) THEN |
---|
[667] | 1332 | w_m_s(:,:,nxlc-nbgp:nxrc+nbgp) = tmp_3dwws(:,:,nxlf-nbgp:nxrf+nbgp) |
---|
[216] | 1333 | ENDIF |
---|
| 1334 | DEALLOCATE( tmp_3dwws ) |
---|
[146] | 1335 | |
---|
[216] | 1336 | CASE ( 'z0' ) |
---|
| 1337 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1338 | z0(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1339 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1340 | |
---|
[216] | 1341 | CASE ( 'z0_av' ) |
---|
| 1342 | IF ( .NOT. ALLOCATED( z0_av ) ) THEN |
---|
[667] | 1343 | ALLOCATE( z0_av(nysg:nyng,nxlg:nxrg) ) |
---|
[216] | 1344 | ENDIF |
---|
| 1345 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
[667] | 1346 | z0_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1347 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
[146] | 1348 | |
---|
[978] | 1349 | CASE ( 'z0h' ) |
---|
| 1350 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 1351 | z0h(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1352 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 1353 | |
---|
| 1354 | CASE ( 'z0h_av' ) |
---|
| 1355 | IF ( .NOT. ALLOCATED( z0h_av ) ) THEN |
---|
| 1356 | ALLOCATE( z0h_av(nysg:nyng,nxlg:nxrg) ) |
---|
| 1357 | ENDIF |
---|
| 1358 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
| 1359 | z0h_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
| 1360 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
| 1361 | |
---|
[216] | 1362 | CASE DEFAULT |
---|
[257] | 1363 | WRITE( message_string, * ) 'unknown field named "', & |
---|
| 1364 | TRIM( field_chr ), '" found in', & |
---|
| 1365 | '&data from prior run on PE ',myid |
---|
| 1366 | CALL message( 'read_3d_binary', 'PA0295', 1, 2, 0, 6, 0 ) |
---|
| 1367 | |
---|
[216] | 1368 | END SELECT |
---|
| 1369 | |
---|
| 1370 | ENDDO ! overlap loop |
---|
| 1371 | |
---|
[1] | 1372 | ! |
---|
[216] | 1373 | !-- Deallocate arrays needed for specific variables only |
---|
| 1374 | IF ( ALLOCATED( tmp_3dwul ) ) DEALLOCATE( tmp_3dwul ) |
---|
| 1375 | IF ( ALLOCATED( tmp_3dwun ) ) DEALLOCATE( tmp_3dwun ) |
---|
| 1376 | IF ( ALLOCATED( tmp_3dwur ) ) DEALLOCATE( tmp_3dwur ) |
---|
| 1377 | IF ( ALLOCATED( tmp_3dwus ) ) DEALLOCATE( tmp_3dwus ) |
---|
| 1378 | IF ( ALLOCATED( tmp_3dwvl ) ) DEALLOCATE( tmp_3dwvl ) |
---|
| 1379 | IF ( ALLOCATED( tmp_3dwvn ) ) DEALLOCATE( tmp_3dwvn ) |
---|
| 1380 | IF ( ALLOCATED( tmp_3dwvr ) ) DEALLOCATE( tmp_3dwvr ) |
---|
| 1381 | IF ( ALLOCATED( tmp_3dwvs ) ) DEALLOCATE( tmp_3dwvs ) |
---|
| 1382 | IF ( ALLOCATED( tmp_3dwwl ) ) DEALLOCATE( tmp_3dwwl ) |
---|
| 1383 | IF ( ALLOCATED( tmp_3dwwn ) ) DEALLOCATE( tmp_3dwwn ) |
---|
| 1384 | IF ( ALLOCATED( tmp_3dwwr ) ) DEALLOCATE( tmp_3dwwr ) |
---|
| 1385 | IF ( ALLOCATED( tmp_3dwws ) ) DEALLOCATE( tmp_3dwws ) |
---|
| 1386 | IF ( ALLOCATED( tmp_4d ) ) DEALLOCATE( tmp_4d ) |
---|
| 1387 | |
---|
| 1388 | ! |
---|
[146] | 1389 | !-- Read next character string |
---|
| 1390 | READ ( 13 ) field_chr |
---|
[1] | 1391 | |
---|
[146] | 1392 | ENDDO ! loop over variables |
---|
[1] | 1393 | |
---|
| 1394 | ! |
---|
[146] | 1395 | !-- Read user-defined restart data |
---|
[220] | 1396 | CALL user_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
| 1397 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
| 1398 | offset_xa, offset_ya, overlap_count(i), & |
---|
[216] | 1399 | tmp_2d, tmp_3d ) |
---|
[145] | 1400 | |
---|
| 1401 | ! |
---|
[146] | 1402 | !-- Close the restart file |
---|
| 1403 | CALL close_file( 13 ) |
---|
| 1404 | |
---|
| 1405 | DEALLOCATE( tmp_2d, tmp_3d ) |
---|
[1551] | 1406 | IF ( ALLOCATED( tmp_3d_soil1 ) ) DEALLOCATE( tmp_3d_soil1 ) |
---|
| 1407 | IF ( ALLOCATED( tmp_3d_soil2 ) ) DEALLOCATE( tmp_3d_soil2 ) |
---|
[146] | 1408 | |
---|
| 1409 | ENDDO ! loop over restart files |
---|
| 1410 | |
---|
| 1411 | |
---|
| 1412 | ! |
---|
| 1413 | !-- Restore the original filename for the restart file to be written |
---|
| 1414 | myid_char = myid_char_save |
---|
| 1415 | |
---|
| 1416 | |
---|
| 1417 | ! |
---|
[1] | 1418 | !-- End of time measuring for reading binary data |
---|
| 1419 | CALL cpu_log( log_point_s(14), 'read_3d_binary', 'stop' ) |
---|
| 1420 | |
---|
| 1421 | END SUBROUTINE read_3d_binary |
---|