Changeset 1551 for palm/trunk/UTIL


Ignore:
Timestamp:
Mar 3, 2015 2:18:16 PM (9 years ago)
Author:
maronga
Message:

land surface model released

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/UTIL/combine_plot_fields.f90

    r1469 r1551  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! Adjustments for data output of soil model quantities
    2323!
    2424! Former revisions:
     
    9191    CHARACTER (LEN=2)    ::  modus, model_string
    9292    CHARACTER (LEN=6)    ::  id_string
    93     CHARACTER (LEN=10)   ::  dimname, var_name
     93    CHARACTER (LEN=20)   ::  dimname, var_name
    9494    CHARACTER (LEN=40)   ::  filename
    9595
     
    100100    INTEGER(iwp) ::  av, danz, i, id, j, k, model, models, nc_stat,            &
    101101                     nxa, nxag, nxe, nxeg, nya, nyag, nye, nyeg,               &
    102                      nza, nzag, nze, nzeg, pos, time_step,                     &
    103                      xa, xe, xxa, xxe, ya, ye, yya, yye, za, ze, zza, zze
     102                     nza, nze, pos, time_step,                                 &
     103                     xa, xe, xxa, xxe, ya, ya_do, ya_tot, ye, ye_do, ye_tot, yya, yye, za,   &
     104                     ze, zza, zze
    104105
    105106#if defined( __lc ) || defined( __decalpha )
     
    372373!--                concerning the lower and upper indices of the total-domain
    373374!--                used in PALM (nxag, nxeg, nyag, nyeg) and the lower and
    374 !--                upper indices of the array to be writte by this routine
     375!--                upper indices of the array to be written by this routine
    375376!--                (nxa, nxe, nya, nye). Usually in the horizontal directions
    376377!--                nxag=-1 and nxa=0 while all other variables have the same
     
    385386                      READ ( id+110 )  dx, eta, hu, ho
    386387
     388
     389!
     390!--                   Set actual domain bounds to total domain
     391                      ya_do = nya
     392                      ye_do = nye
     393
    387394                      IF ( iso2d_output )  THEN
    388395                         OPEN ( 2, FILE='PLOT2D_'//modus//TRIM( model_string ),&
     
    405412!
    406413!--                Read subdomain indices
    407                    READ ( id+110, END=998 )  xa, xe, ya, ye
     414                   READ ( id+110, END=998 )  xa, xe, ya, ye, ya_tot, ye_tot
     415
    408416!
    409417!--                IF the PE made no output (in case that no part of the
     
    412420                   IF ( .NOT. ( xa == -1  .AND.  xe == -1  .AND. &
    413421                                ya == -1  .AND.  ye == -1 ) )  THEN
     422
     423
    414424!
    415425!--                   Read the subdomain grid-point values
    416426                      ALLOCATE( pf_tmp(xa:xe,ya:ye) )
    417427                      READ ( id+110 )  pf_tmp
    418                       pf(xa:xe,ya:ye) = pf_tmp
     428!
     429!--                   Calculate indices on atmospheric grid (e.g. for soil model
     430!--                   quantities)
     431                      IF ( ya /= ya_tot .OR. ye /= ye_tot )  THEN
     432                         ye_do = ye - ya
     433                         ya_do = ya
     434                         pf(xa:xe,ya_do:ye_do) = pf_tmp
     435                      ELSE
     436                         ye_do = nye
     437                         ya_do = nya
     438                         pf(xa:xe,ya:ye) = pf_tmp
     439                      ENDIF
     440
    419441                      DEALLOCATE( pf_tmp )
    420442                   ENDIF
     
    459481                         nc_stat = NF90_PUT_VAR( id_set(av),                   &
    460482                                           id_var(av,current_var(av)),         &
    461                                            pf(nxa:nxe,nya:nye),                &
     483                                           pf(nxa:nxe,ya_do:ye_do),            &
    462484                             start = (/ 1, current_level(av), 1, time_step /), &
    463                                       count = (/ nxe-nxa+1, 1, nye-nya+1, 1 /) )
     485                                      count = (/ nxe-nxa+1, 1, ye_do-ya_do+1, 1 /) )
    464486                         IF ( nc_stat /= NF90_NOERR )  THEN
    465487                            CALL handle_netcdf_error( 9 )
     
    469491                         nc_stat = NF90_PUT_VAR( id_set(av),                   &
    470492                                           id_var(av,current_var(av)),         &
    471                                            pf(nxa:nxe,nya:nye),                &
     493                                           pf(nxa:nxe,ya_do:ye_do),            &
    472494                             start = (/ current_level(av), 1, 1, time_step /), &
    473                                       count = (/ 1, nxe-nxa+1, nye-nya+1, 1 /) )
     495                                      count = (/ 1, nxe-nxa+1, ye_do-ya_do+1, 1 /) )
    474496                         IF ( nc_stat /= NF90_NOERR )  THEN
    475497                            CALL handle_netcdf_error( 10 )
     
    743765!--             File from PE0 contains special information at the beginning,
    744766!--             concerning the lower and upper indices of the total-domain used
    745 !--             in PALM (nxag, nxeg, nyag, nyeg, nzag, nzeg) and the lower and
     767!--             in PALM (nxag, nxeg, nyag, nyeg) and the lower and
    746768!--             upper indices of the array to be written by this routine (nxa,
    747769!--             nxe, nya, nye, nza, nze). Usually nxag=-1 and nxa=0, nyag=-1
    748 !--             and nya=0, nzeg=nz and nze=nz_plot3d.
     770!--             and nya=0, nzeg=nz and nze=nz_do3d.
    749771!--             Allocate necessary array and open the output file.
    750772                IF ( id == 0  .AND.  fanz(0) == 0  .AND.  fanz(1) == 0 )  THEN
    751                    READ ( id+110 )  nxag, nxeg, nyag, nyeg, nzag, nzeg
     773                   READ ( id+110 )  nxag, nxeg, nyag, nyeg
    752774                   READ ( id+110 )  nxa, nxe, nya, nye, nza, nze
    753775                   ALLOCATE ( pf3d(nxa:nxe,nya:nye,nza:nze) )
     
    781803                yya = MAX( nya, ya )
    782804                yye = MIN( nye, ye )
    783                 zza = MAX( nza, za )
    784                 zze = MIN( nze, ze )
    785                 DO  k = zza, zze
     805                DO  k = za, ze
    786806                   DO  j = yya, yye
    787807                      DO  i = xxa, xxe
     
    818838!--             Now write the data
    819839                nc_stat = NF90_PUT_VAR( id_set(av), id_var(av,current_var(av)),&
    820                                         pf3d, start = (/ 1, 1, 1, time_step /),&
    821                               count = (/ nxe-nxa+1, nye-nya+1, nze-nza+1, 1 /) )
     840                                        pf3d(nxa:nxe,nya:nye,za:ze), start = (/ 1, 1, 1, time_step /),&
     841                              count = (/ nxe-nxa+1, nye-nya+1, ze-za+1, 1 /) )
    822842                IF ( nc_stat /= NF90_NOERR )  CALL handle_netcdf_error( 18 )
    823843
Note: See TracChangeset for help on using the changeset viewer.