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