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