dm_swap Interface

public interface dm_swap

Subroutines to reverse the byte order of integer and real variables. This is useful when reading binary data from a file intended for use on a compute whose byte order is opposite that of the computer on which the Fortran program is to be run.

Adopted from Fortran 90 routines written by David G. Simpson, NASA Goddard Space Flight Center (https://caps.gsfc.nasa.gov/simpson/).

Calls

interface~~dm_swap~~CallsGraph interface~dm_swap dm_swap proc~dm_swap_int16 dm_swap_int16 interface~dm_swap->proc~dm_swap_int16 proc~dm_swap_int32 dm_swap_int32 interface~dm_swap->proc~dm_swap_int32 proc~dm_swap_int64 dm_swap_int64 interface~dm_swap->proc~dm_swap_int64 proc~dm_swap_real32 dm_swap_real32 interface~dm_swap->proc~dm_swap_real32 proc~dm_swap_real64 dm_swap_real64 interface~dm_swap->proc~dm_swap_real64

Module Procedures

public pure elemental subroutine dm_swap_int16(n)

Swaps bytes for a 2-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i2), intent(inout) :: n

public pure elemental subroutine dm_swap_int32(n)

Swaps bytes for a 4-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(inout) :: n

public pure elemental subroutine dm_swap_int64(n)

Swaps bytes for a 8-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(inout) :: n

public pure elemental subroutine dm_swap_real32(f)

Swaps bytes for a 4-byte real.

Arguments

Type IntentOptional Attributes Name
real(kind=r4), intent(inout) :: f

public pure elemental subroutine dm_swap_real64(f)

Swaps bytes for an 8-byte real.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(inout) :: f