Changes between Version 3 and Version 4 of Developers/Rebuild Zooms


Ignore:
Timestamp:
2020-08-18T11:54:19+02:00 (5 months ago)
Author:
acc
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Developers/Rebuild Zooms

    v3 v4  
    110110 NEMO rebuild completed successfully 
    111111}}} 
    112 This successfully rebuilds the zoom but places it in an otherwise empty global domain. 
     112This successfully rebuilds the zoom but places it in an otherwise empty global domain: 
     113 
     114[[Image(zoom_full.png)]] 
    113115 
    114116Fixing the second issue is trickier. Simply editing the DOMAIN_size_global settings will not suffice because REBUILD_NEMO also uses the DOMAIN_position_first information to place data within the global arrays. Changing the size but not the offset results in Bus errors. 
     
    162164 
    163165{{{#!diff 
    164 --- REBUILD_NEMO/src/org.rebuild_nemo.F90       2020-08-12 17:28:17.562148712 +0100 
    165 +++ REBUILD_NEMO/src/rebuild_nemo.F90   2020-08-12 20:01:36.044158059 +0100 
     166--- org.rebuild_nemo.F90        2020-08-12 17:28:17.562148712 +0100 
     167+++ rebuild_nemo.F90    2020-08-18 10:36:12.747885729 +0100 
    166168@@ -70,8 +70,8 @@ 
    167169    CHARACTER(LEN=50)  :: clibnc ! netcdf library version 
     
    203205 
    204206 !2.1 Set up the output file 
    205 @@ -275,6 +283,29 @@ 
     207@@ -275,6 +283,26 @@ 
    206208 
    207209    ALLOCATE(global_sizes(rbdims)) 
     
    209211+ 
    210212+!2.2.0.1 Override global sizes if zoom attributes are found 
     213+   iszoom = .false. 
    211214+   istat = nf90_inquire_attribute( ncid, nf90_global, 'DOMAIN_size_zoom_i', xtype, rbdims1, attid ) 
    212215+   IF ( istat == nf90_noerr ) THEN 
    213216+       CALL check_nf90( nf90_get_att( ncid, nf90_global, 'DOMAIN_size_zoom_i', ni_zoom ) ) 
    214 +       iszoom = .true. 
    215 +   ELSE 
    216 +       iszoom = .false. 
    217 +   ENDIF 
    218 +   istat = nf90_inquire_attribute( ncid, nf90_global, 'DOMAIN_size_zoom_j', xtype, rbdims1, attid ) 
    219 +   IF ( istat == nf90_noerr ) THEN 
    220 +       CALL check_nf90( nf90_get_att( ncid, nf90_global, 'DOMAIN_size_zoom_j', nj_zoom ) ) 
    221 +       iszoom = .true. 
    222 +   ELSE 
    223 +       iszoom = .false. 
    224 +   ENDIF 
    225 +   IF( iszoom ) THEN 
    226 +       global_sizes(1) = ni_zoom 
    227 +       global_sizes(2) = nj_zoom 
    228 +       CALL check_nf90( nf90_get_att( ncid, nf90_global, 'ibegin', ni_off ) ) 
    229 +       CALL check_nf90( nf90_get_att( ncid, nf90_global, 'jbegin', nj_off ) ) 
     217+       ! Need both zoom_i and zoom_j attributes to determine zoom size 
     218+       istat = nf90_inquire_attribute( ncid, nf90_global, 'DOMAIN_size_zoom_j', xtype, rbdims1, attid ) 
     219+       IF ( istat == nf90_noerr ) THEN 
     220+           CALL check_nf90( nf90_get_att( ncid, nf90_global, 'DOMAIN_size_zoom_j', nj_zoom ) ) 
     221+           iszoom = .true. 
     222+           global_sizes(1) = ni_zoom 
     223+           global_sizes(2) = nj_zoom 
     224+           CALL check_nf90( nf90_get_att( ncid, nf90_global, 'ibegin', ni_off ) ) 
     225+           CALL check_nf90( nf90_get_att( ncid, nf90_global, 'jbegin', nj_off ) ) 
     226+       ELSE 
     227+           iszoom = .false. 
     228+       ENDIF 
    230229+   ENDIF 
    231230+ 
     
    233232 
    234233 
    235 @@ -773,6 +804,9 @@ 
     234@@ -773,6 +801,9 @@ 
    236235                halo_start(2) = 0 
    237236                di=rebuild_dims(1) 
     
    244243 !3.3.1 Generate local domain interior sizes from local_sizes and halo sizes 
    245244}}} 
     245 
     246This modified rebuild_nemo will, if the correct attributes are found, rebuild just the zoom region. It will also ignore any mismatch between the DOMAIN_number_total attribute and the number of files specified by the user; trusting that the user has correctly specified the true number. 
     247[[Image(zoom_only.png)]] 
    246248 
    247249== Notes for possibly tackling the problem at source ==