Move calculation of physical quantities to subroutines in save_fields.f90.