Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f2ser: remove confusing log messages #360

Open
ChristopherBignamini opened this issue Jan 24, 2024 · 0 comments
Open

f2ser: remove confusing log messages #360

ChristopherBignamini opened this issue Jan 24, 2024 · 0 comments
Assignees

Comments

@ChristopherBignamini
Copy link
Contributor

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

@ChristopherBignamini ChristopherBignamini changed the title Remove confusing log message when serialization is off Remove confusing log messages Jan 24, 2024
@ChristopherBignamini ChristopherBignamini self-assigned this Jan 24, 2024
@ChristopherBignamini ChristopherBignamini changed the title Remove confusing log messages f2ser: remove confusing log messages Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant