Addressed issue with 3D var not being written first and longitude getting lost from the top of the file header