UPP (develop)
Loading...
Searching...
No Matches
native_endianness.f File Reference

This module, native_endianness, was written by Dusan Jovic and has been adapted to GSI for internal translation of WRF ARW and NMM binary restart files as required to match the machine native endian storage format. More...

Go to the source code of this file.

Functions/Subroutines

logical function, public native_endianness::is_little_endian ()
 

Variables

logical, public native_endianness::byte_swap
 false if machine and wrf binary file are same endian, true if different
 

Detailed Description

This module, native_endianness, was written by Dusan Jovic and has been adapted to GSI for internal translation of WRF ARW and NMM binary restart files as required to match the machine native endian storage format.

The original code only converted from big-endian to little-endian. There are no restrictions in this version. This is required for these two types of files, because they are read/written to using mpi-io, which has no compiler option for automatic switching to machine native endian format for fortran unformatted read/write.

Author
Parrish wx22
Date
2012-10-11
Note
functions included: is_little_endian - no argument–returns true for little-endian machine, false for big-endian machine
variables included: byte_swap - false if machine and wrf binary file are same endian, true if different

Program History Log

Date Programmer Comments
2012-10-11 Parrish Initial. Copy/modify original module native_endianness provided by Dusan Jovic, NCEP/EMC 2012
2012-10-19 parrish Additional modifications to improve efficiency. Remove interface and make to_native_endianness to work only with integer(4) arguments. Put to_native_endianness_i4 outside module.
Author
Parrish wx22
Date
2012-10-11

Definition in file native_endianness.f.

Function/Subroutine Documentation

◆ is_little_endian()

logical function, public native_endianness::is_little_endian

is_little_endian() tests to see if machine is little-endian. Returns true for little-endian, false for big-endian.

Returns
is_little_endian logical Returns true or false

Program History Log

Date Programmer Comments
2012-10-11 Parrish Add doc block
Author
Parrish wx22
Date
2012-10-11

Definition at line 39 of file native_endianness.f.

Variable Documentation

◆ byte_swap

logical, public native_endianness::byte_swap

false if machine and wrf binary file are same endian, true if different

Definition at line 35 of file native_endianness.f.