Skip to content

Commit

Permalink
Merge branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git into
Browse files Browse the repository at this point in the history
ftg-zerosize

Conflicts:
	src/serialbox-fortran/m_ser_ftg.f90
  • Loading branch information
Christian Hovy committed Mar 21, 2018
2 parents 8e9ae96 + ad0b774 commit c3da0ff
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions src/serialbox-fortran/m_ser_ftg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,10 @@ SUBROUTINE ftg_write_logical_0d(fieldname, field)
IF (.NOT. bullshit) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:loc', TRIM(ADJUSTL(ftg_loc_hex(C_LOC(field)))))
END IF

Expand All @@ -562,7 +565,10 @@ SUBROUTINE ftg_write_logical_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -594,7 +600,10 @@ SUBROUTINE ftg_write_logical_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -628,7 +637,10 @@ SUBROUTINE ftg_write_logical_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -662,7 +674,10 @@ SUBROUTINE ftg_write_logical_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -690,7 +705,10 @@ SUBROUTINE ftg_write_bool_0d(fieldname, field)
IF (.NOT. bullshit) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:loc', TRIM(ADJUSTL(ftg_loc_hex(C_LOC(field)))))
END IF

Expand All @@ -717,7 +735,10 @@ SUBROUTINE ftg_write_bool_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -749,7 +770,10 @@ SUBROUTINE ftg_write_bool_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -782,7 +806,10 @@ SUBROUTINE ftg_write_bool_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -816,7 +843,10 @@ SUBROUTINE ftg_write_bool_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'bool', fs_boolsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -844,7 +874,10 @@ SUBROUTINE ftg_write_int_0d(fieldname, field)
IF (.NOT. bullshit) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:loc', TRIM(ADJUSTL(ftg_loc_hex(C_LOC(field)))))
END IF

Expand All @@ -871,7 +904,10 @@ SUBROUTINE ftg_write_int_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'int', fs_intsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -903,7 +939,10 @@ SUBROUTINE ftg_write_int_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'int', fs_intsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -936,7 +975,10 @@ SUBROUTINE ftg_write_int_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'int', fs_intsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -970,7 +1012,10 @@ SUBROUTINE ftg_write_int_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'int', fs_intsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -998,7 +1043,10 @@ SUBROUTINE ftg_write_long_0d(fieldname, field)
IF (.NOT. bullshit) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:loc', TRIM(ADJUSTL(ftg_loc_hex(C_LOC(field)))))
END IF

Expand All @@ -1025,7 +1073,10 @@ SUBROUTINE ftg_write_long_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'long', fs_longsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1057,7 +1108,10 @@ SUBROUTINE ftg_write_long_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'long', fs_longsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1090,7 +1144,10 @@ SUBROUTINE ftg_write_long_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'long', fs_longsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1124,7 +1181,10 @@ SUBROUTINE ftg_write_long_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'long', fs_longsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1179,7 +1239,10 @@ SUBROUTINE ftg_write_float_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'float', fs_floatsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1211,7 +1274,10 @@ SUBROUTINE ftg_write_float_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'float', fs_floatsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1244,7 +1310,10 @@ SUBROUTINE ftg_write_float_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'float', fs_floatsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1278,7 +1347,10 @@ SUBROUTINE ftg_write_float_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'float', fs_floatsize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1306,7 +1378,10 @@ SUBROUTINE ftg_write_double_0d(fieldname, field)
IF (.NOT. bullshit) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:loc', TRIM(ADJUSTL(ftg_loc_hex(C_LOC(field)))))
END IF

Expand All @@ -1333,7 +1408,10 @@ SUBROUTINE ftg_write_double_1d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'double', fs_doublesize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1365,7 +1443,10 @@ SUBROUTINE ftg_write_double_2d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'double', fs_doublesize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1398,7 +1479,10 @@ SUBROUTINE ftg_write_double_3d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'double', fs_doublesize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1432,7 +1516,10 @@ SUBROUTINE ftg_write_double_4d(fieldname, field, lbounds, ubounds)
IF (SIZE(field) > 0) THEN
CALL fs_write_field(ftg_get_serializer(), ftg_get_savepoint(), fieldname, field, lbounds, ubounds)
serializer_has_written = .TRUE.
<<<<<<< HEAD
CALL fs_add_field_metainfo(serializer, TRIM(fieldname), 'ftg:registered_only', .FALSE.)
=======
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
ELSE
CALL ftg_register_only_internal(fieldname, 'double', fs_doublesize(), lbounds, ubounds)
END IF
Expand Down Expand Up @@ -1543,11 +1630,16 @@ SUBROUTINE ftg_read_bool_2d(fieldname, field)
LOGICAL(KIND=C_BOOL), INTENT(OUT), TARGET :: field(:,:)
LOGICAL :: registered_only

<<<<<<< HEAD
IF (.NOT. ignore_not_existing .OR. ftg_field_exists(fieldname)) THEN
CALL fs_get_field_metainfo(serializer, fieldname, 'ftg:registered_only', registered_only)
IF (.NOT. registered_only) THEN
CALL fs_read_field(serializer, savepoint, fieldname, field)
END IF
=======
IF (.NOT. ignore_not_existing .OR. (ftg_field_exists(fieldname) .AND. fs_get_total_size(serializer, fieldname) > 0)) THEN
CALL fs_read_field(serializer, savepoint, fieldname, field)
>>>>>>> branch 'ftg-zerosize' of github-chovyy:chovyy/serialbox2.git
END IF
END SUBROUTINE ftg_read_bool_2d

Expand Down

0 comments on commit c3da0ff

Please sign in to comment.