Skip to content

f2ser: remove confusing log messages  #360

@ChristopherBignamini

Description

@ChristopherBignamini

In case of array data, we currently check the variable size to decide if add pre-serialization directives to the code as in the following example:

    PRINT *, 'Serializing dz=dz(:,:)'                                 
                                                                      
    IF (SIZE(dz) > 0) THEN                                            
       !$ser data dz=dz(:,:)                                          
    ELSE                                                              
       PRINT *, 'Warning: Array dz has size 0. Not serializing array.'
    END IF                                                            

After running pp_ser.py we get the following code:


    PRINT *, 'Serializing dz=dz(:,:)'                                                        
                                                                                             
    IF (SIZE(dz) > 0) THEN                                                                   
#ifdef SERIALIZE                                                                             
! file: mo_aes_graupel_new.f90_f2ser lineno: #202                                            
SELECT CASE ( ppser_get_mode() )                                                             
  CASE(0)                                                                                    
    call fs_write_field(ppser_serializer, ppser_savepoint, 'dz', dz(:,:))                    
  CASE(1)                                                                                    
    call fs_read_field(ppser_serializer_ref, ppser_savepoint, 'dz', dz(:,:))                 
  CASE(2)                                                                                    
    call fs_read_field(ppser_serializer_ref, ppser_savepoint, 'dz', dz(:,:), ppser_zrperturb)
END SELECT                                                                                   
#endif                                                                                       
    ELSE                                                                                     
       PRINT *, 'Warning: Array dz has size 0. Not serializing array.'                       
    END IF                                                                                   

When SERIALIZE is not defined, we get the confusing log message 'Warning: Array dz has size 0. Not serializing array.'

Moreover, the

PRINT *, 'Serializing dz=dz(:,:)'"

message should be included in #ifdef SERIALIZE code blocks

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions