| 35 | * We can also store the layout for later use... (iE we could store a 512^3^ fixed grid run as a layout and then in another simulation load it in to a level 2 region) |
| 36 | |
| 37 | For example we could save the level 0 fixed grid 512^3^ as a layout inside of 1 simulation (during BeforeGlobalStep(0)) |
| 38 | {{{ |
| 39 | CALL CreateLayout(GmGlobal, layout) |
| 40 | layout%level = 0 |
| 41 | mB=layout%mB(MPI_ID,:,:) |
| 42 | ALLOCATE(data(mB(1,1):mB(1,2), mB(2,1):mB(2,2),mB(3,1):mB(3,2),4)) |
| 43 | CALL LoadFieldIntoLayout(layout, data, FieldID) |
| 44 | CALL StoreLayout(layout, data, 'ISO512') |
| 45 | }}} |
| 46 | |
| 47 | and then load it into another simulation where the base grid is 128, and the finest level 3 grid is 1024 cells across - and we want to load the data into the middle of the domain on level 3 |
| 48 | |
| 49 | {{{ |
| 50 | CALL CreateLayout(GmGlobal, layout) |
| 51 | CALL LoadLayout(layout, data, 'ISO512') |
| 52 | layout%level = 2 |
| 53 | layout%mB(:,1:nDim,:)=layout%mB(:,1:nDim,:)+256 !Shift everything by 256 level 3 cells = 1/4 of the grid |
| 54 | CALL UnloadFieldFromLayout(layout, data, FieldID, lHydroPeriodic, levels(n)%gmbc(1)) |
| 55 | CALL DestroyLayout(layout) |
| 56 | DEALLOCATE(data) |
| 57 | |
| 58 | |
| 59 | }}} |
| 60 | |