anchor.diff:  		call check( nf90_put_att(ncid,temp_id,"units","kg m-3"))
   		varid(21)=temp_id
   		
  -		call check( nf90_def_var(ncid, "clt", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","cloud_area_fraction"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Fractional cloud cover"))
  -		call check( nf90_put_att(ncid,temp_id,"units","[0-1]"))
  -		varid(22)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "shs", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","sensible_heat_flux"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Sensible heat flux"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","up"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(23)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "hfls", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_upward_latent_heat_flux"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Latent Heat Flux"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","up"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(24)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "hfgs", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","upward_heat_flux_at_ground_level_in_soil"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Ground Heat Flux"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","up"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(25)=temp_id
  -		
  -		dimids(2)=soil_id
  -		call check( nf90_def_var(ncid, "soil_w", NF90_REAL, dimids, temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","soil_moisture_content"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Column Soil Moisture"))
  -		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  -		varid(26)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "soil_t", NF90_REAL, dimids, temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","soil_temperature"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Column Soil Temperature"))
  -		call check( nf90_put_att(ncid,temp_id,"units","K"))
  -		varid(27)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "ts", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_temperature"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Land surface skin temperature"))
  -		call check( nf90_put_att(ncid,temp_id,"units","K"))
  -		varid(28)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "rlus", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_upwelling_longwave_flux_in_air"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Longwave upward radiative energy flux from the surface"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","up"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(29)=temp_id
  -		
  -		call check( nf90_def_var(ncid, "snw", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_snow_amount"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Snow water equivalent"))
  -		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  -		varid(30)=temp_id
  +		! surface fluxes
  +		! these should only be output for radiation packages that compute them
  +		if (options%physics%radiation>=2) then
  +			call check( nf90_def_var(ncid, "rsds", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_shortwave_flux_in_air"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Shortwave downward radiation energy flux at the surface"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","down"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(18)=temp_id
   
  -		call check( nf90_def_var(ncid, "canwat", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","canopy_water_amount"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Canopy water content"))
  -		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  -		varid(31)=temp_id
  +			call check( nf90_def_var(ncid, "rlds", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_longwave_flux_in_air"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Longwave downward radiation energy flux at the surface"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","down"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(19)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "clt", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","cloud_area_fraction"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Fractional cloud cover"))
  +			call check( nf90_put_att(ncid,temp_id,"units","[0-1]"))
  +			varid(22)=temp_id
  +		endif
  +		! these should only be output for lsm packages that compute them
  +		if (options%physics%landsurface>=2) then
  +			call check( nf90_def_var(ncid, "shs", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","sensible_heat_flux"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Sensible heat flux"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","up"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(23)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "hfls", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_upward_latent_heat_flux"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Latent Heat Flux"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","up"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(24)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "hfgs", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","upward_heat_flux_at_ground_level_in_soil"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Ground Heat Flux"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","up"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(25)=temp_id
  +		
  +			dimids(2)=soil_id
  +			call check( nf90_def_var(ncid, "soil_w", NF90_REAL, dimids, temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","soil_moisture_content"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Column Soil Moisture"))
  +			call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  +			varid(26)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "soil_t", NF90_REAL, dimids, temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","soil_temperature"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Column Soil Temperature"))
  +			call check( nf90_put_att(ncid,temp_id,"units","K"))
  +			varid(27)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "ts", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_temperature"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Land surface skin temperature"))
  +			call check( nf90_put_att(ncid,temp_id,"units","K"))
  +			varid(28)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "rlus", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_upwelling_longwave_flux_in_air"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Longwave upward radiative energy flux from the surface"))
  +			call check( nf90_put_att(ncid,temp_id,"positive","up"))
  +			call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  +			varid(29)=temp_id
  +		
  +			call check( nf90_def_var(ncid, "snw", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","surface_snow_amount"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Snow water equivalent"))
  +			call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  +			varid(30)=temp_id
  +
  +			call check( nf90_def_var(ncid, "canwat", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","canopy_water_amount"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Canopy water content"))
  +			call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  +			varid(31)=temp_id
  +		endif
   
   		
   		! End define mode. This tells netCDF we are done defining metadata.
  
positive.code: 		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  		varid(16)=temp_id
  		
  		call check( nf90_def_var(ncid, "crain", NF90_REAL, dimids(1:3:2), temp_id) )
  		call check( nf90_put_att(ncid,temp_id,"standard_name","convective_rainfall_amount"))
  		call check( nf90_put_att(ncid,temp_id,"long_name","Convective rain (accumulated)"))
  		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  		varid(17)=temp_id
  		
  		! surface fluxes
  		call check( nf90_def_var(ncid, "rsds", NF90_REAL, dimids(1:3:2), temp_id) )
  		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_shortwave_flux_in_air"))
  		call check( nf90_put_att(ncid,temp_id,"long_name","Shortwave downward radiation energy flux at the surface"))
  		call check( nf90_put_att(ncid,temp_id,"positive","down"))
  		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  		varid(18)=temp_id
  
  		call check( nf90_def_var(ncid, "rlds", NF90_REAL, dimids(1:3:2), temp_id) )
  		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_longwave_flux_in_air"))
  		call check( nf90_put_att(ncid,temp_id,"long_name","Longwave downward radiation energy flux at the surface"))
  		call check( nf90_put_att(ncid,temp_id,"positive","down"))
  		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  		varid(19)=temp_id
  		
  		call check( nf90_def_var(ncid, "z",  NF90_REAL, dimids, temp_id) )
  		call check( nf90_put_att(ncid,temp_id,"standard_name","height"))
  
negative.code: 		call check( nf90_put_att(ncid,temp_id,"units","kg kg-1"))
  		varid(5)=temp_id
  		
  		! these should only be output for thompson microphysics
  		if (options%physics%microphysics==1) then
  			call check( nf90_def_var(ncid, "qg", NF90_REAL, dimids, temp_id) )
  			call check( nf90_put_att(ncid,temp_id,"standard_name","mass_fraction_of_graupel_in_air"))
  			call check( nf90_put_att(ncid,temp_id,"long_name","Graupel ice content"))
  			call check( nf90_put_att(ncid,temp_id,"WARNING","Could be mixing ratio, not mass fraction w/thompson scheme"))
  			call check( nf90_put_att(ncid,temp_id,"units","kg kg-1"))
  			varid(6)=temp_id
  		
  			call check( nf90_def_var(ncid, "nr", NF90_REAL, dimids, temp_id) )
  			call check( nf90_put_att(ncid,temp_id,"standard_name","number_concentration_of_rain_particles_in_air"))
  			call check( nf90_put_att(ncid,temp_id,"long_name","Rain number concentration"))
  			call check( nf90_put_att(ncid,temp_id,"units","cm-3"))
  			varid(7)=temp_id
  		
  			call check( nf90_def_var(ncid, "ni", NF90_REAL, dimids, temp_id) )
  			call check( nf90_put_att(ncid,temp_id,"standard_name","number_concentration_of_ice_crystals_in_air"))
  			call check( nf90_put_att(ncid,temp_id,"long_name","Cloud ice number concentration"))
  			call check( nf90_put_att(ncid,temp_id,"units","cm-3"))
  			varid(8)=temp_id
  		endif
  		
  		dimids(1)=xu_id
  		call check( nf90_def_var(ncid, "u",  NF90_REAL, dimids, temp_id) )
  