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